@llblab/pi-kit 0.27.6 → 0.28.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.
- package/BACKLOG.md +2 -5
- package/CHANGELOG.md +5 -0
- package/README.md +2 -2
- package/node_modules/@llblab/pi-telegram/AGENTS.md +10 -8
- package/node_modules/@llblab/pi-telegram/BACKLOG.md +1 -9
- package/node_modules/@llblab/pi-telegram/CHANGELOG.md +13 -0
- package/node_modules/@llblab/pi-telegram/LICENSE +21 -0
- package/node_modules/@llblab/pi-telegram/README.md +15 -5
- package/node_modules/@llblab/pi-telegram/dist/lib/activity-verbosity.d.ts +1 -5
- package/node_modules/@llblab/pi-telegram/dist/lib/activity-verbosity.js +5 -7
- package/node_modules/@llblab/pi-telegram/dist/lib/bindings.d.ts +5 -1
- package/node_modules/@llblab/pi-telegram/dist/lib/bindings.js +6 -1
- package/node_modules/@llblab/pi-telegram/dist/lib/bus-api.js +4 -2
- package/node_modules/@llblab/pi-telegram/dist/lib/bus-follower.d.ts +54 -56
- package/node_modules/@llblab/pi-telegram/dist/lib/bus-follower.js +206 -139
- package/node_modules/@llblab/pi-telegram/dist/lib/bus-leader.d.ts +21 -2
- package/node_modules/@llblab/pi-telegram/dist/lib/bus-leader.js +181 -25
- package/node_modules/@llblab/pi-telegram/dist/lib/bus-transport.d.ts +4 -1
- package/node_modules/@llblab/pi-telegram/dist/lib/bus-transport.js +28 -4
- package/node_modules/@llblab/pi-telegram/dist/lib/bus.d.ts +52 -56
- package/node_modules/@llblab/pi-telegram/dist/lib/bus.js +78 -246
- package/node_modules/@llblab/pi-telegram/dist/lib/channel-posts.d.ts +1 -3
- package/node_modules/@llblab/pi-telegram/dist/lib/channel-posts.js +23 -26
- package/node_modules/@llblab/pi-telegram/dist/lib/command-templates.d.ts +0 -5
- package/node_modules/@llblab/pi-telegram/dist/lib/command-templates.js +5 -5
- package/node_modules/@llblab/pi-telegram/dist/lib/commands.d.ts +0 -23
- package/node_modules/@llblab/pi-telegram/dist/lib/commands.js +15 -15
- package/node_modules/@llblab/pi-telegram/dist/lib/config.d.ts +0 -17
- package/node_modules/@llblab/pi-telegram/dist/lib/config.js +12 -14
- package/node_modules/@llblab/pi-telegram/dist/lib/delivery.d.ts +0 -4
- package/node_modules/@llblab/pi-telegram/dist/lib/delivery.js +2 -5
- package/node_modules/@llblab/pi-telegram/dist/lib/extension.js +255 -61
- package/node_modules/@llblab/pi-telegram/dist/lib/generative-apps.d.ts +0 -19
- package/node_modules/@llblab/pi-telegram/dist/lib/inbound.d.ts +0 -2
- package/node_modules/@llblab/pi-telegram/dist/lib/inbound.js +2 -2
- package/node_modules/@llblab/pi-telegram/dist/lib/journal.d.ts +177 -16
- package/node_modules/@llblab/pi-telegram/dist/lib/journal.js +1115 -249
- package/node_modules/@llblab/pi-telegram/dist/lib/keyboard.d.ts +0 -2
- package/node_modules/@llblab/pi-telegram/dist/lib/keyboard.js +2 -2
- package/node_modules/@llblab/pi-telegram/dist/lib/lifecycle.js +1 -1
- package/node_modules/@llblab/pi-telegram/dist/lib/locks.d.ts +100 -12
- package/node_modules/@llblab/pi-telegram/dist/lib/locks.js +380 -14
- package/node_modules/@llblab/pi-telegram/dist/lib/logging.d.ts +30 -12
- package/node_modules/@llblab/pi-telegram/dist/lib/logging.js +129 -72
- package/node_modules/@llblab/pi-telegram/dist/lib/media.d.ts +28 -5
- package/node_modules/@llblab/pi-telegram/dist/lib/media.js +26 -8
- package/node_modules/@llblab/pi-telegram/dist/lib/menu-model.d.ts +0 -11
- package/node_modules/@llblab/pi-telegram/dist/lib/menu-model.js +8 -8
- package/node_modules/@llblab/pi-telegram/dist/lib/menu-settings.d.ts +0 -18
- package/node_modules/@llblab/pi-telegram/dist/lib/menu-settings.js +18 -18
- package/node_modules/@llblab/pi-telegram/dist/lib/menu-status.d.ts +4 -4
- package/node_modules/@llblab/pi-telegram/dist/lib/menu-status.js +12 -7
- package/node_modules/@llblab/pi-telegram/dist/lib/menu-thinking.d.ts +1 -1
- package/node_modules/@llblab/pi-telegram/dist/lib/menu-thinking.js +1 -1
- package/node_modules/@llblab/pi-telegram/dist/lib/menu.d.ts +1 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/menu.js +4 -3
- package/node_modules/@llblab/pi-telegram/dist/lib/outbound-attachments.d.ts +0 -1
- package/node_modules/@llblab/pi-telegram/dist/lib/outbound-attachments.js +1 -1
- package/node_modules/@llblab/pi-telegram/dist/lib/outbound-buttons.js +1 -8
- package/node_modules/@llblab/pi-telegram/dist/lib/outbound-markup.d.ts +1 -6
- package/node_modules/@llblab/pi-telegram/dist/lib/outbound-markup.js +4 -21
- package/node_modules/@llblab/pi-telegram/dist/lib/outbound.d.ts +0 -8
- package/node_modules/@llblab/pi-telegram/dist/lib/outbound.js +5 -5
- package/node_modules/@llblab/pi-telegram/dist/lib/paths.d.ts +50 -7
- package/node_modules/@llblab/pi-telegram/dist/lib/paths.js +155 -17
- package/node_modules/@llblab/pi-telegram/dist/lib/pi.d.ts +1 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/pi.js +2 -1
- package/node_modules/@llblab/pi-telegram/dist/lib/polling.d.ts +0 -5
- package/node_modules/@llblab/pi-telegram/dist/lib/polling.js +5 -5
- package/node_modules/@llblab/pi-telegram/dist/lib/preview.d.ts +0 -3
- package/node_modules/@llblab/pi-telegram/dist/lib/preview.js +3 -3
- package/node_modules/@llblab/pi-telegram/dist/lib/prompt-templates.d.ts +0 -1
- package/node_modules/@llblab/pi-telegram/dist/lib/prompt-templates.js +1 -1
- package/node_modules/@llblab/pi-telegram/dist/lib/queue.d.ts +3 -15
- package/node_modules/@llblab/pi-telegram/dist/lib/queue.js +69 -8
- package/node_modules/@llblab/pi-telegram/dist/lib/recovery.d.ts +29 -9
- package/node_modules/@llblab/pi-telegram/dist/lib/recovery.js +104 -33
- package/node_modules/@llblab/pi-telegram/dist/lib/replies.d.ts +0 -4
- package/node_modules/@llblab/pi-telegram/dist/lib/replies.js +1 -1
- package/node_modules/@llblab/pi-telegram/dist/lib/routing.d.ts +73 -8
- package/node_modules/@llblab/pi-telegram/dist/lib/routing.js +2206 -307
- package/node_modules/@llblab/pi-telegram/dist/lib/sections.d.ts +0 -2
- package/node_modules/@llblab/pi-telegram/dist/lib/sections.js +1 -1
- package/node_modules/@llblab/pi-telegram/dist/lib/status.d.ts +44 -9
- package/node_modules/@llblab/pi-telegram/dist/lib/status.js +149 -27
- package/node_modules/@llblab/pi-telegram/dist/lib/sync.d.ts +0 -5
- package/node_modules/@llblab/pi-telegram/dist/lib/sync.js +5 -4
- package/node_modules/@llblab/pi-telegram/dist/lib/telegram-api.d.ts +11 -3
- package/node_modules/@llblab/pi-telegram/dist/lib/telegram-api.js +34 -23
- package/node_modules/@llblab/pi-telegram/dist/lib/thread-cleanup-manager.d.ts +1 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/thread-cleanup-manager.js +18 -21
- package/node_modules/@llblab/pi-telegram/dist/lib/thread-naming.d.ts +32 -5
- package/node_modules/@llblab/pi-telegram/dist/lib/thread-naming.js +191 -7
- package/node_modules/@llblab/pi-telegram/dist/lib/thread-reconciler.d.ts +2 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/thread-reconciler.js +1 -1
- package/node_modules/@llblab/pi-telegram/dist/lib/threads.d.ts +291 -59
- package/node_modules/@llblab/pi-telegram/dist/lib/threads.js +1647 -369
- package/node_modules/@llblab/pi-telegram/dist/lib/turns.d.ts +0 -1
- package/node_modules/@llblab/pi-telegram/dist/lib/turns.js +1 -1
- package/node_modules/@llblab/pi-telegram/dist/lib/updates.d.ts +184 -28
- package/node_modules/@llblab/pi-telegram/dist/lib/updates.js +1032 -114
- package/node_modules/@llblab/pi-telegram/dist/lib/wire.d.ts +12 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/wire.js +21 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/workspace-admission.d.ts +25 -17
- package/node_modules/@llblab/pi-telegram/dist/lib/workspace-admission.js +95 -20
- package/node_modules/@llblab/pi-telegram/dist/lib/workspace-identity.d.ts +20 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/workspace-identity.js +103 -0
- package/node_modules/@llblab/pi-telegram/dist/lib/workspace-retirement.d.ts +43 -8
- package/node_modules/@llblab/pi-telegram/dist/lib/workspace-retirement.js +148 -52
- package/node_modules/@llblab/pi-telegram/dist/package.json +6 -6
- package/node_modules/@llblab/pi-telegram/dist/skills/generated-control-surface/SKILL.md +3 -3
- package/node_modules/@llblab/pi-telegram/dist/skills/telegram-bridge/references/diagnosis.md +3 -3
- package/node_modules/@llblab/pi-telegram/docs/README.md +1 -1
- package/node_modules/@llblab/pi-telegram/docs/activity.md +1 -1
- package/node_modules/@llblab/pi-telegram/docs/architecture.md +152 -34
- package/node_modules/@llblab/pi-telegram/docs/callback-namespaces.md +1 -1
- package/node_modules/@llblab/pi-telegram/docs/delivery.md +1 -1
- package/node_modules/@llblab/pi-telegram/docs/generative-apps.md +2 -2
- package/node_modules/@llblab/pi-telegram/docs/inbound.md +1 -1
- package/node_modules/@llblab/pi-telegram/docs/multi-instance-bus.md +125 -19
- package/node_modules/@llblab/pi-telegram/docs/public-api.md +3 -1
- package/node_modules/@llblab/pi-telegram/docs/ui-style.md +22 -8
- package/node_modules/@llblab/pi-telegram/docs/updates.md +1 -1
- package/node_modules/@llblab/pi-telegram/lib/activity-verbosity.ts +5 -9
- package/node_modules/@llblab/pi-telegram/lib/bindings.ts +6 -0
- package/node_modules/@llblab/pi-telegram/lib/bus-api.ts +5 -2
- package/node_modules/@llblab/pi-telegram/lib/bus-follower.ts +243 -224
- package/node_modules/@llblab/pi-telegram/lib/bus-leader.ts +178 -31
- package/node_modules/@llblab/pi-telegram/lib/bus-transport.ts +30 -8
- package/node_modules/@llblab/pi-telegram/lib/bus.ts +110 -334
- package/node_modules/@llblab/pi-telegram/lib/channel-posts.ts +29 -29
- package/node_modules/@llblab/pi-telegram/lib/command-templates.ts +5 -5
- package/node_modules/@llblab/pi-telegram/lib/commands.ts +15 -15
- package/node_modules/@llblab/pi-telegram/lib/config.ts +12 -17
- package/node_modules/@llblab/pi-telegram/lib/delivery.ts +2 -8
- package/node_modules/@llblab/pi-telegram/lib/extension.ts +257 -72
- package/node_modules/@llblab/pi-telegram/lib/generative-apps.ts +0 -22
- package/node_modules/@llblab/pi-telegram/lib/inbound.ts +2 -2
- package/node_modules/@llblab/pi-telegram/lib/journal.ts +1182 -326
- package/node_modules/@llblab/pi-telegram/lib/keyboard.ts +2 -2
- package/node_modules/@llblab/pi-telegram/lib/lifecycle.ts +1 -1
- package/node_modules/@llblab/pi-telegram/lib/locks.ts +402 -23
- package/node_modules/@llblab/pi-telegram/lib/logging.ts +151 -101
- package/node_modules/@llblab/pi-telegram/lib/media.ts +51 -9
- package/node_modules/@llblab/pi-telegram/lib/menu-model.ts +8 -8
- package/node_modules/@llblab/pi-telegram/lib/menu-settings.ts +18 -18
- package/node_modules/@llblab/pi-telegram/lib/menu-status.ts +11 -0
- package/node_modules/@llblab/pi-telegram/lib/menu-thinking.ts +2 -2
- package/node_modules/@llblab/pi-telegram/lib/menu.ts +5 -1
- package/node_modules/@llblab/pi-telegram/lib/outbound-attachments.ts +1 -1
- package/node_modules/@llblab/pi-telegram/lib/outbound-buttons.ts +1 -10
- package/node_modules/@llblab/pi-telegram/lib/outbound-markup.ts +5 -24
- package/node_modules/@llblab/pi-telegram/lib/outbound.ts +5 -5
- package/node_modules/@llblab/pi-telegram/lib/paths.ts +177 -17
- package/node_modules/@llblab/pi-telegram/lib/pi.ts +5 -2
- package/node_modules/@llblab/pi-telegram/lib/polling.ts +5 -5
- package/node_modules/@llblab/pi-telegram/lib/preview.ts +3 -3
- package/node_modules/@llblab/pi-telegram/lib/prompt-templates.ts +1 -1
- package/node_modules/@llblab/pi-telegram/lib/queue.ts +67 -9
- package/node_modules/@llblab/pi-telegram/lib/recovery.ts +104 -44
- package/node_modules/@llblab/pi-telegram/lib/replies.ts +1 -1
- package/node_modules/@llblab/pi-telegram/lib/routing.ts +1955 -375
- package/node_modules/@llblab/pi-telegram/lib/sections.ts +1 -1
- package/node_modules/@llblab/pi-telegram/lib/status.ts +156 -36
- package/node_modules/@llblab/pi-telegram/lib/sync.ts +4 -4
- package/node_modules/@llblab/pi-telegram/lib/telegram-api.ts +48 -33
- package/node_modules/@llblab/pi-telegram/lib/thread-cleanup-manager.ts +24 -21
- package/node_modules/@llblab/pi-telegram/lib/thread-naming.ts +267 -9
- package/node_modules/@llblab/pi-telegram/lib/thread-reconciler.ts +3 -1
- package/node_modules/@llblab/pi-telegram/lib/threads.ts +1697 -488
- package/node_modules/@llblab/pi-telegram/lib/turns.ts +1 -1
- package/node_modules/@llblab/pi-telegram/lib/updates.ts +1072 -151
- package/node_modules/@llblab/pi-telegram/lib/wire.ts +28 -0
- package/node_modules/@llblab/pi-telegram/lib/workspace-admission.ts +97 -47
- package/node_modules/@llblab/pi-telegram/lib/workspace-identity.ts +147 -0
- package/node_modules/@llblab/pi-telegram/lib/workspace-retirement.ts +188 -89
- package/node_modules/@llblab/pi-telegram/package.json +6 -6
- package/node_modules/@llblab/pi-telegram/scripts/audit-exports.mjs +100 -0
- package/node_modules/@llblab/pi-telegram/scripts/check-downgrade.mjs +80 -43
- package/node_modules/@llblab/pi-telegram/skills/generated-control-surface/SKILL.md +3 -3
- package/node_modules/@llblab/pi-telegram/skills/telegram-bridge/references/diagnosis.md +3 -3
- package/package.json +2 -2
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
* Owns serializable bus envelopes, socket/auth helpers, local IPC client/server primitives,
|
|
5
5
|
* cross-instance forwarding helpers, and the live follower registry model.
|
|
6
6
|
*/
|
|
7
|
-
import { type TelegramBusTransportEventRecorder, type TelegramBusTransportRetryPolicy } from "./bus-transport.ts";
|
|
7
|
+
import { type TelegramBusEndpointLayout, type TelegramBusTransportEventRecorder, type TelegramBusTransportRetryPolicy } from "./bus-transport.ts";
|
|
8
8
|
import { type TelegramQueueHandoffPayload } from "./queue.ts";
|
|
9
9
|
import type { TelegramTarget } from "./target.ts";
|
|
10
10
|
import type { TelegramThreadDisplayMode } from "./config.ts";
|
|
11
11
|
import { type TelegramSessionReplacementIntent } from "./threads.ts";
|
|
12
|
-
|
|
12
|
+
interface TelegramBusProcessRuntime {
|
|
13
13
|
instanceId: string;
|
|
14
14
|
processId: number;
|
|
15
15
|
processBirthId: string;
|
|
@@ -17,22 +17,15 @@ export interface TelegramBusProcessRuntime {
|
|
|
17
17
|
getLeaderSocketPath: () => string;
|
|
18
18
|
getFollowerSocketPath: () => string;
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
interface TelegramProcessBirthIdentityOptions {
|
|
21
21
|
platform?: NodeJS.Platform;
|
|
22
22
|
readProcStat?: (pid: number) => string;
|
|
23
23
|
readDarwinProcessStart?: (pid: number) => string;
|
|
24
24
|
}
|
|
25
|
-
export type TelegramProcessBirthProof = {
|
|
26
|
-
status: "proven";
|
|
27
|
-
identity: string;
|
|
28
|
-
} | {
|
|
29
|
-
status: "unverifiable";
|
|
30
|
-
};
|
|
31
25
|
export type TelegramProcessLiveness = "alive" | "dead" | "unverifiable";
|
|
32
|
-
|
|
26
|
+
interface TelegramProcessLivenessOptions extends TelegramProcessBirthIdentityOptions {
|
|
33
27
|
isProcessAlive?: (pid: number) => boolean;
|
|
34
28
|
}
|
|
35
|
-
export declare function getTelegramProcessBirthProof(pid: number, options?: TelegramProcessBirthIdentityOptions): TelegramProcessBirthProof;
|
|
36
29
|
export declare function getTelegramProcessBirthIdentity(pid: number, fallbackGeneration: number | string, options?: TelegramProcessBirthIdentityOptions): string;
|
|
37
30
|
export declare function getTelegramProcessLiveness(owner: {
|
|
38
31
|
processId: number;
|
|
@@ -41,19 +34,20 @@ export declare function getTelegramProcessLiveness(owner: {
|
|
|
41
34
|
export declare function getTelegramProcessBirthIdentityLiveness(processBirthId: string, options?: TelegramProcessLivenessOptions): TelegramProcessLiveness;
|
|
42
35
|
export declare function createCurrentTelegramBusProcessRuntime(input: {
|
|
43
36
|
getActiveProfileName: () => string | undefined;
|
|
37
|
+
endpointLayout?: TelegramBusEndpointLayout;
|
|
44
38
|
pid?: number;
|
|
45
39
|
parentPid?: number;
|
|
46
40
|
createdAtMs?: number;
|
|
47
41
|
}): TelegramBusProcessRuntime;
|
|
48
42
|
export declare function createTelegramBusProcessRuntime(input: {
|
|
49
43
|
getActiveProfileName: () => string | undefined;
|
|
44
|
+
endpointLayout?: TelegramBusEndpointLayout;
|
|
50
45
|
pid: number;
|
|
51
46
|
parentPid: number;
|
|
52
47
|
parentProcessIdentity?: string;
|
|
53
48
|
createdAtMs: number;
|
|
54
49
|
}): TelegramBusProcessRuntime;
|
|
55
50
|
export declare function createTelegramBusAuthSecret(): string;
|
|
56
|
-
export declare const TELEGRAM_BUS_PROTOCOL_VERSION: 2;
|
|
57
51
|
export declare const TELEGRAM_BUS_CAPABILITY_DURABLE_FOLLOWER_ADMISSION: "durable-follower-admission-v1";
|
|
58
52
|
export declare const TELEGRAM_BUS_CAPABILITY_QUEUE_HANDOFF: "queue-handoff-v1";
|
|
59
53
|
export declare const TELEGRAM_BUS_CAPABILITY_INPUT_CUSTODY_REFERENCE: "input-custody-reference-v1";
|
|
@@ -62,12 +56,27 @@ export declare const TELEGRAM_BUS_CAPABILITY_THREAD_DISPLAY_MODE: "thread-displa
|
|
|
62
56
|
export declare const TELEGRAM_BUS_CAPABILITY_DIRECTORY_DISPLAY_FORMAT: "directory-display-format-v1";
|
|
63
57
|
export declare const TELEGRAM_BUS_CAPABILITY_WORKSPACE_FOLLOWER_AUTO_CONNECT: "workspace-follower-auto-connect-v1";
|
|
64
58
|
export declare const TELEGRAM_BUS_CAPABILITY_SESSION_REPLACEMENT_INTENT: "session-replacement-intent-v1";
|
|
59
|
+
export declare const TELEGRAM_BUS_CAPABILITY_WORKSPACE_RESTORE: "workspace-restore-v1";
|
|
60
|
+
export interface TelegramBusWorkspaceRestoreObservation {
|
|
61
|
+
operationId: string;
|
|
62
|
+
recipient: {
|
|
63
|
+
kind: "follower";
|
|
64
|
+
instanceId: string;
|
|
65
|
+
sessionId: string;
|
|
66
|
+
generation: string;
|
|
67
|
+
};
|
|
68
|
+
target: TelegramTarget & {
|
|
69
|
+
threadId: number;
|
|
70
|
+
};
|
|
71
|
+
slot: string;
|
|
72
|
+
ready: boolean;
|
|
73
|
+
}
|
|
65
74
|
export interface TelegramBusProtocolIdentity {
|
|
66
75
|
protocolVersion: number;
|
|
67
76
|
runtimeBuild: string;
|
|
68
77
|
capabilities: string[];
|
|
69
78
|
}
|
|
70
|
-
|
|
79
|
+
interface TelegramBusProtocolCompatibility {
|
|
71
80
|
compatible: boolean;
|
|
72
81
|
reason?: "missing-identity" | "version-mismatch" | "missing-capability";
|
|
73
82
|
missingCapabilities: string[];
|
|
@@ -83,8 +92,8 @@ export declare function getTelegramBusProtocolCompatibility(input: {
|
|
|
83
92
|
local: TelegramBusProtocolIdentity;
|
|
84
93
|
remote?: TelegramBusProtocolIdentity;
|
|
85
94
|
}): TelegramBusProtocolCompatibility;
|
|
86
|
-
export declare function getTelegramBusSocketPath(agentDir?: string, platform?: NodeJS.Platform, profileName?: string): string;
|
|
87
|
-
export declare function getTelegramBusFollowerSocketPath(instanceId: string, agentDir?: string, platform?: NodeJS.Platform, profileName?: string): string;
|
|
95
|
+
export declare function getTelegramBusSocketPath(agentDir?: string, platform?: NodeJS.Platform, profileName?: string, layout?: TelegramBusEndpointLayout): string;
|
|
96
|
+
export declare function getTelegramBusFollowerSocketPath(instanceId: string, agentDir?: string, platform?: NodeJS.Platform, profileName?: string, layout?: TelegramBusEndpointLayout): string;
|
|
88
97
|
export interface TelegramBusInstanceRegistration {
|
|
89
98
|
instanceId: string;
|
|
90
99
|
previousInstanceId?: string;
|
|
@@ -125,9 +134,7 @@ export declare function getTelegramFollowerTargetOwnership(input: {
|
|
|
125
134
|
protocolIdentity: TelegramBusProtocolIdentity;
|
|
126
135
|
} | undefined;
|
|
127
136
|
export declare function markTelegramBusAggregateDelivery<T extends Record<string, unknown>>(body: T): T;
|
|
128
|
-
export declare function isTelegramBusAggregateDelivery(body: unknown): boolean;
|
|
129
137
|
export declare function markTelegramBusCrossTargetDelivery<T extends Record<string, unknown>>(body: T): T;
|
|
130
|
-
export declare function isTelegramBusCrossTargetDelivery(body: unknown): boolean;
|
|
131
138
|
export declare function stripTelegramBusApiMetadata<T extends Record<string, unknown>>(body: T): T;
|
|
132
139
|
export declare function isTelegramFollowerApiCallAllowed(input: {
|
|
133
140
|
follower: TelegramBusFollowerView;
|
|
@@ -135,7 +142,7 @@ export declare function isTelegramFollowerApiCallAllowed(input: {
|
|
|
135
142
|
args: unknown[];
|
|
136
143
|
isMessageOwned?: (chatId: number, messageId: number) => boolean;
|
|
137
144
|
}): boolean;
|
|
138
|
-
|
|
145
|
+
interface TelegramFollowerApiCallAuthorizationInput {
|
|
139
146
|
follower: TelegramBusFollowerView;
|
|
140
147
|
method: string;
|
|
141
148
|
args: unknown[];
|
|
@@ -169,7 +176,7 @@ export interface TelegramBusFollowerDeliveryIdentity {
|
|
|
169
176
|
handoffId: string;
|
|
170
177
|
};
|
|
171
178
|
}
|
|
172
|
-
|
|
179
|
+
type TelegramBusForeignUpdateFailureClass = "source-update-identity-missing" | "recipient-binding-missing" | "recipient-generation-missing" | "source-reference-missing" | "recipient-ownership-stale" | "transport-failed" | "acknowledgement-missing" | "acknowledgement-rejected" | "acknowledgement-mismatched" | "durable-receipt-missing" | "durable-receipt-mismatched";
|
|
173
180
|
export type TelegramBusForeignUpdateSettlement = {
|
|
174
181
|
status: "accepted";
|
|
175
182
|
delivery: TelegramBusFollowerDeliveryIdentity;
|
|
@@ -313,17 +320,12 @@ export type TelegramBusEnvelope = ({
|
|
|
313
320
|
delivery: TelegramBusFollowerDeliveryIdentity;
|
|
314
321
|
sentAtMs: number;
|
|
315
322
|
} | {
|
|
316
|
-
kind: "leader.
|
|
323
|
+
kind: "leader.workspaceRestore";
|
|
317
324
|
requestId: string;
|
|
318
325
|
recipientInstanceId: string;
|
|
319
|
-
recipientRegistrationGeneration
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
};
|
|
323
|
-
oldTarget?: TelegramTarget & {
|
|
324
|
-
threadId: number;
|
|
325
|
-
};
|
|
326
|
-
reason: "thread-restore";
|
|
326
|
+
recipientRegistrationGeneration: string;
|
|
327
|
+
operationId: string;
|
|
328
|
+
mode: "apply" | "inspect";
|
|
327
329
|
sentAtMs: number;
|
|
328
330
|
} | {
|
|
329
331
|
kind: "leader.offerQueueHandoff";
|
|
@@ -392,7 +394,7 @@ export type TelegramBusEnvelope = ({
|
|
|
392
394
|
}) & {
|
|
393
395
|
auth?: string;
|
|
394
396
|
};
|
|
395
|
-
|
|
397
|
+
type TelegramBusEnvelopeTrafficClass = "bootstrap" | "generation-fenced" | "response";
|
|
396
398
|
export declare function getTelegramBusEnvelopeTrafficClass(envelope: TelegramBusEnvelope): TelegramBusEnvelopeTrafficClass;
|
|
397
399
|
export declare function createTelegramBusRequestId(input: {
|
|
398
400
|
instanceId: string;
|
|
@@ -401,14 +403,14 @@ export declare function createTelegramBusRequestId(input: {
|
|
|
401
403
|
export declare function createTelegramBusRequestIdFactory(instanceId: string): () => string;
|
|
402
404
|
export declare function encodeTelegramBusEnvelope(envelope: TelegramBusEnvelope): string;
|
|
403
405
|
export declare function parseTelegramBusEnvelope(line: string): TelegramBusEnvelope | undefined;
|
|
404
|
-
|
|
406
|
+
interface TelegramBusLocalServer {
|
|
405
407
|
start: () => Promise<void>;
|
|
406
408
|
stop: () => Promise<void>;
|
|
407
409
|
ensureEndpoint: () => Promise<boolean>;
|
|
408
410
|
}
|
|
409
411
|
export type TelegramBusSocketPathSource = string | (() => string);
|
|
410
412
|
export declare function resolveTelegramBusSocketPath(source: TelegramBusSocketPathSource, platform?: NodeJS.Platform | string): string;
|
|
411
|
-
|
|
413
|
+
interface TelegramBusLocalServerDeps {
|
|
412
414
|
socketPath: TelegramBusSocketPathSource;
|
|
413
415
|
handleEnvelope: (envelope: TelegramBusEnvelope) => Promise<TelegramBusEnvelope | undefined> | TelegramBusEnvelope | undefined;
|
|
414
416
|
recordTransportEvent?: TelegramBusTransportEventRecorder;
|
|
@@ -417,14 +419,14 @@ export interface TelegramBusLocalServerDeps {
|
|
|
417
419
|
requestLedgerMaxEntries?: number;
|
|
418
420
|
shouldDropResponse?: (request: TelegramBusEnvelope, response: TelegramBusEnvelope) => boolean;
|
|
419
421
|
}
|
|
420
|
-
|
|
422
|
+
interface TelegramBusLocalClientOptions {
|
|
421
423
|
socketPath: string;
|
|
422
424
|
envelope: TelegramBusEnvelope;
|
|
423
425
|
timeoutMs?: number;
|
|
424
426
|
retry?: TelegramBusTransportRetryPolicy;
|
|
425
427
|
recordTransportEvent?: TelegramBusTransportEventRecorder;
|
|
426
428
|
}
|
|
427
|
-
|
|
429
|
+
interface TelegramBusForeignOwnedForwarderDeps<TMessage = unknown> {
|
|
428
430
|
socketPath: TelegramBusSocketPathSource;
|
|
429
431
|
createRequestId: () => string;
|
|
430
432
|
getNowMs?: () => number;
|
|
@@ -477,38 +479,31 @@ export declare function createTelegramBusForeignOwnedUpdateForwarder<TContext, T
|
|
|
477
479
|
ctx: TContext;
|
|
478
480
|
}) => Promise<TelegramBusForeignUpdateSettlement>;
|
|
479
481
|
};
|
|
480
|
-
export interface TelegramBusFollowerThreadRestoreHandlerDeps {
|
|
481
|
-
followerRegistry: Pick<TelegramBusFollowerRegistry, "get" | "register">;
|
|
482
|
-
followerTargetController: ReturnType<typeof createTelegramBusFollowerTargetController>;
|
|
483
|
-
onRestored?: () => void;
|
|
484
|
-
}
|
|
485
482
|
export declare function listTelegramBusLiveThreadTargets(input: {
|
|
486
483
|
leaderTarget?: TelegramTarget;
|
|
487
484
|
followers: readonly TelegramBusFollowerView[];
|
|
488
485
|
}): TelegramTarget[];
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
export declare function createTelegramBusFollowerThreadRestoreHandler(deps: TelegramBusFollowerThreadRestoreHandlerDeps): (input: {
|
|
502
|
-
record: {
|
|
503
|
-
instanceId?: string;
|
|
504
|
-
};
|
|
486
|
+
/** Caller owns the durable one-shot apply grant. Inspections never grant another apply. */
|
|
487
|
+
export declare function createTelegramBusWorkspaceRestoreController(deps: {
|
|
488
|
+
getFollower: (instanceId: string) => TelegramBusFollowerView | undefined;
|
|
489
|
+
localProtocolIdentity: TelegramBusProtocolIdentity;
|
|
490
|
+
createRequestId: () => string;
|
|
491
|
+
getAuthSecret: () => string | undefined;
|
|
492
|
+
timeoutMs?: number;
|
|
493
|
+
}): (input: {
|
|
494
|
+
operationId: string;
|
|
495
|
+
instanceId: string;
|
|
496
|
+
sessionId: string;
|
|
497
|
+
slot: string;
|
|
505
498
|
target: TelegramTarget & {
|
|
506
499
|
threadId: number;
|
|
507
500
|
};
|
|
508
|
-
oldTarget
|
|
501
|
+
oldTarget: TelegramTarget & {
|
|
509
502
|
threadId: number;
|
|
510
503
|
};
|
|
511
|
-
|
|
504
|
+
mode: "apply" | "inspect";
|
|
505
|
+
isCurrent: () => boolean;
|
|
506
|
+
}) => Promise<TelegramBusWorkspaceRestoreObservation | undefined>;
|
|
512
507
|
export declare function isTelegramBusEnvelopeAuthorized(envelope: TelegramBusEnvelope, secret: string | undefined): boolean;
|
|
513
508
|
export declare function createUnauthorizedBusAck(requestId: string): TelegramBusEnvelope;
|
|
514
509
|
export declare function createTelegramBusLocalServer(deps: TelegramBusLocalServerDeps): TelegramBusLocalServer;
|
|
@@ -529,3 +524,4 @@ export interface TelegramBusFollowerRegistry {
|
|
|
529
524
|
}
|
|
530
525
|
export declare function createTelegramBusForwardOwnershipValidator(registry: Pick<TelegramBusFollowerRegistry, "get">): (ownership: TelegramBusForwardOwnership) => boolean;
|
|
531
526
|
export declare function createTelegramBusFollowerRegistry(): TelegramBusFollowerRegistry;
|
|
527
|
+
export {};
|