domain-knowledge-kit 0.2.15 → 0.2.16
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 +4 -0
- package/dist/cli.js +20 -0
- package/dist/cli.js.map +1 -1
- package/dist/features/agent/commands/init.d.ts.map +1 -1
- package/dist/features/agent/commands/init.js +141 -3
- package/dist/features/agent/commands/init.js.map +1 -1
- package/dist/features/agent/commands/prime.d.ts +11 -0
- package/dist/features/agent/commands/prime.d.ts.map +1 -1
- package/dist/features/agent/commands/prime.js +104 -8
- package/dist/features/agent/commands/prime.js.map +1 -1
- package/dist/features/federation/commands/consumers.d.ts +40 -0
- package/dist/features/federation/commands/consumers.d.ts.map +1 -0
- package/dist/features/federation/commands/consumers.js +126 -0
- package/dist/features/federation/commands/consumers.js.map +1 -0
- package/dist/features/federation/commands/peers-add.d.ts +14 -0
- package/dist/features/federation/commands/peers-add.d.ts.map +1 -0
- package/dist/features/federation/commands/peers-add.js +79 -0
- package/dist/features/federation/commands/peers-add.js.map +1 -0
- package/dist/features/federation/commands/peers-list.d.ts +8 -0
- package/dist/features/federation/commands/peers-list.d.ts.map +1 -0
- package/dist/features/federation/commands/peers-list.js +51 -0
- package/dist/features/federation/commands/peers-list.js.map +1 -0
- package/dist/features/federation/commands/peers-status.d.ts +8 -0
- package/dist/features/federation/commands/peers-status.d.ts.map +1 -0
- package/dist/features/federation/commands/peers-status.js +78 -0
- package/dist/features/federation/commands/peers-status.js.map +1 -0
- package/dist/features/federation/commands/pull.d.ts +18 -0
- package/dist/features/federation/commands/pull.d.ts.map +1 -0
- package/dist/features/federation/commands/pull.js +153 -0
- package/dist/features/federation/commands/pull.js.map +1 -0
- package/dist/features/federation/git-fetcher.d.ts +45 -0
- package/dist/features/federation/git-fetcher.d.ts.map +1 -0
- package/dist/features/federation/git-fetcher.js +70 -0
- package/dist/features/federation/git-fetcher.js.map +1 -0
- package/dist/features/federation/loader.d.ts +60 -0
- package/dist/features/federation/loader.d.ts.map +1 -0
- package/dist/features/federation/loader.js +193 -0
- package/dist/features/federation/loader.js.map +1 -0
- package/dist/features/federation/lock.d.ts +12 -0
- package/dist/features/federation/lock.d.ts.map +1 -0
- package/dist/features/federation/lock.js +48 -0
- package/dist/features/federation/lock.js.map +1 -0
- package/dist/features/federation/tests/git-fetcher.test.d.ts +2 -0
- package/dist/features/federation/tests/git-fetcher.test.d.ts.map +1 -0
- package/dist/features/federation/tests/git-fetcher.test.js +167 -0
- package/dist/features/federation/tests/git-fetcher.test.js.map +1 -0
- package/dist/features/federation/tests/loader.test.d.ts +2 -0
- package/dist/features/federation/tests/loader.test.d.ts.map +1 -0
- package/dist/features/federation/tests/loader.test.js +144 -0
- package/dist/features/federation/tests/loader.test.js.map +1 -0
- package/dist/features/federation/tests/phase5.test.d.ts +2 -0
- package/dist/features/federation/tests/phase5.test.d.ts.map +1 -0
- package/dist/features/federation/tests/phase5.test.js +137 -0
- package/dist/features/federation/tests/phase5.test.js.map +1 -0
- package/dist/features/federation/tests/schema-load.test.d.ts +2 -0
- package/dist/features/federation/tests/schema-load.test.d.ts.map +1 -0
- package/dist/features/federation/tests/schema-load.test.js +97 -0
- package/dist/features/federation/tests/schema-load.test.js.map +1 -0
- package/dist/features/federation/tests/validator.test.d.ts +2 -0
- package/dist/features/federation/tests/validator.test.d.ts.map +1 -0
- package/dist/features/federation/tests/validator.test.js +319 -0
- package/dist/features/federation/tests/validator.test.js.map +1 -0
- package/dist/features/mcp/commands/serve.d.ts +10 -0
- package/dist/features/mcp/commands/serve.d.ts.map +1 -0
- package/dist/features/mcp/commands/serve.js +12 -0
- package/dist/features/mcp/commands/serve.js.map +1 -0
- package/dist/features/mcp/server.d.ts +15 -0
- package/dist/features/mcp/server.d.ts.map +1 -0
- package/dist/features/mcp/server.js +438 -0
- package/dist/features/mcp/server.js.map +1 -0
- package/dist/features/pipeline/commands/validate.d.ts.map +1 -1
- package/dist/features/pipeline/commands/validate.js +7 -0
- package/dist/features/pipeline/commands/validate.js.map +1 -1
- package/dist/features/pipeline/indexer.d.ts +28 -2
- package/dist/features/pipeline/indexer.d.ts.map +1 -1
- package/dist/features/pipeline/indexer.js +82 -27
- package/dist/features/pipeline/indexer.js.map +1 -1
- package/dist/features/pipeline/validator.d.ts +10 -0
- package/dist/features/pipeline/validator.d.ts.map +1 -1
- package/dist/features/pipeline/validator.js +274 -27
- package/dist/features/pipeline/validator.js.map +1 -1
- package/dist/features/query/commands/list.d.ts +10 -0
- package/dist/features/query/commands/list.d.ts.map +1 -1
- package/dist/features/query/commands/list.js +1 -1
- package/dist/features/query/commands/list.js.map +1 -1
- package/dist/features/query/commands/locate.d.ts +1 -0
- package/dist/features/query/commands/locate.d.ts.map +1 -1
- package/dist/features/query/commands/locate.js +1 -1
- package/dist/features/query/commands/locate.js.map +1 -1
- package/dist/features/query/commands/search.d.ts.map +1 -1
- package/dist/features/query/commands/search.js +2 -0
- package/dist/features/query/commands/search.js.map +1 -1
- package/dist/features/query/commands/show.d.ts +15 -0
- package/dist/features/query/commands/show.d.ts.map +1 -1
- package/dist/features/query/commands/show.js +116 -58
- package/dist/features/query/commands/show.js.map +1 -1
- package/dist/features/query/commands/story.d.ts +70 -0
- package/dist/features/query/commands/story.d.ts.map +1 -1
- package/dist/features/query/commands/story.js +2 -2
- package/dist/features/query/commands/story.js.map +1 -1
- package/dist/features/query/commands/summary.d.ts +3 -0
- package/dist/features/query/commands/summary.d.ts.map +1 -1
- package/dist/features/query/commands/summary.js +1 -1
- package/dist/features/query/commands/summary.js.map +1 -1
- package/dist/features/query/searcher.d.ts +18 -1
- package/dist/features/query/searcher.d.ts.map +1 -1
- package/dist/features/query/searcher.js +11 -2
- package/dist/features/query/searcher.js.map +1 -1
- package/dist/features/scaffold/commands/service-init.d.ts +12 -0
- package/dist/features/scaffold/commands/service-init.d.ts.map +1 -0
- package/dist/features/scaffold/commands/service-init.js +69 -0
- package/dist/features/scaffold/commands/service-init.js.map +1 -0
- package/dist/shared/graph.d.ts +8 -0
- package/dist/shared/graph.d.ts.map +1 -1
- package/dist/shared/graph.js +180 -112
- package/dist/shared/graph.js.map +1 -1
- package/dist/shared/index.d.ts +4 -1
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +6 -1
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/loader.d.ts +22 -0
- package/dist/shared/loader.d.ts.map +1 -1
- package/dist/shared/loader.js +31 -1
- package/dist/shared/loader.js.map +1 -1
- package/dist/shared/paths.d.ts +59 -7
- package/dist/shared/paths.d.ts.map +1 -1
- package/dist/shared/paths.js +93 -11
- package/dist/shared/paths.js.map +1 -1
- package/dist/shared/refs.d.ts +96 -0
- package/dist/shared/refs.d.ts.map +1 -0
- package/dist/shared/refs.js +182 -0
- package/dist/shared/refs.js.map +1 -0
- package/dist/shared/service-id.d.ts +11 -0
- package/dist/shared/service-id.d.ts.map +1 -0
- package/dist/shared/service-id.js +64 -0
- package/dist/shared/service-id.js.map +1 -0
- package/dist/shared/tests/paths.test.d.ts +2 -0
- package/dist/shared/tests/paths.test.d.ts.map +1 -0
- package/dist/shared/tests/paths.test.js +111 -0
- package/dist/shared/tests/paths.test.js.map +1 -0
- package/dist/shared/tests/refs.test.d.ts +2 -0
- package/dist/shared/tests/refs.test.d.ts.map +1 -0
- package/dist/shared/tests/refs.test.js +104 -0
- package/dist/shared/tests/refs.test.js.map +1 -0
- package/dist/shared/types/domain.d.ts +14 -0
- package/dist/shared/types/domain.d.ts.map +1 -1
- package/dist/shared/types/federation.d.ts +60 -0
- package/dist/shared/types/federation.d.ts.map +1 -0
- package/dist/shared/types/federation.js +12 -0
- package/dist/shared/types/federation.js.map +1 -0
- package/package.json +6 -3
- package/tools/dkk/claude/agents/dkk-domain-reviewer.md +69 -0
- package/tools/dkk/claude/commands/dkk-adr.md +11 -0
- package/tools/dkk/claude/commands/dkk-impact.md +34 -0
- package/tools/dkk/claude/commands/dkk-implement.md +12 -0
- package/tools/dkk/claude/commands/dkk-prime.md +6 -0
- package/tools/dkk/claude/commands/dkk-review.md +12 -0
- package/tools/dkk/claude/commands/dkk-story.md +12 -0
- package/tools/dkk/claude/hooks/post-edit-validate.mjs +51 -0
- package/tools/dkk/claude/hooks/pre-edit-block-generated.mjs +39 -0
- package/tools/dkk/claude/hooks/session-start-prime.mjs +33 -0
- package/tools/dkk/claude/hooks/stop-validate.mjs +48 -0
- package/tools/dkk/claude/settings.json +62 -0
- package/tools/dkk/claude/skills/dkk-adr-author/SKILL.md +54 -0
- package/tools/dkk/claude/skills/dkk-flow-implementer/SKILL.md +51 -0
- package/tools/dkk/claude/skills/dkk-story-analyst/SKILL.md +108 -0
- package/tools/dkk/schema/actors.schema.json +1 -1
- package/tools/dkk/schema/adr-frontmatter.schema.json +4 -4
- package/tools/dkk/schema/aggregate.schema.json +1 -1
- package/tools/dkk/schema/command.schema.json +1 -1
- package/tools/dkk/schema/event.schema.json +1 -1
- package/tools/dkk/schema/federation.schema.json +71 -0
- package/tools/dkk/schema/glossary.schema.json +1 -1
- package/tools/dkk/schema/index.schema.json +2 -2
- package/tools/dkk/schema/policy.schema.json +1 -1
- package/tools/dkk/schema/read-model.schema.json +1 -1
- package/tools/dkk/schema/service.schema.json +30 -0
package/dist/shared/loader.js
CHANGED
|
@@ -20,6 +20,16 @@ import { join, basename, extname } from "node:path";
|
|
|
20
20
|
import { parseYaml } from "./yaml.js";
|
|
21
21
|
import { parseAdrFile } from "./adr-parser.js";
|
|
22
22
|
import { actorsFile, contextsDir, indexFile, adrDir, } from "./paths.js";
|
|
23
|
+
import { loadServiceId } from "./service-id.js";
|
|
24
|
+
let federationHook;
|
|
25
|
+
/**
|
|
26
|
+
* Register a federation hook. Called once at module-init time by the
|
|
27
|
+
* federation slice. Passing `undefined` clears the hook (intended for
|
|
28
|
+
* tests).
|
|
29
|
+
*/
|
|
30
|
+
export function setFederationHook(hook) {
|
|
31
|
+
federationHook = hook;
|
|
32
|
+
}
|
|
23
33
|
// ── Helpers ───────────────────────────────────────────────────────────
|
|
24
34
|
/** Read a YAML file and parse it into `T`. */
|
|
25
35
|
function loadYaml(filePath) {
|
|
@@ -156,11 +166,31 @@ export function loadDomainModel(options = {}) {
|
|
|
156
166
|
adrs.set(record.id, record);
|
|
157
167
|
}
|
|
158
168
|
}
|
|
159
|
-
|
|
169
|
+
// 5. Service identity (federation Phase 1 — optional)
|
|
170
|
+
const service = loadServiceId(root) ?? undefined;
|
|
171
|
+
const model = {
|
|
160
172
|
index,
|
|
161
173
|
actors: actorsData.actors ?? [],
|
|
162
174
|
contexts,
|
|
163
175
|
adrs,
|
|
164
176
|
};
|
|
177
|
+
if (service)
|
|
178
|
+
model.service = service;
|
|
179
|
+
// 6. Federation peers (Phase 2 — optional, one level deep).
|
|
180
|
+
// The federation slice registers itself via `setFederationHook` at
|
|
181
|
+
// module-init time. The hook is suppressed via `followPeers: false`
|
|
182
|
+
// when this loader is itself invoked from inside the federation
|
|
183
|
+
// slice (loading a peer's own model). That keeps peer-of-peer
|
|
184
|
+
// transitivity off without any cycle detection.
|
|
185
|
+
if (options.followPeers !== false && federationHook) {
|
|
186
|
+
try {
|
|
187
|
+
federationHook(root, model);
|
|
188
|
+
}
|
|
189
|
+
catch (err) {
|
|
190
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
191
|
+
console.warn(`dkk: federation load failed: ${msg}`);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return model;
|
|
165
195
|
}
|
|
166
196
|
//# sourceMappingURL=loader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/shared/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAcpD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,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CAAC,CAAC;QACtD,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/shared/paths.d.ts
CHANGED
|
@@ -1,22 +1,52 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Resolve the DKK package installation root.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Computed from `import.meta.url` via `fileURLToPath` instead of
|
|
5
|
+
* `import.meta.dirname` because the latter is undefined under tsx
|
|
6
|
+
* when this module is loaded transitively via `createRequire` (used
|
|
7
|
+
* by the loader's federation hydration). `fileURLToPath(import.meta.url)`
|
|
8
|
+
* works in all loading paths.
|
|
9
|
+
*
|
|
10
|
+
* Running from source (`tsx src/cli.ts`) → resolves to `src/shared`.
|
|
11
|
+
* Running from the compiled output (`dist/shared/`) → `dist/shared`.
|
|
12
|
+
* Both cases go up two levels to reach the package root.
|
|
7
13
|
*
|
|
8
14
|
* Used exclusively for locating package-bundled assets (schemas,
|
|
9
15
|
* templates).
|
|
10
16
|
*/
|
|
11
17
|
export declare function packageRoot(): string;
|
|
18
|
+
/**
|
|
19
|
+
* Walk up the directory tree from `from`, returning the first ancestor
|
|
20
|
+
* that contains a `.dkk/` directory. Returns `null` when none is found.
|
|
21
|
+
*
|
|
22
|
+
* Capped at 64 iterations as a defensive measure against pathological
|
|
23
|
+
* filesystems; normal trees terminate at `/` well before that. The
|
|
24
|
+
* `from` path is resolved to an absolute path before searching.
|
|
25
|
+
*
|
|
26
|
+
* Exposed separately from {@link repoRoot} so other tools (e.g. a
|
|
27
|
+
* future `dkk doctor`) can reuse the search without inheriting
|
|
28
|
+
* `repoRoot`'s override/fallback semantics.
|
|
29
|
+
*/
|
|
30
|
+
export declare function findDkkRoot(from: string): string | null;
|
|
12
31
|
/**
|
|
13
32
|
* Resolve the project root (where `.dkk/` lives).
|
|
14
33
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
34
|
+
* Resolution order:
|
|
35
|
+
* 1. Explicit `override` (the `--root` CLI flag) — used verbatim,
|
|
36
|
+
* no walk-up. This preserves the contract for callers that pass
|
|
37
|
+
* an absolute root and expect it to be used as-is (including
|
|
38
|
+
* pointing at a fresh directory that has no `.dkk/` yet).
|
|
39
|
+
* 2. Walk-up search via {@link findDkkRoot}: if `cwd/.dkk/` exists,
|
|
40
|
+
* return `cwd`. Otherwise walk up the directory tree to the
|
|
41
|
+
* first ancestor containing a `.dkk/`. This makes DKK usable
|
|
42
|
+
* from any sub-directory of a service repo (including monorepos
|
|
43
|
+
* where services live under `services/<name>/`).
|
|
44
|
+
* 3. Fallback: if no `.dkk/` is found on the walk-up path, return
|
|
45
|
+
* `process.cwd()` (matches the historical behaviour, so that
|
|
46
|
+
* scaffold commands which create `.dkk/` in cwd still work).
|
|
17
47
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
48
|
+
* The walk-up can be disabled with `DKK_DISABLE_WALKUP=1` for callers
|
|
49
|
+
* who want the strict legacy behaviour.
|
|
20
50
|
*/
|
|
21
51
|
export declare function repoRoot(override?: string): string;
|
|
22
52
|
/** Absolute path to the `.dkk/domain/` directory. */
|
|
@@ -52,9 +82,31 @@ export declare function schemaDir(): string;
|
|
|
52
82
|
* Used by `dkk init --skills` to copy skill files into a user's project.
|
|
53
83
|
*/
|
|
54
84
|
export declare function packageSkillsDir(): string;
|
|
85
|
+
/**
|
|
86
|
+
* Absolute path to the `tools/dkk/claude/` directory bundled inside the
|
|
87
|
+
* DKK package installation.
|
|
88
|
+
*
|
|
89
|
+
* Holds the Claude Code config template (`settings.json` + hook scripts)
|
|
90
|
+
* used by `dkk init --claude` to scaffold AI-assistant integration in
|
|
91
|
+
* a consumer's repo.
|
|
92
|
+
*/
|
|
93
|
+
export declare function packageClaudeDir(): string;
|
|
55
94
|
/**
|
|
56
95
|
* Turn an absolute path into a repo-relative POSIX path
|
|
57
96
|
* (forward slashes, no leading `./`).
|
|
58
97
|
*/
|
|
59
98
|
export declare function repoRelative(absPath: string, root?: string): string;
|
|
99
|
+
/** Absolute path to `.dkk/service.yml` (service identity manifest). */
|
|
100
|
+
export declare function serviceFile(root?: string): string;
|
|
101
|
+
/** Absolute path to `.dkk/federation.yml` (peer manifest). */
|
|
102
|
+
export declare function federationFile(root?: string): string;
|
|
103
|
+
/** Absolute path to `.dkk/federation.lock.json` (pinned peer SHAs). */
|
|
104
|
+
export declare function federationLockFile(root?: string): string;
|
|
105
|
+
/** Absolute path to `.dkk/imports/` (gitignored peer cache root). */
|
|
106
|
+
export declare function importsDir(root?: string): string;
|
|
107
|
+
/**
|
|
108
|
+
* Absolute path to a single peer's cached repo root under `.dkk/imports/<service>/`.
|
|
109
|
+
* The peer's `.dkk/` lives at `<importedServiceDir>/.dkk/`.
|
|
110
|
+
*/
|
|
111
|
+
export declare function importedServiceDir(service: string, root?: string): string;
|
|
60
112
|
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/shared/paths.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/shared/paths.ts"],"names":[],"mappings":"AAiBA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAWvD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAUlD;AAED,qDAAqD;AACrD,wBAAgB,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,gDAAgD;AAChD,wBAAgB,WAAW,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,iDAAiD;AACjD,wBAAgB,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,gDAAgD;AAChD,wBAAgB,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,oCAAoC;AACpC,wBAAgB,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,uDAAuD;AACvD,wBAAgB,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAEnE;AAID,uEAAuE;AACvE,wBAAgB,WAAW,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,8DAA8D;AAC9D,wBAAgB,cAAc,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,uEAAuE;AACvE,wBAAgB,kBAAkB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,qEAAqE;AACrE,wBAAgB,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAEzE"}
|
package/dist/shared/paths.js
CHANGED
|
@@ -11,34 +11,81 @@
|
|
|
11
11
|
* resolve from `import.meta.dirname` relative to the DKK package
|
|
12
12
|
* install. Schemas and Handlebars templates ship with the package.
|
|
13
13
|
*/
|
|
14
|
-
import { resolve, join, relative } from "node:path";
|
|
14
|
+
import { resolve, join, relative, dirname } from "node:path";
|
|
15
|
+
import { existsSync } from "node:fs";
|
|
16
|
+
import { fileURLToPath } from "node:url";
|
|
15
17
|
/**
|
|
16
18
|
* Resolve the DKK package installation root.
|
|
17
19
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
20
|
+
* Computed from `import.meta.url` via `fileURLToPath` instead of
|
|
21
|
+
* `import.meta.dirname` because the latter is undefined under tsx
|
|
22
|
+
* when this module is loaded transitively via `createRequire` (used
|
|
23
|
+
* by the loader's federation hydration). `fileURLToPath(import.meta.url)`
|
|
24
|
+
* works in all loading paths.
|
|
25
|
+
*
|
|
26
|
+
* Running from source (`tsx src/cli.ts`) → resolves to `src/shared`.
|
|
27
|
+
* Running from the compiled output (`dist/shared/`) → `dist/shared`.
|
|
28
|
+
* Both cases go up two levels to reach the package root.
|
|
21
29
|
*
|
|
22
30
|
* Used exclusively for locating package-bundled assets (schemas,
|
|
23
31
|
* templates).
|
|
24
32
|
*/
|
|
25
33
|
export function packageRoot() {
|
|
26
|
-
|
|
27
|
-
|
|
34
|
+
return resolve(dirname(fileURLToPath(import.meta.url)), "../..");
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Walk up the directory tree from `from`, returning the first ancestor
|
|
38
|
+
* that contains a `.dkk/` directory. Returns `null` when none is found.
|
|
39
|
+
*
|
|
40
|
+
* Capped at 64 iterations as a defensive measure against pathological
|
|
41
|
+
* filesystems; normal trees terminate at `/` well before that. The
|
|
42
|
+
* `from` path is resolved to an absolute path before searching.
|
|
43
|
+
*
|
|
44
|
+
* Exposed separately from {@link repoRoot} so other tools (e.g. a
|
|
45
|
+
* future `dkk doctor`) can reuse the search without inheriting
|
|
46
|
+
* `repoRoot`'s override/fallback semantics.
|
|
47
|
+
*/
|
|
48
|
+
export function findDkkRoot(from) {
|
|
49
|
+
let current = resolve(from);
|
|
50
|
+
for (let i = 0; i < 64; i++) {
|
|
51
|
+
if (existsSync(join(current, ".dkk"))) {
|
|
52
|
+
return current;
|
|
53
|
+
}
|
|
54
|
+
const parent = dirname(current);
|
|
55
|
+
if (parent === current)
|
|
56
|
+
return null;
|
|
57
|
+
current = parent;
|
|
58
|
+
}
|
|
59
|
+
return null;
|
|
28
60
|
}
|
|
29
61
|
/**
|
|
30
62
|
* Resolve the project root (where `.dkk/` lives).
|
|
31
63
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
64
|
+
* Resolution order:
|
|
65
|
+
* 1. Explicit `override` (the `--root` CLI flag) — used verbatim,
|
|
66
|
+
* no walk-up. This preserves the contract for callers that pass
|
|
67
|
+
* an absolute root and expect it to be used as-is (including
|
|
68
|
+
* pointing at a fresh directory that has no `.dkk/` yet).
|
|
69
|
+
* 2. Walk-up search via {@link findDkkRoot}: if `cwd/.dkk/` exists,
|
|
70
|
+
* return `cwd`. Otherwise walk up the directory tree to the
|
|
71
|
+
* first ancestor containing a `.dkk/`. This makes DKK usable
|
|
72
|
+
* from any sub-directory of a service repo (including monorepos
|
|
73
|
+
* where services live under `services/<name>/`).
|
|
74
|
+
* 3. Fallback: if no `.dkk/` is found on the walk-up path, return
|
|
75
|
+
* `process.cwd()` (matches the historical behaviour, so that
|
|
76
|
+
* scaffold commands which create `.dkk/` in cwd still work).
|
|
34
77
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
78
|
+
* The walk-up can be disabled with `DKK_DISABLE_WALKUP=1` for callers
|
|
79
|
+
* who want the strict legacy behaviour.
|
|
37
80
|
*/
|
|
38
81
|
export function repoRoot(override) {
|
|
39
82
|
if (override)
|
|
40
83
|
return resolve(override);
|
|
41
|
-
|
|
84
|
+
const cwd = resolve(process.cwd());
|
|
85
|
+
if (process.env.DKK_DISABLE_WALKUP === "1") {
|
|
86
|
+
return cwd;
|
|
87
|
+
}
|
|
88
|
+
return findDkkRoot(cwd) ?? cwd;
|
|
42
89
|
}
|
|
43
90
|
/** Absolute path to the `.dkk/domain/` directory. */
|
|
44
91
|
export function domainDir(root) {
|
|
@@ -91,6 +138,17 @@ export function schemaDir() {
|
|
|
91
138
|
export function packageSkillsDir() {
|
|
92
139
|
return join(packageRoot(), ".github", "skills");
|
|
93
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* Absolute path to the `tools/dkk/claude/` directory bundled inside the
|
|
143
|
+
* DKK package installation.
|
|
144
|
+
*
|
|
145
|
+
* Holds the Claude Code config template (`settings.json` + hook scripts)
|
|
146
|
+
* used by `dkk init --claude` to scaffold AI-assistant integration in
|
|
147
|
+
* a consumer's repo.
|
|
148
|
+
*/
|
|
149
|
+
export function packageClaudeDir() {
|
|
150
|
+
return join(packageRoot(), "tools", "dkk", "claude");
|
|
151
|
+
}
|
|
94
152
|
/**
|
|
95
153
|
* Turn an absolute path into a repo-relative POSIX path
|
|
96
154
|
* (forward slashes, no leading `./`).
|
|
@@ -98,4 +156,28 @@ export function packageSkillsDir() {
|
|
|
98
156
|
export function repoRelative(absPath, root) {
|
|
99
157
|
return relative(repoRoot(root), absPath).replace(/\\/g, "/");
|
|
100
158
|
}
|
|
159
|
+
// ── Federation paths ─────────────────────────────────────────────────
|
|
160
|
+
/** Absolute path to `.dkk/service.yml` (service identity manifest). */
|
|
161
|
+
export function serviceFile(root) {
|
|
162
|
+
return join(repoRoot(root), ".dkk", "service.yml");
|
|
163
|
+
}
|
|
164
|
+
/** Absolute path to `.dkk/federation.yml` (peer manifest). */
|
|
165
|
+
export function federationFile(root) {
|
|
166
|
+
return join(repoRoot(root), ".dkk", "federation.yml");
|
|
167
|
+
}
|
|
168
|
+
/** Absolute path to `.dkk/federation.lock.json` (pinned peer SHAs). */
|
|
169
|
+
export function federationLockFile(root) {
|
|
170
|
+
return join(repoRoot(root), ".dkk", "federation.lock.json");
|
|
171
|
+
}
|
|
172
|
+
/** Absolute path to `.dkk/imports/` (gitignored peer cache root). */
|
|
173
|
+
export function importsDir(root) {
|
|
174
|
+
return join(repoRoot(root), ".dkk", "imports");
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Absolute path to a single peer's cached repo root under `.dkk/imports/<service>/`.
|
|
178
|
+
* The peer's `.dkk/` lives at `<importedServiceDir>/.dkk/`.
|
|
179
|
+
*/
|
|
180
|
+
export function importedServiceDir(service, root) {
|
|
181
|
+
return join(importsDir(root), service);
|
|
182
|
+
}
|
|
101
183
|
//# sourceMappingURL=paths.js.map
|
package/dist/shared/paths.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/shared/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/shared/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;AACnE,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,IAAI,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5B,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;YACtC,OAAO,OAAO,CAAC;QACj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AED,uEAAuE;AACvE,MAAM,UAAU,kBAAkB,CAAC,IAAa;IAC9C,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,sBAAsB,CAAC,CAAC;AAC9D,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,UAAU,CAAC,IAAa;IACtC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;AACjD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAe,EAAE,IAAa;IAC/D,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reference parsing — single source of truth for DKK item-id grammar.
|
|
3
|
+
*
|
|
4
|
+
* IDs identify domain items, actors, ADRs, flows, and contexts. The
|
|
5
|
+
* grammar is additive: an optional `<service>:` prefix may be attached
|
|
6
|
+
* to any id to federate it across repos. Bare refs stay local-only.
|
|
7
|
+
*
|
|
8
|
+
* Forms:
|
|
9
|
+
* <ctx>.<Name> → context-scoped item
|
|
10
|
+
* actor.<Name> → actor
|
|
11
|
+
* adr-NNNN → ADR
|
|
12
|
+
* flow.<Name> → cross-context flow
|
|
13
|
+
* context.<name> → bounded context itself
|
|
14
|
+
* <service>:<any of above> → federated form
|
|
15
|
+
*/
|
|
16
|
+
/** Discriminated union over the five id shapes. */
|
|
17
|
+
export type ParsedRef = {
|
|
18
|
+
kind: "item";
|
|
19
|
+
service?: string;
|
|
20
|
+
context: string;
|
|
21
|
+
name: string;
|
|
22
|
+
} | {
|
|
23
|
+
kind: "adr";
|
|
24
|
+
service?: string;
|
|
25
|
+
id: string;
|
|
26
|
+
} | {
|
|
27
|
+
kind: "actor";
|
|
28
|
+
service?: string;
|
|
29
|
+
name: string;
|
|
30
|
+
} | {
|
|
31
|
+
kind: "flow";
|
|
32
|
+
service?: string;
|
|
33
|
+
name: string;
|
|
34
|
+
} | {
|
|
35
|
+
kind: "context";
|
|
36
|
+
service?: string;
|
|
37
|
+
name: string;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Parse a ref string into its structured form. Returns `null` for
|
|
41
|
+
* inputs that do not match any of the five shapes.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* parseRef("ordering.OrderPlaced")
|
|
45
|
+
* // → { kind: "item", context: "ordering", name: "OrderPlaced" }
|
|
46
|
+
*
|
|
47
|
+
* parseRef("payments:billing.PaymentCaptured")
|
|
48
|
+
* // → { kind: "item", service: "payments", context: "billing", name: "PaymentCaptured" }
|
|
49
|
+
*
|
|
50
|
+
* parseRef("adr-0001")
|
|
51
|
+
* // → { kind: "adr", id: "adr-0001" }
|
|
52
|
+
*
|
|
53
|
+
* parseRef("ordering:adr-0007")
|
|
54
|
+
* // → { kind: "adr", service: "ordering", id: "adr-0007" }
|
|
55
|
+
*/
|
|
56
|
+
export declare function parseRef(s: string): ParsedRef | null;
|
|
57
|
+
/**
|
|
58
|
+
* Result of qualifying a name-only or partial ref into its canonical
|
|
59
|
+
* graph/index id form. Used by the indexer and graph builders to
|
|
60
|
+
* produce service-prefixed ids consistently.
|
|
61
|
+
*/
|
|
62
|
+
export interface QualifiedRef {
|
|
63
|
+
/** Canonical id (e.g. `ordering.OrderPlaced` or `payments:billing.PaymentCaptured`). */
|
|
64
|
+
id: string;
|
|
65
|
+
/** Bounded-context name, when the ref names a context-scoped item. */
|
|
66
|
+
context?: string;
|
|
67
|
+
/** Item / actor / flow / context name as written. */
|
|
68
|
+
name: string;
|
|
69
|
+
/** True when the ref points at a service different from the walk prefix. */
|
|
70
|
+
isForeign: boolean;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Qualify a bare-or-federated item ref into a canonical id form.
|
|
74
|
+
*
|
|
75
|
+
* Three input shapes are handled:
|
|
76
|
+
* - Author-qualified federated form (`<svc>:<ctx>.<Name>`) → kept as-is,
|
|
77
|
+
* marked foreign whenever it differs from `walkPrefix`.
|
|
78
|
+
* - Author-qualified context form (`<ctx>.<Name>`, no service) →
|
|
79
|
+
* gets `walkPrefix` applied so peer walks namespace it correctly.
|
|
80
|
+
* - Bare PascalCase name (`Name`) → resolved as a name in
|
|
81
|
+
* `currentContext`, then prefixed with `walkPrefix`.
|
|
82
|
+
*
|
|
83
|
+
* `walkPrefix` is `""` for local walks and `"<peerName>:"` for peer
|
|
84
|
+
* walks. The function leaves any already-prefixed ref untouched so
|
|
85
|
+
* a peer's own author-written federated refs survive the prefix pass.
|
|
86
|
+
*/
|
|
87
|
+
export declare function qualifyItemRef(raw: string, walkPrefix: string, currentContext: string): QualifiedRef;
|
|
88
|
+
/**
|
|
89
|
+
* Qualify a bare-or-federated actor ref. Actor ids use the
|
|
90
|
+
* `actor.<Name>` form (no context). Federated form is
|
|
91
|
+
* `<service>:actor.<Name>`. Bare YAML form is just `<Name>`.
|
|
92
|
+
*/
|
|
93
|
+
export declare function qualifyActorRef(raw: string, walkPrefix: string): QualifiedRef;
|
|
94
|
+
/** Serialize a {@link ParsedRef} back into its canonical string form. */
|
|
95
|
+
export declare function formatRef(r: ParsedRef): string;
|
|
96
|
+
//# sourceMappingURL=refs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refs.d.ts","sourceRoot":"","sources":["../../src/shared/refs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AASH,mDAAmD;AACnD,MAAM,MAAM,SAAS,GACjB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACjE;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAC7C;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACjD;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAChD;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAExD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAgDpD;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,wFAAwF;IACxF,EAAE,EAAE,MAAM,CAAC;IACX,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,GACrB,YAAY,CAqCd;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,YAAY,CAuB7E;AAED,yEAAyE;AACzE,wBAAgB,SAAS,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CAc9C"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reference parsing — single source of truth for DKK item-id grammar.
|
|
3
|
+
*
|
|
4
|
+
* IDs identify domain items, actors, ADRs, flows, and contexts. The
|
|
5
|
+
* grammar is additive: an optional `<service>:` prefix may be attached
|
|
6
|
+
* to any id to federate it across repos. Bare refs stay local-only.
|
|
7
|
+
*
|
|
8
|
+
* Forms:
|
|
9
|
+
* <ctx>.<Name> → context-scoped item
|
|
10
|
+
* actor.<Name> → actor
|
|
11
|
+
* adr-NNNN → ADR
|
|
12
|
+
* flow.<Name> → cross-context flow
|
|
13
|
+
* context.<name> → bounded context itself
|
|
14
|
+
* <service>:<any of above> → federated form
|
|
15
|
+
*/
|
|
16
|
+
/** Kebab-case service / context identifier. */
|
|
17
|
+
const KEBAB = /^[a-z][a-z0-9-]*$/;
|
|
18
|
+
/** PascalCase item name (events, commands, etc.). */
|
|
19
|
+
const PASCAL = /^[A-Za-z][A-Za-z0-9]*$/;
|
|
20
|
+
/** ADR id pattern (`adr-NNNN`). */
|
|
21
|
+
const ADR_ID = /^adr-\d{4}$/;
|
|
22
|
+
/**
|
|
23
|
+
* Parse a ref string into its structured form. Returns `null` for
|
|
24
|
+
* inputs that do not match any of the five shapes.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* parseRef("ordering.OrderPlaced")
|
|
28
|
+
* // → { kind: "item", context: "ordering", name: "OrderPlaced" }
|
|
29
|
+
*
|
|
30
|
+
* parseRef("payments:billing.PaymentCaptured")
|
|
31
|
+
* // → { kind: "item", service: "payments", context: "billing", name: "PaymentCaptured" }
|
|
32
|
+
*
|
|
33
|
+
* parseRef("adr-0001")
|
|
34
|
+
* // → { kind: "adr", id: "adr-0001" }
|
|
35
|
+
*
|
|
36
|
+
* parseRef("ordering:adr-0007")
|
|
37
|
+
* // → { kind: "adr", service: "ordering", id: "adr-0007" }
|
|
38
|
+
*/
|
|
39
|
+
export function parseRef(s) {
|
|
40
|
+
if (typeof s !== "string" || s.length === 0)
|
|
41
|
+
return null;
|
|
42
|
+
// Peel off optional service prefix.
|
|
43
|
+
let service;
|
|
44
|
+
let body = s;
|
|
45
|
+
const colon = s.indexOf(":");
|
|
46
|
+
if (colon > 0) {
|
|
47
|
+
const svc = s.slice(0, colon);
|
|
48
|
+
if (!KEBAB.test(svc))
|
|
49
|
+
return null;
|
|
50
|
+
service = svc;
|
|
51
|
+
body = s.slice(colon + 1);
|
|
52
|
+
if (body.length === 0)
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
// ADR: "adr-NNNN"
|
|
56
|
+
if (ADR_ID.test(body)) {
|
|
57
|
+
return { kind: "adr", service, id: body };
|
|
58
|
+
}
|
|
59
|
+
// Special-prefix forms: "actor.X", "flow.X", "context.X"
|
|
60
|
+
if (body.startsWith("actor.")) {
|
|
61
|
+
const name = body.slice("actor.".length);
|
|
62
|
+
if (!PASCAL.test(name))
|
|
63
|
+
return null;
|
|
64
|
+
return { kind: "actor", service, name };
|
|
65
|
+
}
|
|
66
|
+
if (body.startsWith("flow.")) {
|
|
67
|
+
const name = body.slice("flow.".length);
|
|
68
|
+
if (name.length === 0)
|
|
69
|
+
return null;
|
|
70
|
+
return { kind: "flow", service, name };
|
|
71
|
+
}
|
|
72
|
+
if (body.startsWith("context.")) {
|
|
73
|
+
const name = body.slice("context.".length);
|
|
74
|
+
if (!KEBAB.test(name))
|
|
75
|
+
return null;
|
|
76
|
+
return { kind: "context", service, name };
|
|
77
|
+
}
|
|
78
|
+
// Generic context-scoped item: "<ctx>.<Name>"
|
|
79
|
+
const dot = body.indexOf(".");
|
|
80
|
+
if (dot > 0) {
|
|
81
|
+
const ctx = body.slice(0, dot);
|
|
82
|
+
const name = body.slice(dot + 1);
|
|
83
|
+
if (KEBAB.test(ctx) && PASCAL.test(name)) {
|
|
84
|
+
return { kind: "item", service, context: ctx, name };
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Qualify a bare-or-federated item ref into a canonical id form.
|
|
91
|
+
*
|
|
92
|
+
* Three input shapes are handled:
|
|
93
|
+
* - Author-qualified federated form (`<svc>:<ctx>.<Name>`) → kept as-is,
|
|
94
|
+
* marked foreign whenever it differs from `walkPrefix`.
|
|
95
|
+
* - Author-qualified context form (`<ctx>.<Name>`, no service) →
|
|
96
|
+
* gets `walkPrefix` applied so peer walks namespace it correctly.
|
|
97
|
+
* - Bare PascalCase name (`Name`) → resolved as a name in
|
|
98
|
+
* `currentContext`, then prefixed with `walkPrefix`.
|
|
99
|
+
*
|
|
100
|
+
* `walkPrefix` is `""` for local walks and `"<peerName>:"` for peer
|
|
101
|
+
* walks. The function leaves any already-prefixed ref untouched so
|
|
102
|
+
* a peer's own author-written federated refs survive the prefix pass.
|
|
103
|
+
*/
|
|
104
|
+
export function qualifyItemRef(raw, walkPrefix, currentContext) {
|
|
105
|
+
const parsed = parseRef(raw);
|
|
106
|
+
if (parsed?.kind === "item" && parsed.service) {
|
|
107
|
+
// Author-qualified federated form: `<svc>:<ctx>.<Name>`.
|
|
108
|
+
return {
|
|
109
|
+
id: `${parsed.service}:${parsed.context}.${parsed.name}`,
|
|
110
|
+
context: parsed.context,
|
|
111
|
+
name: parsed.name,
|
|
112
|
+
isForeign: walkPrefix !== `${parsed.service}:`,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
if (parsed?.kind === "item") {
|
|
116
|
+
// Author-qualified context form (`<ctx>.<Name>`, no service).
|
|
117
|
+
return {
|
|
118
|
+
id: `${walkPrefix}${parsed.context}.${parsed.name}`,
|
|
119
|
+
context: parsed.context,
|
|
120
|
+
name: parsed.name,
|
|
121
|
+
isForeign: false,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
// Bare name fallback (`OrderPlaced` in YAML inter-item refs such as
|
|
125
|
+
// raised_by, handles.commands, when.events, …).
|
|
126
|
+
if (raw.includes(":")) {
|
|
127
|
+
// Author wrote a colon but it didn't parse as `<svc>:<ctx>.<Name>`.
|
|
128
|
+
// Leave as-is so the caller can surface a clear "malformed" error
|
|
129
|
+
// elsewhere; treat as foreign so the prefix isn't applied.
|
|
130
|
+
return { id: raw, name: raw, isForeign: true };
|
|
131
|
+
}
|
|
132
|
+
return {
|
|
133
|
+
id: `${walkPrefix}${currentContext}.${raw}`,
|
|
134
|
+
context: currentContext,
|
|
135
|
+
name: raw,
|
|
136
|
+
isForeign: false,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Qualify a bare-or-federated actor ref. Actor ids use the
|
|
141
|
+
* `actor.<Name>` form (no context). Federated form is
|
|
142
|
+
* `<service>:actor.<Name>`. Bare YAML form is just `<Name>`.
|
|
143
|
+
*/
|
|
144
|
+
export function qualifyActorRef(raw, walkPrefix) {
|
|
145
|
+
const parsed = parseRef(raw);
|
|
146
|
+
if (parsed?.kind === "actor" && parsed.service) {
|
|
147
|
+
return {
|
|
148
|
+
id: `${parsed.service}:actor.${parsed.name}`,
|
|
149
|
+
name: parsed.name,
|
|
150
|
+
isForeign: walkPrefix !== `${parsed.service}:`,
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
if (parsed?.kind === "actor") {
|
|
154
|
+
return {
|
|
155
|
+
id: `${walkPrefix}actor.${parsed.name}`,
|
|
156
|
+
name: parsed.name,
|
|
157
|
+
isForeign: false,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
// Bare PascalCase actor name (the dominant case in YAML).
|
|
161
|
+
if (raw.includes(":")) {
|
|
162
|
+
return { id: raw, name: raw, isForeign: true };
|
|
163
|
+
}
|
|
164
|
+
return { id: `${walkPrefix}actor.${raw}`, name: raw, isForeign: false };
|
|
165
|
+
}
|
|
166
|
+
/** Serialize a {@link ParsedRef} back into its canonical string form. */
|
|
167
|
+
export function formatRef(r) {
|
|
168
|
+
const prefix = r.service ? `${r.service}:` : "";
|
|
169
|
+
switch (r.kind) {
|
|
170
|
+
case "item":
|
|
171
|
+
return `${prefix}${r.context}.${r.name}`;
|
|
172
|
+
case "adr":
|
|
173
|
+
return `${prefix}${r.id}`;
|
|
174
|
+
case "actor":
|
|
175
|
+
return `${prefix}actor.${r.name}`;
|
|
176
|
+
case "flow":
|
|
177
|
+
return `${prefix}flow.${r.name}`;
|
|
178
|
+
case "context":
|
|
179
|
+
return `${prefix}context.${r.name}`;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C,CAAC,CAAC,EAAE,CAAC;IAChD,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;QACf,KAAK,MAAM;YACT,OAAO,GAAG,MAAM,GAAG,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;QAC3C,KAAK,KAAK;YACR,OAAO,GAAG,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC;QAC5B,KAAK,OAAO;YACV,OAAO,GAAG,MAAM,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC;QACpC,KAAK,MAAM;YACT,OAAO,GAAG,MAAM,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;QACnC,KAAK,SAAS;YACZ,OAAO,GAAG,MAAM,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC;IACxC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ServiceManifest } from "./types/federation.js";
|
|
2
|
+
/**
|
|
3
|
+
* Load `.dkk/service.yml` from the given root (or auto-detected root).
|
|
4
|
+
* Returns the parsed manifest, or `null` if the file does not exist.
|
|
5
|
+
*
|
|
6
|
+
* Throws when the file exists but does not conform to
|
|
7
|
+
* `service.schema.json` — the message includes Ajv's error list so
|
|
8
|
+
* the user can fix the manifest directly.
|
|
9
|
+
*/
|
|
10
|
+
export declare function loadServiceId(root?: string): ServiceManifest | null;
|
|
11
|
+
//# sourceMappingURL=service-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-id.d.ts","sourceRoot":"","sources":["../../src/shared/service-id.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AA0B7D;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAkBnE"}
|