@jaybeeuu/agent-cortex 1.41.1 → 1.43.0
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/.agents/skills/style-versioning/SKILL.md +73 -2
- package/.github/workflows/ci.yml +52 -32
- package/AGENTS.md +23 -2
- package/CHANGELOG.md +189 -0
- package/README.md +125 -73
- package/agents/README.md +17 -4
- package/agents/ralph-plan/agent.md +7 -3
- package/agents/ralph-plan.agent.md +7 -3
- package/bin/agent-cortex.mjs +48 -30
- package/bin/installers/pi.mjs +885 -237
- package/claude-extras/scripts/statusline-command.sh +0 -0
- package/docs/claude-hooks.md +5 -4
- package/docs/commit-signing.md +231 -0
- package/docs/ideas/ban-content-assertion-tests.md +3 -1
- package/docs/ideas/dedicated-review-tests-skill.md +71 -0
- package/docs/ideas/enable-signed-commit-enforcement-changesets-bot-commits-must-be-signed.md +10 -1
- package/docs/ideas/extension-manifests.md +5 -0
- package/docs/ideas/unify-the-ticket-and-task-decomposition-workflows.md +71 -0
- package/docs/research/disable-model-invocation.md +103 -0
- package/docs/research/skill-design-research.md +2 -2
- package/docs/skills/skill-anatomy.md +5 -1
- package/docs/technical-direction/harness-config.md +25 -1
- package/docs/technical-direction/migration-execution-labels.md +17 -9
- package/extensions/agent-modes/discover.test.ts +19 -0
- package/extensions/agent-modes/discover.ts +25 -3
- package/extensions/session-start/README.md +38 -0
- package/extensions/session-start/index.test.ts +122 -0
- package/extensions/session-start/index.ts +27 -0
- package/extensions/session-start/package.json +19 -0
- package/extensions/session-start/tsconfig.json +12 -0
- package/extensions/subagent/README.md +1 -1
- package/extensions/subagent/agents.test.ts +176 -0
- package/extensions/subagent/agents.ts +102 -11
- package/extensions/subagent/index.ts +2 -1
- package/extensions/subagent/package.json +1 -1
- package/lib/cli.mjs +35 -9
- package/package.json +10 -6
- package/pi/settings.json +1 -7
- package/plugin.json +1 -1
- package/pnpm-workspace.yaml +6 -0
- package/scripts/check-changeset.mjs +42 -0
- package/scripts/install-instructions.sh +0 -0
- package/scripts/lib/release-gates.mjs +61 -0
- package/scripts/lib/verify-worker-tree.mjs +107 -0
- package/scripts/resolve-publish-command.mjs +17 -0
- package/scripts/sync-plugin-version.sh +0 -0
- package/skills/engineering/grill-with-docs/SKILL.md +3 -2
- package/skills/engineering/improve-codebase-architecture/REFERENCE.md +5 -0
- package/skills/engineering/improve-codebase-architecture/SKILL.md +2 -1
- package/skills/planning/create-task/SKILL.md +8 -3
- package/skills/planning/create-task/scripts/create-chores.ts +4 -1
- package/skills/planning/prd-to-tasks/REFERENCE.md +2 -2
- package/skills/planning/prd-to-tasks/SKILL.md +9 -4
- package/skills/planning/request-refactor-plan/FORMAT.md +5 -0
- package/skills/planning/request-refactor-plan/SKILL.md +3 -2
- package/skills/planning/spec-to-tickets/REFERENCE.md +82 -0
- package/skills/planning/spec-to-tickets/SKILL.md +143 -0
- package/skills/planning/write-a-prd/FORMAT.md +6 -0
- package/skills/planning/write-a-prd/SKILL.md +9 -6
- package/skills/planning/write-a-ticket/EXAMPLES.md +133 -0
- package/skills/planning/write-a-ticket/SKILL.md +77 -59
- package/skills/productivity/bd-tool/SKILL.md +27 -2
- package/skills/productivity/grill-me/SKILL.md +11 -0
- package/skills/review/review-security/scripts/install-gitleaks.sh +0 -0
- package/skills/workflow/git-workflow/SKILL.md +35 -1
- package/skills/workflow/plan/SKILL.md +20 -8
- package/skills/workflow/ralph/REFERENCE.md +20 -2
- package/skills/workflow/ralph/SKILL.md +4 -1
- package/skills/workflow/run-pipeline-stage/SKILL.md +17 -5
- package/skills/workflow/run-pipeline-stage/playbooks/code.md +2 -0
- package/skills/workflow/run-pipeline-stage/playbooks/document.md +3 -0
- package/skills/workflow/run-pipeline-stage/playbooks/fix.md +2 -0
- package/skills/workflow/run-pipeline-stage/prompts/stage-runner.md +11 -0
- package/skills/workflow/using-agent-skills/SKILL.md +1 -0
- package/test/cli.test.mjs +26 -29
- package/test/create-chores.test.mjs +12 -0
- package/test/fake-bd.test.mjs +72 -0
- package/test/helpers/fake-bd.mjs +26 -6
- package/test/helpers/fake-pi.mjs +132 -0
- package/test/pi-installer.test.mjs +345 -286
- package/test/pi-register.test.mjs +342 -0
- package/test/pi-sweep.test.mjs +619 -0
- package/test/release-gates.test.mjs +190 -0
- package/test/verify-worker-tree.test.mjs +120 -0
- package/token-map.README.md +7 -6
- package/token-map.json +6 -5
- package/extensions/agent-guardrails/node_modules/.bin/pi +0 -21
- package/extensions/agent-guardrails/node_modules/.bin/tsc +0 -21
- package/extensions/agent-guardrails/node_modules/.bin/tsserver +0 -21
- package/extensions/agent-guardrails/node_modules/.bin/tsx +0 -21
- package/extensions/agent-modes/node_modules/.bin/pi +0 -21
- package/extensions/agent-modes/node_modules/.bin/tsc +0 -21
- package/extensions/agent-modes/node_modules/.bin/tsserver +0 -21
- package/extensions/agent-modes/node_modules/.bin/tsx +0 -21
- package/extensions/session-start.ts +0 -44
- package/extensions/skill-stats/node_modules/.bin/pi +0 -21
- package/extensions/skill-stats/node_modules/.bin/tsc +0 -21
- package/extensions/skill-stats/node_modules/.bin/tsserver +0 -21
- package/extensions/skill-stats/node_modules/.bin/tsx +0 -21
- package/extensions/subagent/node_modules/.bin/pi +0 -21
- package/extensions/subagent/node_modules/.bin/pi-ai +0 -21
- package/extensions/subagent/node_modules/.bin/tsc +0 -21
- package/extensions/subagent/node_modules/.bin/tsserver +0 -21
- package/extensions/subagent/node_modules/.bin/tsx +0 -21
- package/lib/pi-packages.mjs +0 -169
- package/skills/planning/create-task/scripts/node_modules/.bin/tsc +0 -21
- package/skills/planning/create-task/scripts/node_modules/.bin/tsserver +0 -21
- package/skills/planning/create-task/scripts/node_modules/.bin/tsx +0 -21
- package/skills/productivity/validate-agent-dir/scripts/node_modules/.bin/tsc +0 -21
- package/skills/productivity/validate-agent-dir/scripts/node_modules/.bin/tsserver +0 -21
- package/skills/productivity/validate-agent-dir/scripts/node_modules/.bin/tsx +0 -21
- package/skills/workflow/run-pipeline-stage/scripts/node_modules/.bin/tsc +0 -21
- package/skills/workflow/run-pipeline-stage/scripts/node_modules/.bin/tsserver +0 -21
- package/skills/workflow/run-pipeline-stage/scripts/node_modules/.bin/tsx +0 -21
- package/test/pi-packages.test.mjs +0 -295
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
// Behaviour tests for the release gates that keep `main` from re-publishing a
|
|
2
|
+
// version: the inverted PR changeset gate and the no-publish release gate.
|
|
3
|
+
// The decision logic is pure; the two CLI adapters are exercised through their
|
|
4
|
+
// process boundary because that is the contract CI depends on.
|
|
5
|
+
|
|
6
|
+
import { describe, it } from "node:test";
|
|
7
|
+
import assert from "node:assert/strict";
|
|
8
|
+
import { spawn } from "node:child_process";
|
|
9
|
+
import { fileURLToPath } from "node:url";
|
|
10
|
+
import {
|
|
11
|
+
PUBLISH_COMMAND,
|
|
12
|
+
NO_PUBLISH_COMMAND,
|
|
13
|
+
evaluateChangesetGate,
|
|
14
|
+
parseNameStatus,
|
|
15
|
+
resolvePublishCommand,
|
|
16
|
+
} from "../scripts/lib/release-gates.mjs";
|
|
17
|
+
|
|
18
|
+
const CHECK_CHANGESET = fileURLToPath(new URL("../scripts/check-changeset.mjs", import.meta.url));
|
|
19
|
+
const RESOLVE_PUBLISH = fileURLToPath(
|
|
20
|
+
new URL("../scripts/resolve-publish-command.mjs", import.meta.url),
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
function runScript(script, { args = [], env = {}, stdin = "" } = {}) {
|
|
24
|
+
return new Promise((resolve, reject) => {
|
|
25
|
+
const child = spawn(process.execPath, [script, ...args], {
|
|
26
|
+
env: { ...process.env, ...env },
|
|
27
|
+
});
|
|
28
|
+
let stdout = "";
|
|
29
|
+
let stderr = "";
|
|
30
|
+
child.stdout.on("data", (chunk) => {
|
|
31
|
+
stdout += chunk;
|
|
32
|
+
});
|
|
33
|
+
child.stderr.on("data", (chunk) => {
|
|
34
|
+
stderr += chunk;
|
|
35
|
+
});
|
|
36
|
+
child.on("error", reject);
|
|
37
|
+
child.on("close", (code) => resolve({ code, stdout, stderr }));
|
|
38
|
+
child.stdin.end(stdin);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
describe("parseNameStatus", () => {
|
|
43
|
+
it("parses added and modified paths from git diff --name-status output", () => {
|
|
44
|
+
const changes = parseNameStatus("M\tpackage.json\nA\t.changeset/fix-release.md\n");
|
|
45
|
+
|
|
46
|
+
assert.deepEqual(changes, [
|
|
47
|
+
{ status: "M", path: "package.json" },
|
|
48
|
+
{ status: "A", path: ".changeset/fix-release.md" },
|
|
49
|
+
]);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it("uses the new path for a rename", () => {
|
|
53
|
+
const changes = parseNameStatus("R087\t.changeset/old.md\t.changeset/new.md\n");
|
|
54
|
+
|
|
55
|
+
assert.deepEqual(changes, [{ status: "R", path: ".changeset/new.md" }]);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it("returns no changes for empty output", () => {
|
|
59
|
+
assert.deepEqual(parseNameStatus(""), []);
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
describe("evaluateChangesetGate", () => {
|
|
64
|
+
it("passes a PR that adds a changeset", () => {
|
|
65
|
+
const result = evaluateChangesetGate({
|
|
66
|
+
changes: [{ status: "A", path: ".changeset/fix-release.md" }],
|
|
67
|
+
labels: [],
|
|
68
|
+
headRef: "fix/release-gate",
|
|
69
|
+
actor: "jaybeeuu",
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
assert.deepEqual(result, { ok: true, reason: "changeset-added" });
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it("fails a CI-only change that adds no changeset", () => {
|
|
76
|
+
const result = evaluateChangesetGate({
|
|
77
|
+
changes: [{ status: "M", path: ".github/workflows/ci.yml" }],
|
|
78
|
+
labels: [],
|
|
79
|
+
headRef: "chore/bump-pnpm",
|
|
80
|
+
actor: "jaybeeuu",
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
assert.equal(result.ok, false);
|
|
84
|
+
assert.equal(result.reason, "missing-changeset");
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it("fails a PR that only modifies an existing changeset", () => {
|
|
88
|
+
const result = evaluateChangesetGate({
|
|
89
|
+
changes: [{ status: "M", path: ".changeset/pending.md" }],
|
|
90
|
+
labels: [],
|
|
91
|
+
headRef: "chore/edit-changeset",
|
|
92
|
+
actor: "jaybeeuu",
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
assert.equal(result.ok, false);
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
it("fails a PR that only adds the changeset README", () => {
|
|
99
|
+
const result = evaluateChangesetGate({
|
|
100
|
+
changes: [{ status: "A", path: ".changeset/README.md" }],
|
|
101
|
+
labels: [],
|
|
102
|
+
headRef: "docs/changesets",
|
|
103
|
+
actor: "jaybeeuu",
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
assert.equal(result.ok, false);
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
it("passes an unlabelled-change PR carrying the no-publish label", () => {
|
|
110
|
+
const result = evaluateChangesetGate({
|
|
111
|
+
changes: [{ status: "M", path: ".github/workflows/ci.yml" }],
|
|
112
|
+
labels: ["no-publish"],
|
|
113
|
+
headRef: "chore/bump-pnpm",
|
|
114
|
+
actor: "jaybeeuu",
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
assert.deepEqual(result, { ok: true, reason: "no-publish-label" });
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it("passes the Version Packages PR by head branch", () => {
|
|
121
|
+
const result = evaluateChangesetGate({
|
|
122
|
+
changes: [{ status: "M", path: "package.json" }],
|
|
123
|
+
labels: [],
|
|
124
|
+
headRef: "changeset-release/main",
|
|
125
|
+
actor: "jaybeeuu",
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
assert.deepEqual(result, { ok: true, reason: "version-packages-pr" });
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
it("passes a PR opened by the GitHub Actions bot", () => {
|
|
132
|
+
const result = evaluateChangesetGate({
|
|
133
|
+
changes: [{ status: "M", path: "package.json" }],
|
|
134
|
+
labels: [],
|
|
135
|
+
headRef: "automation/some-branch",
|
|
136
|
+
actor: "github-actions[bot]",
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
assert.deepEqual(result, { ok: true, reason: "version-packages-pr" });
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
describe("resolvePublishCommand", () => {
|
|
144
|
+
it("publishes by default when the merged PR has no labels", () => {
|
|
145
|
+
assert.equal(resolvePublishCommand([]), PUBLISH_COMMAND);
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
it("publishes when the merged PR carries unrelated labels", () => {
|
|
149
|
+
assert.equal(resolvePublishCommand(["bug", "priority:p2"]), PUBLISH_COMMAND);
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
it("refuses to publish when the merged PR carries the no-publish label", () => {
|
|
153
|
+
assert.equal(resolvePublishCommand(["bug", "no-publish"]), NO_PUBLISH_COMMAND);
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
it("matches the label exactly, not as a substring", () => {
|
|
157
|
+
assert.equal(resolvePublishCommand(["no-publish-ci"]), PUBLISH_COMMAND);
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
describe("check-changeset CLI", () => {
|
|
162
|
+
it("exits 0 for a no-publish PR with no diff", async () => {
|
|
163
|
+
const { code } = await runScript(CHECK_CHANGESET, {
|
|
164
|
+
env: { PR_LABELS: '["no-publish"]', PR_HEAD_REF: "chore/bump-pnpm", PR_ACTOR: "jaybeeuu" },
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
assert.equal(code, 0);
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
it("exits 1 and explains the no-publish escape hatch for a changeset-less PR", async () => {
|
|
171
|
+
const { code, stderr } = await runScript(CHECK_CHANGESET, {
|
|
172
|
+
stdin: "M\tpackage.json\n",
|
|
173
|
+
env: { PR_LABELS: "[]", PR_HEAD_REF: "chore/bump-pnpm", PR_ACTOR: "jaybeeuu" },
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
assert.equal(code, 1);
|
|
177
|
+
assert.match(stderr, /no-publish/);
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
describe("resolve-publish-command CLI", () => {
|
|
182
|
+
it("prints the noop command for a no-publish label set", async () => {
|
|
183
|
+
const { code, stdout } = await runScript(RESOLVE_PUBLISH, {
|
|
184
|
+
args: ['["no-publish"]'],
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
assert.equal(code, 0);
|
|
188
|
+
assert.equal(stdout.trim(), NO_PUBLISH_COMMAND);
|
|
189
|
+
});
|
|
190
|
+
});
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// Integration tests for scripts/lib/verify-worker-tree.mjs. The module exists to
|
|
2
|
+
// tell a worker that delivered from one that only said it did, so each case runs
|
|
3
|
+
// a real git repository and asserts the verdict — no mocking of git, because git
|
|
4
|
+
// is the thing whose state the verdict is about.
|
|
5
|
+
|
|
6
|
+
import { describe, it } from "node:test";
|
|
7
|
+
import assert from "node:assert/strict";
|
|
8
|
+
import { execFile } from "node:child_process";
|
|
9
|
+
import { mkdtemp, writeFile, rm } from "node:fs/promises";
|
|
10
|
+
import { tmpdir } from "node:os";
|
|
11
|
+
import { join } from "node:path";
|
|
12
|
+
import { promisify } from "node:util";
|
|
13
|
+
|
|
14
|
+
import { verifyWorkerTree } from "../scripts/lib/verify-worker-tree.mjs";
|
|
15
|
+
|
|
16
|
+
const execFileAsync = promisify(execFile);
|
|
17
|
+
|
|
18
|
+
/** Run a git command in `cwd`. */
|
|
19
|
+
async function git(cwd, args) {
|
|
20
|
+
await execFileAsync("git", args, { cwd });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** A repository with one base commit; returns its directory and that commit. */
|
|
24
|
+
async function createRepo() {
|
|
25
|
+
const dir = await mkdtemp(join(tmpdir(), "verify-worker-tree-"));
|
|
26
|
+
await git(dir, ["init", "--quiet"]);
|
|
27
|
+
await git(dir, ["config", "user.email", "t@example.com"]);
|
|
28
|
+
await git(dir, ["config", "user.name", "T"]);
|
|
29
|
+
// A developer's global config may enable commit signing; the fixture must not
|
|
30
|
+
// depend on a secret key being present.
|
|
31
|
+
await git(dir, ["config", "commit.gpgsign", "false"]);
|
|
32
|
+
await writeFile(join(dir, "README.md"), "base\n");
|
|
33
|
+
await git(dir, ["add", "-A"]);
|
|
34
|
+
await git(dir, ["commit", "-m", "base"]);
|
|
35
|
+
const { stdout } = await execFileAsync("git", ["rev-parse", "HEAD"], { cwd: dir });
|
|
36
|
+
return { dir, base: stdout.trim() };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Commit a file in the repo, as a delivering worker would. */
|
|
40
|
+
async function commitWork(dir) {
|
|
41
|
+
await writeFile(join(dir, "worker-output.txt"), "delivered\n");
|
|
42
|
+
await git(dir, ["add", "-A"]);
|
|
43
|
+
await git(dir, ["commit", "-m", "worker: deliver"]);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
describe("verifyWorkerTree", () => {
|
|
47
|
+
it("passes a worker that committed and left a clean tree", async () => {
|
|
48
|
+
const { dir, base } = await createRepo();
|
|
49
|
+
try {
|
|
50
|
+
await commitWork(dir);
|
|
51
|
+
|
|
52
|
+
const verdict = await verifyWorkerTree({ worktree: dir, base });
|
|
53
|
+
|
|
54
|
+
assert.deepEqual(verdict, { ok: true, reasons: [], commitsAhead: 1 });
|
|
55
|
+
} finally {
|
|
56
|
+
await rm(dir, { recursive: true, force: true });
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it("fails a worker that reported success but left its work uncommitted", async () => {
|
|
61
|
+
const { dir, base } = await createRepo();
|
|
62
|
+
try {
|
|
63
|
+
await writeFile(join(dir, "left-behind.txt"), "uncommitted\n");
|
|
64
|
+
|
|
65
|
+
const verdict = await verifyWorkerTree({ worktree: dir, base });
|
|
66
|
+
|
|
67
|
+
assert.equal(verdict.ok, false);
|
|
68
|
+
assert.equal(verdict.reasons[0], "worktree is dirty: 1 uncommitted path(s)");
|
|
69
|
+
assert.equal(verdict.commitsAhead, 0);
|
|
70
|
+
} finally {
|
|
71
|
+
await rm(dir, { recursive: true, force: true });
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it("fails a worker that left a clean tree with nothing committed", async () => {
|
|
76
|
+
const { dir, base } = await createRepo();
|
|
77
|
+
try {
|
|
78
|
+
const verdict = await verifyWorkerTree({ worktree: dir, base });
|
|
79
|
+
|
|
80
|
+
assert.equal(verdict.ok, false);
|
|
81
|
+
assert.equal(verdict.reasons.length, 1);
|
|
82
|
+
assert.match(verdict.reasons[0], /^no commit ahead of base [0-9a-f]{7}$/);
|
|
83
|
+
} finally {
|
|
84
|
+
await rm(dir, { recursive: true, force: true });
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it("reports a dirty tree and a missing commit together", async () => {
|
|
89
|
+
const { dir, base } = await createRepo();
|
|
90
|
+
try {
|
|
91
|
+
await writeFile(join(dir, "partial.txt"), "half done\n");
|
|
92
|
+
|
|
93
|
+
const verdict = await verifyWorkerTree({ worktree: dir, base });
|
|
94
|
+
|
|
95
|
+
assert.equal(verdict.ok, false);
|
|
96
|
+
assert.equal(verdict.reasons.length, 2);
|
|
97
|
+
assert.equal(verdict.reasons[0], "worktree is dirty: 1 uncommitted path(s)");
|
|
98
|
+
assert.match(verdict.reasons[1], /^no commit ahead of base [0-9a-f]{7}$/);
|
|
99
|
+
} finally {
|
|
100
|
+
await rm(dir, { recursive: true, force: true });
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it("counts every commit the worker made, not just the last", async () => {
|
|
105
|
+
const { dir, base } = await createRepo();
|
|
106
|
+
try {
|
|
107
|
+
await commitWork(dir);
|
|
108
|
+
await writeFile(join(dir, "second.txt"), "more\n");
|
|
109
|
+
await git(dir, ["add", "-A"]);
|
|
110
|
+
await git(dir, ["commit", "-m", "worker: second"]);
|
|
111
|
+
|
|
112
|
+
const verdict = await verifyWorkerTree({ worktree: dir, base });
|
|
113
|
+
|
|
114
|
+
assert.equal(verdict.ok, true);
|
|
115
|
+
assert.equal(verdict.commitsAhead, 2);
|
|
116
|
+
} finally {
|
|
117
|
+
await rm(dir, { recursive: true, force: true });
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
});
|
package/token-map.README.md
CHANGED
|
@@ -15,14 +15,14 @@ decisions behind the map.
|
|
|
15
15
|
| id | Platform | Agent format | Plugin root |
|
|
16
16
|
|---|---|---|---|
|
|
17
17
|
| `copilot` | GitHub Copilot CLI | `agents/<name>/` composable dirs → generated `agents/*.agent.md` | `~/.copilot/installed-plugins/_direct/agent-cortex` |
|
|
18
|
-
| `pi` | pi coding agent | `agents/<name>/` composable dirs (composed at runtime by agent-modes, or
|
|
18
|
+
| `pi` | pi coding agent | `agents/<name>/` composable dirs (composed at runtime by agent-modes, or rendered install-time by `agent-cortex install pi`) | `~/.agent-cortex/pi` |
|
|
19
19
|
| `claude` | Claude Code | `~/.agent-cortex/claude/agents/*.md` (materialised home install) | `${CLAUDE_PLUGIN_ROOT}` (env var) |
|
|
20
20
|
|
|
21
21
|
The harness ids match the values accepted by `agent-cortex install <harness>` in
|
|
22
|
-
`lib/cli.mjs` (`SUPPORTED_HARNESSES`). The pi `plugin_root` row is the
|
|
23
|
-
|
|
24
|
-
installs pass `--plugin-root <dir>` to override it (see README "Pi
|
|
25
|
-
|
|
22
|
+
`lib/cli.mjs` (`SUPPORTED_HARNESSES`). The pi `plugin_root` row is the staged package
|
|
23
|
+
directory `agent-cortex install pi` materialises, which pi then loads by path; checkout
|
|
24
|
+
and symlinked installs pass `--plugin-root <dir>` to override it (see README "Pi package
|
|
25
|
+
staging (`agent-cortex install pi`)").
|
|
26
26
|
|
|
27
27
|
## Design decisions
|
|
28
28
|
|
|
@@ -49,7 +49,8 @@ rather than inventing a dotted form:
|
|
|
49
49
|
column, consumed by `bin/installers/claude.mjs` (the install-time generator — PR #91, #92); the pi column is grounded
|
|
50
50
|
in pi's documented built-in tool surface (`read`, `bash`, `edit`, `write`, `grep`, `find`,
|
|
51
51
|
`ls`) plus `ask_questions` — added by the pi-questions package (mapped from
|
|
52
|
-
`ask_user`) — and `task` / `read_agent` / `wait_for_agents` subagent tools
|
|
52
|
+
`ask_user`) — and `task` / `read_agent` / `wait_for_agents` subagent tools, the last three
|
|
53
|
+
supplied by this repo's own `extensions/subagent` rather than by pi; `skill` maps
|
|
53
54
|
to `read` (skills load by reading the listed SKILL.md path).
|
|
54
55
|
- **`paths`** — `plugin_root`, `agents_dir`, and `skills_dir`. These are the install-time
|
|
55
56
|
variables that differ per harness. `plugin_root` is the anchor; the other two resolve
|
package/token-map.json
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"plugin_root": {
|
|
32
32
|
"copilot": "~/.copilot/installed-plugins/_direct/agent-cortex",
|
|
33
33
|
"claude": "${CLAUDE_PLUGIN_ROOT}",
|
|
34
|
-
"pi": "~/.
|
|
34
|
+
"pi": "~/.agent-cortex/pi"
|
|
35
35
|
},
|
|
36
36
|
"agents_dir": {
|
|
37
37
|
"copilot": { "base": "plugin_root", "relative": "agents" },
|
|
@@ -63,14 +63,15 @@
|
|
|
63
63
|
"tools": {
|
|
64
64
|
"rg": "Copilot alias for grep. Claude and pi collapse it onto their single search tool (Grep / grep) — same collapse rule as the build script.",
|
|
65
65
|
"glob": "Claude has a dedicated Glob tool. pi's built-in pattern-search tool is find (hypa_find when the pi-hypa extension is installed).",
|
|
66
|
-
"ask_user": "Copilot (ask_user) and Claude (AskUserQuestion) prompt the user mid-run. pi's equivalent is ask_questions, provided by the pi-questions package (
|
|
67
|
-
"web_fetch": "pi's fetch_content comes from the pi-web-access package (
|
|
66
|
+
"ask_user": "Copilot (ask_user) and Claude (AskUserQuestion) prompt the user mid-run. pi's equivalent is ask_questions, provided by the pi-questions package (an ordinary runtime dependency of this package that `agent-cortex install pi` bundles into the staged package's node_modules) — the genuine interactive-questioning tool, restoring grilling in plan/ralph-plan/strategy modes. Like fetch_content (pi-web-access), it is only present when its package is installed, so the mapping depends on that package (see the extension-manifests idea). pi still intentionally ships no permission popups; ask_questions is the interactive mid-run question tool, not a popup.",
|
|
67
|
+
"web_fetch": "pi's fetch_content comes from the pi-web-access package (an ordinary runtime dependency of this package that `agent-cortex install pi` bundles into the staged package's node_modules).",
|
|
68
68
|
"skill": "Copilot (skill) and Claude (Skill) expose skills as a tool. pi has no dedicated skill tool — skills are surfaced in the always-present 'Available skills' context block and loaded by reading the listed SKILL.md path ({{PATH:<skill>/SKILL.md}}). The pi mapping is read, the tool used to load a skill's file; a dedicated skill tool is a follow-on design candidate if prompting proves insufficient.",
|
|
69
|
-
"read_agent": "Claude's Task returns results inline — there is no separate read step, so read_agent drops on claude (null). Copilot uses the task + read_agent poll loop; pi
|
|
69
|
+
"read_agent": "Claude's Task returns results inline — there is no separate read step, so read_agent drops on claude (null). Copilot uses the task + read_agent poll loop; pi exposes read_agent as a fallback to wait_for_agents.",
|
|
70
|
+
"task": "Copilot and Claude provide a subagent tool natively. On pi it is supplied by this repo's own extensions/subagent extension (which also registers read_agent and wait_for_agents), not by pi itself — a pi session started before that extension was installed has no dispatch tool at all. Skills must therefore stop and report a missing subagent tool rather than improvising a backgrounded CLI run, which has no completion signal.",
|
|
70
71
|
"wait_for_agents": "PI-only blocking wait over background subagent runs (the task tool): returns the results of completed agents and STILL RUNNING for the rest. Copilot has no equivalent tool (its task + read_agent poll loop stays) and Claude's Task delivers results inline with no wait step — both null."
|
|
71
72
|
},
|
|
72
73
|
"paths": {
|
|
73
|
-
"pi": "plugin_root
|
|
74
|
+
"pi": "plugin_root is the staged package `agent-cortex install pi` materialises at ~/.agent-cortex/pi; pi loads that directory by path and the shipped extensions resolve their own resources relative to it (agent-modes computes plugin_root from its actual install location). A checkout or symlinked install differs — installers compute plugin_root from the actual resolution and can override it (--plugin-root).",
|
|
74
75
|
"claude": "plugin_root stays ${CLAUDE_PLUGIN_ROOT} (env var) for the materialised plugin — never a literal ~/.agent-cortex/claude. Claude Code copies marketplace-installed plugins (including local directory sources like ~/.agent-cortex/claude) into its own cache and expands the env var per context, so a literal home path in substituted files would break under cache-copy; the installer passes the env form through verbatim."
|
|
75
76
|
},
|
|
76
77
|
"agents": {
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/@earendil-works+pi-coding-agent@0.78.1_ws@8.21.0_zod@4.4.3/node_modules/@earendil-works/pi-coding-agent/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/@earendil-works+pi-coding-agent@0.78.1_ws@8.21.0_zod@4.4.3/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/@earendil-works+pi-coding-agent@0.78.1_ws@8.21.0_zod@4.4.3/node_modules/@earendil-works/pi-coding-agent/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/@earendil-works+pi-coding-agent@0.78.1_ws@8.21.0_zod@4.4.3/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../@earendil-works/pi-coding-agent/dist/cli.js" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../@earendil-works/pi-coding-agent/dist/cli.js" "$@"
|
|
21
|
-
fi
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../typescript/bin/tsc" "$@"
|
|
21
|
-
fi
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../typescript/bin/tsserver" "$@"
|
|
21
|
-
fi
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/tsx@4.22.4/node_modules/tsx/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/tsx@4.22.4/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/tsx@4.22.4/node_modules/tsx/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/tsx@4.22.4/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../tsx/dist/cli.mjs" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../tsx/dist/cli.mjs" "$@"
|
|
21
|
-
fi
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/@earendil-works+pi-coding-agent@0.78.1_ws@8.21.0_zod@4.4.3/node_modules/@earendil-works/pi-coding-agent/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/@earendil-works+pi-coding-agent@0.78.1_ws@8.21.0_zod@4.4.3/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/@earendil-works+pi-coding-agent@0.78.1_ws@8.21.0_zod@4.4.3/node_modules/@earendil-works/pi-coding-agent/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/@earendil-works+pi-coding-agent@0.78.1_ws@8.21.0_zod@4.4.3/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../@earendil-works/pi-coding-agent/dist/cli.js" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../@earendil-works/pi-coding-agent/dist/cli.js" "$@"
|
|
21
|
-
fi
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../typescript/bin/tsc" "$@"
|
|
21
|
-
fi
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../typescript/bin/tsserver" "$@"
|
|
21
|
-
fi
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/tsx@4.22.4/node_modules/tsx/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/tsx@4.22.4/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/tsx@4.22.4/node_modules/tsx/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/tsx@4.22.4/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../tsx/dist/cli.mjs" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../tsx/dist/cli.mjs" "$@"
|
|
21
|
-
fi
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import { loadSessionContext } from "./lib/context-loader.js";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Session-start extension.
|
|
6
|
-
*
|
|
7
|
-
* Injects baseline context at the start of every PI session:
|
|
8
|
-
* 1. Skill availability hints (so the agent knows they exist)
|
|
9
|
-
* 2. Project context files (AGENTS.md, user-preferences.md)
|
|
10
|
-
*
|
|
11
|
-
* Context files are read dynamically from the project root (cwd).
|
|
12
|
-
*/
|
|
13
|
-
export default function (pi: ExtensionAPI) {
|
|
14
|
-
pi.on("before_agent_start", async (_event, ctx) => {
|
|
15
|
-
const skillHints = [
|
|
16
|
-
"Available skills — invoke when relevant (not pre-loaded to save context):",
|
|
17
|
-
"",
|
|
18
|
-
"• /skill:using-agent-skills — meta-skill that routes to the right skill",
|
|
19
|
-
" and enforces core agent behaviors. Check this first if unsure.",
|
|
20
|
-
"",
|
|
21
|
-
"• /skill:bd-tool — project context & task tracking with beads.",
|
|
22
|
-
" Run `bd ready` to see available work.",
|
|
23
|
-
"",
|
|
24
|
-
"• /skill:git-workflow — git discipline: feature branches,",
|
|
25
|
-
" worktrees for solo AFK work, PR workflow, and when to ask.",
|
|
26
|
-
"",
|
|
27
|
-
"Read the SKILL.md for full instructions when needed.",
|
|
28
|
-
].join("\n");
|
|
29
|
-
|
|
30
|
-
const contextFiles = loadSessionContext(ctx.cwd);
|
|
31
|
-
|
|
32
|
-
const content = contextFiles
|
|
33
|
-
? `${skillHints}\n\n---\n\n${contextFiles}`
|
|
34
|
-
: skillHints;
|
|
35
|
-
|
|
36
|
-
return {
|
|
37
|
-
message: {
|
|
38
|
-
customType: "session-start",
|
|
39
|
-
content,
|
|
40
|
-
display: false,
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
});
|
|
44
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/@earendil-works+pi-coding-agent@0.78.1_ws@8.21.0_zod@4.4.3/node_modules/@earendil-works/pi-coding-agent/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/@earendil-works+pi-coding-agent@0.78.1_ws@8.21.0_zod@4.4.3/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/@earendil-works+pi-coding-agent@0.78.1_ws@8.21.0_zod@4.4.3/node_modules/@earendil-works/pi-coding-agent/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/@earendil-works+pi-coding-agent@0.78.1_ws@8.21.0_zod@4.4.3/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../@earendil-works/pi-coding-agent/dist/cli.js" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../@earendil-works/pi-coding-agent/dist/cli.js" "$@"
|
|
21
|
-
fi
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/agent-cortex/agent-cortex/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../typescript/bin/tsc" "$@"
|
|
21
|
-
fi
|