@xenosystem/agent-interface-core 0.1.3

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 (122) hide show
  1. package/LICENSE +67 -0
  2. package/dist/agentDiscovery.d.ts +97 -0
  3. package/dist/agentDiscovery.d.ts.map +1 -0
  4. package/dist/agentDiscovery.js +93 -0
  5. package/dist/agentDiscovery.js.map +1 -0
  6. package/dist/capabilityRouting.d.ts +72 -0
  7. package/dist/capabilityRouting.d.ts.map +1 -0
  8. package/dist/capabilityRouting.js +124 -0
  9. package/dist/capabilityRouting.js.map +1 -0
  10. package/dist/capabilityTier.d.ts +105 -0
  11. package/dist/capabilityTier.d.ts.map +1 -0
  12. package/dist/capabilityTier.js +120 -0
  13. package/dist/capabilityTier.js.map +1 -0
  14. package/dist/combinationVerification.d.ts +101 -0
  15. package/dist/combinationVerification.d.ts.map +1 -0
  16. package/dist/combinationVerification.js +115 -0
  17. package/dist/combinationVerification.js.map +1 -0
  18. package/dist/context/agentAttachedContextPrompt.d.ts +13 -0
  19. package/dist/context/agentAttachedContextPrompt.d.ts.map +1 -0
  20. package/dist/context/agentAttachedContextPrompt.js +50 -0
  21. package/dist/context/agentAttachedContextPrompt.js.map +1 -0
  22. package/dist/context/agentModelContext.d.ts +77 -0
  23. package/dist/context/agentModelContext.d.ts.map +1 -0
  24. package/dist/context/agentModelContext.js +297 -0
  25. package/dist/context/agentModelContext.js.map +1 -0
  26. package/dist/fanOutPlanner.d.ts +65 -0
  27. package/dist/fanOutPlanner.d.ts.map +1 -0
  28. package/dist/fanOutPlanner.js +78 -0
  29. package/dist/fanOutPlanner.js.map +1 -0
  30. package/dist/fleetBoardProjection.d.ts +143 -0
  31. package/dist/fleetBoardProjection.d.ts.map +1 -0
  32. package/dist/fleetBoardProjection.js +156 -0
  33. package/dist/fleetBoardProjection.js.map +1 -0
  34. package/dist/fleetProjection.d.ts +63 -0
  35. package/dist/fleetProjection.d.ts.map +1 -0
  36. package/dist/fleetProjection.js +86 -0
  37. package/dist/fleetProjection.js.map +1 -0
  38. package/dist/hostBackedCapabilities.d.ts +50 -0
  39. package/dist/hostBackedCapabilities.d.ts.map +1 -0
  40. package/dist/hostBackedCapabilities.js +66 -0
  41. package/dist/hostBackedCapabilities.js.map +1 -0
  42. package/dist/index.d.ts +54 -0
  43. package/dist/index.d.ts.map +1 -0
  44. package/dist/index.js +134 -0
  45. package/dist/index.js.map +1 -0
  46. package/dist/intakeBoardProjection.d.ts +75 -0
  47. package/dist/intakeBoardProjection.d.ts.map +1 -0
  48. package/dist/intakeBoardProjection.js +90 -0
  49. package/dist/intakeBoardProjection.js.map +1 -0
  50. package/dist/intakeClaim.d.ts +156 -0
  51. package/dist/intakeClaim.d.ts.map +1 -0
  52. package/dist/intakeClaim.js +190 -0
  53. package/dist/intakeClaim.js.map +1 -0
  54. package/dist/knowledgeBoardProjection.d.ts +57 -0
  55. package/dist/knowledgeBoardProjection.d.ts.map +1 -0
  56. package/dist/knowledgeBoardProjection.js +74 -0
  57. package/dist/knowledgeBoardProjection.js.map +1 -0
  58. package/dist/landingOverlap.d.ts +127 -0
  59. package/dist/landingOverlap.d.ts.map +1 -0
  60. package/dist/landingOverlap.js +107 -0
  61. package/dist/landingOverlap.js.map +1 -0
  62. package/dist/landingQueue.d.ts +152 -0
  63. package/dist/landingQueue.d.ts.map +1 -0
  64. package/dist/landingQueue.js +258 -0
  65. package/dist/landingQueue.js.map +1 -0
  66. package/dist/markdown/markdownWindowsPaths.d.ts +20 -0
  67. package/dist/markdown/markdownWindowsPaths.d.ts.map +1 -0
  68. package/dist/markdown/markdownWindowsPaths.js +208 -0
  69. package/dist/markdown/markdownWindowsPaths.js.map +1 -0
  70. package/dist/reviewProjection.d.ts +118 -0
  71. package/dist/reviewProjection.d.ts.map +1 -0
  72. package/dist/reviewProjection.js +133 -0
  73. package/dist/reviewProjection.js.map +1 -0
  74. package/dist/runDiff.d.ts +86 -0
  75. package/dist/runDiff.d.ts.map +1 -0
  76. package/dist/runDiff.js +103 -0
  77. package/dist/runDiff.js.map +1 -0
  78. package/dist/runtime/agentReasoningEffort.d.ts +22 -0
  79. package/dist/runtime/agentReasoningEffort.d.ts.map +1 -0
  80. package/dist/runtime/agentReasoningEffort.js +76 -0
  81. package/dist/runtime/agentReasoningEffort.js.map +1 -0
  82. package/dist/runtime/agentRuntimeProvider.d.ts +12 -0
  83. package/dist/runtime/agentRuntimeProvider.d.ts.map +1 -0
  84. package/dist/runtime/agentRuntimeProvider.js +294 -0
  85. package/dist/runtime/agentRuntimeProvider.js.map +1 -0
  86. package/dist/runtime/agentRuntimeProviderTypes.d.ts +100 -0
  87. package/dist/runtime/agentRuntimeProviderTypes.d.ts.map +1 -0
  88. package/dist/runtime/agentRuntimeProviderTypes.js +2 -0
  89. package/dist/runtime/agentRuntimeProviderTypes.js.map +1 -0
  90. package/dist/runtime/conversationRuntime.d.ts +53 -0
  91. package/dist/runtime/conversationRuntime.d.ts.map +1 -0
  92. package/dist/runtime/conversationRuntime.js +207 -0
  93. package/dist/runtime/conversationRuntime.js.map +1 -0
  94. package/dist/runtime/legacyAgentRuntimeEvents.d.ts +65 -0
  95. package/dist/runtime/legacyAgentRuntimeEvents.d.ts.map +1 -0
  96. package/dist/runtime/legacyAgentRuntimeEvents.js +104 -0
  97. package/dist/runtime/legacyAgentRuntimeEvents.js.map +1 -0
  98. package/dist/runtimeProjection.d.ts +19 -0
  99. package/dist/runtimeProjection.d.ts.map +1 -0
  100. package/dist/runtimeProjection.js +133 -0
  101. package/dist/runtimeProjection.js.map +1 -0
  102. package/dist/sessionBoardProjection.d.ts +84 -0
  103. package/dist/sessionBoardProjection.d.ts.map +1 -0
  104. package/dist/sessionBoardProjection.js +103 -0
  105. package/dist/sessionBoardProjection.js.map +1 -0
  106. package/dist/sessionMode.d.ts +115 -0
  107. package/dist/sessionMode.d.ts.map +1 -0
  108. package/dist/sessionMode.js +98 -0
  109. package/dist/sessionMode.js.map +1 -0
  110. package/dist/workspace/workspaceSelectionContinuation.d.ts +8 -0
  111. package/dist/workspace/workspaceSelectionContinuation.d.ts.map +1 -0
  112. package/dist/workspace/workspaceSelectionContinuation.js +18 -0
  113. package/dist/workspace/workspaceSelectionContinuation.js.map +1 -0
  114. package/dist/workspaceKnowledge.d.ts +90 -0
  115. package/dist/workspaceKnowledge.d.ts.map +1 -0
  116. package/dist/workspaceKnowledge.js +103 -0
  117. package/dist/workspaceKnowledge.js.map +1 -0
  118. package/dist/writeLease.d.ts +92 -0
  119. package/dist/writeLease.d.ts.map +1 -0
  120. package/dist/writeLease.js +108 -0
  121. package/dist/writeLease.js.map +1 -0
  122. package/package.json +29 -0
@@ -0,0 +1,133 @@
1
+ /**
2
+ * What a review surface is allowed to SHOW — §2.9 and §5.7, as a projection.
3
+ *
4
+ * Pure, and in `core` rather than in a component, because every rule here is a
5
+ * statement about honesty rather than about layout, and the honesty is the part
6
+ * that must not depend on someone remembering it while writing JSX.
7
+ * `packages/ui` holds `toolCardProjection` for the same reason — a projection
8
+ * kept out of the component that renders it.
9
+ *
10
+ * ⚠️ This sentence used to say `core` holds it. It does not; it is in
11
+ * `packages/ui`. Corrected rather than left, because a wrong pointer in a
12
+ * doc comment sends the next reader to the wrong package.
13
+ *
14
+ * ## 🔴 The rule the whole module exists for
15
+ *
16
+ * **An incomplete diff must never be presented as a review.** §2.9's claim is
17
+ * that tier 1 yields a real diff; a diff that quietly omits changes is worse
18
+ * than no diff, because a reviewer reads "3 files changed" and approves. So an
19
+ * incomplete snapshot projects to a state a surface cannot render as an ordinary
20
+ * file list — not to a list with a warning beside it, which is a thing people
21
+ * learn to skip past.
22
+ *
23
+ * ## Unobserved is not empty
24
+ *
25
+ * "This run changed nothing" and "nobody was watching" produce the same zero
26
+ * changes and mean opposite things. They are separate states here, and the
27
+ * second is not a variant of the first.
28
+ */
29
+ export function projectReview(snapshot, overlaps) {
30
+ if (!snapshot.available) {
31
+ return {
32
+ runId: snapshot.runId,
33
+ status: 'unobserved',
34
+ changes: [],
35
+ counts: { added: 0, modified: 0, deleted: 0, contested: 0 },
36
+ notice: snapshot.reason ?? 'This run is not being observed, so there is nothing to review.',
37
+ trustworthy: false,
38
+ };
39
+ }
40
+ // Contested paths come from the OVERLAP report rather than being recomputed:
41
+ // two implementations of "did these runs collide" is how the answers diverge.
42
+ const contested = new Set();
43
+ if (overlaps?.available) {
44
+ for (const overlap of overlaps.overlaps) {
45
+ if (overlap.runIds.includes(snapshot.runId))
46
+ contested.add(overlap.path);
47
+ }
48
+ }
49
+ const changes = snapshot.changes.map((change) => ({
50
+ path: change.path,
51
+ kind: change.kind,
52
+ ...(contested.has(change.path) ? { contested: true } : {}),
53
+ }));
54
+ const counts = {
55
+ added: changes.filter((change) => change.kind === 'added').length,
56
+ modified: changes.filter((change) => change.kind === 'modified').length,
57
+ deleted: changes.filter((change) => change.kind === 'deleted').length,
58
+ contested: changes.filter((change) => change.contested).length,
59
+ };
60
+ if (!snapshot.complete) {
61
+ return {
62
+ runId: snapshot.runId,
63
+ status: 'incomplete',
64
+ changes,
65
+ counts,
66
+ notice: incompleteNotice(snapshot),
67
+ // The load-bearing line. Everything else in this module is presentation;
68
+ // this is the claim a surface must not make on an incomplete diff.
69
+ trustworthy: false,
70
+ };
71
+ }
72
+ if (changes.length === 0) {
73
+ return {
74
+ runId: snapshot.runId,
75
+ status: 'clean',
76
+ changes: [],
77
+ counts,
78
+ notice: 'This run changed nothing in the observed directories.',
79
+ trustworthy: true,
80
+ };
81
+ }
82
+ return { runId: snapshot.runId, status: 'reviewable', changes, counts, trustworthy: true };
83
+ }
84
+ function incompleteNotice(snapshot) {
85
+ // Dropped events are the definitive incompleteness: those changes exist on
86
+ // disk and are absent from this diff forever. Said first, and with the number,
87
+ // because "some changes may be missing" is not actionable and "412 changes
88
+ // were missed" is.
89
+ if (snapshot.droppedEvents > 0) {
90
+ return `${snapshot.droppedEvents} change${snapshot.droppedEvents === 1 ? '' : 's'} were missed and are not in this diff. Do not treat it as the whole story.`;
91
+ }
92
+ const first = snapshot.problems[0];
93
+ return first
94
+ ? `This diff is incomplete: ${first}`
95
+ : 'This diff is known to be incomplete. Do not treat it as the whole story.';
96
+ }
97
+ export function projectLanding(input) {
98
+ if (!input.available) {
99
+ return {
100
+ rows: [],
101
+ couldLand: false,
102
+ notice: input.reason ?? 'This host has no landing queue, so nothing can be landed from here.',
103
+ };
104
+ }
105
+ const rows = input.entries.map((entry) => ({
106
+ runId: entry.runId,
107
+ state: entry.state,
108
+ ...(entry.position === undefined ? {} : { positionLabel: ordinal(entry.position) }),
109
+ ...(entry.reason === undefined ? {} : { reason: entry.reason }),
110
+ // A refused or failed run is actionable — a human can fix and requeue it.
111
+ // A landing one is not: interrupting it is what the single-slot rule exists
112
+ // to prevent.
113
+ actionable: entry.state === 'refused' || entry.state === 'failed' || entry.state === 'queued',
114
+ }));
115
+ const head = rows.find((row) => row.state === 'queued');
116
+ return {
117
+ rows,
118
+ ...(input.landing ? { landing: input.landing } : {}),
119
+ couldLand: Boolean(head) && !input.landing,
120
+ ...(input.landing
121
+ ? { notice: `${input.landing} is landing. One run lands at a time, so the verified combination is the one that lands.` }
122
+ : rows.length === 0
123
+ ? { notice: 'Nothing is waiting to land.' }
124
+ : {}),
125
+ };
126
+ }
127
+ function ordinal(position) {
128
+ const suffix = position % 100 >= 11 && position % 100 <= 13
129
+ ? 'th'
130
+ : ['th', 'st', 'nd', 'rd'][position % 10] ?? 'th';
131
+ return `${position}${suffix} in line`;
132
+ }
133
+ //# sourceMappingURL=reviewProjection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reviewProjection.js","sourceRoot":"","sources":["../src/reviewProjection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAsDH,MAAM,UAAU,aAAa,CAC3B,QAA6B,EAC7B,QAA8B;IAE9B,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;QACxB,OAAO;YACL,KAAK,EAAE,QAAQ,CAAC,KAA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AAC,CAAC,EAAE,CAAC;QACpD,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO;QAC1C,GAAG,CAAC,KAAK,CAAC,OAAO;YACf,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,OAAO,0FAA0F,EAAE;YACxH,CAAC,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC;gBACjB,CAAC,CAAC,EAAE,MAAM,EAAE,6BAA6B,EAAE;gBAC3C,CAAC,CAAC,EAAE,CAAC;KACV,CAAA;AACH,CAAC;AAED,SAAS,OAAO,CAAC,QAAgB;IAC/B,MAAM,MAAM,GAAG,QAAQ,GAAG,GAAG,IAAI,EAAE,IAAI,QAAQ,GAAG,GAAG,IAAI,EAAE;QACzD,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,QAAQ,GAAG,EAAE,CAAC,IAAI,IAAI,CAAA;IACnD,OAAO,GAAG,QAAQ,GAAG,MAAM,UAAU,CAAA;AACvC,CAAC"}
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Continuous diff against a run's baseline — ADE spec §2.9, tier 1.
3
+ *
4
+ * > "from the sandbox filesystem: every create, write and delete with
5
+ * > before/after content; **a real diff against the run's baseline, computed
6
+ * > continuously**; hunk-level review, which needs the changes and not the
7
+ * > agent's narration."
8
+ *
9
+ * This is the engine behind the tier-1 review capability, and it is also §9b's
10
+ * fourth load component — the last one unmeasured, and the only one where the
11
+ * case for a Rust host could still be won, because it is the one that scales
12
+ * with repository size rather than with agent count.
13
+ *
14
+ * ## An event log is not a diff
15
+ *
16
+ * The whole difficulty is that the filesystem stream describes WHAT HAPPENED
17
+ * while a reviewer needs to know WHAT IS DIFFERENT. Those disagree constantly:
18
+ *
19
+ * - create then delete → **nothing changed**, not "added" followed by "deleted".
20
+ * A diff listing the added file sends a reviewer to a path that does not
21
+ * exist.
22
+ * - delete then create → **modified**, if the file was in the baseline. Reported
23
+ * as "added" it implies the original is gone when it was replaced.
24
+ * - modify a file the baseline never had → **added**. It was created before the
25
+ * watcher attached, or created and then written; either way "modified"
26
+ * describes a prior version that never existed.
27
+ * - many writes → **one** modified entry. A reviewer counting events would read
28
+ * an agent that saved often as an agent that changed more.
29
+ *
30
+ * Each of those is a case where replaying events verbatim produces a confident,
31
+ * wrong answer — which is worse than no diff, because a reviewer acts on it.
32
+ *
33
+ * ## Baseline membership, not content hashes
34
+ *
35
+ * The baseline is the set of paths that existed when the run started. Content
36
+ * hashing is deliberately out of scope here: it belongs where the bytes live
37
+ * (the sandbox), and pulling contents into this layer would make a pure,
38
+ * cheap state machine depend on I/O — the thing that makes it measurable for
39
+ * §9b in the first place.
40
+ */
41
+ /** The tier-1 filesystem event, mirroring `xeno-use`'s shape.
42
+ *
43
+ * Redeclared rather than imported: this package is provider-neutral and must not
44
+ * depend on the isolation substrate. The three kinds are the substrate's whole
45
+ * vocabulary, so the coupling is a shape, not a dependency. */
46
+ export type RunFileEventKind = 'created' | 'modified' | 'removed';
47
+ export interface RunFileEvent {
48
+ kind: RunFileEventKind;
49
+ /** Container-relative path, as the sandbox reports it. */
50
+ path: string;
51
+ }
52
+ /** What is DIFFERENT, which is not what happened. */
53
+ export type RunChangeKind = 'added' | 'modified' | 'deleted';
54
+ export interface RunChange {
55
+ path: string;
56
+ kind: RunChangeKind;
57
+ /** How many filesystem events touched this path. Diagnostic only: a reviewer
58
+ * must never read it as a measure of how much changed. */
59
+ events: number;
60
+ }
61
+ export interface RunDiffOptions {
62
+ /** Paths that existed when the run started. */
63
+ baseline?: Iterable<string>;
64
+ }
65
+ /**
66
+ * Folds a filesystem event stream into a net change set.
67
+ *
68
+ * Incremental by construction: each event is O(1), so the cost tracks the event
69
+ * rate rather than the repository size. That is the property §9b's fourth
70
+ * component needs measured, and it only holds while this stays a pure fold.
71
+ */
72
+ export declare class RunDiff {
73
+ #private;
74
+ constructor(options?: RunDiffOptions);
75
+ apply(event: RunFileEvent): void;
76
+ applyAll(events: Iterable<RunFileEvent>): void;
77
+ /**
78
+ * The net change set, sorted by path so two runs over the same work produce
79
+ * identical output — a diff whose order varies is a diff that cannot be
80
+ * compared between runs.
81
+ */
82
+ changes(): RunChange[];
83
+ /** True when the run has changed nothing on disk. */
84
+ isClean(): boolean;
85
+ }
86
+ //# sourceMappingURL=runDiff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runDiff.d.ts","sourceRoot":"","sources":["../src/runDiff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH;;;;+DAI+D;AAC/D,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAA;AAEjE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,gBAAgB,CAAA;IACtB,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAA;CACb;AAED,qDAAqD;AACrD,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAA;AAE5D,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,aAAa,CAAA;IACnB;+DAC2D;IAC3D,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;CAC5B;AAED;;;;;;GAMG;AACH,qBAAa,OAAO;;gBAON,OAAO,GAAE,cAAmB;IAKxC,KAAK,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAahC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,YAAY,CAAC,GAAG,IAAI;IAI9C;;;;OAIG;IACH,OAAO,IAAI,SAAS,EAAE;IAoBtB,qDAAqD;IACrD,OAAO,IAAI,OAAO;CAGnB"}
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Continuous diff against a run's baseline — ADE spec §2.9, tier 1.
3
+ *
4
+ * > "from the sandbox filesystem: every create, write and delete with
5
+ * > before/after content; **a real diff against the run's baseline, computed
6
+ * > continuously**; hunk-level review, which needs the changes and not the
7
+ * > agent's narration."
8
+ *
9
+ * This is the engine behind the tier-1 review capability, and it is also §9b's
10
+ * fourth load component — the last one unmeasured, and the only one where the
11
+ * case for a Rust host could still be won, because it is the one that scales
12
+ * with repository size rather than with agent count.
13
+ *
14
+ * ## An event log is not a diff
15
+ *
16
+ * The whole difficulty is that the filesystem stream describes WHAT HAPPENED
17
+ * while a reviewer needs to know WHAT IS DIFFERENT. Those disagree constantly:
18
+ *
19
+ * - create then delete → **nothing changed**, not "added" followed by "deleted".
20
+ * A diff listing the added file sends a reviewer to a path that does not
21
+ * exist.
22
+ * - delete then create → **modified**, if the file was in the baseline. Reported
23
+ * as "added" it implies the original is gone when it was replaced.
24
+ * - modify a file the baseline never had → **added**. It was created before the
25
+ * watcher attached, or created and then written; either way "modified"
26
+ * describes a prior version that never existed.
27
+ * - many writes → **one** modified entry. A reviewer counting events would read
28
+ * an agent that saved often as an agent that changed more.
29
+ *
30
+ * Each of those is a case where replaying events verbatim produces a confident,
31
+ * wrong answer — which is worse than no diff, because a reviewer acts on it.
32
+ *
33
+ * ## Baseline membership, not content hashes
34
+ *
35
+ * The baseline is the set of paths that existed when the run started. Content
36
+ * hashing is deliberately out of scope here: it belongs where the bytes live
37
+ * (the sandbox), and pulling contents into this layer would make a pure,
38
+ * cheap state machine depend on I/O — the thing that makes it measurable for
39
+ * §9b in the first place.
40
+ */
41
+ /**
42
+ * Folds a filesystem event stream into a net change set.
43
+ *
44
+ * Incremental by construction: each event is O(1), so the cost tracks the event
45
+ * rate rather than the repository size. That is the property §9b's fourth
46
+ * component needs measured, and it only holds while this stays a pure fold.
47
+ */
48
+ export class RunDiff {
49
+ #baseline;
50
+ /** Paths that exist right now, as far as the stream has told us. */
51
+ #present = new Set();
52
+ /** Paths the stream has touched at all, with a count. */
53
+ #touched = new Map();
54
+ constructor(options = {}) {
55
+ this.#baseline = new Set(options.baseline ?? []);
56
+ for (const path of this.#baseline)
57
+ this.#present.add(path);
58
+ }
59
+ apply(event) {
60
+ this.#touched.set(event.path, (this.#touched.get(event.path) ?? 0) + 1);
61
+ if (event.kind === 'removed') {
62
+ this.#present.delete(event.path);
63
+ return;
64
+ }
65
+ // `created` and `modified` both mean "it exists now". The distinction the
66
+ // reviewer needs comes from the BASELINE, not from which verb the watcher
67
+ // used — a file created before the watcher attached arrives as `modified`,
68
+ // and one written twice arrives as `created` then `modified`.
69
+ this.#present.add(event.path);
70
+ }
71
+ applyAll(events) {
72
+ for (const event of events)
73
+ this.apply(event);
74
+ }
75
+ /**
76
+ * The net change set, sorted by path so two runs over the same work produce
77
+ * identical output — a diff whose order varies is a diff that cannot be
78
+ * compared between runs.
79
+ */
80
+ changes() {
81
+ const changes = [];
82
+ for (const [path, events] of this.#touched) {
83
+ const inBaseline = this.#baseline.has(path);
84
+ const existsNow = this.#present.has(path);
85
+ if (!inBaseline && !existsNow) {
86
+ // Created and then deleted within the run. Nothing is different, and
87
+ // listing it would send a reviewer to a path that does not exist.
88
+ continue;
89
+ }
90
+ if (inBaseline && existsNow) {
91
+ changes.push({ path, kind: 'modified', events });
92
+ continue;
93
+ }
94
+ changes.push({ path, kind: existsNow ? 'added' : 'deleted', events });
95
+ }
96
+ return changes.sort((left, right) => left.path.localeCompare(right.path));
97
+ }
98
+ /** True when the run has changed nothing on disk. */
99
+ isClean() {
100
+ return this.changes().length === 0;
101
+ }
102
+ }
103
+ //# sourceMappingURL=runDiff.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runDiff.js","sourceRoot":"","sources":["../src/runDiff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AA+BH;;;;;;GAMG;AACH,MAAM,OAAO,OAAO;IACT,SAAS,CAAa;IAC/B,oEAAoE;IAC3D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,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;YAEzC,IAAI,CAAC,UAAU,IAAI,CAAC,SAAS,EAAE,CAAC;gBAC9B,qEAAqE;gBACrE,kEAAkE;gBAClE,SAAQ;YACV,CAAC;YACD,IAAI,UAAU,IAAI,SAAS,EAAE,CAAC;gBAC5B,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CAAA;gBAChD,SAAQ;YACV,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,CAAA;QACvE,CAAC;QACD,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;IAC3E,CAAC;IAED,qDAAqD;IACrD,OAAO;QACL,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,KAAK,CAAC,CAAA;IACpC,CAAC;CACF"}
@@ -0,0 +1,22 @@
1
+ export declare const AGENT_REASONING_EFFORTS: readonly ["none", "low", "medium", "high", "xhigh"];
2
+ export type AgentReasoningEffort = 'auto' | 'thinking' | typeof AGENT_REASONING_EFFORTS[number];
3
+ export interface AgentReasoningEffortOption {
4
+ effort: AgentReasoningEffort;
5
+ modelId: string;
6
+ }
7
+ export interface AgentReasoningEffortFamily {
8
+ baseId: string;
9
+ effort: AgentReasoningEffort;
10
+ options: AgentReasoningEffortOption[];
11
+ }
12
+ export declare function splitAgentReasoningEffort(id: string): {
13
+ baseId: string;
14
+ effort: Exclude<AgentReasoningEffort, 'auto' | 'thinking'>;
15
+ } | null;
16
+ export declare function agentReasoningEffortLabel(effort: AgentReasoningEffort): string;
17
+ export declare function agentReasoningEffortRank(effort: AgentReasoningEffort): number;
18
+ export declare function buildExplicitAgentReasoningEffortFamilies(modelIds: readonly string[]): Map<string, AgentReasoningEffortOption[]>;
19
+ export declare function indexAgentReasoningEffortFamilies(families: ReadonlyMap<string, readonly AgentReasoningEffortOption[]>): Map<string, string>;
20
+ export declare function resolveAgentReasoningEffortFamily(selectedModelId: string | undefined, families: ReadonlyMap<string, AgentReasoningEffortOption[]>, familyByModelId: ReadonlyMap<string, string>): AgentReasoningEffortFamily | null;
21
+ export declare function preferredAgentReasoningModelId(options: readonly AgentReasoningEffortOption[]): string | undefined;
22
+ //# sourceMappingURL=agentReasoningEffort.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentReasoningEffort.d.ts","sourceRoot":"","sources":["../../src/runtime/agentReasoningEffort.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,qDAAsD,CAAA;AAE1F,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,uBAAuB,CAAC,MAAM,CAAC,CAAA;AAE/F,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,oBAAoB,CAAA;IAC5B,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,oBAAoB,CAAA;IAC5B,OAAO,EAAE,0BAA0B,EAAE,CAAA;CACtC;AAED,wBAAgB,yBAAyB,CACvC,EAAE,EAAE,MAAM,GACT;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC,oBAAoB,EAAE,MAAM,GAAG,UAAU,CAAC,CAAA;CAAE,GAAG,IAAI,CAQvF;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAI9E;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAI7E;AAED,wBAAgB,yCAAyC,CACvD,QAAQ,EAAE,SAAS,MAAM,EAAE,GAC1B,GAAG,CAAC,MAAM,EAAE,0BAA0B,EAAE,CAAC,CAuB3C;AAED,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,0BAA0B,EAAE,CAAC,GACnE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAOrB;AAED,wBAAgB,iCAAiC,CAC/C,eAAe,EAAE,MAAM,GAAG,SAAS,EACnC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,0BAA0B,EAAE,CAAC,EAC3D,eAAe,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3C,0BAA0B,GAAG,IAAI,CAenC;AAED,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,SAAS,0BAA0B,EAAE,GAC7C,MAAM,GAAG,SAAS,CAMpB"}
@@ -0,0 +1,76 @@
1
+ export const AGENT_REASONING_EFFORTS = ['none', 'low', 'medium', 'high', 'xhigh'];
2
+ export function splitAgentReasoningEffort(id) {
3
+ const match = id.replace(/:thinking$/, '').match(/^(.*)-(none|low|medium|high|xhigh)$/);
4
+ return match
5
+ ? {
6
+ baseId: match[1],
7
+ effort: match[2],
8
+ }
9
+ : null;
10
+ }
11
+ export function agentReasoningEffortLabel(effort) {
12
+ return effort === 'xhigh'
13
+ ? 'X-High'
14
+ : `${effort.charAt(0).toUpperCase()}${effort.slice(1)}`;
15
+ }
16
+ export function agentReasoningEffortRank(effort) {
17
+ if (effort === 'auto')
18
+ return -1;
19
+ if (effort === 'thinking')
20
+ return AGENT_REASONING_EFFORTS.length;
21
+ return AGENT_REASONING_EFFORTS.indexOf(effort);
22
+ }
23
+ export function buildExplicitAgentReasoningEffortFamilies(modelIds) {
24
+ const variants = new Map();
25
+ const modelIdSet = new Set(modelIds);
26
+ for (const modelId of modelIds) {
27
+ const parsed = splitAgentReasoningEffort(modelId);
28
+ if (!parsed)
29
+ continue;
30
+ const family = variants.get(parsed.baseId) || [];
31
+ family.push({ effort: parsed.effort, modelId });
32
+ variants.set(parsed.baseId, family);
33
+ }
34
+ const families = new Map();
35
+ for (const [baseId, options] of variants) {
36
+ if (options.length < 2 && !modelIdSet.has(baseId))
37
+ continue;
38
+ const sorted = [...options].sort((a, b) => agentReasoningEffortRank(a.effort) - agentReasoningEffortRank(b.effort));
39
+ if (modelIdSet.has(baseId))
40
+ sorted.unshift({ effort: 'auto', modelId: baseId });
41
+ families.set(baseId, sorted);
42
+ }
43
+ return families;
44
+ }
45
+ export function indexAgentReasoningEffortFamilies(families) {
46
+ const familyByModelId = new Map();
47
+ for (const [baseId, options] of families) {
48
+ familyByModelId.set(baseId, baseId);
49
+ for (const option of options)
50
+ familyByModelId.set(option.modelId, baseId);
51
+ }
52
+ return familyByModelId;
53
+ }
54
+ export function resolveAgentReasoningEffortFamily(selectedModelId, families, familyByModelId) {
55
+ if (!selectedModelId)
56
+ return null;
57
+ const parsed = splitAgentReasoningEffort(selectedModelId);
58
+ const baseId = familyByModelId.get(selectedModelId)
59
+ || parsed?.baseId
60
+ || selectedModelId.replace(/:thinking$/, '');
61
+ const options = families.get(baseId);
62
+ if (!options)
63
+ return null;
64
+ const selectedOption = options.find((option) => option.modelId === selectedModelId);
65
+ return {
66
+ baseId,
67
+ effort: selectedOption?.effort || parsed?.effort || 'auto',
68
+ options,
69
+ };
70
+ }
71
+ export function preferredAgentReasoningModelId(options) {
72
+ return (options.find((option) => option.effort === 'auto')
73
+ || options.find((option) => option.effort === 'high')
74
+ || options[0])?.modelId;
75
+ }
76
+ //# sourceMappingURL=agentReasoningEffort.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentReasoningEffort.js","sourceRoot":"","sources":["../../src/runtime/agentReasoningEffort.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAU,CAAA;AAe1F,MAAM,UAAU,yBAAyB,CACvC,EAAU;IAEV,MAAM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eAAe;QAAE,OAAO,IAAI,CAAA;IACjC,MAAM,MAAM,GAAG,yBAAyB,CAAC,eAAe,CAAC,CAAA;IACzD,MAAM,MAAM,GAAG,eAAe,CAAC,GAAG,CAAC,eAAe,CAAC;WAC9C,MAAM,EAAE,MAAM;WACd,eAAe,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAA;IAC9C,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IACpC,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAA;IACzB,MAAM,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,KAAK,eAAe,CAAC,CAAA;IAEnF,OAAO;QACL,MAAM;QACN,MAAM,EAAE,cAAc,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,IAAI,MAAM;QAC1D,OAAO;KACR,CAAA;AACH,CAAC;AAED,MAAM,UAAU,8BAA8B,CAC5C,OAA8C;IAE9C,OAAO,CACL,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC;WAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC;WAClD,OAAO,CAAC,CAAC,CAAC,CACd,EAAE,OAAO,CAAA;AACZ,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { AcpRuntimeAgentDescriptor, HubAgentRuntimeProvider, HubAgentRuntimeSelection } from './agentRuntimeProviderTypes.js';
2
+ export declare const DEFAULT_HUB_AGENT_RUNTIME_SELECTION: HubAgentRuntimeSelection;
3
+ export declare function normalizeHubAgentRuntimeSelection(value: unknown): HubAgentRuntimeSelection;
4
+ export interface ResolveHubAgentRuntimeProviderOptions {
5
+ selection?: unknown;
6
+ permissionProfile?: string | undefined;
7
+ acpAgents?: AcpRuntimeAgentDescriptor[] | undefined;
8
+ }
9
+ export declare function resolveHubAgentRuntimeProvider(options?: ResolveHubAgentRuntimeProviderOptions): HubAgentRuntimeProvider;
10
+ export declare function runtimeProviderDisplayLabel(provider: Pick<HubAgentRuntimeProvider, 'kind' | 'displayName' | 'status'>): string;
11
+ export declare function acpAgentDisplayName(agent: Pick<AcpRuntimeAgentDescriptor, 'id' | 'name'>): string;
12
+ //# sourceMappingURL=agentRuntimeProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentRuntimeProvider.d.ts","sourceRoot":"","sources":["../../src/runtime/agentRuntimeProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EAGzB,uBAAuB,EAEvB,wBAAwB,EACzB,MAAM,gCAAgC,CAAA;AAsBvC,eAAO,MAAM,mCAAmC,EAAE,wBAKjD,CAAA;AAED,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,OAAO,GAAG,wBAAwB,CAqB1F;AAED,MAAM,WAAW,qCAAqC;IACpD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACtC,SAAS,CAAC,EAAE,yBAAyB,EAAE,GAAG,SAAS,CAAA;CACpD;AAED,wBAAgB,8BAA8B,CAAC,OAAO,GAAE,qCAA0C,GAAG,uBAAuB,CAgE3H;AAED,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,IAAI,CAAC,uBAAuB,EAAE,MAAM,GAAG,aAAa,GAAG,QAAQ,CAAC,GAAG,MAAM,CAG9H;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,IAAI,CAAC,yBAAyB,EAAE,IAAI,GAAG,MAAM,CAAC,GAAG,MAAM,CAIjG"}