agl 43.3.0 → 43.3.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/changelog.md +9 -0
- package/dist_serve/bundle.js +2 -2
- package/dist_serve/bundle.js.map +2 -2
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/classes.authstore.d.ts +7 -0
- package/dist_ts/classes.authstore.js +9 -1
- package/dist_ts/classes.claudeharness.d.ts +13 -2
- package/dist_ts/classes.claudeharness.js +12 -5
- package/dist_ts/classes.controller.d.ts +27 -6
- package/dist_ts/classes.controller.js +136 -39
- package/dist_ts/classes.mcpcontrollerhost.js +4 -1
- package/dist_ts/classes.mcptools.js +6 -1
- package/dist_ts/classes.nativesessions.d.ts +12 -0
- package/dist_ts/classes.nativesessions.js +1 -1
- package/dist_ts/classes.workercallers.js +4 -2
- package/dist_ts/driver/classes.directreports.js +19 -19
- package/dist_ts/driver/classes.directreportstore.d.ts +8 -1
- package/dist_ts/driver/classes.directreportstore.js +20 -10
- package/dist_ts/fleet/classes.workers.d.ts +16 -0
- package/dist_ts/fleet/classes.workers.js +73 -39
- package/dist_ts/fleet/classes.workerstore.js +14 -8
- package/dist_ts/fleet/functions.workervalidation.js +10 -3
- package/dist_ts/fleet/interfaces.workers.d.ts +6 -2
- package/dist_ts/fleet/interfaces.workers.js +8 -4
- package/dist_ts/functions.deviceapi.d.ts +50 -3
- package/dist_ts/functions.deviceapi.js +174 -7
- package/dist_ts/functions.exactpersistence.d.ts +3 -0
- package/dist_ts/functions.exactpersistence.js +4 -0
- package/dist_ts/functions.mcpfleetworkertools.js +2 -2
- package/dist_ts/functions.ticketactor.d.ts +17 -1
- package/dist_ts/functions.ticketactor.js +55 -15
- package/dist_ts_interfaces/devices.d.ts +17 -4
- package/dist_ts_interfaces/devices.js +1 -1
- package/dist_ts_interfaces/fleetworkers.d.ts +32 -7
- package/dist_ts_interfaces/fleetworkers.js +19 -8
- package/dist_ts_interfaces/workercallers.d.ts +2 -0
- package/dist_ts_migration/classes.documentmigrationrunner.d.ts +14 -0
- package/dist_ts_migration/classes.documentmigrationrunner.js +20 -1
- package/dist_ts_migration/index.d.ts +1 -0
- package/dist_ts_migration/index.js +2 -1
- package/dist_ts_migration/v43_ticketactornames.d.ts +32 -0
- package/dist_ts_migration/v43_ticketactornames.js +236 -0
- package/package.json +1 -1
- package/readme.md +34 -3
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.authstore.ts +10 -0
- package/ts/classes.claudeharness.ts +18 -4
- package/ts/classes.controller.ts +142 -40
- package/ts/classes.mcpcontrollerhost.ts +3 -0
- package/ts/classes.mcptools.ts +5 -0
- package/ts/classes.nativesessions.ts +13 -0
- package/ts/classes.workercallers.ts +3 -1
- package/ts/driver/classes.directreports.ts +18 -18
- package/ts/driver/classes.directreportstore.ts +20 -9
- package/ts/fleet/classes.workers.ts +66 -39
- package/ts/fleet/classes.workerstore.ts +11 -7
- package/ts/fleet/functions.workervalidation.ts +7 -2
- package/ts/fleet/interfaces.workers.ts +6 -2
- package/ts/functions.deviceapi.ts +227 -6
- package/ts/functions.exactpersistence.ts +5 -0
- package/ts/functions.mcpfleetworkertools.ts +1 -1
- package/ts/functions.ticketactor.ts +58 -14
- package/ts_interfaces/devices.schema.json +5 -2
- package/ts_interfaces/devices.ts +20 -4
- package/ts_interfaces/fleetworkers.ts +33 -7
- package/ts_interfaces/workercallers.ts +2 -0
- package/ts_migration/classes.documentmigrationrunner.ts +21 -0
- package/ts_migration/index.ts +1 -0
- package/ts_migration/v43_ticketactornames.ts +225 -0
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements.fleetworker.ts +4 -2
|
@@ -15,7 +15,7 @@ const descriptions = {
|
|
|
15
15
|
list: 'List this owner\'s fleet workers as summaries, newest first, in pages of limit (1-100, default 50): identity, ticket, state, native id, cwd, the native status, newest turn outcome and native wait last observed, and fence flags (an unresolved dispatch with its action and since, a lost or reconfirmed dispatch, a recorded error). total, fenced and failed (recorded errors and failed turn outcomes) count the whole filtered set, so a page never hides a fence. Continue with nextCursor and the same filter (archived, ticketKey, state, harness); a cursor of another filter or one after a worker no longer held as it was is refused. view full returns every full record unpaged; fleet_worker_get returns one worker whole.',
|
|
16
16
|
get: 'Read one of this owner\'s fleet workers, archived ones included, by name or id: its full record (dispatch fence, lost, reconfirmed and re-bind resolutions with their attribution and proof, error) and the native status, turn outcome and start, native wait and excerpt the controller last observed.',
|
|
17
17
|
status: 'Read a fleet operation job (the handle a fleet_worker_* action returns), not a host job. Jobs are transient; bindings and unresolved dispatches survive restart. Inspect unknown native outcomes before retrying.',
|
|
18
|
-
'job-wait': 'Wait until a fleet operation job (the handle a fleet_worker_* action returns, not a host job) succeeds or fails, or timeoutMs (at most 240000) passes; timedOut tells which. Waiting, a timeout or an abandoned wait never cancels the job. A job the controller no longer holds (jobs end with a controller restart or eviction) is JOB_UNAVAILABLE, not failed: read the worker with fleet_worker_get.',
|
|
18
|
+
'job-wait': 'Wait until a fleet operation job (the handle a fleet_worker_* action returns, not a host job) succeeds or fails, or timeoutMs (at most 240000) passes; timedOut tells which. Waiting, a timeout or an abandoned wait never cancels the job. A job the controller no longer holds (jobs end with a controller restart or eviction) is JOB_UNAVAILABLE, not failed: read the worker with fleet_worker_get. A failed job\'s errorOutcome is refused when nothing reached a native session, unknown when it may have (a steer may have been delivered): never repeat an unknown one before reading the worker.',
|
|
19
19
|
'native-message': 'Reach a Claude Code background job that no fleet worker binds with an attributed message, through Claude Code itself, as the browser\'s native session send does: a settled (done, blocked or stopped) job is woken with it (`claude --bg --resume <id> <text>`), a running one takes it in its inbox through Claude Code\'s own SendMessage, accepted and queued there, not yet read. nativeId is the full session id or a unique prefix of at least 8 characters; an ambiguous prefix is refused. A running job without a session name of its own (none, or one another running session shares), a failed or held job, a fleet worker\'s session and a project conversation are refused with their reason. The message arrives behind the same attribution header as session_message, naming the sender label and the local owner capability, never as the job\'s user. It holds no dispatch fence, writes no ticket comment and does not observe the turn that reads it; the receipt (delivery native-wake or native-inbox) names the command that adopts the job as a fleet worker. Returns a job handle; an unknown outcome is never retried.',
|
|
20
20
|
watch: 'Read the one bounded fleet event stream: worker turn endings, reports during turns, reaped Claude worker observations, release outcomes, and host load. Continue with the returned epoch/cursor; reset explicitly signals restart or retained-history gaps.',
|
|
21
21
|
};
|
|
@@ -47,4 +47,4 @@ export const waitForFleetWorkerJob = async (slice, timeoutMs, monotonicNow = ()
|
|
|
47
47
|
return result;
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
50
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZnVuY3Rpb25zLm1jcGZsZWV0d29ya2VydG9vbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9mdW5jdGlvbnMubWNwZmxlZXR3b3JrZXJ0b29scy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLGNBQWMsQ0FBQztBQUN4QyxPQUFPLEVBQUUseUJBQXlCLEVBQUUsTUFBTSx1Q0FBdUMsQ0FBQztBQUNsRixPQUFPLEVBQUUsc0JBQXNCLEVBQXNELE1BQU0sa0NBQWtDLENBQUM7QUFFOUgsTUFBTSxZQUFZLEdBQXVDO0lBQ3ZELEtBQUssRUFBRSw0SkFBNEo7SUFDbkssS0FBSyxFQUFFLHExQkFBcTFCO0lBQzUxQixjQUFjLEVBQUUsK1JBQStSO0lBQy9TLFNBQVMsRUFBRSxxWkFBcVo7SUFDaGEsS0FBSyxFQUFFLGdWQUFnVjtJQUN2VixNQUFNLEVBQUUsNk5BQTZOO0lBQ3JPLElBQUksRUFBRSwwRkFBMEY7SUFDaEcsT0FBTyxFQUFFLHFKQUFxSjtJQUM5SixPQUFPLEVBQUUsZ1hBQWdYO0lBQ3pYLElBQUksRUFBRSw4SkFBOEo7SUFDcEssSU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QUFNLENBQUMsTUFBTSx5QkFBeUIsR0FBRyxNQUFNLENBQUM7QUFDaEQ7Ozs7R0FJRztBQUNILE1BQU0sQ0FBQyxNQUFNLHFCQUFxQixHQUFHLEtBQUssRUFDeEMsS0FBdUUsRUFDdkUsU0FBaUIsRUFDakIsWUFBWSxHQUFpQixHQUFHLEVBQUUsQ0FBQyxXQUFXLENBQUMsR0FBRyxFQUFFLEVBQ1QsRUFBRTtJQUM3QyxNQUFNLFFBQVEsR0FBRyxZQUFZLEVBQUUsR0FBRyxTQUFTLENBQUM7SUFDNUMsT0FBTyxJQUFJLEVBQUUsQ0FBQztRQUNaLE1BQU0sV0FBVyxHQUFHLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQyxFQUFFLElBQUksQ0FBQyxJQUFJLENBQUMsUUFBUSxHQUFHLFlBQVksRUFBRSxDQUFDLENBQUMsQ0FBQztRQUN0RSxNQUFNLE9BQU8sR0FBRyxJQUFJLENBQUMsR0FBRyxDQUFDLHlCQUF5QixFQUFFLFdBQVcsQ0FBQyxDQUFDO1FBQ2pFLE1BQU0sTUFBTSxHQUFHLE1BQU0sS0FBSyxDQUFDLE9BQU8sQ0FBQyxDQUFDO1FBQ3BDLElBQUksQ0FBQyxNQUFNLENBQUMsUUFBUSxJQUFJLE9BQU8sS0FBSyxXQUFXLElBQUksWUFBWSxFQUFFLElBQUksUUFBUTtZQUFFLE9BQU8sTUFBTSxDQUFDO0lBQy9GLENBQUM7QUFDSCxDQUFDLENBQUMifQ==
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
import type { TControllerSessionHarnessId } from '../dist_ts_interfaces/interfaces.js';
|
|
1
2
|
import type { IControllerMcpCaller } from '../dist_ts_interfaces/mcprequests.js';
|
|
2
3
|
import { type ITicketActor } from '../dist_ts_interfaces/tickets.js';
|
|
3
|
-
|
|
4
|
+
/**
|
|
5
|
+
* What a ticket calls a session no direct report or fleet worker names: its harness's label, never its session id. A
|
|
6
|
+
* new harness does not compile until it has one.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ticketSessionLabels: Readonly<Record<TControllerSessionHarnessId, string>>;
|
|
9
|
+
/** What a ticket calls the OpenCode runtime's caller: one server per controller, never one session (AGL-1686). */
|
|
10
|
+
export declare const ticketOpenCodeRuntimeName = "OpenCode";
|
|
11
|
+
/** The native session an MCP caller acts in, as tickets name it (`harness:nativeId`); none for a caller without one. */
|
|
12
|
+
export declare const ticketCallerSessionId: (callerArg: IControllerMcpCaller) => string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* The actor a ticket records for an MCP caller. It is named by its role, never by a session id (AGL-1686): the active
|
|
15
|
+
* direct report whose session the caller acts in (`reportNameArg`, which the caller resolves once through
|
|
16
|
+
* `DirectReports.reportOf` with `ticketCallerSessionId`), else the fleet worker's name, else its harness's label; the
|
|
17
|
+
* OpenCode runtime is "OpenCode". `id` and `sessionId` identify the actor; the name is display only.
|
|
18
|
+
*/
|
|
19
|
+
export declare const ticketActorFromCaller: (callerArg: IControllerMcpCaller, reportNameArg?: string) => ITicketActor;
|
|
@@ -1,21 +1,61 @@
|
|
|
1
1
|
import { ticketErrorMessages } from '../dist_ts_interfaces/tickets.js';
|
|
2
2
|
import { TicketError } from './classes.ticketstore.js';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* What a ticket calls a session no direct report or fleet worker names: its harness's label, never its session id. A
|
|
5
|
+
* new harness does not compile until it has one.
|
|
6
|
+
*/
|
|
7
|
+
export const ticketSessionLabels = {
|
|
8
|
+
claude: 'Claude Code session',
|
|
9
|
+
codex: 'Codex session',
|
|
10
|
+
opencode: 'OpenCode session',
|
|
11
|
+
flex: 'Flex session',
|
|
12
|
+
};
|
|
13
|
+
/** What a ticket calls the OpenCode runtime's caller: one server per controller, never one session (AGL-1686). */
|
|
14
|
+
export const ticketOpenCodeRuntimeName = 'OpenCode';
|
|
15
|
+
/** The native session an MCP caller acts in, as tickets name it (`harness:nativeId`); none for a caller without one. */
|
|
16
|
+
export const ticketCallerSessionId = (callerArg) => {
|
|
4
17
|
const subject = callerArg.subject;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
18
|
+
switch (subject.kind) {
|
|
19
|
+
case 'worker_launch': return subject.ticketSessionId;
|
|
20
|
+
case 'session': return `${subject.sessionId.harnessId}:${subject.sessionId.nativeId}`;
|
|
21
|
+
case 'terminal': return subject.agentSessionId === undefined ? undefined : `claude:${subject.agentSessionId}`;
|
|
22
|
+
case 'runtime':
|
|
23
|
+
case 'anonymous': return undefined;
|
|
24
|
+
default: {
|
|
25
|
+
const exhaustive = subject;
|
|
26
|
+
throw new Error(`Unknown MCP caller subject ${exhaustive.kind}.`);
|
|
27
|
+
}
|
|
14
28
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* The actor a ticket records for an MCP caller. It is named by its role, never by a session id (AGL-1686): the active
|
|
32
|
+
* direct report whose session the caller acts in (`reportNameArg`, which the caller resolves once through
|
|
33
|
+
* `DirectReports.reportOf` with `ticketCallerSessionId`), else the fleet worker's name, else its harness's label; the
|
|
34
|
+
* OpenCode runtime is "OpenCode". `id` and `sessionId` identify the actor; the name is display only.
|
|
35
|
+
*/
|
|
36
|
+
export const ticketActorFromCaller = (callerArg, reportNameArg) => {
|
|
37
|
+
const subject = callerArg.subject;
|
|
38
|
+
switch (subject.kind) {
|
|
39
|
+
case 'anonymous': throw new TicketError('ticket_identity_required', ticketErrorMessages.ticket_identity_required);
|
|
40
|
+
case 'worker_launch': return { id: subject.sessionIdentityId, name: reportNameArg ?? subject.workerName,
|
|
41
|
+
sessionId: subject.ticketSessionId, kind: subject.harnessId, role: 'worker' };
|
|
42
|
+
case 'session': {
|
|
43
|
+
const sessionId = `${subject.sessionId.harnessId}:${subject.sessionId.nativeId}`;
|
|
44
|
+
return { id: subject.sessionIdentityId, name: reportNameArg ?? ticketSessionLabels[subject.sessionId.harnessId], sessionId,
|
|
45
|
+
kind: subject.sessionId.harnessId === 'codex' ? 'codex' : 'worker', role: 'worker' };
|
|
46
|
+
}
|
|
47
|
+
case 'terminal': {
|
|
48
|
+
// A terminal without an agent session acts in no session.
|
|
49
|
+
if (subject.agentSessionId === undefined)
|
|
50
|
+
return { id: callerArg.auditPeerId, name: 'terminal', kind: 'worker', role: 'worker' };
|
|
51
|
+
const sessionId = `claude:${subject.agentSessionId}`;
|
|
52
|
+
return { id: sessionId, name: reportNameArg ?? ticketSessionLabels.claude, sessionId, kind: 'claude', role: 'worker' };
|
|
53
|
+
}
|
|
54
|
+
case 'runtime': return { id: callerArg.auditPeerId, name: ticketOpenCodeRuntimeName, kind: 'worker', role: 'worker' };
|
|
55
|
+
default: {
|
|
56
|
+
const exhaustive = subject;
|
|
57
|
+
throw new Error(`Unknown MCP caller subject ${exhaustive.kind}.`);
|
|
58
|
+
}
|
|
18
59
|
}
|
|
19
|
-
return { id: callerArg.auditPeerId, name: subject.kind, kind: 'worker', role: 'worker' };
|
|
20
60
|
};
|
|
21
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
61
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZnVuY3Rpb25zLnRpY2tldGFjdG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vdHMvZnVuY3Rpb25zLnRpY2tldGFjdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE9BQU8sRUFBRSxtQkFBbUIsRUFBcUIsTUFBTSw2QkFBNkIsQ0FBQztBQUNyRixPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sMEJBQTBCLENBQUM7QUFFdkQ7OztHQUdHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sbUJBQW1CLEdBQTBEO0lBQ3hGLE1BQU0sRUFBRSxxQkFBcUI7SUF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QiwwREFBMEQ7WUFDMUQsSUFBSSxPQUFPLENBQUMsY0FBYyxLQUFLLFNBQVM7Z0JBQUUsT0FBTyxFQUFFLEVBQUUsRUFBRSxTQUFTLENBQUMsV0FBVyxFQUFFLElBQUksRUFBRSxVQUFVLEVBQUUsSUFBSSxFQUFFLFFBQVEsRUFBRSxJQUFJLEVBQUUsUUFBUSxFQUFFLENBQUM7WUFDakksTUFBTSxTQUFTLEdBQUcsVUFBVSxPQUFPLENBQUMsY0FBYyxFQUFFLENBQUM7WUFDckQsT0FBTyxFQUFFLEVBQUUsRUFBRSxTQUFTLEVBQUUsSUFBSSxFQUFFLGFBQWEsSUFBSSxtQkFBbUIsQ0FBQyxNQUFNLEVBQUUsU0FBUyxFQUFFLElBQUksRUFBRSxRQUFRLEVBQUUsSUFBSSxFQUFFLFFBQVEsRUFBRSxDQUFDO1FBQ3pILENBQUM7UUFDRCxLQUFLLFNBQVMsRUFBRSxPQUFPLEVBQUUsRUFBRSxFQUFFLFNBQVMsQ0FBQyxXQUFXLEVBQUUsSUFBSSxFQUFFLHlCQUF5QixFQUFFLElBQUksRUFBRSxRQUFRLEVBQUUsSUFBSSxFQUFFLFFBQVEsRUFBRSxDQUFDO1FBQ3RILFNBQVMsQ0FBQztZQUNSLE1BQU0sVUFBVSxHQUFVLE9BQU8sQ0FBQztZQUNsQyxNQUFNLElBQUksS0FBSyxDQUFDLDhCQUErQixVQUErQixDQUFDLElBQUksR0FBRyxDQUFDLENBQUM7UUFDMUYsQ0FBQztJQUNILENBQUM7QUFDSCxDQUFDLENBQUMifQ==
|
|
@@ -50,7 +50,9 @@ export type TDeviceTicketRefusalCode = (typeof deviceTicketRefusalCodes)[number]
|
|
|
50
50
|
* `device_authentication_required`: the connection is not authenticated as a device;
|
|
51
51
|
* `session_not_found`: the session feed lists no such session (or, for a `childSessionId`, the session has no such
|
|
52
52
|
* direct child that runs);
|
|
53
|
-
* `session_read_only`: AGL does not write to the session
|
|
53
|
+
* `session_read_only`: AGL does not write to the session for a device now: another process runs it, a fleet worker owns
|
|
54
|
+
* it, or it needs the owner in the browser first (its model is no longer available, or a stopped message holds files its
|
|
55
|
+
* connection cannot read); the message says which;
|
|
54
56
|
* the ticket store's own refusals, `deviceTicketRefusalCodes`, each with the store's reason (since 1.3; these four since
|
|
55
57
|
* 1.2): `ticket_not_found`, `ticket_question_not_found`: no such ticket, or no such question on it;
|
|
56
58
|
* `ticket_question_answered`: the question already has a different answer; a second answer is refused;
|
|
@@ -60,15 +62,26 @@ export type TDeviceTicketRefusalCode = (typeof deviceTicketRefusalCodes)[number]
|
|
|
60
62
|
* (since 1.3);
|
|
61
63
|
* `direct_report_failed`: the direct report took no message, or AGL could not confirm it did: it is not an active
|
|
62
64
|
* report, it is a Claude Code session the fleet does not run, or its fleet job or Codex server failed; the message says
|
|
63
|
-
* why (since 1.3);
|
|
65
|
+
* why (since 1.3); a message AGL dispatched without learning whether it arrived is `outcome_unknown`;
|
|
64
66
|
* `direct_report_busy`: the report's Codex thread runs a turn another Codex client started, which a device does not
|
|
65
67
|
* steer; nothing was sent: send it again once that turn ended (since 1.3);
|
|
66
|
-
* `rate_limited`, `invalid_request`, `controller_unavailable` and `operation_limit` as for any client
|
|
68
|
+
* `rate_limited`, `invalid_request`, `controller_unavailable` and `operation_limit` as for any client;
|
|
69
|
+
* `concurrent_change`: another change to the same session or record ran at the same time (a turn another client runs,
|
|
70
|
+
* a session being archived or deleted, a prompt answered meanwhile), and AGL did not carry the request out: read again,
|
|
71
|
+
* then decide (since 1.3);
|
|
72
|
+
* `outcome_unknown`: AGL dispatched the request, or may have, and cannot tell whether it took effect: it may have
|
|
73
|
+
* happened. A client never resends it on its own; it reads the session, the driver or the ticket again to learn the
|
|
74
|
+
* outcome, and the user decides (since 1.3; `device.session.send` and `device.ticket.answer` sent it before as it was);
|
|
75
|
+
* `controller_failed`: AGL failed the request; the message is always "The controller operation failed.", and AGL keeps
|
|
76
|
+
* the cause in its failure journal under `error.data.reference`, which the owner's browser shows (since 1.3; a device got
|
|
77
|
+
* the browser's `controller_operation_failed` before).
|
|
78
|
+
* The set is closed: every refusal of every device method is one of these codes, whatever the controller refused it
|
|
79
|
+
* with, and a client may treat any other code as `controller_failed`.
|
|
67
80
|
* In this device protocol version (1.0) AGL sends no retry hint with a refusal (no `retry` beside the error, no retry
|
|
68
81
|
* timing in `error.data`), and `rate_limited` is final: a client never resends the refused request on its own; it shows
|
|
69
82
|
* the refusal, and the user may try again.
|
|
70
83
|
*/
|
|
71
|
-
export type TDeviceRefusalCode = 'device_unknown' | 'device_pairing_invalid' | 'device_pairing_unavailable' | 'device_limit' | 'device_already_paired' | 'device_proof_invalid' | 'device_challenge_invalid' | 'device_authentication_required' | 'session_not_found' | 'session_read_only' | (typeof deviceTicketRefusalCodes)[number] | 'driver_absent' | 'direct_report_failed' | 'direct_report_busy' | 'rate_limited' | 'invalid_request' | 'controller_unavailable' | 'operation_limit';
|
|
84
|
+
export type TDeviceRefusalCode = 'device_unknown' | 'device_pairing_invalid' | 'device_pairing_unavailable' | 'device_limit' | 'device_already_paired' | 'device_proof_invalid' | 'device_challenge_invalid' | 'device_authentication_required' | 'session_not_found' | 'session_read_only' | (typeof deviceTicketRefusalCodes)[number] | 'driver_absent' | 'direct_report_failed' | 'direct_report_busy' | 'rate_limited' | 'invalid_request' | 'controller_unavailable' | 'operation_limit' | 'concurrent_change' | 'outcome_unknown' | 'controller_failed';
|
|
72
85
|
/** The harness a session runs on. */
|
|
73
86
|
export type TDeviceHarness = 'claude' | 'codex' | 'flex' | 'opencode';
|
|
74
87
|
/** `needs_input`: a question, a permission or an MCP elicitation waits for the owner. */
|
|
@@ -98,4 +98,4 @@ export const deviceMethods = [
|
|
|
98
98
|
'device.ticket.ask',
|
|
99
99
|
'device.ticket.move',
|
|
100
100
|
];
|
|
101
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
101
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGV2aWNlc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EsRUFBRSx1QkFBdUIsRUFBRSxtQkFBbUIsQ0FBVSxDQUFDO0FBQzNILE1BQU0sQ0FBQyxNQUFNLGFBQWEsR0FBRztJQUMzQixzQkFBc0I7SUFDdEIscUJBQXFCO0lBQ3JCLHFCQUFxQjtJQUNyQix5QkFBeUI7SUFDekIsdUJBQXVCO0lBQ3ZCLDBCQUEwQjtJQUMxQixtQkFBbUI7SUFDbkIsc0JBQXNCO0lBQ3RCLG1CQUFtQjtJQUNuQixvQkFBb0I7SUFDcEIsb0JBQW9CO0lBQ3BCLG9CQUFvQjtJQUNwQiwyQkFBMkI7SUFDM0IsNkJBQTZCO0lBQzdCLGlCQUFpQjtJQUNqQixtQkFBbUI7SUFDbkIsbUJBQW1CO0lBQ25CLHVCQUF1QjtJQUN2QixtQkFBbUI7SUFDbkIsb0JBQW9CO0NBQ1osQ0FBQyJ9
|
|
@@ -359,14 +359,22 @@ export interface IFleetWorkerSummaryPage {
|
|
|
359
359
|
nextCursor?: string;
|
|
360
360
|
}
|
|
361
361
|
/**
|
|
362
|
-
* The refusals
|
|
363
|
-
* holds no such job of the owner (jobs are
|
|
364
|
-
*
|
|
365
|
-
*
|
|
366
|
-
*
|
|
367
|
-
* refused by request validation
|
|
362
|
+
* The fleet's own refusals, whose text AGL writes, passed to the caller with their message, thrown or as a failed job's
|
|
363
|
+
* `errorCode`. Of the worker reads: `job_unavailable`, the controller holds no such job of the owner (jobs are
|
|
364
|
+
* transient: a controller restart or eviction drops them; read the worker with `fleet_worker_get`); `worker_not_found`,
|
|
365
|
+
* the owner has no worker of that name or id; `list_cursor_mismatch`, the cursor belongs to another filter;
|
|
366
|
+
* `list_cursor_stale`, the worker the cursor continues after is no longer held as it was; `list_cursor_invalid`, the
|
|
367
|
+
* cursor is not one a summary list returned (a `limit` or `cursor` with the full view is refused by request validation
|
|
368
|
+
* instead). Of the jobs, the relaunch and the dispatch fences, by what the caller does next: `fleet_unavailable`, the
|
|
369
|
+
* fleet admits no job now (it is closing, holds its most jobs, or cannot prove its own process); try again later;
|
|
370
|
+
* `worker_fenced`, the worker's dispatch fence stands in the way (an unresolved or running dispatch, one resolved as
|
|
371
|
+
* lost, a reconfirmation without its ticket comment, a fence or record another job changed, no native session yet);
|
|
372
|
+
* inspect the worker before acting again; `worker_archived`, the worker is archived; `ticket_mismatch`, the worker is
|
|
373
|
+
* bound to another ticket; `worker_conflict`, the request does not fit what the fleet holds (the name is taken, the
|
|
374
|
+
* session is bound already, the harness has no relaunch or native sessions, the profile is not configured, the
|
|
375
|
+
* directory is none, the session cannot be adopted as that identity); change the request.
|
|
368
376
|
*/
|
|
369
|
-
export declare const fleetWorkerErrorCodes: readonly ['job_unavailable', 'worker_not_found', 'list_cursor_mismatch', 'list_cursor_stale', 'list_cursor_invalid'];
|
|
377
|
+
export declare const fleetWorkerErrorCodes: readonly ['job_unavailable', 'worker_not_found', 'list_cursor_mismatch', 'list_cursor_stale', 'list_cursor_invalid', 'fleet_unavailable', 'worker_fenced', 'worker_archived', 'ticket_mismatch', 'worker_conflict'];
|
|
370
378
|
export type TFleetWorkerErrorCode = (typeof fleetWorkerErrorCodes)[number];
|
|
371
379
|
export type TFleetWorkerRequest<T extends TFleetWorkerAction> = IFleetWorkerRequests[T];
|
|
372
380
|
export interface IFleetWorkerJob {
|
|
@@ -379,8 +387,25 @@ export interface IFleetWorkerJob {
|
|
|
379
387
|
ticketSync?: IFleetTicketSync;
|
|
380
388
|
/** What a `native-message` job delivered. */
|
|
381
389
|
nativeMessage?: IFleetNativeMessageReceipt;
|
|
390
|
+
/** Why the job failed, as its error said: the fleet's own refusal, or a dependency's text (a harness's output). */
|
|
382
391
|
error?: string;
|
|
392
|
+
/**
|
|
393
|
+
* Set on a failed job exactly when the fleet refused it itself (`fleetWorkerErrorCodes`): then `error` is AGL's own
|
|
394
|
+
* text, which the Driver view and a device show. Without it, `error` may be a dependency's output.
|
|
395
|
+
*/
|
|
396
|
+
errorCode?: TFleetWorkerErrorCode;
|
|
397
|
+
/**
|
|
398
|
+
* Set on a failed job: whether what it dispatched may have reached a native session, in the words of a failed native
|
|
399
|
+
* send (`native_session_failed`'s `outcome`). `refused`: the job failed before anything reached a native session,
|
|
400
|
+
* proved by a refusal before its first dispatch or by a dispatch that sent nothing: nothing was sent. `unknown`: it
|
|
401
|
+
* may have (a steer may have been delivered), which is every failure without that proof; read the worker before acting
|
|
402
|
+
* again and never send it again on your own. A failed job without it, from an older controller, is `unknown`.
|
|
403
|
+
*/
|
|
404
|
+
errorOutcome?: TFleetWorkerErrorOutcome;
|
|
383
405
|
}
|
|
406
|
+
/** How far a failed fleet worker job got (`IFleetWorkerJob.errorOutcome`). */
|
|
407
|
+
export declare const fleetWorkerErrorOutcomes: readonly ['refused', 'unknown'];
|
|
408
|
+
export type TFleetWorkerErrorOutcome = (typeof fleetWorkerErrorOutcomes)[number];
|
|
384
409
|
/**
|
|
385
410
|
* A message to a Claude Code background job no fleet worker binds: a native wake of a settled job (`native-wake`) or a
|
|
386
411
|
* message into a running job's inbox through Claude Code's own SendMessage (`native-inbox`, accepted and queued, not
|
|
@@ -3,12 +3,23 @@ export const fleetWorkerReadActions = ['list', 'get', 'status', 'job-wait', 'wat
|
|
|
3
3
|
/** The longest fleet worker job wait one request asks for. */
|
|
4
4
|
export const fleetWorkerJobWaitMaximumMs = 240_000;
|
|
5
5
|
/**
|
|
6
|
-
* The refusals
|
|
7
|
-
* holds no such job of the owner (jobs are
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* refused by request validation
|
|
6
|
+
* The fleet's own refusals, whose text AGL writes, passed to the caller with their message, thrown or as a failed job's
|
|
7
|
+
* `errorCode`. Of the worker reads: `job_unavailable`, the controller holds no such job of the owner (jobs are
|
|
8
|
+
* transient: a controller restart or eviction drops them; read the worker with `fleet_worker_get`); `worker_not_found`,
|
|
9
|
+
* the owner has no worker of that name or id; `list_cursor_mismatch`, the cursor belongs to another filter;
|
|
10
|
+
* `list_cursor_stale`, the worker the cursor continues after is no longer held as it was; `list_cursor_invalid`, the
|
|
11
|
+
* cursor is not one a summary list returned (a `limit` or `cursor` with the full view is refused by request validation
|
|
12
|
+
* instead). Of the jobs, the relaunch and the dispatch fences, by what the caller does next: `fleet_unavailable`, the
|
|
13
|
+
* fleet admits no job now (it is closing, holds its most jobs, or cannot prove its own process); try again later;
|
|
14
|
+
* `worker_fenced`, the worker's dispatch fence stands in the way (an unresolved or running dispatch, one resolved as
|
|
15
|
+
* lost, a reconfirmation without its ticket comment, a fence or record another job changed, no native session yet);
|
|
16
|
+
* inspect the worker before acting again; `worker_archived`, the worker is archived; `ticket_mismatch`, the worker is
|
|
17
|
+
* bound to another ticket; `worker_conflict`, the request does not fit what the fleet holds (the name is taken, the
|
|
18
|
+
* session is bound already, the harness has no relaunch or native sessions, the profile is not configured, the
|
|
19
|
+
* directory is none, the session cannot be adopted as that identity); change the request.
|
|
12
20
|
*/
|
|
13
|
-
export const fleetWorkerErrorCodes = ['job_unavailable', 'worker_not_found', 'list_cursor_mismatch', 'list_cursor_stale', 'list_cursor_invalid'
|
|
14
|
-
|
|
21
|
+
export const fleetWorkerErrorCodes = ['job_unavailable', 'worker_not_found', 'list_cursor_mismatch', 'list_cursor_stale', 'list_cursor_invalid',
|
|
22
|
+
'fleet_unavailable', 'worker_fenced', 'worker_archived', 'ticket_mismatch', 'worker_conflict'];
|
|
23
|
+
/** How far a failed fleet worker job got (`IFleetWorkerJob.errorOutcome`). */
|
|
24
|
+
export const fleetWorkerErrorOutcomes = ['refused', 'unknown'];
|
|
25
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmxlZXR3b3JrZXJzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vdHNfaW50ZXJmYWNlcy9mbGVldHdvcmtlcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBcU5BLG1EQUFtRDtBQUNuRCxNQUFNLENBQUMsTUFBTSxzQkFBc0IsR0FBRyxDQUFDLE1BQU0sRUFBRSxLQUFLLEVBQUUsUUFBUSxFQUFFLFVBQVUsRUFBRSxPQUFPLENBQWtELENBQUM7QUFHdEksOERBQThEO0FBQzlELE1BQU0sQ0FBQyxNQUFNLDJCQUEyQixHQUFHLE9BQU8sQ0FBQztBQStDbkQ7Ozs7Ozs7Ozs7Ozs7OztHQWVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0scUJBQXFCLEdBQUcsQ0FBQyxpQkFBaUIsRUFBRSxrQkFBa0IsRUFBRSxzQkFBc0IsRUFBRSxtQkFBbUIsRUFBRSxxQkFBcUI7SUFDN0ksbUJBQW1CLEVBQUUsZUFBZSxFQUFFLGlCQUFpQixFQUFFLGlCQUFpQixFQUFFLGlCQUFpQixDQUFVLENBQUM7QUE2QjFHLDhFQUE4RTtBQUM5RSxNQUFNLENBQUMsTUFBTSx3QkFBd0IsR0FBRyxDQUFDLFNBQVMsRUFBRSxTQUFTLENBQVUsQ0FBQyJ9
|
|
@@ -112,6 +112,8 @@ export interface IWorkerCallerSubject {
|
|
|
112
112
|
nativeSessionId: string;
|
|
113
113
|
sessionIdentityId: string;
|
|
114
114
|
ticketSessionId: string;
|
|
115
|
+
/** The fleet worker's name: what a ticket calls the worker, unless it is an active direct report. */
|
|
116
|
+
workerName: string;
|
|
115
117
|
}
|
|
116
118
|
export type TWorkerCallerEnrollment = {
|
|
117
119
|
bridgePid: number;
|
|
@@ -6,9 +6,23 @@ export declare class PostDatabaseDocumentMigrationRunner {
|
|
|
6
6
|
constructor(database: plugins.nosqldb.SmartdataDb | undefined);
|
|
7
7
|
run(): Promise<void>;
|
|
8
8
|
runProjectFilesystemIdentity(controllerIdArg: string): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* The ticket migrations of a controller start, in their order; a new one goes last. v38 gives owner assignments the
|
|
11
|
+
* store's principal, v41 moves tickets released by hand without a release link to closed, and v43 names ticket actors
|
|
12
|
+
* by their role (AGL-1686). Answers the keys v41 moved and those whose revision v43 moved.
|
|
13
|
+
*/
|
|
14
|
+
runTicketStart(principalIdArg: string): Promise<{
|
|
15
|
+
closed: string[];
|
|
16
|
+
renamed: string[];
|
|
17
|
+
}>;
|
|
9
18
|
runTicketOwnerPrincipal(principalIdArg: string): Promise<void>;
|
|
10
19
|
/** AGL-916: tickets released by hand without a release link move to closed; answers the keys it moved. */
|
|
11
20
|
runTicketClosedColumn(): Promise<string[]>;
|
|
21
|
+
/**
|
|
22
|
+
* AGL-1686: once, every person and actor a ticket stores under its session id is named by its harness's label, and the
|
|
23
|
+
* OpenCode runtime's `runtime` actor "OpenCode"; answers the keys whose revision it moved.
|
|
24
|
+
*/
|
|
25
|
+
runTicketActorNames(): Promise<string[]>;
|
|
12
26
|
/**
|
|
13
27
|
* AGL-909: once, links and release plans name each repository `resolveArg` resolves as `org/name`; answers the keys it
|
|
14
28
|
* changed. With no repository discovered (`discoveredArg` 0) it waits for a later start.
|
|
@@ -14,6 +14,7 @@ import { ClaudeGatewayRetirementV38Migration } from './v38_claudegatewayretireme
|
|
|
14
14
|
import { TicketOwnerPrincipalV38Migration } from './v38_ticketownerprincipal.js';
|
|
15
15
|
import { TicketClosedColumnV41Migration } from './v41_ticketclosedcolumn.js';
|
|
16
16
|
import { TicketLinkReposV41Migration } from './v41_ticketlinkrepos.js';
|
|
17
|
+
import { TicketActorNamesV43Migration } from './v43_ticketactornames.js';
|
|
17
18
|
export class PostDatabaseDocumentMigrationRunner {
|
|
18
19
|
database;
|
|
19
20
|
migrations;
|
|
@@ -43,6 +44,17 @@ export class PostDatabaseDocumentMigrationRunner {
|
|
|
43
44
|
async runProjectFilesystemIdentity(controllerIdArg) {
|
|
44
45
|
await new ProtocolV22ProjectFilesystemIdentityMigration(this.database, controllerIdArg).run();
|
|
45
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* The ticket migrations of a controller start, in their order; a new one goes last. v38 gives owner assignments the
|
|
49
|
+
* store's principal, v41 moves tickets released by hand without a release link to closed, and v43 names ticket actors
|
|
50
|
+
* by their role (AGL-1686). Answers the keys v41 moved and those whose revision v43 moved.
|
|
51
|
+
*/
|
|
52
|
+
async runTicketStart(principalIdArg) {
|
|
53
|
+
await this.runTicketOwnerPrincipal(principalIdArg);
|
|
54
|
+
const closed = await this.runTicketClosedColumn();
|
|
55
|
+
const renamed = await this.runTicketActorNames();
|
|
56
|
+
return { closed, renamed };
|
|
57
|
+
}
|
|
46
58
|
async runTicketOwnerPrincipal(principalIdArg) {
|
|
47
59
|
await new TicketOwnerPrincipalV38Migration(this.database, principalIdArg).run();
|
|
48
60
|
}
|
|
@@ -50,6 +62,13 @@ export class PostDatabaseDocumentMigrationRunner {
|
|
|
50
62
|
async runTicketClosedColumn() {
|
|
51
63
|
return await new TicketClosedColumnV41Migration(this.database).run();
|
|
52
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* AGL-1686: once, every person and actor a ticket stores under its session id is named by its harness's label, and the
|
|
67
|
+
* OpenCode runtime's `runtime` actor "OpenCode"; answers the keys whose revision it moved.
|
|
68
|
+
*/
|
|
69
|
+
async runTicketActorNames() {
|
|
70
|
+
return await new TicketActorNamesV43Migration(this.database).run();
|
|
71
|
+
}
|
|
53
72
|
/**
|
|
54
73
|
* AGL-909: once, links and release plans name each repository `resolveArg` resolves as `org/name`; answers the keys it
|
|
55
74
|
* changed. With no repository discovered (`discoveredArg` 0) it waits for a later start.
|
|
@@ -61,4 +80,4 @@ export class PostDatabaseDocumentMigrationRunner {
|
|
|
61
80
|
return new ControllerIssuerIdentityV25Migration(this.database).run(dataRootDirectoryArg);
|
|
62
81
|
}
|
|
63
82
|
}
|
|
64
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
83
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xhc3Nlcy5kb2N1bWVudG1pZ3JhdGlvbnJ1bm5lci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL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yxVQUFtRCxFQUFFLGFBQXFCO1FBQ3hHLE9BQU8sTUFBTSxJQUFJLDJCQUEyQixDQUFDLElBQUksQ0FBQyxRQUFRLEVBQUUsVUFBVSxFQUFFLGFBQWEsQ0FBQyxDQUFDLEdBQUcsRUFBRSxDQUFDO0lBQy9GLENBQUM7SUFFTSxLQUFLLENBQUMsMkJBQTJCLENBQ3RDLG9CQUE0QjtRQUU1QixPQUFPLElBQUksb0NBQW9DLENBQUMsSUFBSSxDQUFDLFFBQVEsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxvQkFBb0IsQ0FBQyxDQUFDO0lBQzNGLENBQUM7Q0FDRiJ9
|
|
@@ -28,4 +28,5 @@ export * from './v39_flexpublicheadpointers.js';
|
|
|
28
28
|
export * from './v41_ticketmigrationmarkers.js';
|
|
29
29
|
export * from './v41_ticketclosedcolumn.js';
|
|
30
30
|
export * from './v41_ticketlinkrepos.js';
|
|
31
|
+
export * from './v43_ticketactornames.js';
|
|
31
32
|
export * from './v43_flexpostharnessmigrationmarkers.js';
|
|
@@ -28,5 +28,6 @@ export * from './v39_flexpublicheadpointers.js';
|
|
|
28
28
|
export * from './v41_ticketmigrationmarkers.js';
|
|
29
29
|
export * from './v41_ticketclosedcolumn.js';
|
|
30
30
|
export * from './v41_ticketlinkrepos.js';
|
|
31
|
+
export * from './v43_ticketactornames.js';
|
|
31
32
|
export * from './v43_flexpostharnessmigrationmarkers.js';
|
|
32
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
33
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90c19taWdyYXRpb24vaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxrQ0FBa0MsQ0FBQztBQUNqRCxjQUFjLGlDQUFpQyxDQUFDO0FBQ2hELGNBQWMsa0NBQWtDLENBQUM7QUFDakQsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLGtDQUFrQyxDQUFDO0FBQ2pELGNBQWMsNkNBQTZDLENBQUM7QUFDNUQsY0FBYyx3QkFBd0IsQ0FBQztBQUN2QyxjQUFjLCtCQUErQixDQUFDO0FBQzlDLGNBQWMsd0NBQXdDLENBQUM7QUFDdkQsY0FBYyw0Q0FBNEMsQ0FBQztBQUMzRCxjQUFjLHdDQUF3QyxDQUFDO0FBQ3ZELGNBQWMsMkNBQTJDLENBQUM7QUFDMUQsY0FBYyw0Q0FBNEMsQ0FBQztBQUMzRCxjQUFjLHVCQUF1QixDQUFDO0FBQ3RDLGNBQWMsZ0NBQWdDLENBQUM7QUFDL0MsY0FBYyx5Q0FBeUMsQ0FBQztBQUN4RCxjQUFjLGdDQUFnQyxDQUFDO0FBQy9DLGNBQWMseUNBQXlDLENBQUM7QUFDeEQsY0FBYywyQkFBMkIsQ0FBQztBQUMxQyxjQUFjLG9DQUFvQyxDQUFDO0FBQ25ELGNBQWMsNEJBQTRCLENBQUM7QUFDM0MsY0FBYywrQkFBK0IsQ0FBQztBQUM5QyxjQUFjLGtDQUFrQyxDQUFDO0FBQ2pELGNBQWMsMEJBQTBCLENBQUM7QUFDekMsY0FBYyxtQ0FBbUMsQ0FBQztBQUNsRCxjQUFjLHlCQUF5QixDQUFDO0FBQ3hDLGNBQWMsaUNBQWlDLENBQUM7QUFDaEQsY0FBYyxpQ0FBaUMsQ0FBQztBQUNoRCxjQUFjLDZCQUE2QixDQUFDO0FBQzVDLGNBQWMsMEJBQTBCLENBQUM7QUFDekMsY0FBYywyQkFBMkIsQ0FBQztBQUMxQyxjQUFjLDBDQUEwQyxDQUFDIn0=
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as plugins from './plugins.js';
|
|
2
|
+
export declare const ticketActorNamesMigrationId = "v43_ticketactornames";
|
|
3
|
+
/**
|
|
4
|
+
* AGL-1686: tickets named the sessions acting on them by their session id (`claude:<uuid>`), and the OpenCode
|
|
5
|
+
* runtime's caller by its subject kind (`runtime`). Once, every person and actor stored in a ticket (its source,
|
|
6
|
+
* creator, last editor and assignee), its comments (author), its questions (asker and answerer) and its activity (actor,
|
|
7
|
+
* and every person in the snapshots its changes hold, the copy of a comment included) whose name is its session id
|
|
8
|
+
* takes its harness's label, and an actor named `runtime` with no session, kind and role `worker` is "OpenCode". Only
|
|
9
|
+
* those names change: ids, session ids and every other value stay, so a 41.1.0 controller reads the result.
|
|
10
|
+
*
|
|
11
|
+
* It works ticket by ticket. A ticket's history, the copy of a comment in its `commented` entry with the comment, and
|
|
12
|
+
* last its document move in one transaction, or, for a history larger than the bound above, in several. Every one of
|
|
13
|
+
* them that rewrites anything of the ticket moves its revision too: the board pump re-reads a ticket only when its
|
|
14
|
+
* revision moved, and no transaction depends on what an earlier one renamed, so a run cut short between them leaves
|
|
15
|
+
* nothing renamed under an unmoved revision. Each transaction that writes fences the board's revision first; none adds history, tells anyone or moves a ticket's
|
|
16
|
+
* column. The marker goes in the transaction that completes the last ticket (alone on an empty board), so a later start
|
|
17
|
+
* does nothing; a run cut short starts again and finds what it renamed already renamed.
|
|
18
|
+
*/
|
|
19
|
+
export declare class TicketActorNamesV43Migration {
|
|
20
|
+
private readonly database;
|
|
21
|
+
constructor(database: plugins.nosqldb.SmartdataDb | undefined);
|
|
22
|
+
/** Runs once; answers the keys of the tickets whose revision it moved. */
|
|
23
|
+
run(): Promise<string[]>;
|
|
24
|
+
private transaction;
|
|
25
|
+
/**
|
|
26
|
+
* One transaction: the ticket's history records after `cursorArg` up to the bound, and, once its history is taken,
|
|
27
|
+
* its document. The ticket's revision moves when this transaction rewrote any of its records or renames its document,
|
|
28
|
+
* never because of an earlier one. With `markerArg` (the keys moved so far) the slice that completes the ticket writes the marker; with
|
|
29
|
+
* no ticket it writes the marker alone. Nothing outside the transaction changes here: the driver may run it again.
|
|
30
|
+
*/
|
|
31
|
+
private slice;
|
|
32
|
+
}
|