kakt-agent-pack 0.0.0-stage → 0.2.3

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.
Files changed (46) hide show
  1. package/README.md +166 -2
  2. package/dist/cli.d.ts +3 -0
  3. package/dist/cli.d.ts.map +1 -0
  4. package/dist/cli.js +206 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/contract.d.ts +121 -0
  7. package/dist/contract.d.ts.map +1 -0
  8. package/dist/contract.js +93 -0
  9. package/dist/contract.js.map +1 -0
  10. package/dist/evals.d.ts +72 -0
  11. package/dist/evals.d.ts.map +1 -0
  12. package/dist/evals.js +184 -0
  13. package/dist/evals.js.map +1 -0
  14. package/dist/index.d.ts +10 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +10 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/init.d.ts +43 -0
  19. package/dist/init.d.ts.map +1 -0
  20. package/dist/init.js +420 -0
  21. package/dist/init.js.map +1 -0
  22. package/dist/inventory-types.d.ts +120 -0
  23. package/dist/inventory-types.d.ts.map +1 -0
  24. package/dist/inventory-types.js +159 -0
  25. package/dist/inventory-types.js.map +1 -0
  26. package/dist/inventory.d.ts +27 -0
  27. package/dist/inventory.d.ts.map +1 -0
  28. package/dist/inventory.js +427 -0
  29. package/dist/inventory.js.map +1 -0
  30. package/dist/resolve.d.ts +30 -0
  31. package/dist/resolve.d.ts.map +1 -0
  32. package/dist/resolve.js +44 -0
  33. package/dist/resolve.js.map +1 -0
  34. package/dist/stage.d.ts +33 -0
  35. package/dist/stage.d.ts.map +1 -0
  36. package/dist/stage.js +68 -0
  37. package/dist/stage.js.map +1 -0
  38. package/dist/topologies.d.ts +25 -0
  39. package/dist/topologies.d.ts.map +1 -0
  40. package/dist/topologies.js +29 -0
  41. package/dist/topologies.js.map +1 -0
  42. package/dist/validate.d.ts +19 -0
  43. package/dist/validate.d.ts.map +1 -0
  44. package/dist/validate.js +517 -0
  45. package/dist/validate.js.map +1 -0
  46. package/package.json +41 -3
package/README.md CHANGED
@@ -1,3 +1,167 @@
1
- # Temporary Holding Version
1
+ # kakt-agent-pack
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The agent pack contract every waypoint consumer conforms to (ADR-041).
4
+
5
+ An **agent pack** is the content of one agent product: its definition, its
6
+ agents' prompts, the tools and skills they use, and the tool binaries `run_tool`
7
+ invokes. It is data — not a service, not an image of its own making.
8
+
9
+ Waypoint defines the structure. Consumers — including consumers in other
10
+ repositories — conform to it and write no build of their own.
11
+
12
+ ## What a pack is
13
+
14
+ ```
15
+ definition.json the agent-dag definition; its `name` names the pack
16
+ agents/<node-id>/
17
+ instructions/*.md the prompt, read in name order and concatenated
18
+ tools/ executables this agent calls through run_tool
19
+ skills/ skills this agent loads
20
+ agents/shared/ prompt sections every agent can import
21
+ agents/shared/tools/ tools merged into every agent's run_tool
22
+ bin/ binaries the tools invoke (AGENT_SDK_TOOLS_BIN_DIR)
23
+ sandbox/Dockerfile optional, and usually absent — see below
24
+ ```
25
+
26
+ There is no serve entrypoint and no `package.json`. A pack is content: waypoint
27
+ ships the runtime that serves it (the `agent-serve` image and chart, below), and
28
+ a consumer that writes serve code has started reimplementing the golden path.
29
+
30
+ `init` also writes a `.gitignore`, from the same list the stager excludes from the
31
+ image — a cache committed to a pack is a cache shipped into a sandbox, and
32
+ agent-sdk has already paid for that once.
33
+
34
+ `init` creates all of these, so a dev never has to know which paths the harness
35
+ scans. Every directory carries a README stating what it is for — and the ones with
36
+ nothing in them yet need it twice over, because git does not track an empty
37
+ directory and a bare one disappears on the first commit.
38
+
39
+ `agents/shared/` holds two different things, which its README spells out: prompt
40
+ sections other agents import through an `<inputs> imports:` block in a file whose
41
+ name ends `inputs.md`, and `tools/` merged into every agent's `run_tool`. It is
42
+ not an agent — no node, no instructions, nothing routes to it.
43
+
44
+ `sandbox/Dockerfile` exists only for dependencies a startup fetch cannot
45
+ deliver — compiled extensions, system packages. **Without it no sandbox image is
46
+ built for the pack, and it runs on the platform harness image named by
47
+ `AGENT_SDK_DEFAULT_IMAGE`.** That absence is the normal case; `init --sandbox`
48
+ generates one when a pack genuinely needs its own.
49
+
50
+ That is the layout in a consumer's tree, in its content image, and in the
51
+ sandbox. One layout, in every place it appears.
52
+
53
+ There is no per-consumer variation and nothing to configure. A second accepted
54
+ location for any entry is waypoint adapting to one consumer's habits, and the
55
+ contract then becomes the union of every consumer's habits — so a consumer whose
56
+ tree differs moves its files.
57
+
58
+ ## Starting a pack
59
+
60
+ ```bash
61
+ npx kakt-agent-pack init my-builders --topology composite
62
+ npx kakt-agent-pack init my-builders --topology star --agents researcher,writer
63
+ ```
64
+
65
+ Writes the layout above and nothing else — a definition, and one `instructions/`
66
+ directory per agent — then validates its own output. An orchestrator is always
67
+ generated; `--agents` names the specialists beside it.
68
+
69
+ `--topology` is the value the definition carries and the graph agent-sdk
70
+ builds (`core/factory.py`). Every one is a DAG, which is why none of them says so:
71
+
72
+ | `--topology` | the graph |
73
+ |---|---|
74
+ | `star` | an orchestrator with specialists around it |
75
+ | `composite` | the same, with specialists that may nest their own subagents |
76
+ | `acrylic` | a code-enforced graph whose edges carry conditions, bypassing the orchestrator |
77
+
78
+ Omitting it altogether is legal — the runtime reads it from the edges, taking
79
+ acrylic when any carries a condition and star otherwise — but a pack that states
80
+ it is one whose graph does not change shape when an edge is added.
81
+
82
+ ## Using it
83
+
84
+ ```bash
85
+ npx kakt-agent-pack validate . # check this pack against the contract
86
+ npx kakt-agent-pack build . # print the docker build command for it
87
+ npx kakt-agent-pack stage . --out ./ctx
88
+ ```
89
+
90
+ `build` prints the command rather than running it, so the same line works by
91
+ hand, in a script and in CI.
92
+
93
+ There are no path options. `validate` is what a consumer runs in its own CI: a
94
+ tree that does not satisfy the layout fails the build, rather than failing at
95
+ session start inside a sandbox where it surfaces as an agent with no prompts.
96
+
97
+ ## What it refuses to ship
98
+
99
+ Each of these builds an image that looks fine and breaks in a sandbox:
100
+
101
+ - an agent directory with no `instructions/` — its prompt resolves to nothing
102
+ - `instructions/` with no `.md` files — its prompt is empty
103
+ - a definition with no nodes — nothing to serve
104
+ - a definition with no `name` — the image would have none either
105
+ - a node with no agent directory — its prompt is resolved from that directory
106
+ - an edge whose `source`, `target`, `conditions[].target`, `default_target` or
107
+ `alt_target` is not a node (`__end__` ends the graph and is allowed) — the
108
+ graph routes to an agent nobody declared
109
+ - an import in an `inputs.md` file that does not exist — the runtime only warns,
110
+ and serves the prompt without it
111
+
112
+ `shared/` is prompt sections other agents import, not an agent, and is not
113
+ checked for instructions.
114
+
115
+ ## The image
116
+
117
+ A pack's content image is the one artifact a consumer builds, and one Dockerfile
118
+ builds every one of them:
119
+
120
+ ```dockerfile
121
+ FROM busybox:1.37-musl
122
+ COPY . /content
123
+ ENTRYPOINT ["/bin/false"]
124
+ ```
125
+
126
+ `busybox` because the content is copied out of this image with `cp -a` before the
127
+ serve runtime starts; `/bin/false` because a pack is data, and one started by
128
+ mistake should do nothing.
129
+
130
+ ## Serving it
131
+
132
+ Waypoint publishes the runtime, once, for every pack:
133
+
134
+ - **`ghcr.io/soloz-io/waypoint/agent-serve`** — the serve runtime image. It holds
135
+ no pack.
136
+ - **the `agent-serve` chart** (`oci://ghcr.io/soloz-io/charts`) — deployed per
137
+ pack, with that pack's content image as an input.
138
+
139
+ A deployment names its packs and their content images, pinned by digest:
140
+
141
+ ```yaml
142
+ packs:
143
+ - name: my-builders # the name the SDK addresses: /packs/my-builders/...
144
+ image:
145
+ repository: ghcr.io/acme/my-builders-pack
146
+ digest: sha256:... # the pack's version
147
+ ```
148
+
149
+ The chart copies each content image to `/packs/<name>` before the runtime
150
+ starts, and tells the runtime what it copied. The runtime hydrates prompts from
151
+ that tree and serves the same tree to each sandbox at `/packs/<pack>/content`,
152
+ which the harness fetches at startup. Nothing mounts a pack into a sandbox, and
153
+ a consumer builds nothing but the content image: no serve code, no Dockerfile,
154
+ no chart.
155
+
156
+ A consumer's CI is therefore three steps: `validate`, `stage` + build and push
157
+ the content image, and pin its digest where the deployment's `packs` reads it.
158
+ Waypoint keeps those steps as a standard workflow,
159
+ `.github/workflows/agent-packs.yml` in the waypoint repository, and it is the
160
+ authority for them. A consumer copies its two jobs into a workflow of its own —
161
+ a copy needs no cross-repository access — states which packs and where in an
162
+ `env` block, and leaves a comment pointing back at the standard. It does not
163
+ adapt the jobs: when the standard changes it re-copies, and a step it needs to
164
+ behave differently is a change to the contract, made in waypoint for everyone.
165
+
166
+ Validation is a gate across every pack named: if one fails, none is built or
167
+ pinned.
package/dist/cli.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
package/dist/cli.js ADDED
@@ -0,0 +1,206 @@
1
+ #!/usr/bin/env node
2
+ import { readFileSync, rmSync } from 'node:fs';
3
+ import { PACK_CONTENT_ROOT } from './contract.js';
4
+ import { initPack } from './init.js';
5
+ import { buildPackInventory } from './inventory.js';
6
+ import { resolvePack } from './resolve.js';
7
+ import { TOPOLOGIES, TOPOLOGY_NAMES } from './topologies.js';
8
+ import { stagePack } from './stage.js';
9
+ import { hasErrors, validatePack } from './validate.js';
10
+ const USAGE = `kakt-agent-pack — the agent pack contract (waypoint ADR-041)
11
+
12
+ kakt-agent-pack init <name> generate a new pack
13
+ kakt-agent-pack validate [dir] check a pack against the contract
14
+ kakt-agent-pack inspect [dir] extract deterministic pack inventory JSON
15
+ kakt-agent-pack push [dir] register a validated shipped pack into the SDK catalog
16
+ kakt-agent-pack stage [dir] write the build context and print its path
17
+ kakt-agent-pack build [dir] print the docker build command for this pack
18
+
19
+ init options
20
+ --topology <name> ${TOPOLOGY_NAMES.join(' | ')} (default: star)
21
+ --agents <a,b,c> the specialists beside the orchestrator (default: specialist)
22
+ --dir <path> where to write (default: ./<name>)
23
+ --workspace <db|s3> filesystem backend for a session (default: db)
24
+ --sandbox also generate sandbox/Dockerfile, for a pack whose tools
25
+ need compiled libraries. Without it the pack runs on the
26
+ platform harness image (AGENT_SDK_DEFAULT_IMAGE).
27
+
28
+ Topologies
29
+ ${Object.entries(TOPOLOGIES)
30
+ .map(([name, t]) => ` ${name.padEnd(11)} → "${t.declares}"${' '.repeat(Math.max(1, 12 - t.declares.length))}${t.summary}`)
31
+ .join('\n')}
32
+
33
+ push options
34
+ --url <sdk-url> Waypoint SDK base URL (or WAYPOINT_SDK_BASE_URL)
35
+ --app <appId> target app ID (or WAYPOINT_APP_ID)
36
+ --tenant <tenantId> target tenant ID (or WAYPOINT_TENANT_ID)
37
+ --slug <slug> override catalog pack slug (default: definition.name)
38
+ --image <ref> optional deployed OCI image ref/digest
39
+ --token <token> SDK internal auth token (or WAYPOINT_INTERNAL_TOKEN)
40
+
41
+ stage / build options
42
+ --tag <image:tag> image to build (default: <definition name>-pack:dev)
43
+ --out <path> stage into this directory instead of a temporary one
44
+
45
+ A pack is content: the definition, the agents' instructions, tools and skills,
46
+ and the tool binaries run_tool invokes. There are no path options — the layout is
47
+ waypoint's, a consumer keeps its files in it, and every pack is built from the
48
+ same Dockerfile, which consumers do not write.
49
+ `;
50
+ function parseArgs(argv) {
51
+ const [command = 'validate', ...rest] = argv;
52
+ const flags = {};
53
+ const positional = [];
54
+ for (let i = 0; i < rest.length; i++) {
55
+ const arg = rest[i];
56
+ if (arg.startsWith('--')) {
57
+ flags[arg.slice(2)] = rest[++i] ?? '';
58
+ }
59
+ else {
60
+ positional.push(arg);
61
+ }
62
+ }
63
+ return { command, dir: positional[0] ?? '.', flags };
64
+ }
65
+ async function main() {
66
+ const { command, dir, flags } = parseArgs(process.argv.slice(2));
67
+ if (command === 'help' || flags.help !== undefined) {
68
+ process.stdout.write(USAGE);
69
+ return;
70
+ }
71
+ if (command === 'init') {
72
+ // Generated before anything is resolved: `init` has no pack to read yet, and
73
+ // its argument is a name rather than a directory.
74
+ const name = dir === '.' ? '' : dir;
75
+ if (!name) {
76
+ process.stderr.write('init needs a name: kakt-agent-pack init <name> [--topology star]\n');
77
+ process.exitCode = 1;
78
+ return;
79
+ }
80
+ let result;
81
+ try {
82
+ result = initPack({
83
+ name,
84
+ dir: flags.dir,
85
+ topology: flags.topology || 'star',
86
+ agents: flags.agents ? flags.agents.split(',') : undefined,
87
+ persistentWorkspace: flags.workspace === 's3' ? 's3' : 'db',
88
+ sandbox: flags.sandbox !== undefined,
89
+ });
90
+ }
91
+ catch (err) {
92
+ process.stderr.write(`${err instanceof Error ? err.message : String(err)}\n`);
93
+ process.exitCode = 1;
94
+ return;
95
+ }
96
+ // Validated immediately, against the same contract every consumer's CI runs.
97
+ // A template that drifts fails here rather than in the first build of a pack
98
+ // someone generated from it.
99
+ const findings = validatePack(resolvePack({ root: result.root }));
100
+ for (const finding of findings) {
101
+ process.stderr.write(`${finding.level === 'error' ? '✖' : '⚠'} ${finding.message}\n`);
102
+ }
103
+ if (hasErrors(findings)) {
104
+ process.stderr.write('\nThe generated pack does not satisfy the contract — this is a bug in init.\n');
105
+ process.exitCode = 1;
106
+ return;
107
+ }
108
+ process.stdout.write(`${name}: created ${result.written.length} paths in ${result.root}\n`);
109
+ for (const path of result.written)
110
+ process.stdout.write(` ${path}\n`);
111
+ process.stdout.write(`\ntopology "${result.declaredTopology}" — edit the instructions, then:\n`);
112
+ process.stdout.write(` npx kakt-agent-pack validate ${result.root}\n`);
113
+ return;
114
+ }
115
+ const pack = resolvePack({ root: dir });
116
+ const findings = validatePack(pack);
117
+ for (const finding of findings) {
118
+ const prefix = finding.level === 'error' ? '✖' : '⚠';
119
+ process.stderr.write(`${prefix} ${finding.message}\n`);
120
+ }
121
+ if (hasErrors(findings)) {
122
+ process.stderr.write(`\n${pack.imageName}: not built — the errors above would ship in the image.\n`);
123
+ process.exitCode = 1;
124
+ return;
125
+ }
126
+ if (command === 'validate') {
127
+ process.stdout.write(`${pack.imageName}: ok (${pack.definitionName}, agents at ${pack.agents})\n`);
128
+ return;
129
+ }
130
+ if (command === 'inspect') {
131
+ const definition = JSON.parse(readFileSync(pack.definition, 'utf-8'));
132
+ const inventory = buildPackInventory(pack.root);
133
+ process.stdout.write(`${JSON.stringify({
134
+ pack: flags.slug || pack.definitionName,
135
+ slug: flags.slug || pack.definitionName,
136
+ contentDigest: inventory.contentDigest,
137
+ definition,
138
+ inventory,
139
+ }, null, 2)}\n`);
140
+ return;
141
+ }
142
+ if (command === 'push') {
143
+ const sdkUrl = (flags.url || process.env.WAYPOINT_SDK_BASE_URL || '').replace(/\/+$/, '');
144
+ const appId = flags.app || process.env.WAYPOINT_APP_ID || '';
145
+ const tenantId = flags.tenant || process.env.WAYPOINT_TENANT_ID || '';
146
+ const token = flags.token || process.env.WAYPOINT_INTERNAL_TOKEN || '';
147
+ const slug = flags.slug || pack.definitionName;
148
+ if (!sdkUrl || !appId || !tenantId) {
149
+ process.stderr.write('push requires --url (or WAYPOINT_SDK_BASE_URL), --app (or WAYPOINT_APP_ID), and --tenant (or WAYPOINT_TENANT_ID)\n');
150
+ process.exitCode = 1;
151
+ return;
152
+ }
153
+ const definition = JSON.parse(readFileSync(pack.definition, 'utf-8'));
154
+ const inventory = buildPackInventory(pack.root);
155
+ const headers = { 'content-type': 'application/json' };
156
+ if (token)
157
+ headers['x-waypoint-internal-token'] = token;
158
+ const res = await fetch(`${sdkUrl}/internal/apps/${encodeURIComponent(appId)}/packs/register`, {
159
+ method: 'POST',
160
+ headers,
161
+ body: JSON.stringify({
162
+ tenant_id: tenantId,
163
+ slug,
164
+ pack: slug,
165
+ source: flags.image ? 'deployed' : 'shipped',
166
+ content_digest: inventory.contentDigest,
167
+ image_ref: flags.image || (typeof definition.image === 'string' ? definition.image : undefined),
168
+ definition,
169
+ inventory,
170
+ }),
171
+ });
172
+ const bodyText = await res.text();
173
+ if (!res.ok) {
174
+ process.stderr.write(`push failed (${res.status}): ${bodyText}\n`);
175
+ process.exitCode = 1;
176
+ return;
177
+ }
178
+ process.stdout.write(`${bodyText}\n`);
179
+ return;
180
+ }
181
+ const tag = flags.tag || `${pack.imageName}:dev`;
182
+ const staged = stagePack(pack, flags.out);
183
+ if (command === 'stage') {
184
+ process.stdout.write(`${staged.contextDir}\n`);
185
+ return;
186
+ }
187
+ if (command === 'build') {
188
+ // Printed, not run. A build belongs to whoever is watching its output, and
189
+ // this way the same command works in a script, in CI and by hand.
190
+ process.stdout.write(`# ${pack.imageName}: ${staged.contents.join(', ')} staged into ${PACK_CONTENT_ROOT}\n` +
191
+ `docker build -t ${tag} -f ${staged.dockerfile} ${staged.contextDir}\n`);
192
+ if (!flags.out) {
193
+ process.stderr.write(`\n# The context above is temporary. Pass --out <dir> to keep it, or run the command before it is cleaned up.\n`);
194
+ }
195
+ return;
196
+ }
197
+ process.stderr.write(`Unknown command "${command}".\n\n${USAGE}`);
198
+ process.exitCode = 1;
199
+ if (!flags.out)
200
+ rmSync(staged.contextDir, { recursive: true, force: true });
201
+ }
202
+ void main().catch((err) => {
203
+ process.stderr.write(`${err instanceof Error ? err.message : String(err)}\n`);
204
+ process.exitCode = 1;
205
+ });
206
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,YAAY,EA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,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,KAAK,IAAI,CAAC,SAAS,KAAK,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,iBAAiB,IAAI;YACrF,mBAAmB,GAAG,OAAO,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,UAAU,IAAI,CAC1E,CAAC;QACF,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;YACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,gHAAgH,CACjH,CAAC;QACJ,CAAC;QACD,OAAO;IACT,CAAC;IAED,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,OAAO,SAAS,KAAK,EAAE,CAAC,CAAC;IAClE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACrB,IAAI,CAAC,KAAK,CAAC,GAAG;QAAE,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9E,CAAC;AAED,KAAK,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACxB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC9E,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,121 @@
1
+ /**
2
+ * The agent pack contract (waypoint ADR-041).
3
+ *
4
+ * Waypoint defines how a pack is structured; every consumer conforms, including
5
+ * consumers in other repositories. The contract lives here as data so there is
6
+ * one statement of it — a second copy in a Dockerfile or a deploy script is how
7
+ * three products came to encode the same build three different ways.
8
+ */
9
+ /** What a built pack looks like inside its image, and inside the sandbox mount. */
10
+ export declare const PACK_CONTENT_ROOT = "/content";
11
+ /** Paths within a pack. The sandbox mounts the pack root, so these are its subpaths. */
12
+ export declare const PACK_LAYOUT: {
13
+ /** The agent-dag definition. Its `name` names the pack; its nodes name the agents. */
14
+ readonly definition: "definition.json";
15
+ /** One directory per agent: instructions/, and optionally tools/ and skills/. */
16
+ readonly agents: "agents";
17
+ /** The tool CLI and action manifest `run_tool` invokes. Optional. */
18
+ readonly bin: "bin";
19
+ /**
20
+ * Eval criteria, one `<agent>-evals.ts` per agent. Optional. Staged only as
21
+ * the compiled `evalsCompiled`, and never in the content a sandbox receives:
22
+ * an agent does not read the rubric it is graded by.
23
+ */
24
+ readonly evals: "evals";
25
+ /** The criteria as data, written by `stage` and served on `/packs/:pack/evals`. */
26
+ readonly evalsCompiled: "evals/evals.json";
27
+ /**
28
+ * The product's sandbox image recipe. Optional, and absent is the common case.
29
+ *
30
+ * A pack needs one only for dependencies that cannot be fetched at startup —
31
+ * compiled extensions, system packages. Without it no sandbox image is built
32
+ * for this pack, no digest is published under its name, and the SDK runs it on
33
+ * the default harness image named by AGENT_SDK_DEFAULT_IMAGE.
34
+ */
35
+ readonly sandbox: "sandbox/Dockerfile";
36
+ /**
37
+ * The session's computer app (waypoint ADR-050 §5), when the definition
38
+ * declares `"computer": true`. Built into the sandbox image at
39
+ * COMPUTER_IMAGE_DIR, never staged into the pack.
40
+ */
41
+ readonly computer: "sandbox/computer";
42
+ /** How the computer starts: { start, port, ready }. */
43
+ readonly computerManifest: "sandbox/computer/computer.json";
44
+ };
45
+ /** Where a sandbox image places its built computer app, manifest included. */
46
+ export declare const COMPUTER_IMAGE_DIR = "/opt/computer";
47
+ /** A computer's manifest (`computer.json`), as the harness reads it. */
48
+ export interface ComputerManifest {
49
+ /** The command that starts the app, run from the session's workspace. */
50
+ start: string;
51
+ /** The port it listens on, on the pod's loopback. */
52
+ port: number;
53
+ /** A path that answers once it is ready to serve. */
54
+ ready?: string;
55
+ }
56
+ /**
57
+ * Where those paths are found in a consumer's source tree: the same places.
58
+ *
59
+ * Requirements, not defaults. A second accepted location per entry is waypoint
60
+ * adapting to each consumer's habits, and the union of those habits is what the
61
+ * contract then becomes — so a consumer whose tree differs moves its files.
62
+ */
63
+ export declare const SOURCE_LAYOUT: {
64
+ /** The agent-dag definition. Its `name` names the pack; its nodes name the agents. */
65
+ readonly definition: "definition.json";
66
+ /** One directory per agent: instructions/, and optionally tools/ and skills/. */
67
+ readonly agents: "agents";
68
+ /** The tool CLI and action manifest `run_tool` invokes. Optional. */
69
+ readonly bin: "bin";
70
+ /**
71
+ * Eval criteria, one `<agent>-evals.ts` per agent. Optional. Staged only as
72
+ * the compiled `evalsCompiled`, and never in the content a sandbox receives:
73
+ * an agent does not read the rubric it is graded by.
74
+ */
75
+ readonly evals: "evals";
76
+ /** The criteria as data, written by `stage` and served on `/packs/:pack/evals`. */
77
+ readonly evalsCompiled: "evals/evals.json";
78
+ /**
79
+ * The product's sandbox image recipe. Optional, and absent is the common case.
80
+ *
81
+ * A pack needs one only for dependencies that cannot be fetched at startup —
82
+ * compiled extensions, system packages. Without it no sandbox image is built
83
+ * for this pack, no digest is published under its name, and the SDK runs it on
84
+ * the default harness image named by AGENT_SDK_DEFAULT_IMAGE.
85
+ */
86
+ readonly sandbox: "sandbox/Dockerfile";
87
+ /**
88
+ * The session's computer app (waypoint ADR-050 §5), when the definition
89
+ * declares `"computer": true`. Built into the sandbox image at
90
+ * COMPUTER_IMAGE_DIR, never staged into the pack.
91
+ */
92
+ readonly computer: "sandbox/computer";
93
+ /** How the computer starts: { start, port, ready }. */
94
+ readonly computerManifest: "sandbox/computer/computer.json";
95
+ };
96
+ /**
97
+ * Never shipped in a pack, and never committed to one.
98
+ *
99
+ * One list for both, because they are the same fact: a build cache has no meaning
100
+ * inside a sandbox, and one that reaches it does damage. `.ruff_cache` and
101
+ * `__pycache__` can carry owner-only permissions from whatever checkout produced
102
+ * them, and agent-sdk records what that costs — a stray `.ruff_cache`
103
+ * crashed every session on a pod with a PermissionError deep inside the skill
104
+ * copy, because one unreadable file aborts the whole tree
105
+ * (agent-sdk core/session/skills.py).
106
+ *
107
+ * `.git` is excluded from a staged pack but not written into a pack's .gitignore,
108
+ * where it would mean nothing.
109
+ */
110
+ export declare const PACK_EXCLUDED: readonly ["node_modules", "__pycache__", ".ruff_cache", ".pytest_cache", ".mypy_cache", ".venv", ".git", "*.egg-info", ".DS_Store", "dist"];
111
+ /** `<definition name>-pack` — the image name the SDK resolves a digest for. */
112
+ export declare function packImageName(definitionName: string): string;
113
+ /**
114
+ * The prompt placeholder convention: a node whose `system_prompt` is this token
115
+ * has its prompt on disk, in the instructions/ directory of the agent named by
116
+ * the node's own id. Nothing maps one to the other — in every pack the mapping
117
+ * was the name twice — so a pack build can check what the serve runtime will
118
+ * later require: that each node declaring a placeholder has a directory.
119
+ */
120
+ export declare const PLACEHOLDER_PATTERN: RegExp;
121
+ //# sourceMappingURL=contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,mFAAmF;AACnF,eAAO,MAAM,iBAAiB,aAAa,CAAC;AAE5C,wFAAwF;AACxF,eAAO,MAAM,WAAW;IACtB,sFAAsF;;IAEtF,iFAAiF;;IAEjF,qEAAqE;;IAErE;;;;OAIG;;IAEH,mFAAmF;;IAEnF;;;;;;;OAOG;;IAEH;;;;OAIG;;IAEH,uDAAuD;;CAE/C,CAAC;AAEX,8EAA8E;AAC9E,eAAO,MAAM,kBAAkB,kBAAkB,CAAC;AAElD,wEAAwE;AACxE,MAAM,WAAW,gBAAgB;IAC/B,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,aAAa;IArDxB,sFAAsF;;IAEtF,iFAAiF;;IAEjF,qEAAqE;;IAErE;;;;OAIG;;IAEH,mFAAmF;;IAEnF;;;;;;;OAOG;;IAEH;;;;OAIG;;IAEH,uDAAuD;;CAwBjB,CAAC;AAEzC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,aAAa,6IAWhB,CAAC;AAEX,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,QAA4B,CAAC"}
@@ -0,0 +1,93 @@
1
+ /**
2
+ * The agent pack contract (waypoint ADR-041).
3
+ *
4
+ * Waypoint defines how a pack is structured; every consumer conforms, including
5
+ * consumers in other repositories. The contract lives here as data so there is
6
+ * one statement of it — a second copy in a Dockerfile or a deploy script is how
7
+ * three products came to encode the same build three different ways.
8
+ */
9
+ /** What a built pack looks like inside its image, and inside the sandbox mount. */
10
+ export const PACK_CONTENT_ROOT = '/content';
11
+ /** Paths within a pack. The sandbox mounts the pack root, so these are its subpaths. */
12
+ export const PACK_LAYOUT = {
13
+ /** The agent-dag definition. Its `name` names the pack; its nodes name the agents. */
14
+ definition: 'definition.json',
15
+ /** One directory per agent: instructions/, and optionally tools/ and skills/. */
16
+ agents: 'agents',
17
+ /** The tool CLI and action manifest `run_tool` invokes. Optional. */
18
+ bin: 'bin',
19
+ /**
20
+ * Eval criteria, one `<agent>-evals.ts` per agent. Optional. Staged only as
21
+ * the compiled `evalsCompiled`, and never in the content a sandbox receives:
22
+ * an agent does not read the rubric it is graded by.
23
+ */
24
+ evals: 'evals',
25
+ /** The criteria as data, written by `stage` and served on `/packs/:pack/evals`. */
26
+ evalsCompiled: 'evals/evals.json',
27
+ /**
28
+ * The product's sandbox image recipe. Optional, and absent is the common case.
29
+ *
30
+ * A pack needs one only for dependencies that cannot be fetched at startup —
31
+ * compiled extensions, system packages. Without it no sandbox image is built
32
+ * for this pack, no digest is published under its name, and the SDK runs it on
33
+ * the default harness image named by AGENT_SDK_DEFAULT_IMAGE.
34
+ */
35
+ sandbox: 'sandbox/Dockerfile',
36
+ /**
37
+ * The session's computer app (waypoint ADR-050 §5), when the definition
38
+ * declares `"computer": true`. Built into the sandbox image at
39
+ * COMPUTER_IMAGE_DIR, never staged into the pack.
40
+ */
41
+ computer: 'sandbox/computer',
42
+ /** How the computer starts: { start, port, ready }. */
43
+ computerManifest: 'sandbox/computer/computer.json',
44
+ };
45
+ /** Where a sandbox image places its built computer app, manifest included. */
46
+ export const COMPUTER_IMAGE_DIR = '/opt/computer';
47
+ /**
48
+ * Where those paths are found in a consumer's source tree: the same places.
49
+ *
50
+ * Requirements, not defaults. A second accepted location per entry is waypoint
51
+ * adapting to each consumer's habits, and the union of those habits is what the
52
+ * contract then becomes — so a consumer whose tree differs moves its files.
53
+ */
54
+ export const SOURCE_LAYOUT = PACK_LAYOUT;
55
+ /**
56
+ * Never shipped in a pack, and never committed to one.
57
+ *
58
+ * One list for both, because they are the same fact: a build cache has no meaning
59
+ * inside a sandbox, and one that reaches it does damage. `.ruff_cache` and
60
+ * `__pycache__` can carry owner-only permissions from whatever checkout produced
61
+ * them, and agent-sdk records what that costs — a stray `.ruff_cache`
62
+ * crashed every session on a pod with a PermissionError deep inside the skill
63
+ * copy, because one unreadable file aborts the whole tree
64
+ * (agent-sdk core/session/skills.py).
65
+ *
66
+ * `.git` is excluded from a staged pack but not written into a pack's .gitignore,
67
+ * where it would mean nothing.
68
+ */
69
+ export const PACK_EXCLUDED = [
70
+ 'node_modules',
71
+ '__pycache__',
72
+ '.ruff_cache',
73
+ '.pytest_cache',
74
+ '.mypy_cache',
75
+ '.venv',
76
+ '.git',
77
+ '*.egg-info',
78
+ '.DS_Store',
79
+ 'dist',
80
+ ];
81
+ /** `<definition name>-pack` — the image name the SDK resolves a digest for. */
82
+ export function packImageName(definitionName) {
83
+ return `${definitionName}-pack`;
84
+ }
85
+ /**
86
+ * The prompt placeholder convention: a node whose `system_prompt` is this token
87
+ * has its prompt on disk, in the instructions/ directory of the agent named by
88
+ * the node's own id. Nothing maps one to the other — in every pack the mapping
89
+ * was the name twice — so a pack build can check what the serve runtime will
90
+ * later require: that each node declaring a placeholder has a directory.
91
+ */
92
+ export const PLACEHOLDER_PATTERN = /^__PROMPT_[A-Z0-9_]+__$/;
93
+ //# sourceMappingURL=contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,mFAAmF;AACnF,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAC;AAE5C,wFAAwF;AACxF,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,sFAAsF;IACtF,UAAU,EAAE,iBAAiB;IAC7B,iFAAiF;IACjF,MAAM,EAAE,QAAQ;IAChB,qEAAqE;IACrE,GAAG,EAAE,KAAK;IACV;;;;OAIG;IACH,KAAK,EAAE,OAAO;IACd,mFAAmF;IACnF,aAAa,EAAE,kBAAkB;IACjC;;;;;;;OAOG;IACH,OAAO,EAAE,oBAAoB;IAC7B;;;;OAIG;IACH,QAAQ,EAAE,kBAAkB;IAC5B,uDAAuD;IACvD,gBAAgB,EAAE,gCAAgC;CAC1C,CAAC;AAEX,8EAA8E;AAC9E,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAC;AAYlD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC;AAEzC;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,cAAc;IACd,aAAa;IACb,aAAa;IACb,eAAe;IACf,aAAa;IACb,OAAO;IACP,MAAM;IACN,YAAY;IACZ,WAAW;IACX,MAAM;CACE,CAAC;AAEX,+EAA+E;AAC/E,MAAM,UAAU,aAAa,CAAC,cAAsB;IAClD,OAAO,GAAG,cAAc,OAAO,CAAC;AAClC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,yBAAyB,CAAC"}