@cat-factory/agents 0.104.3 → 0.105.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/dist/agents/kinds/traits.d.ts +7 -3
- package/dist/agents/kinds/traits.d.ts.map +1 -1
- package/dist/agents/kinds/traits.js +10 -6
- package/dist/agents/kinds/traits.js.map +1 -1
- package/dist/foundationalServices/FoundationalServiceRunResolver.d.ts +2 -2
- package/dist/foundationalServices/FoundationalServiceRunResolver.d.ts.map +1 -1
- package/dist/foundationalServices/FoundationalServiceRunResolver.js +44 -2
- package/dist/foundationalServices/FoundationalServiceRunResolver.js.map +1 -1
- package/package.json +5 -5
|
@@ -87,9 +87,13 @@ export declare const FOUNDATIONAL_CATALOG_GUIDANCE: string;
|
|
|
87
87
|
* storage service and the selected CONTEXT services (an inventory that can say which entities
|
|
88
88
|
* exist, which lack an asset, and how each is described), each with its API contract, and reads
|
|
89
89
|
* the agent's machine-readable declaration of what it stored back onto the step
|
|
90
|
-
* (`PipelineStep.binaryOutputs`).
|
|
91
|
-
*
|
|
92
|
-
*
|
|
90
|
+
* (`PipelineStep.binaryOutputs`). The same selection names the GENERATIVE INTEGRATIONS the step
|
|
91
|
+
* may call to produce those artifacts (`generatorIds`, from the deployment's code-registered
|
|
92
|
+
* `BinaryGeneratorRegistry`) and the CONTENT TYPES it must deliver (`modalities`), which the
|
|
93
|
+
* brief lays out per integration so an image generator is never asked for music. Run admission
|
|
94
|
+
* refuses a step carrying this trait whose selection is missing, does not resolve against the
|
|
95
|
+
* catalog/registry, or cannot cover a content type the step declares. No built-in kind carries
|
|
96
|
+
* it — a deployment's generator opts in via `registerAgentKind({ traits })`.
|
|
93
97
|
* See docs/initiatives/binary-output-foundational-storage.md.
|
|
94
98
|
*/
|
|
95
99
|
export declare const BINARY_OUTPUT_TRAIT: AgentTrait;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traits.d.ts","sourceRoot":"","sources":["../../../src/agents/kinds/traits.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,SAAS,EASf,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAetD,yFAAyF;AACzF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAA;AAE/B;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,UAAyB,CAAA;AAExD;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,UAAwB,CAAA;AAEtD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,UAAyB,CAAA;AAExD;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,EAAE,UAA6B,CAAA;AAEhE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB,EAAE,UAA6B,CAAA;AAEhE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,EAAE,UAA8B,CAAA;AAElE;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,EAAE,UAAmC,CAAA;AAE5E;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,EAAE,UAAqC,CAAA;AAEhF,4FAA4F;AAC5F,eAAO,MAAM,6BAA6B,QAK9B,CAAA;AAEZ
|
|
1
|
+
{"version":3,"file":"traits.d.ts","sourceRoot":"","sources":["../../../src/agents/kinds/traits.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,SAAS,EASf,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAetD,yFAAyF;AACzF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAA;AAE/B;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,UAAyB,CAAA;AAExD;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,UAAwB,CAAA;AAEtD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,UAAyB,CAAA;AAExD;;;;;;;;GAQ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AAE,iBAAiB,GAAG,OAAO,CAEjG;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,iBAAiB,GAC1B,MAAM,GAAG,OAAO,CAElB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,iBAAiB,GAAG,MAAM,EAAE,CAQvF"}
|
|
@@ -90,17 +90,21 @@ export const FOUNDATIONAL_CATALOG_GUIDANCE = [
|
|
|
90
90
|
* storage service and the selected CONTEXT services (an inventory that can say which entities
|
|
91
91
|
* exist, which lack an asset, and how each is described), each with its API contract, and reads
|
|
92
92
|
* the agent's machine-readable declaration of what it stored back onto the step
|
|
93
|
-
* (`PipelineStep.binaryOutputs`).
|
|
94
|
-
*
|
|
95
|
-
*
|
|
93
|
+
* (`PipelineStep.binaryOutputs`). The same selection names the GENERATIVE INTEGRATIONS the step
|
|
94
|
+
* may call to produce those artifacts (`generatorIds`, from the deployment's code-registered
|
|
95
|
+
* `BinaryGeneratorRegistry`) and the CONTENT TYPES it must deliver (`modalities`), which the
|
|
96
|
+
* brief lays out per integration so an image generator is never asked for music. Run admission
|
|
97
|
+
* refuses a step carrying this trait whose selection is missing, does not resolve against the
|
|
98
|
+
* catalog/registry, or cannot cover a content type the step declares. No built-in kind carries
|
|
99
|
+
* it — a deployment's generator opts in via `registerAgentKind({ traits })`.
|
|
96
100
|
* See docs/initiatives/binary-output-foundational-storage.md.
|
|
97
101
|
*/
|
|
98
102
|
export const BINARY_OUTPUT_TRAIT = 'binary-output';
|
|
99
103
|
/** The guidance a binary-generating kind gets: the brief, the workflow, and the declaration. */
|
|
100
104
|
export const BINARY_OUTPUT_GUIDANCE = [
|
|
101
|
-
`Your deliverable is BINARY artifacts (images, audio, or similar), stored through a shared storage service this deployment runs. Start from \`.cat-context/${BINARY_OUTPUT_BRIEF_FILE}\`: it names the storage service to
|
|
102
|
-
`Before generating, establish SCOPE from the selected context services (what entities exist, which already have an asset, what each thing's description says) rather than inventing subjects. Store every artifact through the named storage service's contract — call the operations it declares, with the shapes it declares; never invent an endpoint, and never deliver binaries by committing them to the repository or embedding them in your reply.`,
|
|
103
|
-
`END your reply with a fenced \`\`\`${BINARY_OUTPUT_DECLARATION_TAG} block containing either the literal \`none\` (you stored nothing) or a JSON array of entries \`{"service": "<service id>", "location": "<where the service stored it>", "entity": "<what it is for>", "contentType": "<media type>", "description": "<one line>"}\` — \`service\` and \`location\` are required, the rest optional. This block is machine-read and recorded on the run; an artifact you omit is one nobody can find later. Anything you could NOT store (a
|
|
105
|
+
`Your deliverable is BINARY artifacts (images, audio, video or similar), produced through the generative integrations this step was given and stored through a shared storage service this deployment runs. Start from \`.cat-context/${BINARY_OUTPUT_BRIEF_FILE}\`: it names the integrations you may generate with (and the content types each one produces), the storage service to store through, any context services selected for this step, and where their API contracts are. If that file is absent, the platform could not provide storage — do not attempt any upload; state it in your report and stop generating.`,
|
|
106
|
+
`Before generating, establish SCOPE from the selected context services (what entities exist, which already have an asset, what each thing's description says) rather than inventing subjects. Generate ONLY through the integrations the brief names, and only for the content types it says each one produces; a credential it names arrives as an environment variable, and an unset one means the platform could not provide it — report that instead of calling the API anyway. Store every artifact through the named storage service's contract — call the operations it declares, with the shapes it declares; never invent an endpoint, and never deliver binaries by committing them to the repository or embedding them in your reply.`,
|
|
107
|
+
`END your reply with a fenced \`\`\`${BINARY_OUTPUT_DECLARATION_TAG} block containing either the literal \`none\` (you stored nothing) or a JSON array of entries \`{"service": "<service id>", "location": "<where the service stored it>", "generator": "<integration id that produced it>", "entity": "<what it is for>", "contentType": "<media type>", "description": "<one line>"}\` — \`service\` and \`location\` are required, the rest optional. This block is machine-read and recorded on the run; an artifact you omit is one nobody can find later. Anything you could NOT produce or store (an integration with no credential, a content type nothing available generates, a failed upload, a contract gap) belongs in your report as a named omission, never silently dropped.`,
|
|
104
108
|
].join('\n');
|
|
105
109
|
/** The guidance a consumer kind gets: the contracts are files, and they are authoritative. */
|
|
106
110
|
export const FOUNDATIONAL_CONTRACTS_GUIDANCE = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traits.js","sourceRoot":"","sources":["../../../src/agents/kinds/traits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAChG,OAAO,EAEL,wBAAwB,EACxB,6BAA6B,EAC7B,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,4BAA4B,EAC5B,uBAAuB,EACvB,iCAAiC,GAClC,MAAM,qBAAqB,CAAA;AAmB5B;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAe,YAAY,CAAA;AAExD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAe,WAAW,CAAA;AAEtD;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAe,YAAY,CAAA;AAExD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAe,gBAAgB,CAAA;AAEhE;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAe,gBAAgB,CAAA;AAEhE;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAe,iBAAiB,CAAA;AAElE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAe,sBAAsB,CAAA;AAE5E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAe,wBAAwB,CAAA;AAEhF,4FAA4F;AAC5F,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,4QAA4Q,yBAAyB,4CAA4C;IACjV,yNAAyN;IACzN,iPAAiP;IACjP,sCAAsC,4BAA4B,6ZAA6Z;CAChe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAEZ
|
|
1
|
+
{"version":3,"file":"traits.js","sourceRoot":"","sources":["../../../src/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 @@
|
|
|
1
1
|
import type { BinaryOutputConfig, FoundationalServiceSelection } from '@cat-factory/contracts';
|
|
2
|
-
import type { FoundationalCatalogView, InjectedContextFile } from '@cat-factory/kernel';
|
|
2
|
+
import type { BinaryGeneratorRegistry, FoundationalCatalogView, InjectedContextFile } from '@cat-factory/kernel';
|
|
3
3
|
import type { FoundationalServiceCatalogService } from './FoundationalServiceCatalogService.js';
|
|
4
4
|
/**
|
|
5
5
|
* The engine-facing seam over the foundational-services catalog
|
|
@@ -49,7 +49,7 @@ export declare class FoundationalServiceRunResolver {
|
|
|
49
49
|
* Run admission refuses the bad selections it can see up front; this read is what a run that
|
|
50
50
|
* outlives a catalog edit still gets, so it re-states rather than assumes.
|
|
51
51
|
*/
|
|
52
|
-
binaryOutputContextFilesFor(workspaceId: string, config: BinaryOutputConfig | undefined): Promise<InjectedContextFile[]>;
|
|
52
|
+
binaryOutputContextFilesFor(workspaceId: string, config: BinaryOutputConfig | undefined, generatorRegistry?: BinaryGeneratorRegistry): Promise<InjectedContextFile[]>;
|
|
53
53
|
private hasCatalog;
|
|
54
54
|
}
|
|
55
55
|
//# sourceMappingURL=FoundationalServiceRunResolver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FoundationalServiceRunResolver.d.ts","sourceRoot":"","sources":["../../src/foundationalServices/FoundationalServiceRunResolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAA;AAC9F,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"FoundationalServiceRunResolver.d.ts","sourceRoot":"","sources":["../../src/foundationalServices/FoundationalServiceRunResolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAA;AAC9F,OAAO,KAAK,EACV,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EAEpB,MAAM,qBAAqB,CAAA;AAY5B,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAA;AAE/F;;;;;;;;;;;;;GAaG;AACH,qBAAa,8BAA8B;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAApC,YAA6B,OAAO,EAAE,iCAAiC,EAAI;IAE3E,oFAAoF;IAC9E,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,EAAE,CAAC,CAUxE;IAED,kGAAkG;IAC5F,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAE1D;IAED;;;;;;;;;;;;;;OAcG;IACG,eAAe,CACnB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,4BAA4B,GAAG,SAAS,GAClD,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAyChC;IAED;;;;;;;;;;OAUG;IACG,2BAA2B,CAC/B,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,kBAAkB,GAAG,SAAS,EACtC,iBAAiB,CAAC,EAAE,uBAAuB,GAC1C,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAoEhC;YAEa,UAAU;CAGzB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BINARY_OUTPUT_BRIEF_FILE, FOUNDATIONAL_INDEX_FILE, binaryContextFileFor, contextFileFor, renderBinaryOutputBrief, renderContractDocument, renderFoundationalIndex, } from '@cat-factory/kernel';
|
|
1
|
+
import { BINARY_OUTPUT_BRIEF_FILE, FOUNDATIONAL_INDEX_FILE, binaryContextFileFor, binaryGeneratorContextFileFor, contextFileFor, renderBinaryOutputBrief, renderContractDocument, renderFoundationalIndex, resolveBinaryGeneratorSelection, } from '@cat-factory/kernel';
|
|
2
2
|
/**
|
|
3
3
|
* The engine-facing seam over the foundational-services catalog
|
|
4
4
|
* (backend/docs/adr/0031-foundational-services.md). Two reads, deliberately separate, because they
|
|
@@ -102,7 +102,7 @@ export class FoundationalServiceRunResolver {
|
|
|
102
102
|
* Run admission refuses the bad selections it can see up front; this read is what a run that
|
|
103
103
|
* outlives a catalog edit still gets, so it re-states rather than assumes.
|
|
104
104
|
*/
|
|
105
|
-
async binaryOutputContextFilesFor(workspaceId, config) {
|
|
105
|
+
async binaryOutputContextFilesFor(workspaceId, config, generatorRegistry) {
|
|
106
106
|
if (!config) {
|
|
107
107
|
return [
|
|
108
108
|
{
|
|
@@ -116,6 +116,11 @@ export class FoundationalServiceRunResolver {
|
|
|
116
116
|
},
|
|
117
117
|
];
|
|
118
118
|
}
|
|
119
|
+
// The GENERATIVE half comes from the deployment's code registry rather than the workspace
|
|
120
|
+
// catalog, so it is resolved here in the same pass: one brief has to describe both, and a
|
|
121
|
+
// step whose integrations resolved but whose storage did not (or the reverse) is exactly the
|
|
122
|
+
// partial state the file must state rather than omit.
|
|
123
|
+
const generators = resolveBinaryGeneratorSelection(config, generatorRegistry?.views() ?? []);
|
|
119
124
|
const catalog = await this.catalogFor(workspaceId);
|
|
120
125
|
const byId = new Map(catalog.map((service) => [service.id, service]));
|
|
121
126
|
const storage = byId.get(config.storageServiceId) ?? null;
|
|
@@ -134,8 +139,10 @@ export class FoundationalServiceRunResolver {
|
|
|
134
139
|
storage,
|
|
135
140
|
contextServices,
|
|
136
141
|
unresolvedContextIds,
|
|
142
|
+
generators,
|
|
137
143
|
}),
|
|
138
144
|
},
|
|
145
|
+
...generatorContractFiles(generators, generatorRegistry),
|
|
139
146
|
];
|
|
140
147
|
for (const service of involved) {
|
|
141
148
|
const contracts = (documents.get(service.id) ?? []).map((doc) => ({
|
|
@@ -165,4 +172,39 @@ export class FoundationalServiceRunResolver {
|
|
|
165
172
|
return (await this.catalog.resolve(workspaceId)).length > 0;
|
|
166
173
|
}
|
|
167
174
|
}
|
|
175
|
+
/**
|
|
176
|
+
* One `.cat-context/binary-output/generators/<id>.md` per SELECTED integration that registers a
|
|
177
|
+
* contract, rendered through the same `renderContractDocument` the catalog services use — an
|
|
178
|
+
* agent reads one kind of contract file whatever registry it came from.
|
|
179
|
+
*
|
|
180
|
+
* An integration with no registered contract gets no file: the brief already states that case
|
|
181
|
+
* (endpoint + notes are the whole interface), and an empty document would read as an API that
|
|
182
|
+
* declares no operations.
|
|
183
|
+
*/
|
|
184
|
+
function generatorContractFiles(generators, registry) {
|
|
185
|
+
if (!registry)
|
|
186
|
+
return [];
|
|
187
|
+
const files = [];
|
|
188
|
+
for (const generator of generators.selected) {
|
|
189
|
+
const contracts = registry.documentsFor(generator.id).map((doc) => ({
|
|
190
|
+
contractId: doc.contractId,
|
|
191
|
+
format: doc.format,
|
|
192
|
+
title: doc.title,
|
|
193
|
+
body: doc.body,
|
|
194
|
+
}));
|
|
195
|
+
if (contracts.length === 0)
|
|
196
|
+
continue;
|
|
197
|
+
files.push({
|
|
198
|
+
path: binaryGeneratorContextFileFor(generator.id),
|
|
199
|
+
content: renderContractDocument({
|
|
200
|
+
id: generator.id,
|
|
201
|
+
name: generator.name,
|
|
202
|
+
summary: generator.summary,
|
|
203
|
+
description: generator.description,
|
|
204
|
+
contracts,
|
|
205
|
+
}),
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
return files;
|
|
209
|
+
}
|
|
168
210
|
//# sourceMappingURL=FoundationalServiceRunResolver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FoundationalServiceRunResolver.js","sourceRoot":"","sources":["../../src/foundationalServices/FoundationalServiceRunResolver.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FoundationalServiceRunResolver.js","sourceRoot":"","sources":["../../src/foundationalServices/FoundationalServiceRunResolver.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,6BAA6B,EAC7B,cAAc,EACd,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,+BAA+B,GAChC,MAAM,qBAAqB,CAAA;AAG5B;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,8BAA8B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AAE,SAAS,CAAC,EAAE;gBAChB,IAAI,EAAE,SAAS,CAAC,IAAI;gBACpB,OAAO,EAAE,SAAS,CAAC,OAAO;gBAC1B,WAAW,EAAE,SAAS,CAAC,WAAW;gBAClC,SAAS;aACV,CAAC;SACH,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cat-factory/agents",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.105.0",
|
|
4
4
|
"description": "Agent catalog, routing, prompts and fragment library for the Agent Architecture Board.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
"handlebars": "^4.7.9",
|
|
33
33
|
"p-map": "^7.0.6",
|
|
34
34
|
"valibot": "^1.4.2",
|
|
35
|
-
"@cat-factory/contracts": "0.
|
|
36
|
-
"@cat-factory/kernel": "0.
|
|
37
|
-
"@cat-factory/prompt-fragments": "0.15.
|
|
35
|
+
"@cat-factory/contracts": "0.212.0",
|
|
36
|
+
"@cat-factory/kernel": "0.215.0",
|
|
37
|
+
"@cat-factory/prompt-fragments": "0.15.37"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"typescript": "7.0.2",
|
|
41
41
|
"vitest": "^4.1.10",
|
|
42
|
-
"@cat-factory/caching": "0.
|
|
42
|
+
"@cat-factory/caching": "0.13.0"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "tsc -b tsconfig.build.json",
|