@timurproko/a1 0.2.7-dev.746 → 0.2.7-dev.767
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/bin/tab-launch-context.d.ts +6 -1
- package/bin/tab-launch-context.js +11 -2
- package/bin/ui.js +7 -3
- package/dist/app/session-shell/session-shell-root.d.ts +23 -0
- package/dist/app/session-shell/session-shell.js +112 -6
- package/dist/composition/owned-ui.d.ts +4 -1
- package/dist/composition/owned-ui.js +54 -8
- package/dist/contracts/owned-ui/session-backend.d.ts +1 -0
- package/dist/features/owned-ui/settings-app.js +8 -35
- package/dist/foundation/release/bootstrap.d.ts +1 -1
- package/dist/foundation/release/bootstrap.js +15 -4
- package/dist/foundation/release/dependency-certification.js +54 -19
- package/dist/foundation/release/progress-palette.generated.d.ts +2 -2
- package/dist/foundation/release/progress-palette.generated.js +2 -2
- package/dist/foundation/resident-tabs/bridge-client.d.ts +7 -2
- package/dist/foundation/resident-tabs/bridge-client.js +58 -16
- package/dist/foundation/resident-tabs/draft-checkpoint.d.ts +27 -0
- package/dist/foundation/resident-tabs/draft-checkpoint.js +145 -0
- package/dist/foundation/resident-tabs/ensure-terminal-host.d.ts +2 -0
- package/dist/foundation/resident-tabs/ensure-terminal-host.js +7 -1
- package/dist/foundation/resident-tabs/fault-injection.d.ts +8 -0
- package/dist/foundation/resident-tabs/fault-injection.js +26 -0
- package/dist/foundation/resident-tabs/index.d.ts +2 -1
- package/dist/foundation/resident-tabs/index.js +1 -1
- package/dist/foundation/resident-tabs/prompt-journal.d.ts +65 -0
- package/dist/foundation/resident-tabs/prompt-journal.js +214 -0
- package/dist/foundation/resident-tabs/recovery.d.ts +26 -0
- package/dist/foundation/resident-tabs/recovery.js +205 -0
- package/dist/foundation/resident-tabs/session-sync.d.ts +14 -0
- package/dist/foundation/resident-tabs/session-sync.js +37 -0
- package/dist/foundation/resident-tabs/settings.d.ts +9 -2
- package/dist/foundation/resident-tabs/settings.js +55 -7
- package/dist/foundation/session-writer-lock/index.d.ts +27 -0
- package/dist/foundation/session-writer-lock/index.js +197 -0
- package/dist/foundation/startup/startup-descriptor.js +2 -2
- package/dist/integrations/pi/components/resources/builtin-themes.d.ts +4 -4
- package/dist/integrations/pi/components/resources/builtin-themes.js +4 -4
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +17 -4
- package/dist/integrations/pi/components/upstream/assets/earendil-image.json +2 -2
- 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/mermaid.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 +1 -1
- 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 +2 -2
- package/dist/integrations/pi/components/upstream/components/status-indicator.js +3 -3
- 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.d.ts +0 -2
- package/dist/integrations/pi/components/upstream/components/tool-execution.js +41 -20
- 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 +2 -2
- package/dist/integrations/pi/components/upstream/history/editor-core.js +5 -5
- 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-controller.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/theme/theme.d.ts +3 -0
- package/dist/integrations/pi/components/upstream/theme/theme.js +24 -1
- package/dist/integrations/pi/engine/adapter.js +1 -0
- package/dist/integrations/pi/engine/pi-settings-metadata.json +2 -2
- package/dist/integrations/pi/engine/resources/changelog.json +4 -4
- package/dist/integrations/pi/engine/runtime-integration.js +102 -29
- package/dist/integrations/pi/engine/session-runtime.d.ts +0 -6
- package/dist/integrations/pi/engine/session-runtime.js +8 -3
- package/dist/integrations/pi/engine/session-selection.d.ts +3 -0
- package/dist/integrations/pi/engine/session-selection.js +45 -9
- package/dist/integrations/pi/engine/workflow-contexts.js +10 -1
- package/dist/integrations/pi/startup-public.js +152 -222
- package/dist/integrations/pi/startup-public.manifest.json +266 -177
- 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/native/darwin-arm64/manifest.json +1 -1
- package/dist/native/linux-x64/manifest.json +1 -1
- package/dist/native/win32-x64/manifest.json +2 -2
- package/dist/native/win32-x64/process-guardian.exe +0 -0
- package/dist/runtime-payload-inventory.json +5349 -6035
- package/dist/ui/components/line-input.d.ts +1 -1
- package/dist/ui/components/prompt-input.d.ts +7 -5
- package/dist/ui/components/prompt-input.js +7 -7
- package/dist/ui/settings/declarations.d.ts +38 -2
- package/dist/ui/settings/declarations.js +29 -2
- package/dist/ui/settings/index.d.ts +4 -2
- package/dist/ui/settings/index.js +2 -1
- package/dist/ui/settings/manager.d.ts +9 -3
- package/dist/ui/settings/manager.js +81 -29
- package/dist/ui/settings/migrations.d.ts +6 -0
- package/dist/ui/settings/migrations.js +25 -0
- package/dist/ui/settings/profile-document.d.ts +26 -0
- package/dist/ui/settings/profile-document.js +164 -0
- package/dist/ui/settings/sections.js +4 -0
- package/docs/architecture/resident-tabs-requirements.md +1 -234
- package/docs/architecture/resident-tabs.md +30 -10
- package/docs/openspec-archive-automation.md +7 -7
- package/package.json +6 -4
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { closeSync, existsSync, mkdirSync, openSync, readFileSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { basename, dirname, join, resolve } from "node:path";
|
|
5
|
+
import { createHash } from "node:crypto";
|
|
6
|
+
/** Reports that a canonical session identity already has a live writer. */
|
|
7
|
+
export class SessionWriterConflict extends Error {
|
|
8
|
+
path;
|
|
9
|
+
holderKind;
|
|
10
|
+
constructor(path, holderKind = "another A1 process") {
|
|
11
|
+
super(`session is open in ${holderKind}`);
|
|
12
|
+
this.name = "SessionWriterConflict";
|
|
13
|
+
this.path = path;
|
|
14
|
+
this.holderKind = holderKind;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
let backendOverride;
|
|
18
|
+
let cachedBackend;
|
|
19
|
+
function nativeCandidates() {
|
|
20
|
+
const suffix = process.platform === "win32" ? "win32" : process.platform;
|
|
21
|
+
const target = `${suffix}-${process.arch}`;
|
|
22
|
+
return [
|
|
23
|
+
process.env.A1_SESSION_LOCK_PATH,
|
|
24
|
+
resolve(process.cwd(), "dist", "native", target, "a1_session_lock.node"),
|
|
25
|
+
resolve(process.cwd(), ".artifacts", "terminal-host", "a1_session_lock.node"),
|
|
26
|
+
].filter((value) => typeof value === "string" && value.length > 0);
|
|
27
|
+
}
|
|
28
|
+
function loadNativeBackend() {
|
|
29
|
+
const require = createRequire(import.meta.url);
|
|
30
|
+
for (const candidate of nativeCandidates()) {
|
|
31
|
+
if (!existsSync(candidate))
|
|
32
|
+
continue;
|
|
33
|
+
try {
|
|
34
|
+
const loaded = require(candidate);
|
|
35
|
+
if (loaded.SessionLock?.acquire)
|
|
36
|
+
return loaded.SessionLock;
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
// Compatibility: an addon for another Node ABI is unusable; try the next location.
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
function processIsLive(pid) {
|
|
45
|
+
try {
|
|
46
|
+
process.kill(pid, 0);
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/** Development fallback. Packaged builds use the Node-API lock above. */
|
|
54
|
+
function portableBackend() {
|
|
55
|
+
const root = join(tmpdir(), "a1-session-writer-locks");
|
|
56
|
+
mkdirSync(root, { recursive: true, mode: 0o700 });
|
|
57
|
+
const authorityPath = (kind, key) => join(root, `${createHash("sha256").update(`${kind}\0${key}`).digest("hex")}.lock`);
|
|
58
|
+
const locationKey = (path) => `${realpathSync.native(dirname(path))}\0${process.platform === "win32" ? basename(path).toLowerCase() : basename(path)}`;
|
|
59
|
+
const identityKey = (path) => {
|
|
60
|
+
const physical = realpathSync.native(path);
|
|
61
|
+
const metadata = statSync(physical, { bigint: true });
|
|
62
|
+
return `${metadata.dev}:${metadata.ino}`;
|
|
63
|
+
};
|
|
64
|
+
const acquireAuthority = (path) => {
|
|
65
|
+
for (let attempt = 0; attempt < 2; attempt += 1) {
|
|
66
|
+
try {
|
|
67
|
+
const descriptor = openSync(path, "wx", 0o600);
|
|
68
|
+
writeFileSync(descriptor, JSON.stringify({ pid: process.pid, kind: process.env.A1_TAB_ID ? "resident tab" : "another A1 process" }));
|
|
69
|
+
closeSync(descriptor);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
if (attempt === 0) {
|
|
74
|
+
try {
|
|
75
|
+
const record = JSON.parse(readFileSync(path, "utf8"));
|
|
76
|
+
if (typeof record.pid === "number" && !processIsLive(record.pid)) {
|
|
77
|
+
rmSync(path, { force: true });
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
// Security: malformed or racing lock evidence remains authoritative and fails closed.
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
throw error;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
return {
|
|
90
|
+
acquire(requested) {
|
|
91
|
+
const absolute = resolve(requested);
|
|
92
|
+
const location = authorityPath("location", locationKey(absolute));
|
|
93
|
+
acquireAuthority(location);
|
|
94
|
+
let identity;
|
|
95
|
+
let identityAcquired = false;
|
|
96
|
+
let bound = false;
|
|
97
|
+
try {
|
|
98
|
+
if (existsSync(absolute)) {
|
|
99
|
+
const key = identityKey(absolute);
|
|
100
|
+
identity = authorityPath("identity", key);
|
|
101
|
+
acquireAuthority(identity);
|
|
102
|
+
identityAcquired = true;
|
|
103
|
+
if (identityKey(absolute) !== key) {
|
|
104
|
+
throw new Error("session identity changed while its writer lock was acquired");
|
|
105
|
+
}
|
|
106
|
+
rmSync(location, { force: true });
|
|
107
|
+
bound = true;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
rmSync(location, { force: true });
|
|
112
|
+
if (identityAcquired && identity !== undefined)
|
|
113
|
+
rmSync(identity, { force: true });
|
|
114
|
+
throw error;
|
|
115
|
+
}
|
|
116
|
+
let released = false;
|
|
117
|
+
return {
|
|
118
|
+
get bound() { return bound; },
|
|
119
|
+
bindCreated(created) {
|
|
120
|
+
if (bound || resolve(created) !== absolute || !existsSync(absolute)) {
|
|
121
|
+
throw new Error("created session does not match its reservation");
|
|
122
|
+
}
|
|
123
|
+
const key = identityKey(absolute);
|
|
124
|
+
identity = authorityPath("identity", key);
|
|
125
|
+
acquireAuthority(identity);
|
|
126
|
+
if (identityKey(absolute) !== key) {
|
|
127
|
+
rmSync(identity, { force: true });
|
|
128
|
+
identity = undefined;
|
|
129
|
+
throw new Error("created session identity changed during bind");
|
|
130
|
+
}
|
|
131
|
+
rmSync(location, { force: true });
|
|
132
|
+
bound = true;
|
|
133
|
+
},
|
|
134
|
+
release() {
|
|
135
|
+
if (released)
|
|
136
|
+
throw new Error("session lock was already released");
|
|
137
|
+
released = true;
|
|
138
|
+
rmSync(bound ? identity : location, { force: true });
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function backend() {
|
|
145
|
+
return backendOverride ?? (cachedBackend ??= loadNativeBackend() ?? portableBackend());
|
|
146
|
+
}
|
|
147
|
+
function acquire(path) {
|
|
148
|
+
const absolute = resolve(path);
|
|
149
|
+
let lock;
|
|
150
|
+
try {
|
|
151
|
+
lock = backend().acquire(absolute);
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
throw new SessionWriterConflict(absolute, process.env.A1_TAB_ID ? "a resident tab" : "another A1 process");
|
|
155
|
+
}
|
|
156
|
+
let released = false;
|
|
157
|
+
return {
|
|
158
|
+
path: absolute,
|
|
159
|
+
get bound() { return lock.bound; },
|
|
160
|
+
bind(createdPath = absolute) {
|
|
161
|
+
if (released)
|
|
162
|
+
throw new Error("session writer lock was released");
|
|
163
|
+
if (!lock.bound)
|
|
164
|
+
lock.bindCreated(resolve(createdPath));
|
|
165
|
+
},
|
|
166
|
+
release() {
|
|
167
|
+
if (released)
|
|
168
|
+
return;
|
|
169
|
+
released = true;
|
|
170
|
+
lock.release();
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
export function acquireExisting(path) {
|
|
175
|
+
if (!existsSync(path))
|
|
176
|
+
throw new Error(`session file does not exist: ${path}`);
|
|
177
|
+
return acquire(path);
|
|
178
|
+
}
|
|
179
|
+
export function reserveNew(parent, name) {
|
|
180
|
+
if (!name || basename(name) !== name)
|
|
181
|
+
throw new Error("session reservation requires one file name");
|
|
182
|
+
return acquire(join(parent, name));
|
|
183
|
+
}
|
|
184
|
+
export function acquireSessionWriter(path) {
|
|
185
|
+
return acquire(path);
|
|
186
|
+
}
|
|
187
|
+
export function bind(handle, createdPath) {
|
|
188
|
+
handle.bind(createdPath);
|
|
189
|
+
}
|
|
190
|
+
export function release(handle) {
|
|
191
|
+
handle.release();
|
|
192
|
+
}
|
|
193
|
+
/** Test-only backend seam; passing undefined restores native discovery. */
|
|
194
|
+
export function setSessionWriterLockBackendForTest(value) {
|
|
195
|
+
backendOverride = value;
|
|
196
|
+
cachedBackend = undefined;
|
|
197
|
+
}
|
|
@@ -10,7 +10,7 @@ export const STARTUP_DESCRIPTOR = Object.freeze({
|
|
|
10
10
|
],
|
|
11
11
|
"generatedArtifact": {
|
|
12
12
|
"path": "dist/integrations/pi/startup-public.js",
|
|
13
|
-
"sha256": "
|
|
13
|
+
"sha256": "2e5c23263868c689b0b76648a7565fe4384f8144f4c11b64569a08fc4d3502c2"
|
|
14
14
|
},
|
|
15
15
|
"dependencyLayerIdentity": {
|
|
16
16
|
"source": "A1_RELEASE_LAYERS",
|
|
@@ -19,7 +19,7 @@ export const STARTUP_DESCRIPTOR = Object.freeze({
|
|
|
19
19
|
"compileCacheNamespace": {
|
|
20
20
|
"strategy": "node-abi-version-and-ordered-layer-sha256-v1"
|
|
21
21
|
},
|
|
22
|
-
"identity": "
|
|
22
|
+
"identity": "5d1fea810b3c76b1560dd3a743dd4db0b8d03935d9f5079fd4b2da55d4f1084a"
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
export function loadDeclaredStartupGraph() {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Attributed owned theme resources adapted from @earendil-works/pi-coding-agent 1.
|
|
3
|
-
* commit
|
|
4
|
-
* Upstream dark.json SHA-256:
|
|
5
|
-
* Upstream light.json SHA-256:
|
|
2
|
+
* Attributed owned theme resources adapted from @earendil-works/pi-coding-agent 1.2.0 (MIT),
|
|
3
|
+
* commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff.
|
|
4
|
+
* Upstream dark.json SHA-256: e1f96982f8cb7d2a48eca7db03c9cb282cb1e14a243680cd855638ecd6a251b6
|
|
5
|
+
* Upstream light.json SHA-256: 2dee6a4be7f765e7fd7728166b7ebf8c29e4ce313f8ec6b38ae50699e3abc2f3
|
|
6
6
|
* Modifications: removed upstream schema/export metadata; runtime color data is unchanged.
|
|
7
7
|
*/
|
|
8
8
|
export declare const BUILTIN_THEME_RESOURCES: Readonly<{
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Attributed owned theme resources adapted from @earendil-works/pi-coding-agent 1.
|
|
3
|
-
* commit
|
|
4
|
-
* Upstream dark.json SHA-256:
|
|
5
|
-
* Upstream light.json SHA-256:
|
|
2
|
+
* Attributed owned theme resources adapted from @earendil-works/pi-coding-agent 1.2.0 (MIT),
|
|
3
|
+
* commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff.
|
|
4
|
+
* Upstream dark.json SHA-256: e1f96982f8cb7d2a48eca7db03c9cb282cb1e14a243680cd855638ecd6a251b6
|
|
5
|
+
* Upstream light.json SHA-256: 2dee6a4be7f765e7fd7728166b7ebf8c29e4ce313f8ec6b38ae50699e3abc2f3
|
|
6
6
|
* Modifications: removed upstream schema/export metadata; runtime color data is unchanged.
|
|
7
7
|
*/
|
|
8
8
|
export const BUILTIN_THEME_RESOURCES = Object.freeze({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
|
|
3
3
|
* packages/coding-agent/src/core/keybindings.ts.
|
|
4
4
|
* Modifications: Mechanical source port with Node import prefixes, public package-root agent-directory
|
|
5
5
|
* resolution, and an opt-in bare-A1 input profile including Ctrl+L level cycling, unbound model
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
|
|
3
3
|
* packages/coding-agent/src/core/keybindings.ts.
|
|
4
4
|
* Modifications: Mechanical source port with Node import prefixes, public package-root agent-directory
|
|
5
5
|
* resolution, and an opt-in bare-A1 input profile including Ctrl+L level cycling, unbound model
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Deviations: keybindings-public-config-boundary, owned-level-cycle-shortcut,
|
|
10
10
|
* owned-input-keybinding-aliases, owned-session-tree-dialog, owned-dialog-ctrl-c-cancel.
|
|
11
11
|
*/
|
|
12
|
-
import { matchesKey, TUI_KEYBINDINGS, KeybindingsManager as TuiKeybindingsManager, } from "@earendil-works/pi-tui";
|
|
12
|
+
import { Key, matchesKey, TUI_KEYBINDINGS, KeybindingsManager as TuiKeybindingsManager, } from "@earendil-works/pi-tui";
|
|
13
13
|
import { existsSync, readFileSync } from "node:fs";
|
|
14
14
|
import { join } from "node:path";
|
|
15
15
|
import { getAgentDir } from "../../../../startup-public.js";
|
|
@@ -278,14 +278,27 @@ const KEYBINDING_NAME_MIGRATIONS = {
|
|
|
278
278
|
function isLegacyKeybindingName(key) {
|
|
279
279
|
return key in KEYBINDING_NAME_MIGRATIONS;
|
|
280
280
|
}
|
|
281
|
+
const KEYBINDING_MODIFIERS = ["ctrl", "shift", "alt", "super"];
|
|
282
|
+
const BASE_KEY_PATTERN = `(?:[a-z0-9]|${Object.values(Key)
|
|
283
|
+
.flatMap((value) => (typeof value === "string" ? [value.replace(/[\\^$.*+?()[\]{}|]/g, "\\$&")] : []))
|
|
284
|
+
.join("|")})`;
|
|
285
|
+
const DUPLICATE_MODIFIER_PATTERN = KEYBINDING_MODIFIERS
|
|
286
|
+
.map((modifier) => `${modifier}\\+.*${modifier}\\+`)
|
|
287
|
+
.join("|");
|
|
288
|
+
const KEY_ID_PATTERN = new RegExp(`^(?!.*(?:${DUPLICATE_MODIFIER_PATTERN}))(?:(?:${KEYBINDING_MODIFIERS.join("|")})\\+){0,4}${BASE_KEY_PATTERN}$`);
|
|
289
|
+
function isKeyId(value) {
|
|
290
|
+
return typeof value === "string" && KEY_ID_PATTERN.test(value);
|
|
291
|
+
}
|
|
281
292
|
function toKeybindingsConfig(value) {
|
|
282
293
|
const config = {};
|
|
283
294
|
for (const [key, binding] of Object.entries(value)) {
|
|
284
|
-
if (
|
|
295
|
+
if (key === "$schema")
|
|
296
|
+
continue;
|
|
297
|
+
if (isKeyId(binding)) {
|
|
285
298
|
config[key] = binding;
|
|
286
299
|
continue;
|
|
287
300
|
}
|
|
288
|
-
if (Array.isArray(binding) && binding.every(
|
|
301
|
+
if (Array.isArray(binding) && binding.every(isKeyId)) {
|
|
289
302
|
config[key] = binding;
|
|
290
303
|
}
|
|
291
304
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"sourcePackage": "@earendil-works/pi-coding-agent",
|
|
3
|
-
"sourceVersion": "1.
|
|
3
|
+
"sourceVersion": "1.2.0",
|
|
4
4
|
"upstreamRepository": "https://github.com/earendil-works/pi.git",
|
|
5
|
-
"upstreamCommit": "
|
|
5
|
+
"upstreamCommit": "06a466935536f8c9bcacb2d5efc0fc021be1bdff",
|
|
6
6
|
"sourcePath": "dist/modes/interactive/assets/clankolas.png",
|
|
7
7
|
"sourceSha256": "169acd0dfe6fbb8d8742ed24a3fc654fd0b2e2d4223c733249c5493723f1b72d",
|
|
8
8
|
"license": "MIT",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/countdown-timer.ts.
|
|
4
4
|
* Modifications: Mechanical source port with ECMAScript private fields; imports remain on the public
|
|
5
5
|
* Pi TUI package root.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/earendil-announcement.ts.
|
|
4
4
|
* Modifications: Mechanical pinned source port with private imports remapped to public package-root
|
|
5
5
|
* types/APIs and A1-owned theme boundaries. The unchanged image is loaded lazily from its attributed,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/extension-editor.ts.
|
|
4
4
|
* Modifications: Mechanical port: remap pi-tui to the root public singleton, use owned
|
|
5
5
|
* keybindings/theme and external-editor seams, preserve editor layout, hints, focus, submission,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/extension-editor.ts.
|
|
4
4
|
* Modifications: Mechanical port: remap pi-tui to the root public singleton, use owned
|
|
5
5
|
* keybindings/theme and external-editor seams, preserve editor layout, hints, focus, submission,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/extension-input.ts.
|
|
4
4
|
* Modifications: Mechanical port: remap public imports, use ECMAScript private fields, and route the
|
|
5
5
|
* bare-A1 instruction row and chrome through the shared semantic shortcut and compact padded
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/extension-selector.ts.
|
|
4
4
|
* Modifications: Mechanical port: remap public imports, use ECMAScript private fields, and route the
|
|
5
5
|
* bare-A1 instruction row and chrome through the shared semantic shortcut and compact padded
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/mermaid.ts.
|
|
4
4
|
* Modifications: Mechanical pinned source port with private imports remapped to public package-root
|
|
5
5
|
* types/APIs and A1-owned theme boundaries; behavior remains acceptance-tested.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/custom-editor.ts.
|
|
4
4
|
* Modifications: A1-owned class name and synchronized A1 keybinding contract replace the nominal
|
|
5
5
|
* private upstream keybinding constructor dependency; bare A1 injects the shared Settings/agent input
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/custom-editor.ts.
|
|
4
4
|
* Modifications: A1-owned class name and synchronized A1 keybinding contract replace the nominal
|
|
5
5
|
* private upstream keybinding constructor dependency; bare A1 injects the shared Settings/agent input
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/pi-logo.ts.
|
|
4
4
|
* Modifications: Remapped the private theme import to A1's public-backed adapter and composed the
|
|
5
5
|
* fixed-color logo into the owned startup header.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/scoped-models-selector.ts.
|
|
4
4
|
* Modifications: Source-synchronized scoped-model selector port: preserve session-only toggles,
|
|
5
5
|
* search, bulk/provider/reorder actions, dirty state, Ctrl+S persistence, refresh status,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/footer.ts.
|
|
4
4
|
* Modifications: Consumes neutral owned-UI view data instead of a fabricated concrete AgentSession;
|
|
5
5
|
* preserves the latest physical route for virtual models; an explicit bare-A1 profile colors the
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/session-selector-search.ts.
|
|
4
4
|
* Modifications: Source-synchronized session search port with only the public SessionInfo type import
|
|
5
5
|
* remapped.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/session-selector.ts.
|
|
4
4
|
* Modifications: Source-synchronized session selector port: preserve threaded/current/all scope,
|
|
5
5
|
* search, sort, named/path filters, rename, delete confirmation, active-session protection,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/skill-invocation-message.ts.
|
|
4
4
|
* Modifications: Mechanical port uses A1's public pi-tui instance, owned theme boundary, and
|
|
5
5
|
* root-instance keybinding registry because the public coding-agent component closes over a second
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/skill-invocation-message.ts.
|
|
4
4
|
* Modifications: Mechanical port uses A1's public pi-tui instance, owned theme boundary, and
|
|
5
5
|
* root-instance keybinding registry because the public coding-agent component closes over a second
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/status-indicator.ts.
|
|
4
4
|
* Modifications: Mechanical source port with public package-root keybinding, Loader, and owned
|
|
5
5
|
* theme/countdown imports plus ECMAScript private fields.
|
|
@@ -24,7 +24,7 @@ export declare class RetryStatusIndicator extends StatusIndicator {
|
|
|
24
24
|
}
|
|
25
25
|
export type CompactionStatusReason = "manual" | "threshold" | "overflow";
|
|
26
26
|
export declare class CompactionStatusIndicator extends StatusIndicator {
|
|
27
|
-
constructor(ui: TUI, reason: CompactionStatusReason);
|
|
27
|
+
constructor(ui: TUI, reason: CompactionStatusReason, colorFn?: (text: string) => string);
|
|
28
28
|
}
|
|
29
29
|
export declare class BranchSummaryStatusIndicator extends StatusIndicator {
|
|
30
30
|
constructor(ui: TUI);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/status-indicator.ts.
|
|
4
4
|
* Modifications: Mechanical source port with public package-root keybinding, Loader, and owned
|
|
5
5
|
* theme/countdown imports plus ECMAScript private fields.
|
|
@@ -47,12 +47,12 @@ export class RetryStatusIndicator extends StatusIndicator {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
export class CompactionStatusIndicator extends StatusIndicator {
|
|
50
|
-
constructor(ui, reason) {
|
|
50
|
+
constructor(ui, reason, colorFn) {
|
|
51
51
|
const cancelHint = `(${keyText("app.interrupt")} to cancel)`;
|
|
52
52
|
const label = reason === "manual"
|
|
53
53
|
? `Compacting context... ${cancelHint}`
|
|
54
54
|
: `${reason === "overflow" ? "Context overflow detected, " : ""}Auto-compacting... ${cancelHint}`;
|
|
55
|
-
super("compaction", ui, spinner => piTheme().fg("accent", spinner), text => piTheme().fg("muted", text), label);
|
|
55
|
+
super("compaction", ui, colorFn ?? (spinner => piTheme().fg("accent", spinner)), colorFn ?? (text => piTheme().fg("muted", text)), label);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
export class BranchSummaryStatusIndicator extends StatusIndicator {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/themed-text.ts.
|
|
4
4
|
* Modifications: Integrated invalidation-aware text into A1's owned startup header and notices;
|
|
5
5
|
* repository formatting only.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/themed-text.ts.
|
|
4
4
|
* Modifications: Integrated invalidation-aware text into A1's owned startup header and notices;
|
|
5
5
|
* repository formatting only.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/thinking-selector.ts.
|
|
4
4
|
* Modifications: Preserve the searchable thinking-level selector, current/default semantics,
|
|
5
5
|
* selection, and focus while accepting the active bare-A1 cycle-key label from the shell, styling the
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provenance: @earendil-works/pi-coding-agent 1.
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
|
|
3
3
|
* packages/coding-agent/src/modes/interactive/components/thinking-selector.ts.
|
|
4
4
|
* Modifications: Preserve the searchable thinking-level selector, current/default semantics,
|
|
5
5
|
* selection, and focus while accepting the active bare-A1 cycle-key label from the shell, styling the
|
|
@@ -4,7 +4,6 @@ type ToolPresentationResult = Parameters<NonNullable<ToolDefinition["renderResul
|
|
|
4
4
|
isError: boolean;
|
|
5
5
|
durationMs?: number;
|
|
6
6
|
};
|
|
7
|
-
/** The caller-side merge 0.85.1 performs before handing a definition to the component: built-in renderers fill the gaps. */
|
|
8
7
|
type ToolRendererInput = ToolRenderers | ToolDefinition<any, any, any>;
|
|
9
8
|
export declare function mergeBuiltInRenderers(definition: ToolRendererInput | undefined, builtIn: ToolRendererInput | undefined): ToolRenderers | undefined;
|
|
10
9
|
export interface ToolExecutionOptions {
|
|
@@ -55,7 +54,6 @@ export declare class ToolExecutionComponent extends Container {
|
|
|
55
54
|
markExecutionStarted(): void;
|
|
56
55
|
setArgsComplete(): void;
|
|
57
56
|
updateResult(result: ToolPresentationResult, isPartial?: boolean): void;
|
|
58
|
-
/** End mount ownership without letting an obsolete conversion or extension callback repaint. */
|
|
59
57
|
dispose(): void;
|
|
60
58
|
setExpanded(expanded: boolean): void;
|
|
61
59
|
setOutputPad(outputPad: number): void;
|