@byok-sdk/bot-collaboration 0.0.0-stage → 0.43.0

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.
Files changed (74) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +2075 -2
  3. package/dist/adapter-steps.d.ts +49 -0
  4. package/dist/channel.d.ts +111 -0
  5. package/dist/chunk-33YA66U7.js +7 -0
  6. package/dist/chunk-33YA66U7.js.map +1 -0
  7. package/dist/chunk-6Y2B2XCP.js +12 -0
  8. package/dist/chunk-6Y2B2XCP.js.map +1 -0
  9. package/dist/chunk-QZRWFFHM.js +12 -0
  10. package/dist/chunk-QZRWFFHM.js.map +1 -0
  11. package/dist/chunk-ZX6C5U2S.js +27 -0
  12. package/dist/chunk-ZX6C5U2S.js.map +1 -0
  13. package/dist/coalesce.d.ts +18 -0
  14. package/dist/commit-vectors.test-support.d.ts +173 -0
  15. package/dist/commit.d.ts +53 -0
  16. package/dist/compaction.d.ts +13 -0
  17. package/dist/delegation.d.ts +12 -0
  18. package/dist/delivery-routing.d.ts +63 -0
  19. package/dist/delivery-vectors.test-support.d.ts +78 -0
  20. package/dist/delivery.d.ts +20 -0
  21. package/dist/dream.d.ts +88 -0
  22. package/dist/home-projections.d.ts +5 -0
  23. package/dist/host-kit.d.ts +60 -0
  24. package/dist/host-kit.js +11 -0
  25. package/dist/host-kit.js.map +1 -0
  26. package/dist/host.d.ts +472 -0
  27. package/dist/inbound.d.ts +17 -0
  28. package/dist/index.d.ts +6 -0
  29. package/dist/index.js +19 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/k4-fixtures.test-support.d.ts +10 -0
  32. package/dist/l-test-host.test-support.d.ts +72 -0
  33. package/dist/migration.d.ts +251 -0
  34. package/dist/model.d.ts +89 -0
  35. package/dist/persona.d.ts +2 -0
  36. package/dist/retention-vectors.test-support.d.ts +17 -0
  37. package/dist/retention.d.ts +61 -0
  38. package/dist/rooms.d.ts +22 -0
  39. package/dist/routine-vectors.test-support.d.ts +81 -0
  40. package/dist/routines.d.ts +110 -0
  41. package/dist/rules/autonomy.d.ts +67 -0
  42. package/dist/rules/cards.d.ts +31 -0
  43. package/dist/rules/coalesce.d.ts +111 -0
  44. package/dist/rules/commands.d.ts +306 -0
  45. package/dist/rules/commit.d.ts +82 -0
  46. package/dist/rules/compaction.d.ts +33 -0
  47. package/dist/rules/context.d.ts +484 -0
  48. package/dist/rules/delegation.d.ts +366 -0
  49. package/dist/rules/due.d.ts +15 -0
  50. package/dist/rules/frame.d.ts +4 -0
  51. package/dist/rules/history.d.ts +34 -0
  52. package/dist/rules/inbound.d.ts +53 -0
  53. package/dist/rules/index.d.ts +13 -0
  54. package/dist/rules/index.js +4 -0
  55. package/dist/rules/index.js.map +1 -0
  56. package/dist/rules/message.d.ts +31 -0
  57. package/dist/rules/outcome.d.ts +45 -0
  58. package/dist/rules/priority.d.ts +52 -0
  59. package/dist/rules/rooms.d.ts +187 -0
  60. package/dist/rules/schema.d.ts +110 -0
  61. package/dist/rules/sync.d.ts +157 -0
  62. package/dist/rules/team.d.ts +119 -0
  63. package/dist/rules/turn.d.ts +129 -0
  64. package/dist/schema.d.ts +154 -0
  65. package/dist/store-compatibility.d.ts +3 -0
  66. package/dist/switch.d.ts +53 -0
  67. package/dist/team-model.d.ts +54 -0
  68. package/dist/team.d.ts +56 -0
  69. package/dist/testing.d.ts +6 -0
  70. package/dist/testing.js +20 -0
  71. package/dist/testing.js.map +1 -0
  72. package/dist/toolset-policy.d.ts +2 -0
  73. package/dist/topology.d.ts +49 -0
  74. package/package.json +80 -4
@@ -0,0 +1,129 @@
1
+ import type { AskUserAction, ConfirmableAction } from '@byok-sdk/protocol';
2
+ import { type Authority, type BatchTurn, type CoalesceState } from './coalesce.js';
3
+ /**
4
+ * Turn rows and the rows that a Turn makes, as pure rules (#739 D1). The functions change only the rows
5
+ * that the caller gives and do no I/O. `model.ts` stores these rows in the K8 ledger.
6
+ */
7
+ /** The same JSON value type as the K4 `Json`. Rules do not import K4 types. */
8
+ export type Json = null | boolean | number | string | Json[] | {
9
+ [key: string]: Json;
10
+ };
11
+ export declare function json(value: unknown): Json;
12
+ export interface Turn {
13
+ id: string;
14
+ root: string;
15
+ botId: string;
16
+ source: 'user' | 'continuation' | 'answer' | 'action_result' | 'routine' | 'room_slot' | 'bot_request' | 'bot_reply';
17
+ request: string;
18
+ hop: number;
19
+ status: 'queued' | 'processing' | 'succeeded' | 'failed' | 'blocked' | 'delivered';
20
+ /** Set at insert and never changed. Absent counts as `bot`: only `owner` turns can manage the team. */
21
+ authority?: Authority;
22
+ /** B side of a delegation: the bot_request Turn and its continuations. */
23
+ delegationId?: string;
24
+ /** bot_reply Turns: one entry per reported delegation. Bodies stay in `replies`. */
25
+ replies?: ReplyEntry[];
26
+ /** A refusal report gets no delegate fragment, so it cannot report again. */
27
+ refusalReport?: boolean;
28
+ /** Budget unit that this Turn's execution spends when it is claimed. */
29
+ unit?: string;
30
+ /** Input batch Turns: the user inputs that this one reply answers, in arrival order. */
31
+ inputIds?: string[];
32
+ /** History mode: the hash of the injected history that this Turn's offer froze (#739 Q4b), or of a seat's injected room messages (#883). */
33
+ historyDigest?: string;
34
+ /**
35
+ * A sealed routine Turn (#953): the occurrence's routine version, whose member-sealed template is the whole instruction.
36
+ * Its `request` is empty. Set at insert and never changed.
37
+ */
38
+ sealedRoutine?: SealedRoutineRef;
39
+ /** Set while the sync holds this Turn because its Bot's device has no active binding (#956) or is frozen for an owner switch (#957). */
40
+ held?: 'device_not_bound' | 'device_switching';
41
+ /**
42
+ * The refusal code of the K4 terminal when the owner's `failStuckIntent` settled this Turn's intent (#1405). Set in the
43
+ * settle transaction, so a reader need not match the audit row, which keeps the message.
44
+ */
45
+ settleCode?: 'outcome_failed';
46
+ blockedReason?: string;
47
+ profileFailure?: {
48
+ sequence: number;
49
+ revision: string;
50
+ reason: string;
51
+ };
52
+ outcome?: Json;
53
+ conclusion?: string;
54
+ reported?: boolean;
55
+ }
56
+ export interface SealedRoutineRef {
57
+ routineId: string;
58
+ definitionVersion: number;
59
+ }
60
+ export type Verdict = 'answered' | 'failed' | 'cancelled' | 'refused' | 'expired' | 'abandoned';
61
+ export interface ReplyEntry {
62
+ delegationId: string;
63
+ from: string;
64
+ request: string;
65
+ verdict: Verdict;
66
+ reason?: string;
67
+ /** B taskId of the accepted reply body in `CollaborationState.replies`. */
68
+ reply?: string;
69
+ continuationRefused?: true;
70
+ /** The reply was accepted before a cancel. The cancel stopped the rest of the execution. */
71
+ partial?: true;
72
+ }
73
+ export interface Card {
74
+ id: string;
75
+ turnId: string;
76
+ action: ConfirmableAction<Json>;
77
+ state: 'pending' | 'confirmed' | 'rejected' | 'expired';
78
+ expiresAt: number;
79
+ result?: Json;
80
+ error?: string;
81
+ conclusion?: 'succeeded' | 'failed';
82
+ decisionReported?: boolean;
83
+ }
84
+ export interface Question {
85
+ id: string;
86
+ turnId: string;
87
+ value: AskUserAction;
88
+ answer?: string;
89
+ }
90
+ export interface Rejection {
91
+ botId: string;
92
+ taskId: string;
93
+ action: string;
94
+ reason: string;
95
+ consumedBy?: string;
96
+ }
97
+ /** `delegation` counts spent Bot units. `reserved` counts open units; it appears at the first Cross-Bot admission. */
98
+ export interface Budget {
99
+ continuation: number;
100
+ delegation: number;
101
+ reserved?: number;
102
+ }
103
+ /** The rows that adding a Turn changes. */
104
+ export interface TurnsState extends CoalesceState {
105
+ turns: Record<string, Turn>;
106
+ budgets: Record<string, Budget>;
107
+ }
108
+ export interface TurnFields {
109
+ id: string;
110
+ root: string;
111
+ source: Turn['source'];
112
+ request: string;
113
+ botId: string;
114
+ hop: number;
115
+ authority: Authority;
116
+ delegationId?: string;
117
+ replies?: ReplyEntry[];
118
+ refusalReport?: boolean;
119
+ unit?: string;
120
+ inputIds?: string[];
121
+ sealedRoutine?: SealedRoutineRef;
122
+ }
123
+ /**
124
+ * Idempotent by id. Hop and authority come from the caller; nothing resets them.
125
+ * A new Turn first seals its Bot's open input batch, so the queue keeps arrival order.
126
+ */
127
+ export declare function addTurn(state: TurnsState, fields: TurnFields): Turn;
128
+ /** One user Turn per sealed input batch, in order. A batch Turn id is new and its batch is sealed, so no boundary seal applies. */
129
+ export declare function addBatchTurns(state: TurnsState, sealed: readonly BatchTurn[]): void;
@@ -0,0 +1,154 @@
1
+ import type { HandoffPackBudgets } from '@byok-sdk/protocol';
2
+ import type { CollaborationState, Turn } from './model.js';
3
+ import type { BotRoutine } from './routines.js';
4
+ export { CONFIRMABLE_MAX, DEFAULT_CONFIRMABLE, DEFAULT_TIME_ZONES, MAIN_ACTIONS, NEW_BOTS, NEW_ROOMS, outcomeOffer, outcomeSchema, ROOM_SYSTEM_PROMPT, SYSTEM_PROMPT, TIME_ZONES_MAX, TURN_ACTIONS, type CheckedOffer, type ConfirmableSpec, type MainAction, type OutcomeOffer, type TurnAction } from './rules/schema.js';
5
+ export { contextTurns, DEFAULT_CONTEXT_MAX_BYTES, DEFAULT_CONTEXT_TURN_LIMIT, DEFAULT_HANDOFF_BUDGETS, type ContextHistory, type ContextTurn, type InstructionLimits } from './rules/context.js';
6
+ /** `crossRequest` is the framed Request section of a Cross-Bot Turn; its background is trimmed too (§3.7). */
7
+ export declare function turnContext(state: CollaborationState, turn: Turn, turnLimit?: number, maxBytes?: number, crossRequest?: string, routines?: readonly BotRoutine[], handoff?: HandoffPackBudgets): {
8
+ historyWindow: import("./rules/history.js").HistoryWindow;
9
+ room: {
10
+ id: string;
11
+ name: string;
12
+ members: string[];
13
+ announcement: string;
14
+ visibility: 'after_join';
15
+ messages: import("./rooms.js").RoomMessage[];
16
+ };
17
+ round: {
18
+ id: string;
19
+ limit: number;
20
+ counts: Record<string, number>;
21
+ };
22
+ seat: {
23
+ id: string;
24
+ deadline: number | undefined;
25
+ };
26
+ teamNotes: {
27
+ id: string;
28
+ text: string;
29
+ }[];
30
+ roster: {
31
+ id: string;
32
+ name: string;
33
+ role: string;
34
+ mainBot: boolean;
35
+ }[];
36
+ rejectedActions: import("./model.js").Rejection[];
37
+ rooms: {
38
+ id: string;
39
+ name: string;
40
+ members: string[];
41
+ admin?: string;
42
+ mode: 'mention';
43
+ announcement: string;
44
+ memberMentions?: import("./rooms.js").MemberMentions;
45
+ archived?: true;
46
+ }[];
47
+ delegation?: {
48
+ delegationId: string;
49
+ from: {
50
+ botId: string;
51
+ name: string;
52
+ };
53
+ hop: number;
54
+ } | undefined;
55
+ openDelegations?: {
56
+ items: {
57
+ id: string;
58
+ from: string;
59
+ to: string;
60
+ status: "queued" | "reply_held" | "reply_pending" | "resolved" | "running" | "uncertain" | "waiting_device";
61
+ request: string;
62
+ }[];
63
+ omitted: number;
64
+ notice: string | null;
65
+ } | undefined;
66
+ } | ({
67
+ teamNotes: {
68
+ id: string;
69
+ text: string;
70
+ }[];
71
+ roster: {
72
+ id: string;
73
+ name: string;
74
+ role: string;
75
+ mainBot: boolean;
76
+ }[];
77
+ rejectedActions: import("./model.js").Rejection[];
78
+ rooms: {
79
+ id: string;
80
+ name: string;
81
+ members: string[];
82
+ admin?: string;
83
+ mode: 'mention';
84
+ announcement: string;
85
+ memberMentions?: import("./rooms.js").MemberMentions;
86
+ archived?: true;
87
+ }[];
88
+ delegation?: {
89
+ delegationId: string;
90
+ from: {
91
+ botId: string;
92
+ name: string;
93
+ };
94
+ hop: number;
95
+ } | undefined;
96
+ openDelegations?: {
97
+ items: {
98
+ id: string;
99
+ from: string;
100
+ to: string;
101
+ status: "queued" | "reply_held" | "reply_pending" | "resolved" | "running" | "uncertain" | "waiting_device";
102
+ request: string;
103
+ }[];
104
+ omitted: number;
105
+ notice: string | null;
106
+ } | undefined;
107
+ } & {
108
+ historyWindow: {
109
+ turnLimit: number;
110
+ maxBytes: number;
111
+ omittedMessages: number;
112
+ omittedTurns?: number;
113
+ currentRequestBytes: number;
114
+ metadataOverBudget: boolean;
115
+ notice: string | null;
116
+ omittedBackground?: number;
117
+ omittedCards: number;
118
+ omittedQuestions: number;
119
+ omittedPendingCards: number;
120
+ omittedPendingQuestions: number;
121
+ omittedRejections: number;
122
+ };
123
+ rejectedActions: import("./model.js").Rejection[];
124
+ questions: import("./model.js").Question[];
125
+ cards: import("./model.js").Card[];
126
+ routines: BotRoutine[];
127
+ history: import("@byok-sdk/protocol").HandoffPack;
128
+ });
129
+ /** Snapshot views include the candidate. Frozen turn views keep it in Request. */
130
+ export declare function contextPack<T extends object = Record<never, never>>(state: CollaborationState, turnLimit?: number, currentTurnId?: string, maxBytes?: number, separateRequest?: boolean, shared?: T, fit?: {
131
+ request?: string;
132
+ background?: unknown[][];
133
+ }, routines?: readonly BotRoutine[], handoff?: HandoffPackBudgets): T & {
134
+ historyWindow: {
135
+ turnLimit: number;
136
+ maxBytes: number;
137
+ omittedMessages: number;
138
+ omittedTurns?: number;
139
+ currentRequestBytes: number;
140
+ metadataOverBudget: boolean;
141
+ notice: string | null;
142
+ omittedBackground?: number;
143
+ omittedCards: number;
144
+ omittedQuestions: number;
145
+ omittedPendingCards: number;
146
+ omittedPendingQuestions: number;
147
+ omittedRejections: number;
148
+ };
149
+ rejectedActions: import("./model.js").Rejection[];
150
+ questions: import("./model.js").Question[];
151
+ cards: import("./model.js").Card[];
152
+ routines: BotRoutine[];
153
+ history: import("@byok-sdk/protocol").HandoffPack;
154
+ };
@@ -0,0 +1,3 @@
1
+ import type { StoreCompatibility } from '@byok-sdk/client';
2
+ /** Inspect a stopped L ledger on a private copy, including its WAL or rollback journal. */
3
+ export declare function inspectLedger(path: string, tenant: string): StoreCompatibility;
@@ -0,0 +1,53 @@
1
+ import { type HostLedger, type LedgerDump } from '@byok-sdk/server/execution-core';
2
+ import { type CollaborationState } from './model.js';
3
+ import { type SwitchContent, type SwitchExport, type SwitchHeader, type SwitchReceipt } from './migration.js';
4
+ /** The import record of a new L owner: from the load until the commit toward L. */
5
+ export interface SwitchImport {
6
+ digest: string;
7
+ devices: string[];
8
+ discarding?: true;
9
+ }
10
+ /** Throws while the domain has an export mark. Each L write calls it after its own refusals, so those come first. */
11
+ export declare function refuseExported(state: CollaborationState): void;
12
+ /**
13
+ * Throws while the ledger holds a switch import, which is not committed toward L yet: no K8 work runs on it. The switch
14
+ * steps `commitImport` and `discardImport` write it themselves.
15
+ */
16
+ export declare function refuseImported(state: CollaborationState): void;
17
+ /**
18
+ * A restart reads the switch records before any write. A ledger with an import is not committed toward L yet, so no
19
+ * `BotCollaboration` may run on it; a malformed export mark fails closed.
20
+ */
21
+ export declare function checkSwitchRecords(state: CollaborationState): void;
22
+ /**
23
+ * Reads an L ledger dump into the neutral form, and refuses a stored copy that differs from the value it is derived from
24
+ * (#975 "Export builder must check"). `tenant` names the ledger (its `agent` keys); `header` is the document's.
25
+ */
26
+ export declare function switchContent(dump: LedgerDump, tenant: string, header: SwitchHeader): SwitchContent;
27
+ /**
28
+ * Writes the neutral form into a K4 dump bound to `tenant`. The K8 owner records the target needs are passed in `owner`.
29
+ * A concluded row gets K4's values of a new row for its scheduler cursors (#975 D6): `phase: 'settled'`, `notBefore: 0`.
30
+ */
31
+ export declare function switchDump(content: SwitchContent, tenant: string, owner: Pick<CollaborationState, 'topology' | 'switchImport'>): LedgerDump;
32
+ /** Seals the content that a ledger holds now, under a given header. */
33
+ export declare function sealLedger(ledger: HostLedger, header: SwitchHeader): SwitchExport;
34
+ /**
35
+ * Step 2 of a switch to L (#975): writes an H export into an empty L ledger tenant and verifies it in the same transaction.
36
+ * The document must verify. Each of its devices is recorded as owned by H, with the import record, until `commitImport`.
37
+ * Before the load commits, K4 reads the tenant's rows back, and they must give the document's digest under its header;
38
+ * otherwise nothing is written. Returns the receipt the old owner commits away on. A `BotCollaboration` refuses a ledger
39
+ * with an import, so no work runs on it before the commit.
40
+ */
41
+ export declare function importForSwitch(ledger: HostLedger, document: SwitchExport): SwitchReceipt;
42
+ /**
43
+ * Step 4 of a switch to L, after the old owner committed away on the receipt: L owns each device of the import. Only the
44
+ * import of this digest that is not being discarded commits. Then a `BotCollaboration` can open the ledger.
45
+ */
46
+ export declare function commitImport(ledger: HostLedger, digest: string): void;
47
+ /**
48
+ * Deletes an import that was not committed, when the switch does not go ahead: the old owner aborts, or the product
49
+ * decides against it. It first records
50
+ * that the import is being discarded, so `commitImport` refuses it from then on, then deletes the tenant (K4 `discard`).
51
+ * A committed tenant has no import record, so it is refused; no `BotCollaboration` ran work on an uncommitted one.
52
+ */
53
+ export declare function discardImport(ledger: HostLedger): void;
@@ -0,0 +1,54 @@
1
+ import type { AgentHomeProjectionRequest } from '@byok-sdk/server';
2
+ import type { ExecutionTemplate } from '@byok-sdk/server/execution-core';
3
+ import type { Room, Round, Seat } from './rules/rooms.js';
4
+ import type { Autonomy } from './rules/autonomy.js';
5
+ import type { ExternalTeam } from './rules/team.js';
6
+ export type { Room, Round, Seat };
7
+ export interface BotProfile {
8
+ id: string;
9
+ name: string;
10
+ role: string;
11
+ persona: string;
12
+ model: string;
13
+ mainBot: boolean;
14
+ archived: boolean;
15
+ revision: string;
16
+ readyRevision: string | null;
17
+ /**
18
+ * Host autonomy policy (#1229). Absent reads as `observe`, the default of a new Bot: each create_routine, cross-Bot
19
+ * delegate and room_call is recorded as would-do until the owner switches this Bot to `auto`. Host state, never wire.
20
+ */
21
+ autonomy?: Autonomy;
22
+ /** #1319: the team authority suspended this Bot. It stays a member and takes no new work. Absent: participating. */
23
+ participation?: 'suspended';
24
+ execution: ExecutionTemplate;
25
+ }
26
+ export interface HomeOperation {
27
+ sequence: number;
28
+ botId: string;
29
+ request: AgentHomeProjectionRequest;
30
+ retries: AgentHomeProjectionRequest[];
31
+ retryAt?: number;
32
+ status: 'pending' | 'applied' | 'failed';
33
+ error?: string;
34
+ /** Set in the transaction before the first write is sent (#957), so a crash or a failed send still counts it as sent. */
35
+ sent?: true;
36
+ }
37
+ export interface TeamState {
38
+ bots: Record<string, BotProfile>;
39
+ rooms: Record<string, Room>;
40
+ rounds: Record<string, Round>;
41
+ seats: Record<string, Seat>;
42
+ roots: Record<string, {
43
+ autonomous: number;
44
+ late: number;
45
+ }>;
46
+ notes: Array<{
47
+ id: string;
48
+ text: string;
49
+ }>;
50
+ homeOperations: HomeOperation[];
51
+ /** External team mode (#739 Q4c). Absent: this Host owns its local team. */
52
+ external?: ExternalTeam;
53
+ }
54
+ export declare function emptyTeam(): TeamState;
package/dist/team.d.ts ADDED
@@ -0,0 +1,56 @@
1
+ import type { AgentHomeProjectionReadback, BotTurnOutcome, CreateBotAction, UpdateBotAction } from '@byok-sdk/protocol';
2
+ import { type ExecutionTemplate } from '@byok-sdk/server/execution-core';
3
+ import { type CollaborationState } from './model.js';
4
+ import type { BotProfile, HomeOperation, TeamState } from './team-model.js';
5
+ import type { Publish } from './rules/delegation.js';
6
+ import { roomFields } from './rules/rooms.js';
7
+ import { NEW_BOTS, NEW_ROOMS } from './rules/schema.js';
8
+ import { activeBot, admitBotToolsets, inactive, requireMain, type TeamSnapshotBot } from './rules/team.js';
9
+ export { activeBot, admitBotToolsets, inactive, NEW_BOTS, NEW_ROOMS, requireMain, roomFields };
10
+ export declare const TEAM_NOTE_LIMIT = 20;
11
+ export declare function projectionRequestId(value: unknown): string;
12
+ /**
13
+ * The Agent home flush rules (#793 S13), the pure part of L's `flushHomes`; each Host runs its own I/O around them.
14
+ * `homeHead` gives the pending operation `sequence` when it is its Bot's oldest pending one and the Bot is free
15
+ * (`busy(botId)`: the Bot has an intent with no conclusion). Only a head is flushed.
16
+ */
17
+ export declare function homeHead(team: Pick<TeamState, 'homeOperations'>, sequence: number, busy: (botId: string) => boolean): HomeOperation | undefined;
18
+ /** The requests of an operation in the order a flush reads them back: the first, then each retry. */
19
+ export declare const homeRequests: (op: HomeOperation) => import("@byok-sdk/server").AgentHomeProjectionRequest[];
20
+ export type HomeReadback = Pick<AgentHomeProjectionReadback, 'deviceId' | 'agentRef' | 'requestId' | 'projectionHash' | 'status'>;
21
+ /**
22
+ * Checks the readback of one request of the operation. A readback for another device, Agent, request or projection throws
23
+ * `Home readback identity conflict`. Returns it when it is terminal (not `pending`); the flush reads no later request then.
24
+ */
25
+ export declare function checkHomeReadback(request: HomeOperation['request'], read: HomeReadback | undefined): HomeReadback | undefined;
26
+ /**
27
+ * No request is terminal. Once `retryAt` has passed, adds a retry of the same desired revision with the next durable request
28
+ * id and a backoff (min(60 s, 1 s × 2^n)). Returns the request to enqueue: the latest.
29
+ */
30
+ export declare function planHomeRetry(op: HomeOperation, now: number): HomeOperation['request'];
31
+ /** The enqueue of the latest request succeeded: the first retry is due a second later. */
32
+ export declare function homeEnqueued(op: HomeOperation, now: number): void;
33
+ /**
34
+ * Settles the operation with a terminal readback: `applied` or `idempotent` applies it and readies its Bot at that revision;
35
+ * any other status fails it and publishes `persona-failed:<sequence>`.
36
+ */
37
+ export declare function applyHomeTerminal(state: CollaborationState, op: HomeOperation, terminal: HomeReadback, publish: Publish): void;
38
+ /** A flush step threw: the operation keeps `pending` with the error. */
39
+ export declare function failHomeFlush(op: HomeOperation, error: unknown): void;
40
+ export declare function createBot(state: CollaborationState, taskId: string, action: CreateBotAction, models: Record<string, ExecutionTemplate>, readOnlyToolsets?: readonly string[]): BotProfile;
41
+ export declare function updateBot(state: CollaborationState, action: UpdateBotAction, models: Record<string, ExecutionTemplate>, readOnlyToolsets?: readonly string[]): void;
42
+ /**
43
+ * The `teamBot` port of a team snapshot (#739 Q4c). A new Bot gets the snapshot id and its first projection.
44
+ * A profile change takes the `update_bot` path, so it queues the same persona projection (T4).
45
+ * Host persona mode (#879): the Bot takes the Host's profile revision and no projection is queued.
46
+ */
47
+ export declare function writeSnapshotBot(state: CollaborationState, row: TeamSnapshotBot, models: Record<string, ExecutionTemplate>, readOnlyToolsets?: readonly string[]): void;
48
+ /**
49
+ * Re-projects the Host's execution templates onto each unarchived Bot, a suspended one too (#1357). A Bot keeps its device,
50
+ * and its agentRef follows its profile. A Bot whose model has no template keeps its stored one, and the freeze holds its Turns
51
+ * with `Unavailable model` until the Host provides it. No profile field changes and no persona projection is queued.
52
+ * A template that fails the toolset check refuses the whole call before any write.
53
+ */
54
+ export declare function applyModels(state: CollaborationState, models: Readonly<Record<string, ExecutionTemplate>>, readOnlyToolsets: readonly string[]): void;
55
+ export declare function applyManagement(state: CollaborationState, actor: string, taskId: string, outcome: BotTurnOutcome, models: Record<string, ExecutionTemplate>, accept: (action: string, work: () => void) => void, readOnlyToolsets?: readonly string[]): void;
56
+ export declare function same(value: unknown, other: unknown): boolean;
@@ -0,0 +1,6 @@
1
+ export { cardCallVectors, cardVectors, coalesceVectors, commitVectors, deviceVectors, homeVectors, replyVectors, roomVectors, seedCollaboration, seedRoom, settlementVectors, SYNC_OPTIONS, syncVectors, VECTOR_NOW, type CardCallSubject, type CardSubject, type CoalesceSubject, type CommitSubject, type DeviceSubject, type HomeCalls, type HomeSubject, type ReplySubject, type RoomSubject, type SeedTeam, type SettlementSubject, type SyncIntentRecord, type SyncSubject } from './commit-vectors.test-support.js';
2
+ export { deliveryVectors, FINAL_BODY, replyToken, type DeliverySubject } from './delivery-vectors.test-support.js';
3
+ export { policy, template } from './k4-fixtures.test-support.js';
4
+ export { openLTestHost, ResultStubAdapter, ResultStubSession, type LTestHost } from './l-test-host.test-support.js';
5
+ export { RETENTION_NOW, retentionVectors, type RetentionSubject } from './retention-vectors.test-support.js';
6
+ export { routineVectors, type OccurrenceRow, type RoutineSubject } from './routine-vectors.test-support.js';