@zgeoff/atc 2.15.0 → 2.15.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/package.json +2 -1
- package/src/agents/agent-adapter.ts +3 -38
- package/src/agents/build-hook-settings.ts +1 -1
- package/src/agents/claude-adapter.ts +3 -3
- package/src/agents/codex-adapter.ts +3 -3
- package/src/agents/gateway-adapter.ts +3 -3
- package/src/agents/grok-adapter.ts +3 -3
- package/src/agents/start-claude-headless-run.ts +1 -1
- package/src/client/boot-daemon.ts +2 -2
- package/src/client/collect-agent-picks.ts +1 -1
- package/src/client/daemon-client.ts +2 -1
- package/src/client/format-overlay-agent-mark.ts +1 -1
- package/src/client/index.ts +4 -2
- package/src/client/pick-tab-target.ts +2 -2
- package/src/client/spawn-picker.ts +1 -1
- package/src/client/to-mirror-session.ts +3 -3
- package/src/client/ui.ts +3 -3
- package/src/daemon/build-message-trail-entry.ts +1 -1
- package/src/daemon/build-report-trail-entry.ts +1 -1
- package/src/daemon/build-scoped-context.ts +1 -1
- package/src/daemon/build-session-message-event.ts +1 -1
- package/src/daemon/daemon-connection.ts +4 -237
- package/src/daemon/daemon-context.ts +240 -0
- package/src/daemon/daemon.ts +9 -5
- package/src/daemon/execution-provider.ts +12 -0
- package/src/daemon/hooks.ts +1 -7
- package/src/daemon/idempotency-ledger.ts +78 -18
- package/src/daemon/imp-harness.ts +41 -0
- package/src/daemon/local-pty-provider.ts +45 -0
- package/src/daemon/parse-hook-line.ts +1 -1
- package/src/daemon/sessions.ts +116 -104
- package/src/daemon/start-headless-turn.ts +3 -3
- package/src/daemon/start-session-bridge.ts +2 -2
- package/src/mcp/collect-clients.ts +1 -1
- package/src/mcp/collect-grants.ts +1 -1
- package/src/mcp/find-client-name.ts +1 -1
- package/src/mcp/mcp-auth-schema.ts +37 -0
- package/src/mcp/open-mcp-auth.ts +2 -2
- package/src/mcp/reconnecting-caller.ts +15 -6
- package/src/mcp/remove-client.ts +1 -1
- package/src/mcp/revoke-grant.ts +1 -1
- package/src/mcp/types.ts +0 -38
- package/src/mcp-http-server.ts +2 -1
- package/src/protocol/adapter-event.ts +25 -0
- package/src/protocol/count-session-states.ts +16 -0
- package/src/protocol/daemon-channel.ts +17 -0
- package/src/protocol/hook-event.ts +11 -0
- package/src/protocol/pinned-group-key.ts +2 -0
- package/src/protocol/session-state.ts +5 -0
- package/src/protocol/sort-grouped-session-views.ts +29 -0
- package/src/protocol/sort-session-views.ts +41 -0
- package/src/protocol/sortable-session-view.ts +13 -0
- package/src/shared/agent-id.ts +6 -0
- package/src/shared/collect-gateways.ts +1 -1
- package/src/shared/to-agent-id.ts +11 -0
- package/src/store/fleet-entry.ts +2 -2
- package/src/store/state-store.ts +5 -4
- /package/src/{store → shared}/bun-sqlite-driver.ts +0 -0
- /package/src/{agents → shared}/truncate-detail.ts +0 -0
- /package/src/{daemon → shared}/truncate-summary.ts +0 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { SessionState } from './session-state';
|
|
2
|
+
import type { SortableSessionView } from './sortable-session-view';
|
|
3
|
+
|
|
4
|
+
// Overlay order: pinned sessions first in most-recently-attached order, then
|
|
5
|
+
// everyone else by urgency — who needs you, finished turns, busy, dead —
|
|
6
|
+
// with most-recently-attached breaking ties inside each state. A
|
|
7
|
+
// sub-session sits directly under its parent, ranked among its siblings
|
|
8
|
+
// alone, so its attention never moves the parent's row; a sub-session whose
|
|
9
|
+
// parent is not listed ranks as a top-level row.
|
|
10
|
+
export function sortSessionViews<T extends SortableSessionView>(list: readonly T[]): T[] {
|
|
11
|
+
const rank: Record<SessionState, number> = {
|
|
12
|
+
needs_you: 0,
|
|
13
|
+
done: 1,
|
|
14
|
+
running: 2,
|
|
15
|
+
exited: 3,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const ranked = [...list].toSorted((a, b) => {
|
|
19
|
+
if (a.pinned !== b.pinned) {
|
|
20
|
+
return a.pinned ? -1 : 1;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const recency = b.lastAttachedAt - a.lastAttachedAt || b.createdAt - a.createdAt;
|
|
24
|
+
|
|
25
|
+
return a.pinned ? recency : rank[a.state] - rank[b.state] || recency;
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const listed = new Set(ranked.map((s) => s.id));
|
|
29
|
+
|
|
30
|
+
const sorted: T[] = [];
|
|
31
|
+
|
|
32
|
+
for (const s of ranked) {
|
|
33
|
+
if (s.parent !== null && listed.has(s.parent)) {
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
sorted.push(s, ...ranked.filter((child) => child.parent === s.id));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return sorted;
|
|
41
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SessionState } from './session-state';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The fields of a session row that the overlay orders by.
|
|
5
|
+
*/
|
|
6
|
+
export interface SortableSessionView {
|
|
7
|
+
readonly id: string;
|
|
8
|
+
readonly parent: string | null;
|
|
9
|
+
readonly state: SessionState;
|
|
10
|
+
readonly pinned: boolean;
|
|
11
|
+
readonly lastAttachedAt: number;
|
|
12
|
+
readonly createdAt: number;
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AgentID } from './agent-id';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Missing and empty values become Claude so a fleet written before the agent
|
|
5
|
+
* column still restores as Claude. Any other string is returned as it stands,
|
|
6
|
+
* registered or not: an id whose adapter is gone must reach the caller intact
|
|
7
|
+
* so the session can be shown and refused, never quietly run as Claude.
|
|
8
|
+
*/
|
|
9
|
+
export function toAgentID(raw: unknown): AgentID {
|
|
10
|
+
return typeof raw === 'string' && raw !== '' ? raw : 'claude';
|
|
11
|
+
}
|
package/src/store/fleet-entry.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
import type { AgentID } from '../agents/agent-adapter';
|
|
2
|
+
import type { AgentID } from '../shared/agent-id';
|
|
4
3
|
import type { AgentSessionID } from '../shared/agent-session-id';
|
|
5
4
|
import { buildOptionalBoolean } from '../shared/build-optional-boolean';
|
|
6
5
|
import { buildOptionalString } from '../shared/build-optional-string';
|
|
7
6
|
import type { DaemonID } from '../shared/daemon-id';
|
|
8
7
|
import { isRecord } from '../shared/report';
|
|
9
8
|
import type { SessionID } from '../shared/session-id';
|
|
9
|
+
import { toAgentID } from '../shared/to-agent-id';
|
|
10
10
|
import { toAgentSessionID } from '../shared/to-agent-session-id';
|
|
11
11
|
import type { SessionWorkspace } from './workspace-materialization';
|
|
12
12
|
|
package/src/store/state-store.ts
CHANGED
|
@@ -3,19 +3,20 @@ import { randomUUID } from 'node:crypto';
|
|
|
3
3
|
import { existsSync, readFileSync } from 'node:fs';
|
|
4
4
|
import { Kysely, SqliteAdapter, SqliteIntrospector, SqliteQueryCompiler, sql } from 'kysely';
|
|
5
5
|
import type { Expression, ExpressionBuilder, SqlBool, Transaction } from 'kysely';
|
|
6
|
-
import {
|
|
7
|
-
import type { AdapterEvent, AgentID } from '../agents/agent-adapter';
|
|
8
|
-
import type { HookEvent } from '../daemon/hooks';
|
|
6
|
+
import type { AdapterEvent } from '../protocol/adapter-event';
|
|
9
7
|
import { DaemonError } from '../protocol/daemon-error';
|
|
8
|
+
import type { HookEvent } from '../protocol/hook-event';
|
|
9
|
+
import type { AgentID } from '../shared/agent-id';
|
|
10
10
|
import type { AgentSessionID } from '../shared/agent-session-id';
|
|
11
|
+
import { BunSqliteDriver } from '../shared/bun-sqlite-driver';
|
|
11
12
|
import type { DaemonID } from '../shared/daemon-id';
|
|
12
13
|
import type { MessageID } from '../shared/message-id';
|
|
13
14
|
import type { SessionID } from '../shared/session-id';
|
|
15
|
+
import { toAgentID } from '../shared/to-agent-id';
|
|
14
16
|
import { toAgentSessionID } from '../shared/to-agent-session-id';
|
|
15
17
|
import { toDaemonID } from '../shared/to-daemon-id';
|
|
16
18
|
import { toMessageID } from '../shared/to-message-id';
|
|
17
19
|
import { toSessionID } from '../shared/to-session-id';
|
|
18
|
-
import { BunSqliteDriver } from './bun-sqlite-driver';
|
|
19
20
|
import { parseFleetEntry } from './fleet-entry';
|
|
20
21
|
import type { FleetEntry, FleetEntryUpdate, LegacyFleetEntry } from './fleet-entry';
|
|
21
22
|
import type { EffectTarget, IdempotencyClaim, IdempotencyRecord } from './idempotency-record';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|