@agenticprimitives/create-app 0.0.0-alpha.34 → 0.0.0-alpha.35
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/README.md +8 -3
- package/bin/create-app.mjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +53 -8
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/templates/home-client/.claude/skills/ap-add-capability/SKILL.md +1 -1
- package/templates/home-client/.env.example +6 -0
- package/templates/home-client/.mcp.json +2 -2
- package/templates/home-client/CLAUDE.md.tmpl +3 -1
- package/templates/home-client/scripts/verify-two-acts.ts +2 -1
- package/templates/product-repo/.cursor/mcp.json +5 -0
- package/templates/product-repo/.cursor/rules/.gitkeep +0 -0
- package/templates/product-repo/.mcp.json +2 -2
- package/templates/product-repo/CLAUDE.md.tmpl +4 -0
- package/templates/product-repo/scripts/set-cloudflare-secrets.sh +3 -2
package/README.md
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
```
|
|
6
6
|
npx @agenticprimitives/create-app my-agent-app --template home-client # the first app: a client of the person's agent
|
|
7
|
-
cd my-agent-app && pnpm install &&
|
|
7
|
+
cd my-agent-app && pnpm install && pnpm exec ap doctor && pnpm dev # Connect with your Home → ask → an act parks for HER signature
|
|
8
8
|
|
|
9
9
|
npx @agenticprimitives/create-app my-product --template product-repo --pin 1.0.0-alpha.24
|
|
10
|
-
cd my-product && pnpm install &&
|
|
10
|
+
cd my-product && pnpm install && pnpm exec ap doctor
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
## `--template home-client` — the Developer Kit's first app (spec 398 §10.1)
|
|
@@ -22,7 +22,12 @@ collects a signature. `pnpm verify` runs the two acts live against a development
|
|
|
22
22
|
dependency), `src/lib/server.ts`, `app/api/{connect,callback,ask,me,disconnect}`, `app/page.tsx`,
|
|
23
23
|
`scripts/verify-two-acts.ts`, `README.md`, the projected `AGENTS.md`/`CLAUDE.md`/`.cursor/rules`, `.mcp.json` (the
|
|
24
24
|
Developer MCP), `agentic.lock.json` pinning `@agenticprimitives/devkit` alone. If the generator is newer than the pinned
|
|
25
|
-
devkit, `
|
|
25
|
+
devkit, `pnpm exec ap doctor --rules --write` re-projects the rules with the pinned corpus (the doctor names the drift).
|
|
26
|
+
|
|
27
|
+
Both templates register the read-only Developer MCP by **path to the pinned local install** (`node
|
|
28
|
+
node_modules/@agenticprimitives/devkit/bin/ap.mjs mcp --root .`), never by the bare name `ap`: that is an unscoped npm
|
|
29
|
+
name this project does not own, and a registry launcher would fetch it whenever the local bin is missing. Run
|
|
30
|
+
`pnpm install` before opening the repository in an editor that starts MCP servers.
|
|
26
31
|
|
|
27
32
|
Writes a product repository the way spec 399 §3.6 describes it — the shape `ap-discovery`, `ap-home` and
|
|
28
33
|
`ap-naming` are created from, never a copy of the monorepo root:
|
package/bin/create-app.mjs
CHANGED
|
@@ -21,7 +21,7 @@ if (!dir || flag('help')) {
|
|
|
21
21
|
try {
|
|
22
22
|
const result = await createApp({ dir: resolve(dir), template: opt('template') ?? 'product-repo', name: opt('name'), pin: opt('pin') });
|
|
23
23
|
if (json) console.log(JSON.stringify({ ok: true, result }, null, 2));
|
|
24
|
-
else console.log(`create-app · ${result.template} → ${result.dir} (${result.name}, pinned ${result.pin})\n${result.files.map((f) => ` ${f}`).join('\n')}\n\nnext: cd ${result.dir} && pnpm install &&
|
|
24
|
+
else console.log(`create-app · ${result.template} → ${result.dir} (${result.name}, pinned ${result.pin})\n${result.files.map((f) => ` ${f}`).join('\n')}\n\nnext: cd ${result.dir} && pnpm install && pnpm exec ap doctor${result.template === 'home-client' ? ' && pnpm dev' : ''}`);
|
|
25
25
|
} catch (e) {
|
|
26
26
|
const code = e?.code ?? 'E_UNEXPECTED';
|
|
27
27
|
if (json) console.log(JSON.stringify({ ok: false, error: { code, message: e.message } })); else console.error(`✗ ${code}: ${e.message}`);
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare const TEMPLATES_DIR: string;
|
|
|
6
6
|
export declare const TEMPLATE_NAMES: readonly ["product-repo", "home-client"];
|
|
7
7
|
export type TemplateName = (typeof TEMPLATE_NAMES)[number];
|
|
8
8
|
/** Bump when the template tree changes shape; recorded in the generated lock so `ap upgrade` can diff it later. */
|
|
9
|
-
export declare const TEMPLATE_REVISION = "2026-
|
|
9
|
+
export declare const TEMPLATE_REVISION = "2026-11-10.1";
|
|
10
10
|
/** The packages every product pins from the start (the kit, the live-gates runner, the two conformance suites). */
|
|
11
11
|
export declare const BASELINE_PINS: readonly ["@agenticprimitives/devkit", "@agenticprimitives/evaluation", "@agenticprimitives/a2a", "@agenticprimitives/mcp-protocol"];
|
|
12
12
|
export interface CreateAppOptions {
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAA4G,KAAK,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEjL,eAAO,MAAM,YAAY,EAAG,+BAAwC,CAAC;AACrE,eAAO,MAAM,cAAc,EAAG,0BAAmC,CAAC;AAClE,eAAO,MAAM,QAAQ,EAAG,uCAAgD,CAAC;AAEzE,eAAO,MAAM,aAAa,QAAmE,CAAC;AAC9F,eAAO,MAAM,cAAc,0CAA2C,CAAC;AACvE,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAC3D,mHAAmH;AACnH,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAEhD,mHAAmH;AACnH,eAAO,MAAM,aAAa,sIAAuI,CAAC;AAElK,MAAM,WAAW,gBAAgB;IAC/B,6EAA6E;IAC7E,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,yFAAyF;IACzF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd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IACZ,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,yFAAyF;IACzF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+GAA+G;IAC/G,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,eAAe;IAAG,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE;AAEpH,yHAAyH;AACzH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,qBAAqB,CAevE;AAED;4GAC4G;AAC5G,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,qBAAqB,CAe1E;AACD,oFAAoF;AACpF,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAGjE,CAAC;AAsDF,wBAAsB,SAAS,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,CA2ChF"}
|
package/dist/index.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
// starts from — W1 creates ap-discovery from it, never from a copy of the monorepo root. Generation is pure over
|
|
4
4
|
// the template tree plus a substitution map; the rules files are projected by the devkit so a product carries the
|
|
5
5
|
// doctrine by digest from day one (ADR-0063 §8).
|
|
6
|
-
import { cpSync, existsSync, mkdirSync, readdirSync, readFileSync,
|
|
7
|
-
import { dirname, join, relative, sep } from 'node:path';
|
|
6
|
+
import { cpSync, existsSync, lstatSync, mkdirSync, readdirSync, readFileSync, realpathSync, writeFileSync } from 'node:fs';
|
|
7
|
+
import { dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
|
|
8
8
|
import { fileURLToPath } from 'node:url';
|
|
9
9
|
import { DevkitError, ERROR_CODES, loadRulesCorpus, projectRules, rulesLockEntries, writeLock } from '@agenticprimitives/devkit';
|
|
10
10
|
export const PACKAGE_NAME = '@agenticprimitives/create-app';
|
|
@@ -13,7 +13,7 @@ export const SPEC_REF = 'specs/399-repository-split-program.md';
|
|
|
13
13
|
export const TEMPLATES_DIR = join(dirname(fileURLToPath(import.meta.url)), '..', 'templates');
|
|
14
14
|
export const TEMPLATE_NAMES = ['product-repo', 'home-client'];
|
|
15
15
|
/** Bump when the template tree changes shape; recorded in the generated lock so `ap upgrade` can diff it later. */
|
|
16
|
-
export const TEMPLATE_REVISION = '2026-
|
|
16
|
+
export const TEMPLATE_REVISION = '2026-11-10.1';
|
|
17
17
|
/** The packages every product pins from the start (the kit, the live-gates runner, the two conformance suites). */
|
|
18
18
|
export const BASELINE_PINS = ['@agenticprimitives/devkit', '@agenticprimitives/evaluation', '@agenticprimitives/a2a', '@agenticprimitives/mcp-protocol'];
|
|
19
19
|
/** The doctor config a fresh product carries: no monorepo layout, exact pins required, rules from the bundled corpus. */
|
|
@@ -59,17 +59,57 @@ export const TEMPLATE_PINS = {
|
|
|
59
59
|
function substitute(text, vars) {
|
|
60
60
|
return text.replace(/\{\{([a-zA-Z0-9_.-]+)\}\}/g, (m, k) => (vars[k] !== undefined ? vars[k] : m));
|
|
61
61
|
}
|
|
62
|
+
/** Every file of a template tree. A symbolic link in a template is refused, not followed: a template is copied
|
|
63
|
+
* bytes, and a link would copy (or substitute into) a file that is not the template's (spec 445 W0). */
|
|
62
64
|
function walk(dir) {
|
|
63
65
|
const out = [];
|
|
64
66
|
for (const e of readdirSync(dir).sort()) {
|
|
65
67
|
const p = join(dir, e);
|
|
66
|
-
|
|
68
|
+
const s = lstatSync(p);
|
|
69
|
+
if (s.isSymbolicLink())
|
|
70
|
+
throw new DevkitError(ERROR_CODES.E_INPUT_MISSING, `template entry ${p} is a symbolic link — templates carry files, never links`);
|
|
71
|
+
if (s.isDirectory())
|
|
67
72
|
out.push(...walk(p));
|
|
68
|
-
else
|
|
73
|
+
else if (s.isFile())
|
|
69
74
|
out.push(p);
|
|
70
75
|
}
|
|
71
76
|
return out;
|
|
72
77
|
}
|
|
78
|
+
const EXACT_VERSION = /^\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?$/;
|
|
79
|
+
/** The variables the generator itself derives and validates; a caller's `vars` may add others, never replace these. */
|
|
80
|
+
const RESERVED_VARS = ['name', 'pin', 'devkitVersion', 'templateRevision'];
|
|
81
|
+
/** A substituted value lands inside JSON strings, YAML scalars, shell scripts and Markdown. It is therefore a plain
|
|
82
|
+
* token: letters, digits and `. _ - @ / : +` — no quote, backslash, whitespace, `$`, backtick, brace or newline, so
|
|
83
|
+
* it cannot close the string it is written into, add a `scripts` entry, or become a shell word (spec 445 W0). */
|
|
84
|
+
const SAFE_VAR_VALUE = /^[A-Za-z0-9._@/:+-]{0,200}$/;
|
|
85
|
+
const VAR_NAME = /^[a-zA-Z0-9_.-]+$/;
|
|
86
|
+
function checkVars(extra) {
|
|
87
|
+
for (const [k, v] of Object.entries(extra)) {
|
|
88
|
+
if (!VAR_NAME.test(k))
|
|
89
|
+
throw new DevkitError(ERROR_CODES.E_USAGE, `template variable name ${JSON.stringify(k)} is not a name`);
|
|
90
|
+
if (RESERVED_VARS.includes(k))
|
|
91
|
+
throw new DevkitError(ERROR_CODES.E_USAGE, `template variable "${k}" is derived by the generator and cannot be supplied`);
|
|
92
|
+
if (typeof v !== 'string' || !SAFE_VAR_VALUE.test(v))
|
|
93
|
+
throw new DevkitError(ERROR_CODES.E_USAGE, `template variable "${k}" has a value that is not a plain token (letters, digits, . _ - @ / : +) — refused, because it is written into JSON, YAML and shell files`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/** The path a template entry is written to — inside the target directory AFTER realpath, or refused. */
|
|
97
|
+
function targetPath(realDir, target) {
|
|
98
|
+
const out = resolve(realDir, target);
|
|
99
|
+
const rel = relative(realDir, out);
|
|
100
|
+
if (rel === '' || rel.startsWith('..') || isAbsolute(rel))
|
|
101
|
+
throw new DevkitError(ERROR_CODES.E_USAGE, `template entry "${target}" would be written outside ${realDir} — refused`);
|
|
102
|
+
// A directory on the way that already exists must not be a link out of the target (the target was empty when we
|
|
103
|
+
// started, so anything there was written by this run — this is the check that keeps that true).
|
|
104
|
+
let dir = dirname(out);
|
|
105
|
+
while (!existsSync(dir))
|
|
106
|
+
dir = dirname(dir);
|
|
107
|
+
const realParent = realpathSync(dir);
|
|
108
|
+
const relParent = relative(realDir, realParent);
|
|
109
|
+
if (relParent.startsWith('..') || isAbsolute(relParent))
|
|
110
|
+
throw new DevkitError(ERROR_CODES.E_USAGE, `template entry "${target}" resolves outside ${realDir} — refused`);
|
|
111
|
+
return out;
|
|
112
|
+
}
|
|
73
113
|
const TEXT = /\.(md|json|yaml|yml|toml|ts|tsx|mjs|js|sh|txt|gitignore|tmpl)$|^(\.gitignore|\.npmrc)$/;
|
|
74
114
|
export async function createApp(opts) {
|
|
75
115
|
const template = opts.template ?? 'product-repo';
|
|
@@ -85,15 +125,20 @@ export async function createApp(opts) {
|
|
|
85
125
|
throw new DevkitError(ERROR_CODES.E_USAGE, `name "${name}" must be kebab-case (a-z, 0-9, -)`);
|
|
86
126
|
const devkitVersion = opts.devkitVersion ?? readOwnDevkitVersion();
|
|
87
127
|
const pin = opts.pin ?? devkitVersion;
|
|
88
|
-
if (
|
|
128
|
+
if (!EXACT_VERSION.test(pin))
|
|
89
129
|
throw new DevkitError(ERROR_CODES.E_USAGE, `--pin "${pin}" must be an exact version (use \`ap upgrade --pin <tag>\` after generation to resolve a dist-tag)`);
|
|
90
|
-
|
|
130
|
+
if (!EXACT_VERSION.test(devkitVersion))
|
|
131
|
+
throw new DevkitError(ERROR_CODES.E_USAGE, `devkit version "${devkitVersion}" is not an exact version`);
|
|
132
|
+
checkVars(opts.vars ?? {});
|
|
133
|
+
// The generator's own (validated) values win: a caller's vars can add a key, never replace one of these.
|
|
134
|
+
const vars = { ...(opts.vars ?? {}), name, pin, devkitVersion, templateRevision: TEMPLATE_REVISION };
|
|
91
135
|
mkdirSync(opts.dir, { recursive: true });
|
|
136
|
+
const realDir = realpathSync(opts.dir);
|
|
92
137
|
const files = [];
|
|
93
138
|
for (const abs of walk(src)) {
|
|
94
139
|
const relPath = relative(src, abs).split(sep).join('/');
|
|
95
140
|
const target = relPath.endsWith('.tmpl') ? relPath.slice(0, -5) : relPath;
|
|
96
|
-
const out =
|
|
141
|
+
const out = targetPath(realDir, target);
|
|
97
142
|
mkdirSync(dirname(out), { recursive: true });
|
|
98
143
|
const base = target.split('/').pop() ?? '';
|
|
99
144
|
if (TEXT.test(base) || TEXT.test(relPath))
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAC/G,mHAAmH;AACnH,iHAAiH;AACjH,kHAAkH;AAClH,iDAAiD;AACjD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAC/G,mHAAmH;AACnH,iHAAiH;AACjH,kHAAkH;AAClH,iDAAiD;AACjD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC3H,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,gBAAgB,EA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AC,IAAI,SAAS;QAAE,IAAI,CAAC,CAAC,MAAM,KAAK,SAAS;YAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC1E,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;AACnF,CAAC;AAED,SAAS,oBAAoB;IAC3B,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,oBAAoB,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;QAC9H,OAAQ,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,CAAyB,CAAC,OAAO,CAAC;IAC9E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,OAAO,CAAC;IACjB,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenticprimitives/create-app",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.35",
|
|
4
4
|
"description": "The Developer Kit generator (spec 398 §10.3, spec 399 §3.6): `create-app <dir> --template product-repo` writes a product repository — pnpm workspace, exact @agenticprimitives/* pins, agentic.lock.json, `ap doctor` + `ap test` CI, a nightly live-gates workflow over the evaluation runner, a generic wrangler env layout with a shadow env, the projected rules files — so a product is built from the template, never from a copy of the monorepo root.",
|
|
5
5
|
"homepage": "https://agenticprimitives.dev",
|
|
6
6
|
"bugs": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@agenticprimitives/devkit": "0.0.0-alpha.
|
|
43
|
+
"@agenticprimitives/devkit": "0.0.0-alpha.35"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"vitest": "^4.1.11"
|
|
@@ -14,7 +14,7 @@ what it knows how to do and what each act needs.
|
|
|
14
14
|
1. **Use a capability her agent already has** (most requests). Find it, then call it through `/api/ask`:
|
|
15
15
|
- `curl -s -A x <SKILLS_REGISTRY>/context/contexts/agentic-trust/archetypes/person-steward/definition | jq '.definition.tools[] | {id, verbs, answers}'`
|
|
16
16
|
(`SKILLS_REGISTRY` is in the estate's `/llms.txt`; the Developer MCP `ap mcp` answers package and ontology questions).
|
|
17
|
-
- A typed operation: `
|
|
17
|
+
- A typed operation: `pnpm exec ap generate client --registry <SKILLS_REGISTRY> --definition agentic-trust/person-steward --only <capability> --out src/lib/agent-client.ts`, then bind its port to a server route that calls `askAgent` with a supplied `plan: { steps: [{ toolId, args }] }`.
|
|
18
18
|
- Render the reply by `kind`: `answer` (her agent's words + evidence) · `authority_required` (show `grantLink`, then `ask { run }` after she signs) · `prompt` (answer with `supplied`) · `done`.
|
|
19
19
|
2. **Offer her agent a NEW capability.** That is a contract in the skills corpus (`~/skills`), not code here: a SKILL.md with
|
|
20
20
|
`capability`, `risk` (R0 read … R3), `inputs`/`required`, `authority` (`resourceArg`/`authorityArg` name AGENTS, never strings),
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# The person's Home MCP — the door to her own agent (spec 397). Set it to your estate's Home MCP origin.
|
|
2
|
+
HOME_MCP_URL=https://<your-home-mcp-host>
|
|
3
|
+
# Where this app runs (the OAuth redirect returns here). Localhost is accepted by the Home MCP's registration.
|
|
4
|
+
APP_URL=http://localhost:3000
|
|
5
|
+
# A random string that seals the connection cookie (openssl rand -hex 32).
|
|
6
|
+
COOKIE_SECRET=change-me
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$comment": "Claude Code reads this: the DEVELOPER MCP (spec 398 §10.4) — read-only; package exports, ontology terms, contract deployments, recipes, the doctor. Not the runtime MCP, not the Home MCP. Holds no key, reads no vault.",
|
|
2
|
+
"$comment": "Claude Code reads this: the DEVELOPER MCP (spec 398 §10.4) — read-only; package exports, ontology terms, contract deployments, recipes, the doctor. Not the runtime MCP, not the Home MCP. Holds no key, reads no vault, executes no code from this repository. Launched by PATH to the pinned local install (node_modules/@agenticprimitives/devkit) — never by an npx-style lookup of the bare name `ap`, an unscoped npm name this project does not own: a file path cannot fall through to the public registry. Run `pnpm install` first.",
|
|
3
3
|
"mcpServers": {
|
|
4
|
-
"ap-dev": { "command": "
|
|
4
|
+
"ap-dev": { "command": "node", "args": ["node_modules/@agenticprimitives/devkit/bin/ap.mjs", "mcp", "--root", "."] }
|
|
5
5
|
}
|
|
6
6
|
}
|
|
@@ -16,13 +16,15 @@ touches a vault, a key or a chain.
|
|
|
16
16
|
## Adding a capability
|
|
17
17
|
|
|
18
18
|
Her agent's capabilities are its playbook's (`~/skills` contracts compiled by digest) — this app asks, the agent decides.
|
|
19
|
-
For a typed client over a contract this app relies on: `
|
|
19
|
+
For a typed client over a contract this app relies on: `pnpm exec ap generate client --registry <skills-registry>
|
|
20
20
|
--definition agentic-trust/person-steward --only <capability> --out src/lib/agent-client.ts` (it posts intents through
|
|
21
21
|
a port you bind to `/api/ask`; it carries no authority).
|
|
22
22
|
|
|
23
23
|
## Ask the Developer MCP, don't guess
|
|
24
24
|
|
|
25
25
|
`.mcp.json` registers `ap mcp` — read-only: package exports, ontology terms, contract deployments, recipes, the doctor.
|
|
26
|
+
It executes no code from this repository, and is launched by path from the pinned install
|
|
27
|
+
(`node node_modules/@agenticprimitives/devkit/bin/ap.mjs`), never by the bare name `ap` through a registry lookup.
|
|
26
28
|
|
|
27
29
|
## Validate
|
|
28
30
|
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
// HOME_MCP_URL=… DEMO_HANDLE=alice DEMO_ORG="Missio Nexus" DEMO_MEMBER=bob node --experimental-strip-types scripts/verify-two-acts.ts
|
|
6
6
|
import { discover, registerClient, demoConnect, askAgent, grantLink } from '../src/lib/home-agent.ts';
|
|
7
7
|
|
|
8
|
-
const HOME_MCP = process.env.HOME_MCP_URL
|
|
8
|
+
const HOME_MCP = process.env.HOME_MCP_URL;
|
|
9
|
+
if (!HOME_MCP) throw new Error('HOME_MCP_URL is required — your estate\'s Home MCP origin (see .env.example)');
|
|
9
10
|
const APP = process.env.APP_URL ?? 'http://localhost:3000';
|
|
10
11
|
const HANDLE = process.env.DEMO_HANDLE ?? 'alice';
|
|
11
12
|
const ORG = process.env.DEMO_ORG ?? 'Missio Nexus';
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$comment": "Claude Code reads this: the DEVELOPER MCP (spec 398 §10.4) — read-only; package exports, ontology terms, contract deployments, recipes, the doctor. Not the runtime MCP, not the Home MCP. Holds no key, reads no vault.",
|
|
2
|
+
"$comment": "Claude Code reads this: the DEVELOPER MCP (spec 398 §10.4) — read-only; package exports, ontology terms, contract deployments, recipes, the doctor. Not the runtime MCP, not the Home MCP. Holds no key, reads no vault, executes no code from this repository. Launched by PATH to the pinned local install (node_modules/@agenticprimitives/devkit) — never by an npx-style lookup of the bare name `ap`, an unscoped npm name this project does not own: a file path cannot fall through to the public registry. Run `pnpm install` first.",
|
|
3
3
|
"mcpServers": {
|
|
4
|
-
"ap-dev": { "command": "
|
|
4
|
+
"ap-dev": { "command": "node", "args": ["node_modules/@agenticprimitives/devkit/bin/ap.mjs", "mcp", "--root", "."] }
|
|
5
5
|
}
|
|
6
6
|
}
|
|
@@ -20,6 +20,10 @@ specs and white-label config; Ring 0 owns the packages and the doctrine.
|
|
|
20
20
|
`.mcp.json` (Claude Code) and `.cursor/mcp.json` register `ap mcp` — the READ-ONLY Developer MCP (spec 398 §10.4):
|
|
21
21
|
`package_exports`, `ontology_term`, `contract_deployments`, `recipes`, `doctor`. Query it for an export name or an
|
|
22
22
|
ontology IRI rather than guessing. It is not the runtime MCP and not the Home MCP; it holds no key and reads no vault.
|
|
23
|
+
It executes no code from this repository: its `doctor` runs the kit's built-in rules, and a rule or catalog module
|
|
24
|
+
this repo's config names is listed as `notRun`, never imported (run `pnpm exec ap doctor` at a terminal for those).
|
|
25
|
+
Both files launch it by path from the pinned install (`node node_modules/@agenticprimitives/devkit/bin/ap.mjs`) —
|
|
26
|
+
never by the bare name `ap` through a registry lookup; run `pnpm install` first.
|
|
23
27
|
|
|
24
28
|
## Validate
|
|
25
29
|
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
#
|
|
6
6
|
# Reads NAME=value pairs from `apps/<app>/.secrets.<env>` (gitignored; never committed) and pushes each with
|
|
7
7
|
# `wrangler secret put --env <env>`. Values never echo. The live envs are set only by the deployer of record
|
|
8
|
-
# (DEPLOYER.md); during the parallel run that is the shadow env only.
|
|
8
|
+
# (DEPLOYER.md); during the parallel run that is the shadow env only. `wrangler` is the app's OWN pinned devDependency
|
|
9
|
+
# (`pnpm exec` runs the local install and never fetches a package by name from the registry, which an npx-style lookup would).
|
|
9
10
|
set -euo pipefail
|
|
10
11
|
ENV_NAME="${1:?usage: set-cloudflare-secrets.sh <env> <app-dir>}"
|
|
11
12
|
APP_DIR="${2:?usage: set-cloudflare-secrets.sh <env> <app-dir>}"
|
|
@@ -14,6 +15,6 @@ FILE="$APP_DIR/.secrets.$ENV_NAME"
|
|
|
14
15
|
while IFS='=' read -r name value; do
|
|
15
16
|
[ -z "$name" ] && continue
|
|
16
17
|
case "$name" in \#*) continue ;; esac
|
|
17
|
-
printf '%s' "$value" | (cd "$APP_DIR" &&
|
|
18
|
+
printf '%s' "$value" | (cd "$APP_DIR" && pnpm exec wrangler secret put "$name" --env "$ENV_NAME") >/dev/null
|
|
18
19
|
echo "set $name for $ENV_NAME ($APP_DIR)"
|
|
19
20
|
done < "$FILE"
|