agents-inc 0.170.1 → 0.171.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/CHANGELOG.md +30 -0
- package/dist/{chunk-52HDHJ7I.js → chunk-24OD7IP4.js} +32 -21
- package/dist/chunk-24OD7IP4.js.map +1 -0
- package/dist/{chunk-MQ6CGZNJ.js → chunk-3YYHL76L.js} +1879 -2019
- package/dist/chunk-3YYHL76L.js.map +1 -0
- package/dist/chunk-4RQKCV6I.js +103 -0
- package/dist/chunk-4RQKCV6I.js.map +1 -0
- package/dist/{chunk-USVBYQSQ.js → chunk-5FM77WKW.js} +16 -6
- package/dist/chunk-5FM77WKW.js.map +1 -0
- package/dist/{chunk-HED2DAXZ.js → chunk-7IVLVEHX.js} +5 -5
- package/dist/chunk-7IVLVEHX.js.map +1 -0
- package/dist/{chunk-PJWGTNOX.js → chunk-A6OWEJGC.js} +144 -186
- package/dist/chunk-A6OWEJGC.js.map +1 -0
- package/dist/{chunk-BMRUNMPV.js → chunk-AWWCRL5A.js} +35 -35
- package/dist/chunk-AWWCRL5A.js.map +1 -0
- package/dist/{chunk-F2BHT5C4.js → chunk-EOKNEGRD.js} +129 -151
- package/dist/chunk-EOKNEGRD.js.map +1 -0
- package/dist/{chunk-NQW25DCF.js → chunk-GHHJYNAN.js} +1 -7
- package/dist/chunk-GHHJYNAN.js.map +1 -0
- package/dist/chunk-JGPE4RRE.js +35 -0
- package/dist/chunk-JGPE4RRE.js.map +1 -0
- package/dist/{chunk-JFLVEFFP.js → chunk-KIK5EZYD.js} +1 -1
- package/dist/chunk-KIK5EZYD.js.map +1 -0
- package/dist/{chunk-NCWDK6L7.js → chunk-KMOCMVK5.js} +254 -379
- package/dist/chunk-KMOCMVK5.js.map +1 -0
- package/dist/{chunk-4AAOOAIN.js → chunk-P6CYS4JK.js} +2 -2
- package/dist/chunk-P6CYS4JK.js.map +1 -0
- package/dist/chunk-QIR56IDM.js +1169 -0
- package/dist/chunk-QIR56IDM.js.map +1 -0
- package/dist/{chunk-6ZRH5RHC.js → chunk-R572RLTI.js} +4 -4
- package/dist/chunk-R572RLTI.js.map +1 -0
- package/dist/{chunk-WTWMGH2C.js → chunk-RDXY4GRO.js} +2 -2
- package/dist/chunk-RDXY4GRO.js.map +1 -0
- package/dist/{chunk-7RDMTR64.js → chunk-S2SKVJT2.js} +785 -256
- package/dist/chunk-S2SKVJT2.js.map +1 -0
- package/dist/{chunk-SZYQISA2.js → chunk-TNFYBKVD.js} +43 -29
- package/dist/chunk-TNFYBKVD.js.map +1 -0
- package/dist/{chunk-RIPSGNLU.js → chunk-W4KAY26P.js} +3 -3
- package/dist/chunk-W4KAY26P.js.map +1 -0
- package/dist/{chunk-OYJQUA3D.js → chunk-WDH6HHA3.js} +31 -13
- package/dist/chunk-WDH6HHA3.js.map +1 -0
- package/dist/{chunk-3G7X2WKI.js → chunk-WII6GOPM.js} +18 -38
- package/dist/chunk-WII6GOPM.js.map +1 -0
- package/dist/{chunk-F5EBEATU.js → chunk-WM2N2D6Q.js} +34 -46
- package/dist/chunk-WM2N2D6Q.js.map +1 -0
- package/dist/{chunk-KOLDW6SF.js → chunk-YLUOGAW7.js} +2 -2
- package/dist/chunk-YLUOGAW7.js.map +1 -0
- package/dist/{chunk-44TE3RKH.js → chunk-ZC6GC66J.js} +5 -4
- package/dist/chunk-ZC6GC66J.js.map +1 -0
- package/dist/{chunk-NEZ4OAOL.js → chunk-ZEGM3MVR.js} +3 -5
- package/dist/chunk-ZEGM3MVR.js.map +1 -0
- package/dist/commands/build/marketplace.js +46 -46
- package/dist/commands/build/marketplace.js.map +1 -1
- package/dist/commands/build/plugins.js +25 -28
- package/dist/commands/build/plugins.js.map +1 -1
- package/dist/commands/compile.js +87 -178
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/doctor.js +510 -360
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/edit.js +451 -357
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/eject.js +144 -125
- package/dist/commands/eject.js.map +1 -1
- package/dist/commands/init.js +20 -27
- package/dist/commands/list.js +39 -55
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/new/marketplace.js +6 -11
- package/dist/commands/new/marketplace.js.map +1 -1
- package/dist/commands/search.js +35 -32
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/share.js +17 -77
- package/dist/commands/share.js.map +1 -1
- package/dist/commands/uninstall.js +159 -222
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.js +9 -32
- package/dist/commands/update.js.map +1 -1
- package/dist/components/common/prompt-confirm.js +2 -2
- package/dist/components/common/removal-plan-confirm.js +2 -2
- package/dist/components/common/scroll-affordance.js +2 -2
- package/dist/components/common/select-list.js +2 -2
- package/dist/components/common/skill-agent-summary.js +4 -4
- package/dist/components/common/spinner.js +2 -4
- package/dist/components/common/summary-panel.js +5 -5
- package/dist/components/common/summary-panel.js.map +1 -1
- package/dist/config-exports.js +7 -3
- package/dist/config-exports.js.map +1 -1
- package/dist/hooks/init.js +18 -19
- package/dist/hooks/init.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/load-agent-defs-UBWITIEI.js +14 -0
- package/dist/recompile-project-agents-IQANWGOP.js +65 -0
- package/dist/recompile-project-agents-IQANWGOP.js.map +1 -0
- package/dist/{source-loader-C5SQXZXI.js → source-loader-YGG7DY2W.js} +5 -5
- package/dist/src/agents/developer/ai-developer/playbook.md +2 -5
- package/dist/src/agents/developer/api-developer/playbook.md +2 -5
- package/dist/src/agents/developer/cli-developer/playbook.md +2 -5
- package/dist/src/agents/developer/web-developer/playbook.md +2 -5
- package/dist/src/agents/meta/agent-summoner/output.md +2 -2
- package/dist/src/agents/meta/agent-summoner/playbook.md +1 -13
- package/dist/src/agents/meta/codex-keeper/critical-requirements.md +2 -5
- package/dist/src/agents/meta/convention-keeper/critical-requirements.md +2 -4
- package/dist/src/agents/tester/ai-tester/critical-requirements.md +1 -2
- package/dist/src/agents/tester/ai-tester/playbook.md +2 -0
- package/dist/src/agents/tester/api-tester/critical-requirements.md +1 -2
- package/dist/src/agents/tester/api-tester/playbook.md +2 -0
- package/dist/src/agents/tester/cli-tester/critical-requirements.md +1 -2
- package/dist/src/agents/tester/cli-tester/playbook.md +2 -0
- package/dist/src/agents/tester/web-tester/critical-requirements.md +1 -2
- package/dist/src/agents/tester/web-tester/playbook.md +2 -0
- package/package.json +9 -8
- package/src/agents/developer/ai-developer/playbook.md +2 -5
- package/src/agents/developer/api-developer/playbook.md +2 -5
- package/src/agents/developer/cli-developer/playbook.md +2 -5
- package/src/agents/developer/web-developer/playbook.md +2 -5
- package/src/agents/meta/agent-summoner/output.md +2 -2
- package/src/agents/meta/agent-summoner/playbook.md +1 -13
- package/src/agents/meta/codex-keeper/critical-requirements.md +2 -5
- package/src/agents/meta/convention-keeper/critical-requirements.md +2 -4
- package/src/agents/tester/ai-tester/critical-requirements.md +1 -2
- package/src/agents/tester/ai-tester/playbook.md +2 -0
- package/src/agents/tester/api-tester/critical-requirements.md +1 -2
- package/src/agents/tester/api-tester/playbook.md +2 -0
- package/src/agents/tester/cli-tester/critical-requirements.md +1 -2
- package/src/agents/tester/cli-tester/playbook.md +2 -0
- package/src/agents/tester/web-tester/critical-requirements.md +1 -2
- package/src/agents/tester/web-tester/playbook.md +2 -0
- package/src/schemas/project-config.schema.json +0 -3
- package/src/schemas/project-source-config.schema.json +0 -6
- package/dist/chunk-3G7X2WKI.js.map +0 -1
- package/dist/chunk-44TE3RKH.js.map +0 -1
- package/dist/chunk-4AAOOAIN.js.map +0 -1
- package/dist/chunk-52HDHJ7I.js.map +0 -1
- package/dist/chunk-6HNXYYVF.js +0 -373
- package/dist/chunk-6HNXYYVF.js.map +0 -1
- package/dist/chunk-6ZRH5RHC.js.map +0 -1
- package/dist/chunk-7RDMTR64.js.map +0 -1
- package/dist/chunk-BMRUNMPV.js.map +0 -1
- package/dist/chunk-CLPUWOSA.js +0 -46
- package/dist/chunk-CLPUWOSA.js.map +0 -1
- package/dist/chunk-F2BHT5C4.js.map +0 -1
- package/dist/chunk-F5EBEATU.js.map +0 -1
- package/dist/chunk-HED2DAXZ.js.map +0 -1
- package/dist/chunk-JFLVEFFP.js.map +0 -1
- package/dist/chunk-KOLDW6SF.js.map +0 -1
- package/dist/chunk-MQ6CGZNJ.js.map +0 -1
- package/dist/chunk-NCWDK6L7.js.map +0 -1
- package/dist/chunk-NEZ4OAOL.js.map +0 -1
- package/dist/chunk-NIHUOWE4.js +0 -106
- package/dist/chunk-NIHUOWE4.js.map +0 -1
- package/dist/chunk-NQW25DCF.js.map +0 -1
- package/dist/chunk-OYJQUA3D.js.map +0 -1
- package/dist/chunk-PJWGTNOX.js.map +0 -1
- package/dist/chunk-RIPSGNLU.js.map +0 -1
- package/dist/chunk-SZYQISA2.js.map +0 -1
- package/dist/chunk-USVBYQSQ.js.map +0 -1
- package/dist/chunk-V3KTSP3Q.js +0 -940
- package/dist/chunk-V3KTSP3Q.js.map +0 -1
- package/dist/chunk-WTWMGH2C.js.map +0 -1
- package/dist/load-agent-defs-YMDWBFDP.js +0 -14
- package/dist/recompile-project-agents-SZ76WNTW.js +0 -18
- package/dist/source-loader-C5SQXZXI.js.map +0 -1
- /package/dist/{load-agent-defs-YMDWBFDP.js.map → load-agent-defs-UBWITIEI.js.map} +0 -0
- /package/dist/{recompile-project-agents-SZ76WNTW.js.map → source-loader-YGG7DY2W.js.map} +0 -0
|
@@ -12,10 +12,8 @@ proposal that describes a change leaves the wording to whoever applies it, and t
|
|
|
12
12
|
approved rule turns into a different one.
|
|
13
13
|
|
|
14
14
|
**Confirm the target file and section exist before you propose an edit, and read the rule back in
|
|
15
|
-
place after you apply one.** No check does this for you
|
|
16
|
-
|
|
17
|
-
quietly in a project that declares no such script. A rule that read correctly in the proposal can
|
|
18
|
-
contradict the one above it once it lands, and a proposal naming a section that no longer exists
|
|
15
|
+
place after you apply one.** No check does this for you. A rule that read correctly in the proposal
|
|
16
|
+
can contradict the one above it once it lands, and a proposal naming a section that no longer exists
|
|
19
17
|
cannot be applied at all.
|
|
20
18
|
|
|
21
19
|
**Mark a processed finding resolved in its own file, at its own path** — `status: resolved` plus a
|
|
@@ -34,8 +34,7 @@ pass threshold.** An eval in the blocking suite fails for reasons no one can rep
|
|
|
34
34
|
**Watch each test fail for the right reason before the implementation exists, then pass after it.**
|
|
35
35
|
A test that has never failed has not been shown to test anything.
|
|
36
36
|
|
|
37
|
-
**Run the suite and report its actual output before claiming completion.**
|
|
38
|
-
the project's typecheck and nothing else, so whether the tests pass is yours to establish.
|
|
37
|
+
**Run the suite and report its actual output before claiming completion.**
|
|
39
38
|
|
|
40
39
|
<self_correction_triggers>
|
|
41
40
|
|
|
@@ -144,6 +144,8 @@ the code does rather than what the feature owes.
|
|
|
144
144
|
2. Run with a randomized test order if the runner supports it
|
|
145
145
|
3. Confirm no test leaks timers, streams, or unclosed handles
|
|
146
146
|
4. Confirm the eval suite is excluded from the default run
|
|
147
|
+
5. Run the project's typecheck once the implementation exists, and fix every error it reports in a
|
|
148
|
+
test file — a runner that strips types runs a test file the compiler rejects
|
|
147
149
|
|
|
148
150
|
**ITERATE: Fix causes, not symptoms**
|
|
149
151
|
1. Flaky test? Find the nondeterminism (clock, ordering, shared fixture, live call) and remove it
|
|
@@ -24,8 +24,7 @@ somewhere else entirely, which is where the debugging time goes.
|
|
|
24
24
|
data-integrity bugs — a handler that returns 201 and persists nothing passes an
|
|
25
25
|
HTTP-only assertion.
|
|
26
26
|
|
|
27
|
-
**Run the suite and report its actual output before claiming completion.**
|
|
28
|
-
the project's typecheck and nothing else, so whether the tests pass is yours to establish.
|
|
27
|
+
**Run the suite and report its actual output before claiming completion.**
|
|
29
28
|
|
|
30
29
|
**Record a finding the way this project's conventions direct** when you fix an anti-pattern or
|
|
31
30
|
discover a missing standard, so the next agent inherits it rather than rediscovering it.
|
|
@@ -63,6 +63,8 @@ nothing to do with the endpoint under test.
|
|
|
63
63
|
2. Verify tests fail for expected reasons (not setup errors)
|
|
64
64
|
3. Check tests pass after implementation exists
|
|
65
65
|
4. Confirm database cleanup prevents test pollution
|
|
66
|
+
5. Run the project's typecheck once the implementation exists, and fix every error it reports in a
|
|
67
|
+
test file — a runner that strips types runs a test file the compiler rejects
|
|
66
68
|
|
|
67
69
|
**ITERATE: Fix and Improve**
|
|
68
70
|
1. If tests are flaky, check for shared database state
|
|
@@ -26,8 +26,7 @@ removed rather than deprecated.
|
|
|
26
26
|
A test that passes immediately has not been shown to test anything.
|
|
27
27
|
|
|
28
28
|
**Run the suite with the project's own test command — the `test` script in its `package.json` — and
|
|
29
|
-
report the actual output before claiming completion.**
|
|
30
|
-
typecheck and nothing else, so whether the tests pass is yours to establish.
|
|
29
|
+
report the actual output before claiming completion.**
|
|
31
30
|
|
|
32
31
|
<self_correction_triggers>
|
|
33
32
|
|
|
@@ -60,6 +60,8 @@ file for a reason none of them names.
|
|
|
60
60
|
2. Verify tests fail for expected reasons (not syntax errors)
|
|
61
61
|
3. Check tests pass after implementation exists
|
|
62
62
|
4. Confirm cleanup prevents memory leaks
|
|
63
|
+
5. Run the project's typecheck once the implementation exists, and fix every error it reports in a
|
|
64
|
+
test file — a runner that strips types runs a test file the compiler rejects
|
|
63
65
|
|
|
64
66
|
**ITERATE: Fix and Improve**
|
|
65
67
|
1. If tests are flaky, find what they race — an unfired effect, a missing unmount, a shared store —
|
|
@@ -17,8 +17,7 @@ drifts from it.
|
|
|
17
17
|
**Mock the boundaries — APIs, databases, external services — so no test reaches a real one.** A
|
|
18
18
|
suite that talks to a live service fails for reasons that have nothing to do with the code.
|
|
19
19
|
|
|
20
|
-
**Run the suite and report its actual output before claiming completion.**
|
|
21
|
-
the project's typecheck and nothing else, so whether the tests pass is yours to establish.
|
|
20
|
+
**Run the suite and report its actual output before claiming completion.**
|
|
22
21
|
|
|
23
22
|
<self_correction_triggers>
|
|
24
23
|
|
|
@@ -54,6 +54,8 @@ result.
|
|
|
54
54
|
1. web-developer cleans up the implementation without changing behavior
|
|
55
55
|
2. Re-run the suite - it must still pass, unedited
|
|
56
56
|
3. A test that reddens on a behavior-preserving refactor was testing implementation; fix that test
|
|
57
|
+
4. Run the project's typecheck, and fix every error it reports in a test file - a runner that strips
|
|
58
|
+
types runs a test file the compiler rejects
|
|
57
59
|
|
|
58
60
|
**Hand Off to Developer:**
|
|
59
61
|
- Provide complete test file
|
|
@@ -14,9 +14,6 @@
|
|
|
14
14
|
"marketplaceName": {
|
|
15
15
|
"type": "string"
|
|
16
16
|
},
|
|
17
|
-
"agentsSource": {
|
|
18
|
-
"type": "string"
|
|
19
|
-
},
|
|
20
17
|
"branding": {
|
|
21
18
|
"type": "object",
|
|
22
19
|
"properties": {
|
|
@@ -29,9 +26,6 @@
|
|
|
29
26
|
"skillsDir": {
|
|
30
27
|
"type": "string"
|
|
31
28
|
},
|
|
32
|
-
"agentsDir": {
|
|
33
|
-
"type": "string"
|
|
34
|
-
},
|
|
35
29
|
"stacksFile": {
|
|
36
30
|
"type": "string"
|
|
37
31
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/lib/agents/agent-fetcher.ts","../src/cli/lib/agents/agent-plugin-compiler.ts"],"sourcesContent":["import path from \"path\";\nimport { directoryExists } from \"../../utils/fs\";\nimport { verbose } from \"../../utils/logger\";\nimport { PROJECT_ROOT, DIRS } from \"../../consts\";\nimport { fetchFromSource, type FetchOptions } from \"../loading\";\nimport { loadSourceRepoConfig } from \"../configuration\";\nimport type { AgentSourcePaths } from \"../../types\";\n\nexport async function getAgentDefinitions(remoteSource?: string): Promise<AgentSourcePaths> {\n if (remoteSource) {\n return fetchAgentDefinitionsFromRemote(remoteSource);\n }\n return getLocalAgentDefinitions();\n}\n\nexport async function getLocalAgentDefinitions(): Promise<AgentSourcePaths> {\n const agentsDir = path.join(PROJECT_ROOT, DIRS.agents);\n\n if (!(await directoryExists(agentsDir))) {\n throw new Error(\n `Agent partials not found at '${agentsDir}'. Ensure the CLI is properly installed.`,\n );\n }\n\n verbose(`Agent partials loaded from CLI: ${agentsDir}`);\n\n return {\n agentsDir,\n sourcePath: PROJECT_ROOT,\n };\n}\n\nexport async function fetchAgentDefinitionsFromRemote(\n source: string,\n options: FetchOptions & { agentsDir?: string } = {},\n): Promise<AgentSourcePaths> {\n verbose(`Fetching agent partials from remote: ${source}`);\n\n const result = await fetchFromSource(source, { subdir: \"\" });\n\n // ABORT on an unreadable config. It names the directory the fetched repository keeps its agent\n // partials in; defaulting past it compiles agents from whatever happens to sit at `DIRS.agents`,\n // or reports partials missing from a repository that has them.\n const sourceProjectConfig = options.agentsDir\n ? undefined\n : await loadSourceRepoConfig(result.path);\n if (sourceProjectConfig?.agentsDir) {\n verbose(`Using agentsDir from source config: ${sourceProjectConfig.agentsDir}`);\n }\n const agentsDirRelPath = options.agentsDir ?? sourceProjectConfig?.agentsDir ?? DIRS.agents;\n\n const agentsDir = path.join(result.path, agentsDirRelPath);\n\n if (!(await directoryExists(agentsDir))) {\n throw new Error(`Agent partials not found at '${agentsDir}'`);\n }\n\n verbose(`Agent partials fetched from: ${result.path}`);\n\n return {\n agentsDir,\n sourcePath: result.path,\n };\n}\n","import path from \"path\";\nimport { getErrorMessage } from \"../../utils/errors\";\nimport { readFile, ensureDir, copy } from \"../../utils/fs\";\nimport { log, verbose, warn } from \"../../utils/logger\";\nimport {\n generateAgentPluginManifest,\n writePluginManifest,\n getPluginManifestPath,\n} from \"../plugins\";\nimport { listAgentMdFiles } from \"./list-compiled-agents\";\nimport { computeStringHash, determinePluginVersion, writeContentHash } from \"../versioning\";\nimport { extractFrontmatter } from \"../../utils/frontmatter\";\nimport { plural } from \"../../utils/string\";\nimport type { AgentFrontmatter, PluginManifest } from \"../../types\";\nimport { agentFrontmatterValidationSchema, formatZodIssues } from \"../schemas\";\n\nexport type AgentPluginOptions = {\n agentPath: string;\n outputDir: string;\n};\n\nexport type CompiledAgentPlugin = {\n pluginPath: string;\n manifest: PluginManifest;\n agentName: string;\n};\n\n/**\n * The frontmatter a plugin build needs, or the reason it could not be had.\n *\n * The reason is carried out rather than discarded because the throw in\n * {@link compileAgentPlugin} is the only thing a `build` run surfaces for a failed agent, and it\n * used to name `name` and `description` whatever had actually gone wrong — so an agent rejected\n * for an unknown key or a bad enum value was reported as missing two fields it declared correctly.\n *\n * Nothing is warned here, deliberately. This function is private and has one caller, which throws\n * on every failure, and {@link compileAllAgentPlugins} catches that throw and warns the message —\n * so a warning here would print the same cause twice. The shared `parseFrontmatter` on the skill\n * side keeps its own warn for the opposite reason: most of its callers skip rather than throw.\n */\ntype AgentFrontmatterParse =\n | { ok: true; frontmatter: Pick<AgentFrontmatter, \"name\" | \"description\"> }\n | { ok: false; reason: string };\n\n/** The reason when there is no frontmatter block at all, as opposed to one the schema refused. */\nconst NO_FRONTMATTER_REASON = \"no YAML frontmatter block\";\n\nfunction parseAgentFrontmatter(content: string): AgentFrontmatterParse {\n const raw = extractFrontmatter(content);\n if (!raw) {\n return { ok: false, reason: NO_FRONTMATTER_REASON };\n }\n\n const result = agentFrontmatterValidationSchema.safeParse(raw);\n if (!result.success) {\n return { ok: false, reason: formatZodIssues(result.error.issues) };\n }\n\n return {\n ok: true,\n frontmatter: { name: result.data.name, description: result.data.description },\n };\n}\n\nexport async function compileAgentPlugin(\n options: AgentPluginOptions,\n): Promise<CompiledAgentPlugin> {\n const { agentPath, outputDir } = options;\n const fileName = path.basename(agentPath);\n\n const content = await readFile(agentPath);\n const parsed = parseAgentFrontmatter(content);\n\n if (!parsed.ok) {\n throw new Error(\n `Agent '${fileName}' has invalid or missing YAML frontmatter: ${parsed.reason}. ` +\n `File: ${agentPath}`,\n );\n }\n\n const agentName = parsed.frontmatter.name;\n\n verbose(`Compiling agent plugin: ${agentName} from ${agentPath}`);\n\n const pluginDir = path.join(outputDir, `agent-${agentName}`);\n const agentsDir = path.join(pluginDir, \"agents\");\n\n await ensureDir(pluginDir);\n await ensureDir(agentsDir);\n\n const newHash = computeStringHash(content);\n const { version, contentHash } = await determinePluginVersion(\n newHash,\n pluginDir,\n getPluginManifestPath,\n );\n\n const manifest = generateAgentPluginManifest({\n agentName,\n description: parsed.frontmatter.description,\n version,\n });\n\n await writePluginManifest(pluginDir, manifest);\n\n await writeContentHash(pluginDir, contentHash, getPluginManifestPath);\n\n verbose(` Wrote plugin.json for ${agentName} (v${version})`);\n\n await copy(agentPath, path.join(agentsDir, `${agentName}.md`));\n verbose(` Copied agent ${fileName} -> agents/${agentName}.md`);\n\n return {\n pluginPath: pluginDir,\n manifest,\n agentName,\n };\n}\n\nexport async function compileAllAgentPlugins(\n agentsDir: string,\n outputDir: string,\n): Promise<CompiledAgentPlugin[]> {\n const results: CompiledAgentPlugin[] = [];\n\n const agentMdFiles = await listAgentMdFiles(agentsDir);\n\n for (const agentFile of agentMdFiles) {\n const agentPath = path.join(agentsDir, agentFile);\n\n try {\n const result = await compileAgentPlugin({\n agentPath,\n outputDir,\n });\n results.push(result);\n log(` [OK] agent-${result.agentName}`);\n } catch (error) {\n const errorMessage = getErrorMessage(error);\n warn(`Failed to compile agent from '${agentFile}': ${errorMessage}`);\n }\n }\n\n return results;\n}\n\nexport function printAgentCompilationSummary(results: CompiledAgentPlugin[]): void {\n log(`\\nCompiled ${plural(results.length, \"agent plugin\")}:`);\n for (const result of results) {\n log(` - agent-${result.agentName} (v${result.manifest.version})`);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,UAAU;AAQjB,eAAsB,oBAAoB,cAAkD;AAC1F,MAAI,cAAc;AAChB,WAAO,gCAAgC,YAAY;AAAA,EACrD;AACA,SAAO,yBAAyB;AAClC;AAEA,eAAsB,2BAAsD;AAC1E,QAAM,YAAY,KAAK,KAAK,cAAc,KAAK,MAAM;AAErD,MAAI,CAAE,MAAM,gBAAgB,SAAS,GAAI;AACvC,UAAM,IAAI;AAAA,MACR,gCAAgC,SAAS;AAAA,IAC3C;AAAA,EACF;AAEA,UAAQ,mCAAmC,SAAS,EAAE;AAEtD,SAAO;AA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A,IACxC,SAAS,OAAO;AACd,YAAM,eAAe,gBAAgB,KAAK;AAC1C,WAAK,iCAAiC,SAAS,MAAM,YAAY,EAAE;AAAA,IACrE;AAAA,EACF;AAEA,SAAO;AACT;AAEO,SAAS,6BAA6B,SAAsC;AACjF,MAAI;AAAA,WAAc,OAAO,QAAQ,QAAQ,cAAc,CAAC,GAAG;AAC3D,aAAW,UAAU,SAAS;AAC5B,QAAI,aAAa,OAAO,SAAS,MAAM,OAAO,SAAS,OAAO,GAAG;AAAA,EACnE;AACF;","names":["path","path"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/components/common/select-list.tsx","../src/cli/components/hooks/use-keyboard-navigation.ts"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { Box, Text } from \"ink\";\nimport { CLI_COLORS, UI_SYMBOLS } from \"../../consts.js\";\nimport { useKeyboardNavigation } from \"../hooks/use-keyboard-navigation.js\";\n\nexport type SelectListItem<T> = {\n value: T;\n label: string;\n};\n\nexport type SelectListProps<T> = {\n items: readonly SelectListItem<T>[];\n onSelect: (value: T) => void;\n onCancel?: (() => void) | undefined;\n renderItem?: ((item: SelectListItem<T>, isFocused: boolean) => React.ReactNode) | undefined;\n active?: boolean | undefined;\n};\n\nexport function SelectList<T>({\n items,\n onSelect,\n onCancel,\n renderItem,\n active,\n}: SelectListProps<T>): React.ReactElement {\n const handleEnter = useCallback(\n (index: number) => {\n const item = items[index];\n if (item) {\n onSelect(item.value);\n }\n },\n [items, onSelect],\n );\n\n const { focusedIndex } = useKeyboardNavigation(\n items.length,\n { onEnter: handleEnter, ...(onCancel !== undefined && { onEscape: onCancel }) },\n { vimKeys: false, ...(active !== undefined && { active }) },\n );\n\n return (\n <Box flexDirection=\"column\">\n {items.map((item, index) => {\n const isFocused = index === focusedIndex;\n const marker = isFocused ? UI_SYMBOLS.CHEVRON : UI_SYMBOLS.CHEVRON_SPACER;\n\n return (\n <Box key={index}>\n <Text bold={isFocused} {...(isFocused && { color: CLI_COLORS.PRIMARY })}>\n {marker}{\" \"}\n </Text>\n {renderItem ? (\n renderItem(item, isFocused)\n ) : (\n <Text bold={isFocused} {...(isFocused && { color: CLI_COLORS.PRIMARY })}>\n {item.label}\n </Text>\n )}\n </Box>\n );\n })}\n </Box>\n );\n}\n","import type { Dispatch, SetStateAction } from \"react\";\nimport { useState, useCallback, useRef } from \"react\";\nimport { useInput, type Key } from \"ink\";\n\ntype KeyboardNavigationHandlers = {\n onEnter?: (focusedIndex: number) => void;\n onEscape?: () => void;\n};\n\ntype KeyboardNavigationOptions = {\n wrap?: boolean;\n vimKeys?: boolean;\n active?: boolean;\n};\n\nexport function useKeyboardNavigation(\n itemCount: number,\n handlers: KeyboardNavigationHandlers = {},\n options: KeyboardNavigationOptions = {},\n): {\n focusedIndex: number;\n setFocusedIndex: Dispatch<SetStateAction<number>>;\n} {\n const { onEnter, onEscape } = handlers;\n const { wrap = true, vimKeys = true, active = true } = options;\n\n const [focusedIndex, setRenderedIndex] = useState(0);\n // The focus the handlers read, written the moment it moves rather than once the move renders.\n // Keys that arrive in one chunk — a fast typist, a paste — are handled one after another with no\n // render between them, so a copy synced by an effect still held the focus from before the burst\n // when Enter read it: Down, Down, Enter on the dashboard ran Edit.\n const focusedIndexRef = useRef(focusedIndex);\n\n const setFocusedIndex = useCallback<Dispatch<SetStateAction<number>>>((action) => {\n const next = typeof action === \"function\" ? action(focusedIndexRef.current) : action;\n focusedIndexRef.current = next;\n setRenderedIndex(next);\n }, []);\n\n const moveUp = useCallback(() => {\n setFocusedIndex((prev) => {\n if (wrap) {\n return (prev - 1 + itemCount) % itemCount;\n }\n return Math.max(0, prev - 1);\n });\n }, [itemCount, wrap, setFocusedIndex]);\n\n const moveDown = useCallback(() => {\n setFocusedIndex((prev) => {\n if (wrap) {\n return (prev + 1) % itemCount;\n }\n return Math.min(itemCount - 1, prev + 1);\n });\n }, [itemCount, wrap, setFocusedIndex]);\n\n useInput(\n useCallback(\n (input: string, key: Key) => {\n if (key.escape) {\n onEscape?.();\n return;\n }\n\n if (key.return) {\n onEnter?.(focusedIndexRef.current);\n return;\n }\n\n if (key.upArrow || (vimKeys && input === \"k\")) {\n moveUp();\n return;\n }\n\n if (key.downArrow || (vimKeys && input === \"j\")) {\n moveDown();\n }\n },\n [onEnter, onEscape, vimKeys, moveUp, moveDown],\n ),\n { isActive: active },\n );\n\n return { focusedIndex, setFocusedIndex };\n}\n"],"mappings":";;;;;;;AAAA,SAAgB,eAAAA,oBAAmB;AACnC,SAAS,KAAK,YAAY;;;ACA1B,SAAS,UAAU,aAAa,cAAc;AAC9C,SAAS,gBAA0B;AAa5B,SAAS,sBACd,WACA,WAAuC,CAAC,GACxC,UAAqC,CAAC,GAItC;AACA,QAAM,EAAE,SAAS,SAAS,IAAI;AAC9B,QAAM,EAAE,OAAO,MAAM,UAAU,MAAM,SAAS,KAAK,IAAI;AAEvD,QAAM,CAAC,cAAc,gBAAgB,IAAI,SAAS,CAAC;AAKnD,QAAM,kBAAkB,OAAO,YAAY;AAE3C,QAAM,kBAAkB,YAA8C,CAAC,WAAW;AAChF,UAAM,OAAO,OAAO,WAAW,aAAa,OAAO,gBAAgB,OAAO,IAAI;AAC9E,oBAAgB,UAAU;AAC1B,qBAAiB,IAAI;AAAA,EACvB,GAAG,CAAC,CAAC;AAEL,QAAM,SAAS,YAAY,MAAM;AAC/B,oBAAgB,CAAC,SAAS;AACxB,UAAI,MAAM;AACR,gBAAQ,OAAO,IAAI,aAAa;AAAA,MAClC;AACA,aAAO,KAAK,IAAI,GAAG,OAAO,CAAC;AAAA,IAC7B,CAAC;AAAA,EACH,GAAG,CAAC,WAAW,MAAM,eAAe,CAAC;AAErC,QAAM,WAAW,YAAY,MAAM;AACjC,oBAAgB,CAAC,SAAS;AACxB,UAAI,MAAM;AACR,gBAAQ,OAAO,KAAK;AAAA,MACtB;AACA,aAAO,KAAK,IAAI,YAAY,GAAG,OAAO,CAAC;AAAA,IACzC,CAAC;AAAA,EACH,GA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AQ;AAAA,SACX;AAAA,MACC,aACC,WAAW,MAAM,SAAS,IAE1B,oBAAC,QAAK,MAAM,WAAY,GAAI,aAAa,EAAE,OAAO,WAAW,QAAQ,GAClE,eAAK,OACR;AAAA,SATM,KAWV;AAAA,EAEJ,CAAC,GACH;AAEJ;","names":["useCallback","useCallback"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/components/common/prompt-confirm.tsx"],"sourcesContent":["import React from \"react\";\nimport { render } from \"../render.js\";\n\nexport type ConfirmHandlers = {\n onConfirm: () => void;\n onCancel: () => void;\n};\n\nexport type PromptValueOptions<T> = {\n /** Value resolved when the Ink app exits before any callback fires (Ctrl+C / render failure). */\n onExit: T;\n /** Call instance.clear() before unmount — repaints a clean terminal (used by the dashboard). */\n clearOnResolve?: boolean;\n};\n\n/**\n * Renders an Ink prompt and resolves with the value produced by its callbacks.\n * First-wins: the first resolve (a callback or the app-exit fallback) settles the\n * promise; later resolves are ignored. The element is unmounted at the resolution\n * site (optionally cleared first). Callers own exit policy (exit codes, logging).\n *\n * A prompt may resolve before `render()` has handed its instance back: Ink flushes\n * mount effects synchronously, so a component that settles on mount reaches the\n * callback first. The teardown is then run the moment the instance exists — one\n * statement later, on the same tick — so callers that resolve from a keypress see\n * exactly the order they always did.\n *\n * The terminal is raw before the first frame is painted, through {@link holdInputRaw}.\n */\nexport async function promptValue<T>(\n build: (resolve: (value: T) => void) => React.ReactElement,\n options: PromptValueOptions<T>,\n): Promise<T> {\n // The promise's own `resolve`, lifted out so the render can be a plain `const` below\n // rather than a binding the element's callbacks would reach while `render()` is still\n // producing it. The seed is never called: a Promise executor runs synchronously, so the\n // next statement has already replaced it by the time anything can answer.\n const answer: { settle: (value: T) => void } = { settle: () => {} };\n const chosen = new Promise<T>((resolve) => {\n answer.settle = resolve;\n });\n\n const releaseInput = holdInputRaw(process.stdin);\n try {\n const instance = render(build((value) => answer.settle(value)));\n\n // App exit without a callback (e.g. Ctrl+C) or a render failure counts as the\n // fallback; the promise is first-wins, so a prior callback value is unaffected.\n instance.waitUntilExit().then(\n () => answer.settle(options.onExit),\n () => answer.settle(options.onExit),\n );\n\n const value = await chosen;\n\n // Taken down here rather than at each resolve site: it then happens exactly once,\n // whichever of the three endings settled the promise, and always with an instance in\n // hand — including the ending that arrives before `render()` has returned one.\n if (options.clearOnResolve) instance.clear();\n instance.unmount();\n\n return value;\n } finally {\n releaseInput();\n }\n}\n\n/**\n * Puts a terminal's input into raw mode for as long as a prompt is up, and returns what puts it\n * back the way it was. Input that is not a terminal has no mode to set, and is left alone.\n *\n * Ink takes raw mode only from `useInput`'s effect, which runs after the frame it belongs to has\n * been written. A key pressed between the two reaches a terminal still in cooked mode: the kernel\n * echoes an Enter as a line break, which scrolls a full-height frame up by a line that is never\n * repainted, and turns it into `\\n`, which Ink reads as `enter` — and every prompt here waits for\n * `return`. Taken here, before the render, the key is held as typed until Ink starts reading.\n *\n * Ink's own handling is unchanged: `useInput` still sets raw mode and Ink still turns it off at\n * unmount. This closes the gap before the effect, and restores the mode for a prompt that never\n * took input or failed to render, where Ink has nothing to turn off.\n *\n * Prompts only, never every render: raw mode turns Ctrl+C into a byte for whoever reads input,\n * and the spinner reads none, so a load under it could no longer be interrupted.\n */\nfunction holdInputRaw(input: NodeJS.ReadStream): () => void {\n if (!input.isTTY) return () => {};\n const wasRaw = input.isRaw;\n input.setRawMode(true);\n return () => {\n input.setRawMode(wasRaw);\n };\n}\n\n/**\n * Renders a confirm UI and resolves with the user's choice. The element is\n * unmounted as soon as either handler fires; a clean exit or render failure\n * without a choice resolves as \"cancelled\". Callers own exit policy.\n */\nexport async function promptConfirm(\n build: (handlers: ConfirmHandlers) => React.ReactElement,\n): Promise<\"confirmed\" | \"cancelled\"> {\n return promptValue<\"confirmed\" | \"cancelled\">(\n (resolve) =>\n build({ onConfirm: () => resolve(\"confirmed\"), onCancel: () => resolve(\"cancelled\") }),\n { onExit: \"cancelled\" },\n );\n}\n"],"mappings":";;;;;;AAAA,OAAkB;AA6BlB,eAAsB,YACpB,OACA,SACY;AAKZ,QAAM,SAAyC,EAAE,QAAQ,MAAM;AAAA,EAAC,EAAE;AAClE,QAAM,SAAS,IAAI,QAAW,CAAC,YAAY;AACzC,WAAO,SAAS;AAAA,EAClB,CAAC;AAED,QAAM,eAAe,aAAa,QAAQ,KAAK;AAC/C,MAAI;AACF,UAAM,WAAW,OAAO,MAAM,CAACA,WAAU,OAAO,OAAOA,MAAK,CAAC,CAAC;AAI9D,aAAS,cAAc,EAAE;AAAA,MACvB,MAAM,OAAO,OAAO,QAAQ,MAAM;AAAA,MAClC,MAAM,OAAO,OAAO,QAAQ,MAAM;AAAA,IACpC;AAEA,UAAM,QAAQ,MAAM;AAKpB,QAAI,QAAQ,eAAgB,UAAS,MAAM;AAC3C,aAAS,QAAQ;AAEjB,WAAO;AAAA,EACT,UAAE;AACA,iBAAa;AAAA,EACf;AACF;AAmBA,SAAS,aAAa,OAAsC;AAC1D,MAAI,CAAC,MAAM,MAAO,QAAO,MAAM;AAAA,EAAC;AAChC,QAAM,SAAS,MAAM;AACrB,QAAM,WAAW,IAAI;AACrB,SAAO,MAAM;AACX,UAAM,WAAW,MAAM;AAAA,EACzB;AACF;AAOA,eAAsB,cACpB,OACoC;AACpC,SAAO;AAAA,IACL,CAAC,YACC,MAAM,EAAE,WAAW,MAAM,QAAQ,WAAW,GAAG,UAAU,MAAM,QAAQ,WAAW,EAAE,CAAC;AAAA,IACvF,EAAE,QAAQ,YAAY;AAAA,EACxB;AACF;","names":["value"]}
|