@songsid/agend 2.1.4-beta.5 → 2.1.4-beta.50
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 +1 -1
- package/README.zh-TW.md +1 -1
- package/dist/agent-endpoint.js +1 -1
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/backend/antigravity.d.ts +12 -8
- package/dist/backend/antigravity.js +189 -42
- package/dist/backend/antigravity.js.map +1 -1
- package/dist/backend/claude-code.d.ts +62 -23
- package/dist/backend/claude-code.js +296 -43
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/codex.d.ts +18 -0
- package/dist/backend/codex.js +148 -8
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/gemini-cli.js +2 -2
- package/dist/backend/gemini-cli.js.map +1 -1
- package/dist/backend/grok.js +2 -2
- package/dist/backend/grok.js.map +1 -1
- package/dist/backend/kiro.d.ts +52 -2
- package/dist/backend/kiro.js +267 -12
- package/dist/backend/kiro.js.map +1 -1
- package/dist/backend/opencode.d.ts +27 -11
- package/dist/backend/opencode.js +65 -41
- package/dist/backend/opencode.js.map +1 -1
- package/dist/backend/types.d.ts +97 -3
- package/dist/backend/types.js +12 -1
- package/dist/backend/types.js.map +1 -1
- package/dist/backend-outage.d.ts +61 -0
- package/dist/backend-outage.js +71 -0
- package/dist/backend-outage.js.map +1 -0
- package/dist/channel/adapters/discord.d.ts +44 -2
- package/dist/channel/adapters/discord.js +526 -78
- package/dist/channel/adapters/discord.js.map +1 -1
- package/dist/channel/adapters/telegram.d.ts +30 -0
- package/dist/channel/adapters/telegram.js +221 -19
- package/dist/channel/adapters/telegram.js.map +1 -1
- package/dist/channel/agy-mcp-launcher.d.ts +2 -0
- package/dist/channel/agy-mcp-launcher.js +28 -0
- package/dist/channel/agy-mcp-launcher.js.map +1 -0
- package/dist/channel/ipc-bridge.d.ts +2 -1
- package/dist/channel/ipc-bridge.js +33 -4
- package/dist/channel/ipc-bridge.js.map +1 -1
- package/dist/channel/mcp-server.js +28 -25
- package/dist/channel/mcp-server.js.map +1 -1
- package/dist/channel/mcp-tools.js +4 -2
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/channel/message-queue.js +62 -1
- package/dist/channel/message-queue.js.map +1 -1
- package/dist/channel/types.d.ts +31 -1
- package/dist/classic-channel-manager.d.ts +61 -3
- package/dist/classic-channel-manager.js +256 -31
- package/dist/classic-channel-manager.js.map +1 -1
- package/dist/cli.js +109 -37
- package/dist/cli.js.map +1 -1
- package/dist/config-validator.js +48 -7
- package/dist/config-validator.js.map +1 -1
- package/dist/config.d.ts +4 -0
- package/dist/config.js +12 -1
- package/dist/config.js.map +1 -1
- package/dist/cross-instance-envelope.d.ts +6 -0
- package/dist/cross-instance-envelope.js +30 -0
- package/dist/cross-instance-envelope.js.map +1 -0
- package/dist/daemon.d.ts +429 -9
- package/dist/daemon.js +1843 -289
- package/dist/daemon.js.map +1 -1
- package/dist/doctor.d.ts +41 -0
- package/dist/doctor.js +267 -0
- package/dist/doctor.js.map +1 -0
- package/dist/fleet-context.d.ts +54 -0
- package/dist/fleet-manager.d.ts +398 -11
- package/dist/fleet-manager.js +2756 -499
- package/dist/fleet-manager.js.map +1 -1
- package/dist/fleet-yaml-slim.d.ts +10 -0
- package/dist/fleet-yaml-slim.js +59 -0
- package/dist/fleet-yaml-slim.js.map +1 -0
- package/dist/general-knowledge/skills/backend-providers/SKILL.md +114 -0
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +3 -1
- package/dist/general-knowledge/skills/delegation-playbook/SKILL.md +52 -0
- package/dist/general-knowledge/skills/development-workflow/SKILL.md +28 -0
- package/dist/general-knowledge/skills/fleet-config/SKILL.md +1 -0
- package/dist/general-knowledge/skills/fleet-health/SKILL.md +1 -0
- package/dist/general-knowledge/skills/fleet-restart/SKILL.md +1 -0
- package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +1 -0
- package/dist/general-knowledge/skills/model-discovery/SKILL.md +64 -16
- package/dist/general-knowledge/skills/multi-channel/SKILL.md +1 -0
- package/dist/general-knowledge/skills/scheduling/SKILL.md +1 -0
- package/dist/general-knowledge/skills/session-management/SKILL.md +172 -8
- package/dist/general-knowledge/skills/tui-effort/SKILL.md +1 -0
- package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +30 -0
- package/dist/instance-lifecycle.d.ts +99 -0
- package/dist/instance-lifecycle.js +339 -11
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/instructions.d.ts +12 -0
- package/dist/instructions.js +35 -1
- package/dist/instructions.js.map +1 -1
- package/dist/locale.js +1004 -288
- package/dist/locale.js.map +1 -1
- package/dist/login-flows.d.ts +91 -0
- package/dist/login-flows.js +170 -0
- package/dist/login-flows.js.map +1 -0
- package/dist/login-manager.d.ts +63 -0
- package/dist/login-manager.js +134 -0
- package/dist/login-manager.js.map +1 -0
- package/dist/network-family.d.ts +18 -0
- package/dist/network-family.js +20 -0
- package/dist/network-family.js.map +1 -0
- package/dist/outbound-handlers.d.ts +8 -0
- package/dist/outbound-handlers.js +101 -18
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +7 -1
- package/dist/outbound-schemas.js +9 -0
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/pane-input-residue.d.ts +52 -0
- package/dist/pane-input-residue.js +107 -0
- package/dist/pane-input-residue.js.map +1 -0
- package/dist/reply-dedup.d.ts +7 -8
- package/dist/reply-dedup.js +0 -0
- package/dist/reply-dedup.js.map +1 -1
- package/dist/restart-progress.d.ts +2 -0
- package/dist/restart-progress.js +3 -0
- package/dist/restart-progress.js.map +1 -1
- package/dist/scheduler/db.d.ts +12 -0
- package/dist/scheduler/db.js +59 -0
- package/dist/scheduler/db.js.map +1 -1
- package/dist/service-installer.d.ts +11 -0
- package/dist/service-installer.js +84 -18
- package/dist/service-installer.js.map +1 -1
- package/dist/settings-api.js +1 -1
- package/dist/settings-api.js.map +1 -1
- package/dist/setup-wizard.js +2 -2
- package/dist/setup-wizard.js.map +1 -1
- package/dist/spawn-gate.d.ts +30 -0
- package/dist/spawn-gate.js +79 -0
- package/dist/spawn-gate.js.map +1 -0
- package/dist/storm-window.d.ts +83 -0
- package/dist/storm-window.js +251 -0
- package/dist/storm-window.js.map +1 -0
- package/dist/tips.d.ts +44 -0
- package/dist/tips.js +355 -0
- package/dist/tips.js.map +1 -0
- package/dist/tmux-manager.d.ts +16 -0
- package/dist/tmux-manager.js +110 -25
- package/dist/tmux-manager.js.map +1 -1
- package/dist/tool-progress.d.ts +40 -0
- package/dist/tool-progress.js +289 -0
- package/dist/tool-progress.js.map +1 -0
- package/dist/topic-commands.d.ts +42 -4
- package/dist/topic-commands.js +372 -67
- package/dist/topic-commands.js.map +1 -1
- package/dist/transcript-monitor.d.ts +15 -2
- package/dist/transcript-monitor.js +63 -17
- package/dist/transcript-monitor.js.map +1 -1
- package/dist/transcript-sources.d.ts +131 -0
- package/dist/transcript-sources.js +580 -0
- package/dist/transcript-sources.js.map +1 -0
- package/dist/types.d.ts +13 -0
- package/dist/ui/dashboard.html +55 -32
- package/dist/ui/settings.html +200 -60
- package/dist/ui/view.html +147 -30
- package/dist/usage/format-rich.d.ts +1 -1
- package/dist/usage/format-rich.js +28 -24
- package/dist/usage/format-rich.js.map +1 -1
- package/dist/usage/i18n-keys.d.ts +7 -0
- package/dist/usage/i18n-keys.js +34 -0
- package/dist/usage/i18n-keys.js.map +1 -0
- package/dist/usage/i18n.d.ts +5 -0
- package/dist/usage/i18n.js +27 -0
- package/dist/usage/i18n.js.map +1 -0
- package/dist/usage/providers.d.ts +21 -0
- package/dist/usage/providers.js +153 -75
- package/dist/usage/providers.js.map +1 -1
- package/dist/usage/usage-api.d.ts +11 -3
- package/dist/usage/usage-api.js +61 -24
- package/dist/usage/usage-api.js.map +1 -1
- package/dist/workflow-templates/default.md +2 -1
- package/package.json +2 -2
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: worker-collaboration
|
|
3
|
+
description: Complete assigned fleet work as a worker, report the result to the assigning instance, and request missing information without taking over coordinator duties.
|
|
4
|
+
roles: [worker]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Worker Collaboration
|
|
8
|
+
|
|
9
|
+
## Complete assigned work
|
|
10
|
+
|
|
11
|
+
- Treat the assignment as the full scope unless the sender explicitly expands it.
|
|
12
|
+
- Work without acknowledgment-only messages. Silence means the task is in progress.
|
|
13
|
+
- Do not call `delegate_task`; delegation and fleet orchestration belong to General.
|
|
14
|
+
|
|
15
|
+
## Request missing information
|
|
16
|
+
|
|
17
|
+
Use `request_information` only when a concrete missing fact blocks safe progress. Ask the assigning instance one focused question and preserve the task correlation ID when the tool supports it.
|
|
18
|
+
|
|
19
|
+
Do not resend after a timeout without checking delivery evidence. A timeout can mean the request was queued or delivered while the caller stopped waiting.
|
|
20
|
+
|
|
21
|
+
## Report the result
|
|
22
|
+
|
|
23
|
+
Call `report_result` exactly once when the assignment is complete or genuinely blocked. Send it to the assigning instance with the original correlation ID. Include:
|
|
24
|
+
|
|
25
|
+
- the conclusion or delivered artifact;
|
|
26
|
+
- material changes and file paths;
|
|
27
|
+
- tests or checks run and their results;
|
|
28
|
+
- remaining risk, blocker, or follow-up, if any.
|
|
29
|
+
|
|
30
|
+
Do not put user-facing results only in terminal text; the fleet report is the delivery channel.
|
|
@@ -5,6 +5,10 @@ import type { IpcClient } from "./channel/ipc-bridge.js";
|
|
|
5
5
|
import type { EventLog } from "./event-log.js";
|
|
6
6
|
import type { TmuxControlClient } from "./tmux-control.js";
|
|
7
7
|
import type { FleetInstructionsParams } from "./instructions.js";
|
|
8
|
+
import { type ProviderUsage } from "./usage/providers.js";
|
|
9
|
+
import type { SpawnGate } from "./spawn-gate.js";
|
|
10
|
+
import type { StormWindow } from "./storm-window.js";
|
|
11
|
+
import type { BackendOutageTracker } from "./backend-outage.js";
|
|
8
12
|
export { isFleetStartCommandLine } from "./fleet-lock.js";
|
|
9
13
|
export interface BackendInstallationInfo {
|
|
10
14
|
binary: string;
|
|
@@ -34,7 +38,21 @@ export interface LifecycleContext {
|
|
|
34
38
|
readonly sessionRegistry: Map<string, string>;
|
|
35
39
|
readonly eventLog: EventLog | null;
|
|
36
40
|
readonly controlClient: TmuxControlClient | null;
|
|
41
|
+
readonly spawnGate?: SpawnGate;
|
|
42
|
+
readonly stormWindow?: StormWindow;
|
|
43
|
+
/** Fleet-level backend reachability memory (see backend-outage.ts). */
|
|
44
|
+
readonly backendOutage?: BackendOutageTracker;
|
|
37
45
|
getInstanceDir(name: string): string;
|
|
46
|
+
/** Fleet-level (General topic) notification, throttled per message text. */
|
|
47
|
+
notifyFleetError?(text: string): void;
|
|
48
|
+
/** Hand a failed/blocked instance to the fleet's delayed automatic startup retry. */
|
|
49
|
+
scheduleStartupRetry?(name: string, attempt: number): void;
|
|
50
|
+
/**
|
|
51
|
+
* Stop THIS daemon (identity-checked) and schedule the delayed startup retry,
|
|
52
|
+
* serialized against operator stop/restart so neither can be undone by the
|
|
53
|
+
* other. Fleet-owned; the lifecycle falls back to stopIfCurrent without it.
|
|
54
|
+
*/
|
|
55
|
+
handOffToStartupRetry?(name: string, daemon: unknown): Promise<void>;
|
|
38
56
|
saveFleetConfig(): void;
|
|
39
57
|
/** Full stop+start. freshStart forces the respawn to skip session resume. */
|
|
40
58
|
restartSingleInstance(name: string, opts?: {
|
|
@@ -57,6 +75,8 @@ export interface LifecycleContext {
|
|
|
57
75
|
isClassicInstance?(name: string): boolean;
|
|
58
76
|
/** True while the fleet is stopping on purpose or an `agend update` is running. */
|
|
59
77
|
isPlannedRestart(): boolean;
|
|
78
|
+
/** Suppress only incident kinds caused by the active tmux server storm. */
|
|
79
|
+
stormSuppressed?(kind: string): boolean;
|
|
60
80
|
/** List claimed tasks for an instance (from task board). Returns empty array if unavailable. */
|
|
61
81
|
listClaimedTasks(assignee: string): Array<{
|
|
62
82
|
id: string;
|
|
@@ -66,6 +86,10 @@ export interface LifecycleContext {
|
|
|
66
86
|
checkModelFailover(name: string, fiveHourPct: number): void;
|
|
67
87
|
/** Retire (delete) any pending Cancel button for an instance. No-op if none. */
|
|
68
88
|
clearCancelButton(name: string): void;
|
|
89
|
+
/** Test/integration seam for the non-LLM Codex quota second opinion. */
|
|
90
|
+
verifyCodexQuota?(): Promise<CodexQuotaVerdict>;
|
|
91
|
+
/** Test/integration seam for the non-LLM Claude quota second opinion. */
|
|
92
|
+
verifyClaudeQuota?(): Promise<ClaudeQuotaVerdict>;
|
|
69
93
|
startStatuslineWatcher(name: string): void;
|
|
70
94
|
stopStatuslineWatcher(name: string): void;
|
|
71
95
|
reactMessageStatus(instanceName: string, chatId: string, messageId: string, emoji: string): void;
|
|
@@ -88,6 +112,8 @@ export interface LifecycleCreateArgs {
|
|
|
88
112
|
description?: string;
|
|
89
113
|
model?: string;
|
|
90
114
|
backend?: string;
|
|
115
|
+
/** Backend-specific launch options, e.g. { codex: { provider: "glm" } }. */
|
|
116
|
+
backend_options?: Record<string, Record<string, unknown>>;
|
|
91
117
|
branch?: string;
|
|
92
118
|
detach?: boolean;
|
|
93
119
|
worktree_path?: string;
|
|
@@ -111,12 +137,45 @@ export interface LifecycleReplaceArgs {
|
|
|
111
137
|
name: string;
|
|
112
138
|
reason?: string;
|
|
113
139
|
}
|
|
140
|
+
export type CodexQuotaVerdict = "available" | "exhausted" | "unknown";
|
|
141
|
+
type CodexUsageResult = Omit<ProviderUsage, "id" | "name">;
|
|
142
|
+
export type ClaudeQuotaVerdict = "available" | "exhausted" | "unknown";
|
|
143
|
+
type ClaudeUsageResult = Omit<ProviderUsage, "id" | "name">;
|
|
144
|
+
/**
|
|
145
|
+
* Convert the live Codex usage row into a conservative quota verdict. A
|
|
146
|
+
* successful response with at least one window below 100% proves that stale
|
|
147
|
+
* terminal text is no longer current only when no other window is exhausted.
|
|
148
|
+
* Missing credentials, API errors, and metric-less responses prove nothing.
|
|
149
|
+
*/
|
|
150
|
+
export declare function codexQuotaVerdictFromUsage(usage: CodexUsageResult): CodexQuotaVerdict;
|
|
151
|
+
/** Run only the Codex usage provider, bounded independently of its network timeout. */
|
|
152
|
+
export declare function verifyCodexQuotaStatus(fetchUsage?: () => Promise<CodexUsageResult>, timeoutMs?: number): Promise<CodexQuotaVerdict>;
|
|
153
|
+
/**
|
|
154
|
+
* Convert a LIVE Claude usage API row into a conservative verdict. The
|
|
155
|
+
* provider can degrade to statusline data when the network/API is unavailable;
|
|
156
|
+
* that fallback is intentionally unknown because stale local limits cannot
|
|
157
|
+
* disprove a current API credit-balance error.
|
|
158
|
+
*/
|
|
159
|
+
export declare function claudeQuotaVerdictFromUsage(usage: ClaudeUsageResult): ClaudeQuotaVerdict;
|
|
160
|
+
/** Run only the Claude usage provider, bounded independently of its network timeout. */
|
|
161
|
+
export declare function verifyClaudeQuotaStatus(fetchUsage?: () => Promise<ClaudeUsageResult>, timeoutMs?: number): Promise<ClaudeQuotaVerdict>;
|
|
114
162
|
export declare class InstanceLifecycle {
|
|
115
163
|
private ctx;
|
|
116
164
|
/** Active daemon processes: instanceName → Daemon */
|
|
117
165
|
readonly daemons: Map<string, import("./daemon.js").Daemon>;
|
|
118
166
|
/** backend → last auth-error alert time, so one expiry sends one alert. */
|
|
119
167
|
private lastAuthAlertAt;
|
|
168
|
+
/**
|
|
169
|
+
* backend → cached token-free auth verification (see AUTH_VERIFY_CACHE_MS).
|
|
170
|
+
* The PROMISE is cached, not the result: a shared credential expiring makes
|
|
171
|
+
* every instance of the backend fire in the same tick, and they must join
|
|
172
|
+
* one in-flight check instead of each spawning their own.
|
|
173
|
+
*/
|
|
174
|
+
private authVerifyCache;
|
|
175
|
+
/** Same-tick Codex quota alerts join one live usage probe. */
|
|
176
|
+
private codexQuotaVerifyInFlight;
|
|
177
|
+
/** Same-tick Claude quota alerts join one live usage probe. */
|
|
178
|
+
private claudeQuotaVerifyInFlight;
|
|
120
179
|
/**
|
|
121
180
|
* Minimum gap between MCP-revival auto-restarts of one instance. Kept here —
|
|
122
181
|
* not in the daemon — because each restart replaces the daemon object, which
|
|
@@ -143,6 +202,27 @@ export declare class InstanceLifecycle {
|
|
|
143
202
|
private notifyIncident;
|
|
144
203
|
/** Backend a running instance uses (config → fleet default). */
|
|
145
204
|
private backendOf;
|
|
205
|
+
/**
|
|
206
|
+
* Confirm a pane-detected auth error with the backend's token-free status
|
|
207
|
+
* probe before pausing anything: pattern matching over terminal text also
|
|
208
|
+
* fires on an agent DISCUSSING a 401. "valid" means false positive — ignore.
|
|
209
|
+
* "invalid" and "unknown" (timeout, missing binary) both pause: for a
|
|
210
|
+
* suspected expiry, pausing too much is recoverable, delivering into a dead
|
|
211
|
+
* CLI is not. Cached per backend so simultaneous alerts run one check.
|
|
212
|
+
*/
|
|
213
|
+
private verifyAuthError;
|
|
214
|
+
private verifyCodexQuota;
|
|
215
|
+
private verifyClaudeQuota;
|
|
216
|
+
/** Same verification keyed by backend (used by startup pre-flight priming). */
|
|
217
|
+
verifyBackendAuth(backend: string): Promise<"valid" | "invalid" | "unknown">;
|
|
218
|
+
/**
|
|
219
|
+
* Startup pre-flight: warm the per-backend auth verification cache so the
|
|
220
|
+
* detectors that fire seconds later (login-screen scan, MCP-died gate) get an
|
|
221
|
+
* instant answer. Advisory only — a pre-flight result alone never pauses
|
|
222
|
+
* anything, because e.g. codex on a custom provider runs fine while
|
|
223
|
+
* `codex login status` reports logged out (live-verified on this fleet).
|
|
224
|
+
*/
|
|
225
|
+
primeAuthVerification(backends: Iterable<string>): void;
|
|
146
226
|
/**
|
|
147
227
|
* One alert per backend per cooldown, naming every affected instance — a CLI's
|
|
148
228
|
* credentials are shared, so N instances failing is ONE problem with ONE fix
|
|
@@ -150,6 +230,13 @@ export declare class InstanceLifecycle {
|
|
|
150
230
|
* instances, so the fleet-level map does it here.
|
|
151
231
|
*/
|
|
152
232
|
private notifyAuthErrorOnce;
|
|
233
|
+
/**
|
|
234
|
+
* A fleet-wide backend outage (see backend-outage.ts): record the sighting so
|
|
235
|
+
* startup stops spending `--resume` attempts on it, and notify ONCE per
|
|
236
|
+
* outage at fleet level — kiro prints the line every 10s on every instance,
|
|
237
|
+
* so per-instance incidents would be N × (one message per cooldown).
|
|
238
|
+
*/
|
|
239
|
+
private noteBackendOutage;
|
|
153
240
|
/**
|
|
154
241
|
* System errors from a ClassicBot belong in the operator's General topic,
|
|
155
242
|
* never in the end user's chat channel. Fleet-topic instances retain their
|
|
@@ -169,6 +256,18 @@ export declare class InstanceLifecycle {
|
|
|
169
256
|
getLastPausedAt(name: string): number | null;
|
|
170
257
|
pause(name: string): Promise<void>;
|
|
171
258
|
wake(name: string, timeoutMs?: number): Promise<void>;
|
|
259
|
+
/**
|
|
260
|
+
* Ownership boundary for a daemon that is not yet registered: if start()
|
|
261
|
+
* rejects, nothing else will ever dispose it, so do it here before
|
|
262
|
+
* rethrowing. The abort is best-effort — the start error is the one to
|
|
263
|
+
* surface.
|
|
264
|
+
*/
|
|
265
|
+
static startOrDispose(daemon: {
|
|
266
|
+
start(): Promise<void>;
|
|
267
|
+
abortStartup(): Promise<void>;
|
|
268
|
+
}, name: string, logger: Logger): Promise<void>;
|
|
269
|
+
/** Stop the registered daemon only if it is still `daemon` (a concurrent restart may have replaced it). */
|
|
270
|
+
stopIfCurrent(name: string, daemon: unknown): Promise<boolean>;
|
|
172
271
|
stop(name: string): Promise<void>;
|
|
173
272
|
remove(name: string): Promise<void>;
|
|
174
273
|
/** Handle create_instance tool call from a daemon. */
|