@timurproko/a1 0.2.7-dev.1276 → 0.2.7-dev.1285
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 +5 -1
- package/dist/app/session-shell/session-shell-root.d.ts +4 -68
- package/dist/app/session-shell/session-shell.js +5 -11
- package/dist/app/session-shell/shell-host.js +2 -2
- package/dist/app/session-shell/shell-options.d.ts +65 -0
- package/dist/app/session-shell/shell-options.js +1 -0
- package/dist/app/session-shell/workflow-router.d.ts +3 -1
- package/dist/app/session-shell/workflow-router.js +12 -0
- package/dist/cli/dispatch.js +27 -1
- package/dist/cli/packages.js +18 -2
- package/dist/cli/session-context.js +6 -2
- package/dist/composition/owned-ui.js +20 -8
- package/dist/composition/session-naming.js +1 -1
- package/dist/composition/session-runtime-registry.d.ts +2 -0
- package/dist/composition/session-runtime-registry.js +49 -9
- package/dist/contracts/agent-engine/package-ports.d.ts +10 -14
- package/dist/contracts/agent-engine/package-ports.js +5 -9
- package/dist/contracts/owned-ui/session-workflows.d.ts +6 -0
- package/dist/contracts/presentation/index.d.ts +1 -0
- package/dist/contracts/presentation/progress-palette.generated.d.ts +1 -1
- package/dist/contracts/presentation/progress-palette.generated.js +1 -1
- package/dist/contracts/presentation/progress-spinner.d.ts +7 -0
- package/dist/contracts/presentation/progress-spinner.js +1 -0
- package/dist/features/launch/session-context.d.ts +8 -0
- package/dist/features/launch/session-context.js +19 -10
- package/dist/features/owned-ui/reference-screen-app.js +9 -5
- package/dist/features/owned-ui/session-fork-prompt.d.ts +2 -1
- package/dist/features/owned-ui/session-fork-prompt.js +11 -5
- package/dist/features/owned-ui/settings-app.d.ts +1 -1
- package/dist/features/owned-ui/settings-app.js +14 -7
- package/dist/features/owned-ui/settings-spinner-preview.d.ts +9 -0
- package/dist/features/owned-ui/settings-spinner-preview.js +29 -0
- package/dist/features/session-naming/context.d.ts +17 -0
- package/dist/features/session-naming/context.js +39 -0
- package/dist/features/session-naming/controller.d.ts +1 -5
- package/dist/features/session-naming/controller.js +7 -4
- package/dist/features/session-naming/generate.d.ts +2 -1
- package/dist/features/session-naming/generate.js +14 -10
- package/dist/features/session-naming/index.d.ts +1 -1
- package/dist/foundation/lifecycle/index.d.ts +3 -1
- package/dist/foundation/lifecycle/index.js +3 -1
- package/dist/foundation/lifecycle/session-claim-lock.d.ts +2 -2
- package/dist/foundation/lifecycle/session-claim-lock.js +36 -10
- package/dist/foundation/lifecycle/session-context-retry.d.ts +2 -0
- package/dist/foundation/lifecycle/session-context-retry.js +17 -0
- package/dist/foundation/lifecycle/session-repository-context.d.ts +7 -1
- package/dist/foundation/lifecycle/session-repository-context.js +105 -39
- package/dist/foundation/lifecycle/session-worktree-entry.d.ts +3 -0
- package/dist/foundation/lifecycle/session-worktree-entry.js +87 -0
- package/dist/foundation/release/automatic-update.js +2 -2
- package/dist/foundation/release/bootstrap.js +19 -3
- package/dist/foundation/release/release-gc.js +20 -5
- package/dist/foundation/release/release-state.d.ts +12 -3
- package/dist/foundation/release/release-state.js +55 -24
- package/dist/foundation/release/release-use.d.ts +10 -0
- package/dist/foundation/release/release-use.js +70 -0
- package/dist/foundation/release/update-activation.js +2 -2
- package/dist/foundation/release/update-recovery.js +2 -2
- package/dist/foundation/release/update.js +1 -1
- package/dist/foundation/release/warmup.js +8 -9
- package/dist/foundation/session-writer-lock/index.d.ts +2 -2
- package/dist/foundation/session-writer-lock/index.js +82 -12
- package/dist/foundation/startup/startup-descriptor.js +2 -2
- package/dist/foundation/terminal-cleanup/fatal-diagnostic.d.ts +2 -0
- package/dist/foundation/terminal-cleanup/fatal-diagnostic.js +59 -0
- package/dist/foundation/terminal-cleanup/fatal-exit.js +1 -29
- package/dist/integrations/pi/components/resources/builtin-themes.d.ts +2 -2
- package/dist/integrations/pi/components/resources/builtin-themes.js +2 -2
- package/dist/integrations/pi/components/share-operation-dialog.d.ts +2 -1
- package/dist/integrations/pi/components/share-operation-dialog.js +13 -5
- package/dist/integrations/pi/components/shell-footer-status.d.ts +2 -1
- package/dist/integrations/pi/components/shell-footer-status.js +15 -8
- package/dist/integrations/pi/components/shell-session-info-reference.js +11 -8
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +1 -1
- package/dist/integrations/pi/components/upstream/assets/earendil-image.json +2 -2
- package/dist/integrations/pi/components/upstream/components/auth-url.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/auth-url.js +1 -1
- package/dist/integrations/pi/components/upstream/components/countdown-timer.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +1 -1
- package/dist/integrations/pi/components/upstream/components/extension-editor.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/extension-editor.js +1 -1
- package/dist/integrations/pi/components/upstream/components/extension-input.js +1 -1
- package/dist/integrations/pi/components/upstream/components/extension-selector.js +1 -1
- package/dist/integrations/pi/components/upstream/components/login-dialog.js +1 -1
- package/dist/integrations/pi/components/upstream/components/mermaid.js +1 -1
- package/dist/integrations/pi/components/upstream/components/oauth-selector.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/oauth-selector.js +1 -1
- package/dist/integrations/pi/components/upstream/components/owned-editor.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/owned-editor.js +1 -1
- package/dist/integrations/pi/components/upstream/components/pi-logo.js +1 -1
- package/dist/integrations/pi/components/upstream/components/scoped-models-selector.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/session-footer.js +14 -8
- package/dist/integrations/pi/components/upstream/components/session-selector-search.js +1 -1
- package/dist/integrations/pi/components/upstream/components/session-selector.js +1 -1
- package/dist/integrations/pi/components/upstream/components/skill-invocation-message.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/skill-invocation-message.js +1 -1
- package/dist/integrations/pi/components/upstream/components/status-indicator.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/status-indicator.js +1 -1
- package/dist/integrations/pi/components/upstream/components/themed-text.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/themed-text.js +1 -1
- package/dist/integrations/pi/components/upstream/components/thinking-selector.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/thinking-selector.js +1 -1
- package/dist/integrations/pi/components/upstream/components/tool-execution.js +1 -1
- package/dist/integrations/pi/components/upstream/components/tree-selector.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/tree-selector.js +1 -1
- package/dist/integrations/pi/components/upstream/components/trust-selector.js +1 -1
- package/dist/integrations/pi/components/upstream/external-editor.js +1 -1
- package/dist/integrations/pi/components/upstream/history/editor-core.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/history/editor-core.js +1 -1
- package/dist/integrations/pi/components/upstream/history/kill-ring.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/history/kill-ring.js +1 -1
- package/dist/integrations/pi/components/upstream/history/printable-key.js +1 -1
- package/dist/integrations/pi/components/upstream/history/text-helpers.js +1 -1
- package/dist/integrations/pi/components/upstream/history/undo-stack.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/history/undo-stack.js +1 -1
- package/dist/integrations/pi/components/upstream/history/word-navigation.js +1 -1
- package/dist/integrations/pi/components/upstream/model-search.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/program-status-reporter.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/theme/theme.js +1 -1
- package/dist/integrations/pi/engine/adapter.d.ts +3 -1
- package/dist/integrations/pi/engine/adapter.js +24 -6
- package/dist/integrations/pi/engine/changelog.js +5 -2
- package/dist/integrations/pi/engine/delivery-retention.d.ts +7 -0
- package/dist/integrations/pi/engine/delivery-retention.js +66 -0
- package/dist/integrations/pi/engine/event-delivery.d.ts +17 -1
- package/dist/integrations/pi/engine/event-delivery.js +25 -3
- package/dist/integrations/pi/engine/extension-ui-binding.d.ts +2 -1
- package/dist/integrations/pi/engine/extension-ui-binding.js +45 -0
- package/dist/integrations/pi/engine/host-ports.d.ts +2 -0
- package/dist/integrations/pi/engine/host.d.ts +3 -0
- package/dist/integrations/pi/engine/host.js +2 -0
- package/dist/integrations/pi/engine/package-integration.js +19 -4
- package/dist/integrations/pi/engine/pending-delivery.d.ts +4 -1
- package/dist/integrations/pi/engine/pending-delivery.js +51 -18
- package/dist/integrations/pi/engine/resources/changelog.json +4 -4
- package/dist/integrations/pi/engine/runtime-integration.d.ts +8 -0
- package/dist/integrations/pi/engine/runtime-integration.js +58 -9
- package/dist/integrations/pi/engine/session-cwd-recovery.d.ts +11 -0
- package/dist/integrations/pi/engine/session-cwd-recovery.js +18 -0
- package/dist/integrations/pi/engine/session-runtime.d.ts +3 -0
- package/dist/integrations/pi/engine/session-runtime.js +2 -0
- package/dist/integrations/pi/engine/session-selection.d.ts +3 -2
- package/dist/integrations/pi/engine/session-selection.js +25 -5
- package/dist/integrations/pi/engine/transcript-image-assets.d.ts +3 -0
- package/dist/integrations/pi/engine/transcript-image-assets.js +65 -14
- package/dist/integrations/pi/engine/view-state.d.ts +14 -0
- package/dist/integrations/pi/engine/view-state.js +17 -0
- package/dist/integrations/pi/engine/workflow-runner.d.ts +2 -0
- package/dist/integrations/pi/engine/workflow-runner.js +47 -26
- package/dist/integrations/pi/engine/worktree-tools.d.ts +4 -0
- package/dist/integrations/pi/engine/worktree-tools.js +26 -0
- package/dist/integrations/pi/session-presenters/components.d.ts +2 -1
- package/dist/integrations/pi/session-presenters/components.js +5 -3
- package/dist/integrations/pi/session-presenters/presenters.d.ts +3 -1
- package/dist/integrations/pi/session-presenters/presenters.js +1 -1
- package/dist/integrations/pi/startup-public.d.ts +1 -1
- package/dist/integrations/pi/startup-public.js +16 -20
- package/dist/integrations/pi/startup-public.manifest.json +29 -29
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +1 -1
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +1 -1
- package/dist/product-identity.json +1 -1
- package/dist/runtime-payload-inventory.json +5027 -5027
- package/dist/ui/components/index.d.ts +1 -1
- package/dist/ui/components/index.js +1 -1
- package/dist/ui/components/progress-status.d.ts +7 -0
- package/dist/ui/components/progress-status.js +21 -0
- package/dist/ui/components/value-menu.d.ts +1 -1
- package/dist/ui/components/value-menu.js +4 -2
- package/dist/ui/settings/declarations.d.ts +16 -4
- package/dist/ui/settings/declarations.js +13 -4
- package/docs/architecture/internal-naming.md +1 -1
- package/docs/architecture/project-structure.md +7 -11
- package/docs/features/session-exports.md +1 -1
- package/docs/features/session-naming.md +8 -6
- package/docs/features/worktrees.md +38 -0
- package/docs/local-worktree-cleanup.md +27 -4
- package/docs/openspec-archive-automation.md +30 -4
- package/docs/worktree-link-recovery.md +2 -2
- package/package.json +5 -5
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DeliveryRetention } from "./delivery-retention.js";
|
|
1
2
|
const MAX_PENDING_EVENTS = 1024;
|
|
2
3
|
const MAX_PENDING_EVENT_BYTES = 8 * 1024 * 1024;
|
|
3
4
|
/** Actual shell semantics: only live complete block state has no independent side effect. */
|
|
@@ -29,21 +30,32 @@ export class PendingEngineDelivery {
|
|
|
29
30
|
#head;
|
|
30
31
|
#tail;
|
|
31
32
|
#size = 0;
|
|
32
|
-
#
|
|
33
|
+
#retention = new DeliveryRetention();
|
|
33
34
|
#protected = 0;
|
|
34
35
|
#generation = -1;
|
|
35
36
|
#superseded = 0;
|
|
36
37
|
#peakNodes = 0;
|
|
37
38
|
#peakBytes = 0;
|
|
39
|
+
rejection = null;
|
|
38
40
|
retain;
|
|
39
|
-
|
|
41
|
+
current;
|
|
42
|
+
externalBytes;
|
|
43
|
+
constructor(retain, current, externalBytes) {
|
|
44
|
+
this.retain = retain;
|
|
45
|
+
this.current = current;
|
|
46
|
+
this.externalBytes = externalBytes;
|
|
47
|
+
}
|
|
40
48
|
get size() { return this.#size; }
|
|
49
|
+
get #bytes() { return this.#retention.bytes + this.#size * 128 + (this.externalBytes?.() ?? 0); }
|
|
41
50
|
diagnostics() {
|
|
42
51
|
return { pending: this.#size, bytes: this.#bytes, protected: this.#protected,
|
|
43
52
|
superseded: this.#superseded, peakNodes: this.#peakNodes, peakBytes: this.#peakBytes };
|
|
44
53
|
}
|
|
45
54
|
/** False means not admitted. The caller must enter its reserved recovery protocol, never evict. */
|
|
46
55
|
push(event, generation, reconcile) {
|
|
56
|
+
this.rejection = null;
|
|
57
|
+
if (this.current)
|
|
58
|
+
this.#retention.baseline(this.current());
|
|
47
59
|
const key = replaceableEventKey(event);
|
|
48
60
|
if (generation !== this.#generation || key === null) {
|
|
49
61
|
if (!this.seal())
|
|
@@ -51,14 +63,23 @@ export class PendingEngineDelivery {
|
|
|
51
63
|
this.#generation = generation;
|
|
52
64
|
}
|
|
53
65
|
const prior = key === null ? undefined : this.#replaceable.get(key);
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
66
|
+
// Compatibility: production owns exact immutable revisions through the ledger. Legacy standalone
|
|
67
|
+
// queues retain the compact-marker contract when no authoritative owner is supplied.
|
|
68
|
+
const marker = this.current === undefined && key !== null && retainedEventBytes(event) > 64 * 1024 && reconcile !== undefined;
|
|
69
|
+
const charge = marker ? undefined : this.#retention.retain(event);
|
|
70
|
+
const release = marker ? undefined : this.retain?.(event);
|
|
71
|
+
prior?.charge?.();
|
|
72
|
+
const bytes = this.#retention.bytes + this.#size * 128 + (this.externalBytes?.(prior?.event) ?? 0);
|
|
58
73
|
if (this.#size - (prior === undefined ? 0 : 1) >= MAX_PENDING_EVENTS
|
|
59
|
-
||
|
|
74
|
+
|| bytes + (prior === undefined ? 128 : 0) > MAX_PENDING_EVENT_BYTES) {
|
|
75
|
+
this.rejection = this.#size - (prior === undefined ? 0 : 1) >= MAX_PENDING_EVENTS ? "event-count" : "retained-bytes";
|
|
76
|
+
charge?.();
|
|
77
|
+
release?.();
|
|
78
|
+
if (prior?.event)
|
|
79
|
+
prior.charge = this.#retention.retain(prior.event);
|
|
60
80
|
return false;
|
|
61
|
-
|
|
81
|
+
}
|
|
82
|
+
const node = { key, generation, charge, ...(marker ? { resolve: reconcile } : { event, release }) };
|
|
62
83
|
if (prior !== undefined) {
|
|
63
84
|
this.#unlink(prior);
|
|
64
85
|
this.#superseded = Math.min(Number.MAX_SAFE_INTEGER, this.#superseded + 1);
|
|
@@ -70,7 +91,6 @@ export class PendingEngineDelivery {
|
|
|
70
91
|
this.#head = node;
|
|
71
92
|
this.#tail = node;
|
|
72
93
|
this.#size++;
|
|
73
|
-
this.#bytes += bytes;
|
|
74
94
|
if (key === null)
|
|
75
95
|
this.#protected++;
|
|
76
96
|
else
|
|
@@ -101,9 +121,17 @@ export class PendingEngineDelivery {
|
|
|
101
121
|
return undefined;
|
|
102
122
|
const event = node.event ?? node.resolve();
|
|
103
123
|
const release = node.release ?? this.retain?.(event);
|
|
124
|
+
const charge = node.charge;
|
|
104
125
|
this.#unlink(node, false);
|
|
105
|
-
// Invariant:
|
|
106
|
-
|
|
126
|
+
// Invariant: keep the exact revision and assets charged through reentrant listener production.
|
|
127
|
+
let released = false;
|
|
128
|
+
return { event, generation: node.generation, release: () => {
|
|
129
|
+
if (released)
|
|
130
|
+
return;
|
|
131
|
+
released = true;
|
|
132
|
+
charge?.();
|
|
133
|
+
release?.();
|
|
134
|
+
} };
|
|
107
135
|
}
|
|
108
136
|
// Invariant: a barrier freezes lazy authoritative markers before a later segment can change them.
|
|
109
137
|
seal() {
|
|
@@ -111,22 +139,28 @@ export class PendingEngineDelivery {
|
|
|
111
139
|
if (node.resolve === undefined)
|
|
112
140
|
continue;
|
|
113
141
|
const event = node.resolve();
|
|
114
|
-
const
|
|
115
|
-
|
|
142
|
+
const charge = this.#retention.retain(event);
|
|
143
|
+
const release = this.retain?.(event);
|
|
144
|
+
if (this.#bytes > MAX_PENDING_EVENT_BYTES) {
|
|
145
|
+
this.rejection = "retained-bytes";
|
|
146
|
+
charge();
|
|
147
|
+
release?.();
|
|
116
148
|
return false;
|
|
117
|
-
|
|
118
|
-
node.
|
|
149
|
+
}
|
|
150
|
+
node.charge = charge;
|
|
119
151
|
node.event = event;
|
|
120
152
|
node.resolve = undefined;
|
|
121
|
-
node.release =
|
|
153
|
+
node.release = release;
|
|
122
154
|
this.#peakBytes = Math.max(this.#peakBytes, this.#bytes);
|
|
123
155
|
}
|
|
124
156
|
this.#replaceable.clear();
|
|
125
157
|
return true;
|
|
126
158
|
}
|
|
127
159
|
#unlink(node, release = true) {
|
|
128
|
-
if (release)
|
|
160
|
+
if (release) {
|
|
161
|
+
node.charge?.();
|
|
129
162
|
node.release?.();
|
|
163
|
+
}
|
|
130
164
|
if (node.previous !== undefined)
|
|
131
165
|
node.previous.next = node.next;
|
|
132
166
|
else
|
|
@@ -136,7 +170,6 @@ export class PendingEngineDelivery {
|
|
|
136
170
|
else
|
|
137
171
|
this.#tail = node.previous;
|
|
138
172
|
this.#size--;
|
|
139
|
-
this.#bytes -= node.bytes;
|
|
140
173
|
if (node.key === null)
|
|
141
174
|
this.#protected--;
|
|
142
175
|
else if (this.#replaceable.get(node.key) === node)
|