@jaybeeuu/agent-cortex 1.42.0 → 2.0.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 +78 -8
- package/.github/workflows/ci.yml +51 -38
- package/AGENTS.md +32 -17
- package/CHANGELOG.md +182 -0
- package/README.md +167 -126
- package/agents/README.md +26 -27
- package/agents/ralph/agent.md +7 -10
- package/agents/ralph/claude/polling.md +1 -1
- package/bin/agent-cortex.mjs +46 -44
- package/bin/installers/claude.mjs +2 -2
- package/bin/installers/pi.mjs +885 -237
- package/docs/claude-hooks.md +5 -4
- package/docs/commit-signing.md +231 -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/research/disable-model-invocation.md +82 -0
- package/docs/research/skill-design-research.md +2 -2
- package/docs/skills/skill-anatomy.md +5 -2
- package/docs/technical-direction/harness-config.md +30 -14
- package/docs/technical-direction/migration-execution-labels.md +17 -9
- package/docs/user-preferences.md +2 -2
- package/extensions/agent-modes/README.md +3 -3
- package/extensions/agent-modes/discover.test.ts +19 -0
- package/extensions/agent-modes/discover.ts +31 -9
- 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/skill-stats/pnpm-lock.yaml +329 -0
- package/extensions/subagent/README.md +3 -3
- package/extensions/subagent/agents.test.ts +176 -0
- package/extensions/subagent/agents.ts +101 -11
- package/extensions/subagent/index.ts +2 -1
- package/extensions/subagent/package.json +1 -1
- package/lib/cli.mjs +40 -16
- package/package.json +8 -9
- package/pi/settings.json +1 -7
- package/pnpm-workspace.yaml +6 -0
- package/scripts/check-changeset.mjs +42 -0
- package/scripts/lib/compose-agent.mjs +10 -10
- 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/skills/planning/create-task/scripts/pnpm-lock.yaml +342 -0
- package/skills/productivity/validate-agent-dir/scripts/pnpm-lock.yaml +329 -0
- package/skills/workflow/git-workflow/SKILL.md +35 -1
- package/skills/workflow/ralph/REFERENCE.md +20 -4
- package/skills/workflow/ralph/SKILL.md +9 -6
- package/skills/workflow/run-pipeline-stage/SKILL.md +11 -4
- 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/run-pipeline-stage/scripts/pnpm-lock.yaml +342 -0
- package/test/cli.test.mjs +37 -39
- 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 +16 -18
- package/token-map.json +29 -33
- package/agents/plan/copilot/frontmatter.json +0 -6
- package/agents/plan.agent.md +0 -59
- package/agents/ralph/copilot/frontmatter.json +0 -6
- package/agents/ralph/copilot/polling.md +0 -62
- package/agents/ralph-plan/copilot/frontmatter.json +0 -6
- package/agents/ralph-plan.agent.md +0 -126
- package/agents/ralph.agent.md +0 -331
- package/agents/strategy/copilot/frontmatter.json +0 -6
- package/agents/strategy.agent.md +0 -112
- package/bin/installers/copilot.mjs +0 -124
- package/extensions/session-start.ts +0 -44
- package/hooks.json +0 -10
- package/lib/pi-packages.mjs +0 -169
- package/plugin.json +0 -35
- package/scripts/build-copilot-agents.mjs +0 -30
- package/scripts/install-instructions.sh +0 -82
- package/scripts/sync-plugin-version.sh +0 -17
- package/test/copilot-installer.test.mjs +0 -308
- package/test/pi-packages.test.mjs +0 -295
package/bin/agent-cortex.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { parseArgs, buildHelpText, validateHarness } from "../lib/cli.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { join, dirname } from "node:path";
|
|
5
|
+
import { installPi, registerPi, sweepLegacyPiUserDirs } from "./installers/pi.mjs";
|
|
5
6
|
|
|
6
7
|
const argv = process.argv.slice(2);
|
|
7
8
|
const parsed = parseArgs(argv);
|
|
@@ -29,18 +30,41 @@ if (parsed.command === "install") {
|
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
if (parsed.harness === "pi") {
|
|
33
|
+
// A plain `agent-cortex install pi` stages the package into the home
|
|
34
|
+
// install root (~/.agent-cortex/pi) and registers that directory with pi
|
|
35
|
+
// through pi's own `pi install` (idempotent by state: a re-run is a no-op
|
|
36
|
+
// update); `--output <dir>` is the stage-only form (tests/CI) and prints
|
|
37
|
+
// the registration command instead.
|
|
32
38
|
try {
|
|
33
39
|
const result = await installPi({
|
|
34
40
|
dryRun: parsed.dryRun ?? false,
|
|
35
|
-
// Third-party pi packages are only provisioned for a real install:
|
|
36
|
-
// --output is the generate-only form, --no-provision opts an offline
|
|
37
|
-
// machine out explicitly.
|
|
38
|
-
provisionPackages: parsed.output === undefined && !parsed.noProvision,
|
|
39
41
|
warn: () => {}, // warnings surface once in the printed summary
|
|
40
42
|
...(parsed.output ? { output: parsed.output } : {}),
|
|
41
43
|
...(parsed.pluginRoot ? { pluginRoot: parsed.pluginRoot } : {}),
|
|
42
44
|
});
|
|
43
45
|
printPiInstall(result);
|
|
46
|
+
if (parsed.output === undefined) {
|
|
47
|
+
const registration = await registerPi({
|
|
48
|
+
output: result.output,
|
|
49
|
+
dryRun: parsed.dryRun ?? false,
|
|
50
|
+
requireRegister: parsed.requireRegister ?? false,
|
|
51
|
+
warn: (msg) => process.stdout.write(` ⚠ ${msg}\n`),
|
|
52
|
+
});
|
|
53
|
+
// The old installer's rendered copies are only stale once the staged
|
|
54
|
+
// package is what pi loads — and nothing is deleted on a dry run. The
|
|
55
|
+
// flag is passed through as well, so the sweep's own guarantee does not
|
|
56
|
+
// depend on this guard staying in place.
|
|
57
|
+
if (registration.registered && !(parsed.dryRun ?? false)) {
|
|
58
|
+
printPiSweep(
|
|
59
|
+
await sweepLegacyPiUserDirs({
|
|
60
|
+
piUserDir: dirname(registration.settingsPath),
|
|
61
|
+
dryRun: parsed.dryRun ?? false,
|
|
62
|
+
}),
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
} else {
|
|
66
|
+
process.stdout.write(` → register it with pi: pi install ${result.output}\n`);
|
|
67
|
+
}
|
|
44
68
|
} catch (err) {
|
|
45
69
|
process.stderr.write(`Install failed: ${err.message}\n`);
|
|
46
70
|
process.exit(1);
|
|
@@ -88,38 +112,34 @@ if (parsed.command === "install") {
|
|
|
88
112
|
process.exit(1);
|
|
89
113
|
}
|
|
90
114
|
}
|
|
115
|
+
}
|
|
91
116
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
process.exit(0);
|
|
100
|
-
} catch (err) {
|
|
101
|
-
process.stderr.write(`Install failed: ${err.message}\n`);
|
|
102
|
-
process.exit(1);
|
|
103
|
-
}
|
|
117
|
+
function printPiSweep({ removed }) {
|
|
118
|
+
if (removed.length === 0) return;
|
|
119
|
+
process.stdout.write(
|
|
120
|
+
` ✓ Removed ${removed.length} artifact(s) the pre-staged-model installer rendered into pi's user directory (one-time migration — the staged package is the source from now on)\n`,
|
|
121
|
+
);
|
|
122
|
+
for (const path of removed) {
|
|
123
|
+
process.stdout.write(` - ${path}\n`);
|
|
104
124
|
}
|
|
105
|
-
|
|
106
|
-
process.exit(0);
|
|
107
125
|
}
|
|
108
126
|
|
|
109
127
|
function printPiInstall(result) {
|
|
110
128
|
process.stdout.write(`Installing agent-cortex for "pi" harness…\n`);
|
|
129
|
+
process.stdout.write(` ✓ Staged pi package → ${result.output}\n`);
|
|
111
130
|
for (const agent of result.agents) {
|
|
112
131
|
process.stdout.write(` ✓ ${agent.name}.agent.md → ${agent.filePath}\n`);
|
|
113
132
|
}
|
|
114
133
|
process.stdout.write(` ✓ Substituted ${result.skills.md} markdown file(s) across ${result.skills.skills} skill(s) → ${result.skills.dir}\n`);
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
process.stdout.write(` ✓ ${
|
|
134
|
+
process.stdout.write(` ✓ Copied ${result.extensions.files} extension file(s) → ${result.extensions.dir}\n`);
|
|
135
|
+
for (const name of result.packages.bundled) {
|
|
136
|
+
process.stdout.write(` ✓ Bundled pi package ${name} → ${join(result.packages.dir, name)}\n`);
|
|
137
|
+
}
|
|
138
|
+
const transitive = result.packages.staged.length - result.packages.bundled.length;
|
|
139
|
+
if (transitive > 0) {
|
|
140
|
+
process.stdout.write(` ✓ Copied ${transitive} transitive dependency tree(s) → ${result.packages.dir}\n`);
|
|
122
141
|
}
|
|
142
|
+
process.stdout.write(` ✓ ${result.dryRun ? "Would write" : "Wrote"} ${result.manifest.path} (version ${result.manifest.manifest.version})\n`);
|
|
123
143
|
for (const warning of result.warnings) {
|
|
124
144
|
process.stdout.write(` ⚠ ${warning}\n`);
|
|
125
145
|
}
|
|
@@ -127,21 +147,3 @@ function printPiInstall(result) {
|
|
|
127
147
|
process.stdout.write("(dry-run — nothing written)\n");
|
|
128
148
|
}
|
|
129
149
|
}
|
|
130
|
-
|
|
131
|
-
/** Report one managed pi config file (settings.json / keybindings.json). */
|
|
132
|
-
function printManagedConfig(label, info) {
|
|
133
|
-
if (!info) return;
|
|
134
|
-
if (info.action === "would-remove-symlink") {
|
|
135
|
-
process.stdout.write(` → would remove symlink ${info.path} and write ${label}\n`);
|
|
136
|
-
} else if (info.action === "would-write") {
|
|
137
|
-
process.stdout.write(` → would write ${label} → ${info.path}\n`);
|
|
138
|
-
} else if (info.action === "unchanged") {
|
|
139
|
-
process.stdout.write(` · ${label} → ${info.path} (unchanged)\n`);
|
|
140
|
-
} else if (info.action === "skipped") {
|
|
141
|
-
process.stdout.write(` ⚠ ${label} modified after install — left untouched → ${info.path}\n`);
|
|
142
|
-
} else if (info.action === "removed-symlink") {
|
|
143
|
-
process.stdout.write(` ✓ ${label} → ${info.path} (removed legacy symlink)\n`);
|
|
144
|
-
} else {
|
|
145
|
-
process.stdout.write(` ✓ ${label} → ${info.path}\n`);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
@@ -97,8 +97,8 @@ const DEFAULT_WARN = (msg) => console.warn(`[claude-installer] ${msg}`);
|
|
|
97
97
|
// section composition from the poll-loop sources.
|
|
98
98
|
const DEFER = new Set(["ralph"]);
|
|
99
99
|
|
|
100
|
-
// Ralph-coupled
|
|
101
|
-
//
|
|
100
|
+
// Ralph-coupled pipeline skills that don't apply to the lean Claude Ralph (its completion
|
|
101
|
+
// handling is event-driven, not the pi orchestrator's). Not copied into the Claude plugin.
|
|
102
102
|
const SKILL_EXCLUDE = new Set(["ralph", "run-pipeline-stage"]);
|
|
103
103
|
|
|
104
104
|
const NAME_PREFIX = "agent-cortex:";
|