@metaobjectsdev/sdk 0.9.0 → 0.11.0-rc.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 (96) hide show
  1. package/README.md +9 -0
  2. package/agent-context/README.md +14 -0
  3. package/agent-context/servers/csharp.meta.json +5 -0
  4. package/agent-context/servers/java.meta.json +5 -0
  5. package/agent-context/servers/kotlin.meta.json +5 -0
  6. package/agent-context/servers/python.meta.json +5 -0
  7. package/agent-context/servers/typescript.meta.json +5 -0
  8. package/agent-context/skills/metaobjects-authoring/SKILL.md +345 -0
  9. package/agent-context/skills/metaobjects-codegen/SKILL.md +99 -0
  10. package/agent-context/skills/metaobjects-codegen/references/csharp.md +87 -0
  11. package/agent-context/skills/metaobjects-codegen/references/java.md +94 -0
  12. package/agent-context/skills/metaobjects-codegen/references/kotlin.md +110 -0
  13. package/agent-context/skills/metaobjects-codegen/references/typescript.md +165 -0
  14. package/agent-context/skills/metaobjects-prompts/SKILL.md +189 -0
  15. package/agent-context/skills/metaobjects-prompts/references/csharp.md +110 -0
  16. package/agent-context/skills/metaobjects-prompts/references/java.md +108 -0
  17. package/agent-context/skills/metaobjects-prompts/references/kotlin.md +130 -0
  18. package/agent-context/skills/metaobjects-prompts/references/python.md +116 -0
  19. package/agent-context/skills/metaobjects-prompts/references/typescript.md +150 -0
  20. package/agent-context/skills/metaobjects-runtime-ui/SKILL.md +130 -0
  21. package/agent-context/skills/metaobjects-runtime-ui/references/java.md +96 -0
  22. package/agent-context/skills/metaobjects-runtime-ui/references/kotlin.md +99 -0
  23. package/agent-context/skills/metaobjects-runtime-ui/references/react.md +86 -0
  24. package/agent-context/skills/metaobjects-runtime-ui/references/tanstack.md +119 -0
  25. package/agent-context/skills/metaobjects-runtime-ui/references/typescript.md +92 -0
  26. package/agent-context/skills/metaobjects-verify/SKILL.md +107 -0
  27. package/agent-context/skills/metaobjects-verify/references/migration.md +105 -0
  28. package/agent-context/templates/always-on.md.mustache +27 -0
  29. package/dist/agent-context/assemble.d.ts +7 -0
  30. package/dist/agent-context/assemble.d.ts.map +1 -0
  31. package/dist/agent-context/assemble.js +61 -0
  32. package/dist/agent-context/assemble.js.map +1 -0
  33. package/dist/agent-context/content-root.d.ts +8 -0
  34. package/dist/agent-context/content-root.d.ts.map +1 -0
  35. package/dist/agent-context/content-root.js +35 -0
  36. package/dist/agent-context/content-root.js.map +1 -0
  37. package/dist/agent-context/index.d.ts +6 -0
  38. package/dist/agent-context/index.d.ts.map +1 -0
  39. package/dist/agent-context/index.js +6 -0
  40. package/dist/agent-context/index.js.map +1 -0
  41. package/dist/agent-context/resolve.d.ts +13 -0
  42. package/dist/agent-context/resolve.d.ts.map +1 -0
  43. package/dist/agent-context/resolve.js +30 -0
  44. package/dist/agent-context/resolve.js.map +1 -0
  45. package/dist/agent-context/scaffold.d.ts +60 -0
  46. package/dist/agent-context/scaffold.d.ts.map +1 -0
  47. package/dist/agent-context/scaffold.js +61 -0
  48. package/dist/agent-context/scaffold.js.map +1 -0
  49. package/dist/agent-context/types.d.ts +21 -0
  50. package/dist/agent-context/types.d.ts.map +1 -0
  51. package/dist/agent-context/types.js +12 -0
  52. package/dist/agent-context/types.js.map +1 -0
  53. package/dist/agent-docs/body.d.ts +5 -1
  54. package/dist/agent-docs/body.d.ts.map +1 -1
  55. package/dist/agent-docs/body.js +7 -3
  56. package/dist/agent-docs/body.js.map +1 -1
  57. package/dist/forge-types.js +2 -2
  58. package/dist/forge-types.js.map +1 -1
  59. package/dist/index.d.ts +2 -1
  60. package/dist/index.d.ts.map +1 -1
  61. package/dist/index.js +3 -1
  62. package/dist/index.js.map +1 -1
  63. package/dist/memory.d.ts.map +1 -1
  64. package/dist/memory.js +3 -1
  65. package/dist/memory.js.map +1 -1
  66. package/dist/storage/errors.d.ts +3 -3
  67. package/dist/storage/errors.d.ts.map +1 -1
  68. package/dist/storage/errors.js +6 -6
  69. package/dist/storage/errors.js.map +1 -1
  70. package/dist/storage/index.d.ts +1 -1
  71. package/dist/storage/index.d.ts.map +1 -1
  72. package/dist/storage/index.js +1 -1
  73. package/dist/storage/index.js.map +1 -1
  74. package/dist/storage/lifecycle.js +4 -4
  75. package/dist/storage/lifecycle.js.map +1 -1
  76. package/dist/storage/read.js +4 -4
  77. package/dist/storage/read.js.map +1 -1
  78. package/dist/storage/write.js +2 -2
  79. package/dist/storage/write.js.map +1 -1
  80. package/package.json +40 -22
  81. package/scripts/bundle-agent-context.mjs +19 -0
  82. package/src/agent-context/assemble.ts +68 -0
  83. package/src/agent-context/content-root.ts +35 -0
  84. package/src/agent-context/index.ts +5 -0
  85. package/src/agent-context/resolve.ts +33 -0
  86. package/src/agent-context/scaffold.ts +103 -0
  87. package/src/agent-context/types.ts +31 -0
  88. package/src/agent-docs/body.ts +7 -3
  89. package/src/forge-types.ts +2 -2
  90. package/src/index.ts +6 -3
  91. package/src/memory.ts +3 -1
  92. package/src/storage/errors.ts +6 -6
  93. package/src/storage/index.ts +3 -3
  94. package/src/storage/lifecycle.ts +4 -4
  95. package/src/storage/read.ts +4 -4
  96. package/src/storage/write.ts +2 -2
@@ -0,0 +1,105 @@
1
+ # Schema migrations — the shared TypeScript engine (every port)
2
+
3
+ Schema migration is owned by **one shared TypeScript engine** regardless of your
4
+ server language (ADR-0015). The Node `meta` CLI (`@metaobjectsdev/cli`, on top of
5
+ `@metaobjectsdev/migrate-ts`) is the migration + live-DB-drift toolchain for **TS,
6
+ Java, Kotlin, C#, and Python alike**. The non-TS ports have **no** migration command
7
+ of their own — their former migrate goals/modules were removed. A JVM service may
8
+ auto-create dev/test tables at startup for convenience, but production schema is
9
+ always the Node migrate engine's output.
10
+
11
+ So even in a Java / Python / C# / Kotlin project you run `meta migrate` and
12
+ `meta verify --db` through Node. Only schema crosses to Node; per-port `gen`/codegen
13
+ stays native to the language.
14
+
15
+ ## Install (Node, dev-only)
16
+
17
+ ```bash
18
+ npm install --save-dev @metaobjectsdev/cli @metaobjectsdev/migrate-ts
19
+ ```
20
+
21
+ You point the tool at the **same database your server connects to** — its
22
+ connection is independent of your runtime tier.
23
+
24
+ ## The workflow
25
+
26
+ 1. **Generate a migration** by diffing metadata vs the prior state (the live DB or a
27
+ committed snapshot). The engine emits paired `up.sql` + `down.sql`:
28
+
29
+ ```bash
30
+ meta migrate --db postgresql://... # emit up.sql + down.sql
31
+ meta migrate --db postgresql://... --slug initial # name the migration
32
+ meta migrate --dry-run # preview without writing
33
+ ```
34
+
35
+ 2. **Review the SQL.** Read the emitted `up.sql` (forward) and `down.sql`
36
+ (rollback) before applying. Destructive changes (drop column / drop table) are
37
+ opt-in — the engine blocks them unless explicitly allowed, and routes ambiguous
38
+ rename-vs-drop+add decisions through a prompt rather than guessing.
39
+
40
+ 3. **Apply** the pending migrations against the DB; migration history is tracked in
41
+ a ledger table:
42
+
43
+ ```bash
44
+ meta migrate --db postgresql://... --apply # run pending up.sql
45
+ meta migrate --db postgresql://... --rollback # run down.sql for the last migration
46
+ ```
47
+
48
+ ## Dialects
49
+
50
+ - `postgres` (default) — native `ALTER`s.
51
+ - `sqlite` (libsql / Turso) — native `ALTER`s where supported (≥ 3.35), bundling
52
+ recreate-and-copy per table when a change needs it.
53
+ - `d1` (Cloudflare D1) — **TS-only**; targets D1 via the wrangler CLI, writes
54
+ Wrangler's native `migrations/<seq>_<slug>.sql` layout. Pass `--dialect d1`.
55
+
56
+ ## Live-DB drift: `meta verify --db`
57
+
58
+ `meta verify --db` introspects the live database and fails if its schema has
59
+ diverged from the metadata (a column the metadata no longer declares, a missing
60
+ index, a type mismatch). This is the **authoritative** DB-vs-metadata gate for every
61
+ port — wire it into CI. On the JVM ports a runtime startup validator can catch
62
+ generated-table drift at app boot as a complementary check, but the gate that owns
63
+ DB drift is the Node `meta verify --db`.
64
+
65
+ A clean run is silent; a failure names the drifted table/column. Bias toward
66
+ trusting the tool — a drift failure almost always means the metadata changed and the
67
+ DB didn't follow.
68
+
69
+ ## Index modeling (Postgres)
70
+
71
+ Secondary indexes carry physical-shape attributes contributed by the db provider
72
+ (they live on `identity.secondary`, not core):
73
+
74
+ - `@orders` — per-key sort direction, positional to `@fields` (`["asc", "desc"]`).
75
+ Omit for all-ascending; drives `DESC`-ordered index keys (e.g. a recency index).
76
+ - `@where` — a partial-index predicate (raw SQL, e.g. `"delivered_at IS NULL"`),
77
+ emitted as `WHERE (<pred>)`. The index then covers only matching rows.
78
+
79
+ ```json
80
+ { "identity.secondary": { "@fields": ["userId", "createdAt"],
81
+ "@orders": ["asc", "desc"], "@where": "archived_at IS NULL" } }
82
+ ```
83
+
84
+ ## Adopting an existing database (non-destructive)
85
+
86
+ `meta verify --db` / `meta migrate` can reach **zero drift** against a hand-built
87
+ schema without a rewrite:
88
+
89
+ - **`meta migrate --from-db`** reverse-engineers a baseline from the live DB so the
90
+ first diff is empty.
91
+ - **Auto schema-scope** — the diff manages only the schemas the metadata *declares*
92
+ (via `source.rdb @schema`); tables in undeclared schemas belong to another owner
93
+ and are left untouched. This is what lets several apps share one database, each
94
+ owning its own schema, with a clean per-owner `verify --db` and no manual ignore
95
+ lists. A downstream app that extends the toolkit's DB declares its own `@schema`,
96
+ models only its tables, and runs its own migrate/verify against that scope.
97
+ - **`identity.reference @constraintName`** pins a foreign-key constraint name so the
98
+ metadata can match an existing DB's naming convention without a destructive
99
+ rename.
100
+
101
+ ## Not yet shipped
102
+
103
+ Triggers, generated columns, exclusion + CHECK constraints, MySQL, and data
104
+ migrations (column-type changes needing data transformation error out with a hint).
105
+ (Partial + descending **indexes** *are* supported — see Index modeling above.)
@@ -0,0 +1,27 @@
1
+ # Working with MetaObjects in this project
2
+
3
+ > {{stackLine}}
4
+
5
+ MetaObjects is a metadata standard: typed metadata in `metaobjects/` is the durable
6
+ spine; generated code is the disposable artifact. Regenerate with `{{codegenCommand}}`.
7
+
8
+ ## Principles
9
+ - Pattern-derivable from metadata = codegen, never hand-write (FKs, CRUD, validators, finders).
10
+ - Never hand-edit generated files — change the metadata and regenerate (three-way merge preserves hand-written regions).
11
+ - Use the generated constants for any string that names metadata.
12
+ - The loaded metadata model is READ-ONLY — never inject nodes or mutate the tree at load time (no "enrich the model on load" hooks). Need an extra field/column? Author it in the metadata, or derive it during codegen (read the metadata, emit output). Mutating the loaded model makes it diverge from what's declared — a bad practice reserved for very rare cases.
13
+
14
+ ## Authoring rules you must not violate
15
+ - Nodes are fused-key maps: `{"<type>.<subType>": { ... }}` (e.g. `{"field.string": {"name": "email"}}`) — never split the type and subtype into separate keys.
16
+ - Attribute names are unique within a node; for multi-value use one array attr (`@values: [...]`).
17
+ - An inline `@maxLength: 50` equals an `attr` child of the same name — never write both.
18
+ - Package paths use `::` (`acme::common::id`).
19
+
20
+ ## Going deeper (Claude Code)
21
+ For authoring, codegen, runtime/UI, prompts, or verify work, use the matching
22
+ `metaobjects-*` skill — its body links the `references/<lang>.md` fragment installed
23
+ for this project's stack.
24
+
25
+ These `metaobjects-*` skills are plain, inspectable Markdown reference docs (no tools
26
+ or hooks) generated by MetaObjects for this project's stack — safe to read and edit;
27
+ re-run the agent-context scaffold to refresh them.
@@ -0,0 +1,7 @@
1
+ import { type AssembledFile, type Stack } from "./types.js";
2
+ /** Assemble the consumer files for a resolved stack. Pure given the content tree. */
3
+ export declare function assemble(opts: {
4
+ contentRoot: string;
5
+ stack: Stack;
6
+ }): AssembledFile[];
7
+ //# sourceMappingURL=assemble.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assemble.d.ts","sourceRoot":"","sources":["../../src/agent-context/assemble.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,aAAa,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AA4BzE,qFAAqF;AACrF,wBAAgB,QAAQ,CAAC,IAAI,EAAE;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,GAAG,aAAa,EAAE,CAoCrF"}
@@ -0,0 +1,61 @@
1
+ import { readFileSync, readdirSync, existsSync, statSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ import { SKILL_NAMES } from "./types.js";
4
+ function readServerMeta(contentRoot, server) {
5
+ const p = join(contentRoot, "servers", `${server}.meta.json`);
6
+ if (!existsSync(p))
7
+ return undefined;
8
+ return JSON.parse(readFileSync(p, "utf8"));
9
+ }
10
+ function stackLine(contentRoot, stack) {
11
+ const primary = stack.servers[0];
12
+ const meta = primary ? readServerMeta(contentRoot, primary) : undefined;
13
+ const serverPart = stack.servers.length ? stack.servers.join(", ") + " server" : "no server";
14
+ const clientPart = stack.clients.length ? stack.clients.join(", ") + " client" : "no client";
15
+ return {
16
+ line: `Stack: ${serverPart}, ${clientPart}; migrations are TS.`,
17
+ codegenCommand: meta ? meta.codegenCommand : "meta gen",
18
+ };
19
+ }
20
+ function applyTemplate(tpl, vars) {
21
+ return tpl.replace(/\{\{(\w+)\}\}/g, (_m, k) => {
22
+ if (!(k in vars))
23
+ throw new Error(`agent-context: unknown template variable {{${k}}}`);
24
+ return vars[k];
25
+ });
26
+ }
27
+ /** Assemble the consumer files for a resolved stack. Pure given the content tree. */
28
+ export function assemble(opts) {
29
+ const { contentRoot, stack } = opts;
30
+ const out = [];
31
+ // 1. Always-on (AGENTS.md + CLAUDE.md, identical contents).
32
+ const tpl = readFileSync(join(contentRoot, "templates", "always-on.md.mustache"), "utf8");
33
+ const { line, codegenCommand } = stackLine(contentRoot, stack);
34
+ const alwaysOn = applyTemplate(tpl, { stackLine: line, codegenCommand });
35
+ out.push({ path: ".metaobjects/AGENTS.md", contents: alwaysOn });
36
+ out.push({ path: ".metaobjects/CLAUDE.md", contents: alwaysOn });
37
+ // 2. Skills: body + only the references whose token is in the stack.
38
+ for (const skill of SKILL_NAMES) {
39
+ const skillDir = join(contentRoot, "skills", skill);
40
+ const body = readFileSync(join(skillDir, "SKILL.md"), "utf8");
41
+ out.push({ path: `.claude/skills/${skill}/SKILL.md`, contents: body });
42
+ const refDir = join(skillDir, "references");
43
+ if (existsSync(refDir) && statSync(refDir).isDirectory()) {
44
+ const refs = readdirSync(refDir)
45
+ .filter((f) => f.endsWith(".md"))
46
+ .map((f) => f.replace(/\.md$/, ""))
47
+ .filter((token) => stack.tokens.has(token))
48
+ .sort();
49
+ for (const token of refs) {
50
+ out.push({
51
+ path: `.claude/skills/${skill}/references/${token}.md`,
52
+ contents: readFileSync(join(refDir, `${token}.md`), "utf8"),
53
+ });
54
+ }
55
+ }
56
+ }
57
+ // Stable order: by path.
58
+ out.sort((a, b) => (a.path < b.path ? -1 : a.path > b.path ? 1 : 0));
59
+ return out;
60
+ }
61
+ //# sourceMappingURL=assemble.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assemble.js","sourceRoot":"","sources":["../../src/agent-context/assemble.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAkC,MAAM,YAAY,CAAC;AAIzE,SAAS,cAAc,CAAC,WAAmB,EAAE,MAAc;IACzD,MAAM,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,EAAE,GAAG,MAAM,YAAY,CAAC,CAAC;IAC9D,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IACrC,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,CAAe,CAAC;AAC3D,CAAC;AAED,SAAS,SAAS,CAAC,WAAmB,EAAE,KAAY;IAClD,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACjC,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACxE,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,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,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,KAAK,KAAK,CAAC,EAAE,MAAM,CAAC;iBAC5D,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,yBAAyB;IACzB,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACrE,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Resolve the `agent-context/` content tree the assembler reads.
3
+ * - If `override` is given, it must be a valid content root (else throw).
4
+ * - Otherwise: check a bundled copy beside this module (`<pkg>/agent-context`,
5
+ * the published path), then walk up looking for a monorepo `agent-context/` (dev).
6
+ */
7
+ export declare function resolveAgentContextRoot(override?: string): string;
8
+ //# sourceMappingURL=content-root.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-root.d.ts","sourceRoot":"","sources":["../../src/agent-context/content-root.ts"],"names":[],"mappings":"AASA;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAmBjE"}
@@ -0,0 +1,35 @@
1
+ import { existsSync } from "node:fs";
2
+ import { dirname, join } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ /** A directory is a valid content root iff it holds the authoring skill body. */
5
+ function isContentRoot(dir) {
6
+ return existsSync(join(dir, "skills", "metaobjects-authoring", "SKILL.md"));
7
+ }
8
+ /**
9
+ * Resolve the `agent-context/` content tree the assembler reads.
10
+ * - If `override` is given, it must be a valid content root (else throw).
11
+ * - Otherwise: check a bundled copy beside this module (`<pkg>/agent-context`,
12
+ * the published path), then walk up looking for a monorepo `agent-context/` (dev).
13
+ */
14
+ export function resolveAgentContextRoot(override) {
15
+ if (override !== undefined) {
16
+ if (isContentRoot(override))
17
+ return override;
18
+ throw new Error(`agent-context content not found at override: ${override}`);
19
+ }
20
+ let dir = dirname(fileURLToPath(import.meta.url));
21
+ for (let i = 0; i < 8; i++) {
22
+ // Matches both a bundled copy shipped inside the package (published) and the
23
+ // monorepo content tree (dev), since both live at `<dir>/agent-context`.
24
+ const candidate = join(dir, "agent-context");
25
+ if (isContentRoot(candidate))
26
+ return candidate;
27
+ const parent = dirname(dir);
28
+ if (parent === dir)
29
+ break;
30
+ dir = parent;
31
+ }
32
+ throw new Error("agent-context content not found — looked for a bundled `agent-context/` beside the package " +
33
+ "and a monorepo `agent-context/` walking up from the sdk module.");
34
+ }
35
+ //# sourceMappingURL=content-root.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-root.js","sourceRoot":"","sources":["../../src/agent-context/content-root.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,iFAAiF;AACjF,SAAS,aAAa,CAAC,GAAW;IAChC,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,uBAAuB,EAAE,UAAU,CAAC,CAAC,CAAC;AAC9E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAAiB;IACvD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,IAAI,aAAa,CAAC,QAAQ,CAAC;YAAE,OAAO,QAAQ,CAAC;QAC7C,MAAM,IAAI,KAAK,CAAC,gDAAgD,QAAQ,EAAE,CAAC,CAAC;IAC9E,CAAC;IACD,IAAI,GAAG,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAClD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3B,6EAA6E;QAC7E,yEAAyE;QACzE,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;QAC7C,IAAI,aAAa,CAAC,SAAS,CAAC;YAAE,OAAO,SAAS,CAAC;QAC/C,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,MAAM,KAAK,GAAG;YAAE,MAAM;QAC1B,GAAG,GAAG,MAAM,CAAC;IACf,CAAC;IACD,MAAM,IAAI,KAAK,CACb,6FAA6F;QAC3F,iEAAiE,CACpE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from "./types.js";
2
+ export * from "./resolve.js";
3
+ export * from "./assemble.js";
4
+ export * from "./content-root.js";
5
+ export * from "./scaffold.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agent-context/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from "./types.js";
2
+ export * from "./resolve.js";
3
+ export * from "./assemble.js";
4
+ export * from "./content-root.js";
5
+ export * from "./scaffold.js";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agent-context/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { type ServerLang, type ClientFramework, type Stack } from "./types.js";
2
+ export interface ProjectProbe {
3
+ hasDep(name: string): boolean;
4
+ hasFileMatching(pattern: RegExp): boolean;
5
+ }
6
+ export declare function makeStack(servers: ServerLang[], clients: ClientFramework[]): Stack;
7
+ /** Best-effort detection from a project probe. Always overridable; a wrong guess
8
+ * writes an extra fragment, never a wrong one (callers confirm before scaffolding). */
9
+ export declare function detectStack(probe: ProjectProbe): {
10
+ servers: ServerLang[];
11
+ clients: ClientFramework[];
12
+ };
13
+ //# sourceMappingURL=resolve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/agent-context/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EAAE,KAAK,eAAe,EAAE,KAAK,KAAK,EAClD,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAC9B,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;CAC3C;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,KAAK,CAIlF;AAED;uFACuF;AACvF,wBAAgB,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG;IAAE,OAAO,EAAE,UAAU,EAAE,CAAC;IAAC,OAAO,EAAE,eAAe,EAAE,CAAA;CAAE,CActG"}
@@ -0,0 +1,30 @@
1
+ import { SERVER_LANGS, CLIENT_FRAMEWORKS, MIGRATION_TOKEN, } from "./types.js";
2
+ export function makeStack(servers, clients) {
3
+ const s = SERVER_LANGS.filter((x) => servers.includes(x));
4
+ const c = CLIENT_FRAMEWORKS.filter((x) => clients.includes(x));
5
+ return { servers: s, clients: c, tokens: new Set([...s, ...c, MIGRATION_TOKEN]) };
6
+ }
7
+ /** Best-effort detection from a project probe. Always overridable; a wrong guess
8
+ * writes an extra fragment, never a wrong one (callers confirm before scaffolding). */
9
+ export function detectStack(probe) {
10
+ const servers = [];
11
+ if (probe.hasDep("@metaobjectsdev/cli") || probe.hasDep("@metaobjectsdev/codegen-ts"))
12
+ servers.push("typescript");
13
+ if (probe.hasFileMatching(/(^|\/)build\.gradle(\.kts)?$/))
14
+ servers.push("kotlin");
15
+ if (probe.hasFileMatching(/(^|\/)pom\.xml$/))
16
+ servers.push("java");
17
+ if (probe.hasFileMatching(/\.csproj$/))
18
+ servers.push("csharp");
19
+ if (probe.hasFileMatching(/(^|\/)(pyproject\.toml|setup\.py)$/))
20
+ servers.push("python");
21
+ const clients = [];
22
+ if (probe.hasDep("@metaobjectsdev/react"))
23
+ clients.push("react");
24
+ if (probe.hasDep("@metaobjectsdev/tanstack"))
25
+ clients.push("tanstack");
26
+ if (probe.hasDep("@metaobjectsdev/angular"))
27
+ clients.push("angular");
28
+ return { servers, clients };
29
+ }
30
+ //# sourceMappingURL=resolve.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../src/agent-context/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAAE,iBAAiB,EAAE,eAAe,GAEjD,MAAM,YAAY,CAAC;AAOpB,MAAM,UAAU,SAAS,CAAC,OAAqB,EAAE,OAA0B;IACzE,MAAM,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1D,MAAM,CAAC,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/D,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,GAAG,CAAS,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC;AAC5F,CAAC;AAED;uFACuF;AACvF,MAAM,UAAU,WAAW,CAAC,KAAmB;IAC7C,MAAM,OAAO,GAAiB,EAAE,CAAC;IACjC,IAAI,KAAK,CAAC,MAAM,CAAC,qBAAqB,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,4BAA4B,CAAC;QAAE,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAClH,IAAI,KAAK,CAAC,eAAe,CAAC,8BAA8B,CAAC;QAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAClF,IAAI,KAAK,CAAC,eAAe,CAAC,iBAAiB,CAAC;QAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnE,IAAI,KAAK,CAAC,eAAe,CAAC,WAAW,CAAC;QAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC/D,IAAI,KAAK,CAAC,eAAe,CAAC,oCAAoC,CAAC;QAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAExF,MAAM,OAAO,GAAsB,EAAE,CAAC;IACtC,IAAI,KAAK,CAAC,MAAM,CAAC,uBAAuB,CAAC;QAAE,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACjE,IAAI,KAAK,CAAC,MAAM,CAAC,0BAA0B,CAAC;QAAE,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACvE,IAAI,KAAK,CAAC,MAAM,CAAC,yBAAyB,CAAC;QAAE,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAErE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAC9B,CAAC"}
@@ -0,0 +1,60 @@
1
+ import type { AssembledFile, Stack } from "./types.js";
2
+ /** Consumer-relative path of the sidecar manifest that tracks scaffolded files. */
3
+ export declare const AGENT_CONTEXT_MANIFEST_PATH = ".metaobjects/.agent-context.json";
4
+ export interface Manifest {
5
+ version: 1;
6
+ /**
7
+ * The MetaObjects version that last scaffolded this agent context. Used to nudge
8
+ * a re-scaffold when the installed version moves ahead (the skills/docs ship with
9
+ * the package, so an upgrade can leave the copied-in context stale). Optional for
10
+ * back-compat with manifests written before version tracking existed.
11
+ */
12
+ generatedBy?: string;
13
+ servers: string[];
14
+ clients: string[];
15
+ /** consumer-relative path → sha256 of the contents as last scaffolded. */
16
+ files: Record<string, string>;
17
+ }
18
+ export declare function hashContents(s: string): string;
19
+ export interface ScaffoldDecision {
20
+ /** files to (over)write at their own path: new, or unmodified-since-last-scaffold. */
21
+ writes: {
22
+ path: string;
23
+ contents: string;
24
+ }[];
25
+ /** hand-edited files: write the fresh contents to `<path>.new`, leave the original. */
26
+ conflicts: {
27
+ path: string;
28
+ newPath: string;
29
+ contents: string;
30
+ }[];
31
+ /** the manifest to persist after writing. */
32
+ manifest: Manifest;
33
+ /** paths the prior manifest tracked that are no longer assembled (e.g. stack shrank) — reported, never auto-deleted. */
34
+ removed: string[];
35
+ }
36
+ /**
37
+ * Decide what to write for a (re-)scaffold. Pure: filesystem access is via the
38
+ * `readCurrent` callback (returns the on-disk contents, or undefined if absent).
39
+ * A file is safe to overwrite iff it is absent, or its on-disk hash still equals
40
+ * the hash the prior manifest recorded (i.e. the user hasn't hand-edited it).
41
+ */
42
+ export declare function planScaffold(opts: {
43
+ stack: Stack;
44
+ assembled: AssembledFile[];
45
+ prior: Manifest | undefined;
46
+ readCurrent: (path: string) => string | undefined;
47
+ /** The MetaObjects version doing the scaffold — stamped into the manifest. */
48
+ generatedBy: string;
49
+ }): ScaffoldDecision;
50
+ /**
51
+ * A one-line nudge if the scaffolded agent context predates the installed MetaObjects
52
+ * (so `gen`/`verify` can remind the user to refresh the skills after an upgrade), or
53
+ * `null` when there is nothing to say — no agent context scaffolded, or it is in sync.
54
+ * Advisory only: never throws, never blocks, never writes.
55
+ */
56
+ export declare function agentContextStaleness(opts: {
57
+ manifest: Manifest | undefined;
58
+ currentVersion: string;
59
+ }): string | null;
60
+ //# sourceMappingURL=scaffold.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../src/agent-context/scaffold.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEvD,mFAAmF;AACnF,eAAO,MAAM,2BAA2B,qCAAqC,CAAC;AAE9E,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,CAAC,CAAC;IACX;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED,MAAM,WAAW,gBAAgB;IAC/B,sFAAsF;IACtF,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC7C,uFAAuF;IACvF,SAAS,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACjE,6CAA6C;IAC7C,QAAQ,EAAE,QAAQ,CAAC;IACnB,wHAAwH;IACxH,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE;IACjC,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,KAAK,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC5B,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAClD,8EAA8E;IAC9E,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,gBAAgB,CA8BnB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE;IAC1C,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;CACxB,GAAG,MAAM,GAAG,IAAI,CAYhB"}
@@ -0,0 +1,61 @@
1
+ import { createHash } from "node:crypto";
2
+ /** Consumer-relative path of the sidecar manifest that tracks scaffolded files. */
3
+ export const AGENT_CONTEXT_MANIFEST_PATH = ".metaobjects/.agent-context.json";
4
+ export function hashContents(s) {
5
+ return createHash("sha256").update(s, "utf8").digest("hex");
6
+ }
7
+ /**
8
+ * Decide what to write for a (re-)scaffold. Pure: filesystem access is via the
9
+ * `readCurrent` callback (returns the on-disk contents, or undefined if absent).
10
+ * A file is safe to overwrite iff it is absent, or its on-disk hash still equals
11
+ * the hash the prior manifest recorded (i.e. the user hasn't hand-edited it).
12
+ */
13
+ export function planScaffold(opts) {
14
+ const { stack, assembled, prior, readCurrent, generatedBy } = opts;
15
+ const writes = [];
16
+ const conflicts = [];
17
+ const files = {};
18
+ for (const f of assembled) {
19
+ files[f.path] = hashContents(f.contents);
20
+ const current = readCurrent(f.path);
21
+ if (current === undefined) {
22
+ writes.push({ path: f.path, contents: f.contents });
23
+ continue;
24
+ }
25
+ const priorHash = prior?.files[f.path];
26
+ if (priorHash !== undefined && hashContents(current) === priorHash) {
27
+ writes.push({ path: f.path, contents: f.contents }); // unmodified → refresh to latest
28
+ }
29
+ else {
30
+ conflicts.push({ path: f.path, newPath: `${f.path}.new`, contents: f.contents });
31
+ }
32
+ }
33
+ const assembledPaths = new Set(assembled.map((f) => f.path));
34
+ const removed = prior ? Object.keys(prior.files).filter((p) => !assembledPaths.has(p)) : [];
35
+ return {
36
+ writes,
37
+ conflicts,
38
+ manifest: { version: 1, generatedBy, servers: stack.servers, clients: stack.clients, files },
39
+ removed,
40
+ };
41
+ }
42
+ /**
43
+ * A one-line nudge if the scaffolded agent context predates the installed MetaObjects
44
+ * (so `gen`/`verify` can remind the user to refresh the skills after an upgrade), or
45
+ * `null` when there is nothing to say — no agent context scaffolded, or it is in sync.
46
+ * Advisory only: never throws, never blocks, never writes.
47
+ */
48
+ export function agentContextStaleness(opts) {
49
+ const { manifest, currentVersion } = opts;
50
+ if (manifest === undefined)
51
+ return null; // no agent context here → nothing to nudge
52
+ // Exact-equality on purpose: ANY drift nudges (a re-scaffold is cheap + idempotent).
53
+ // Don't "fix" this into a semver compare — a prerelease/build-metadata difference is
54
+ // still a reason to refresh, and the nudge is advisory, never a gate.
55
+ if (manifest.generatedBy === currentVersion)
56
+ return null; // in sync
57
+ const from = manifest.generatedBy ?? "an older MetaObjects";
58
+ return (`MetaObjects agent context was generated by ${from}; you're on ${currentVersion}. ` +
59
+ `Re-run 'meta init --docs-only --refresh-docs' to refresh the .claude/skills docs.`);
60
+ }
61
+ //# sourceMappingURL=scaffold.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../src/agent-context/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,mFAAmF;AACnF,MAAM,CAAC,MAAM,2BAA2B,GAAG,kCAAkC,CAAC;AAiB9E,MAAM,UAAU,YAAY,CAAC,CAAS;IACpC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9D,CAAC;AAaD;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAO5B;IACC,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IACnE,MAAM,MAAM,GAA+B,EAAE,CAAC;IAC9C,MAAM,SAAS,GAAkC,EAAE,CAAC;IACpD,MAAM,KAAK,GAA2B,EAAE,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AAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAE5F,OAAO;QACL,MAAM;QACN,SAAS;QACT,QAAQ,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE;QAC5F,OAAO;KACR,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAGrC;IACC,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;IAC1C,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC,CAAC,2CAA2C;IACpF,qFAAqF;IACrF,qFAAqF;IACrF,sEAAsE;IACtE,IAAI,QAAQ,CAAC,WAAW,KAAK,cAAc;QAAE,OAAO,IAAI,CAAC,CAAC,UAAU;IACpE,MAAM,IAAI,GAAG,QAAQ,CAAC,WAAW,IAAI,sBAAsB,CAAC;IAC5D,OAAO,CACL,8CAA8C,IAAI,eAAe,cAAc,IAAI;QACnF,mFAAmF,CACpF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,21 @@
1
+ export declare const SERVER_LANGS: readonly ["typescript", "java", "kotlin", "csharp", "python"];
2
+ export type ServerLang = (typeof SERVER_LANGS)[number];
3
+ export declare const CLIENT_FRAMEWORKS: readonly ["react", "tanstack", "angular"];
4
+ export type ClientFramework = (typeof CLIENT_FRAMEWORKS)[number];
5
+ /** Always-present token: schema migrations are TS-owned for every port (ADR-0015). */
6
+ export declare const MIGRATION_TOKEN = "migration";
7
+ export declare const SKILL_NAMES: readonly ["metaobjects-authoring", "metaobjects-codegen", "metaobjects-runtime-ui", "metaobjects-prompts", "metaobjects-verify"];
8
+ export type SkillName = (typeof SKILL_NAMES)[number];
9
+ /** The resolved tech-stack of a consumer project. */
10
+ export interface Stack {
11
+ servers: ServerLang[];
12
+ clients: ClientFramework[];
13
+ /** servers ∪ clients ∪ {"migration"} — the install-selection set for reference fragments. */
14
+ tokens: ReadonlySet<string>;
15
+ }
16
+ /** A file the assembler emits, path relative to the consumer project root. */
17
+ export interface AssembledFile {
18
+ path: string;
19
+ contents: string;
20
+ }
21
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/agent-context/types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,+DAAgE,CAAC;AAC1F,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,eAAO,MAAM,iBAAiB,2CAA4C,CAAC;AAC3E,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjE,sFAAsF;AACtF,eAAO,MAAM,eAAe,cAAc,CAAC;AAE3C,eAAO,MAAM,WAAW,kIAMd,CAAC;AACX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD,qDAAqD;AACrD,MAAM,WAAW,KAAK;IACpB,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,6FAA6F;IAC7F,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC7B;AAED,8EAA8E;AAC9E,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB"}
@@ -0,0 +1,12 @@
1
+ export const SERVER_LANGS = ["typescript", "java", "kotlin", "csharp", "python"];
2
+ export const CLIENT_FRAMEWORKS = ["react", "tanstack", "angular"];
3
+ /** Always-present token: schema migrations are TS-owned for every port (ADR-0015). */
4
+ export const MIGRATION_TOKEN = "migration";
5
+ export const SKILL_NAMES = [
6
+ "metaobjects-authoring",
7
+ "metaobjects-codegen",
8
+ "metaobjects-runtime-ui",
9
+ "metaobjects-prompts",
10
+ "metaobjects-verify",
11
+ ];
12
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/agent-context/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAC;AAG1F,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,CAAU,CAAC;AAG3E,sFAAsF;AACtF,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC;AAE3C,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,uBAAuB;IACvB,qBAAqB;IACrB,wBAAwB;IACxB,qBAAqB;IACrB,oBAAoB;CACZ,CAAC"}