@ouro.bot/cli 0.1.0-alpha.1556 → 0.1.0-alpha.1557
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.json +6 -0
- package/deploy/unraid/sanctuary.ouro/bundle-meta.json +1 -1
- package/deploy/unraid/sanctuary.xml +1 -1
- package/desk.lock.json +3 -3
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/vendor/desk/.claude-plugin/plugin.json +1 -1
- package/vendor/desk/.ouro-desk.json +3 -3
- package/vendor/desk/CHANGELOG.md +600 -0
- package/vendor/desk/activation/copilot-root.flattened-bundle.json +2 -2
- package/vendor/desk/activation/desk.activation.json +5 -5
- package/vendor/desk/agency.json +1 -1
- package/vendor/desk/docs/sessions.md +1 -1
- package/vendor/desk/hooks/lib/boot-checks.cjs +1 -1
- package/vendor/desk/hooks/lib/child-agent.cjs +2 -2
- package/vendor/desk/hooks/lib/factory-end.cjs +4 -1
- package/vendor/desk/mcp/README.md +6 -0
- package/vendor/desk/mcp/bootstrap.cjs +64 -38
- package/vendor/desk/mcp/idle-proxy.cjs +14 -6
- package/vendor/desk/mcp/scripts/crew.js +3 -3
- package/vendor/desk/mcp/scripts/drains-launcher.mjs +6 -5
- package/vendor/desk/mcp/scripts/factory.js +15 -6
- package/vendor/desk/mcp/scripts/resolve-desk-root.js +1 -2
- package/vendor/desk/mcp/src/actions/desk-session.actions.mts +16 -1
- package/vendor/desk/mcp/src/actions/desk.actions.mts +2 -2
- package/vendor/desk/mcp/src/actions/generated/desk/actions.json +36 -1
- package/vendor/desk/mcp/src/actions/generated/desk/mcp.json +34 -1
- package/vendor/desk/mcp/src/activation/superpowers-context.js +9 -0
- package/vendor/desk/mcp/src/crew/workspace.js +30 -4
- package/vendor/desk/mcp/src/desk/card-commit-guard.js +3 -2
- package/vendor/desk/mcp/src/desk/content-home.js +16 -0
- package/vendor/desk/mcp/src/indexer/discover.js +8 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/ax-claims.ts +2 -1
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/ax-command.ts +20 -0
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/mcp.ts +1 -1
- package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/xray.ts +40 -2
- package/vendor/desk/mcp/src/runtime/boot.js +0 -1
- package/vendor/desk/mcp/src/runtime/deliver.js +42 -5
- package/vendor/desk/mcp/src/runtime/drains-cli.js +9 -1
- package/vendor/desk/mcp/src/runtime/drains.js +7 -4
- package/vendor/desk/mcp/src/runtime/hosted.js +5 -3
- package/vendor/desk/mcp/src/runtime/pending-migrations.js +5 -1
- package/vendor/desk/mcp/src/runtime/pr-publication.js +55 -29
- package/vendor/desk/mcp/src/runtime/relays.js +10 -1
- package/vendor/desk/mcp/src/runtime/remote-identity.js +22 -0
- package/vendor/desk/mcp/src/runtime/sessions-cli.js +6 -6
- package/vendor/desk/mcp/src/runtime/sync-worker.js +10 -8
- package/vendor/desk/mcp/src/runtime/unmerged-saves.js +29 -3
- package/vendor/desk/mcp/src/server.js +3 -2
- package/vendor/desk/mcp/src/tool-names.js +0 -2
- package/vendor/desk/mcp/src/tool-schemas.js +3 -8
- package/vendor/desk/mcp/src/tools/archive-links.js +3 -0
- package/vendor/desk/mcp/src/tools/desk-save.js +8 -3
- package/vendor/desk/mcp/src/tools/move.js +32 -3
- package/vendor/desk/mcp/src/tools/sibling-desk.js +10 -4
- package/vendor/desk/mcp/src/tools/status.js +9 -6
- package/vendor/desk/mcp/src/tools/task-log.js +6 -2
- package/vendor/desk/mcp/src/tools/task.js +17 -5
- package/vendor/desk/mcp/src/util/citations.js +54 -0
- package/vendor/desk/mcp/web-auth.cjs +17 -0
- package/vendor/desk/mcp/web-sso.cjs +52 -0
- package/vendor/desk/plugin.json +2 -2
- package/vendor/desk/skills/add-workspace-mcp/SKILL.md +2 -2
- package/vendor/desk/skills/archive-workflow/SKILL.md +1 -1
- package/vendor/desk/skills/coordinating-lanes/SKILL.md +24 -0
- package/vendor/desk/skills/evidence-discipline/SKILL.md +8 -12
- package/vendor/desk/skills/git-hygiene/SKILL.md +6 -0
- package/vendor/desk/skills/interaction-style/SKILL.md +4 -2
- package/vendor/desk/skills/live-ui-iteration/SKILL.md +35 -0
- package/vendor/desk/skills/operator-voice-comments/SKILL.md +4 -0
- package/vendor/desk/skills/outside-approval/SKILL.md +10 -0
- package/vendor/desk/skills/pr-feedback-on-own-pr/SKILL.md +5 -1
- package/vendor/desk/skills/pr-reviewer-audit/SKILL.md +1 -1
- package/vendor/desk/skills/pr-reviewer-audit/helpers/audit.py +19 -1
- package/vendor/desk/skills/pr-reviewer-audit/helpers/test_audit.py +37 -1
- package/vendor/desk/skills/pr-self-review/SKILL.md +1 -1
- package/vendor/desk/skills/pr-surface-hygiene/SKILL.md +28 -4
- package/vendor/desk/skills/pr-surface-hygiene/check-visual-proof.cjs +27 -14
- package/vendor/desk/skills/prior-art/SKILL.md +14 -0
- package/vendor/desk/skills/runtime-symptom-investigation/SKILL.md +5 -1
- package/vendor/desk/skills/session-resumption/SKILL.md +3 -1
- package/vendor/desk/skills/using-desk/SKILL.md +3 -3
- package/vendor/desk/skills/using-superpowers-with-desk/SKILL.md +2 -0
- package/vendor/desk/skills/visual-proof/SKILL.md +42 -0
- package/vendor/desk/skills/work-orchestration/SKILL.md +17 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Sessions on this machine
|
|
2
2
|
|
|
3
|
-
Agents often need to know what another session on the same machine last said, or to message it. [`sessions.js`](../mcp/scripts/sessions.js) does both, and finds out which session you are. It covers this machine only; to reach a session on another
|
|
3
|
+
Agents often need to know what another session on the same machine last said, or to message it. [`sessions.js`](../mcp/scripts/sessions.js) does both, and finds out which session you are. It covers this machine only; to reach a session on another of the operator's machines, run the same command there over SSH on their tailnet (`ssh <host> node <desk>/plugins/desk/mcp/scripts/sessions.js tail <session>`), not through Agency Hub. The logic is in [sessions-cli.js](../mcp/src/runtime/sessions-cli.js).
|
|
4
4
|
|
|
5
5
|
```sh
|
|
6
6
|
node <desk>/plugins/desk/mcp/scripts/sessions.js whoami [--hint <text from your own command>]
|
|
@@ -630,7 +630,7 @@ function main(argv = process.argv.slice(2)) {
|
|
|
630
630
|
}))
|
|
631
631
|
: Promise.reject(new Error("usage: boot-checks.cjs --compatible <script> [args] | --fast-forward <desk> | --repair <desk> | --ack <desk> <id> <digest> <canonical-evidence> | --revoke <common-git-dir> <worktree> <branch-ref> <owner>"));
|
|
632
632
|
run.then((result) => process.stdout.write(`${JSON.stringify(result)}\n`)).catch((error) => {
|
|
633
|
-
process.stderr.write(`
|
|
633
|
+
process.stderr.write(`boot-checks: ${oneLine(error.message)}\n`);
|
|
634
634
|
process.exitCode = 1;
|
|
635
635
|
});
|
|
636
636
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
// Plain Language loads on demand, and agents do not load it unprompted (0 of 8 haiku runs did), so every start points at it.
|
|
4
|
-
const PLAIN_LANGUAGE_POINTER = "Before you write
|
|
4
|
+
const PLAIN_LANGUAGE_POINTER = "Before you write for others, load the `plain-language` skill and follow it. Skills and briefs carry no disclaimer, copyright or read-the-original line unless required.";
|
|
5
5
|
|
|
6
6
|
// What a child agent (a subagent) gets in place of the boot: its brief is its instruction, so Desk's startup does not apply to it.
|
|
7
|
-
const CHILD_AGENT_LINE = "Desk: you are a child agent, so follow your brief and skip Desk's startup. Desk's tools are named `desk-<name>`. Before you write anything a person will read, load the `plain-language` skill.";
|
|
7
|
+
const CHILD_AGENT_LINE = "Desk: you are a child agent, so follow your brief and skip Desk's startup. Desk's tools are named `desk-<name>`. Before you write anything a person or agent will read (a skill, document, prompt or brief included), load the `plain-language` skill. Skills and briefs carry no disclaimer, copyright or read-the-original line unless required.";
|
|
8
8
|
|
|
9
9
|
// Copilot's prompt hooks name the agent running the prompt: a subagent's input carries `agentId` and `parentAgentId`, a main session's carries neither.
|
|
10
10
|
function isChildAgentInput(input) {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
// The stable code printed when the background worker cannot run.
|
|
4
|
+
const WORKER_UNAVAILABLE = "hook_worker_unavailable";
|
|
5
|
+
|
|
3
6
|
const fs = require("node:fs");
|
|
4
7
|
const os = require("node:os");
|
|
5
8
|
const path = require("node:path");
|
|
@@ -292,7 +295,7 @@ async function runBoundedHook(host, input, entry, { deadlineMs = DEADLINE_MS, st
|
|
|
292
295
|
} catch { /* Accounting produces no stdout when no correction is due. */ }
|
|
293
296
|
} else {
|
|
294
297
|
const why = timedOut ? "deadline" : spawnError ? `spawn ${spawnError.code ?? "error"}` : signal ? `signal ${signal}` : `exit ${code}`;
|
|
295
|
-
stderr.write(`[desk-delivery] unverified:
|
|
298
|
+
stderr.write(`[desk-delivery] unverified: ${WORKER_UNAVAILABLE} (${why})\n`);
|
|
296
299
|
}
|
|
297
300
|
resolve();
|
|
298
301
|
};
|
|
@@ -244,6 +244,12 @@ The plugin's `artifacts/tombstones/tombstones.jsonl` lists documents, by path an
|
|
|
244
244
|
|
|
245
245
|
## Tests
|
|
246
246
|
|
|
247
|
+
Publishing a workspace candidate does not close other `desk/publish/*` pull requests or delete their branches. Independent Desk roots may publish unrelated changes. Recorded-save settlement closes duplicates only after verifying their content on actual upstream, and records the evidence while clearing the local waiting receipt.
|
|
248
|
+
|
|
249
|
+
Workspace PR publication reads `.desk/publication.json` from the published target and waits for its required checks, the base branch's required checks, and every other reported check on the exact candidate head. Only then does it attach the merge relay's label and request an exact-head merge. It does not call `gh pr merge --auto`: that command can merge immediately when GitHub's own checks do not enforce the published policy.
|
|
250
|
+
|
|
251
|
+
Checks that outlast the qualification timeout remain recorded and unlabelled. The background push worker retries pending-check qualification beyond its network retry budget; failed checks, unreadable policy/rules, authentication failures and changed or closed PRs still stop with the recorded diagnostic. A relay that merges the qualified PR concurrently is accepted only after rereading its exact identity and proving the candidate is on the actual upstream.
|
|
252
|
+
|
|
247
253
|
```sh
|
|
248
254
|
npm test
|
|
249
255
|
```
|
|
@@ -524,56 +524,79 @@ function serveDegraded(options) {
|
|
|
524
524
|
|
|
525
525
|
// A host installs one copy of Desk per session, as <sessions>/<session>/<root-N>/desk, and keeps a session's server for days. When the idle proxy has to start a new server it can start the newest installed copy's index.js instead of the copy it was launched from, so every idle session moves to the current Desk on its next message.
|
|
526
526
|
// A copy is chosen only when it is newer, is the same Desk (plugin name and repository), declares the same mcp/package.json `toolProtocol` (the tools the host already listed all still exist with the same inputs; bump it in the same change that removes or breaks a tool), and its engines and runtime pack accept this Node. Anything else, or any read that fails, keeps the copy the proxy was started from.
|
|
527
|
-
// options: { mcpRoot, current: { version, abi }, platform, arch, scanRoot (the folder of session folders; default: the one this copy sits in, when it sits in that layout) }
|
|
527
|
+
// options: { mcpRoot, current: { version, abi }, platform, arch, scanRoot (the folder of session folders; default: the one this copy sits in, when it sits in that layout), own (what readOwn returned when this process started) }
|
|
528
|
+
// A copy that sits in a folder named for its version (the Claude Code plugin cache: <plugin>/<version>) also looks at its sibling version folders.
|
|
529
|
+
// When this copy's own folder has been removed (a host pruned the version a live session runs from), `own` stands in for its manifests and any installed copy of the same Desk that fits this Node is chosen, newest first.
|
|
528
530
|
// Returns { indexFile, pluginRoot, version } of the copy to run, or null to keep this one.
|
|
531
|
+
function readOwn(mcpRoot, platform, arch) {
|
|
532
|
+
var plugin = readJson(path.join(path.dirname(mcpRoot), "plugin.json"));
|
|
533
|
+
var pkg = readJson(path.join(mcpRoot, "package.json"));
|
|
534
|
+
if (!plugin || !pkg) return null;
|
|
535
|
+
return { plugin: plugin, package: pkg, abis: packAbis(mcpRoot, pkg.version, platform, arch) };
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
var VERSION_FOLDER = /^\d+\.\d+\.\d+/;
|
|
539
|
+
|
|
529
540
|
function newestDesk(options) {
|
|
530
541
|
var mcpRoot = options.mcpRoot;
|
|
531
|
-
var
|
|
532
|
-
var
|
|
533
|
-
|
|
534
|
-
var
|
|
542
|
+
var live = readOwn(mcpRoot, options.platform, options.arch);
|
|
543
|
+
var own = live || options.own || null;
|
|
544
|
+
if (!own) return null;
|
|
545
|
+
var ownPlugin = own.plugin;
|
|
546
|
+
var ownPackage = own.package;
|
|
547
|
+
var ownVersion = parseVersion(ownPlugin.version);
|
|
548
|
+
var protocol = ownPackage.toolProtocol;
|
|
535
549
|
if (!ownVersion || typeof protocol !== "number") return null;
|
|
550
|
+
var ownRoot = path.resolve(mcpRoot, "..");
|
|
551
|
+
var folders = [];
|
|
536
552
|
var scanRoot = options.scanRoot;
|
|
537
553
|
if (!scanRoot) {
|
|
538
554
|
var layout = path.resolve(mcpRoot, "..", "..", "..", "..");
|
|
539
555
|
var shape = /^root-\d+$/.test(path.basename(path.resolve(mcpRoot, "..", ".."))) && path.basename(layout) === "sessions";
|
|
540
|
-
if (
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
} catch (error) {
|
|
547
|
-
return null;
|
|
556
|
+
if (shape) scanRoot = layout;
|
|
557
|
+
else if (VERSION_FOLDER.test(path.basename(ownRoot))) {
|
|
558
|
+
listDir(path.dirname(ownRoot)).forEach(function (name) {
|
|
559
|
+
if (VERSION_FOLDER.test(name)) folders.push(path.join(path.dirname(ownRoot), name));
|
|
560
|
+
});
|
|
561
|
+
} else return null;
|
|
548
562
|
}
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
var bestVersion = ownVersion;
|
|
552
|
-
sessions.forEach(function (session) {
|
|
553
|
-
var roots;
|
|
563
|
+
if (scanRoot) {
|
|
564
|
+
var sessions;
|
|
554
565
|
try {
|
|
555
|
-
|
|
566
|
+
sessions = fs.readdirSync(scanRoot);
|
|
556
567
|
} catch (error) {
|
|
557
|
-
return;
|
|
568
|
+
return null;
|
|
558
569
|
}
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
var engines = either(pkg.engines, {});
|
|
570
|
-
if (typeof engines.node === "string" && !satisfies(options.current.version, engines.node)) return;
|
|
571
|
-
var abis = packAbis(candidateMcp, pkg.version, options.platform, options.arch);
|
|
572
|
-
// A copy that ships a runtime pack must ship one for this Node's ABI when this copy does.
|
|
573
|
-
if (ownAbis.indexOf(String(options.current.abi)) !== -1 && abis.indexOf(String(options.current.abi)) === -1) return;
|
|
574
|
-
best = { indexFile: path.join(candidateMcp, "index.js"), pluginRoot: pluginRoot, version: plugin.version };
|
|
575
|
-
bestVersion = version;
|
|
570
|
+
sessions.forEach(function (session) {
|
|
571
|
+
var roots;
|
|
572
|
+
try {
|
|
573
|
+
roots = fs.readdirSync(path.join(scanRoot, session));
|
|
574
|
+
} catch (error) {
|
|
575
|
+
return;
|
|
576
|
+
}
|
|
577
|
+
roots.forEach(function (root) {
|
|
578
|
+
if (/^root-\d+$/.test(root)) folders.push(path.join(scanRoot, session, root, "desk"));
|
|
579
|
+
});
|
|
576
580
|
});
|
|
581
|
+
}
|
|
582
|
+
var ownAbis = own.abis;
|
|
583
|
+
var best = null;
|
|
584
|
+
var bestVersion = live ? ownVersion : null;
|
|
585
|
+
folders.forEach(function (pluginRoot) {
|
|
586
|
+
var plugin = readJson(path.join(pluginRoot, "plugin.json"));
|
|
587
|
+
if (!plugin || plugin.name !== ownPlugin.name || plugin.repository !== ownPlugin.repository) return;
|
|
588
|
+
var version = parseVersion(plugin.version);
|
|
589
|
+
if (!version || (bestVersion !== null && compareVersions(version, bestVersion) <= 0)) return;
|
|
590
|
+
var candidateMcp = path.join(pluginRoot, "mcp");
|
|
591
|
+
var pkg = readJson(path.join(candidateMcp, "package.json"));
|
|
592
|
+
if (!pkg || pkg.toolProtocol !== protocol || !fs.existsSync(path.join(candidateMcp, "index.js"))) return;
|
|
593
|
+
var engines = either(pkg.engines, {});
|
|
594
|
+
if (typeof engines.node === "string" && !satisfies(options.current.version, engines.node)) return;
|
|
595
|
+
var abis = packAbis(candidateMcp, pkg.version, options.platform, options.arch);
|
|
596
|
+
// A copy that ships a runtime pack must ship one for this Node's ABI when this copy does.
|
|
597
|
+
if (ownAbis.indexOf(String(options.current.abi)) !== -1 && abis.indexOf(String(options.current.abi)) === -1) return;
|
|
598
|
+
best = { indexFile: path.join(candidateMcp, "index.js"), pluginRoot: pluginRoot, version: plugin.version };
|
|
599
|
+
bestVersion = version;
|
|
577
600
|
});
|
|
578
601
|
return best;
|
|
579
602
|
}
|
|
@@ -683,7 +706,9 @@ function start(o, stderr, serve) {
|
|
|
683
706
|
// A host keeps one server per session for days, so this process stays small: it starts the real server on demand and ends it when idle (idle-proxy.cjs). An injected importIndex, or DESK_MCP_IDLE_MS=0, runs index.js in this process instead.
|
|
684
707
|
var proxy = idleMs > 0 && o.importIndex === undefined;
|
|
685
708
|
if (proxy) {
|
|
686
|
-
|
|
709
|
+
// Read while this copy's folder is still there: a host may remove it later, and the copy that replaces it must be the same Desk.
|
|
710
|
+
var ownCopy = readOwn(mcpRoot, platform, either(o.arch, process.arch));
|
|
711
|
+
var proxied = idle.runIdleProxy({ node: current.path, indexFile: indexFile, chooseIndex: function () { return newestDesk({ mcpRoot: mcpRoot, current: current, platform: platform, arch: either(o.arch, process.arch), scanRoot: o.scanRoot, own: ownCopy }); }, exists: fs.existsSync, args: args, env: env, idleMs: idleMs, spawn: o.spawn, stdin: o.stdin, stdout: o.stdout, stderr: stderr, exit: o.exit, signals: o.signals, kill: o.kill, now: o.now, setTimer: o.setTimer, clearTimer: o.clearTimer });
|
|
687
712
|
if (proxied.error !== null) throw proxied.error;
|
|
688
713
|
return new Promise(function () {});
|
|
689
714
|
}
|
|
@@ -736,6 +761,7 @@ module.exports = {
|
|
|
736
761
|
candidatePaths: candidatePaths,
|
|
737
762
|
importIndex: importIndex,
|
|
738
763
|
newestDesk: newestDesk,
|
|
764
|
+
readOwn: readOwn,
|
|
739
765
|
installCommand: installCommand,
|
|
740
766
|
packedMajor: packedMajor,
|
|
741
767
|
packAbis: packAbis,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
//
|
|
3
3
|
// A Desk server holds about 200 MB once it has loaded its runtime, its tools and its search index, and a host keeps one per hosted session for days. This proxy is the process the host talks to: it holds none of that. It starts the real server (index.js) as a child, passes the MCP stream through line by line, and when nothing has crossed it for DESK_MCP_IDLE_MS (3 minutes by default) and no call is waiting for an answer, it ends the child, which gives all of that memory back. The next message from the host starts a new child first: the proxy replays the `initialize` handshake the host already sent (the child's answer to that replay is dropped, so the host never sees a second handshake) and then delivers the message.
|
|
4
4
|
//
|
|
5
|
-
// A new child runs the newest compatible installed Desk, not the copy this proxy was installed with (bootstrap.cjs newestDesk), so an idle session follows Desk releases without a restart.
|
|
5
|
+
// A new child runs the newest compatible installed Desk, not the copy this proxy was installed with (bootstrap.cjs newestDesk), so an idle session follows Desk releases without a restart, and a session whose copy a host removed keeps working on the next call.
|
|
6
6
|
//
|
|
7
7
|
// DESK_MCP_IDLE_MS=0 turns the release off: bootstrap.cjs then runs index.js in this process, as before.
|
|
8
8
|
//
|
|
@@ -306,12 +306,19 @@ function createIdleProxy(options) {
|
|
|
306
306
|
// A host that is gone cannot be answered: end like a closed stdin rather than keep a server alive with no client.
|
|
307
307
|
if (options.stdout.on) options.stdout.on("error", onClientEnd);
|
|
308
308
|
if (options.watchParent) options.watchParent(onClientEnd);
|
|
309
|
+
var signalHandlers = {};
|
|
309
310
|
FORWARDED_SIGNALS.forEach(function (signal) {
|
|
310
|
-
|
|
311
|
+
signalHandlers[signal] = function () {
|
|
311
312
|
signalled = true;
|
|
312
|
-
if (child !== null) child.kill(signal);
|
|
313
|
-
|
|
314
|
-
|
|
313
|
+
if (child !== null) return child.kill(signal);
|
|
314
|
+
// Stop listening first, so the re-raised signal takes its default action and ends the proxy instead of coming
|
|
315
|
+
// back to this listener, which would raise it again forever.
|
|
316
|
+
FORWARDED_SIGNALS.forEach(function (name) {
|
|
317
|
+
options.signals.removeListener(name, signalHandlers[name]);
|
|
318
|
+
});
|
|
319
|
+
options.kill(process.pid, signal);
|
|
320
|
+
};
|
|
321
|
+
options.signals.on(signal, signalHandlers[signal]);
|
|
315
322
|
});
|
|
316
323
|
options.stdin.resume();
|
|
317
324
|
return start();
|
|
@@ -393,7 +400,8 @@ function runIdleProxy(o) {
|
|
|
393
400
|
}
|
|
394
401
|
if (newest) {
|
|
395
402
|
var ownRoot = path.dirname(path.dirname(o.indexFile));
|
|
396
|
-
|
|
403
|
+
// A root the host set that no longer exists (a pruned version) is replaced too.
|
|
404
|
+
if (!childEnv.DESK_PLUGIN_ROOT || childEnv.DESK_PLUGIN_ROOT === ownRoot || !o.exists(childEnv.DESK_PLUGIN_ROOT)) childEnv.DESK_PLUGIN_ROOT = newest.pluginRoot;
|
|
397
405
|
indexFile = newest.indexFile;
|
|
398
406
|
pick("stderr").write("[desk-mcp] idle proxy: running Desk " + newest.version + " from " + newest.pluginRoot + "\n");
|
|
399
407
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// Without --apply, no member or shared files change; join may fetch missing Git history for its preview.
|
|
7
7
|
// `--repo` defaults to the current folder.
|
|
8
8
|
// `initiative` writes the working tree only; publish the result through the shared-path protocol.
|
|
9
|
-
// Exits 1 when the result is refused, failed, has layout problems or is not a Git clone, and 2 for a usage error (one line on stderr).
|
|
9
|
+
// Exits 1 when the result is refused, failed, has layout problems or the folder is not a Git clone or not a Crew workspace, and 2 for a usage error (one line on stderr).
|
|
10
10
|
|
|
11
11
|
import process from "node:process"
|
|
12
12
|
import { realpathSync } from "node:fs"
|
|
@@ -27,14 +27,14 @@ function founderOf(text) {
|
|
|
27
27
|
return at === -1 ? { alias: text, identity: "" } : { alias: text.slice(0, at), identity: text.slice(at + 1) }
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
const FAILED = new Set(["refused", "failed", "not_git", "problems"])
|
|
30
|
+
const FAILED = new Set(["refused", "failed", "not_git", "not_crew", "problems"])
|
|
31
31
|
|
|
32
32
|
function crewCli({ cwd, engine, script }) {
|
|
33
33
|
const command = (name, def, run) => defineCommand({ name, output: "one JSON value", text: (result) => JSON.stringify(result, null, 2), exit: (result) => (FAILED.has(result.state) ? "error" : "ok"), effect: "private", ...def, run })
|
|
34
34
|
const repoOf = (input) => input.repo ?? cwd
|
|
35
35
|
return defineCli({
|
|
36
36
|
name: "crew",
|
|
37
|
-
about: ["Crew workspace setup, one deterministic step at a time. Exits 1 when the result is refused, failed, has layout problems or is not a Git clone."],
|
|
37
|
+
about: ["Crew workspace setup, one deterministic step at a time. Exits 1 when the result is refused, failed, has layout problems, or the folder is not a Git clone or not a Crew workspace."],
|
|
38
38
|
groups: { initiative: "A shared initiative, written to the working tree only; publish the result through the shared-path protocol." },
|
|
39
39
|
commands: [
|
|
40
40
|
// status also says what a Desk session started in the clone binds (`session`), the check a join runs before it delivers.
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
// `releases/<commit>/`, never the checkout another runner may be updating. If GitHub cannot be reached the last published copy runs;
|
|
6
6
|
// with no copy yet, the newest `plugins/desk@release` entry in
|
|
7
7
|
// Agency's plugin cache (`~/.local/agency/plugins/cache/cache_index.json`) or the last path that worked runs. One line is logged
|
|
8
|
-
// to stderr and to resolve.log whenever the fetch or the cache resolution fails
|
|
8
|
+
// to stderr and to resolve.log whenever the fetch or the cache resolution fails, as `<time> <code>: <sentence>` with the code
|
|
9
|
+
// `fetch-failed` or `release-unresolved`; with nothing to run it then exits 1.
|
|
9
10
|
// This file must stay standalone: the installed copy has no neighbours to import.
|
|
10
11
|
import { spawnSync } from "node:child_process"
|
|
11
12
|
import { randomUUID } from "node:crypto"
|
|
@@ -288,8 +289,8 @@ function launchWithLease({ argv, env, home, spawn, git, stderr, execPath, now, d
|
|
|
288
289
|
const cache = env.AGENCY_PLUGIN_CACHE ?? path.join(home, ".local", "agency", "plugins", "cache")
|
|
289
290
|
const lastGood = path.join(dir, "last-good-script")
|
|
290
291
|
const own = path.join(dir, "desk-release")
|
|
291
|
-
const complain = (text) => {
|
|
292
|
-
const line = `${now().toISOString()} ${text}`
|
|
292
|
+
const complain = (code, text) => {
|
|
293
|
+
const line = `${now().toISOString()} ${code}: ${text}`
|
|
293
294
|
stderr.write(`${line}\n`)
|
|
294
295
|
mkdirSync(dir, { recursive: true })
|
|
295
296
|
appendFileSync(path.join(dir, "resolve.log"), `${line}\n`)
|
|
@@ -307,7 +308,7 @@ function launchWithLease({ argv, env, home, spawn, git, stderr, execPath, now, d
|
|
|
307
308
|
let script
|
|
308
309
|
if (copy && existsSync(copy.script)) {
|
|
309
310
|
script = copy.script
|
|
310
|
-
if (fetchError) complain(`could not fetch the released Desk (${fetchError}); using the copy from ${release.slice(0, 8)}`)
|
|
311
|
+
if (fetchError) complain("fetch-failed", `could not fetch the released Desk (${fetchError}); using the copy from ${release.slice(0, 8)}`)
|
|
311
312
|
} else {
|
|
312
313
|
release = null
|
|
313
314
|
try {
|
|
@@ -318,7 +319,7 @@ function launchWithLease({ argv, env, home, spawn, git, stderr, execPath, now, d
|
|
|
318
319
|
}
|
|
319
320
|
} catch (error) {
|
|
320
321
|
script = existsSync(lastGood) ? readFileSync(lastGood, "utf8").trim() : null
|
|
321
|
-
complain(`could not resolve the released Desk (${fetchError ? `${fetchError}; ` : ""}${error.message}); ${script ? `using the last good path ${script}` : "no last good path"}`)
|
|
322
|
+
complain("release-unresolved", `could not resolve the released Desk (${fetchError ? `${fetchError}; ` : ""}${error.message}); ${script ? `using the last good path ${script}` : "no last good path"}`)
|
|
322
323
|
if (!script || !existsSync(script)) return 1
|
|
323
324
|
}
|
|
324
325
|
}
|
|
@@ -461,7 +461,11 @@ export async function runJobLinkCommand({ store, "desk-remote": deskRemote, trac
|
|
|
461
461
|
slug = birth.slug
|
|
462
462
|
}
|
|
463
463
|
// A bad store fails with the usage error before any state is read.
|
|
464
|
-
|
|
464
|
+
try {
|
|
465
|
+
jobReportUrl({ store, job: "0".repeat(32) })
|
|
466
|
+
} catch (error) {
|
|
467
|
+
throw usageError("job-link", error.message, "factory job-link --store <owner/repo> ...")
|
|
468
|
+
}
|
|
465
469
|
const job = jobId({ deskRemote, personPrefix, track, slug })
|
|
466
470
|
const published = publishedJobId({ env, deskRemote, job })
|
|
467
471
|
if (thisMachine) return thisMachineLink({ env, store, job, published })
|
|
@@ -604,6 +608,11 @@ const JOB_FLAG = { type: "string", required: true, placeholder: "<job>", descrip
|
|
|
604
608
|
const ISSUE_FLAGS = { store: { type: "string", required: true, placeholder: "<directory>", description: "The checked-out store." }, repo: { type: "string", required: true, placeholder: "<owner/repo>", description: "The store's owner/repo." }, author: { type: "string", placeholder: "<login>", description: "The bot login whose comments are the build's own." } }
|
|
605
609
|
const text = (result) => JSON.stringify(result)
|
|
606
610
|
const exitFor = (ok) => (ok ? "ok" : "error")
|
|
611
|
+
// A result that did nothing because the machine has not opted in, or because another process holds the lock, is a refusal: exit 1 so a caller
|
|
612
|
+
// that checks the status can tell it from work done. A finalize result is refused when any of its jobs was.
|
|
613
|
+
const REFUSED_RESULTS = new Set(["not_opted_in", "locked", "busy"])
|
|
614
|
+
const refusedOne = (result) => Object(result).ok === false || REFUSED_RESULTS.has(Object(result).result)
|
|
615
|
+
export const outcome = (result) => exitFor(!(refusedOne(result) || Object.values(Object(Object(result).jobs)).some(refusedOne)))
|
|
607
616
|
const noFailures = (result) => exitFor(!(Object(result).failed > 0))
|
|
608
617
|
|
|
609
618
|
/** The commands defined with Ouro AX; each prints one JSON value on one line, and a refusal exits 1. */
|
|
@@ -616,19 +625,19 @@ function factoryCli({ env, cwd, git, runner }) {
|
|
|
616
625
|
commands: [
|
|
617
626
|
command("account", { summary: "Name the signed-in GitHub account that can open intake pull requests on the store.", readOnly: true, flags: { store: STORE }, exit: (r) => exitFor(r.result === "account_found") }, runAccountCommand),
|
|
618
627
|
command("consent", { summary: "Record whether this machine contributes to the store.", flags: { store: STORE, contribute: { type: "enum", values: ["yes", "no"], required: true, description: "Whether to contribute." }, account: { type: "string", placeholder: "<gh login>", description: "The GitHub account to deliver with." } } }, runConsentCommand),
|
|
619
|
-
command("derive", { summary: "Derive facts from one marker file (the detached worker).", flags: { marker: { type: "string", required: true, placeholder: "<file>", description: "The marker file." }, "wait-quiet": { type: "number", min: 0, max: 30000, placeholder: "<milliseconds>", description: "How long to wait for the session to go quiet first." } } }, runDeriveCommand),
|
|
628
|
+
command("derive", { summary: "Derive facts from one marker file (the detached worker).", flags: { marker: { type: "string", required: true, placeholder: "<file>", description: "The marker file." }, "wait-quiet": { type: "number", min: 0, max: 30000, placeholder: "<milliseconds>", description: "How long to wait for the session to go quiet first." } }, exit: outcome }, runDeriveCommand),
|
|
620
629
|
command("status", { summary: "Print the factory's local status and maintain existing state; do not enable an uninitialized factory." }, runStatusCommand),
|
|
621
|
-
command("flush", { summary: "Make one delivery attempt to the store.", flags: { store: STORE } }, runFlushCommand),
|
|
630
|
+
command("flush", { summary: "Make one delivery attempt to the store.", flags: { store: STORE }, exit: outcome }, runFlushCommand),
|
|
622
631
|
command("context-request", { summary: "Request the task context of one existing job, as the operator.", flags: { store: STORE, job: { ...JOB_FLAG, placeholder: "<public job id>" } }, exit: (r) => exitFor(r.ok !== false) }, runContextRequestCommand),
|
|
623
|
-
command("finalize", { summary: "Finalize up to eight finished jobs, then start the loop worker when its step is due.", flags: { job: { ...JOB_FLAG, repeat: true } } }, runFinalizeCommand),
|
|
632
|
+
command("finalize", { summary: "Finalize up to eight finished jobs, then start the loop worker when its step is due.", flags: { job: { ...JOB_FLAG, repeat: true } }, exit: outcome }, runFinalizeCommand),
|
|
624
633
|
command("build", { summary: "Build the store's reports.", flags: { store: { type: "string", required: true, placeholder: "<directory>", description: "The checked-out store." }, out: { type: "string", required: true, placeholder: "<directory>", description: "Where to write the build." } } }, runBuildCommand),
|
|
625
634
|
command("evaluate-accept", { summary: "Check what the evaluator wrote for a job and move accepted labels into the outbox.", flags: { job: JOB_FLAG } }, runEvaluateAcceptCommand),
|
|
626
|
-
command("evaluate", { summary: "Record a job's evaluation request and prepare its briefs; --pending prepares every retained request again.", flags: { desk: { type: "string", placeholder: "<absolute desk root>", description: "The desk." }, task: { type: "string", placeholder: "<track>/<slug>", description: "The task, as [desks/<alias>/]<track>/<slug>." }, pending: { type: "boolean", description: "Prepare every retained request again." } } }, runEvaluateCommand),
|
|
635
|
+
command("evaluate", { summary: "Record a job's evaluation request and prepare its briefs; --pending prepares every retained request again.", flags: { desk: { type: "string", placeholder: "<absolute desk root>", description: "The desk." }, task: { type: "string", placeholder: "<track>/<slug>", description: "The task, as [desks/<alias>/]<track>/<slug>." }, pending: { type: "boolean", description: "Prepare every retained request again." } }, exit: outcome }, runEvaluateCommand),
|
|
627
636
|
command("job-link", { summary: "Print the keyed link of a job in the store (private).", readOnly: true, flags: { store: STORE, "desk-remote": { type: "string", required: true, placeholder: "<url>", description: "The desk's remote." }, track: { type: "string", required: true, placeholder: "<track>", description: "The track." }, slug: { type: "string", required: true, placeholder: "<slug>", description: "The task slug." }, "person-prefix": { type: "string", placeholder: "<prefix>", description: "The person prefix, desks/<alias>." }, desk: { type: "string", placeholder: "<desk root>", description: "The desk, to follow a renamed task." }, "this-machine": { type: "boolean", description: "Print only this machine's own link." } } }, runJobLinkCommand),
|
|
628
637
|
command("kaizen-check", { summary: "Run the kaizen check on every open card of the store.", flags: ISSUE_FLAGS, exit: noFailures }, runKaizenCheckCommand),
|
|
629
638
|
command("andon", { summary: "Open, update, reopen and close the store's andon issues.", flags: ISSUE_FLAGS, exit: noFailures }, runAndonCommand),
|
|
630
639
|
command("reconcile", { summary: "Reconcile a desk's sessions against the store for a time window.", readOnly: true, flags: { desk: { type: "string", required: true, placeholder: "<absolute desk root>", description: "The desk." }, since: { type: "string", required: true, placeholder: "<iso>", description: "Window start, a UTC timestamp." }, until: { type: "string", required: true, placeholder: "<iso>", description: "Window end, a UTC timestamp." }, store: { type: "string", placeholder: "<directory>", description: "The store checkout." }, "person-prefix": { type: "string", placeholder: "desks/<alias>", description: "The person prefix." } }, exit: (r) => exitFor(r.ok !== false) }, runReconcileCommand),
|
|
631
|
-
command("loop", { summary: "Run the improvement steps once for the desk and person given.", flags: { desk: { type: "string", placeholder: "<absolute desk root>", description: "The desk." }, "person-prefix": { type: "string", placeholder: "desks/<alias>", description: "The person prefix." } } }, runLoopCommand),
|
|
640
|
+
command("loop", { summary: "Run the improvement steps once for the desk and person given.", flags: { desk: { type: "string", placeholder: "<absolute desk root>", description: "The desk." }, "person-prefix": { type: "string", placeholder: "desks/<alias>", description: "The person prefix." } }, exit: outcome }, runLoopCommand),
|
|
632
641
|
command("validate-pr", { summary: "Validate a store pull request against the facts its merge would leave.", readOnly: true, flags: { base: { type: "string", required: true, placeholder: "<base sha>", description: "The base commit." }, head: { type: "string", required: true, placeholder: "<head sha>", description: "The pull request head commit." }, "author-association": { type: "string", required: true, placeholder: "<value>", description: "The author's association, such as NONE or OWNER." }, repo: { type: "string", placeholder: "<owner/repo>", description: "The store, to read the triage actor." }, pr: { type: "string", placeholder: "<number>", description: "The pull request number." } }, exit: (r) => exitFor(r.ok !== false) }, runValidatePrCommand),
|
|
633
642
|
command("proof", { summary: "Mark an existing local session as a controlled proof.", args: [{ name: "session", required: true, description: "The session id." }], flags: { desk: { type: "string", placeholder: "<absolute desk root>", description: "The desk the session belongs to." } }, exit: (r) => exitFor(["marked", "already_proof"].includes(r.result)) }, runProofCommand),
|
|
634
643
|
],
|
|
@@ -32,7 +32,7 @@ export function resolveHookDeskRoot({ env = process.env, cwd = process.cwd(), ho
|
|
|
32
32
|
})
|
|
33
33
|
return { root: resolved.root, source: resolved.source, binding_path: bindingPath }
|
|
34
34
|
} catch (error) {
|
|
35
|
-
return { root: null, source: null, binding_path: bindingPath, tried: error.tried ?? [], error: error.message }
|
|
35
|
+
return { root: null, source: null, binding_path: bindingPath, tried: error.tried ?? [], error: error.message, code: "desk-root-not-found" }
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -57,7 +57,6 @@ export async function main({ argv = process.argv.slice(2), env = process.env, wr
|
|
|
57
57
|
name: "resolve-desk-root",
|
|
58
58
|
summary: "Print the bound desk root as JSON, or the one line a flag asks for.",
|
|
59
59
|
effect: "private",
|
|
60
|
-
readOnly: true,
|
|
61
60
|
protocol: true,
|
|
62
61
|
output: "the root's JSON, or the one line a flag asks for",
|
|
63
62
|
flags: FLAGS,
|
|
@@ -2,7 +2,7 @@ import { defineAction, field } from "../lib/ouro-actions/ouro-actions.mts";
|
|
|
2
2
|
|
|
3
3
|
export const deskStatus = defineAction({
|
|
4
4
|
id: "desk_status",
|
|
5
|
-
consent: "
|
|
5
|
+
consent: "read",
|
|
6
6
|
label: "Desk status",
|
|
7
7
|
description: "Check that Desk is ready for this session.",
|
|
8
8
|
agent: "Session-start health check for the resolved desk root. The compact answer has `state` (ready, degraded, admitting or setup_required), `degraded` (why), `fix` (what to do in this session), `search`, `notes`, where the desk is and `machine_desks` (every desk registered on this machine, with path, owner and remote). Retries admission when Desk is not ready. `detail: true` returns the full payload. A hosted Desk (claude.ai, ChatGPT) also returns its instructions, unless `has_instructions: true`; follow them and read the skills they name with desk_skill.",
|
|
@@ -40,3 +40,18 @@ export const improvementNext = defineAction({
|
|
|
40
40
|
},
|
|
41
41
|
output: {},
|
|
42
42
|
});
|
|
43
|
+
|
|
44
|
+
export const taskFocus = defineAction({
|
|
45
|
+
id: "task_focus",
|
|
46
|
+
consent: "read",
|
|
47
|
+
label: "Task focus",
|
|
48
|
+
description: "Declare the task this session is working on.",
|
|
49
|
+
agent: "Declare the task this session is working on, so its time is credited to it. Pass `track` and `slug` of an existing card (live or archived), or `clear: true` for a side conversation. A subagent shares this session's server, so its call would move the main agent's focus: only the main agent calls it. Writes nothing: the focus is held in memory. Returns `task_status`, `recent_progress`, `next_step`, any `shelved_lessons` to read before you act, and `archive_due` for a done/cancelled card. `task_create` with `focus: true` does the same for a new task.",
|
|
50
|
+
input: {
|
|
51
|
+
track: field.string({ label: "Track", description: "The track folder of the task you are working on; give it with `slug`.", optional: true }),
|
|
52
|
+
slug: field.string({ label: "Slug", description: "The task folder name; give it with `track`.", optional: true }),
|
|
53
|
+
clear: field.boolean({ label: "Clear", description: "Pass true, alone, to declare no task: for a side conversation that belongs to none.", optional: true }),
|
|
54
|
+
displayLabel: field.string({ label: "Display label", description: "Optional short description of the focused task, at most 72 characters; never paths, URLs, emails or credentials. Unsafe labels are ignored.", optional: true, wire: "display_label" }),
|
|
55
|
+
},
|
|
56
|
+
output: {},
|
|
57
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineActions } from "../lib/ouro-actions/ouro-actions.mts";
|
|
2
2
|
import { deskSearch, deskRecall, deskSkill } from "./desk-read.actions.mts";
|
|
3
|
-
import { deskStatus, deskDoctor, improvementNext } from "./desk-session.actions.mts";
|
|
3
|
+
import { taskFocus, deskStatus, deskDoctor, improvementNext } from "./desk-session.actions.mts";
|
|
4
4
|
|
|
5
|
-
export default defineActions("desk", [deskSearch, deskRecall, deskSkill, deskStatus, deskDoctor, improvementNext], { tool: "desk" });
|
|
5
|
+
export default defineActions("desk", [deskSearch, deskRecall, deskSkill, deskStatus, deskDoctor, improvementNext, taskFocus], { tool: "desk" });
|
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
},
|
|
188
188
|
{
|
|
189
189
|
"id": "desk_status",
|
|
190
|
-
"consent": "
|
|
190
|
+
"consent": "read",
|
|
191
191
|
"label": "Desk status",
|
|
192
192
|
"description": "Check that Desk is ready for this session.",
|
|
193
193
|
"agent": "Session-start health check for the resolved desk root. The compact answer has `state` (ready, degraded, admitting or setup_required), `degraded` (why), `fix` (what to do in this session), `search`, `notes`, where the desk is and `machine_desks` (every desk registered on this machine, with path, owner and remote). Retries admission when Desk is not ready. `detail: true` returns the full payload. A hosted Desk (claude.ai, ChatGPT) also returns its instructions, unless `has_instructions: true`; follow them and read the skills they name with desk_skill.",
|
|
@@ -275,6 +275,41 @@
|
|
|
275
275
|
}
|
|
276
276
|
},
|
|
277
277
|
"output": {}
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"id": "task_focus",
|
|
281
|
+
"consent": "read",
|
|
282
|
+
"label": "Task focus",
|
|
283
|
+
"description": "Declare the task this session is working on.",
|
|
284
|
+
"agent": "Declare the task this session is working on, so its time is credited to it. Pass `track` and `slug` of an existing card (live or archived), or `clear: true` for a side conversation. A subagent shares this session's server, so its call would move the main agent's focus: only the main agent calls it. Writes nothing: the focus is held in memory. Returns `task_status`, `recent_progress`, `next_step`, any `shelved_lessons` to read before you act, and `archive_due` for a done/cancelled card. `task_create` with `focus: true` does the same for a new task.",
|
|
285
|
+
"input": {
|
|
286
|
+
"track": {
|
|
287
|
+
"label": "Track",
|
|
288
|
+
"description": "The track folder of the task you are working on; give it with `slug`.",
|
|
289
|
+
"optional": true,
|
|
290
|
+
"kind": "string"
|
|
291
|
+
},
|
|
292
|
+
"slug": {
|
|
293
|
+
"label": "Slug",
|
|
294
|
+
"description": "The task folder name; give it with `track`.",
|
|
295
|
+
"optional": true,
|
|
296
|
+
"kind": "string"
|
|
297
|
+
},
|
|
298
|
+
"clear": {
|
|
299
|
+
"label": "Clear",
|
|
300
|
+
"description": "Pass true, alone, to declare no task: for a side conversation that belongs to none.",
|
|
301
|
+
"optional": true,
|
|
302
|
+
"kind": "boolean"
|
|
303
|
+
},
|
|
304
|
+
"displayLabel": {
|
|
305
|
+
"label": "Display label",
|
|
306
|
+
"description": "Optional short description of the focused task, at most 72 characters; never paths, URLs, emails or credentials. Unsafe labels are ignored.",
|
|
307
|
+
"optional": true,
|
|
308
|
+
"wire": "display_label",
|
|
309
|
+
"kind": "string"
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
"output": {}
|
|
278
313
|
}
|
|
279
314
|
]
|
|
280
315
|
}
|
|
@@ -181,7 +181,7 @@
|
|
|
181
181
|
"additionalProperties": false
|
|
182
182
|
},
|
|
183
183
|
"annotations": {
|
|
184
|
-
"readOnlyHint":
|
|
184
|
+
"readOnlyHint": true,
|
|
185
185
|
"destructiveHint": false,
|
|
186
186
|
"openWorldHint": false
|
|
187
187
|
}
|
|
@@ -250,6 +250,39 @@
|
|
|
250
250
|
"destructiveHint": false,
|
|
251
251
|
"openWorldHint": false
|
|
252
252
|
}
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"name": "task_focus",
|
|
256
|
+
"title": "Task focus",
|
|
257
|
+
"description": "Declare the task this session is working on, so its time is credited to it. Pass `track` and `slug` of an existing card (live or archived), or `clear: true` for a side conversation. A subagent shares this session's server, so its call would move the main agent's focus: only the main agent calls it. Writes nothing: the focus is held in memory. Returns `task_status`, `recent_progress`, `next_step`, any `shelved_lessons` to read before you act, and `archive_due` for a done/cancelled card. `task_create` with `focus: true` does the same for a new task.",
|
|
258
|
+
"inputSchema": {
|
|
259
|
+
"type": "object",
|
|
260
|
+
"properties": {
|
|
261
|
+
"track": {
|
|
262
|
+
"type": "string",
|
|
263
|
+
"description": "The track folder of the task you are working on; give it with `slug`."
|
|
264
|
+
},
|
|
265
|
+
"slug": {
|
|
266
|
+
"type": "string",
|
|
267
|
+
"description": "The task folder name; give it with `track`."
|
|
268
|
+
},
|
|
269
|
+
"clear": {
|
|
270
|
+
"type": "boolean",
|
|
271
|
+
"description": "Pass true, alone, to declare no task: for a side conversation that belongs to none."
|
|
272
|
+
},
|
|
273
|
+
"display_label": {
|
|
274
|
+
"type": "string",
|
|
275
|
+
"description": "Optional short description of the focused task, at most 72 characters; never paths, URLs, emails or credentials. Unsafe labels are ignored."
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
"required": [],
|
|
279
|
+
"additionalProperties": false
|
|
280
|
+
},
|
|
281
|
+
"annotations": {
|
|
282
|
+
"readOnlyHint": true,
|
|
283
|
+
"destructiveHint": false,
|
|
284
|
+
"openWorldHint": false
|
|
285
|
+
}
|
|
253
286
|
}
|
|
254
287
|
],
|
|
255
288
|
"refusals": {}
|
|
@@ -74,6 +74,14 @@ export function reportRule(implementationReportPath, reviewReportPath) {
|
|
|
74
74
|
return `Return your report as text in your final reply; do not write it to a file, because some hosts refuse a subagent's file write. The coordinator saves your reply at ${implementationReportPath} (implementer) or ${reviewReportPath} (reviewer).`
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
// An orphaned pull request has no findable owner unless it names the session that opened it. The child reads its own id from its
|
|
78
|
+
// environment; the coordinator's id is written into the rule here, because the child cannot look it up.
|
|
79
|
+
export function sessionRule(env) {
|
|
80
|
+
const parent = (env.COPILOT_AGENT_SESSION_ID ?? env.AGENCY_SESSION_ID ?? "").replace(/[^\x21-\x7e]/gu, "")
|
|
81
|
+
const parentLine = parent === "" ? "" : ` and \`Desk-Parent-Session: ${parent}\``
|
|
82
|
+
return `Name yourself on every pull request you open: put \`Desk-Session: <your session id>\`${parentLine} on their own lines in the pull-request body, beside any Desk-Task line. Read your id from COPILOT_AGENT_SESSION_ID, else AGENCY_SESSION_ID; if neither is set, write \`Desk-Session: unknown\`. When you hand work to a child of your own, give it the same rule with your id as its parent.`
|
|
83
|
+
}
|
|
84
|
+
|
|
77
85
|
// Two children sharing one scratchpad both wrote pr-body.md and one published the other's text as a live pull request body.
|
|
78
86
|
export function scratchRule(name) {
|
|
79
87
|
return `Write scratch and pull-request bodies only under a folder named for your task, node and attempt (\`${name}\`, made under the session scratchpad or with mktemp), never at the scratchpad's root, and use a uniquely named body file there (\`${name}/pr-body-${name}.md\`); pass that exact path to \`gh pr create\` or \`gh pr edit\` with --body-file.`
|
|
@@ -210,6 +218,7 @@ export async function resolveSuperpowersContext(input) {
|
|
|
210
218
|
// work-orchestration's scratch sentence, verbatim: a reviewer dispatched from a review skill never reads that skill.
|
|
211
219
|
"Write down the exact path of everything you create when you create it. Delete only those paths, each by that exact path written out in full in the delete command, never through a shell variable or a command substitution; leave anything else in place and list it in your return.",
|
|
212
220
|
"on return list every created worktree and branch, its exact repository/path/ref, current state, owner and verified disposition in the mapped Resources record; close out only exact-owned safe resources through desk:git-hygiene",
|
|
221
|
+
sessionRule(process.env),
|
|
213
222
|
VISUAL_PROOF_RULE,
|
|
214
223
|
],
|
|
215
224
|
cleanupPaths: [],
|