@cat-factory/agents 0.6.0 → 0.7.2
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/LICENSE +21 -21
- package/dist/agents/prompts/roles.js +1 -1
- package/dist/agents/prompts/roles.js.map +1 -1
- package/dist/agents/runtime/web-search.js +7 -7
- package/package.json +9 -4
- package/dist/agents/AiAgentExecutor.d.ts +0 -72
- package/dist/agents/AiAgentExecutor.d.ts.map +0 -1
- package/dist/agents/AiAgentExecutor.js +0 -125
- package/dist/agents/AiAgentExecutor.js.map +0 -1
- package/dist/agents/acceptance-prompts.d.ts +0 -29
- package/dist/agents/acceptance-prompts.d.ts.map +0 -1
- package/dist/agents/acceptance-prompts.js +0 -112
- package/dist/agents/acceptance-prompts.js.map +0 -1
- package/dist/agents/agent-catalog.d.ts +0 -6
- package/dist/agents/agent-catalog.d.ts.map +0 -1
- package/dist/agents/agent-catalog.js +0 -197
- package/dist/agents/agent-catalog.js.map +0 -1
- package/dist/agents/agent-configs.d.ts +0 -17
- package/dist/agents/agent-configs.d.ts.map +0 -1
- package/dist/agents/agent-configs.js +0 -66
- package/dist/agents/agent-configs.js.map +0 -1
- package/dist/agents/agent-routing.d.ts +0 -57
- package/dist/agents/agent-routing.d.ts.map +0 -1
- package/dist/agents/agent-routing.js +0 -41
- package/dist/agents/agent-routing.js.map +0 -1
- package/dist/agents/business-logic-prompts.d.ts +0 -28
- package/dist/agents/business-logic-prompts.d.ts.map +0 -1
- package/dist/agents/business-logic-prompts.js +0 -96
- package/dist/agents/business-logic-prompts.js.map +0 -1
- package/dist/agents/ci-gate.d.ts +0 -2
- package/dist/agents/ci-gate.d.ts.map +0 -1
- package/dist/agents/ci-gate.js +0 -33
- package/dist/agents/ci-gate.js.map +0 -1
- package/dist/agents/companion-prompts.d.ts +0 -4
- package/dist/agents/companion-prompts.d.ts.map +0 -1
- package/dist/agents/companion-prompts.js +0 -27
- package/dist/agents/companion-prompts.js.map +0 -1
- package/dist/agents/companions.d.ts +0 -20
- package/dist/agents/companions.d.ts.map +0 -1
- package/dist/agents/companions.js +0 -38
- package/dist/agents/companions.js.map +0 -1
- package/dist/agents/mock-prompts.d.ts +0 -12
- package/dist/agents/mock-prompts.d.ts.map +0 -1
- package/dist/agents/mock-prompts.js +0 -61
- package/dist/agents/mock-prompts.js.map +0 -1
- package/dist/agents/prompt-fragments.d.ts +0 -17
- package/dist/agents/prompt-fragments.d.ts.map +0 -1
- package/dist/agents/prompt-fragments.js +0 -33
- package/dist/agents/prompt-fragments.js.map +0 -1
- package/dist/agents/prompt-shared.d.ts +0 -7
- package/dist/agents/prompt-shared.d.ts.map +0 -1
- package/dist/agents/prompt-shared.js +0 -10
- package/dist/agents/prompt-shared.js.map +0 -1
- package/dist/agents/prompt-versions.d.ts +0 -48
- package/dist/agents/prompt-versions.d.ts.map +0 -1
- package/dist/agents/prompt-versions.js +0 -55
- package/dist/agents/prompt-versions.js.map +0 -1
- package/dist/agents/read-only.d.ts +0 -13
- package/dist/agents/read-only.d.ts.map +0 -1
- package/dist/agents/read-only.js +0 -29
- package/dist/agents/read-only.js.map +0 -1
- package/dist/agents/registry.d.ts +0 -70
- package/dist/agents/registry.d.ts.map +0 -1
- package/dist/agents/registry.js +0 -51
- package/dist/agents/registry.js.map +0 -1
- package/dist/agents/standard-prompt-templates.generated.d.ts +0 -36
- package/dist/agents/standard-prompt-templates.generated.d.ts.map +0 -1
- package/dist/agents/standard-prompt-templates.generated.js +0 -122
- package/dist/agents/standard-prompt-templates.generated.js.map +0 -1
- package/dist/agents/standard-prompts.d.ts +0 -36
- package/dist/agents/standard-prompts.d.ts.map +0 -1
- package/dist/agents/standard-prompts.js +0 -202
- package/dist/agents/standard-prompts.js.map +0 -1
- package/dist/agents/test-prompts.d.ts +0 -12
- package/dist/agents/test-prompts.d.ts.map +0 -1
- package/dist/agents/test-prompts.js +0 -92
- package/dist/agents/test-prompts.js.map +0 -1
- package/dist/agents/traits.d.ts +0 -56
- package/dist/agents/traits.d.ts.map +0 -1
- package/dist/agents/traits.js +0 -100
- package/dist/agents/traits.js.map +0 -1
- package/dist/agents/web-search.d.ts +0 -43
- package/dist/agents/web-search.d.ts.map +0 -1
- package/dist/agents/web-search.js +0 -102
- package/dist/agents/web-search.js.map +0 -1
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { companionFor } from './companions.js';
|
|
2
|
-
// System prompt for a companion agent, parameterised by the producer kind it
|
|
3
|
-
// reviews. The companion returns a single overall quality rating (0..1) plus prose
|
|
4
|
-
// feedback and optional per-item challenges, all as JSON the engine validates with
|
|
5
|
-
// `companionAssessmentSchema`.
|
|
6
|
-
/** The companion system prompt for `kind`, or undefined when `kind` is not a companion. */
|
|
7
|
-
export function companionSystemPrompt(kind) {
|
|
8
|
-
const def = companionFor(kind);
|
|
9
|
-
if (!def)
|
|
10
|
-
return undefined;
|
|
11
|
-
return [
|
|
12
|
-
`You are a meticulous quality companion reviewing the ${def.reviews} produced by the`,
|
|
13
|
-
`preceding ${def.targets.join(' / ')} step. Challenge it hard for correctness, quality,`,
|
|
14
|
-
'completeness and risk: call out gaps, missing cases, weak or untestable points, and',
|
|
15
|
-
'anything that would block confident downstream work. Then give a SINGLE overall quality',
|
|
16
|
-
'rating between 0 and 1 (1 = excellent and complete, 0 = unusable). Be a fair but demanding',
|
|
17
|
-
'critic — do not rubber-stamp.',
|
|
18
|
-
'',
|
|
19
|
-
'Respond with ONLY a JSON object of shape',
|
|
20
|
-
'{"rating":0.0,"summary":"…","comments":[{"anchorId":"…","body":"…"}]}: `rating` is the',
|
|
21
|
-
'overall score, `summary` is your justification plus the concrete changes the step should',
|
|
22
|
-
'make, and `comments` (optional) anchors specific challenges to an item id when the',
|
|
23
|
-
'reviewed output is structured (e.g. a spec requirement / acceptance-criterion id). No',
|
|
24
|
-
'prose outside the JSON, no code fences.',
|
|
25
|
-
].join('\n');
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=companion-prompts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"companion-prompts.js","sourceRoot":"","sources":["../../src/agents/companion-prompts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,6EAA6E;AAC7E,mFAAmF;AACnF,mFAAmF;AACnF,+BAA+B;AAE/B,2FAA2F;AAC3F,MAAM,UAAU,qBAAqB,CAAC,IAAe;IACnD,MAAM,GAAG,GAAG,YAAY,CAAC,IAAI,CAAC,CAAA;IAC9B,IAAI,CAAC,GAAG;QAAE,OAAO,SAAS,CAAA;IAC1B,OAAO;QACL,wDAAwD,GAAG,CAAC,OAAO,kBAAkB;QACrF,aAAa,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,oDAAoD;QACxF,qFAAqF;QACrF,yFAAyF;QACzF,4FAA4F;QAC5F,+BAA+B;QAC/B,EAAE;QACF,0CAA0C;QAC1C,wFAAwF;QACxF,0FAA0F;QAC1F,oFAAoF;QACpF,uFAAuF;QACvF,yCAAyC;KAC1C,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACd,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { AgentKind } from '@cat-factory/kernel';
|
|
2
|
-
export interface CompanionDefinition {
|
|
3
|
-
/** The companion's own agent kind. */
|
|
4
|
-
kind: AgentKind;
|
|
5
|
-
/** Producer kinds this companion may review (allow-list for pipeline placement). */
|
|
6
|
-
targets: AgentKind[];
|
|
7
|
-
/** Default quality bar (0..1) a pipeline step uses when it sets no explicit threshold. */
|
|
8
|
-
defaultThreshold: number;
|
|
9
|
-
/** Short label for the producer being reviewed, woven into the companion's prompt. */
|
|
10
|
-
reviews: string;
|
|
11
|
-
}
|
|
12
|
-
/** The built-in companion catalog. */
|
|
13
|
-
export declare const COMPANIONS: CompanionDefinition[];
|
|
14
|
-
/** Whether `kind` is a companion agent (driven by the engine's companion review loop). */
|
|
15
|
-
export declare function isCompanionKind(kind: AgentKind): boolean;
|
|
16
|
-
/** The companion definition for `kind`, or undefined if it is not a companion. */
|
|
17
|
-
export declare function companionFor(kind: AgentKind): CompanionDefinition | undefined;
|
|
18
|
-
/** The producer kinds a companion may be attached to (empty if not a companion). */
|
|
19
|
-
export declare function companionTargets(kind: AgentKind): AgentKind[];
|
|
20
|
-
//# sourceMappingURL=companions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"companions.d.ts","sourceRoot":"","sources":["../../src/agents/companions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAYpD,MAAM,WAAW,mBAAmB;IAClC,sCAAsC;IACtC,IAAI,EAAE,SAAS,CAAA;IACf,oFAAoF;IACpF,OAAO,EAAE,SAAS,EAAE,CAAA;IACpB,0FAA0F;IAC1F,gBAAgB,EAAE,MAAM,CAAA;IACxB,sFAAsF;IACtF,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,sCAAsC;AACtC,eAAO,MAAM,UAAU,EAAE,mBAAmB,EAqB3C,CAAA;AAID,0FAA0F;AAC1F,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAExD;AAED,kFAAkF;AAClF,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,mBAAmB,GAAG,SAAS,CAE7E;AAED,oFAAoF;AACpF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,EAAE,CAE7D"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { DEFAULT_COMPANION_THRESHOLD } from '@cat-factory/contracts';
|
|
2
|
-
/** The built-in companion catalog. */
|
|
3
|
-
export const COMPANIONS = [
|
|
4
|
-
{
|
|
5
|
-
kind: 'architect-companion',
|
|
6
|
-
targets: ['architect'],
|
|
7
|
-
defaultThreshold: DEFAULT_COMPANION_THRESHOLD,
|
|
8
|
-
reviews: 'solution design / architecture proposal',
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
kind: 'spec-companion',
|
|
12
|
-
targets: ['spec-writer'],
|
|
13
|
-
defaultThreshold: DEFAULT_COMPANION_THRESHOLD,
|
|
14
|
-
reviews: 'service specification and the completeness of its acceptance-scenario coverage',
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
// `reviewer` is the coder's companion: it directly challenges the builder's
|
|
18
|
-
// output and can loop it back for rework. Auto-only by default (no human gate).
|
|
19
|
-
kind: 'reviewer',
|
|
20
|
-
targets: ['coder'],
|
|
21
|
-
defaultThreshold: DEFAULT_COMPANION_THRESHOLD,
|
|
22
|
-
reviews: 'code change for correctness, quality, security and risk',
|
|
23
|
-
},
|
|
24
|
-
];
|
|
25
|
-
const BY_KIND = new Map(COMPANIONS.map((c) => [c.kind, c]));
|
|
26
|
-
/** Whether `kind` is a companion agent (driven by the engine's companion review loop). */
|
|
27
|
-
export function isCompanionKind(kind) {
|
|
28
|
-
return BY_KIND.has(kind);
|
|
29
|
-
}
|
|
30
|
-
/** The companion definition for `kind`, or undefined if it is not a companion. */
|
|
31
|
-
export function companionFor(kind) {
|
|
32
|
-
return BY_KIND.get(kind);
|
|
33
|
-
}
|
|
34
|
-
/** The producer kinds a companion may be attached to (empty if not a companion). */
|
|
35
|
-
export function companionTargets(kind) {
|
|
36
|
-
return BY_KIND.get(kind)?.targets ?? [];
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=companions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"companions.js","sourceRoot":"","sources":["../../src/agents/companions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAA;AAsBpE,sCAAsC;AACtC,MAAM,CAAC,MAAM,UAAU,GAA0B;IAC/C;QACE,IAAI,EAAE,qBAAqB;QAC3B,OAAO,EAAE,CAAC,WAAW,CAAC;QACtB,gBAAgB,EAAE,2BAA2B;QAC7C,OAAO,EAAE,yCAAyC;KACnD;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,CAAC,aAAa,CAAC;QACxB,gBAAgB,EAAE,2BAA2B;QAC7C,OAAO,EAAE,gFAAgF;KAC1F;IACD;QACE,4EAA4E;QAC5E,gFAAgF;QAChF,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,CAAC,OAAO,CAAC;QAClB,gBAAgB,EAAE,2BAA2B;QAC7C,OAAO,EAAE,yDAAyD;KACnE;CACF,CAAA;AAED,MAAM,OAAO,GAAG,IAAI,GAAG,CAA8B,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;AAExF,0FAA0F;AAC1F,MAAM,UAAU,eAAe,CAAC,IAAe;IAC7C,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AAC1B,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,YAAY,CAAC,IAAe;IAC1C,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AAC1B,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,gBAAgB,CAAC,IAAe;IAC9C,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,IAAI,EAAE,CAAA;AACzC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { AgentKind } from '@cat-factory/kernel';
|
|
2
|
-
/** The single agent kind that builds external-dependency mocks. */
|
|
3
|
-
export declare const MOCK_AGENT_KIND = "mocker";
|
|
4
|
-
/** True when the agent kind is the mock-builder. */
|
|
5
|
-
export declare function isMockKind(kind: AgentKind): boolean;
|
|
6
|
-
/**
|
|
7
|
-
* The built-out system (role) prompt for the mock-builder agent kind, or
|
|
8
|
-
* `undefined` when the kind is not the mock builder (so callers can fall through
|
|
9
|
-
* to the standard phases / acceptance track / generic role).
|
|
10
|
-
*/
|
|
11
|
-
export declare function mockSystemPrompt(kind: AgentKind): string | undefined;
|
|
12
|
-
//# sourceMappingURL=mock-prompts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mock-prompts.d.ts","sourceRoot":"","sources":["../../src/agents/mock-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAiBpD,mEAAmE;AACnE,eAAO,MAAM,eAAe,WAAW,CAAA;AAmCvC,oDAAoD;AACpD,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAEnD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAEpE"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { STANDARDS_FOOTER } from './prompt-shared.js';
|
|
2
|
-
// Built-out role prompt for the mock-builder agent. This kind stands up
|
|
3
|
-
// WireMock-based mocks for the external SERVICES a building block depends on, so
|
|
4
|
-
// the block can build, run and be tested locally and in CI without reaching real
|
|
5
|
-
// third parties — in particular so end-to-end / Playwright suites pass on GitHub
|
|
6
|
-
// Actions against the mocks rather than live APIs.
|
|
7
|
-
//
|
|
8
|
-
// Like the standard solution phases and the acceptance-testing track, "what the
|
|
9
|
-
// agent should do" lives here and "which extra standards apply" stays in
|
|
10
|
-
// @cat-factory/prompt-fragments: the prompt closes by deferring to the
|
|
11
|
-
// best-practice fragments that `composeSystemPrompt` appends below it. The
|
|
12
|
-
// dynamic run context (the block, its features, linked requirement docs and the
|
|
13
|
-
// prior agents' output — where the external dependencies surface) is folded in by
|
|
14
|
-
// the generic `userPromptFor`.
|
|
15
|
-
/** The single agent kind that builds external-dependency mocks. */
|
|
16
|
-
export const MOCK_AGENT_KIND = 'mocker';
|
|
17
|
-
const SYSTEM_PROMPT = [
|
|
18
|
-
'You are an integration-test engineer owning the EXTERNAL-DEPENDENCY MOCKS for a building block.',
|
|
19
|
-
'Your goal: make the service runnable and usable LOCALLY with just `docker-compose up` — every external service it depends on answered by a WireMock mock, so it builds, runs and can be exercised end to end without reaching any real third party. This is what lets the later Tester step actually run the service.',
|
|
20
|
-
'',
|
|
21
|
-
'This is a HANDS-ON build step, not a write-up. You MUST inspect the repository, then create/extend the mock mappings, fixtures and wiring and COMMIT them. Do NOT merely restate what the implementer did, describe the dependencies in prose, or report "already covered" without having read the existing mappings and confirmed it. If the block calls external services that are not yet mocked, leaving them unmocked is a failure of this step. A commit with the new/updated mock files is the deliverable; the prose note is only a summary of what you committed.',
|
|
22
|
-
'',
|
|
23
|
-
'Scope — services, not infrastructure:',
|
|
24
|
-
'- Mock external SERVICES the block depends on: third-party / partner HTTP APIs, payment, email / SMS, auth or identity providers, and other internal services reached over the network.',
|
|
25
|
-
'- Do NOT mock owned infrastructure (databases, caches, queues, object storage) — those run as real local instances (e.g. containers) wired into docker-compose, not WireMock.',
|
|
26
|
-
'',
|
|
27
|
-
'Be incremental and additive:',
|
|
28
|
-
'- First discover what is already mocked: read the existing WireMock stub mappings, response fixtures and mock wiring already in the repository.',
|
|
29
|
-
'- Inventory the external calls the block actually makes — base URL, path, method, auth headers, request and response shapes — from the code and the design / prior work given to you.',
|
|
30
|
-
'- Add stubs ONLY for calls that are not mocked yet. Never duplicate, rewrite or delete an existing mapping; if an existing stub looks wrong, flag it rather than silently changing it.',
|
|
31
|
-
'',
|
|
32
|
-
'WireMock best practices:',
|
|
33
|
-
'- One stub mapping per external operation; match on method + URL path, adding header / query / body matchers only where they are needed to disambiguate — keep matchers as loose as correctness allows so they are not brittle.',
|
|
34
|
-
'- Return realistic, schema-faithful response bodies and status codes; cover the success path plus the error and edge responses the block must handle (4xx, 5xx, rate limits, timeouts).',
|
|
35
|
-
'- Keep mappings deterministic and self-contained: prefer JSON mapping files (with response bodies in `__files`) checked into the repo over programmatic stubs, and reach for response templating only where a dynamic echo is genuinely required.',
|
|
36
|
-
'- Organise mappings per upstream service and name each one after the operation it stands in for, so coverage is easy to read.',
|
|
37
|
-
'- Add a low-priority catch-all stub that fails loudly on any unmatched request, so a new, yet-unmocked call is caught instead of silently passing.',
|
|
38
|
-
'- Never hard-code real secrets in stubs; assert on the presence / shape of auth headers, not their real values.',
|
|
39
|
-
'',
|
|
40
|
-
'Hook the mocks up for local docker-compose and CI runs:',
|
|
41
|
-
"- Add the WireMock server to the service's docker-compose so a plain `docker-compose up` brings the mocks up alongside the real infra; point the block's external base URLs at it through environment variables / config, switched on for local dev and CI and off in production.",
|
|
42
|
-
'- Make it runnable in CI (e.g. a GitHub Actions service container or a start step) so end-to-end / Playwright tests pass on GHA against the mocks, waiting on a health check before the tests start.',
|
|
43
|
-
'- Document how to start the mocks and run the suite locally with the same configuration, so local and CI behave identically.',
|
|
44
|
-
'',
|
|
45
|
-
'Commit the WireMock mapping files, the response fixtures and the docker-compose / config / wiring changes. Then, as your prose output, list each external service and which of its operations are now mocked, and call out any external call you deliberately left unmocked and why.',
|
|
46
|
-
'',
|
|
47
|
-
STANDARDS_FOOTER,
|
|
48
|
-
].join('\n');
|
|
49
|
-
/** True when the agent kind is the mock-builder. */
|
|
50
|
-
export function isMockKind(kind) {
|
|
51
|
-
return kind === MOCK_AGENT_KIND;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* The built-out system (role) prompt for the mock-builder agent kind, or
|
|
55
|
-
* `undefined` when the kind is not the mock builder (so callers can fall through
|
|
56
|
-
* to the standard phases / acceptance track / generic role).
|
|
57
|
-
*/
|
|
58
|
-
export function mockSystemPrompt(kind) {
|
|
59
|
-
return isMockKind(kind) ? SYSTEM_PROMPT : undefined;
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=mock-prompts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mock-prompts.js","sourceRoot":"","sources":["../../src/agents/mock-prompts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD,wEAAwE;AACxE,iFAAiF;AACjF,iFAAiF;AACjF,iFAAiF;AACjF,mDAAmD;AACnD,EAAE;AACF,gFAAgF;AAChF,yEAAyE;AACzE,uEAAuE;AACvE,2EAA2E;AAC3E,gFAAgF;AAChF,kFAAkF;AAClF,+BAA+B;AAE/B,mEAAmE;AACnE,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAA;AAEvC,MAAM,aAAa,GAAG;IACpB,iGAAiG;IACjG,uTAAuT;IACvT,EAAE;IACF,4iBAA4iB;IAC5iB,EAAE;IACF,uCAAuC;IACvC,yLAAyL;IACzL,+KAA+K;IAC/K,EAAE;IACF,8BAA8B;IAC9B,iJAAiJ;IACjJ,uLAAuL;IACvL,wLAAwL;IACxL,EAAE;IACF,0BAA0B;IAC1B,iOAAiO;IACjO,yLAAyL;IACzL,mPAAmP;IACnP,+HAA+H;IAC/H,oJAAoJ;IACpJ,iHAAiH;IACjH,EAAE;IACF,yDAAyD;IACzD,mRAAmR;IACnR,sMAAsM;IACtM,8HAA8H;IAC9H,EAAE;IACF,sRAAsR;IACtR,EAAE;IACF,gBAAgB;CACjB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAEZ,oDAAoD;AACpD,MAAM,UAAU,UAAU,CAAC,IAAe;IACxC,OAAO,IAAI,KAAK,eAAe,CAAA;AACjC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAe;IAC9C,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAA;AACrD,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/** A block's fragment selection, as the prompt composer needs it. */
|
|
2
|
-
export interface ComposableBlock {
|
|
3
|
-
fragmentIds?: string[];
|
|
4
|
-
resolvedFragments?: {
|
|
5
|
-
id: string;
|
|
6
|
-
body: string;
|
|
7
|
-
}[];
|
|
8
|
-
}
|
|
9
|
-
export declare function composeSystemPrompt(baseSystem: string, fragmentIds?: string[]): string;
|
|
10
|
-
/**
|
|
11
|
-
* Compose the system prompt for a block, preferring the engine-resolved tenant
|
|
12
|
-
* catalog bodies when present and otherwise falling back to static id resolution.
|
|
13
|
-
* Both inline and container executors use this so the fragment-library feature
|
|
14
|
-
* applies uniformly to every agent kind, not just the reviewer.
|
|
15
|
-
*/
|
|
16
|
-
export declare function composeBlockSystemPrompt(baseSystem: string, block: ComposableBlock): string;
|
|
17
|
-
//# sourceMappingURL=prompt-fragments.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-fragments.d.ts","sourceRoot":"","sources":["../../src/agents/prompt-fragments.ts"],"names":[],"mappings":"AAgBA,qEAAqE;AACrE,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,iBAAiB,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CACnD;AAcD,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,GAAE,MAAM,EAAO,GAAG,MAAM,CAM1F;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,MAAM,CAQ3F"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { getFragment } from '@cat-factory/prompt-fragments';
|
|
2
|
-
/** Fold a set of fragment bodies into the base system prompt under a header. */
|
|
3
|
-
function foldStandards(baseSystem, bodies) {
|
|
4
|
-
if (bodies.length === 0)
|
|
5
|
-
return baseSystem;
|
|
6
|
-
return [
|
|
7
|
-
baseSystem,
|
|
8
|
-
'',
|
|
9
|
-
'Follow these standards while doing the work:',
|
|
10
|
-
'',
|
|
11
|
-
bodies.join('\n\n'),
|
|
12
|
-
].join('\n');
|
|
13
|
-
}
|
|
14
|
-
export function composeSystemPrompt(baseSystem, fragmentIds = []) {
|
|
15
|
-
const bodies = fragmentIds
|
|
16
|
-
.map((id) => getFragment(id))
|
|
17
|
-
.filter((fragment) => fragment !== undefined)
|
|
18
|
-
.map((fragment) => fragment.body);
|
|
19
|
-
return foldStandards(baseSystem, bodies);
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Compose the system prompt for a block, preferring the engine-resolved tenant
|
|
23
|
-
* catalog bodies when present and otherwise falling back to static id resolution.
|
|
24
|
-
* Both inline and container executors use this so the fragment-library feature
|
|
25
|
-
* applies uniformly to every agent kind, not just the reviewer.
|
|
26
|
-
*/
|
|
27
|
-
export function composeBlockSystemPrompt(baseSystem, block) {
|
|
28
|
-
if (block.resolvedFragments && block.resolvedFragments.length > 0) {
|
|
29
|
-
return foldStandards(baseSystem, block.resolvedFragments.map((f) => f.body));
|
|
30
|
-
}
|
|
31
|
-
return composeSystemPrompt(baseSystem, block.fragmentIds);
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=prompt-fragments.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-fragments.js","sourceRoot":"","sources":["../../src/agents/prompt-fragments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAsB3D,gFAAgF;AAChF,SAAS,aAAa,CAAC,UAAkB,EAAE,MAAgB;IACzD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,UAAU,CAAA;IAC1C,OAAO;QACL,UAAU;QACV,EAAE;QACF,8CAA8C;QAC9C,EAAE;QACF,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;KACpB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACd,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,UAAkB,EAAE,WAAW,GAAa,EAAE;IAChF,MAAM,MAAM,GAAG,WAAW;SACvB,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;SAC5B,MAAM,CAAC,CAAC,QAAQ,EAA4C,EAAE,CAAC,QAAQ,KAAK,SAAS,CAAC;SACtF,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IACnC,OAAO,aAAa,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;AAC1C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,UAAkB,EAAE,KAAsB;IACjF,IAAI,KAAK,CAAC,iBAAiB,IAAI,KAAK,CAAC,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClE,OAAO,aAAa,CAClB,UAAU,EACV,KAAK,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAC3C,CAAA;IACH,CAAC;IACD,OAAO,mBAAmB,CAAC,UAAU,EAAE,KAAK,CAAC,WAAW,CAAC,CAAA;AAC3D,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Closing line every role prompt appends before `composeSystemPrompt` folds in
|
|
3
|
-
* the user's selected best-practice fragments — it tells the agent to treat those
|
|
4
|
-
* appended standards as hard requirements rather than optional suggestions.
|
|
5
|
-
*/
|
|
6
|
-
export declare const STANDARDS_FOOTER = "Treat every best-practice standard appended below as a hard requirement, not a suggestion.";
|
|
7
|
-
//# sourceMappingURL=prompt-shared.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-shared.d.ts","sourceRoot":"","sources":["../../src/agents/prompt-shared.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,+FACiE,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// Shared constants used across the agent role prompts (standard solution phases,
|
|
2
|
-
// acceptance-testing track, business-logic track and the mock prompts). Kept here
|
|
3
|
-
// so the wording stays identical everywhere it is appended.
|
|
4
|
-
/**
|
|
5
|
-
* Closing line every role prompt appends before `composeSystemPrompt` folds in
|
|
6
|
-
* the user's selected best-practice fragments — it tells the agent to treat those
|
|
7
|
-
* appended standards as hard requirements rather than optional suggestions.
|
|
8
|
-
*/
|
|
9
|
-
export const STANDARDS_FOOTER = 'Treat every best-practice standard appended below as a hard requirement, not a suggestion.';
|
|
10
|
-
//# sourceMappingURL=prompt-shared.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-shared.js","sourceRoot":"","sources":["../../src/agents/prompt-shared.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,kFAAkF;AAClF,4DAA4D;AAE5D;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAC3B,4FAA4F,CAAA"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
export declare const REVIEW_SYSTEM_PROMPT: string;
|
|
2
|
-
/**
|
|
3
|
-
* The "requirements rework" agent. Given a block's collected requirements plus the
|
|
4
|
-
* answers / dismissals a human gave to the reviewer's findings, it folds everything
|
|
5
|
-
* into ONE self-contained requirements document. The output is emitted in a fixed,
|
|
6
|
-
* standard structure so the service-level spec-writer can aggregate it with
|
|
7
|
-
* minimal synthesis (it mirrors that writer's own expectations: "The system SHALL …"
|
|
8
|
-
* statements, MoSCoW priorities, Given/When/Then acceptance criteria, and
|
|
9
|
-
* cross-cutting domain rules). It must produce this standard document even when the
|
|
10
|
-
* reviewer raised no findings — so every task can carry a clean, writer-ready spec.
|
|
11
|
-
*/
|
|
12
|
-
export declare const REWORK_SYSTEM_PROMPT: string;
|
|
13
|
-
/** A prompt under version control: its stable id, integer version and text. */
|
|
14
|
-
export interface VersionedPrompt {
|
|
15
|
-
id: string;
|
|
16
|
-
version: number;
|
|
17
|
-
text: string;
|
|
18
|
-
}
|
|
19
|
-
/** The currently-shipping version of each numbered prompt. */
|
|
20
|
-
export declare const PROMPT_VERSIONS: {
|
|
21
|
-
readonly 'requirement-review': {
|
|
22
|
-
readonly id: 'requirement-review';
|
|
23
|
-
readonly version: 1;
|
|
24
|
-
readonly text: string;
|
|
25
|
-
};
|
|
26
|
-
readonly 'requirement-rework': {
|
|
27
|
-
readonly id: 'requirement-rework';
|
|
28
|
-
readonly version: 1;
|
|
29
|
-
readonly text: string;
|
|
30
|
-
};
|
|
31
|
-
readonly build: {
|
|
32
|
-
readonly id: 'build';
|
|
33
|
-
readonly version: 2;
|
|
34
|
-
readonly text: string;
|
|
35
|
-
};
|
|
36
|
-
readonly review: {
|
|
37
|
-
readonly id: 'review';
|
|
38
|
-
readonly version: 1;
|
|
39
|
-
readonly text: string;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
/** Ids of the prompts currently under version control. */
|
|
43
|
-
export type PromptId = keyof typeof PROMPT_VERSIONS;
|
|
44
|
-
/** The current versioned prompt for an id. */
|
|
45
|
-
export declare function promptVersion(id: PromptId): VersionedPrompt;
|
|
46
|
-
/** The canonical `id@vN` label for a prompt id (or an explicit version). */
|
|
47
|
-
export declare function promptVersionLabel(id: string, version?: number): string;
|
|
48
|
-
//# sourceMappingURL=prompt-versions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-versions.d.ts","sourceRoot":"","sources":["../../src/agents/prompt-versions.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,QAO8B,CAAA;AAE/D;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,QAoBF,CAAA;AAY/B,+EAA+E;AAC/E,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;CACb;AAED,8DAA8D;AAC9D,eAAO,MAAM,eAAe;;iBACF,EAAE,EAAE,oBAAoB;iBAAE,OAAO,EAAE,CAAC;iBAAE,IAAI;;;iBAC1C,EAAE,EAAE,oBAAoB;iBAAE,OAAO,EAAE,CAAC;iBAAE,IAAI;;;iBACzD,EAAE,EAAE,OAAO;iBAAE,OAAO,EAAE,CAAC;iBAAE,IAAI;;;iBAC5B,EAAE,EAAE,QAAQ;iBAAE,OAAO,EAAE,CAAC;iBAAE,IAAI;;CACU,CAAA;AAEpD,0DAA0D;AAC1D,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,eAAe,CAAA;AAEnD,8CAA8C;AAC9C,wBAAgB,aAAa,CAAC,EAAE,EAAE,QAAQ,GAAG,eAAe,CAE3D;AAED,4EAA4E;AAC5E,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAGvE"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { standardSystemPrompt } from './standard-prompts.js';
|
|
2
|
-
export const REVIEW_SYSTEM_PROMPT = 'You are a meticulous product / requirements analyst reviewing the collected ' +
|
|
3
|
-
'requirements for a single unit of software work before an engineer starts on it. ' +
|
|
4
|
-
'Surface everything that would block confident implementation: missing information ' +
|
|
5
|
-
'(gaps), ambiguities that need clarification, unstated assumptions, risks, and open ' +
|
|
6
|
-
'questions. Be specific, concrete and actionable, and phrase each item so a product ' +
|
|
7
|
-
'owner can answer it directly. Do NOT invent answers or requirements. ' +
|
|
8
|
-
'Respond with ONLY a JSON object — no prose, no code fences.';
|
|
9
|
-
/**
|
|
10
|
-
* The "requirements rework" agent. Given a block's collected requirements plus the
|
|
11
|
-
* answers / dismissals a human gave to the reviewer's findings, it folds everything
|
|
12
|
-
* into ONE self-contained requirements document. The output is emitted in a fixed,
|
|
13
|
-
* standard structure so the service-level spec-writer can aggregate it with
|
|
14
|
-
* minimal synthesis (it mirrors that writer's own expectations: "The system SHALL …"
|
|
15
|
-
* statements, MoSCoW priorities, Given/When/Then acceptance criteria, and
|
|
16
|
-
* cross-cutting domain rules). It must produce this standard document even when the
|
|
17
|
-
* reviewer raised no findings — so every task can carry a clean, writer-ready spec.
|
|
18
|
-
*/
|
|
19
|
-
export const REWORK_SYSTEM_PROMPT = 'You are a requirements editor. You are given the current collected requirements ' +
|
|
20
|
-
'for a single unit of software work, plus any clarifying questions and the answers ' +
|
|
21
|
-
'a human gave. Produce a revised, self-contained requirements document in Markdown ' +
|
|
22
|
-
'that folds every answer in, resolves the ambiguities, and states the ' +
|
|
23
|
-
'previously-missing details explicitly. Preserve the original intent; do not invent ' +
|
|
24
|
-
'facts beyond what the answers provide. Even when there are no questions, restate ' +
|
|
25
|
-
'the requirements cleanly in the SAME standard structure. Use EXACTLY these Markdown ' +
|
|
26
|
-
'sections, in this order, omitting a section only when it has no content:\n' +
|
|
27
|
-
'# <Title> — Requirements\n' +
|
|
28
|
-
'## Overview — one paragraph of intent and scope.\n' +
|
|
29
|
-
'## Functional Requirements — a bullet per requirement phrased as "The system SHALL ' +
|
|
30
|
-
'…", each tagged with a MoSCoW priority (must/should/could); under each, an ' +
|
|
31
|
-
'"Acceptance:" sub-list of Given/When/Then criteria.\n' +
|
|
32
|
-
'## Non-Functional Requirements — quality attributes, same "The system SHALL …" ' +
|
|
33
|
-
'phrasing with a priority and a short rationale.\n' +
|
|
34
|
-
'## Domain Rules / Constraints — cross-cutting invariants, each with a brief why.\n' +
|
|
35
|
-
'## Assumptions — assumptions the requirements rest on.\n' +
|
|
36
|
-
'## Out of Scope — what this work explicitly does not cover.\n' +
|
|
37
|
-
'Respond with ONLY the revised requirements in Markdown — no preamble, no ' +
|
|
38
|
-
'commentary, no code fences.';
|
|
39
|
-
/** The currently-shipping version of each numbered prompt. */
|
|
40
|
-
export const PROMPT_VERSIONS = {
|
|
41
|
-
'requirement-review': { id: 'requirement-review', version: 1, text: REVIEW_SYSTEM_PROMPT },
|
|
42
|
-
'requirement-rework': { id: 'requirement-rework', version: 1, text: REWORK_SYSTEM_PROMPT },
|
|
43
|
-
build: { id: 'build', version: 2, text: standardSystemPrompt('build') },
|
|
44
|
-
review: { id: 'review', version: 1, text: standardSystemPrompt('review') },
|
|
45
|
-
};
|
|
46
|
-
/** The current versioned prompt for an id. */
|
|
47
|
-
export function promptVersion(id) {
|
|
48
|
-
return PROMPT_VERSIONS[id];
|
|
49
|
-
}
|
|
50
|
-
/** The canonical `id@vN` label for a prompt id (or an explicit version). */
|
|
51
|
-
export function promptVersionLabel(id, version) {
|
|
52
|
-
const v = version ?? (id in PROMPT_VERSIONS ? PROMPT_VERSIONS[id].version : 1);
|
|
53
|
-
return `${id}@v${v}`;
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=prompt-versions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-versions.js","sourceRoot":"","sources":["../../src/agents/prompt-versions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAE5D,MAAM,CAAC,MAAM,oBAAoB,GAC/B,8EAA8E;IAC9E,mFAAmF;IACnF,oFAAoF;IACpF,qFAAqF;IACrF,qFAAqF;IACrF,uEAAuE;IACvE,6DAA6D,CAAA;AAE/D;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAC/B,kFAAkF;IAClF,oFAAoF;IACpF,oFAAoF;IACpF,uEAAuE;IACvE,qFAAqF;IACrF,mFAAmF;IACnF,sFAAsF;IACtF,4EAA4E;IAC5E,4BAA4B;IAC5B,oDAAoD;IACpD,qFAAqF;IACrF,6EAA6E;IAC7E,uDAAuD;IACvD,iFAAiF;IACjF,mDAAmD;IACnD,oFAAoF;IACpF,0DAA0D;IAC1D,+DAA+D;IAC/D,2EAA2E;IAC3E,6BAA6B,CAAA;AAmB/B,8DAA8D;AAC9D,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,oBAAoB,EAAE,EAAE,EAAE,EAAE,oBAAoB,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE;IAC1F,oBAAoB,EAAE,EAAE,EAAE,EAAE,oBAAoB,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE;IAC1F,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,oBAAoB,CAAC,OAAO,CAAC,EAAE;IACvE,MAAM,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,oBAAoB,CAAC,QAAQ,CAAC,EAAE;CACxB,CAAA;AAKpD,8CAA8C;AAC9C,MAAM,UAAU,aAAa,CAAC,EAAY;IACxC,OAAO,eAAe,CAAC,EAAE,CAAC,CAAA;AAC5B,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,kBAAkB,CAAC,EAAU,EAAE,OAAgB;IAC7D,MAAM,CAAC,GAAG,OAAO,IAAI,CAAC,EAAE,IAAI,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,EAAc,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAC1F,OAAO,GAAG,EAAE,KAAK,CAAC,EAAE,CAAA;AACtB,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { AgentKind } from '@cat-factory/kernel';
|
|
2
|
-
/** Container agent kinds that operate read-only (explore + report; no edits/commits/PR). */
|
|
3
|
-
export declare const READ_ONLY_AGENT_KINDS: Set<string>;
|
|
4
|
-
/** Whether `kind` is a read-only container agent (runs the harness `/explore` path). */
|
|
5
|
-
export declare function isReadOnlyAgentKind(kind: AgentKind): boolean;
|
|
6
|
-
/**
|
|
7
|
-
* Appended to a read-only agent's system prompt so it never tries to edit, commit or
|
|
8
|
-
* open a PR — the prose report it returns is its sole deliverable. Centralised here
|
|
9
|
-
* (rather than repeated in each role prompt) so every read-only kind states the same
|
|
10
|
-
* guardrail exactly once.
|
|
11
|
-
*/
|
|
12
|
-
export declare const READ_ONLY_GUARDRAIL: string;
|
|
13
|
-
//# sourceMappingURL=read-only.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"read-only.d.ts","sourceRoot":"","sources":["../../src/agents/read-only.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAepD,4FAA4F;AAC5F,eAAO,MAAM,qBAAqB,aAA6C,CAAA;AAE/E,wFAAwF;AACxF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAE5D;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,QAIiB,CAAA"}
|
package/dist/agents/read-only.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// Read-only container agents. Some agent kinds need a real checkout to do their
|
|
2
|
-
// work but only ever READ it: they clone the repo, explore it, and return a prose
|
|
3
|
-
// report/proposal — making no edits, no commits and opening no pull request. They
|
|
4
|
-
// run through the harness `/explore` endpoint (not `/run`), where an edit-free run
|
|
5
|
-
// is the expected, correct outcome rather than an "implementation produced no
|
|
6
|
-
// changes" failure, and where no work branch or PR is created.
|
|
7
|
-
//
|
|
8
|
-
// Today that is the `architect` (proposes a design after reading the existing code,
|
|
9
|
-
// whose prose proposal feeds the human gate / architect-companion) and the tech-debt
|
|
10
|
-
// `analysis` agent (audits the repo and emits a prioritized report). Both share the
|
|
11
|
-
// single reusable read-only execution path (see ContainerAgentExecutor's explore
|
|
12
|
-
// body + the harness `handleExplore`).
|
|
13
|
-
/** Container agent kinds that operate read-only (explore + report; no edits/commits/PR). */
|
|
14
|
-
export const READ_ONLY_AGENT_KINDS = new Set(['architect', 'analysis']);
|
|
15
|
-
/** Whether `kind` is a read-only container agent (runs the harness `/explore` path). */
|
|
16
|
-
export function isReadOnlyAgentKind(kind) {
|
|
17
|
-
return READ_ONLY_AGENT_KINDS.has(kind);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Appended to a read-only agent's system prompt so it never tries to edit, commit or
|
|
21
|
-
* open a PR — the prose report it returns is its sole deliverable. Centralised here
|
|
22
|
-
* (rather than repeated in each role prompt) so every read-only kind states the same
|
|
23
|
-
* guardrail exactly once.
|
|
24
|
-
*/
|
|
25
|
-
export const READ_ONLY_GUARDRAIL = 'IMPORTANT — this is a READ-ONLY exploration: you may read and inspect any file in ' +
|
|
26
|
-
'the repository, but you MUST NOT modify, create or delete files, run commands that ' +
|
|
27
|
-
'change the repository, commit, or open a pull request. Your written report is the ' +
|
|
28
|
-
'only deliverable; return it as your response.';
|
|
29
|
-
//# sourceMappingURL=read-only.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"read-only.js","sourceRoot":"","sources":["../../src/agents/read-only.ts"],"names":[],"mappings":"AAEA,gFAAgF;AAChF,kFAAkF;AAClF,kFAAkF;AAClF,mFAAmF;AACnF,8EAA8E;AAC9E,+DAA+D;AAC/D,EAAE;AACF,oFAAoF;AACpF,qFAAqF;AACrF,oFAAoF;AACpF,iFAAiF;AACjF,uCAAuC;AAEvC,4FAA4F;AAC5F,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAS,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC,CAAA;AAE/E,wFAAwF;AACxF,MAAM,UAAU,mBAAmB,CAAC,IAAe;IACjD,OAAO,qBAAqB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AACxC,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAC9B,oFAAoF;IACpF,qFAAqF;IACrF,oFAAoF;IACpF,+CAA+C,CAAA"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import type { AgentConfigDescriptor, AgentKind, AgentRunContext } from '@cat-factory/kernel';
|
|
2
|
-
import type { AgentTrait } from './traits.js';
|
|
3
|
-
export interface AgentKindDefinition {
|
|
4
|
-
/** The free-form agent-kind id used in pipelines and steps (e.g. `security-auditor`). */
|
|
5
|
-
kind: AgentKind;
|
|
6
|
-
/**
|
|
7
|
-
* The system prompt (role) for this kind. A function form receives the kind id so a
|
|
8
|
-
* single definition object can serve a family of related kinds.
|
|
9
|
-
*/
|
|
10
|
-
systemPrompt: string | ((kind: AgentKind) => string);
|
|
11
|
-
/**
|
|
12
|
-
* Optional custom user-prompt builder. When omitted the kind uses the generic user
|
|
13
|
-
* prompt (block context + prior pipeline outputs), exactly like any other
|
|
14
|
-
* non-standard-phase kind. Human revision feedback is appended automatically.
|
|
15
|
-
*/
|
|
16
|
-
userPrompt?: (context: AgentRunContext) => string;
|
|
17
|
-
/**
|
|
18
|
-
* When true this kind needs a real checkout (clone/edit/commit/PR) and must run in a
|
|
19
|
-
* container rather than as a one-shot inline LLM call — see the Worker's
|
|
20
|
-
* `CompositeAgentExecutor`. Defaults to false (an inline LLM agent). NOTE: a container
|
|
21
|
-
* kind ALSO needs harness support for its dispatch endpoint; inline kinds work
|
|
22
|
-
* end-to-end with no harness changes.
|
|
23
|
-
*/
|
|
24
|
-
requiresContainer?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Optional one-clause reason this kind should reach for web search, phrased to
|
|
27
|
-
* complete "Use it mainly to …" (e.g. "verify the vendor's current API contract
|
|
28
|
-
* before generating a client"). When web search is enabled for the deployment, this
|
|
29
|
-
* is folded into the kind's web-search guidance so a proprietary kind gets a nudge
|
|
30
|
-
* tailored to its job — without the shared library needing to know the kind exists.
|
|
31
|
-
* Omitted ⇒ the generic "verify a fact that changes" hint. See `webResearchGuidanceFor`.
|
|
32
|
-
*/
|
|
33
|
-
webResearchHint?: string;
|
|
34
|
-
/**
|
|
35
|
-
* Task-level configuration parameters this kind contributes (see the agent-config
|
|
36
|
-
* contracts). When a pipeline that includes this kind is selected for a task, these
|
|
37
|
-
* descriptors are surfaced on task creation + the inspector, editable until the
|
|
38
|
-
* kind's step starts. Each descriptor's `agentKind` should match this `kind` so the
|
|
39
|
-
* freeze targets the right step. Omitted ⇒ the kind contributes no config.
|
|
40
|
-
*/
|
|
41
|
-
configContributions?: AgentConfigDescriptor[];
|
|
42
|
-
/**
|
|
43
|
-
* Capability traits this kind carries (see ./traits). `code-aware` makes the engine
|
|
44
|
-
* fold the running service's selected best-practice fragments into the agent's prompt;
|
|
45
|
-
* `spec-aware` appends the in-repo-spec reading guidance. Deployments can also assign
|
|
46
|
-
* their own traits registered via `registerAgentTrait`. Omitted ⇒ no traits.
|
|
47
|
-
*/
|
|
48
|
-
traits?: AgentTrait[];
|
|
49
|
-
}
|
|
50
|
-
/** Register a custom agent kind. A later registration of the same id replaces the earlier one. */
|
|
51
|
-
export declare function registerAgentKind(definition: AgentKindDefinition): void;
|
|
52
|
-
/** Register several custom agent kinds at once. */
|
|
53
|
-
export declare function registerAgentKinds(definitions: Iterable<AgentKindDefinition>): void;
|
|
54
|
-
/** The registered definition for a kind, or undefined for built-in / unregistered kinds. */
|
|
55
|
-
export declare function registeredAgentKind(kind: AgentKind): AgentKindDefinition | undefined;
|
|
56
|
-
/** All registered custom agent kinds (registration order). */
|
|
57
|
-
export declare function registeredAgentKinds(): AgentKindDefinition[];
|
|
58
|
-
/** Whether a registered kind asked to run in a container. False for built-in / unregistered kinds. */
|
|
59
|
-
export declare function registeredKindRequiresContainer(kind: AgentKind): boolean;
|
|
60
|
-
/** Drop all registered kinds. Intended for tests that exercise registration. */
|
|
61
|
-
export declare function clearRegisteredAgentKinds(): void;
|
|
62
|
-
/** A registered kind's system prompt, or undefined when the kind is not registered. */
|
|
63
|
-
export declare function registeredSystemPrompt(kind: AgentKind): string | undefined;
|
|
64
|
-
/** A registered kind's user prompt, or undefined when the kind is not registered / has no builder. */
|
|
65
|
-
export declare function registeredUserPrompt(context: AgentRunContext): string | undefined;
|
|
66
|
-
/** A registered kind's web-research hint, or undefined when unregistered / not supplied. */
|
|
67
|
-
export declare function registeredWebResearchHint(kind: AgentKind): string | undefined;
|
|
68
|
-
/** A registered kind's contributed config descriptors, or an empty array when none. */
|
|
69
|
-
export declare function registeredConfigContributions(kind: AgentKind): AgentConfigDescriptor[];
|
|
70
|
-
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/agents/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC5F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAY7C,MAAM,WAAW,mBAAmB;IAClC,yFAAyF;IACzF,IAAI,EAAE,SAAS,CAAA;IACf;;;OAGG;IACH,YAAY,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,KAAK,MAAM,CAAC,CAAA;IACpD;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,MAAM,CAAA;IACjD;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,qBAAqB,EAAE,CAAA;IAC7C;;;;;OAKG;IACH,MAAM,CAAC,EAAE,UAAU,EAAE,CAAA;CACtB;AAOD,kGAAkG;AAClG,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,mBAAmB,GAAG,IAAI,CAEvE;AAED,mDAAmD;AACnD,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,QAAQ,CAAC,mBAAmB,CAAC,GAAG,IAAI,CAEnF;AAED,4FAA4F;AAC5F,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,SAAS,GAAG,mBAAmB,GAAG,SAAS,CAEpF;AAED,8DAA8D;AAC9D,wBAAgB,oBAAoB,IAAI,mBAAmB,EAAE,CAE5D;AAED,sGAAsG;AACtG,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAExE;AAED,gFAAgF;AAChF,wBAAgB,yBAAyB,IAAI,IAAI,CAEhD;AAED,uFAAuF;AACvF,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAM1E;AAED,sGAAsG;AACtG,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,GAAG,SAAS,CAEjF;AAED,4FAA4F;AAC5F,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAE7E;AAED,uFAAuF;AACvF,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,SAAS,GAAG,qBAAqB,EAAE,CAEtF"}
|
package/dist/agents/registry.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
// Process-wide registry, mirroring the Worker's model-provider registry. Registration
|
|
2
|
-
// is a startup side effect read by every prompt build / routing decision, so the extra
|
|
3
|
-
// kinds reach all paths — HTTP requests, the durable driver and the cron sweeper.
|
|
4
|
-
const registry = new Map();
|
|
5
|
-
/** Register a custom agent kind. A later registration of the same id replaces the earlier one. */
|
|
6
|
-
export function registerAgentKind(definition) {
|
|
7
|
-
registry.set(definition.kind, definition);
|
|
8
|
-
}
|
|
9
|
-
/** Register several custom agent kinds at once. */
|
|
10
|
-
export function registerAgentKinds(definitions) {
|
|
11
|
-
for (const definition of definitions)
|
|
12
|
-
registerAgentKind(definition);
|
|
13
|
-
}
|
|
14
|
-
/** The registered definition for a kind, or undefined for built-in / unregistered kinds. */
|
|
15
|
-
export function registeredAgentKind(kind) {
|
|
16
|
-
return registry.get(kind);
|
|
17
|
-
}
|
|
18
|
-
/** All registered custom agent kinds (registration order). */
|
|
19
|
-
export function registeredAgentKinds() {
|
|
20
|
-
return [...registry.values()];
|
|
21
|
-
}
|
|
22
|
-
/** Whether a registered kind asked to run in a container. False for built-in / unregistered kinds. */
|
|
23
|
-
export function registeredKindRequiresContainer(kind) {
|
|
24
|
-
return registry.get(kind)?.requiresContainer === true;
|
|
25
|
-
}
|
|
26
|
-
/** Drop all registered kinds. Intended for tests that exercise registration. */
|
|
27
|
-
export function clearRegisteredAgentKinds() {
|
|
28
|
-
registry.clear();
|
|
29
|
-
}
|
|
30
|
-
/** A registered kind's system prompt, or undefined when the kind is not registered. */
|
|
31
|
-
export function registeredSystemPrompt(kind) {
|
|
32
|
-
const definition = registry.get(kind);
|
|
33
|
-
if (!definition)
|
|
34
|
-
return undefined;
|
|
35
|
-
return typeof definition.systemPrompt === 'function'
|
|
36
|
-
? definition.systemPrompt(kind)
|
|
37
|
-
: definition.systemPrompt;
|
|
38
|
-
}
|
|
39
|
-
/** A registered kind's user prompt, or undefined when the kind is not registered / has no builder. */
|
|
40
|
-
export function registeredUserPrompt(context) {
|
|
41
|
-
return registry.get(context.agentKind)?.userPrompt?.(context);
|
|
42
|
-
}
|
|
43
|
-
/** A registered kind's web-research hint, or undefined when unregistered / not supplied. */
|
|
44
|
-
export function registeredWebResearchHint(kind) {
|
|
45
|
-
return registry.get(kind)?.webResearchHint;
|
|
46
|
-
}
|
|
47
|
-
/** A registered kind's contributed config descriptors, or an empty array when none. */
|
|
48
|
-
export function registeredConfigContributions(kind) {
|
|
49
|
-
return registry.get(kind)?.configContributions ?? [];
|
|
50
|
-
}
|
|
51
|
-
//# sourceMappingURL=registry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/agents/registry.ts"],"names":[],"mappings":"AA6DA,sFAAsF;AACtF,uFAAuF;AACvF,kFAAkF;AAClF,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA+B,CAAA;AAEvD,kGAAkG;AAClG,MAAM,UAAU,iBAAiB,CAAC,UAA+B;IAC/D,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;AAC3C,CAAC;AAED,mDAAmD;AACnD,MAAM,UAAU,kBAAkB,CAAC,WAA0C;IAC3E,KAAK,MAAM,UAAU,IAAI,WAAW;QAAE,iBAAiB,CAAC,UAAU,CAAC,CAAA;AACrE,CAAC;AAED,4FAA4F;AAC5F,MAAM,UAAU,mBAAmB,CAAC,IAAe;IACjD,OAAO,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AAC3B,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,oBAAoB;IAClC,OAAO,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;AAC/B,CAAC;AAED,sGAAsG;AACtG,MAAM,UAAU,+BAA+B,CAAC,IAAe;IAC7D,OAAO,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAA;AACvD,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,yBAAyB;IACvC,QAAQ,CAAC,KAAK,EAAE,CAAA;AAClB,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,sBAAsB,CAAC,IAAe;IACpD,MAAM,UAAU,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IACrC,IAAI,CAAC,UAAU;QAAE,OAAO,SAAS,CAAA;IACjC,OAAO,OAAO,UAAU,CAAC,YAAY,KAAK,UAAU;QAClD,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC;QAC/B,CAAC,CAAC,UAAU,CAAC,YAAY,CAAA;AAC7B,CAAC;AAED,sGAAsG;AACtG,MAAM,UAAU,oBAAoB,CAAC,OAAwB;IAC3D,OAAO,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,CAAC,OAAO,CAAC,CAAA;AAC/D,CAAC;AAED,4FAA4F;AAC5F,MAAM,UAAU,yBAAyB,CAAC,IAAe;IACvD,OAAO,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,eAAe,CAAA;AAC5C,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,6BAA6B,CAAC,IAAe;IAC3D,OAAO,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,mBAAmB,IAAI,EAAE,CAAA;AACtD,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export declare const blockContext: {
|
|
2
|
-
"0": (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
|
|
3
|
-
"1": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
4
|
-
"2": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
5
|
-
"3": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
6
|
-
"4": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
7
|
-
"5": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
8
|
-
compiler: (string | number)[];
|
|
9
|
-
main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
10
|
-
useData: boolean;
|
|
11
|
-
};
|
|
12
|
-
export declare const design: {
|
|
13
|
-
compiler: (string | number)[];
|
|
14
|
-
main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
15
|
-
usePartial: boolean;
|
|
16
|
-
useData: boolean;
|
|
17
|
-
};
|
|
18
|
-
export declare const build: {
|
|
19
|
-
compiler: (string | number)[];
|
|
20
|
-
main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
21
|
-
usePartial: boolean;
|
|
22
|
-
useData: boolean;
|
|
23
|
-
};
|
|
24
|
-
export declare const review: {
|
|
25
|
-
compiler: (string | number)[];
|
|
26
|
-
main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
27
|
-
usePartial: boolean;
|
|
28
|
-
useData: boolean;
|
|
29
|
-
};
|
|
30
|
-
export declare const test: {
|
|
31
|
-
compiler: (string | number)[];
|
|
32
|
-
main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
33
|
-
usePartial: boolean;
|
|
34
|
-
useData: boolean;
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=standard-prompt-templates.generated.d.ts.map
|