@songsid/agend 2.4.0-beta.11 → 2.4.0-beta.13
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/dist/accounts-view.d.ts +29 -0
- package/dist/accounts-view.js +2 -14
- package/dist/accounts-view.js.map +1 -1
- package/dist/agent-endpoint.d.ts +1 -0
- package/dist/agent-endpoint.js +4 -2
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/auth-api.d.ts +2 -0
- package/dist/auth-api.js +33 -2
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/codex.js +11 -0
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/types.d.ts +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/channel/mcp-server.js +1 -1
- package/dist/channel/mcp-server.js.map +1 -1
- package/dist/channel/mcp-tools.js +3 -1
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/claude-install-kind.d.ts +19 -0
- package/dist/claude-install-kind.js +54 -0
- package/dist/claude-install-kind.js.map +1 -0
- package/dist/daemon.d.ts +13 -1
- package/dist/daemon.js +54 -9
- package/dist/daemon.js.map +1 -1
- package/dist/dispatcher-liveness.js +2 -2
- package/dist/dispatcher-liveness.js.map +1 -1
- package/dist/fleet-manager.d.ts +110 -1
- package/dist/fleet-manager.js +387 -25
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/credential-profiles/SKILL.md +7 -0
- package/dist/general-knowledge/skills/hub/SKILL.md +25 -0
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +6 -0
- package/dist/hub/agent-intro-model.d.ts +38 -0
- package/dist/hub/agent-intro-model.js +14 -0
- package/dist/hub/agent-intro-model.js.map +1 -0
- package/dist/hub/agent-intro-tool.d.ts +35 -0
- package/dist/hub/agent-intro-tool.js +83 -0
- package/dist/hub/agent-intro-tool.js.map +1 -0
- package/dist/hub/client.d.ts +1 -0
- package/dist/hub/client.js +26 -0
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.d.ts +13 -5
- package/dist/hub/compose/member.js +28 -5
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.d.ts +1 -0
- package/dist/hub/compose/server.js +5 -1
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/http/compose.d.ts +1 -0
- package/dist/hub/http/compose.js +28 -5
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/schema.js +6 -0
- package/dist/hub/http/schema.js.map +1 -1
- package/dist/hub/member/agent-intro.d.ts +28 -0
- package/dist/hub/member/agent-intro.js +66 -0
- package/dist/hub/member/agent-intro.js.map +1 -0
- package/dist/hub/member/room-ask.d.ts +10 -0
- package/dist/hub/member/room-ask.js +70 -7
- package/dist/hub/member/room-ask.js.map +1 -1
- package/dist/hub/member/room-notification.d.ts +1 -1
- package/dist/hub/member/room-post.d.ts +6 -3
- package/dist/hub/member/room-post.js +9 -3
- package/dist/hub/member/room-post.js.map +1 -1
- package/dist/hub/protocol.d.ts +172 -4
- package/dist/hub/protocol.js +10 -5
- package/dist/hub/protocol.js.map +1 -1
- package/dist/hub/room-answer-status-model.d.ts +3 -0
- package/dist/hub/room-answer-status-model.js +4 -0
- package/dist/hub/room-answer-status-model.js.map +1 -0
- package/dist/hub/room-brief-model.d.ts +30 -0
- package/dist/hub/room-brief-model.js +37 -0
- package/dist/hub/room-brief-model.js.map +1 -0
- package/dist/hub/room-context-model.d.ts +2 -0
- package/dist/hub/room-context-model.js +2 -2
- package/dist/hub/room-context-model.js.map +1 -1
- package/dist/hub/room-members-model.d.ts +63 -0
- package/dist/hub/room-members-model.js +7 -0
- package/dist/hub/room-members-model.js.map +1 -0
- package/dist/hub/rooms/agents.js +50 -10
- package/dist/hub/rooms/agents.js.map +1 -1
- package/dist/hub/rooms/brief.d.ts +18 -0
- package/dist/hub/rooms/brief.js +39 -0
- package/dist/hub/rooms/brief.js.map +1 -0
- package/dist/hub/rooms/members-page.d.ts +33 -0
- package/dist/hub/rooms/members-page.js +37 -0
- package/dist/hub/rooms/members-page.js.map +1 -0
- package/dist/hub/rooms/purpose.d.ts +7 -0
- package/dist/hub/rooms/purpose.js +14 -0
- package/dist/hub/rooms/purpose.js.map +1 -0
- package/dist/hub/rooms/service.d.ts +11 -0
- package/dist/hub/rooms/service.js +56 -12
- package/dist/hub/rooms/service.js.map +1 -1
- package/dist/hub/rooms/types.d.ts +6 -2
- package/dist/hub/runtime.d.ts +1 -1
- package/dist/hub/server.js +27 -1
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/types.d.ts +9 -5
- package/dist/hub-room-reply-warning.d.ts +2 -0
- package/dist/hub-room-reply-warning.js +16 -0
- package/dist/hub-room-reply-warning.js.map +1 -0
- package/dist/instance-lifecycle.d.ts +18 -0
- package/dist/instance-lifecycle.js +43 -4
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/locale.js +26 -0
- package/dist/locale.js.map +1 -1
- package/dist/login-controller.d.ts +26 -0
- package/dist/login-controller.js +72 -2
- package/dist/login-controller.js.map +1 -1
- package/dist/native-mcp.js +1 -1
- package/dist/native-mcp.js.map +1 -1
- package/dist/needs-you-hub.js +1 -1
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +12 -1
- package/dist/needs-you.js +9 -0
- package/dist/needs-you.js.map +1 -1
- package/dist/office-share-page.js +1 -1
- package/dist/office-share-page.js.map +1 -1
- package/dist/outbound-handlers.d.ts +2 -1
- package/dist/outbound-handlers.js +19 -4
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +10 -0
- package/dist/outbound-schemas.js +3 -1
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/pause-marker.d.ts +1 -1
- package/dist/pause-marker.js +1 -1
- package/dist/pause-marker.js.map +1 -1
- package/dist/public-web-gateway.d.ts +20 -0
- package/dist/public-web-gateway.js +66 -5
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/restart-progress.d.ts +6 -0
- package/dist/restart-progress.js +5 -0
- package/dist/restart-progress.js.map +1 -1
- package/dist/settings-effect.js +17 -1
- package/dist/settings-effect.js.map +1 -1
- package/dist/tool-permissions.js +3 -3
- package/dist/tool-permissions.js.map +1 -1
- package/dist/ui/accounts-keepalive.js +2 -1
- package/dist/ui/accounts-view.js +2 -1
- package/dist/ui/chat-quote.js +3 -261
- package/dist/ui/fleet-canvas.js +3 -1
- package/dist/ui/fleet-office-skin.js +4 -3
- package/dist/ui/fleet-route.js +44 -6
- package/dist/ui/fleet-task-view.js +2 -1
- package/dist/ui/host-install.js +82 -5
- package/dist/ui/hub-agent-intro.js +15 -6
- package/dist/ui/hub-ai-apps.js +2 -1
- package/dist/ui/hub-attachments.js +81 -3
- package/dist/ui/hub-chat-strings.js +2 -1
- package/dist/ui/hub-client.js +4 -0
- package/dist/ui/hub-grant-picker.js +2 -1
- package/dist/ui/hub-group-strings.js +2 -1
- package/dist/ui/hub-intro-notice.js +16 -0
- package/dist/ui/hub-my-agents.js +7 -3
- package/dist/ui/hub-owner-strings.js +2 -1
- package/dist/ui/hub-personal-agent.js +2 -1
- package/dist/ui/hub-quota.js +2 -1
- package/dist/ui/hub-roles-strings.js +2 -1
- package/dist/ui/hub-room-composer.js +10 -2
- package/dist/ui/hub-room-list.js +1 -1
- package/dist/ui/hub-room-members.js +2 -0
- package/dist/ui/hub-room-new-strings.js +2 -1
- package/dist/ui/hub-room-new.js +7 -4
- package/dist/ui/hub-room-purpose.js +19 -0
- package/dist/ui/hub-room-search.js +1 -1
- package/dist/ui/hub-room-settings.js +9 -0
- package/dist/ui/hub-room-source.js +2 -1
- package/dist/ui/hub-room-strings.js +6 -4
- package/dist/ui/hub-room-thread.js +68 -17
- package/dist/ui/hub-strings.js +2 -1
- package/dist/ui/hub-teams.js +2 -1
- package/dist/ui/model-picker.js +3 -2
- package/dist/ui/panel-chat.js +25 -7
- package/dist/ui/panel-hub.js +67 -20
- package/dist/ui/panel-needs.js +3 -2
- package/dist/ui/panel-runtimes.js +2 -1
- package/dist/ui/reply-file-preview.js +2 -1
- package/dist/ui/settings-access-overview.js +2 -1
- package/dist/ui/settings-connector.js +2 -1
- package/dist/ui/shared/agent-sheet.js +2 -1
- package/dist/ui/shared/app-i18n.js +2 -2
- package/dist/ui/shared/app-shell.js +39 -9
- package/dist/ui/shared/app.css +11 -0
- package/dist/ui/shared/app.js +3 -1
- package/dist/ui/shared/asset-url.d.ts +2 -0
- package/dist/ui/shared/asset-url.js +20 -0
- package/dist/ui/shared/chat-msg-actions.js +3 -1
- package/dist/ui/shared/chat-quote.js +261 -0
- package/dist/ui/shared/chat-table-select.js +175 -0
- package/dist/ui/shared/hub-chat.css +28 -0
- package/dist/ui/shared/hub-rooms-u2.css +5 -0
- package/dist/ui/shared/image-annotate.js +2 -1
- package/dist/ui/shared/module-warm.d.ts +3 -0
- package/dist/ui/shared/module-warm.js +39 -0
- package/dist/ui/shared/ui-states.js +3 -2
- package/dist/ui/shared/view-history.js +2 -1
- package/dist/ui/subagent-row.js +3 -2
- package/dist/ui/usage-pool.js +2 -1
- package/dist/ui/workspace-panel.js +2 -1
- package/dist/wake-coordinator.js +3 -2
- package/dist/wake-coordinator.js.map +1 -1
- package/dist/web-api.d.ts +17 -4
- package/dist/web-api.js +83 -6
- package/dist/web-api.js.map +1 -1
- package/dist/web-asset-version.d.ts +65 -0
- package/dist/web-asset-version.js +259 -0
- package/dist/web-asset-version.js.map +1 -0
- package/dist/web-host-guard.js +3 -1
- package/dist/web-host-guard.js.map +1 -1
- package/dist/web-host-install.d.ts +30 -3
- package/dist/web-host-install.js +50 -4
- package/dist/web-host-install.js.map +1 -1
- package/dist/web-terminal.d.ts +5 -0
- package/dist/web-terminal.js +11 -0
- package/dist/web-terminal.js.map +1 -1
- package/launcher/agend-install.cjs +48 -7
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type ClaudeInstallKind = "native" | "npm-global" | "other";
|
|
2
|
+
export interface ClaudeInstall {
|
|
3
|
+
kind: ClaudeInstallKind;
|
|
4
|
+
/** npm-global: the package directory (`…/node_modules/@anthropic-ai/claude-code`), what `npm -g uninstall` removes. */
|
|
5
|
+
npmPackageDir?: string;
|
|
6
|
+
/** native, as the accounts page is told it: an npm copy still left on this computer (shown `~`-abbreviated), whose removal the page offers. */
|
|
7
|
+
npmLeftover?: string;
|
|
8
|
+
}
|
|
9
|
+
/** The npm package of Claude Code, as npm names it. */
|
|
10
|
+
export declare const CLAUDE_NPM_PACKAGE = "@anthropic-ai/claude-code";
|
|
11
|
+
/** Where Claude's native installer keeps its versions: `$XDG_DATA_HOME/claude/versions`, else `~/.local/share/claude/versions`. */
|
|
12
|
+
export declare function nativeVersionsDir(env: NodeJS.ProcessEnv, home: string): string;
|
|
13
|
+
/** The kind of install `realPath` (the real path of the `claude` the fleet runs) belongs to. */
|
|
14
|
+
export declare function claudeInstallKind(realPath: string | null | undefined, env: NodeJS.ProcessEnv, home: string): ClaudeInstall;
|
|
15
|
+
/**
|
|
16
|
+
* M-3307 (Fable note 2 on #4163): a host path as the browser may see it — never one that names a user. Under this user's home it is `~/…`; under another user's
|
|
17
|
+
* home (`/home/<name>/…`, `/Users/<name>/…`) the name is left out (`~…/…`); a system path (`/usr/lib/…`) names nobody and is kept.
|
|
18
|
+
*/
|
|
19
|
+
export declare function displayHostPath(path: string | null | undefined, home: string): string | null;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* M-3307 (#4146): which kind of Claude Code install the fleet runs, read from where its `claude` really is.
|
|
3
|
+
*
|
|
4
|
+
* - `native`: Claude's own installer (claude.ai/install.sh, `claude install`) — the binary is one of `<data>/claude/versions/<v>`,
|
|
5
|
+
* reached through the `~/.local/bin/claude` link. It updates under one lock and moves a finished file into place.
|
|
6
|
+
* - `npm-global`: `npm install -g @anthropic-ai/claude-code` — the binary lives in that package (its `bin/claude.exe`, `cli.js`, or
|
|
7
|
+
* its platform package's binary). Its updates are `npm install -g` runs on the shared global prefix, which an AgEnD restart can
|
|
8
|
+
* interrupt half-way (#4146: `claude` gone, a 500-byte placeholder left).
|
|
9
|
+
* - `other`: anything else (Homebrew, a hand-made link, a dev build) — no offer is made for it.
|
|
10
|
+
*
|
|
11
|
+
* Pure: the caller resolves the real path (realpath of what PATH finds). Nothing here runs a command.
|
|
12
|
+
*/
|
|
13
|
+
import { join, sep } from "node:path";
|
|
14
|
+
/** The npm package of Claude Code, as npm names it. */
|
|
15
|
+
export const CLAUDE_NPM_PACKAGE = "@anthropic-ai/claude-code";
|
|
16
|
+
/** Where Claude's native installer keeps its versions: `$XDG_DATA_HOME/claude/versions`, else `~/.local/share/claude/versions`. */
|
|
17
|
+
export function nativeVersionsDir(env, home) {
|
|
18
|
+
const data = env.XDG_DATA_HOME?.trim();
|
|
19
|
+
return join(data && data.startsWith("/") ? data : join(home, ".local", "share"), "claude", "versions");
|
|
20
|
+
}
|
|
21
|
+
/** The kind of install `realPath` (the real path of the `claude` the fleet runs) belongs to. */
|
|
22
|
+
export function claudeInstallKind(realPath, env, home) {
|
|
23
|
+
if (!realPath)
|
|
24
|
+
return { kind: "other" };
|
|
25
|
+
const versions = nativeVersionsDir(env, home) + sep;
|
|
26
|
+
if (realPath.startsWith(versions) && !realPath.slice(versions.length).includes(sep))
|
|
27
|
+
return { kind: "native" };
|
|
28
|
+
// npm's global layout: <prefix>/lib/node_modules/@anthropic-ai/claude-code/… (Linux, macOS), or …/node_modules/@anthropic-ai/claude-code-<platform>/…
|
|
29
|
+
// for the platform package npm nests inside it. The package directory is the outer one.
|
|
30
|
+
const marker = `${sep}node_modules${sep}@anthropic-ai${sep}claude-code`;
|
|
31
|
+
const at = realPath.indexOf(marker);
|
|
32
|
+
if (at < 0)
|
|
33
|
+
return { kind: "other" };
|
|
34
|
+
const after = realPath.slice(at + marker.length);
|
|
35
|
+
if (after !== "" && !after.startsWith(sep))
|
|
36
|
+
return { kind: "other" }; // @anthropic-ai/claude-code-something at the top: not this package
|
|
37
|
+
return { kind: "npm-global", npmPackageDir: realPath.slice(0, at + marker.length) };
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* M-3307 (Fable note 2 on #4163): a host path as the browser may see it — never one that names a user. Under this user's home it is `~/…`; under another user's
|
|
41
|
+
* home (`/home/<name>/…`, `/Users/<name>/…`) the name is left out (`~…/…`); a system path (`/usr/lib/…`) names nobody and is kept.
|
|
42
|
+
*/
|
|
43
|
+
export function displayHostPath(path, home) {
|
|
44
|
+
if (!path)
|
|
45
|
+
return null;
|
|
46
|
+
const h = home.replace(/\/+$/, "");
|
|
47
|
+
if (h && (path === h || path.startsWith(`${h}/`)))
|
|
48
|
+
return `~${path.slice(h.length)}`;
|
|
49
|
+
const other = /^\/(?:home|Users)\/[^/]+(\/.*)?$/.exec(path);
|
|
50
|
+
if (other)
|
|
51
|
+
return `~…${other[1] ?? ""}`;
|
|
52
|
+
return path;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=claude-install-kind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-install-kind.js","sourceRoot":"","sources":["../src/claude-install-kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAYtC,uDAAuD;AACvD,MAAM,CAAC,MAAM,kBAAkB,GAAG,2BAA2B,CAAC;AAE9D,mIAAmI;AACnI,MAAM,UAAU,iBAAiB,CAAC,GAAsB,EAAE,IAAY;IACpE,MAAM,IAAI,GAAG,GAAG,CAAC,aAAa,EAAE,IAAI,EAAE,CAAC;IACvC,OAAO,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;AACzG,CAAC;AAED,gGAAgG;AAChG,MAAM,UAAU,iBAAiB,CAAC,QAAmC,EAAE,GAAsB,EAAE,IAAY;IACzG,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IACxC,MAAM,QAAQ,GAAG,iBAAiB,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,GAAG,CAAC;IACpD,IAAI,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAC/G,sJAAsJ;IACtJ,wFAAwF;IACxF,MAAM,MAAM,GAAG,GAAG,GAAG,eAAe,GAAG,gBAAgB,GAAG,aAAa,CAAC;IACxE,MAAM,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACpC,IAAI,EAAE,GAAG,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IACrC,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IACjD,IAAI,KAAK,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAK,mEAAmE;IAC7I,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;AACtF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,IAA+B,EAAE,IAAY;IAC3E,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IACvB,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACnC,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACrF,MAAM,KAAK,GAAG,kCAAkC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5D,IAAI,KAAK;QAAE,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;IACxC,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/daemon.d.ts
CHANGED
|
@@ -791,6 +791,8 @@ export declare class Daemon extends EventEmitter {
|
|
|
791
791
|
* instance is still auth-broken and must not resume raising alarms.
|
|
792
792
|
*/
|
|
793
793
|
private authFailureUnresolved;
|
|
794
|
+
/** A process-local login failure cannot be repaired by a valid auth file or idle chrome. */
|
|
795
|
+
private staleAuth;
|
|
794
796
|
/** One login-screen auth report per spawn — the screen persists across polls. */
|
|
795
797
|
private loginScreenReported;
|
|
796
798
|
/** #2795: the auth pattern match the token-free check is still to judge; it arms nothing until confirmAuthFailure(). */
|
|
@@ -1081,6 +1083,10 @@ export declare class Daemon extends EventEmitter {
|
|
|
1081
1083
|
/** Stop buffering and deliver, in order, every `pty_error` raised while the lifecycle was starting us. */
|
|
1082
1084
|
releaseStartupIncidents(): void;
|
|
1083
1085
|
emit(event: string | symbol, ...args: unknown[]): boolean;
|
|
1086
|
+
/** Attention remains active for General/busy agents too, until a new launch takes ownership. */
|
|
1087
|
+
staleAuthIssue(): {
|
|
1088
|
+
since: number;
|
|
1089
|
+
} | null;
|
|
1084
1090
|
/**
|
|
1085
1091
|
* Undo an auth suspicion once the backend's token-free probe has said the credentials are fine. Since #2795 a pane
|
|
1086
1092
|
* pattern match arms nothing before that probe (its pending match is just dropped); what is left to undo is a
|
|
@@ -1705,6 +1711,11 @@ export declare class Daemon extends EventEmitter {
|
|
|
1705
1711
|
/** M-3239: this launch's turn as its transcript tells it (dispatcher-liveness.ts). */
|
|
1706
1712
|
private readonly turnWatch;
|
|
1707
1713
|
private turnActivitySentAt;
|
|
1714
|
+
private hubRoomInputEpoch;
|
|
1715
|
+
private hubRoomTranscriptActivity;
|
|
1716
|
+
private hubRoomTurnActivityStart;
|
|
1717
|
+
private readonly hubRoomTurnBoot;
|
|
1718
|
+
private hubRoomTurnSequence;
|
|
1708
1719
|
private turnEndTimer;
|
|
1709
1720
|
/** M-3239: Claude's and Codex's transcripts tell each tool call and answer; their pane's spinner alone is not a turn. */
|
|
1710
1721
|
private turnEvidence;
|
|
@@ -2360,6 +2371,7 @@ export declare class Daemon extends EventEmitter {
|
|
|
2360
2371
|
/** Observe the Kiro paste outside paneWriteLock; a long agent turn must not block dialog handling. */
|
|
2361
2372
|
private observeKiroSubmission;
|
|
2362
2373
|
/**
|
|
2374
|
+
* A stale process login refuses delivery before any write; durable attempts stay retryable.
|
|
2363
2375
|
* While the CLI is parked on a fatal startup screen (see fatalStartupBlocked),
|
|
2364
2376
|
* no pane write may happen: paste+Enter into the corrupt-config modal would
|
|
2365
2377
|
* confirm "Exit and fix manually" and exit the CLI. The message is failed (❌)
|
|
@@ -2367,7 +2379,7 @@ export declare class Daemon extends EventEmitter {
|
|
|
2367
2379
|
* what to fix, and holding would only build a queue that floods the pane the
|
|
2368
2380
|
* moment the flag clears.
|
|
2369
2381
|
*/
|
|
2370
|
-
private
|
|
2382
|
+
private refuseBlockedDelivery;
|
|
2371
2383
|
/**
|
|
2372
2384
|
* A raw `%output` silence check is authoritative for ordinary TUIs. It is not
|
|
2373
2385
|
* for a backend such as agy whose status-line hook periodically redraws an
|
package/dist/daemon.js
CHANGED
|
@@ -114,7 +114,7 @@ const WEB_THEME_IPC = Object.freeze({
|
|
|
114
114
|
});
|
|
115
115
|
/** The largest picture any slot may take (a card slot's ceiling; the fleet checks the limit in force): read no more. */
|
|
116
116
|
const WEB_THEME_ASSET_MAX_BYTES = ASSET_UPLOAD_MAX_BYTES;
|
|
117
|
-
const CROSS_INSTANCE_TOOLS = new Set(["hub_room_status", "hub_room_list", "hub_room_post", "hub_room_members", "hub_people_search", "send_to_instance", "broadcast", "list_instances", "start_instance", "restart_instance", "create_instance", "delete_instance", "replace_instance", "request_information", "delegate_task", "report_result", "delivery_status", "describe_instance"]);
|
|
117
|
+
const CROSS_INSTANCE_TOOLS = new Set(["hub_set_intro", "hub_room_status", "hub_room_list", "hub_room_post", "hub_room_members", "hub_people_search", "send_to_instance", "broadcast", "list_instances", "start_instance", "restart_instance", "create_instance", "delete_instance", "replace_instance", "request_information", "delegate_task", "report_result", "delivery_status", "describe_instance"]);
|
|
118
118
|
const SCHEDULE_TOOLS = new Set(["create_schedule", "list_schedules", "update_schedule", "delete_schedule"]);
|
|
119
119
|
const DECISION_TOOLS = new Set(["post_decision", "list_decisions", "update_decision"]);
|
|
120
120
|
const TASK_TOOL = "task";
|
|
@@ -1568,6 +1568,8 @@ export class Daemon extends EventEmitter {
|
|
|
1568
1568
|
* instance is still auth-broken and must not resume raising alarms.
|
|
1569
1569
|
*/
|
|
1570
1570
|
authFailureUnresolved = false;
|
|
1571
|
+
/** A process-local login failure cannot be repaired by a valid auth file or idle chrome. */
|
|
1572
|
+
staleAuth = null;
|
|
1571
1573
|
/** One login-screen auth report per spawn — the screen persists across polls. */
|
|
1572
1574
|
loginScreenReported = false;
|
|
1573
1575
|
/** #2795: the auth pattern match the token-free check is still to judge; it arms nothing until confirmAuthFailure(). */
|
|
@@ -1861,7 +1863,7 @@ export class Daemon extends EventEmitter {
|
|
|
1861
1863
|
if (!["codex", "grok"].includes(this.backend?.binaryName ?? ""))
|
|
1862
1864
|
return [];
|
|
1863
1865
|
const patterns = this.backend?.getErrorPatterns?.() ?? [];
|
|
1864
|
-
return this.backend?.binaryName === "codex" ? patterns.filter(ep => Daemon.isCodexUsageLimitPause(ep)) : patterns.filter(ep => ep.type === "quota");
|
|
1866
|
+
return this.backend?.binaryName === "codex" ? patterns.filter(ep => Daemon.isCodexUsageLimitPause(ep) || ep.type === "stale_auth") : patterns.filter(ep => ep.type === "quota");
|
|
1865
1867
|
}
|
|
1866
1868
|
async prepareQuotaReplayHistory(reuseWindow) {
|
|
1867
1869
|
this.quotaReplay = null;
|
|
@@ -1923,7 +1925,7 @@ export class Daemon extends EventEmitter {
|
|
|
1923
1925
|
this.quotaInput = history.marker && history.occurrences === 0 ? { history, reported: new Map() } : null;
|
|
1924
1926
|
}
|
|
1925
1927
|
quotaOccurrencesAfterInput(pane, ep) {
|
|
1926
|
-
if (!(this.backend?.binaryName === "codex" && Daemon.isCodexUsageLimitPause(ep)
|
|
1928
|
+
if (!(this.backend?.binaryName === "codex" && (Daemon.isCodexUsageLimitPause(ep) || ep.type === "stale_auth")
|
|
1927
1929
|
|| this.backend?.binaryName === "grok" && ep.type === "quota"))
|
|
1928
1930
|
return null;
|
|
1929
1931
|
const input = this.quotaInput, history = input?.history;
|
|
@@ -2087,6 +2089,10 @@ export class Daemon extends EventEmitter {
|
|
|
2087
2089
|
}
|
|
2088
2090
|
return super.emit(event, ...args);
|
|
2089
2091
|
}
|
|
2092
|
+
/** Attention remains active for General/busy agents too, until a new launch takes ownership. */
|
|
2093
|
+
staleAuthIssue() {
|
|
2094
|
+
return this.staleAuth?.generation === this.spawnGeneration ? { since: this.staleAuth.since } : null;
|
|
2095
|
+
}
|
|
2090
2096
|
/**
|
|
2091
2097
|
* Undo an auth suspicion once the backend's token-free probe has said the credentials are fine. Since #2795 a pane
|
|
2092
2098
|
* pattern match arms nothing before that probe (its pending match is just dropped); what is left to undo is a
|
|
@@ -2095,6 +2101,8 @@ export class Daemon extends EventEmitter {
|
|
|
2095
2101
|
* is still live and stays.
|
|
2096
2102
|
*/
|
|
2097
2103
|
clearSuspectedAuthFailure() {
|
|
2104
|
+
if (this.staleAuthIssue())
|
|
2105
|
+
return false;
|
|
2098
2106
|
this.unverifiedAuthMatch = null;
|
|
2099
2107
|
if (!this.authFailureUnresolved && !this.loginScreenReported)
|
|
2100
2108
|
return false;
|
|
@@ -2970,6 +2978,8 @@ export class Daemon extends EventEmitter {
|
|
|
2970
2978
|
const oomStop = readSessionOomStop(this.instanceDir);
|
|
2971
2979
|
if (oomStop.blocked)
|
|
2972
2980
|
return sessionOomStopHint(oomStop);
|
|
2981
|
+
if (this.staleAuthIssue())
|
|
2982
|
+
return t("inst.codex_stale_auth");
|
|
2973
2983
|
if (this.pauseWakeState !== "active")
|
|
2974
2984
|
return t("delivery.hold_state", this.pauseWakeState);
|
|
2975
2985
|
if (this.inputBlockedDialogKey !== null)
|
|
@@ -4714,6 +4724,8 @@ export class Daemon extends EventEmitter {
|
|
|
4714
4724
|
}
|
|
4715
4725
|
/** Evaluate one pane snapshot. Kept synchronous so state-machine edges are unit-testable. */
|
|
4716
4726
|
evaluateErrorPatterns(pane, patterns, readyPattern, now = Date.now(), busyPattern = null) {
|
|
4727
|
+
if (this.staleAuthIssue())
|
|
4728
|
+
return; // Ready chrome and recovery deadlines cannot repair this process.
|
|
4717
4729
|
// Count occurrences across the WHOLE pane (not just text after the last
|
|
4718
4730
|
// ready prompt). One shared counter (the static below): arm requires
|
|
4719
4731
|
// count > baseline, so a drifted clone here would silently gate nudges.
|
|
@@ -4824,7 +4836,7 @@ export class Daemon extends EventEmitter {
|
|
|
4824
4836
|
// composer to establish its baseline; later appended occurrences remain eligible.
|
|
4825
4837
|
if ((ep.type === "rate_limit" && ep.action === "nudge_continue") || ep.historyUntilLiveComposer) {
|
|
4826
4838
|
const baseline = this.nudgeBaselines?.get(key);
|
|
4827
|
-
if (baseline === undefined || count <= baseline) {
|
|
4839
|
+
if ((baseline === undefined || count <= baseline) && !(ep.type === "stale_auth" && newQuotaAfterInput)) {
|
|
4828
4840
|
if (baseline !== undefined)
|
|
4829
4841
|
this.lastErrorCount.set(key, count);
|
|
4830
4842
|
continue;
|
|
@@ -4922,6 +4934,10 @@ export class Daemon extends EventEmitter {
|
|
|
4922
4934
|
});
|
|
4923
4935
|
return;
|
|
4924
4936
|
}
|
|
4937
|
+
if (ep.type === "stale_auth") {
|
|
4938
|
+
this.staleAuth = { generation: this.spawnGeneration, since: now };
|
|
4939
|
+
this.authFailureUnresolved = true;
|
|
4940
|
+
}
|
|
4925
4941
|
// #2795: auth text on the pane proves nothing about the credentials (22 of 22 such matches on the main host were
|
|
4926
4942
|
// conversation text). It arms nothing here; it only asks the lifecycle's token-free check, and a failing check
|
|
4927
4943
|
// arms the auth state through confirmAuthFailure().
|
|
@@ -6464,7 +6480,8 @@ export class Daemon extends EventEmitter {
|
|
|
6464
6480
|
// auth pause — otherwise the instance would pause again the moment it idles.
|
|
6465
6481
|
this.pausePending = false;
|
|
6466
6482
|
this.pauseReconfirmAuth = false;
|
|
6467
|
-
this.
|
|
6483
|
+
if (!this.staleAuthIssue())
|
|
6484
|
+
this.authFailureUnresolved = false;
|
|
6468
6485
|
this.unverifiedAuthMatch = null;
|
|
6469
6486
|
this.loginScreenReported = false;
|
|
6470
6487
|
this.fatalStartupReported = false;
|
|
@@ -7140,6 +7157,11 @@ export class Daemon extends EventEmitter {
|
|
|
7140
7157
|
/** M-3239: this launch's turn as its transcript tells it (dispatcher-liveness.ts). */
|
|
7141
7158
|
turnWatch = new TurnWatch();
|
|
7142
7159
|
turnActivitySentAt = 0;
|
|
7160
|
+
hubRoomInputEpoch = 0;
|
|
7161
|
+
hubRoomTranscriptActivity = 0;
|
|
7162
|
+
hubRoomTurnActivityStart = null;
|
|
7163
|
+
hubRoomTurnBoot = randomUUID();
|
|
7164
|
+
hubRoomTurnSequence = 0;
|
|
7143
7165
|
turnEndTimer = null;
|
|
7144
7166
|
/** M-3239: Claude's and Codex's transcripts tell each tool call and answer; their pane's spinner alone is not a turn. */
|
|
7145
7167
|
turnEvidence() {
|
|
@@ -7164,15 +7186,24 @@ export class Daemon extends EventEmitter {
|
|
|
7164
7186
|
clearTimeout(this.turnEndTimer);
|
|
7165
7187
|
this.turnEndTimer = null;
|
|
7166
7188
|
}
|
|
7167
|
-
if (state === "working")
|
|
7189
|
+
if (state === "working") {
|
|
7168
7190
|
this.turnWatch.begin(Date.now());
|
|
7191
|
+
this.hubRoomTurnActivityStart ??= this.hubRoomTranscriptActivity;
|
|
7192
|
+
}
|
|
7169
7193
|
return;
|
|
7170
7194
|
}
|
|
7171
7195
|
if (this.turnEndTimer)
|
|
7172
7196
|
return;
|
|
7197
|
+
const roomGeneration = this.roomConversationState ? this.roomConversationGeneration() : null, roomInputEpoch = this.hubRoomInputEpoch;
|
|
7173
7198
|
this.turnEndTimer = setTimeout(() => {
|
|
7174
7199
|
this.turnEndTimer = null; // a working edge before this cancels it: the turn went on
|
|
7175
7200
|
const turn = this.turnWatch.end();
|
|
7201
|
+
// A Claude/Codex compaction spinner is not a completed model turn. Require fresh tool/text evidence.
|
|
7202
|
+
const bin = this.backend?.binaryName, needsTranscript = bin === "claude" || bin === "codex";
|
|
7203
|
+
const realWork = !needsTranscript || this.hubRoomTurnActivityStart !== null && this.hubRoomTranscriptActivity > this.hubRoomTurnActivityStart;
|
|
7204
|
+
this.hubRoomTurnActivityStart = null;
|
|
7205
|
+
if (turn && realWork && roomGeneration && roomGeneration === this.roomConversationGeneration() && roomInputEpoch === this.hubRoomInputEpoch)
|
|
7206
|
+
this.broadcastFleetMessage({ type: "hub_room_turn_ended", generation: roomGeneration, turn: `${this.hubRoomTurnBoot}:${++this.hubRoomTurnSequence}` });
|
|
7176
7207
|
if (!turn || turn.messaged || !turn.text.trim() || !this.turnEvidence())
|
|
7177
7208
|
return;
|
|
7178
7209
|
this.broadcastFleetMessage({ type: "turn_ended", instanceName: this.name, startedAt: turn.startedAt, text: turn.text.slice(-4000) });
|
|
@@ -7264,14 +7295,17 @@ export class Daemon extends EventEmitter {
|
|
|
7264
7295
|
// M-3239: the turn as the transcript tells it — progress for the board's quiet clock, and the question a turn ends on.
|
|
7265
7296
|
const mine = () => this.transcriptMonitor === monitor;
|
|
7266
7297
|
monitor.on("tool_use", (name, input) => { if (mine()) {
|
|
7298
|
+
this.hubRoomTranscriptActivity++;
|
|
7267
7299
|
this.turnWatch.tool(name, input, Date.now());
|
|
7268
7300
|
this.reportTurnActivity();
|
|
7269
7301
|
} });
|
|
7270
7302
|
monitor.on("tool_result", () => { if (mine()) {
|
|
7303
|
+
this.hubRoomTranscriptActivity++;
|
|
7271
7304
|
this.turnWatch.result(Date.now());
|
|
7272
7305
|
this.reportTurnActivity();
|
|
7273
7306
|
} });
|
|
7274
7307
|
monitor.on("assistant_text", (text) => { if (mine()) {
|
|
7308
|
+
this.hubRoomTranscriptActivity++;
|
|
7275
7309
|
this.turnWatch.text(text, Date.now());
|
|
7276
7310
|
this.reportTurnActivity();
|
|
7277
7311
|
} });
|
|
@@ -8968,7 +9002,7 @@ export class Daemon extends EventEmitter {
|
|
|
8968
9002
|
const settleFence = this.launchFenceEpoch;
|
|
8969
9003
|
if (cancelled())
|
|
8970
9004
|
return false;
|
|
8971
|
-
if (this.
|
|
9005
|
+
if (this.refuseBlockedDelivery(verdict, status))
|
|
8972
9006
|
return false;
|
|
8973
9007
|
let windowId = this.getWindowId();
|
|
8974
9008
|
const supportsQueuedInput = this.backend?.supportsQueuedInput?.() === true;
|
|
@@ -9093,7 +9127,7 @@ export class Daemon extends EventEmitter {
|
|
|
9093
9127
|
// delivery from the top, where the settle wait runs again outside it.
|
|
9094
9128
|
if (!settledClean || settleGeneration !== this.spawnGeneration || this.spawning)
|
|
9095
9129
|
return "spawn-started";
|
|
9096
|
-
if (this.
|
|
9130
|
+
if (this.refuseBlockedDelivery(verdict, status))
|
|
9097
9131
|
return false;
|
|
9098
9132
|
// A passive startup phase may paint after the outer readiness probe.
|
|
9099
9133
|
// It clears without input, so waiting under the pane lock cannot starve
|
|
@@ -9127,6 +9161,7 @@ export class Daemon extends EventEmitter {
|
|
|
9127
9161
|
// same process, a pause/stop/respawn is not (launchFenceEpoch moves even
|
|
9128
9162
|
// when a failed pause resumes the monitors).
|
|
9129
9163
|
const writeCurrent = () => !cancelled()
|
|
9164
|
+
&& !this.staleAuthIssue()
|
|
9130
9165
|
&& !this.deliveryWritesStopping
|
|
9131
9166
|
&& !this.runtimeMonitorsFrozen
|
|
9132
9167
|
&& !this.spawning
|
|
@@ -10361,6 +10396,10 @@ export class Daemon extends EventEmitter {
|
|
|
10361
10396
|
* pane proves nothing. The silence gate comes first and costs no capture.
|
|
10362
10397
|
*/
|
|
10363
10398
|
async paneReadinessForDelivery(windowId) {
|
|
10399
|
+
if (this.staleAuthIssue()) {
|
|
10400
|
+
this.resetFooterFallback();
|
|
10401
|
+
return "dialog";
|
|
10402
|
+
}
|
|
10364
10403
|
// Each early return below is the pane seen outside the footer-fallback
|
|
10365
10404
|
// candidate state, and never reaches deliveryInputReadyPane: reset here.
|
|
10366
10405
|
if (!this.isPaneIdleForDelivery(windowId)) {
|
|
@@ -10885,6 +10924,7 @@ export class Daemon extends EventEmitter {
|
|
|
10885
10924
|
}
|
|
10886
10925
|
}
|
|
10887
10926
|
/**
|
|
10927
|
+
* A stale process login refuses delivery before any write; durable attempts stay retryable.
|
|
10888
10928
|
* While the CLI is parked on a fatal startup screen (see fatalStartupBlocked),
|
|
10889
10929
|
* no pane write may happen: paste+Enter into the corrupt-config modal would
|
|
10890
10930
|
* confirm "Exit and fix manually" and exit the CLI. The message is failed (❌)
|
|
@@ -10892,7 +10932,11 @@ export class Daemon extends EventEmitter {
|
|
|
10892
10932
|
* what to fix, and holding would only build a queue that floods the pane the
|
|
10893
10933
|
* moment the flag clears.
|
|
10894
10934
|
*/
|
|
10895
|
-
|
|
10935
|
+
refuseBlockedDelivery(verdict, status) {
|
|
10936
|
+
if (this.staleAuthIssue()) {
|
|
10937
|
+
this.failDelivery(verdict, status, "pre-write", "stale-auth");
|
|
10938
|
+
return true;
|
|
10939
|
+
}
|
|
10896
10940
|
if (!this.fatalStartupBlocked && !this.modelMinimumBlocked)
|
|
10897
10941
|
return false;
|
|
10898
10942
|
this.logger.error("Delivery refused — CLI startup or model-version repair is held");
|
|
@@ -15402,6 +15446,7 @@ export class Daemon extends EventEmitter {
|
|
|
15402
15446
|
const generation = meta.hub_room_context_generation;
|
|
15403
15447
|
if (meta.from_instance !== HUB_REPORT_TARGET || !generation || generation !== this.roomConversationGeneration())
|
|
15404
15448
|
return;
|
|
15449
|
+
this.hubRoomInputEpoch++;
|
|
15405
15450
|
this.broadcastFleetMessage({ type: "hub_room_input", correlationId: meta.correlation_id, generation });
|
|
15406
15451
|
}
|
|
15407
15452
|
saveSessionId() {
|