@agenticprimitives/devkit 0.0.0-alpha.1

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 (116) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +62 -0
  3. package/bin/ap.mjs +119 -0
  4. package/dist/config.d.ts +130 -0
  5. package/dist/config.d.ts.map +1 -0
  6. package/dist/config.js +128 -0
  7. package/dist/config.js.map +1 -0
  8. package/dist/dispatch.d.ts +44 -0
  9. package/dist/dispatch.d.ts.map +1 -0
  10. package/dist/dispatch.js +43 -0
  11. package/dist/dispatch.js.map +1 -0
  12. package/dist/doctor.d.ts +21 -0
  13. package/dist/doctor.d.ts.map +1 -0
  14. package/dist/doctor.js +71 -0
  15. package/dist/doctor.js.map +1 -0
  16. package/dist/errors.d.ts +37 -0
  17. package/dist/errors.d.ts.map +1 -0
  18. package/dist/errors.js +35 -0
  19. package/dist/errors.js.map +1 -0
  20. package/dist/fs.d.ts +20 -0
  21. package/dist/fs.d.ts.map +1 -0
  22. package/dist/fs.js +54 -0
  23. package/dist/fs.js.map +1 -0
  24. package/dist/index.d.ts +24 -0
  25. package/dist/index.d.ts.map +1 -0
  26. package/dist/index.js +19 -0
  27. package/dist/index.js.map +1 -0
  28. package/dist/lock.d.ts +18 -0
  29. package/dist/lock.d.ts.map +1 -0
  30. package/dist/lock.js +15 -0
  31. package/dist/lock.js.map +1 -0
  32. package/dist/redact.d.ts +2 -0
  33. package/dist/redact.d.ts.map +1 -0
  34. package/dist/redact.js +14 -0
  35. package/dist/redact.js.map +1 -0
  36. package/dist/rules/archetype-catalog.d.ts +4 -0
  37. package/dist/rules/archetype-catalog.d.ts.map +1 -0
  38. package/dist/rules/archetype-catalog.js +48 -0
  39. package/dist/rules/archetype-catalog.js.map +1 -0
  40. package/dist/rules/capability-vocabulary.d.ts +4 -0
  41. package/dist/rules/capability-vocabulary.d.ts.map +1 -0
  42. package/dist/rules/capability-vocabulary.js +56 -0
  43. package/dist/rules/capability-vocabulary.js.map +1 -0
  44. package/dist/rules/custodian-coverage.d.ts +4 -0
  45. package/dist/rules/custodian-coverage.d.ts.map +1 -0
  46. package/dist/rules/custodian-coverage.js +47 -0
  47. package/dist/rules/custodian-coverage.js.map +1 -0
  48. package/dist/rules/demo-person-org-distinct.d.ts +4 -0
  49. package/dist/rules/demo-person-org-distinct.d.ts.map +1 -0
  50. package/dist/rules/demo-person-org-distinct.js +26 -0
  51. package/dist/rules/demo-person-org-distinct.js.map +1 -0
  52. package/dist/rules/fail-open-knobs.d.ts +4 -0
  53. package/dist/rules/fail-open-knobs.d.ts.map +1 -0
  54. package/dist/rules/fail-open-knobs.js +64 -0
  55. package/dist/rules/fail-open-knobs.js.map +1 -0
  56. package/dist/rules/index.d.ts +10 -0
  57. package/dist/rules/index.d.ts.map +1 -0
  58. package/dist/rules/index.js +29 -0
  59. package/dist/rules/index.js.map +1 -0
  60. package/dist/rules/internal-marker-split.d.ts +4 -0
  61. package/dist/rules/internal-marker-split.d.ts.map +1 -0
  62. package/dist/rules/internal-marker-split.js +31 -0
  63. package/dist/rules/internal-marker-split.js.map +1 -0
  64. package/dist/rules/lock-coherent.d.ts +4 -0
  65. package/dist/rules/lock-coherent.d.ts.map +1 -0
  66. package/dist/rules/lock-coherent.js +39 -0
  67. package/dist/rules/lock-coherent.js.map +1 -0
  68. package/dist/rules/no-cross-subject-vault-reads.d.ts +4 -0
  69. package/dist/rules/no-cross-subject-vault-reads.d.ts.map +1 -0
  70. package/dist/rules/no-cross-subject-vault-reads.js +35 -0
  71. package/dist/rules/no-cross-subject-vault-reads.js.map +1 -0
  72. package/dist/rules/no-hmac-home-bridge.d.ts +4 -0
  73. package/dist/rules/no-hmac-home-bridge.d.ts.map +1 -0
  74. package/dist/rules/no-hmac-home-bridge.js +40 -0
  75. package/dist/rules/no-hmac-home-bridge.js.map +1 -0
  76. package/dist/rules/no-private-keys.d.ts +4 -0
  77. package/dist/rules/no-private-keys.d.ts.map +1 -0
  78. package/dist/rules/no-private-keys.js +45 -0
  79. package/dist/rules/no-private-keys.js.map +1 -0
  80. package/dist/rules/rules-drift.d.ts +4 -0
  81. package/dist/rules/rules-drift.d.ts.map +1 -0
  82. package/dist/rules/rules-drift.js +46 -0
  83. package/dist/rules/rules-drift.js.map +1 -0
  84. package/dist/rules/types.d.ts +50 -0
  85. package/dist/rules/types.d.ts.map +1 -0
  86. package/dist/rules/types.js +2 -0
  87. package/dist/rules/types.js.map +1 -0
  88. package/dist/rules/web-no-direct-mcp.d.ts +4 -0
  89. package/dist/rules/web-no-direct-mcp.d.ts.map +1 -0
  90. package/dist/rules/web-no-direct-mcp.js +37 -0
  91. package/dist/rules/web-no-direct-mcp.js.map +1 -0
  92. package/dist/rules-projection.d.ts +58 -0
  93. package/dist/rules-projection.d.ts.map +1 -0
  94. package/dist/rules-projection.js +135 -0
  95. package/dist/rules-projection.js.map +1 -0
  96. package/dist/upgrade.d.ts +37 -0
  97. package/dist/upgrade.d.ts.map +1 -0
  98. package/dist/upgrade.js +116 -0
  99. package/dist/upgrade.js.map +1 -0
  100. package/dist/workspace.d.ts +18 -0
  101. package/dist/workspace.d.ts.map +1 -0
  102. package/dist/workspace.js +56 -0
  103. package/dist/workspace.js.map +1 -0
  104. package/package.json +73 -0
  105. package/rules/coordination-vs-orchestration.md +31 -0
  106. package/rules/demo-person-org-distinct.md +40 -0
  107. package/rules/external-registry-integrations.md +15 -0
  108. package/rules/hard-rules.md +50 -0
  109. package/rules/one-capability-model-generates-both.md +82 -0
  110. package/rules/ontology-drives-behavior.md +58 -0
  111. package/rules/service-agent-signing.md +84 -0
  112. package/rules/sidecar.json +13 -0
  113. package/rules/skill-terminology.md +76 -0
  114. package/rules/vault-and-ontology.md +8 -0
  115. package/rules/vault-records-are-ontology-shaped.md +85 -0
  116. package/spec.md +11 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Agentic Trust Labs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,62 @@
1
+ # @agenticprimitives/devkit
2
+
3
+ The Developer Kit core — `ap`, the CLI that is the packages' own front door (spec 398 §10, spec 399 §3, ADR-0063).
4
+
5
+ ```
6
+ npx ap doctor # every rule, this tree, the config it found
7
+ npx ap doctor --rule no-private-keys # one rule; --json for a coding agent
8
+ npx ap doctor --rules --write # project the rules source; pin digests in agentic.lock.json
9
+ npx ap upgrade --canary # newest canary of every @agenticprimitives/* pin, one exact set
10
+ npx ap upgrade --pin 1.0.0-alpha.24 # or one named version / dist-tag
11
+ npx ap conform a2a https://… # A2A 1.0 conformance (dispatches to @agenticprimitives/a2a)
12
+ npx ap test --live-gates live-gates.json
13
+ npx ap create my-product --template product-repo --pin 1.0.0-alpha.24
14
+ ```
15
+
16
+ ## Doctor rules
17
+
18
+ Each rule is one file under `src/rules/`, data plus one pure judgement, parameterised by a config section. The
19
+ ids are the ones spec 399 §2.3 gives to the root checks they replace:
20
+
21
+ | Rule | Twin (root check) | Enforces |
22
+ | --- | --- | --- |
23
+ | `web-no-direct-mcp` | `check:no-direct-mcp-in-web` | ADR-0044 — browser code reaches MCP only via `/a2a/*` |
24
+ | `no-private-keys` | `check:no-app-private-keys` | no raw key material in app source; allow-list with reasons |
25
+ | `no-hmac-home-bridge` | `check:no-hmac-home-bridge` | spec 341 ratchet — the bridge count only falls |
26
+ | `no-cross-subject-vault-reads` | `check:no-cross-subject-vault-reads` | spec 366 R3 — reads only at the own subject |
27
+ | `fail-open-knobs` | `check:fail-open-knobs` | ADR-0045 — every permissive knob allow-listed by name |
28
+ | `internal-marker-split` | `check:internal-marker-split` | spec 341 §7 — marker ≠ custody secret |
29
+ | `custodian-coverage` | `check:custodian-coverage` | specs 294/295 — provider-neutral custodian |
30
+ | `archetype-catalog` | `check:archetype-catalog` | spec 354 §3 — catalog validates at recorded digests |
31
+ | `capability-vocabulary` | `check:capability-vocabulary` | ADR-0051 — capability / protocol features / playbook |
32
+ | `demo-person-org-distinct` | `check:demo-person-org-distinct` | ADR-0046 — person SA ≠ org SA |
33
+ | `rules-drift` | — | 399 §3.4 — projections match the pinned source by digest |
34
+ | `lock-coherent` | — | 399 §3.1 — exact, coherent `@agenticprimitives/*` pins |
35
+
36
+ Config resolution is one mechanism: `ap.config.json#doctor`, else `agentic.lock.json#doctor`, else the built-in
37
+ reference layout of the agenticprimitives monorepo. A product repo gets its own section from `create-app`.
38
+
39
+ Exit codes: `0` clean · `1` findings · `2` usage or config · `3` a rule or dispatch errored. Error codes are
40
+ stable strings (`E_CONFIG`, `E_RULE_UNKNOWN`, `E_MODULE_ABSENT`, …) so an agent branches on the code.
41
+
42
+ ## Rules projection
43
+
44
+ `ap doctor --rules` projects one rules source into `.cursor/rules/*.mdc` (frontmatter from `rules/sidecar.json`,
45
+ body byte-for-byte) and into the `<!-- ap:rules -->…<!-- /ap:rules -->` block of `AGENTS.md` and `CLAUDE.md`.
46
+ A file without the block is left alone. Digests are pinned in `agentic.lock.json#rules`; `rules-drift` fails when a
47
+ projection or a pin no longer matches the source. In this monorepo the source is `docs/architecture/agent-rules`;
48
+ a consumer uses the copy bundled in the package.
49
+
50
+ ## `agentic.lock.json`
51
+
52
+ ```json
53
+ { "lockVersion": 1, "packages": { "@agenticprimitives/a2a": "1.0.0-alpha.24" }, "rules": { "skill-terminology": "sha256:…" }, "devkit": "…", "template": { "name": "product-repo", "revision": "…" }, "doctor": { … } }
54
+ ```
55
+
56
+ `packages` is the coherent set `ap upgrade` maintains; `rules` the source digests; `doctor` the product's rule
57
+ config (each section replaces the reference section whole).
58
+
59
+ ## What it will not do
60
+
61
+ Hold a key, read a vault, mint authority, invoke a production effect. A doctor finding is a review checkpoint;
62
+ no verifier reads it (spec 361 §1).
package/bin/ap.mjs ADDED
@@ -0,0 +1,119 @@
1
+ #!/usr/bin/env node
2
+ // `ap` — the Developer Kit CLI (spec 398 §10.3; every command takes --json for coding agents).
3
+ //
4
+ // ap doctor [--rule <id>[,<id>]] [--root <dir>] [--verbose] [--json]
5
+ // ap doctor --rules [--write] [--all] [--source <dir>] project the rules source; report drift by digest
6
+ // ap upgrade --canary | --pin <version|tag> [--dry-run] [--no-install] [--json]
7
+ // ap conform a2a|mcp <url> [--bearer <token>] [--timeout <ms>] [--json]
8
+ // ap test --live-gates <ledger.json> [--only a,b] [--json]
9
+ // ap create <dir> --template product-repo [--name <n>] [--pin <version>] [--json]
10
+ //
11
+ // Exit: 0 clean · 1 findings · 2 usage/config · 3 a rule or dispatch errored.
12
+ import { spawnSync } from 'node:child_process';
13
+ import { existsSync, readFileSync } from 'node:fs';
14
+ import { resolve } from 'node:path';
15
+ import {
16
+ DevkitError, EXIT, RULE_IDS, runDoctor, formatDoctorReport, loadDoctorConfig, loadRulesCorpus, projectRules, rulesLockEntries,
17
+ readLock, writeLock, planUpgrade, applyUpgradePlan, formatUpgradePlan, loadConform, loadLiveGatesRunner, loadCreateApp, formatConformanceReport,
18
+ } from '../dist/index.js';
19
+
20
+ const argv = process.argv.slice(2);
21
+ const cmd = argv[0];
22
+ const rest = argv.slice(1);
23
+ const flag = (n) => rest.includes(`--${n}`);
24
+ const opt = (n) => { const i = rest.indexOf(`--${n}`); return i >= 0 && !String(rest[i + 1] ?? '--').startsWith('--') ? rest[i + 1] : undefined; };
25
+ const positional = () => rest.filter((a, i) => !a.startsWith('--') && !(i > 0 && rest[i - 1].startsWith('--') && opt(rest[i - 1].slice(2)) === a));
26
+ const json = flag('json');
27
+ const root = resolve(opt('root') ?? process.cwd());
28
+ const devkitVersion = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version;
29
+
30
+ const out = (obj, text) => { if (json) console.log(JSON.stringify(obj, null, 2)); else console.log(text); };
31
+ const fail = (e) => {
32
+ const code = e instanceof DevkitError ? e.code : 'E_UNEXPECTED';
33
+ if (json) console.log(JSON.stringify({ ok: false, error: { code, message: e.message } }, null, 2));
34
+ else console.error(`✗ ${code}: ${e.message}`);
35
+ process.exit(code === 'E_USAGE' || code === 'E_CONFIG' || code === 'E_RULE_UNKNOWN' ? EXIT.USAGE : EXIT.ERROR);
36
+ };
37
+
38
+ const USAGE = `ap <doctor|upgrade|conform|test|create> … (see the header of bin/ap.mjs). Rules: ${RULE_IDS.join(', ')}`;
39
+
40
+ async function doctor() {
41
+ if (flag('rules')) {
42
+ const loaded = loadDoctorConfig(root);
43
+ const cfg = loaded.config.rulesDrift;
44
+ const corpus = loadRulesCorpus({ root, source: opt('source') ?? cfg.source, hardRulesFrom: cfg.hardRulesFrom });
45
+ const results = projectRules({ root, corpus, cursorRules: cfg.cursorRules, agentsMd: cfg.agentsMd, claudeMd: cfg.claudeMd, write: flag('write'), all: flag('all'), createCursorDir: flag('write') && flag('create-cursor') });
46
+ const digests = rulesLockEntries(corpus);
47
+ let lockStatus = 'not written';
48
+ if (flag('write')) {
49
+ const lock = readLock(root) ?? { lockVersion: 1, packages: {}, rules: {} };
50
+ lock.rules = digests; lock.devkit = devkitVersion; writeLock(root, lock); lockStatus = 'agentic.lock.json#rules written';
51
+ }
52
+ const drift = results.filter((r) => r.status === 'would-write');
53
+ const text = [`ap doctor --rules · source ${corpus.sourceDir} · ${corpus.rules.length} rule(s) · lock ${lockStatus}`, ...results.map((r) => ` ${r.status === 'unchanged' || r.status === 'written' ? '✓' : r.status === 'would-write' ? '✗' : '·'} ${r.status.padEnd(11)} ${r.path}${r.reason ? ` (${r.reason})` : ''}`), '', drift.length ? `✗ ${drift.length} projection(s) differ from the source — run with --write` : '✓ every projection matches the source (no-op)'].join('\n');
54
+ out({ ok: drift.length === 0, source: corpus.sourceDir, rules: digests, projections: results }, text);
55
+ process.exit(drift.length ? EXIT.FINDINGS : EXIT.OK);
56
+ }
57
+ const only = opt('rule')?.split(',').map((s) => s.trim()).filter(Boolean);
58
+ const report = await runDoctor({ root, only });
59
+ out({ ok: report.ok, ...report }, formatDoctorReport(report, { verbose: flag('verbose') }));
60
+ process.exit(report.errored ? EXIT.ERROR : report.ok ? EXIT.OK : EXIT.FINDINGS);
61
+ }
62
+
63
+ async function upgrade() {
64
+ const mode = flag('canary') ? 'canary' : opt('pin') !== undefined ? 'pin' : null;
65
+ if (!mode) throw new DevkitError('E_USAGE', 'ap upgrade needs --canary or --pin <version|tag>');
66
+ const plan = await planUpgrade({ root, mode, pin: opt('pin') });
67
+ if (plan.unresolved.length) { out({ ok: false, plan }, formatUpgradePlan(plan)); throw new DevkitError('E_RESOLVE', `${plan.unresolved.length} package(s) could not be resolved`); }
68
+ if (flag('dry-run')) { out({ ok: true, dryRun: true, plan }, formatUpgradePlan(plan)); return; }
69
+ const touched = applyUpgradePlan(root, plan, { devkitVersion });
70
+ const steps = [];
71
+ if (!flag('no-install') && plan.changes.length) {
72
+ for (const args of [['install'], ['dedupe']]) {
73
+ const r = spawnSync('pnpm', args, { cwd: root, stdio: json ? 'pipe' : 'inherit', encoding: 'utf8' });
74
+ steps.push({ cmd: `pnpm ${args.join(' ')}`, status: r.status });
75
+ if (r.status !== 0) { out({ ok: false, plan, touched, steps }, `${formatUpgradePlan(plan)}\n✗ pnpm ${args.join(' ')} exited ${r.status}`); process.exit(EXIT.ERROR); }
76
+ }
77
+ }
78
+ const report = await runDoctor({ root });
79
+ out({ ok: report.ok, plan, touched, steps, doctor: report }, `${formatUpgradePlan(plan)}\n wrote ${touched.join(', ')}\n\n${formatDoctorReport(report)}`);
80
+ process.exit(report.ok ? EXIT.OK : EXIT.FINDINGS);
81
+ }
82
+
83
+ async function conform() {
84
+ const [kind, url] = positional();
85
+ if (!['a2a', 'mcp'].includes(kind) || !url) throw new DevkitError('E_USAGE', 'ap conform a2a|mcp <url>');
86
+ const fn = await loadConform(kind);
87
+ const report = await fn(url, { bearer: opt('bearer') ?? process.env.AP_CONFORM_BEARER, timeoutMs: opt('timeout') ? Number(opt('timeout')) : undefined });
88
+ out({ ok: report.ok, report }, formatConformanceReport(report));
89
+ process.exit(report.ok ? EXIT.OK : EXIT.FINDINGS);
90
+ }
91
+
92
+ async function test() {
93
+ const ledgerPath = opt('live-gates');
94
+ if (!ledgerPath) throw new DevkitError('E_USAGE', 'ap test --live-gates <ledger.json> (interaction-coverage and ask-truth modes land with 399 W1)');
95
+ if (!existsSync(resolve(root, ledgerPath))) throw new DevkitError('E_INPUT_MISSING', `live-gates ledger not found: ${ledgerPath}`);
96
+ const runner = await loadLiveGatesRunner();
97
+ const ledger = JSON.parse(readFileSync(resolve(root, ledgerPath), 'utf8'));
98
+ const result = await runner(ledger, { root, only: opt('only')?.split(','), home: opt('home') ?? process.env.HOME_URL });
99
+ out({ ok: result.ok, result }, `ap test --live-gates · ${result.ok ? 'passed' : 'FAILED'} · ${Array.isArray(result.results) ? result.results.length : 0} gate(s)`);
100
+ process.exit(result.ok ? EXIT.OK : EXIT.FINDINGS);
101
+ }
102
+
103
+ async function create() {
104
+ const [dir] = positional();
105
+ if (!dir) throw new DevkitError('E_USAGE', 'ap create <dir> --template product-repo [--name <n>] [--pin <version>]');
106
+ const createApp = await loadCreateApp();
107
+ const result = await createApp({ dir: resolve(root, dir), template: opt('template') ?? 'product-repo', name: opt('name'), pin: opt('pin'), devkitVersion });
108
+ out({ ok: true, result }, `ap create · ${result.dir}\n${(result.files ?? []).map((f) => ` ${f}`).join('\n')}`);
109
+ }
110
+
111
+ const commands = { doctor, upgrade, conform, test, create };
112
+ try {
113
+ if (!cmd || flag('help') || cmd === '--help' || !commands[cmd]) {
114
+ if (json) console.log(JSON.stringify({ ok: !cmd || cmd === '--help', usage: USAGE }));
115
+ else console.log(USAGE);
116
+ process.exit(!cmd || cmd === '--help' ? EXIT.OK : EXIT.USAGE);
117
+ }
118
+ await commands[cmd]();
119
+ } catch (e) { fail(e); }
@@ -0,0 +1,130 @@
1
+ /** Any section may carry `skip: <reason>`: the rule reports `skip` with that sentence instead of judging — for a
2
+ * product that has no Home custody surface yet, no archetype catalog, no persona roster. A reason is required;
3
+ * a silent off-switch is the drift this kit refuses. */
4
+ export interface Skippable {
5
+ skip?: string;
6
+ }
7
+ export interface WhyEntry {
8
+ file: string;
9
+ why: string;
10
+ }
11
+ export interface KnobAllow {
12
+ file: string;
13
+ knob: string;
14
+ why: string;
15
+ }
16
+ export interface DoctorConfig {
17
+ /** ADR-0044 — browser apps reach MCP data only via /a2a/*. */
18
+ webNoDirectMcp: Skippable & {
19
+ browserApps: string[];
20
+ allowMarkers: string[];
21
+ };
22
+ /** key-custody doctrine — no raw key material in app source. */
23
+ noPrivateKeys: Skippable & {
24
+ roots: string[];
25
+ allowedIn: WhyEntry[];
26
+ toleratedEnvNames: Array<{
27
+ name: string;
28
+ why: string;
29
+ }>;
30
+ };
31
+ /** spec 341 / ADR-0059 — the control plane never rides a shared secret; a ratchet that only falls. */
32
+ noHmacHomeBridge: Skippable & {
33
+ dir: string;
34
+ hmacCall: string;
35
+ sessionRpcCall: string;
36
+ ceilings: {
37
+ hmac: number;
38
+ total: number;
39
+ };
40
+ };
41
+ /** spec 366 R3 — a read tool reads only at its own subject. */
42
+ noCrossSubjectVaultReads: Skippable & {
43
+ roots: string[];
44
+ exemptFiles: string[];
45
+ gate: string;
46
+ };
47
+ /** ADR-0045 — a fail-open knob is allow-listed by name, never silent. */
48
+ failOpenKnobs: Skippable & {
49
+ roots: string[];
50
+ allowlist: KnobAllow[];
51
+ };
52
+ /** spec 341 §7 — the in-Worker marker and the custody secret never re-merge. */
53
+ internalMarkerSplit: Skippable & {
54
+ src: string;
55
+ secret: string;
56
+ marker: string;
57
+ budget: Record<string, number | 'unbounded'>;
58
+ };
59
+ /** specs 294/295 — the connection custodian is provider-neutral and the Home offers every custody class. */
60
+ custodianCoverage: Skippable & {
61
+ matrix: string;
62
+ matrixKinds: string[];
63
+ homeVia: string;
64
+ viaRequired: string[];
65
+ viaSocialAny: string[];
66
+ relyingApp: {
67
+ dir: string;
68
+ entryFiles: string[];
69
+ mustImport: string;
70
+ };
71
+ providerNamedCustody: string[];
72
+ browserApps: string[];
73
+ };
74
+ /** spec 354 §3 — the compiled archetype catalog validates and its digests are the recorded ones. */
75
+ archetypeCatalog: Skippable & {
76
+ module: string;
77
+ exportName: string;
78
+ expected: Record<string, string>;
79
+ };
80
+ /** ADR-0051 — capability · protocol features · playbook stay distinct. */
81
+ capabilityVocabulary: Skippable & {
82
+ homeGlobs: string[];
83
+ packagesGlob: string;
84
+ wireAllowed: string[];
85
+ };
86
+ /** ADR-0046 — a person SA is never also their org SA, on the roster of record. */
87
+ demoPersonOrgDistinct: Skippable & {
88
+ roster: string;
89
+ };
90
+ /** 399 §3.4 — projected rules match their pinned source by digest. */
91
+ rulesDrift: Skippable & {
92
+ source?: string;
93
+ hardRulesFrom?: string;
94
+ cursorRules: string;
95
+ lock: string;
96
+ agentsMd: string;
97
+ claudeMd: string;
98
+ };
99
+ /** 399 §3.1 — exact, coherent @agenticprimitives/* pins (the ~/skills lesson). */
100
+ lockCoherent: Skippable & {
101
+ allowWorkspace: boolean;
102
+ scope: string;
103
+ };
104
+ }
105
+ /** A section override replaces the reference section whole — or names only `{ skip }` to keep the reference shape and
106
+ * switch the rule off with a reason. */
107
+ export type DoctorConfigOverrides = {
108
+ [K in keyof DoctorConfig]?: DoctorConfig[K] | {
109
+ skip: string;
110
+ };
111
+ };
112
+ /**
113
+ * The REFERENCE layout — the agenticprimitives monorepo as it stands, so `ap doctor` run at its root reproduces
114
+ * every root check's verdict (399 §3.3 "side by side"). A product repo never inherits this: `create-app`
115
+ * writes its own `agentic.lock.json#doctor`. Names here are directory names, never hostnames.
116
+ */
117
+ export declare const RING0_DOCTOR_CONFIG: DoctorConfig;
118
+ export type ConfigSource = 'ap.config.json' | 'agentic.lock.json#doctor' | 'built-in ring-0 layout';
119
+ export interface LoadedConfig {
120
+ config: DoctorConfig;
121
+ source: ConfigSource;
122
+ overrides: string[];
123
+ }
124
+ /** Merge a per-rule override set over the reference layout: a section given replaces that section whole. */
125
+ export declare function mergeDoctorConfig(base: DoctorConfig, overrides: DoctorConfigOverrides): {
126
+ config: DoctorConfig;
127
+ applied: string[];
128
+ };
129
+ export declare function loadDoctorConfig(root: string): LoadedConfig;
130
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAQA;;yDAEyD;AACzD,MAAM,WAAW,SAAS;IAAG,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE;AAC5C,MAAM,WAAW,QAAQ;IAAG,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE;AACvD,MAAM,WAAW,SAAS;IAAG,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE;AAEtE,MAAM,WAAW,YAAY;IAE3B,8DAA8D;IAC9D,cAAc,EAAE,SAAS,GAAG;QAAE,WAAW,EAAE,MAAM,EAAE,CAAC;QAAC,YAAY,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAC9E,gEAAg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MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG,0BAA0B,GAAG,wBAAwB,CAAC;AAEpG,MAAM,WAAW,YAAY;IAAG,MAAM,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,YAAY,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE;AAIjG,4GAA4G;AAC5G,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,qBAAqB,GAAG;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAYnI;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAiB3D"}
package/dist/config.js ADDED
@@ -0,0 +1,128 @@
1
+ // THE DOCTOR CONFIG. Every rule is parameterised by a section here; the rule LOGIC is generic (ADR-0021), the
2
+ // LAYOUT it judges is data. Resolution order, one mechanism (ADR-0013): `ap.config.json#doctor` if present,
3
+ // else `agentic.lock.json#doctor` if present, else the built-in reference layout below — and the report SAYS
4
+ // which one it used.
5
+ import { existsSync, readFileSync } from 'node:fs';
6
+ import { join } from 'node:path';
7
+ import { DevkitError, ERROR_CODES } from './errors.js';
8
+ /**
9
+ * The REFERENCE layout — the agenticprimitives monorepo as it stands, so `ap doctor` run at its root reproduces
10
+ * every root check's verdict (399 §3.3 "side by side"). A product repo never inherits this: `create-app`
11
+ * writes its own `agentic.lock.json#doctor`. Names here are directory names, never hostnames.
12
+ */
13
+ export const RING0_DOCTOR_CONFIG = {
14
+ webNoDirectMcp: {
15
+ browserApps: ['apps/demo-web', 'apps/demo-web-pro', 'apps/demo-web-recovery', 'apps/demo-web-payment', 'apps/demo-org', 'apps/demo-gs', 'apps/demo-jp', 'apps/demo-sso-next'],
16
+ allowMarkers: ['@external-mcp-client-demo'],
17
+ },
18
+ noPrivateKeys: {
19
+ roots: ['apps'],
20
+ allowedIn: [
21
+ { file: 'apps/demo-a2a/src/config.ts', why: 'local-aes dev backend reads A2A_MASTER_PRIVATE_KEY only when A2A_KMS_BACKEND=local-aes; production is gcp-kms (deferred KMS migration, memory project_demo_a2a_kms_deferred)' },
22
+ { file: 'apps/demo-a2a/scripts/canonical-a2a-e2e.ts', why: 'e2e harness mints an ephemeral SIWE persona; never an identity, never deployed' },
23
+ { file: 'apps/demo-sso-next/scripts/provision-demo-personas-local.ts', why: 'local-chain provisioner with published dev keys' },
24
+ { file: 'apps/demo-sso-next/scripts/provision-service-agent-local.ts', why: 'local-chain provisioner with published dev keys' },
25
+ { file: 'apps/demo-sso-next/scripts/provision-typed-service-agent.ts', why: 'one-run operator CLI; key from env, never written' },
26
+ { file: 'apps/demo-sso-next/scripts/set-typed-name-records.ts', why: 'one-run operator CLI' },
27
+ { file: 'apps/demo-sso-next/scripts/publish-capabilities.ts', why: 'one-run operator CLI' },
28
+ { file: 'apps/demo-sso-next/scripts/link-service-steward-local.ts', why: 'one-run operator CLI' },
29
+ { file: 'apps/demo-jp/src/lib/personas.ts', why: 'demo personas hold testnet EOAs by design (D-1)' },
30
+ { file: 'apps/demo-resolution/src/live.ts', why: 'browser personas derived from published seed strings; read-only resolution' },
31
+ { file: 'apps/demo-jp/src/lib/chain.ts', why: 'persona signer for the D-1 demo custody path' },
32
+ { file: 'apps/demo-gs/src/lib/personas.ts', why: 'same accepted testnet demo-key pattern as demo-jp' },
33
+ { file: 'apps/demo-gs/src/lib/chain.ts', why: 'same accepted testnet demo-key pattern as demo-jp' },
34
+ { file: 'apps/demo-gs/scripts/seed-substrate.ts', why: 'same accepted testnet demo-key pattern as demo-jp' },
35
+ { file: 'apps/demo-jp/src/connect-client.ts', why: 'ephemeral per-connect session keypair on the relying origin (spec 270 v4)' },
36
+ { file: 'apps/demo-web-payment/src/lib/personas.ts', why: 'ephemeral payee EOA in sessionStorage; never signs' },
37
+ { file: 'apps/demo-web-payment/vite.config.ts', why: 'dev-server-only gas faucet reading the local env' },
38
+ { file: 'apps/demo-discovery/src/lib/abox.ts', why: 'fixture signers for the browser-verified demo bundles' },
39
+ { file: 'apps/demo-web-pro/src/lib/native-session.ts', why: 'in-memory session keypair for the Act 6 native-ingress demonstration' },
40
+ { file: 'apps/demo-mcp/scripts/native-mcp-smoke.ts', why: 'dev smoke script with throwaway EOAs' },
41
+ { file: 'apps/demo-sso-next/server/_lib/demo-custody.ts', why: 'testnet demo-persona custody from DEMO_PERSONA_KEYS' },
42
+ { file: 'apps/demo-sso-next/server/connect/demo-accounts.ts', why: 'derives the seeded persona custodian address' },
43
+ ],
44
+ toleratedEnvNames: [
45
+ { name: 'A2A_MASTER_PRIVATE_KEY', why: 'the local-aes dev backend signing key; unused under gcp-kms' },
46
+ { name: 'A2A_INTERACTIONS_SESSION_PRIVATE_KEY', why: 'workstation-only InteractionsDO session signer when no Cloud KMS is present' },
47
+ ],
48
+ },
49
+ noHmacHomeBridge: { dir: 'apps/demo-sso-next', hmacCall: 'bridgeInteractions', sessionRpcCall: 'callInteractions', ceilings: { hmac: 0, total: 42 } },
50
+ noCrossSubjectVaultReads: { roots: ['packages/context/src', 'apps/demo-a2a/src'], exemptFiles: ['self-only.ts'], gate: 'subjectOfRead' },
51
+ failOpenKnobs: {
52
+ roots: ['apps'],
53
+ allowlist: [
54
+ { file: 'apps/demo-mcp/src/index.ts', knob: 'allowUnboundSessionToken', why: 'persona/operator-key demo path (accepted testnet hole C-1, spec 248)' },
55
+ { file: 'apps/demo-mcp/src/kas.ts', knob: 'allowUnsignedGrant', why: 'in-process self-authored grant; real authority is the spec-278 vault-key authorization' },
56
+ { file: 'apps/demo-mcp/src/kas.ts', knob: 'allowUnboundGrant', why: 'N-4: same in-process single-use grant' },
57
+ { file: 'apps/demo-a2a/src/index.ts', knob: 'developmentMode', why: 'test/dev session verification; production wires expectedIss/expectedAud' },
58
+ { file: 'apps/demo-mcp/wrangler.toml', knob: 'DEMO_VAULT_PROVISION_ENABLED', why: 'registers the KEK provision route; the route is proof-gated by default' },
59
+ ],
60
+ },
61
+ internalMarkerSplit: { src: 'apps/demo-a2a/src', secret: 'A2A_CUSTODY_BRIDGE_SECRET', marker: 'x-ap-internal', budget: { 'index.ts': 'unbounded', 'interactions-do.ts': 1 } },
62
+ custodianCoverage: {
63
+ matrix: 'docs/architecture/connection-custodian-matrix.md', matrixKinds: ['siwe', 'passkey', 'social'],
64
+ homeVia: 'apps/demo-sso-next/src/home/onboarding.ts', viaRequired: ['passkey', 'wallet'], viaSocialAny: ['google', 'youversion'],
65
+ relyingApp: { dir: 'apps/demo-web/src', entryFiles: ['main.tsx', 'connect.ts', 'App.tsx'], mustImport: '@agenticprimitives/connect-client' },
66
+ providerNamedCustody: ['google', 'youversion'], browserApps: ['apps/demo-web', 'apps/demo-org', 'apps/demo-gs', 'apps/demo-jp'],
67
+ },
68
+ archetypeCatalog: {
69
+ module: 'apps/demo-sso-next/src/lib/archetype-catalog.ts', exportName: 'ARCHETYPE_CATALOG',
70
+ expected: {
71
+ 'treasury-steward': '0x00f5b03b5724864c5b8edf11048baa6693b520647594997bbffc2fa41391fc0e',
72
+ bookkeeper: '0xce101b9c3ba2df0ae0a969a1d058a34727a581a5a848d509f617eae68bbde219',
73
+ 'org-steward': '0x20c188049af98ea4ce1aa7d94178d1aacf2848b2531d93010dc158293b4c3567',
74
+ },
75
+ },
76
+ capabilityVocabulary: {
77
+ homeGlobs: ['apps/demo-sso-next/app/**/*.{ts,tsx}', 'apps/demo-sso-next/src/**/*.{ts,tsx}', 'packages/home/src/**/*.{ts,tsx}'],
78
+ packagesGlob: 'packages/*/src/**/*.ts',
79
+ wireAllowed: ['packages/agent-profile/src/a2a/', 'packages/capability-claims/src/', 'apps/demo-sso-next/src/components/studio/Inspector.tsx', 'apps/demo-a2a/src/', 'packages/surface-catalog/src/', 'packages/a2a/src/', 'apps/demo-sso-next/src/whitelabel/'],
80
+ },
81
+ demoPersonOrgDistinct: { roster: 'demo/personas.json' },
82
+ rulesDrift: { source: 'docs/architecture/agent-rules', hardRulesFrom: 'CLAUDE.md', cursorRules: '.cursor/rules', lock: 'agentic.lock.json', agentsMd: 'AGENTS.md', claudeMd: 'CLAUDE.md' },
83
+ lockCoherent: { allowWorkspace: true, scope: '@agenticprimitives/' },
84
+ };
85
+ function isObject(v) { return typeof v === 'object' && v !== null && !Array.isArray(v); }
86
+ /** Merge a per-rule override set over the reference layout: a section given replaces that section whole. */
87
+ export function mergeDoctorConfig(base, overrides) {
88
+ const config = { ...base };
89
+ const applied = [];
90
+ for (const [k, v] of Object.entries(overrides)) {
91
+ if (!(k in base))
92
+ throw new DevkitError(ERROR_CODES.E_CONFIG, `doctor config names an unknown rule section "${k}"`);
93
+ if (!isObject(v))
94
+ throw new DevkitError(ERROR_CODES.E_CONFIG, `doctor config section "${k}" must be an object`);
95
+ if ('skip' in v && typeof v['skip'] !== 'string')
96
+ throw new DevkitError(ERROR_CODES.E_CONFIG, `doctor config section "${k}": skip must be a sentence saying why`);
97
+ const only = Object.keys(v).length === 1 && 'skip' in v;
98
+ config[k] = only ? { ...base[k], skip: v['skip'] } : v;
99
+ applied.push(k);
100
+ }
101
+ return { config, applied };
102
+ }
103
+ export function loadDoctorConfig(root) {
104
+ const apConfig = join(root, 'ap.config.json');
105
+ const lock = join(root, 'agentic.lock.json');
106
+ const readSection = (path, label) => {
107
+ if (!existsSync(path))
108
+ return null;
109
+ let parsed;
110
+ try {
111
+ parsed = JSON.parse(readFileSync(path, 'utf8'));
112
+ }
113
+ catch (e) {
114
+ throw new DevkitError(ERROR_CODES.E_CONFIG, `${label}: not valid JSON (${e.message})`);
115
+ }
116
+ if (!isObject(parsed))
117
+ throw new DevkitError(ERROR_CODES.E_CONFIG, `${label}: top level must be an object`);
118
+ const section = parsed['doctor'];
119
+ if (section === undefined)
120
+ return null;
121
+ if (!isObject(section))
122
+ throw new DevkitError(ERROR_CODES.E_CONFIG, `${label}: "doctor" must be an object of rule sections`);
123
+ const { config, applied } = mergeDoctorConfig(RING0_DOCTOR_CONFIG, section);
124
+ return { config, source: label, overrides: applied };
125
+ };
126
+ return readSection(apConfig, 'ap.config.json') ?? readSection(lock, 'agentic.lock.json#doctor') ?? { config: RING0_DOCTOR_CONFIG, source: 'built-in ring-0 layout', overrides: [] };
127
+ }
128
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAC9G,4GAA4G;AAC5G,6GAA6G;AAC7G,qBAAqB;AACrB,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA8CvD;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAiB;IAC/C,cAAc,EAAE;QACd,WAAW,EAAE,CAAC,eAAe,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,oBAAoB,CAAC;QAC7K,YAAY,EAAE,CAAC,2BAA2B,CAAC;KAC5C;IACD,aAAa,EAAE;QACb,KAAK,EAAE,CAAC,MAAM,CAAC;QACf,SAAS,EAAE;YACT,EAAE,IAAI,EAAE,6BAA6B,EAAE,GAAG,EAAE,8KAA8K,EAAE;YAC5N,EAAE,IAAI,EAAE,4CAA4C,EAAE,GAAG,EAAE,gFAAgF,EAAE;YAC7I,EAAE,IAAI,EAAE,6DAA6D,EAAE,GAAG,EAAE,iDAAiD,EAAE;YAC/H,EAAE,IAAI,EAAE,6DAA6D,EAAE,GAAG,EAAE,iDAAiD,EAAE;YAC/H,EAAE,IAAI,EAAE,6DAA6D,EAAE,GAAG,EAAE,mDAAmD,EAAE;YACjI,EAAE,IAAI,EAAE,sDAAsD,EAAE,GAAG,EAAE,sBAAsB,EAAE;YAC7F,EAAE,IAAI,EAAE,oDAAoD,EAAE,GAAG,EAAE,sBAAsB,EAAE;YA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 'SHOULD' | 'MAY';
4
+ ok: boolean;
5
+ detail?: string;
6
+ }
7
+ export interface ConformanceReport {
8
+ target: string;
9
+ ok: boolean;
10
+ checks: ConformanceCheck[];
11
+ }
12
+ export type ConformFn = (url: string, opts?: {
13
+ bearer?: string;
14
+ timeoutMs?: number;
15
+ }) => Promise<ConformanceReport>;
16
+ export interface LiveGatesRunner {
17
+ (ledger: unknown, opts?: Record<string, unknown>): Promise<{
18
+ ok: boolean;
19
+ results: unknown[];
20
+ }>;
21
+ }
22
+ export declare const CONFORM_MODULES: {
23
+ readonly a2a: {
24
+ readonly spec: "@agenticprimitives/a2a/conform";
25
+ readonly fn: "conformA2a";
26
+ };
27
+ readonly mcp: {
28
+ readonly spec: "@agenticprimitives/mcp-protocol/conform";
29
+ readonly fn: "conformMcp";
30
+ };
31
+ };
32
+ export declare function loadConform(kind: keyof typeof CONFORM_MODULES): Promise<ConformFn>;
33
+ export declare const LIVE_GATES_MODULE: {
34
+ readonly spec: "@agenticprimitives/evaluation";
35
+ readonly fn: "runLiveGates";
36
+ };
37
+ export declare function loadLiveGatesRunner(): Promise<LiveGatesRunner>;
38
+ export declare const CREATE_APP_MODULE: {
39
+ readonly spec: "@agenticprimitives/create-app";
40
+ readonly fn: "createApp";
41
+ };
42
+ export declare function loadCreateApp(): Promise<(opts: Record<string, unknown>) => Promise<unknown>>;
43
+ export declare function formatConformanceReport(r: ConformanceReport): string;
44
+ //# sourceMappingURL=dispatch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../src/dispatch.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,gBAAgB;IAAG,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IAAC,EAAE,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE;AAChH,MAAM,WAAW,iBAAiB;IAAG,MAAM,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,gBAAgB,EAAE,CAAA;CAAE;AAC9F,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAEpH,MAAM,WAAW,eAAe;IAC9B,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,OAAO,EAAE,CAAA;KAAE,CAAC,CAAC;CACjG;AAoBD,eAAO,MAAM,eAAe;;;;;;;;;CAA6J,CAAC;AAE1L,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,OAAO,eAAe,GAAG,OAAO,CAAC,SAAS,CAAC,CAGxF;AAED,eAAO,MAAM,iBAAiB;;;CAAyE,CAAC;AAExG,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,eAAe,CAAC,CAEpE;AAED,eAAO,MAAM,iBAAiB;;;CAAsE,CAAC;AAErG,wBAAsB,aAAa,IAAI,OAAO,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC,CAElG;AAED,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAIpE"}
@@ -0,0 +1,43 @@
1
+ // Dispatchers to the packages that OWN a conformance suite or a runner (spec 399 §3.3): `ap conform a2a|mcp` calls
2
+ // `@agenticprimitives/a2a/conform` / `@agenticprimitives/mcp-protocol/conform`; `ap test --live-gates` calls
3
+ // `@agenticprimitives/evaluation`'s runner. Resolved at run time from the consumer's install, so this kit does
4
+ // not carry the protocol packages: an absent module is a stable E_MODULE_ABSENT, never a fallback (ADR-0013).
5
+ import { DevkitError, ERROR_CODES } from './errors.js';
6
+ const MODULE_NOT_FOUND = new Set(['ERR_MODULE_NOT_FOUND', 'ERR_PACKAGE_PATH_NOT_EXPORTED', 'MODULE_NOT_FOUND']);
7
+ async function loadModule(spec, what) {
8
+ try {
9
+ return (await import(spec));
10
+ }
11
+ catch (e) {
12
+ const code = e.code ?? '';
13
+ if (MODULE_NOT_FOUND.has(code))
14
+ throw new DevkitError(ERROR_CODES.E_MODULE_ABSENT, `${what} needs ${spec.split('/').slice(0, 2).join('/')} installed (${spec} not found)`, { cause: e });
15
+ throw e;
16
+ }
17
+ }
18
+ function pick(mod, name, spec) {
19
+ const fn = mod[name];
20
+ if (typeof fn !== 'function')
21
+ throw new DevkitError(ERROR_CODES.E_MODULE_SHAPE, `${spec} does not export ${name}() — upgrade the package or this kit so their contracts agree`);
22
+ return fn;
23
+ }
24
+ export const CONFORM_MODULES = { a2a: { spec: '@agenticprimitives/a2a/conform', fn: 'conformA2a' }, mcp: { spec: '@agenticprimitives/mcp-protocol/conform', fn: 'conformMcp' } };
25
+ export async function loadConform(kind) {
26
+ const m = CONFORM_MODULES[kind];
27
+ return pick(await loadModule(m.spec, `ap conform ${kind}`), m.fn, m.spec);
28
+ }
29
+ export const LIVE_GATES_MODULE = { spec: '@agenticprimitives/evaluation', fn: 'runLiveGates' };
30
+ export async function loadLiveGatesRunner() {
31
+ return pick(await loadModule(LIVE_GATES_MODULE.spec, 'ap test --live-gates'), LIVE_GATES_MODULE.fn, LIVE_GATES_MODULE.spec);
32
+ }
33
+ export const CREATE_APP_MODULE = { spec: '@agenticprimitives/create-app', fn: 'createApp' };
34
+ export async function loadCreateApp() {
35
+ return pick(await loadModule(CREATE_APP_MODULE.spec, 'ap create'), CREATE_APP_MODULE.fn, CREATE_APP_MODULE.spec);
36
+ }
37
+ export function formatConformanceReport(r) {
38
+ const lines = [`ap conform · ${r.target} · ${r.ok ? 'CONFORMANT' : 'NOT conformant'}`];
39
+ for (const c of r.checks)
40
+ lines.push(` ${c.ok ? '✓' : c.level === 'MUST' ? '✗' : '⚠'} ${c.level.padEnd(6)} ${c.id}${c.detail ? ` — ${c.detail}` : ''}`);
41
+ return lines.join('\n');
42
+ }
43
+ //# sourceMappingURL=dispatch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dispatch.js","sourceRoot":"","sources":["../src/dispatch.ts"],"names":[],"mappings":"AAAA,mHAAmH;AACnH,6GAA6G;AAC7G,+GAA+G;AAC/G,8GAA8G;AAC9G,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAUvD,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,sBAAsB,EAAE,+BAA+B,EAAE,kBAAkB,CAAC,CAAC,CAAC;AAEhH,KAAK,UAAU,UAAU,CAAC,IAAY,EAAE,IAAY;IAClD,IAAI,CAAC;QACH,OAAO,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,CAA4B,CAAC;IACzD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,GAAI,CAAuB,CAAC,IAAI,IAAI,EAAE,CAAC;QACjD,IAAI,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,MAAM,IAAI,WAAW,CAAC,WAAW,CAAC,eAAe,EAAE,GAAG,IAAI,UAAU,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,eAAe,IAAI,aAAa,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;QACzL,MAAM,CAAC,CAAC;IACV,CAAC;AACH,CAAC;AAED,SAAS,IAAI,CAAI,GAA4B,EAAE,IAAY,EAAE,IAAY;IACvE,MAAM,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;IACrB,IAAI,OAAO,EAAE,KAAK,UAAU;QAAE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1D,MAAM,KAAK,GAAG,CAAC,gBAAgB,CAAC,CAAC,MAAM,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC,CAAC;IACvF,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM;QAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACzJ,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { type DoctorConfig, type LoadedConfig } from './config.js';
2
+ import type { RuleContext, RuleResult } from './rules/types.js';
3
+ export interface DoctorReport {
4
+ root: string;
5
+ configSource: LoadedConfig['source'];
6
+ configOverrides: string[];
7
+ rules: RuleResult[];
8
+ ok: boolean;
9
+ errored: boolean;
10
+ }
11
+ export declare function makeRuleContext(root: string): RuleContext;
12
+ export declare function runDoctor(opts: {
13
+ root: string;
14
+ config?: DoctorConfig;
15
+ only?: string[];
16
+ loaded?: LoadedConfig;
17
+ }): Promise<DoctorReport>;
18
+ export declare function formatDoctorReport(report: DoctorReport, opts?: {
19
+ verbose?: boolean;
20
+ }): string;
21
+ //# sourceMappingURL=doctor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../src/doctor.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAoB,MAAM,aAAa,CAAC;AAKrF,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEhE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;IACrC,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,EAAE,EAAE,OAAO,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAUzD;AAED,wBAAsB,SAAS,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,YAAY,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,CAAC,EAAE,YAAY,CAAA;CAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAoB5I;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,MAAM,CAcjG"}