aicodeman 1.28.2 → 1.29.1
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 +58 -31
- package/README.zh-CN.md +207 -51
- package/dist/attachment-registry.d.ts +20 -0
- package/dist/attachment-registry.d.ts.map +1 -1
- package/dist/attachment-registry.js +75 -10
- package/dist/attachment-registry.js.map +1 -1
- package/dist/config/cli-registry/schema.d.ts +25 -0
- package/dist/config/cli-registry/schema.d.ts.map +1 -1
- package/dist/config/cli-registry/schema.js +43 -0
- package/dist/config/cli-registry/schema.js.map +1 -1
- package/dist/config/cli-registry/stock.d.ts.map +1 -1
- package/dist/config/cli-registry/stock.js +157 -2
- package/dist/config/cli-registry/stock.js.map +1 -1
- package/dist/config/cli-registry/types.d.ts +60 -0
- package/dist/config/cli-registry/types.d.ts.map +1 -1
- package/dist/custom-model-hosts.d.ts +39 -0
- package/dist/custom-model-hosts.d.ts.map +1 -0
- package/dist/custom-model-hosts.js +35 -0
- package/dist/custom-model-hosts.js.map +1 -0
- package/dist/custom-model-injection-apply.d.ts +49 -0
- package/dist/custom-model-injection-apply.d.ts.map +1 -0
- package/dist/custom-model-injection-apply.js +77 -0
- package/dist/custom-model-injection-apply.js.map +1 -0
- package/dist/custom-model-injection.d.ts +79 -0
- package/dist/custom-model-injection.d.ts.map +1 -0
- package/dist/custom-model-injection.js +169 -0
- package/dist/custom-model-injection.js.map +1 -0
- package/dist/docker-hosts.d.ts +42 -0
- package/dist/docker-hosts.d.ts.map +1 -1
- package/dist/docker-hosts.js +18 -0
- package/dist/docker-hosts.js.map +1 -1
- package/dist/generated-artifact-attachments.d.ts +3 -0
- package/dist/generated-artifact-attachments.d.ts.map +1 -1
- package/dist/generated-artifact-attachments.js +18 -8
- package/dist/generated-artifact-attachments.js.map +1 -1
- package/dist/mux-interface.d.ts +7 -0
- package/dist/mux-interface.d.ts.map +1 -1
- package/dist/remote-files.d.ts +145 -0
- package/dist/remote-files.d.ts.map +1 -0
- package/dist/remote-files.js +347 -0
- package/dist/remote-files.js.map +1 -0
- package/dist/remote-hosts.d.ts +12 -0
- package/dist/remote-hosts.d.ts.map +1 -1
- package/dist/remote-hosts.js +7 -1
- package/dist/remote-hosts.js.map +1 -1
- package/dist/remote-ssh-limiter.d.ts +42 -0
- package/dist/remote-ssh-limiter.d.ts.map +1 -0
- package/dist/remote-ssh-limiter.js +84 -0
- package/dist/remote-ssh-limiter.js.map +1 -0
- package/dist/session-auto-name.d.ts +74 -0
- package/dist/session-auto-name.d.ts.map +1 -0
- package/dist/session-auto-name.js +339 -0
- package/dist/session-auto-name.js.map +1 -0
- package/dist/session-manager.d.ts.map +1 -1
- package/dist/session-manager.js +8 -1
- package/dist/session-manager.js.map +1 -1
- package/dist/session.d.ts +123 -5
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +237 -9
- package/dist/session.js.map +1 -1
- package/dist/tmux-manager.d.ts.map +1 -1
- package/dist/tmux-manager.js +27 -13
- package/dist/tmux-manager.js.map +1 -1
- package/dist/types/api.d.ts +6 -0
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/api.js.map +1 -1
- package/dist/types/session.d.ts +48 -0
- package/dist/types/session.d.ts.map +1 -1
- package/dist/types/session.js.map +1 -1
- package/dist/web/middleware/auth.d.ts +11 -1
- package/dist/web/middleware/auth.d.ts.map +1 -1
- package/dist/web/middleware/auth.js +69 -1
- package/dist/web/middleware/auth.js.map +1 -1
- package/dist/web/public/admin-ui.js.gz +0 -0
- package/dist/web/public/api-client.c9b1cddc.js.gz +0 -0
- package/dist/web/public/{app.78bf0bf8.js → app.556be563.js} +7 -7
- package/dist/web/public/app.556be563.js.br +0 -0
- package/dist/web/public/app.556be563.js.gz +0 -0
- package/dist/web/public/approvals-ui.js.gz +0 -0
- package/dist/web/public/constants.258b140f.js.gz +0 -0
- package/dist/web/public/cron-ui.js.gz +0 -0
- package/dist/web/public/entrance-animations.js.gz +0 -0
- package/dist/web/public/home-sessions.js.gz +0 -0
- package/dist/web/public/i18n.5f897ed5.js +1 -0
- package/dist/web/public/i18n.5f897ed5.js.br +0 -0
- package/dist/web/public/i18n.5f897ed5.js.gz +0 -0
- package/dist/web/public/image-input.cd4b97c4.js.gz +0 -0
- package/dist/web/public/index.html +23 -9
- package/dist/web/public/index.html.br +0 -0
- package/dist/web/public/index.html.gz +0 -0
- package/dist/web/public/input-cjk.8bc46081.js +1 -0
- package/dist/web/public/input-cjk.8bc46081.js.br +0 -0
- package/dist/web/public/input-cjk.8bc46081.js.gz +0 -0
- package/dist/web/public/{keyboard-accessory.1d0dda9b.js → keyboard-accessory.2cf04f17.js} +38 -3
- package/dist/web/public/keyboard-accessory.2cf04f17.js.br +0 -0
- package/dist/web/public/keyboard-accessory.2cf04f17.js.gz +0 -0
- package/dist/web/public/mobile-handlers.6f354a87.js.gz +0 -0
- package/dist/web/public/mobile-overview.js.gz +0 -0
- package/dist/web/public/mobile.e9d0b53e.css.gz +0 -0
- package/dist/web/public/notification-manager.36ea4624.js.gz +0 -0
- package/dist/web/public/orchestrator-panel.js.gz +0 -0
- package/dist/web/public/panels-ui.5b07ad14.js.gz +0 -0
- package/dist/web/public/ralph-panel.6de2d0f8.js.gz +0 -0
- package/dist/web/public/ralph-wizard.13a1831e.js.gz +0 -0
- package/dist/web/public/readmymind-ui.js.gz +0 -0
- package/dist/web/public/respawn-ui.ff0dae4c.js.gz +0 -0
- package/dist/web/public/sanitize-html.bc7078d6.js.gz +0 -0
- package/dist/web/public/session-lineage.js.gz +0 -0
- package/dist/web/public/{session-ui.5d0a7b15.js → session-ui.42b81477.js} +13 -13
- package/dist/web/public/session-ui.42b81477.js.br +0 -0
- package/dist/web/public/session-ui.42b81477.js.gz +0 -0
- package/dist/web/public/settings-ui.58f1d756.js +67 -0
- package/dist/web/public/settings-ui.58f1d756.js.br +0 -0
- package/dist/web/public/settings-ui.58f1d756.js.gz +0 -0
- package/dist/web/public/{styles.5d36726d.css → styles.6add175d.css} +1 -1
- package/dist/web/public/styles.6add175d.css.br +0 -0
- package/dist/web/public/{styles.5d36726d.css.gz → styles.6add175d.css.gz} +0 -0
- package/dist/web/public/subagent-windows.e6ca799f.js.gz +0 -0
- package/dist/web/public/sw.js.gz +0 -0
- package/dist/web/public/tab-rail-resize.42c24949.js.gz +0 -0
- package/dist/web/public/terminal-keycode229-recovery.6ea8fe37.js.gz +0 -0
- package/dist/web/public/terminal-ui.38c49244.js +2 -0
- package/dist/web/public/terminal-ui.38c49244.js.br +0 -0
- package/dist/web/public/terminal-ui.38c49244.js.gz +0 -0
- package/dist/web/public/ultracode-panel.js.gz +0 -0
- package/dist/web/public/ultracode-windows.js.gz +0 -0
- package/dist/web/public/upload.html.gz +0 -0
- package/dist/web/public/vendor/dompurify.min.js.gz +0 -0
- package/dist/web/public/vendor/marked.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-fit.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-serialize.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-unicode11.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-webgl.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-predictive-echo.bd6882b8.js.gz +0 -0
- package/dist/web/public/vendor/xterm-zerolag-input.6fee72f2.js.gz +0 -0
- package/dist/web/public/vendor/xterm.css.gz +0 -0
- package/dist/web/public/vendor/xterm.min.js.gz +0 -0
- package/dist/web/public/voice-input.c4b51eb6.js.gz +0 -0
- package/dist/web/public/voice-pcm-worklet.js.gz +0 -0
- package/dist/web/public/webview-tabs.js +56 -4
- package/dist/web/public/webview-tabs.js.br +0 -0
- package/dist/web/public/webview-tabs.js.gz +0 -0
- package/dist/web/route-helpers.d.ts +20 -0
- package/dist/web/route-helpers.d.ts.map +1 -1
- package/dist/web/route-helpers.js +29 -2
- package/dist/web/route-helpers.js.map +1 -1
- package/dist/web/routes/case-routes.d.ts.map +1 -1
- package/dist/web/routes/case-routes.js +23 -6
- package/dist/web/routes/case-routes.js.map +1 -1
- package/dist/web/routes/custom-model-routes.d.ts +18 -0
- package/dist/web/routes/custom-model-routes.d.ts.map +1 -0
- package/dist/web/routes/custom-model-routes.js +136 -0
- package/dist/web/routes/custom-model-routes.js.map +1 -0
- package/dist/web/routes/file-routes.d.ts.map +1 -1
- package/dist/web/routes/file-routes.js +484 -100
- package/dist/web/routes/file-routes.js.map +1 -1
- package/dist/web/routes/index.d.ts +1 -0
- package/dist/web/routes/index.d.ts.map +1 -1
- package/dist/web/routes/index.js +1 -0
- package/dist/web/routes/index.js.map +1 -1
- package/dist/web/routes/session-routes.d.ts.map +1 -1
- package/dist/web/routes/session-routes.js +93 -7
- package/dist/web/routes/session-routes.js.map +1 -1
- package/dist/web/routes/ws-routes.d.ts.map +1 -1
- package/dist/web/routes/ws-routes.js +28 -3
- package/dist/web/routes/ws-routes.js.map +1 -1
- package/dist/web/schemas.d.ts +21 -0
- package/dist/web/schemas.d.ts.map +1 -1
- package/dist/web/schemas.js +38 -0
- package/dist/web/schemas.js.map +1 -1
- package/dist/web/server.d.ts +8 -0
- package/dist/web/server.d.ts.map +1 -1
- package/dist/web/server.js +70 -3
- package/dist/web/server.js.map +1 -1
- package/dist/web/session-listener-wiring.d.ts +6 -2
- package/dist/web/session-listener-wiring.d.ts.map +1 -1
- package/dist/web/session-listener-wiring.js +33 -2
- package/dist/web/session-listener-wiring.js.map +1 -1
- package/dist/web/webview-proxy.d.ts +41 -0
- package/dist/web/webview-proxy.d.ts.map +1 -1
- package/dist/web/webview-proxy.js +102 -1
- package/dist/web/webview-proxy.js.map +1 -1
- package/package.json +2 -2
- package/dist/web/public/app.78bf0bf8.js.br +0 -0
- package/dist/web/public/app.78bf0bf8.js.gz +0 -0
- package/dist/web/public/i18n.561ca09c.js +0 -1
- package/dist/web/public/i18n.561ca09c.js.br +0 -0
- package/dist/web/public/i18n.561ca09c.js.gz +0 -0
- package/dist/web/public/input-cjk.87f14251.js +0 -1
- package/dist/web/public/input-cjk.87f14251.js.br +0 -0
- package/dist/web/public/input-cjk.87f14251.js.gz +0 -0
- package/dist/web/public/keyboard-accessory.1d0dda9b.js.br +0 -0
- package/dist/web/public/keyboard-accessory.1d0dda9b.js.gz +0 -0
- package/dist/web/public/session-ui.5d0a7b15.js.br +0 -0
- package/dist/web/public/session-ui.5d0a7b15.js.gz +0 -0
- package/dist/web/public/settings-ui.e0c7f6b4.js +0 -67
- package/dist/web/public/settings-ui.e0c7f6b4.js.br +0 -0
- package/dist/web/public/settings-ui.e0c7f6b4.js.gz +0 -0
- package/dist/web/public/styles.5d36726d.css.br +0 -0
- package/dist/web/public/terminal-ui.0cbe8637.js +0 -2
- package/dist/web/public/terminal-ui.0cbe8637.js.br +0 -0
- package/dist/web/public/terminal-ui.0cbe8637.js.gz +0 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Global concurrency limiter for the short-lived `ssh` children that
|
|
3
|
+
* remote-case file access spawns (`src/remote-files.ts`: the realpath+stat probe and
|
|
4
|
+
* the buffered text read).
|
|
5
|
+
*
|
|
6
|
+
* Two paths can fan those out without a human behind each one:
|
|
7
|
+
*
|
|
8
|
+
* - `GET /api/sessions/:id/attachments` resolves every history entry (up to
|
|
9
|
+
* `ATTACHMENT_HISTORY_LIMIT`, 100), and the attachments drawer re-runs it on every
|
|
10
|
+
* `attachment:detected` event while it is open, which is exactly when an agent is
|
|
11
|
+
* writing files. The route now batches the probes, but a burst of drawers is still
|
|
12
|
+
* a burst.
|
|
13
|
+
* - A `codeman://attach?path=` magic link in terminal output registers the path
|
|
14
|
+
* fire-and-forget, once per distinct link per PTY chunk. In a remote session that
|
|
15
|
+
* output is written by a process on the remote host, so a prompt-injected agent can
|
|
16
|
+
* print hundreds of links and have the server fork one `ssh` per link, each holding
|
|
17
|
+
* a 20s probe timeout.
|
|
18
|
+
*
|
|
19
|
+
* Without a cap that is the fork-bomb shape `document-conversion-limiter.ts` exists to
|
|
20
|
+
* prevent, and it also trips OpenSSH's default `MaxStartups 10:30:100`, which starts
|
|
21
|
+
* dropping connections at ten unauthenticated handshakes. This is that limiter for
|
|
22
|
+
* ssh: a small fixed pool, FIFO queueing, and a slot handed straight to the next
|
|
23
|
+
* waiter on release so the active count can never exceed the cap under interleaved
|
|
24
|
+
* async resumption.
|
|
25
|
+
*
|
|
26
|
+
* Streams (`remoteCreateReadStream`) are deliberately NOT counted: one is opened per
|
|
27
|
+
* browser request and held for the life of a media playback, so four open videos
|
|
28
|
+
* would otherwise block every preview and the history list. They are already gated
|
|
29
|
+
* behind a counted probe (the guard re-probe runs first), so their spawn RATE is
|
|
30
|
+
* bounded here even though their concurrency is bounded by the browser.
|
|
31
|
+
*
|
|
32
|
+
* NOT re-entrant: never acquire from inside a task already holding a slot.
|
|
33
|
+
*/
|
|
34
|
+
/** Test/diagnostic hook: remote calls currently holding a slot. */
|
|
35
|
+
export declare function getActiveRemoteSshCount(): number;
|
|
36
|
+
/** Test/diagnostic hook: remote calls queued behind the cap. */
|
|
37
|
+
export declare function getQueuedRemoteSshCount(): number;
|
|
38
|
+
/** The configured cap, so a test can assert against the real number. */
|
|
39
|
+
export declare function getRemoteSshLimit(): number;
|
|
40
|
+
/** Run `task` once an ssh slot is free, releasing the slot afterward. */
|
|
41
|
+
export declare function runWithRemoteSshLimit<T>(task: () => Promise<T>): Promise<T>;
|
|
42
|
+
//# sourceMappingURL=remote-ssh-limiter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-ssh-limiter.d.ts","sourceRoot":"","sources":["../src/remote-ssh-limiter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAeH,mEAAmE;AACnE,wBAAgB,uBAAuB,IAAI,MAAM,CAEhD;AAED,gEAAgE;AAChE,wBAAgB,uBAAuB,IAAI,MAAM,CAEhD;AAED,wEAAwE;AACxE,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAoBD,yEAAyE;AACzE,wBAAsB,qBAAqB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAOjF"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Global concurrency limiter for the short-lived `ssh` children that
|
|
3
|
+
* remote-case file access spawns (`src/remote-files.ts`: the realpath+stat probe and
|
|
4
|
+
* the buffered text read).
|
|
5
|
+
*
|
|
6
|
+
* Two paths can fan those out without a human behind each one:
|
|
7
|
+
*
|
|
8
|
+
* - `GET /api/sessions/:id/attachments` resolves every history entry (up to
|
|
9
|
+
* `ATTACHMENT_HISTORY_LIMIT`, 100), and the attachments drawer re-runs it on every
|
|
10
|
+
* `attachment:detected` event while it is open, which is exactly when an agent is
|
|
11
|
+
* writing files. The route now batches the probes, but a burst of drawers is still
|
|
12
|
+
* a burst.
|
|
13
|
+
* - A `codeman://attach?path=` magic link in terminal output registers the path
|
|
14
|
+
* fire-and-forget, once per distinct link per PTY chunk. In a remote session that
|
|
15
|
+
* output is written by a process on the remote host, so a prompt-injected agent can
|
|
16
|
+
* print hundreds of links and have the server fork one `ssh` per link, each holding
|
|
17
|
+
* a 20s probe timeout.
|
|
18
|
+
*
|
|
19
|
+
* Without a cap that is the fork-bomb shape `document-conversion-limiter.ts` exists to
|
|
20
|
+
* prevent, and it also trips OpenSSH's default `MaxStartups 10:30:100`, which starts
|
|
21
|
+
* dropping connections at ten unauthenticated handshakes. This is that limiter for
|
|
22
|
+
* ssh: a small fixed pool, FIFO queueing, and a slot handed straight to the next
|
|
23
|
+
* waiter on release so the active count can never exceed the cap under interleaved
|
|
24
|
+
* async resumption.
|
|
25
|
+
*
|
|
26
|
+
* Streams (`remoteCreateReadStream`) are deliberately NOT counted: one is opened per
|
|
27
|
+
* browser request and held for the life of a media playback, so four open videos
|
|
28
|
+
* would otherwise block every preview and the history list. They are already gated
|
|
29
|
+
* behind a counted probe (the guard re-probe runs first), so their spawn RATE is
|
|
30
|
+
* bounded here even though their concurrency is bounded by the browser.
|
|
31
|
+
*
|
|
32
|
+
* NOT re-entrant: never acquire from inside a task already holding a slot.
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* Max remote probes/reads allowed to run concurrently across the whole process.
|
|
36
|
+
* Override with CODEMAN_MAX_REMOTE_FILE_SSH (clamped to >= 1). Four keeps a burst
|
|
37
|
+
* well under OpenSSH's ten-handshake default.
|
|
38
|
+
*/
|
|
39
|
+
const MAX_CONCURRENT_REMOTE_SSH = (() => {
|
|
40
|
+
const raw = Number(process.env.CODEMAN_MAX_REMOTE_FILE_SSH);
|
|
41
|
+
return Number.isFinite(raw) && raw >= 1 ? Math.floor(raw) : 4;
|
|
42
|
+
})();
|
|
43
|
+
let active = 0;
|
|
44
|
+
const waiters = [];
|
|
45
|
+
/** Test/diagnostic hook: remote calls currently holding a slot. */
|
|
46
|
+
export function getActiveRemoteSshCount() {
|
|
47
|
+
return active;
|
|
48
|
+
}
|
|
49
|
+
/** Test/diagnostic hook: remote calls queued behind the cap. */
|
|
50
|
+
export function getQueuedRemoteSshCount() {
|
|
51
|
+
return waiters.length;
|
|
52
|
+
}
|
|
53
|
+
/** The configured cap, so a test can assert against the real number. */
|
|
54
|
+
export function getRemoteSshLimit() {
|
|
55
|
+
return MAX_CONCURRENT_REMOTE_SSH;
|
|
56
|
+
}
|
|
57
|
+
function acquire() {
|
|
58
|
+
if (active < MAX_CONCURRENT_REMOTE_SSH) {
|
|
59
|
+
active++;
|
|
60
|
+
return Promise.resolve();
|
|
61
|
+
}
|
|
62
|
+
return new Promise((resolve) => waiters.push(resolve));
|
|
63
|
+
}
|
|
64
|
+
function release() {
|
|
65
|
+
const next = waiters.shift();
|
|
66
|
+
if (next) {
|
|
67
|
+
// Hand the slot straight to the next waiter; `active` stays at the cap.
|
|
68
|
+
next();
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
active--;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/** Run `task` once an ssh slot is free, releasing the slot afterward. */
|
|
75
|
+
export async function runWithRemoteSshLimit(task) {
|
|
76
|
+
await acquire();
|
|
77
|
+
try {
|
|
78
|
+
return await task();
|
|
79
|
+
}
|
|
80
|
+
finally {
|
|
81
|
+
release();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=remote-ssh-limiter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-ssh-limiter.js","sourceRoot":"","sources":["../src/remote-ssh-limiter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH;;;;GAIG;AACH,MAAM,yBAAyB,GAAG,CAAC,GAAG,EAAE;IACtC,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;IAC5D,OAAO,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChE,CAAC,CAAC,EAAE,CAAC;AAEL,IAAI,MAAM,GAAG,CAAC,CAAC;AACf,MAAM,OAAO,GAAsB,EAAE,CAAC;AAEtC,mEAAmE;AACnE,MAAM,UAAU,uBAAuB;IACrC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,uBAAuB;IACrC,OAAO,OAAO,CAAC,MAAM,CAAC;AACxB,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,iBAAiB;IAC/B,OAAO,yBAAyB,CAAC;AACnC,CAAC;AAED,SAAS,OAAO;IACd,IAAI,MAAM,GAAG,yBAAyB,EAAE,CAAC;QACvC,MAAM,EAAE,CAAC;QACT,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IACD,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED,SAAS,OAAO;IACd,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAC7B,IAAI,IAAI,EAAE,CAAC;QACT,wEAAwE;QACxE,IAAI,EAAE,CAAC;IACT,CAAC;SAAM,CAAC;QACN,MAAM,EAAE,CAAC;IACX,CAAC;AACH,CAAC;AAED,yEAAyE;AACzE,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAI,IAAsB;IACnE,MAAM,OAAO,EAAE,CAAC;IAChB,IAAI,CAAC;QACH,OAAO,MAAM,IAAI,EAAE,CAAC;IACtB,CAAC;YAAS,CAAC;QACT,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Automatic session names from the first prompt.
|
|
3
|
+
*
|
|
4
|
+
* A new tab is born as `w3-myapp`, which says where it runs and nothing about
|
|
5
|
+
* what it is doing. Once the user submits a real prompt the tab can carry a
|
|
6
|
+
* title derived from it (`w3-myapp: fix the login redirect`), and this module
|
|
7
|
+
* holds the three pure pieces of that: a tracker that reconstructs the composer
|
|
8
|
+
* text from the keystrokes Codeman forwards, the title heuristic, and the
|
|
9
|
+
* prefix-preserving composition.
|
|
10
|
+
*
|
|
11
|
+
* Deliberately no LLM: the prompt already passes through the input boundary,
|
|
12
|
+
* so a local title is private, deterministic and identical for every CLI.
|
|
13
|
+
*
|
|
14
|
+
* ⚠️ The tracker sits on the raw keystroke stream, which carries far more than
|
|
15
|
+
* the prompt: cursor keys, mouse reports Codeman forwards to the CLI, bracketed
|
|
16
|
+
* pastes, Alt chords, the bare Esc that interrupts a turn. Every one of those
|
|
17
|
+
* once named a tab something wrong (a lone Esc ate the next prompt's first
|
|
18
|
+
* character; a wheel tick mid-word dropped the first half of the prompt), so
|
|
19
|
+
* the rules below are explicit per key. The model is a best-effort transcript:
|
|
20
|
+
* keys whose effect on the composer is knowable are mirrored, keys that leave
|
|
21
|
+
* the text alone are ignored, and keys that replace it with something the
|
|
22
|
+
* tracker cannot see (history recall) TAINT the draft so that Enter submits
|
|
23
|
+
* nothing rather than a fragment. A prompt that yields no title leaves the
|
|
24
|
+
* session eligible for the next one.
|
|
25
|
+
*
|
|
26
|
+
* Only user-originated input is fed here; the Session decides that. Ralph
|
|
27
|
+
* kick-starts, respawn `/clear`s, cron launches and approval answers all go
|
|
28
|
+
* through the same write paths and must never become a tab title.
|
|
29
|
+
*
|
|
30
|
+
* @module session-auto-name
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* Reconstructs the composer draft from forwarded keystrokes and reports each
|
|
34
|
+
* submitted prompt. Input arrives in arbitrary chunks (one keystroke, a paste,
|
|
35
|
+
* an agent's whole prompt plus Enter), so all state lives across calls.
|
|
36
|
+
*/
|
|
37
|
+
export declare class SubmittedPromptTracker {
|
|
38
|
+
private buffer;
|
|
39
|
+
private bufferCodePoints;
|
|
40
|
+
/** Code points typed past the cap; backspaces eat these before real text. */
|
|
41
|
+
private overflow;
|
|
42
|
+
/** Escape sequence in progress; a lone ESC means "just saw ESC". */
|
|
43
|
+
private sequence;
|
|
44
|
+
private inPaste;
|
|
45
|
+
/** The composer holds text the tracker never saw (history recall); Enter submits nothing. */
|
|
46
|
+
private tainted;
|
|
47
|
+
feed(data: string): string[];
|
|
48
|
+
private continueSequence;
|
|
49
|
+
private handleKeyOrEscape;
|
|
50
|
+
private handleCsi;
|
|
51
|
+
private handleKey;
|
|
52
|
+
/** One space between lines, never a run of them, and none at the start. */
|
|
53
|
+
private appendSeparator;
|
|
54
|
+
private append;
|
|
55
|
+
private backspace;
|
|
56
|
+
private killWord;
|
|
57
|
+
private reset;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Turns a submitted prompt into a title, or null when the prompt is not a task:
|
|
61
|
+
* empty, a slash command (`/clear`, `/model`), or a `!` shell escape.
|
|
62
|
+
*/
|
|
63
|
+
export declare function deriveAutoSessionName(prompt: string): string | null;
|
|
64
|
+
/**
|
|
65
|
+
* The name a placeholder becomes: `<prefix>: <title>`, so the tab keeps its
|
|
66
|
+
* case identity and its `w<n>` counter (the tab strip already renders that
|
|
67
|
+
* form as the title alone, prefix in the tooltip, and the next-session counter
|
|
68
|
+
* still matches it). A session with no name at all just takes the title. The
|
|
69
|
+
* result honours `maxLength` in UTF-16 units, the unit the rename route caps.
|
|
70
|
+
*/
|
|
71
|
+
export declare function composeAutoSessionName(currentName: string, title: string, maxLength?: number): string;
|
|
72
|
+
/** Codeman's own `w<n>-<case>` / `s<n>-<case>` placeholders, the only names auto-naming replaces. */
|
|
73
|
+
export declare function isGeneratedSessionName(name: string): boolean;
|
|
74
|
+
//# sourceMappingURL=session-auto-name.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-auto-name.d.ts","sourceRoot":"","sources":["../src/session-auto-name.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AA4CH;;;;GAIG;AACH,qBAAa,sBAAsB;IACjC,OAAO,CAAC,MAAM,CAAM;IACpB,OAAO,CAAC,gBAAgB,CAAK;IAC7B,6EAA6E;IAC7E,OAAO,CAAC,QAAQ,CAAK;IACrB,oEAAoE;IACpE,OAAO,CAAC,QAAQ,CAAM;IACtB,OAAO,CAAC,OAAO,CAAS;IACxB,6FAA6F;IAC7F,OAAO,CAAC,OAAO,CAAS;IAExB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE;IAsB5B,OAAO,CAAC,gBAAgB;IA8CxB,OAAO,CAAC,iBAAiB;IAUzB,OAAO,CAAC,SAAS;IAiBjB,OAAO,CAAC,SAAS;IA8CjB,2EAA2E;IAC3E,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,MAAM;IASd,OAAO,CAAC,SAAS;IAYjB,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,KAAK;CAMd;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAInE;AA8BD;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,SAAS,SAA0B,GAClC,MAAM,CAMR;AAeD,qGAAqG;AACrG,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE5D"}
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Automatic session names from the first prompt.
|
|
3
|
+
*
|
|
4
|
+
* A new tab is born as `w3-myapp`, which says where it runs and nothing about
|
|
5
|
+
* what it is doing. Once the user submits a real prompt the tab can carry a
|
|
6
|
+
* title derived from it (`w3-myapp: fix the login redirect`), and this module
|
|
7
|
+
* holds the three pure pieces of that: a tracker that reconstructs the composer
|
|
8
|
+
* text from the keystrokes Codeman forwards, the title heuristic, and the
|
|
9
|
+
* prefix-preserving composition.
|
|
10
|
+
*
|
|
11
|
+
* Deliberately no LLM: the prompt already passes through the input boundary,
|
|
12
|
+
* so a local title is private, deterministic and identical for every CLI.
|
|
13
|
+
*
|
|
14
|
+
* ⚠️ The tracker sits on the raw keystroke stream, which carries far more than
|
|
15
|
+
* the prompt: cursor keys, mouse reports Codeman forwards to the CLI, bracketed
|
|
16
|
+
* pastes, Alt chords, the bare Esc that interrupts a turn. Every one of those
|
|
17
|
+
* once named a tab something wrong (a lone Esc ate the next prompt's first
|
|
18
|
+
* character; a wheel tick mid-word dropped the first half of the prompt), so
|
|
19
|
+
* the rules below are explicit per key. The model is a best-effort transcript:
|
|
20
|
+
* keys whose effect on the composer is knowable are mirrored, keys that leave
|
|
21
|
+
* the text alone are ignored, and keys that replace it with something the
|
|
22
|
+
* tracker cannot see (history recall) TAINT the draft so that Enter submits
|
|
23
|
+
* nothing rather than a fragment. A prompt that yields no title leaves the
|
|
24
|
+
* session eligible for the next one.
|
|
25
|
+
*
|
|
26
|
+
* Only user-originated input is fed here; the Session decides that. Ralph
|
|
27
|
+
* kick-starts, respawn `/clear`s, cron launches and approval answers all go
|
|
28
|
+
* through the same write paths and must never become a tab title.
|
|
29
|
+
*
|
|
30
|
+
* @module session-auto-name
|
|
31
|
+
*/
|
|
32
|
+
import { MAX_SESSION_NAME_LENGTH } from './config/terminal-limits.js';
|
|
33
|
+
/**
|
|
34
|
+
* Longest composer draft kept, in code points. The title is cut from the HEAD
|
|
35
|
+
* of the prompt, so once the cap is reached further text is counted rather
|
|
36
|
+
* than kept (backspaces consume that count first). Keeping the tail instead
|
|
37
|
+
* would turn a long paste into a title made of its last line.
|
|
38
|
+
*/
|
|
39
|
+
const MAX_PROMPT_BUFFER_CODE_POINTS = 8_192;
|
|
40
|
+
/** Longest escape sequence collected before the tracker gives up on it. */
|
|
41
|
+
const MAX_ESCAPE_SEQUENCE_LENGTH = 64;
|
|
42
|
+
/** Longest title, in code points, before it is cut with an ellipsis. */
|
|
43
|
+
const MAX_AUTO_NAME_CODE_POINTS = 72;
|
|
44
|
+
/**
|
|
45
|
+
* A sentence boundary is only honoured this far into the prompt, or "e.g. fix
|
|
46
|
+
* this now" becomes "e.g." and "Ok. Fix the bug" becomes "Ok". Short enough
|
|
47
|
+
* that a CJK sentence (a dozen code points is a full request) still cuts.
|
|
48
|
+
*/
|
|
49
|
+
const MIN_SENTENCE_CODE_POINTS = 8;
|
|
50
|
+
/** A CSI sequence ends at its first byte in this range. */
|
|
51
|
+
const CSI_FINAL_BYTE = /[\x40-\x7e]/;
|
|
52
|
+
/** CSI parameter and intermediate bytes; anything else mid-sequence is malformed. */
|
|
53
|
+
const CSI_BODY_BYTE = /[\x20-\x3f]/;
|
|
54
|
+
/**
|
|
55
|
+
* `/clear`, `/model opus`, `/ralph-loop:ralph-loop`: a slash followed by a
|
|
56
|
+
* command word and then whitespace or the end. A path (`/home/me/notes.txt
|
|
57
|
+
* what is this`) has a second slash where the whitespace should be and so is a
|
|
58
|
+
* prompt.
|
|
59
|
+
*/
|
|
60
|
+
const SLASH_COMMAND_PATTERN = /^\/[a-z][a-z0-9_:-]*(?:\s|$)/i;
|
|
61
|
+
// eslint-disable-next-line no-control-regex
|
|
62
|
+
const CSI_SEQUENCE_PATTERN = /\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]/g;
|
|
63
|
+
// eslint-disable-next-line no-control-regex
|
|
64
|
+
const CONTROL_CHAR_PATTERN = /[\x00-\x1f\x7f]/g;
|
|
65
|
+
const SENTENCE_TERMINATORS = new Set(['.', '!', '?', '。', '!', '?']);
|
|
66
|
+
/**
|
|
67
|
+
* Reconstructs the composer draft from forwarded keystrokes and reports each
|
|
68
|
+
* submitted prompt. Input arrives in arbitrary chunks (one keystroke, a paste,
|
|
69
|
+
* an agent's whole prompt plus Enter), so all state lives across calls.
|
|
70
|
+
*/
|
|
71
|
+
export class SubmittedPromptTracker {
|
|
72
|
+
buffer = '';
|
|
73
|
+
bufferCodePoints = 0;
|
|
74
|
+
/** Code points typed past the cap; backspaces eat these before real text. */
|
|
75
|
+
overflow = 0;
|
|
76
|
+
/** Escape sequence in progress; a lone ESC means "just saw ESC". */
|
|
77
|
+
sequence = '';
|
|
78
|
+
inPaste = false;
|
|
79
|
+
/** The composer holds text the tracker never saw (history recall); Enter submits nothing. */
|
|
80
|
+
tainted = false;
|
|
81
|
+
feed(data) {
|
|
82
|
+
const submitted = [];
|
|
83
|
+
for (const ch of data) {
|
|
84
|
+
if (this.sequence) {
|
|
85
|
+
this.continueSequence(ch);
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
if (ch === '\x1b') {
|
|
89
|
+
this.sequence = ch;
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
this.handleKey(ch, submitted);
|
|
93
|
+
}
|
|
94
|
+
// A chunk that ENDS in a lone ESC is the Esc key, not the start of a
|
|
95
|
+
// sequence: xterm hands each key's whole sequence to one write, and the
|
|
96
|
+
// programmatic senders (an approval deny sends exactly `\x1b`) send it
|
|
97
|
+
// alone. Leaving it pending would make the next prompt's first character
|
|
98
|
+
// look like an Alt chord and swallow it.
|
|
99
|
+
if (this.sequence === '\x1b')
|
|
100
|
+
this.sequence = '';
|
|
101
|
+
return submitted;
|
|
102
|
+
}
|
|
103
|
+
continueSequence(ch) {
|
|
104
|
+
if (this.sequence === '\x1b') {
|
|
105
|
+
if (ch === '[' || ch === 'O' || ch === ']' || ch === 'P') {
|
|
106
|
+
this.sequence += ch;
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
this.sequence = ch === '\x1b' ? ch : '';
|
|
110
|
+
// Alt+Enter inserts a newline in the composer; every other Alt chord
|
|
111
|
+
// (word movement, Alt+B/F) leaves the text alone.
|
|
112
|
+
if (ch === '\r' || ch === '\n')
|
|
113
|
+
this.appendSeparator();
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
this.sequence += ch;
|
|
117
|
+
if (this.sequence.length > MAX_ESCAPE_SEQUENCE_LENGTH) {
|
|
118
|
+
// Not a sequence any terminal sends; what follows is unknowable, so the
|
|
119
|
+
// draft is tainted rather than titled after the tail of the garbage.
|
|
120
|
+
this.sequence = '';
|
|
121
|
+
this.tainted = true;
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const kind = this.sequence[1];
|
|
125
|
+
if (kind === '[') {
|
|
126
|
+
if (CSI_FINAL_BYTE.test(ch)) {
|
|
127
|
+
const sequence = this.sequence;
|
|
128
|
+
this.sequence = '';
|
|
129
|
+
this.handleCsi(sequence);
|
|
130
|
+
}
|
|
131
|
+
else if (!CSI_BODY_BYTE.test(ch)) {
|
|
132
|
+
// Malformed (an ESC [ followed by text): drop the sequence and let the
|
|
133
|
+
// character count as typed rather than swallowing up to 64 of them.
|
|
134
|
+
this.sequence = '';
|
|
135
|
+
this.handleKeyOrEscape(ch);
|
|
136
|
+
}
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
if (kind === 'O') {
|
|
140
|
+
// SS3 carries exactly one byte (application-mode cursor keys).
|
|
141
|
+
this.sequence = '';
|
|
142
|
+
if (ch === 'A' || ch === 'B')
|
|
143
|
+
this.tainted = true;
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
// OSC / DCS run to BEL or ST (ESC \).
|
|
147
|
+
if (ch === '\x07' || this.sequence.endsWith('\x1b\\'))
|
|
148
|
+
this.sequence = '';
|
|
149
|
+
}
|
|
150
|
+
handleKeyOrEscape(ch) {
|
|
151
|
+
if (ch === '\x1b') {
|
|
152
|
+
this.sequence = ch;
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
// Only reached mid-chunk from a malformed sequence, where no submission can
|
|
156
|
+
// be reported; a stray Enter there resets the draft like any other Enter.
|
|
157
|
+
this.handleKey(ch, []);
|
|
158
|
+
}
|
|
159
|
+
handleCsi(sequence) {
|
|
160
|
+
if (sequence === '\x1b[200~') {
|
|
161
|
+
this.inPaste = true;
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
if (sequence === '\x1b[201~') {
|
|
165
|
+
this.inPaste = false;
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
const final = sequence[sequence.length - 1];
|
|
169
|
+
// Up/Down (with or without modifiers) recall history: the composer now
|
|
170
|
+
// holds a line this tracker never saw. Everything else leaves the text as
|
|
171
|
+
// it is: Left/Right/Home/End, Delete (`3~`), Shift+Tab (`Z`), SGR mouse
|
|
172
|
+
// reports (`<…M`/`m`, forwarded on every wheel tick), focus reports.
|
|
173
|
+
if (final === 'A' || final === 'B')
|
|
174
|
+
this.tainted = true;
|
|
175
|
+
}
|
|
176
|
+
handleKey(ch, submitted) {
|
|
177
|
+
const codePoint = ch.codePointAt(0) ?? 0;
|
|
178
|
+
if (this.inPaste) {
|
|
179
|
+
// Pasted newlines are newlines IN the composer, never Enter; they and
|
|
180
|
+
// the other controls (tabs) become a single separator.
|
|
181
|
+
if (codePoint < 0x20 || codePoint === 0x7f)
|
|
182
|
+
this.appendSeparator();
|
|
183
|
+
else
|
|
184
|
+
this.append(ch);
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
switch (ch) {
|
|
188
|
+
case '\r': {
|
|
189
|
+
const prompt = this.tainted ? '' : this.buffer.trim();
|
|
190
|
+
if (prompt)
|
|
191
|
+
submitted.push(prompt);
|
|
192
|
+
this.reset();
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
case '\n':
|
|
196
|
+
// Ctrl+J, and the line feed the send-key route injects for Shift+Enter:
|
|
197
|
+
// a newline inside the composer, so the lines join with a separator.
|
|
198
|
+
this.appendSeparator();
|
|
199
|
+
return;
|
|
200
|
+
case '\x7f':
|
|
201
|
+
case '\x08':
|
|
202
|
+
this.backspace();
|
|
203
|
+
return;
|
|
204
|
+
case '\x17': // Ctrl+W: word rubout
|
|
205
|
+
this.killWord();
|
|
206
|
+
return;
|
|
207
|
+
case '\x15': // Ctrl+U: line discard
|
|
208
|
+
case '\x03': // Ctrl+C: clears the composer (or, empty, arms an exit)
|
|
209
|
+
this.reset();
|
|
210
|
+
return;
|
|
211
|
+
case '\x10': // Ctrl+P
|
|
212
|
+
case '\x0e': // Ctrl+N
|
|
213
|
+
case '\x12': // Ctrl+R: history search
|
|
214
|
+
case '\x1f': // Ctrl+_: undo
|
|
215
|
+
this.tainted = true;
|
|
216
|
+
return;
|
|
217
|
+
default:
|
|
218
|
+
// Tab (the @-mention completer, which only ever extends the token),
|
|
219
|
+
// cursor chords (Ctrl+A/E/B/F) and the rest of C0 leave the text alone.
|
|
220
|
+
if (codePoint < 0x20 || codePoint === 0x7f)
|
|
221
|
+
return;
|
|
222
|
+
this.append(ch);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
/** One space between lines, never a run of them, and none at the start. */
|
|
226
|
+
appendSeparator() {
|
|
227
|
+
if (this.overflow > 0)
|
|
228
|
+
return;
|
|
229
|
+
if (!this.buffer || /\s$/.test(this.buffer))
|
|
230
|
+
return;
|
|
231
|
+
this.append(' ');
|
|
232
|
+
}
|
|
233
|
+
append(ch) {
|
|
234
|
+
if (this.bufferCodePoints >= MAX_PROMPT_BUFFER_CODE_POINTS) {
|
|
235
|
+
this.overflow += 1;
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
this.buffer += ch;
|
|
239
|
+
this.bufferCodePoints += 1;
|
|
240
|
+
}
|
|
241
|
+
backspace() {
|
|
242
|
+
if (this.overflow > 0) {
|
|
243
|
+
this.overflow -= 1;
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
if (!this.buffer)
|
|
247
|
+
return;
|
|
248
|
+
const last = this.buffer.charCodeAt(this.buffer.length - 1);
|
|
249
|
+
const units = last >= 0xdc00 && last <= 0xdfff && this.buffer.length >= 2 ? 2 : 1;
|
|
250
|
+
this.buffer = this.buffer.slice(0, -units);
|
|
251
|
+
this.bufferCodePoints -= 1;
|
|
252
|
+
}
|
|
253
|
+
killWord() {
|
|
254
|
+
this.overflow = 0;
|
|
255
|
+
this.buffer = this.buffer.replace(/\S+\s*$/u, '');
|
|
256
|
+
this.bufferCodePoints = Array.from(this.buffer).length;
|
|
257
|
+
}
|
|
258
|
+
reset() {
|
|
259
|
+
this.buffer = '';
|
|
260
|
+
this.bufferCodePoints = 0;
|
|
261
|
+
this.overflow = 0;
|
|
262
|
+
this.tainted = false;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Turns a submitted prompt into a title, or null when the prompt is not a task:
|
|
267
|
+
* empty, a slash command (`/clear`, `/model`), or a `!` shell escape.
|
|
268
|
+
*/
|
|
269
|
+
export function deriveAutoSessionName(prompt) {
|
|
270
|
+
const text = prompt.replace(CSI_SEQUENCE_PATTERN, '').replace(CONTROL_CHAR_PATTERN, ' ').replace(/\s+/g, ' ').trim();
|
|
271
|
+
if (!text || text.startsWith('!') || SLASH_COMMAND_PATTERN.test(text))
|
|
272
|
+
return null;
|
|
273
|
+
return truncateCodePoints(firstSentence(text), MAX_AUTO_NAME_CODE_POINTS);
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* The first sentence, provided it is long enough to be one; a trailing full
|
|
277
|
+
* stop is dropped because a tab title is not a sentence.
|
|
278
|
+
*/
|
|
279
|
+
function firstSentence(text) {
|
|
280
|
+
const codePoints = Array.from(text);
|
|
281
|
+
for (let i = MIN_SENTENCE_CODE_POINTS - 1; i < codePoints.length; i++) {
|
|
282
|
+
if (!SENTENCE_TERMINATORS.has(codePoints[i]))
|
|
283
|
+
continue;
|
|
284
|
+
const next = codePoints[i + 1];
|
|
285
|
+
if (next !== undefined && !/\s/.test(next))
|
|
286
|
+
continue;
|
|
287
|
+
return codePoints
|
|
288
|
+
.slice(0, i + 1)
|
|
289
|
+
.join('')
|
|
290
|
+
.replace(/[.。]+$/, '');
|
|
291
|
+
}
|
|
292
|
+
return text.replace(/[.。]+$/, '');
|
|
293
|
+
}
|
|
294
|
+
/** Cuts to `max` code points with an ellipsis, on a word boundary when one is near the end. */
|
|
295
|
+
function truncateCodePoints(text, max) {
|
|
296
|
+
const codePoints = Array.from(text);
|
|
297
|
+
if (codePoints.length <= max)
|
|
298
|
+
return text;
|
|
299
|
+
let cut = codePoints.slice(0, max - 1).join('');
|
|
300
|
+
const lastSpace = cut.lastIndexOf(' ');
|
|
301
|
+
if (lastSpace >= Math.floor(cut.length / 2))
|
|
302
|
+
cut = cut.slice(0, lastSpace);
|
|
303
|
+
return `${cut.trimEnd()}…`;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* The name a placeholder becomes: `<prefix>: <title>`, so the tab keeps its
|
|
307
|
+
* case identity and its `w<n>` counter (the tab strip already renders that
|
|
308
|
+
* form as the title alone, prefix in the tooltip, and the next-session counter
|
|
309
|
+
* still matches it). A session with no name at all just takes the title. The
|
|
310
|
+
* result honours `maxLength` in UTF-16 units, the unit the rename route caps.
|
|
311
|
+
*/
|
|
312
|
+
export function composeAutoSessionName(currentName, title, maxLength = MAX_SESSION_NAME_LENGTH) {
|
|
313
|
+
const prefix = currentName.trim();
|
|
314
|
+
if (!prefix)
|
|
315
|
+
return fitTitle(title, maxLength);
|
|
316
|
+
const room = maxLength - prefix.length - 2;
|
|
317
|
+
if (room <= 0)
|
|
318
|
+
return prefix;
|
|
319
|
+
return `${prefix}: ${fitTitle(title, room)}`;
|
|
320
|
+
}
|
|
321
|
+
/** Fits a title into `maxUnits` UTF-16 units, ellipsis included. */
|
|
322
|
+
function fitTitle(title, maxUnits) {
|
|
323
|
+
if (title.length <= maxUnits)
|
|
324
|
+
return title;
|
|
325
|
+
let units = 0;
|
|
326
|
+
let keep = 0;
|
|
327
|
+
for (const codePoint of Array.from(title)) {
|
|
328
|
+
if (units + codePoint.length > maxUnits - 1)
|
|
329
|
+
break;
|
|
330
|
+
units += codePoint.length;
|
|
331
|
+
keep += 1;
|
|
332
|
+
}
|
|
333
|
+
return truncateCodePoints(title, keep + 1);
|
|
334
|
+
}
|
|
335
|
+
/** Codeman's own `w<n>-<case>` / `s<n>-<case>` placeholders, the only names auto-naming replaces. */
|
|
336
|
+
export function isGeneratedSessionName(name) {
|
|
337
|
+
return /^[ws]\d+-[a-zA-Z0-9_-]+$/.test(name);
|
|
338
|
+
}
|
|
339
|
+
//# sourceMappingURL=session-auto-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-auto-name.js","sourceRoot":"","sources":["../src/session-auto-name.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE;;;;;GAKG;AACH,MAAM,6BAA6B,GAAG,KAAK,CAAC;AAE5C,2EAA2E;AAC3E,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAEtC,wEAAwE;AACxE,MAAM,yBAAyB,GAAG,EAAE,CAA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OAAO,CAAC,KAAK,CAAc;IAG3B,OAAO,CAAC,oBAAoB,CAA8B;IAE1D;;OAEG;;IAMH,OAAO,CAAC,aAAa;IAarB;;;;;;;OAOG;IACG,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAqEzD;;;;OAIG;IACG,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA6B5C;;;OAGG;IACG,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAWtC;;;;OAIG;IACH,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS;IAI3C,gCAAgC;IAChC,cAAc,IAAI,OAAO,EAAE;IAI3B,yDAAyD;IACzD,eAAe,IAAI,OAAO,EAAE;IAI5B,qDAAqD;IACrD,eAAe,IAAI,OAAO,EAAE;IAI5B,yCAAyC;IACzC,eAAe,IAAI,MAAM;IAIzB,wCAAwC;IACxC,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAI/B,OAAO,CAAC,kBAAkB;IAmB1B,qEAAqE;IACrE,iBAAiB,IAAI,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC;IAIjD;;;;;;OAMG;IACG,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQpE,4CAA4C;IAC5C,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAKlD,2CAA2C;IAC3C,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CAIlD;AAKD;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,cAAc,CAKlD"}
|
package/dist/session-manager.js
CHANGED
|
@@ -197,7 +197,14 @@ export class SessionManager extends EventEmitter {
|
|
|
197
197
|
// future reader of state.json.
|
|
198
198
|
const state = session.toState();
|
|
199
199
|
const envOverrides = session.getEnvOverridesForPersist();
|
|
200
|
-
|
|
200
|
+
// __customModel: same convention, the disk-only bookkeeping of a custom-model
|
|
201
|
+
// selection (env KEYS, config dir, launch model; never the injected values).
|
|
202
|
+
const customModel = session.getCustomModelForPersist();
|
|
203
|
+
const toStore = {
|
|
204
|
+
...state,
|
|
205
|
+
...(envOverrides ? { __envOverrides: envOverrides } : {}),
|
|
206
|
+
...(customModel ? { __customModel: customModel } : {}),
|
|
207
|
+
};
|
|
201
208
|
this.store.setSession(session.id, toStore);
|
|
202
209
|
}
|
|
203
210
|
/** Gets all sessions from persistent storage (including stopped). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-manager.js","sourceRoot":"","sources":["../src/session-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAiC5C,MAAM,OAAO,cAAe,SAAQ,YAAY;IACtC,QAAQ,GAAyB,IAAI,GAAG,EAAE,CAAC;IAC3C,eAAe,GAAiC,IAAI,GAAG,EAAE,CAAC;IAC1D,KAAK,GAAG,QAAQ,EAAE,CAAC;IAE3B,wDAAwD;IAChD,oBAAoB,GAAyB,IAAI,CAAC;IAE1D;;OAEG;IACH;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;IAEO,aAAa;QACnB,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;QAChD,0DAA0D;QAC1D,sCAAsC;QACtC,KAAK,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;YACzD,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;gBAC/B,KAAK,CAAC,MAAM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