@pbuilder/sdk 0.19.0 → 0.21.0

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 (68) hide show
  1. package/README.md +81 -38
  2. package/dist/acl/irwire/stdio-engine-client.d.ts +1 -0
  3. package/dist/acl/irwire/stdio-engine-client.js +9 -0
  4. package/dist/bin/pbuilder-codegen.js +90 -18
  5. package/dist/bounded-contexts/authoring/application/usecases/authoring-verbs/index.d.ts +15 -0
  6. package/dist/bounded-contexts/authoring/application/usecases/authoring-verbs/index.js +17 -0
  7. package/dist/bounded-contexts/authoring/application/usecases/run-factory/context.d.ts +16 -3
  8. package/dist/bounded-contexts/authoring/application/usecases/run-factory/context.js +45 -11
  9. package/dist/bounded-contexts/authoring/domain/aggregates/session/session.d.ts +3 -1
  10. package/dist/bounded-contexts/authoring/domain/aggregates/session/session.js +10 -1
  11. package/dist/bounded-contexts/authoring/domain/ports/engine-client.d.ts +1 -0
  12. package/dist/bounded-contexts/authoring/domain/services/define-dialect.d.ts +28 -1
  13. package/dist/bounded-contexts/authoring/domain/services/define-dialect.js +27 -3
  14. package/dist/bounded-contexts/authoring/domain/services/evaluation.d.ts +29 -0
  15. package/dist/bounded-contexts/authoring/domain/services/evaluation.js +43 -0
  16. package/dist/bounded-contexts/authoring/domain/services/glob-match.d.ts +4 -0
  17. package/dist/bounded-contexts/authoring/domain/services/glob-match.js +81 -0
  18. package/dist/bounded-contexts/authoring/domain/services/schema/input-rejection.d.ts +1 -0
  19. package/dist/bounded-contexts/authoring/domain/services/schema/input-rejection.js +4 -0
  20. package/dist/bounded-contexts/authoring/domain/services/schema/schema-validate.d.ts +2 -1
  21. package/dist/bounded-contexts/authoring/domain/services/schema/schema-validate.js +6 -2
  22. package/dist/bounded-contexts/authoring/domain/valueobjects/findings.d.ts +12 -0
  23. package/dist/bounded-contexts/authoring/domain/valueobjects/findings.js +57 -0
  24. package/dist/bounded-contexts/authoring/domain/valueobjects/schema-model.d.ts +2 -0
  25. package/dist/bounded-contexts/authoring/infrastructure/in/codegen/cli.d.ts +7 -2
  26. package/dist/bounded-contexts/authoring/infrastructure/in/codegen/cli.js +28 -7
  27. package/dist/bounded-contexts/authoring/infrastructure/in/codegen/emit-type.d.ts +6 -2
  28. package/dist/bounded-contexts/authoring/infrastructure/in/codegen/emit-type.js +23 -13
  29. package/dist/bounded-contexts/authoring/infrastructure/in/codegen/project-codegen.d.ts +1 -0
  30. package/dist/bounded-contexts/authoring/infrastructure/in/codegen/project-codegen.js +5 -2
  31. package/dist/bounded-contexts/authoring/infrastructure/in/commons/index.d.ts +2 -1
  32. package/dist/bounded-contexts/authoring/infrastructure/in/commons/index.js +1 -1
  33. package/dist/bounded-contexts/authoring/infrastructure/out/dialects/angular/index.d.ts +14 -1
  34. package/dist/bounded-contexts/authoring/infrastructure/out/dialects/angular/index.js +15 -0
  35. package/dist/bounded-contexts/authoring/infrastructure/out/dialects/aspnet/index.d.ts +14 -1
  36. package/dist/bounded-contexts/authoring/infrastructure/out/dialects/aspnet/index.js +15 -0
  37. package/dist/bounded-contexts/authoring/infrastructure/out/dialects/csharp/index.d.ts +14 -1
  38. package/dist/bounded-contexts/authoring/infrastructure/out/dialects/csharp/index.js +15 -0
  39. package/dist/bounded-contexts/authoring/infrastructure/out/dialects/css/index.d.ts +14 -1
  40. package/dist/bounded-contexts/authoring/infrastructure/out/dialects/css/index.js +15 -0
  41. package/dist/bounded-contexts/authoring/infrastructure/out/dialects/json/index.d.ts +14 -1
  42. package/dist/bounded-contexts/authoring/infrastructure/out/dialects/json/index.js +15 -0
  43. package/dist/bounded-contexts/authoring/infrastructure/out/dialects/msbuild/index.d.ts +14 -1
  44. package/dist/bounded-contexts/authoring/infrastructure/out/dialects/msbuild/index.js +15 -0
  45. package/dist/bounded-contexts/authoring/infrastructure/out/dialects/nestjs/index.d.ts +14 -1
  46. package/dist/bounded-contexts/authoring/infrastructure/out/dialects/nestjs/index.js +15 -0
  47. package/dist/bounded-contexts/authoring/infrastructure/out/dialects/react/index.d.ts +14 -1
  48. package/dist/bounded-contexts/authoring/infrastructure/out/dialects/react/index.js +15 -0
  49. package/dist/bounded-contexts/authoring/infrastructure/out/dialects/typescript/index.d.ts +14 -1
  50. package/dist/bounded-contexts/authoring/infrastructure/out/dialects/typescript/index.js +15 -0
  51. package/dist/bounded-contexts/authoring/infrastructure/out/dialects/yaml/index.d.ts +14 -1
  52. package/dist/bounded-contexts/authoring/infrastructure/out/dialects/yaml/index.js +15 -0
  53. package/dist/bounded-contexts/authoring/testing/contract-fake.d.ts +1 -0
  54. package/dist/bounded-contexts/authoring/testing/contract-fake.js +8 -0
  55. package/dist/bounded-contexts/authoring/testing/glob-pattern.d.ts +5 -0
  56. package/dist/bounded-contexts/authoring/testing/glob-pattern.js +20 -0
  57. package/dist/bounded-contexts/authoring/testing/harness/index.d.ts +8 -0
  58. package/dist/bounded-contexts/authoring/testing/harness/index.js +12 -1
  59. package/dist/bounded-contexts/authoring/testing/run-vehicle.d.ts +1 -0
  60. package/dist/bounded-contexts/authoring/testing/run-vehicle.js +4 -0
  61. package/dist/bounded-contexts/runner-hosting/infrastructure/in/bootstrap-bridge.d.ts +3 -0
  62. package/dist/bounded-contexts/runner-hosting/infrastructure/in/bootstrap-bridge.js +4 -0
  63. package/dist/bounded-contexts/runner-hosting/infrastructure/in/runner.js +15 -3
  64. package/dist/runner-manifest.json +33 -9
  65. package/dist/shared-kernel/wire-protocol.d.ts +1 -1
  66. package/dist/shared-kernel/wire-protocol.js +1 -1
  67. package/package.json +1 -1
  68. package/schemas/project-builder.schema.json +75 -2
@@ -68,3 +68,18 @@ const yamlDialect = withOps(baseDialect, opsPack);
68
68
  export function find(path) {
69
69
  return yamlDialect.find(path);
70
70
  }
71
+ /**
72
+ * Opens every file `pattern` matches that this dialect edits, ordered by path; a file of any
73
+ * other extension is left out without an error (A-132). Resolves `[]` when none matches. The
74
+ * pattern syntax and `ignore` are commons `glob`'s, and it sees the run as `find` does.
75
+ *
76
+ * @example
77
+ * import * as yaml from "@pbuilder/sdk/yaml";
78
+ *
79
+ * export const run = async () => {
80
+ * for (const file of await yaml.glob("**\/*.{yml,yaml}")) await file.read();
81
+ * };
82
+ */
83
+ export function glob(pattern, options) {
84
+ return yamlDialect.glob(pattern, options);
85
+ }
@@ -14,4 +14,5 @@ export declare class ContractFake implements EngineClient {
14
14
  committedTree(): ReadonlyMap<string, string>;
15
15
  stagingTree(): ReadonlyMap<string, string>;
16
16
  read(filePath: string): Promise<string | undefined>;
17
+ list(pattern: string, ignore?: readonly string[]): Promise<readonly string[]>;
17
18
  }
@@ -8,6 +8,7 @@ import { posix as path } from "node:path";
8
8
  import { exceedsEmitBatchBudget } from "../domain/valueobjects/wire.js";
9
9
  import { EMIT_BATCH_BUDGET_BYTES, EMIT_FRAME_ENVELOPE_ALLOWANCE_BYTES } from "../../../shared-kernel/batch-cap.js";
10
10
  import { EmitRejection } from "../domain/ports/emit-rejection.js";
11
+ import { listMatching } from "./glob-pattern.js";
11
12
  import { deepEqual } from "../../../platform/deep-equal.js";
12
13
  import { CONTRACT_FAKE_PREFIX, ALREADY_EXISTS, USE_FORCE_TO_OVERWRITE, NOT_FOUND, EXCEEDS_SIZE_CAP, ROUND_TRIP_FIDELITY_CHECK, JSON_SERIALIZATION, } from "./rejection-messages.js";
13
14
  export class ContractFake {
@@ -98,6 +99,13 @@ export class ContractFake {
98
99
  }
99
100
  return undefined;
100
101
  }
102
+ // Sees staging as read() does: staged and seeded paths, minus the deleted ones.
103
+ async list(pattern, ignore) {
104
+ const present = new Set([...Object.keys(this.#seed), ...this.#tree.keys()]);
105
+ for (const p of this.#deleted)
106
+ present.delete(p);
107
+ return listMatching(present, pattern, ignore);
108
+ }
101
109
  #exists(p) {
102
110
  if (this.#deleted.has(p))
103
111
  return false;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * The paths among `files` that `pattern` matches and no `ignore` pattern does, sorted bytewise.
3
+ * Every alternative of `pattern` must stay inside the workspace, as the engine's gate requires.
4
+ */
5
+ export declare function listMatching(files: Iterable<string>, pattern: string, ignore?: readonly string[]): string[];
@@ -0,0 +1,20 @@
1
+ // The listing the in-memory engines answer `list` with, matching as the engine's `tree.list` does.
2
+ import { posix } from "node:path";
3
+ import { alternatives, globMatcher } from "../domain/services/glob-match.js";
4
+ /**
5
+ * The paths among `files` that `pattern` matches and no `ignore` pattern does, sorted bytewise.
6
+ * Every alternative of `pattern` must stay inside the workspace, as the engine's gate requires.
7
+ */
8
+ export function listMatching(files, pattern, ignore = []) {
9
+ for (const alternative of alternatives(pattern)) {
10
+ const normalized = posix.normalize(alternative);
11
+ if (posix.isAbsolute(alternative) || normalized === ".." || normalized.startsWith("../")) {
12
+ throw new Error("path escapes workspace");
13
+ }
14
+ }
15
+ const matches = globMatcher(pattern);
16
+ const ignored = ignore.map(globMatcher);
17
+ return [...files]
18
+ .filter((path) => matches(path) && !ignored.some((ignores) => ignores(path)))
19
+ .sort((a, b) => Buffer.compare(Buffer.from(a), Buffer.from(b)));
20
+ }
@@ -1,5 +1,6 @@
1
1
  import type { Batch, Directive } from "../../domain/valueobjects/wire.ts";
2
2
  import type { AuthoringError } from "../../domain/valueobjects/authoring-error.ts";
3
+ import type { Role } from "../../domain/valueobjects/findings.ts";
3
4
  /**
4
5
  * The outcome of running a factory via `runFactoryForTest`.
5
6
  *
@@ -65,6 +66,11 @@ export type { Batch, Directive };
65
66
  * `packageDir` at all.
66
67
  * @param options.declaredDialects - the names of the author-defined dialects the schematic's
67
68
  * library declares in its Manifest; a handle of any other named dialect fails the run (A-16).
69
+ * @param options.role - the role the schematic declares in its Collection definition entry. With
70
+ * `evaluation`, `fn` returns its Findings and `result.result` holds them as they leave the
71
+ * schematic: each with its `source`, and only those inside the scope `include` and `exclude` name.
72
+ * @param options.name - the qualified name `collection:schematic` of the schematic, which an
73
+ * evaluation's findings carry as their `source`; required with the role `evaluation`.
68
74
  *
69
75
  * @example
70
76
  * import { runFactoryForTest } from "@pbuilder/sdk/testing";
@@ -95,4 +101,6 @@ export declare function runFactoryForTest<O, R = void>(fn: (input: O) => R | Pro
95
101
  seed?: Record<string, string>;
96
102
  packageDir?: string | URL;
97
103
  declaredDialects?: readonly string[];
104
+ role?: Role;
105
+ name?: string;
98
106
  }): Promise<RunResult<R>>;
@@ -29,6 +29,11 @@ import { nodePackageFiles } from "../../infrastructure/out/fs/package-files.js";
29
29
  * `packageDir` at all.
30
30
  * @param options.declaredDialects - the names of the author-defined dialects the schematic's
31
31
  * library declares in its Manifest; a handle of any other named dialect fails the run (A-16).
32
+ * @param options.role - the role the schematic declares in its Collection definition entry. With
33
+ * `evaluation`, `fn` returns its Findings and `result.result` holds them as they leave the
34
+ * schematic: each with its `source`, and only those inside the scope `include` and `exclude` name.
35
+ * @param options.name - the qualified name `collection:schematic` of the schematic, which an
36
+ * evaluation's findings carry as their `source`; required with the role `evaluation`.
32
37
  *
33
38
  * @example
34
39
  * import { runFactoryForTest } from "@pbuilder/sdk/testing";
@@ -56,6 +61,9 @@ import { nodePackageFiles } from "../../infrastructure/out/fs/package-files.js";
56
61
  * });
57
62
  */
58
63
  export async function runFactoryForTest(fn, input, options) {
64
+ if (options?.role === "evaluation" && options.name === undefined) {
65
+ throw new Error("runFactoryForTest: an evaluation factory needs options.name, the qualified name collection:schematic");
66
+ }
59
67
  const fake = new ContractFake({ seed: options?.seed ?? {} });
60
68
  const emitted = [];
61
69
  const reads = new Map();
@@ -69,6 +77,9 @@ export async function runFactoryForTest(fn, input, options) {
69
77
  reads.set(path, (reads.get(path) ?? 0) + 1);
70
78
  return fake.read(path);
71
79
  },
80
+ list(pattern, ignore) {
81
+ return fake.list(pattern, ignore);
82
+ },
72
83
  commit(result) {
73
84
  committed = result;
74
85
  return fake.commit();
@@ -82,7 +93,7 @@ export async function runFactoryForTest(fn, input, options) {
82
93
  : { declaredDialects: options?.declaredDialects });
83
94
  let error;
84
95
  try {
85
- await run(input, { client });
96
+ await run(input, { client, role: options?.role, name: options?.name });
86
97
  }
87
98
  catch (caught) {
88
99
  error = caught;
@@ -3,6 +3,7 @@ import type { Batch } from "../domain/valueobjects/wire.ts";
3
3
  interface RunVehicleClient {
4
4
  emit(batch: Batch): Promise<void>;
5
5
  read(path: string): Promise<string | undefined>;
6
+ list(pattern: string, ignore?: readonly string[]): Promise<readonly string[]>;
6
7
  commit(): Promise<void>;
7
8
  discard(): Promise<void>;
8
9
  }
@@ -16,6 +16,7 @@
16
16
  // its allow-list is exactly one path, and this is not it). The port shape is satisfied via a
17
17
  // LOCAL structural type instead — the same sanctioned pattern `src/testing/index.ts`'s facade
18
18
  // uses for its own spy-wrapping.
19
+ import { listMatching } from "./glob-pattern.js";
19
20
  function applyDirective(tree, directive) {
20
21
  if (directive.op === "create") {
21
22
  tree.set(directive.create.pathTemplate, directive.create.template);
@@ -91,6 +92,9 @@ export function createRunVehicle(seed) {
91
92
  async read(path) {
92
93
  return tree.get(path);
93
94
  },
95
+ async list(pattern, ignore) {
96
+ return listMatching(tree.keys(), pattern, ignore);
97
+ },
94
98
  async commit() {
95
99
  // Nothing to promote — this vehicle applies eagerly on emit (no staging/committed
96
100
  // distinction; each exercise is a fresh, single-purpose, single-run instance whose
@@ -15,6 +15,9 @@ export interface BridgeParams {
15
15
  input: BridgeInput;
16
16
  /** The Frame's declared dialects (A-16, CA-5); absent means none. */
17
17
  dialects?: readonly DeclaredDialect[];
18
+ /** The root's role and qualified name (CA-19); absent when the engine has none to pass. */
19
+ role?: string;
20
+ name?: string;
18
21
  }
19
22
  export interface BridgeIo {
20
23
  input: RunnerIo["input"];
@@ -46,6 +46,10 @@ function toArgv(params) {
46
46
  argv.push("--input-file", params.input.path);
47
47
  if (params.dialects !== undefined)
48
48
  argv.push("--dialects", JSON.stringify(params.dialects));
49
+ if (params.role !== undefined)
50
+ argv.push("--role", params.role);
51
+ if (params.name !== undefined)
52
+ argv.push("--name", params.name);
49
53
  return argv;
50
54
  }
51
55
  /**
@@ -91,13 +91,16 @@ function parseDialects(value) {
91
91
  return dialects;
92
92
  }
93
93
  // REQ-RUN-01: `--factory <url>#<export>` required; exactly one of `--input <json>` XOR
94
- // `--input-file <path>`; `--dialects <json>` optional, absent meaning none declared; any
95
- // unrecognized flag fails closed.
94
+ // `--input-file <path>`; `--dialects <json>` optional, absent meaning none declared; `--role`
95
+ // and `--name` optional, the root's role and qualified name the engine passes unread (CA-19);
96
+ // any unrecognized flag fails closed.
96
97
  function parseArgv(argv) {
97
98
  let factory;
98
99
  let inputJson;
99
100
  let inputFile;
100
101
  let dialects = [];
102
+ let role;
103
+ let name;
101
104
  for (let i = 0; i < argv.length; i += 2) {
102
105
  const flag = argv[i];
103
106
  const value = argv[i + 1];
@@ -116,6 +119,10 @@ function parseArgv(argv) {
116
119
  return { error: DIALECTS_SHAPE };
117
120
  dialects = declared;
118
121
  }
122
+ else if (flag === "--role")
123
+ role = value;
124
+ else if (flag === "--name")
125
+ name = value;
119
126
  else
120
127
  return { error: composeWithToken("pbuilder-runner: unrecognized flag ", flag) };
121
128
  }
@@ -127,9 +134,14 @@ function parseArgv(argv) {
127
134
  if (inputJson === undefined && inputFile === undefined) {
128
135
  return { error: "pbuilder-runner: exactly one of --input or --input-file is required" };
129
136
  }
137
+ if (role === "evaluation" && name === undefined) {
138
+ return { error: "pbuilder-runner: --role evaluation needs --name, the qualified name collection:schematic" };
139
+ }
130
140
  return {
131
141
  factory,
132
142
  dialects,
143
+ role,
144
+ name,
133
145
  input: inputJson !== undefined ? { kind: "inline", json: inputJson } : { kind: "file", path: inputFile },
134
146
  };
135
147
  }
@@ -385,7 +397,7 @@ async function runRunnerBody(argv, io, opened) {
385
397
  };
386
398
  const client = new StdioEngineClient(channel);
387
399
  try {
388
- await run(resolvedInput.value, { client });
400
+ await run(resolvedInput.value, { client, role: parsed.role, name: parsed.name });
389
401
  return 0;
390
402
  }
391
403
  catch (err) {
@@ -2,7 +2,7 @@
2
2
  "manifestVersion": 1,
3
3
  "algorithm": "sha256",
4
4
  "entry": "dist/bin/pbuilder-runner.js",
5
- "packageVersion": "0.19.0",
5
+ "packageVersion": "0.21.0",
6
6
  "files": [
7
7
  {
8
8
  "path": "dist/acl/irwire/frame-reader.js",
@@ -10,7 +10,7 @@
10
10
  },
11
11
  {
12
12
  "path": "dist/acl/irwire/stdio-engine-client.js",
13
- "sha256": "a7b8f09a1c2c63c90d605d28f4376a2772504bb7b89b8e2ea46ba5b103ce63fe"
13
+ "sha256": "0708fe083ad447fe69fa97c8512072c4fe957f34c073919adc2337c7687d60a9"
14
14
  },
15
15
  {
16
16
  "path": "dist/bin/pbuilder-runner.js",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  {
20
20
  "path": "dist/bounded-contexts/authoring/application/usecases/run-factory/context.js",
21
- "sha256": "a2521108c576a7b3dfcda1bd05cdd6547f01a53c51b930b3d891d7d36f0ecf07"
21
+ "sha256": "0be3b6041f3588e8ee9a37d224fa5009e4a1dc3a11239b0a7f257b229dc2d230"
22
22
  },
23
23
  {
24
24
  "path": "dist/bounded-contexts/authoring/application/usecases/run-factory/driving.js",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  {
28
28
  "path": "dist/bounded-contexts/authoring/domain/aggregates/session/session.js",
29
- "sha256": "d766298100d79ee9d3f2486cb36a951d0950a507b87564a48d3f9f17e4624be1"
29
+ "sha256": "93605d869fcde9292acc77370b3a5a0df52ff84f1ce9b7023f0a44a8a1b19c39"
30
30
  },
31
31
  {
32
32
  "path": "dist/bounded-contexts/authoring/domain/ports/emit-rejection.js",
@@ -40,13 +40,21 @@
40
40
  "path": "dist/bounded-contexts/authoring/domain/services/directive-factory.js",
41
41
  "sha256": "e3718b19c6609139f36d562daa44a4727d0d6d279a90736aa24722ab5df93d92"
42
42
  },
43
+ {
44
+ "path": "dist/bounded-contexts/authoring/domain/services/evaluation.js",
45
+ "sha256": "c309775ce55a3858f7804835154a15d17f38736db3abf91ed2c7b5563cbc2b8a"
46
+ },
47
+ {
48
+ "path": "dist/bounded-contexts/authoring/domain/services/glob-match.js",
49
+ "sha256": "1518f8ba27114e34a7d0103015934ec98acf09718dc29a59655bbbef71148950"
50
+ },
43
51
  {
44
52
  "path": "dist/bounded-contexts/authoring/domain/services/run-context.js",
45
53
  "sha256": "4c45aa26aa81b2ec59a6b09dbaf14da7be6d034bfc46e2b35aba2bfe0e641a49"
46
54
  },
47
55
  {
48
56
  "path": "dist/bounded-contexts/authoring/domain/services/schema/input-rejection.js",
49
- "sha256": "31aacefce17622b2b6fd22af8834311c69e6a8c95afdf079bcee04c2a4d06a28"
57
+ "sha256": "fb7789824d3d387b796ea303f8d8dde9e9ae3aad2cfcb7226333ecc51e2fe898"
50
58
  },
51
59
  {
52
60
  "path": "dist/bounded-contexts/authoring/domain/services/schema/schema-files.js",
@@ -62,12 +70,16 @@
62
70
  },
63
71
  {
64
72
  "path": "dist/bounded-contexts/authoring/domain/services/schema/schema-validate.js",
65
- "sha256": "ba0da0e1feec8c74a14992ad720e44b53088e5e2c9866e31168ec9dcd492fd6d"
73
+ "sha256": "bfafc4c94a9208b51621db29ad97fbdb8b48cddeabfe60ca78bf77c07450674d"
66
74
  },
67
75
  {
68
76
  "path": "dist/bounded-contexts/authoring/domain/valueobjects/authoring-error.js",
69
77
  "sha256": "12bcb05ddffaade8ba3cadea33c30d469909e9c034415554456a1e4a765bfd19"
70
78
  },
79
+ {
80
+ "path": "dist/bounded-contexts/authoring/domain/valueobjects/findings.js",
81
+ "sha256": "ddf9fa8688938ef11066de0e45916c2fa8d159fcd261b5d6641f74105730bc5f"
82
+ },
71
83
  {
72
84
  "path": "dist/bounded-contexts/authoring/domain/valueobjects/schema-model.js",
73
85
  "sha256": "6d015200921c8a72ef27941d287d460275bc944620ee9a7c140ad73354bbfc82"
@@ -94,7 +106,7 @@
94
106
  },
95
107
  {
96
108
  "path": "dist/bounded-contexts/runner-hosting/infrastructure/in/runner.js",
97
- "sha256": "78aee0804a9fe9b110821a41dfb171dab635708c6220ad5aba986e167109ed50"
109
+ "sha256": "c2eceb3d4373d03b4782276fd9bef2a49f7048a52671f8a9225adac28309bf78"
98
110
  },
99
111
  {
100
112
  "path": "dist/bounded-contexts/runner-hosting/infrastructure/in/single-instance-probe.js",
@@ -118,11 +130,23 @@
118
130
  },
119
131
  {
120
132
  "path": "dist/shared-kernel/wire-protocol.js",
121
- "sha256": "99f9965f655042b8724f04de798894bad7f2b4d517f3f9c2f61acc5bfe4be457"
133
+ "sha256": "4668d233d209ad77d5205ffc66b19e79f680b5d9856e8a5f51e563a85211ebd6"
122
134
  },
123
135
  {
124
136
  "path": "package.json",
125
- "sha256": "19ccb4ace24caa2a75a77a044363d75601cdd64465a66e89601920a45d1bfc88"
137
+ "sha256": "25620cd1ab23de4c32c12bd6118fc0ef21efb2edc4bc3651669bd34d78ee461b"
126
138
  }
139
+ ],
140
+ "dialects": [
141
+ "angular",
142
+ "aspnet",
143
+ "csharp",
144
+ "css",
145
+ "json",
146
+ "msbuild",
147
+ "nestjs",
148
+ "react",
149
+ "typescript",
150
+ "yaml"
127
151
  ]
128
152
  }
@@ -1,6 +1,6 @@
1
1
  export declare const WIRE_PROTOCOL_VERSION = 1;
2
2
  export declare const BRIDGE_CONTRACT_VERSION = 1;
3
- export declare const REVERSE_CALLBACK_METHODS: readonly ["tree.read", "ir.emit", "ir.commit", "ir.discard"];
3
+ export declare const REVERSE_CALLBACK_METHODS: readonly ["tree.read", "tree.list", "ir.emit", "ir.commit", "ir.discard"];
4
4
  export type ReverseMethod = (typeof REVERSE_CALLBACK_METHODS)[number];
5
5
  export interface ReadyGreeting {
6
6
  method: "ready";
@@ -2,7 +2,7 @@
2
2
  // guards (WPS-02/03/05/09). design.md § 4.3 Data Model gives these signatures verbatim.
3
3
  export const WIRE_PROTOCOL_VERSION = 1; // ready.protocolVersion (transport) — DISTINCT from Batch.protocolVersion (IR)
4
4
  export const BRIDGE_CONTRACT_VERSION = 1; // in-process JS bridge; independent of the wire (BRB-01)
5
- export const REVERSE_CALLBACK_METHODS = ["tree.read", "ir.emit", "ir.commit", "ir.discard"];
5
+ export const REVERSE_CALLBACK_METHODS = ["tree.read", "tree.list", "ir.emit", "ir.commit", "ir.discard"];
6
6
  // REQ-WPS-02.3: structural validity is method === "ready" plus an integer protocolVersion —
7
7
  // no other shape (missing field, wrong type, non-integer version) qualifies.
8
8
  export function isStructurallyValidGreeting(value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pbuilder/sdk",
3
- "version": "0.19.0",
3
+ "version": "0.21.0",
4
4
  "description": "The public TypeScript/Bun authoring layer for Project Builder schematics. Authors file mutations (create, replaceContent, remove, rename, move, copy, copyIn), lowers them to IR, and talks to the Project Builder engine over framed stdio (see docs/engine-sdk-wire-spec.md).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -24,10 +24,57 @@
24
24
  ]
25
25
  }
26
26
  },
27
+ "externals": {
28
+ "type": "object",
29
+ "description": "External collections the workspace depends on, keyed by package name.",
30
+ "additionalProperties": { "$ref": "#/$defs/externalDeclaration" }
31
+ },
27
32
  "dependencies": {
28
33
  "type": "object",
29
- "description": "Package names mapped to semver ranges.",
30
- "additionalProperties": { "type": "string" }
34
+ "deprecated": true,
35
+ "description": "Deprecated alias of externals; the CLI reads it as externals with a warning, and refuses a Manifest that holds both.",
36
+ "additionalProperties": { "$ref": "#/$defs/externalDeclaration" }
37
+ },
38
+ "dialects": {
39
+ "type": "object",
40
+ "description": "Author-defined dialects, keyed by name: a published dialect's package name, or a local dialect's name.",
41
+ "additionalProperties": {
42
+ "oneOf": [
43
+ {
44
+ "allOf": [{ "$ref": "#/$defs/publishedDeclaration" }],
45
+ "not": { "anyOf": [{ "required": ["path"] }, { "required": ["conformance"] }] },
46
+ "description": "A published dialect, installed from its registry."
47
+ },
48
+ {
49
+ "type": "object",
50
+ "required": ["path"],
51
+ "not": { "anyOf": [{ "required": ["registry"] }, { "required": ["range"] }] },
52
+ "description": "A local dialect, read where it lies in the workspace.",
53
+ "properties": {
54
+ "path": {
55
+ "type": "string",
56
+ "description": "Workspace-relative path to the dialect's base file, inside a folder of the workspace."
57
+ },
58
+ "conformance": {
59
+ "type": "string",
60
+ "description": "Workspace-relative path to the file exporting the dialect's conformance fixture data, inside the folder of its base file."
61
+ }
62
+ }
63
+ }
64
+ ]
65
+ }
66
+ },
67
+ "glob": {
68
+ "type": "object",
69
+ "description": "Settings for finding many files.",
70
+ "properties": {
71
+ "exclude": {
72
+ "type": "array",
73
+ "items": { "type": "string", "minLength": 1 },
74
+ "description": "Patterns every listing of a Run leaves out.",
75
+ "examples": [[".git/**", "node_modules/**"]]
76
+ }
77
+ }
31
78
  },
32
79
  "settings": {
33
80
  "type": "object",
@@ -74,6 +121,32 @@
74
121
  }
75
122
  },
76
123
  "$defs": {
124
+ "publishedDeclaration": {
125
+ "type": "object",
126
+ "required": ["registry", "range"],
127
+ "properties": {
128
+ "registry": {
129
+ "type": "string",
130
+ "pattern": "^[a-z][a-z0-9-]*$",
131
+ "description": "The ecosystem id the package comes from; its URL and credentials come from the ecosystem's own configuration.",
132
+ "examples": ["npm"]
133
+ },
134
+ "range": {
135
+ "type": "string",
136
+ "description": "The semver range the package may resolve to.",
137
+ "examples": ["^1.2.0"]
138
+ }
139
+ }
140
+ },
141
+ "externalDeclaration": {
142
+ "allOf": [{ "$ref": "#/$defs/publishedDeclaration" }],
143
+ "properties": {
144
+ "alias": {
145
+ "type": "string",
146
+ "description": "Another name the workspace addresses the library by; it shares one namespace with every other name in the Manifest (CA-6)."
147
+ }
148
+ }
149
+ },
77
150
  "collectionPointer": {
78
151
  "type": "object",
79
152
  "required": ["path"],