commit 35ab5d0cb9c3aeadd1934b637ed714f4ebef7524 Author: Quixos Template Publisher Date: Sat Jan 1 00:00:00 2000 +0000 Export template source from 6e17e087ee180acb0c6a52cd53b3c60ffe967ac3:quixos-instance/packages/agent-workspace-bootstrap diff --git a/.quixos-template-source.json b/.quixos-template-source.json new file mode 100644 index 0000000..caff641 --- /dev/null +++ b/.quixos-template-source.json @@ -0,0 +1,4 @@ +{ + "monorepoCommit": "6e17e087ee180acb0c6a52cd53b3c60ffe967ac3", + "sourcePath": "quixos-instance/packages/agent-workspace-bootstrap" +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..8393c55 --- /dev/null +++ b/flake.lock @@ -0,0 +1,108 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "helpers": { + "flake": false, + "locked": { + "lastModified": 1791886789, + "narHash": "sha256-7YF98v0AcxD1qkAdS+nL/aDtmTvcRzld9CB9AxY0qaA=", + "ref": "refs/tags/quixos-reachability/5657043450c46fc84e1a6d38c2f8919ba1e9d10c", + "rev": "5657043450c46fc84e1a6d38c2f8919ba1e9d10c", + "revCount": 78, + "type": "git", + "url": "https://repos.quixos.org/quixos-toolchain/quixos-nix-helpers.git" + }, + "original": { + "ref": "refs/tags/quixos-reachability/5657043450c46fc84e1a6d38c2f8919ba1e9d10c", + "rev": "5657043450c46fc84e1a6d38c2f8919ba1e9d10c", + "type": "git", + "url": "https://repos.quixos.org/quixos-toolchain/quixos-nix-helpers.git" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1783776592, + "narHash": "sha256-UgCQzxeWI75XM8G+hPrPh+MKzEPjG3SpAj7dtqSbksA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e7a3ca8092b61ff85b6a45bf863ea2b2d6a661b3", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "protocol": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1792963716, + "narHash": "sha256-MESSLO46ZHYtxVhlNpQfpiHi/A6WJEYDnczr+I3Wfb8=", + "ref": "refs/tags/quixos-reachability/d829d584af91326aacb8997459014c49def2f66e", + "rev": "d829d584af91326aacb8997459014c49def2f66e", + "revCount": 233, + "type": "git", + "url": "https://repos.quixos.org/quixos-toolchain/quixos-protocol.git" + }, + "original": { + "ref": "refs/tags/quixos-reachability/d829d584af91326aacb8997459014c49def2f66e", + "rev": "d829d584af91326aacb8997459014c49def2f66e", + "type": "git", + "url": "https://repos.quixos.org/quixos-toolchain/quixos-protocol.git" + } + }, + "root": { + "inputs": { + "flake-utils": [ + "protocol", + "flake-utils" + ], + "helpers": "helpers", + "nixpkgs": [ + "protocol", + "nixpkgs" + ], + "protocol": "protocol" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..efba642 --- /dev/null +++ b/flake.nix @@ -0,0 +1,37 @@ +{ + inputs.protocol.url = "git+https://repos.quixos.org/quixos-toolchain/quixos-protocol.git?ref=refs/tags/quixos-reachability/d829d584af91326aacb8997459014c49def2f66e&rev=d829d584af91326aacb8997459014c49def2f66e"; + inputs.nixpkgs.follows = "protocol/nixpkgs"; + inputs.flake-utils.follows = "protocol/flake-utils"; + inputs.helpers = { + url = "git+https://repos.quixos.org/quixos-toolchain/quixos-nix-helpers.git?ref=refs/tags/quixos-reachability/5657043450c46fc84e1a6d38c2f8919ba1e9d10c&rev=5657043450c46fc84e1a6d38c2f8919ba1e9d10c"; + flake = false; + }; + outputs = + { + nixpkgs, + flake-utils, + helpers, + ... + }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = import nixpkgs { inherit system; }; + camino = import (helpers + "/quixos-package-helpers.nix"); + in + { + quixosPackages.checkedArtifacts = + context: + let + pkgs = camino.packageSet { inherit nixpkgs system context; }; + in + camino.mkCaminoTypeScriptPackage { + inherit pkgs context; + src = ./.; + targets = [ "server" ]; + entry = "src/server.ts"; + }; + devShells.default = camino.mkCaminoYarnShell { inherit pkgs; }; + } + ); +} diff --git a/package.qx b/package.qx new file mode 100644 index 0000000..23d8f0c --- /dev/null +++ b/package.qx @@ -0,0 +1,12 @@ +symbol JavaScript id "target:org.quixos.execution.javascript@1"; +import interface WebStudioCanvas; +import interface WebStudioCanvasPlacement; +import interface WebStudioPlaceable; +import interface AgentWorkspace; +external atom WebStudioCanvas id "atom:org.quixos.web-studio:canvas"; +package AgentWorkspaceBootstrap id "package:org.quixos.agent:workspace-bootstrap" revision "package:org.quixos.agent:workspace-bootstrap@1" { + function createRoot id "agent:workspace:create-root" : unit -> atom-ref execution transaction targets [server] requires { + creation canvas id "canvas" : WebStudioCanvas input record {name:string;}; + interface agentWorkspace id "agent-workspace" : AgentWorkspace using [install.call] from input; + }; +} diff --git a/quixos.lock b/quixos.lock new file mode 100644 index 0000000..d3f2d7d --- /dev/null +++ b/quixos.lock @@ -0,0 +1,7 @@ +quixos-lock version 1 { + quixos source { repository "https://gitea.internal.quixos.org/quixos/quixos.git"; commit "6e17e087ee180acb0c6a52cd53b3c60ffe967ac3"; } + interface WebStudioCanvas source { repository "https://repos.quixos.org/quixos-studio/interface-web-studio-canvas.git"; commit "fb076e2d0d48080f76b88b2ffa4edeb4c37a7342"; } + interface WebStudioCanvasPlacement source { repository "https://repos.quixos.org/quixos-studio/interface-web-studio-canvas-placement.git"; commit "8bee874e37700fc860f066f11946efc82a1f521d"; } + interface WebStudioPlaceable source { repository "https://repos.quixos.org/quixos-studio/interface-web-studio-placeable.git"; commit "a998ebd982f7b61946156a0fa7038bc1295c3afc"; } + interface AgentWorkspace source { repository "https://repos.quixos.org/quixos-studio/interface-agent-workspace.git"; commit "6b6fca52d9d9f22dbc8af6b9d59577809f5eeea5"; } +} diff --git a/src/server.ts b/src/server.ts new file mode 100644 index 0000000..ace006d --- /dev/null +++ b/src/server.ts @@ -0,0 +1,48 @@ +import { createRegistry } from "./gen/qx.js"; + +// These instructions are part of the checked workspace source, then captured +// with every request. Mechanical tool instructions are supplied by the host. +export const workspaceInstructions = `You are the Workspace Agent for this Quixos workspace. +Help the user understand and operate its graph, and make requested software changes. +Use qx-workspace graph and agent commands for checked graph operations. Inspect the +installed public contracts before calling them. Use qx-workspace eval for small +calculations and ad hoc queries; creating a package is unnecessary for these. +Workspace source is a resource workbench: root/ contains the workspace assembly +and resources/ contains independently pinned interfaces and packages. Read the +workspace's AGENTS.md and the short qx-workspace guides before source changes. +Make changes in the workbench, verify affected packages with qx-workspace check, +and activate a checked candidate with qx-workspace activate. A failed candidate +must leave the previous selection intact. Use qx-workspace for source publishing +and cutover. Collaborate with concurrent authors and preserve unrelated changes. +Describe the outcome clearly, including validation and any unresolved failures. +Use graph-backed status, questions and presentations when they help the user. +When creating UI, use direct, specific product copy. Labels should name actions, +content, and settings. Avoid slogans, inspirational filler, faux section branding, +decorative all-caps headings, and canned AI disclaimers. Empty states should explain +what to do next. Include a concise caveat only when it helps a real user decision. +Some requests only need tool actions; do not invent a prose result or a code change.`; + +export const registry = createRegistry({ + createRoot: async ({ ports }) => { + const canvas = await ports.canvas.create({ name: "Workspace" }, { key: "canvas" }); + await ports.agentWorkspace["install.call"]( + { + receiver: { ...canvas, expectation: { kind: "interface", id: "interface:org.quixos.agent:workspace@1" } }, + input: { + instructions: workspaceInstructions, + settings: JSON.stringify({ + profile: "balanced", + response: { kind: "text" }, + capabilities: ["web-search", "graph-read", "graph-write", "source-read", "source-write", "eval"], + interactive: true, + notifications: false, + retry: "never", + limits: { activeMs: 1800000 }, + }), + }, + }, + { key: "agents" }, + ); + return canvas; + }, +}); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..e0d52df --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "strict": true, + "target": "ES2024", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "noEmit": true + }, + "include": ["src/**/*.ts"] +}