@letta-ai/letta-code 0.33.1 → 0.33.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/agent-presets.js +22 -37
- package/dist/agent-presets.js.map +3 -3
- package/dist/channels-public.js +6 -35
- package/dist/channels-public.js.map +3 -3
- package/dist/channels-slack.js +2 -2
- package/dist/channels-slack.js.map +4 -4
- package/dist/gateway-core.js +8 -36
- package/dist/gateway-core.js.map +4 -4
- package/dist/mcp-client.js +2 -2
- package/dist/mcp-client.js.map +1 -1
- package/dist/memory-confinement.js.map +1 -1
- package/dist/types/agent/approval-execution.d.ts.map +1 -1
- package/dist/types/agent/cloud-managed-system-prompt.d.ts +10 -0
- package/dist/types/agent/cloud-managed-system-prompt.d.ts.map +1 -0
- package/dist/types/agent/create-agent-request.d.ts +4 -0
- package/dist/types/agent/create-agent-request.d.ts.map +1 -1
- package/dist/types/agent/legacy-default-system-prompt-hashes.d.ts +14 -0
- package/dist/types/agent/legacy-default-system-prompt-hashes.d.ts.map +1 -0
- package/dist/types/agent/memory-conflict-repair.d.ts +5 -4
- package/dist/types/agent/memory-conflict-repair.d.ts.map +1 -1
- package/dist/types/agent/memory-constraints-audit.d.ts +19 -0
- package/dist/types/agent/memory-constraints-audit.d.ts.map +1 -0
- package/dist/types/agent/memory-constraints.d.ts.map +1 -1
- package/dist/types/agent/memory-filesystem.d.ts.map +1 -1
- package/dist/types/agent/memory-format.d.ts +1 -3
- package/dist/types/agent/memory-format.d.ts.map +1 -1
- package/dist/types/agent/memory-git-hooks.d.ts +7 -0
- package/dist/types/agent/memory-git-hooks.d.ts.map +1 -1
- package/dist/types/agent/memory-git.d.ts +3 -12
- package/dist/types/agent/memory-git.d.ts.map +1 -1
- package/dist/types/agent/modify.d.ts +1 -1
- package/dist/types/agent/modify.d.ts.map +1 -1
- package/dist/types/agent/subagents/index.d.ts.map +1 -1
- package/dist/types/agent/subagents/manager.d.ts.map +1 -1
- package/dist/types/agent/subagents/sandbox.d.ts +1 -1
- package/dist/types/agent/subagents/subagent-launcher.d.ts +1 -1
- package/dist/types/agent/system-prompt-versioning.d.ts +8 -0
- package/dist/types/agent/system-prompt-versioning.d.ts.map +1 -1
- package/dist/types/backend/api/conversation-enqueue.d.ts +3 -1
- package/dist/types/backend/api/conversation-enqueue.d.ts.map +1 -1
- package/dist/types/backend/api/request.d.ts +2 -1
- package/dist/types/backend/api/request.d.ts.map +1 -1
- package/dist/types/backend/local/initial-memory.d.ts +7 -0
- package/dist/types/backend/local/initial-memory.d.ts.map +1 -0
- package/dist/types/backend/local/local-backend.d.ts.map +1 -1
- package/dist/types/backend/local/local-store.d.ts +66 -26
- package/dist/types/backend/local/local-store.d.ts.map +1 -1
- package/dist/types/backend/local/local-transcript.d.ts +171 -0
- package/dist/types/backend/local/local-transcript.d.ts.map +1 -0
- package/dist/types/backend/local/local-types.d.ts +8 -0
- package/dist/types/backend/local/local-types.d.ts.map +1 -1
- package/dist/types/backend/local/system-prompt-compilation.d.ts.map +1 -1
- package/dist/types/channels/message-channel-tool-definition.d.ts.map +1 -1
- package/dist/types/channels/progress-formatting.d.ts.map +1 -1
- package/dist/types/channels/slack/progress.d.ts.map +1 -1
- package/dist/types/cli/helpers/tool-name-mapping.d.ts.map +1 -1
- package/dist/types/cron/runner.d.ts +16 -68
- package/dist/types/cron/runner.d.ts.map +1 -1
- package/dist/types/cron/scheduler.d.ts.map +1 -1
- package/dist/types/managed-cloud-runtime.d.ts +9 -0
- package/dist/types/managed-cloud-runtime.d.ts.map +1 -0
- package/dist/types/mods/disabled-mod-adapter.d.ts.map +1 -1
- package/dist/types/mods/event-emitter.d.ts +2 -0
- package/dist/types/mods/event-emitter.d.ts.map +1 -1
- package/dist/types/mods/mod-adapter.d.ts.map +1 -1
- package/dist/types/permissions/canonical.d.ts.map +1 -1
- package/dist/types/permissions/checker.d.ts.map +1 -1
- package/dist/types/permissions/cross-agent-guard.d.ts +2 -2
- package/dist/types/permissions/cross-agent-guard.d.ts.map +1 -1
- package/dist/types/permissions/mode.d.ts.map +1 -1
- package/dist/types/permissions/workspace-sandbox.d.ts.map +1 -1
- package/dist/types/queue/queue-runtime.d.ts +2 -0
- package/dist/types/queue/queue-runtime.d.ts.map +1 -1
- package/dist/types/queue/turn-queue-runtime.d.ts +23 -0
- package/dist/types/queue/turn-queue-runtime.d.ts.map +1 -0
- package/dist/types/reminders/catalog.d.ts +1 -1
- package/dist/types/reminders/catalog.d.ts.map +1 -1
- package/dist/types/reminders/disk-space.d.ts +47 -0
- package/dist/types/reminders/disk-space.d.ts.map +1 -0
- package/dist/types/reminders/engine.d.ts.map +1 -1
- package/dist/types/reminders/state.d.ts +2 -0
- package/dist/types/reminders/state.d.ts.map +1 -1
- package/dist/types/sandbox/availability.d.ts +1 -1
- package/dist/types/telemetry/event-queue.d.ts +32 -0
- package/dist/types/telemetry/event-queue.d.ts.map +1 -0
- package/dist/types/telemetry/index.d.ts +1 -0
- package/dist/types/telemetry/index.d.ts.map +1 -1
- package/dist/types/tools/external-tool-background-eligibility.d.ts +24 -0
- package/dist/types/tools/external-tool-background-eligibility.d.ts.map +1 -0
- package/dist/types/tools/external-tool-background.d.ts +28 -0
- package/dist/types/tools/external-tool-background.d.ts.map +1 -0
- package/dist/types/tools/external-tool-types.d.ts +44 -0
- package/dist/types/tools/external-tool-types.d.ts.map +1 -0
- package/dist/types/tools/impl/bash.d.ts.map +1 -1
- package/dist/types/tools/impl/exec-command.d.ts.map +1 -1
- package/dist/types/tools/impl/external-coding-agent.d.ts +2 -0
- package/dist/types/tools/impl/external-coding-agent.d.ts.map +1 -1
- package/dist/types/tools/impl/github-pull-request-diff.d.ts +7 -0
- package/dist/types/tools/impl/github-pull-request-diff.d.ts.map +1 -0
- package/dist/types/tools/impl/github-pull-request-query.d.ts +4 -0
- package/dist/types/tools/impl/github-pull-request-query.d.ts.map +1 -0
- package/dist/types/tools/impl/github-pull-request-state.d.ts +11 -0
- package/dist/types/tools/impl/github-pull-request-state.d.ts.map +1 -0
- package/dist/types/tools/impl/github-pull-request-types.d.ts +53 -0
- package/dist/types/tools/impl/github-pull-request-types.d.ts.map +1 -0
- package/dist/types/tools/impl/github-pull-request-watch.d.ts +16 -0
- package/dist/types/tools/impl/github-pull-request-watch.d.ts.map +1 -0
- package/dist/types/tools/impl/kill-bash.d.ts +0 -8
- package/dist/types/tools/impl/kill-bash.d.ts.map +1 -1
- package/dist/types/tools/impl/memory-task-lifecycle.d.ts +9 -8
- package/dist/types/tools/impl/memory-task-lifecycle.d.ts.map +1 -1
- package/dist/types/tools/impl/monitor.d.ts +20 -0
- package/dist/types/tools/impl/monitor.d.ts.map +1 -1
- package/dist/types/tools/impl/process_manager.d.ts +2 -2
- package/dist/types/tools/impl/process_manager.d.ts.map +1 -1
- package/dist/types/tools/impl/send-agent-message.d.ts.map +1 -1
- package/dist/types/tools/impl/shell-env.d.ts +1 -1
- package/dist/types/tools/impl/shell-env.d.ts.map +1 -1
- package/dist/types/tools/impl/skill.d.ts +0 -6
- package/dist/types/tools/impl/skill.d.ts.map +1 -1
- package/dist/types/tools/impl/task-stop.d.ts.map +1 -1
- package/dist/types/tools/impl/tool-return-clamp.d.ts +2 -3
- package/dist/types/tools/impl/tool-return-clamp.d.ts.map +1 -1
- package/dist/types/tools/impl/truncation.d.ts +0 -16
- package/dist/types/tools/impl/truncation.d.ts.map +1 -1
- package/dist/types/tools/impl/wake.d.ts.map +1 -1
- package/dist/types/tools/impl/watch-pr.d.ts +32 -0
- package/dist/types/tools/impl/watch-pr.d.ts.map +1 -0
- package/dist/types/tools/impl/windows-command-safety.d.ts +9 -0
- package/dist/types/tools/impl/windows-command-safety.d.ts.map +1 -0
- package/dist/types/tools/impl/workflow.d.ts +3 -2
- package/dist/types/tools/impl/workflow.d.ts.map +1 -1
- package/dist/types/tools/manager.d.ts +4 -56
- package/dist/types/tools/manager.d.ts.map +1 -1
- package/dist/types/tools/removed-tools.d.ts +4 -0
- package/dist/types/tools/removed-tools.d.ts.map +1 -0
- package/dist/types/tools/task-tool-assets.d.ts +9 -0
- package/dist/types/tools/task-tool-assets.d.ts.map +1 -1
- package/dist/types/tools/tool-definitions.d.ts +2 -93
- package/dist/types/tools/tool-definitions.d.ts.map +1 -1
- package/dist/types/tools/toolset-catalog.d.ts +1 -1
- package/dist/types/tools/toolset-catalog.d.ts.map +1 -1
- package/dist/types/tools/toolset.d.ts.map +1 -1
- package/dist/types/tools/workflow/sdk-spawner.d.ts.map +1 -1
- package/dist/types/tools/workflow/types.d.ts +4 -0
- package/dist/types/tools/workflow/types.d.ts.map +1 -1
- package/dist/types/types/background-process-protocol.d.ts +1 -1
- package/dist/types/types/background-process-protocol.d.ts.map +1 -1
- package/dist/types/types/external-tool-protocol.d.ts +4 -0
- package/dist/types/types/external-tool-protocol.d.ts.map +1 -1
- package/dist/types/utils/debug.d.ts +11 -1
- package/dist/types/utils/debug.d.ts.map +1 -1
- package/dist/types/utils/message-queue-bridge.d.ts +3 -0
- package/dist/types/utils/message-queue-bridge.d.ts.map +1 -1
- package/dist/types/utils/task-notifications.d.ts +1 -1
- package/dist/types/utils/task-notifications.d.ts.map +1 -1
- package/dist/types/websocket/listener/queue.d.ts.map +1 -1
- package/dist/types/websocket/listener/runtime.d.ts +2 -0
- package/dist/types/websocket/listener/runtime.d.ts.map +1 -1
- package/dist/types/websocket/listener/types.d.ts +4 -0
- package/dist/types/websocket/listener/types.d.ts.map +1 -1
- package/letta.js +25953 -27978
- package/package.json +3 -2
- package/scripts/agent-watch/verify-pr-identity.test.ts +52 -0
- package/scripts/agent-watch/verify-pr-identity.ts +13 -4
- package/scripts/isolated-unit-tests.json +5 -10
- package/scripts/postinstall-patches.js +53 -3
- package/scripts/source-file-size-baseline.json +8 -10
- package/scripts/stage-pypi-deps.mjs +10 -1
- package/skills/creating-mods/references/plan-mode.md +6 -8
- package/skills/initializing-memory/SKILL.md +122 -640
- package/skills/initializing-memory/scripts/history-coverage.mjs +129 -0
- package/skills/initializing-memory/scripts/prepare-history.mjs +219 -0
- package/skills/scheduling-tasks/SKILL.md +15 -24
- package/skills/submitting-feedback/SKILL.md +2 -0
- package/skills/workflow-authoring/SKILL.md +6 -5
- package/dist/types/agent/memory-markdown.d.ts +0 -25
- package/dist/types/agent/memory-markdown.d.ts.map +0 -1
- package/dist/types/tools/impl/grep-files.d.ts +0 -19
- package/dist/types/tools/impl/grep-files.d.ts.map +0 -1
- package/dist/types/tools/impl/list-dir-codex.d.ts +0 -21
- package/dist/types/tools/impl/list-dir-codex.d.ts.map +0 -1
- package/dist/types/tools/impl/memory-apply-patch.d.ts +0 -10
- package/dist/types/tools/impl/memory-apply-patch.d.ts.map +0 -1
- package/dist/types/tools/impl/memory.d.ts +0 -20
- package/dist/types/tools/impl/memory.d.ts.map +0 -1
- package/dist/types/tools/impl/multi-edit.d.ts +0 -21
- package/dist/types/tools/impl/multi-edit.d.ts.map +0 -1
- package/dist/types/tools/impl/read-file-codex.d.ts +0 -24
- package/dist/types/tools/impl/read-file-codex.d.ts.map +0 -1
- package/dist/types/tools/impl/shell-command.d.ts +0 -25
- package/dist/types/tools/impl/shell-command.d.ts.map +0 -1
- package/dist/types/tools/impl/shell.d.ts +0 -25
- package/dist/types/tools/impl/shell.d.ts.map +0 -1
- package/dist/types/tools/impl/todo-write.d.ts +0 -14
- package/dist/types/tools/impl/todo-write.d.ts.map +0 -1
- package/dist/types/tools/memory-tool-assets.d.ts +0 -6
- package/dist/types/tools/memory-tool-assets.d.ts.map +0 -1
- package/dist/types/tools/tool-permissions.d.ts +0 -7
- package/dist/types/tools/tool-permissions.d.ts.map +0 -1
- package/skills/initializing-memory/ROOT_MEMORY.md +0 -723
|
@@ -7,6 +7,12 @@ import { type LocalMessage } from "./local-message";
|
|
|
7
7
|
import type { LocalAgentRecord, StoredMessage } from "./local-types";
|
|
8
8
|
import type { LocalCompiledSystemPrompt } from "./system-prompt-compilation";
|
|
9
9
|
export type { LocalAgentRecord, StoredMessage };
|
|
10
|
+
/**
|
|
11
|
+
* Resident floor per conversation on disk-backed stores: the window always
|
|
12
|
+
* holds every in-context message, and messages that left the context are only
|
|
13
|
+
* evicted beyond this many. Doubles the cloud BACKFILL_PAGE_LIMIT (50).
|
|
14
|
+
*/
|
|
15
|
+
export declare const DEFAULT_RESIDENT_MESSAGE_TAIL_LIMIT = 100;
|
|
10
16
|
export interface StoredTurnInput {
|
|
11
17
|
agentId: string;
|
|
12
18
|
conversationId: string;
|
|
@@ -28,34 +34,16 @@ export interface LocalStoreOptions {
|
|
|
28
34
|
conversationIdPrefix?: string;
|
|
29
35
|
storedMessageIdPrefix?: string;
|
|
30
36
|
localMessageIdPrefix?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Resident floor for disk-backed stores; in-memory stores keep the full
|
|
39
|
+
* transcript resident (no disk to page from).
|
|
40
|
+
*/
|
|
41
|
+
residentMessageTailLimit?: number;
|
|
31
42
|
}
|
|
32
43
|
export declare class LocalBackendNotFoundError extends Error {
|
|
33
44
|
readonly status = 404;
|
|
34
45
|
constructor(resource: string, id: string);
|
|
35
46
|
}
|
|
36
|
-
export declare const LOCAL_TRANSCRIPT_LEGACY_SCHEMA_VERSION = 1;
|
|
37
|
-
export declare const LOCAL_TRANSCRIPT_SCHEMA_VERSION = 2;
|
|
38
|
-
export declare const LOCAL_TRANSCRIPT_LEGACY_MESSAGE_FORMAT = "pi-ai-message-jsonl";
|
|
39
|
-
export declare const LOCAL_TRANSCRIPT_MESSAGE_FORMAT = "pi-session-entry-jsonl";
|
|
40
|
-
export declare const LOCAL_TRANSCRIPT_PROVIDER_STACK = "pi-ai";
|
|
41
|
-
type LocalTranscriptSchemaVersion = typeof LOCAL_TRANSCRIPT_SCHEMA_VERSION | typeof LOCAL_TRANSCRIPT_LEGACY_SCHEMA_VERSION;
|
|
42
|
-
type LocalTranscriptMessageFormat = typeof LOCAL_TRANSCRIPT_MESSAGE_FORMAT | typeof LOCAL_TRANSCRIPT_LEGACY_MESSAGE_FORMAT;
|
|
43
|
-
export interface LocalTranscriptManifest {
|
|
44
|
-
schema_version: LocalTranscriptSchemaVersion;
|
|
45
|
-
message_format: LocalTranscriptMessageFormat;
|
|
46
|
-
provider_stack: typeof LOCAL_TRANSCRIPT_PROVIDER_STACK;
|
|
47
|
-
created_at: string;
|
|
48
|
-
migrated_from?: string;
|
|
49
|
-
migrated_at?: string;
|
|
50
|
-
backup_path?: string;
|
|
51
|
-
}
|
|
52
|
-
export declare class LocalTranscriptMigrationRequiredError extends Error {
|
|
53
|
-
constructor(storageDir: string);
|
|
54
|
-
}
|
|
55
|
-
export declare class LocalTranscriptRepairRequiredError extends Error {
|
|
56
|
-
constructor(storageDir: string, conversationDir: string);
|
|
57
|
-
}
|
|
58
|
-
export declare function localTranscriptMigrationCommand(storageDir: string): string;
|
|
59
47
|
export declare class LocalStore {
|
|
60
48
|
private readonly defaultAgentId;
|
|
61
49
|
private readonly storageDir?;
|
|
@@ -73,9 +61,13 @@ export declare class LocalStore {
|
|
|
73
61
|
private readonly conversations;
|
|
74
62
|
private readonly localMessagesByConversationKey;
|
|
75
63
|
private readonly loadedConversationKeys;
|
|
64
|
+
private readonly tailResidentConversationKeys;
|
|
65
|
+
private readonly residentTailStartIndexByConversationKey;
|
|
66
|
+
private readonly residentMessageTailLimit;
|
|
76
67
|
private readonly loadRepairedConversationKeys;
|
|
68
|
+
private readonly unreadTranscriptHeadBytesByKey;
|
|
77
69
|
private readonly transcriptMetadataByConversationKey;
|
|
78
|
-
private readonly
|
|
70
|
+
private readonly conversationRecordJsonByKey;
|
|
79
71
|
private readonly sessionEntryIdsByConversationKey;
|
|
80
72
|
private readonly sessionEntryIdByMessageIdByConversationKey;
|
|
81
73
|
private readonly persistedMessageByMessageIdByConversationKey;
|
|
@@ -155,15 +147,65 @@ export declare class LocalStore {
|
|
|
155
147
|
private createStoredChunk;
|
|
156
148
|
private applyListOptions;
|
|
157
149
|
private projectLocalMessages;
|
|
150
|
+
/**
|
|
151
|
+
* Index only the projections of the message matching messageId within a
|
|
152
|
+
* paged list, so deep retrieveMessage scans never pin a whole transcript.
|
|
153
|
+
*/
|
|
154
|
+
private indexMatchingMessageInList;
|
|
158
155
|
private projectTailMessagesForConversation;
|
|
159
156
|
private projectedMessagesForConversation;
|
|
160
157
|
private rebuildMessageIndex;
|
|
161
158
|
private loadConversationContainingMessage;
|
|
159
|
+
/**
|
|
160
|
+
* Page the full transcript from disk and index only the retrieved
|
|
161
|
+
* message; nothing stays resident.
|
|
162
|
+
*/
|
|
163
|
+
private indexMessageFromConversationFullRead;
|
|
162
164
|
private indexMessageFromTranscriptTail;
|
|
163
165
|
private indexMessageFromConversationTail;
|
|
166
|
+
/**
|
|
167
|
+
* Full logical message list for readers that need the whole history
|
|
168
|
+
* (executor, compaction, fork, export). Serves from the resident array
|
|
169
|
+
* when fully resident, else pages disk and merges the resident tail.
|
|
170
|
+
* Fresh array; mutation paths use residentLocalMessagesForConversation.
|
|
171
|
+
*/
|
|
164
172
|
private localMessagesForConversation;
|
|
173
|
+
/**
|
|
174
|
+
* The live resident message window for mutation paths (append, rollback,
|
|
175
|
+
* tool settlement, approval application, streaming chunk application).
|
|
176
|
+
* In-context window on disk-backed stores; appends mirror to the transcript.
|
|
177
|
+
*/
|
|
178
|
+
private residentLocalMessagesForConversation;
|
|
179
|
+
/**
|
|
180
|
+
* Read and normalize the full transcript from disk without changing
|
|
181
|
+
* message residency; undefined when there is no transcript metadata.
|
|
182
|
+
*/
|
|
183
|
+
private readConversationMessagesFromDisk;
|
|
184
|
+
private markConversationFullyResident;
|
|
185
|
+
private markNewConversationResident;
|
|
186
|
+
/**
|
|
187
|
+
* Full load: the entire parsed transcript becomes resident (legacy format,
|
|
188
|
+
* synthetic timestamp repair, in-memory stores).
|
|
189
|
+
*/
|
|
165
190
|
private loadConversationMessages;
|
|
191
|
+
/**
|
|
192
|
+
* Tail load: the transcript suffix holding every in-context message becomes
|
|
193
|
+
* the resident window; append dedup, parent chaining, and rollback
|
|
194
|
+
* detection only consult it.
|
|
195
|
+
*/
|
|
196
|
+
private loadConversationMessageTail;
|
|
197
|
+
/**
|
|
198
|
+
* Replace the resident window after a wholesale in-memory rewrite
|
|
199
|
+
* (compaction); the caller's persist appends the rewrite entry to disk.
|
|
200
|
+
*/
|
|
201
|
+
private setResidentConversationMessages;
|
|
202
|
+
/** Drop a fully resident conversation back to its bounded tail window. */
|
|
203
|
+
private demoteConversationToResidentTail;
|
|
204
|
+
/** Evict out-of-context messages (still on disk) beyond the resident floor. */
|
|
205
|
+
private trimResidentConversationTail;
|
|
206
|
+
private evictResidentHeadMessages;
|
|
166
207
|
private pushLocalMessage;
|
|
208
|
+
private validateUnreadTranscriptHeadOnce;
|
|
167
209
|
private persistPendingAssistantMessage;
|
|
168
210
|
private touchConversationForLocalMessage;
|
|
169
211
|
private cloneLocalMessageForConversation;
|
|
@@ -179,8 +221,6 @@ export declare class LocalStore {
|
|
|
179
221
|
private updateConversationSequences;
|
|
180
222
|
private cacheConversationRecord;
|
|
181
223
|
private loadConversationRecordFromDir;
|
|
182
|
-
private conversationRecordMtimeMs;
|
|
183
|
-
private recordConversationRecordMtime;
|
|
184
224
|
private refreshConversationRecordFromStorage;
|
|
185
225
|
private loadConversationRecordsFromStorage;
|
|
186
226
|
private refreshLoadedConversationRecordsFromStorage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-store.d.ts","sourceRoot":"","sources":["../../../../src/backend/local/local-store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"local-store.d.ts","sourceRoot":"","sources":["../../../../src/backend/local/local-store.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gDAAgD,CAAC;AACjF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kDAAkD,CAAC;AAC/F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAC;AACjG,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf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AAO,CAAC,YAAY;IAiBpB,OAAO,CAAC,wBAAwB;IA8ChC,OAAO,CAAC,6BAA6B;IAmFrC,OAAO,CAAC,oCAAoC;IAY5C,OAAO,CAAC,qCAAqC;IA+B7C,OAAO,CAAC,wCAAwC;IA8BhD,OAAO,CAAC,8BAA8B;IAgBtC,OAAO,CAAC,kCAAkC;IAW1C,OAAO,CAAC,0BAA0B;IAuBlC,OAAO,CAAC,qCAAqC;IAW7C,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,0BAA0B;IASlC,OAAO,CAAC,4BAA4B;IASpC,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,2BAA2B;IAoBnC,OAAO,CAAC,kBAAkB;IAyB1B,OAAO,CAAC,kBAAkB;IAa1B,OAAO,CAAC,gBAAgB;IAsBxB,OAAO,CAAC,qBAAqB;IAqC7B,OAAO,CAAC,sBAAsB;IAO9B,OAAO,CAAC,eAAe;CAKxB"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import type { LocalCompactionStats } from "./compaction";
|
|
2
|
+
import type { LocalMessage } from "./local-message";
|
|
3
|
+
import type { StoredConversation } from "./local-types";
|
|
4
|
+
export declare const LOCAL_TRANSCRIPT_LEGACY_SCHEMA_VERSION = 1;
|
|
5
|
+
export declare const LOCAL_TRANSCRIPT_SCHEMA_VERSION = 2;
|
|
6
|
+
export declare const LOCAL_TRANSCRIPT_LEGACY_MESSAGE_FORMAT = "pi-ai-message-jsonl";
|
|
7
|
+
export declare const LOCAL_TRANSCRIPT_MESSAGE_FORMAT = "pi-session-entry-jsonl";
|
|
8
|
+
export declare const LOCAL_TRANSCRIPT_PROVIDER_STACK = "pi-ai";
|
|
9
|
+
type LocalTranscriptSchemaVersion = typeof LOCAL_TRANSCRIPT_SCHEMA_VERSION | typeof LOCAL_TRANSCRIPT_LEGACY_SCHEMA_VERSION;
|
|
10
|
+
export type LocalTranscriptMessageFormat = typeof LOCAL_TRANSCRIPT_MESSAGE_FORMAT | typeof LOCAL_TRANSCRIPT_LEGACY_MESSAGE_FORMAT;
|
|
11
|
+
export interface LocalTranscriptManifest {
|
|
12
|
+
schema_version: LocalTranscriptSchemaVersion;
|
|
13
|
+
message_format: LocalTranscriptMessageFormat;
|
|
14
|
+
provider_stack: typeof LOCAL_TRANSCRIPT_PROVIDER_STACK;
|
|
15
|
+
created_at: string;
|
|
16
|
+
migrated_from?: string;
|
|
17
|
+
migrated_at?: string;
|
|
18
|
+
backup_path?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare class LocalTranscriptMigrationRequiredError extends Error {
|
|
21
|
+
constructor(storageDir: string);
|
|
22
|
+
}
|
|
23
|
+
export declare class LocalTranscriptRepairRequiredError extends Error {
|
|
24
|
+
constructor(storageDir: string, conversationDir: string);
|
|
25
|
+
}
|
|
26
|
+
export declare function localTranscriptMigrationCommand(storageDir: string): string;
|
|
27
|
+
export declare function transcriptManifestPath(conversationDir: string): string;
|
|
28
|
+
export declare function transcriptMessagesPath(conversationDir: string): string;
|
|
29
|
+
export declare function hasNonEmptyJsonl(path: string): boolean;
|
|
30
|
+
export declare function assertNoLegacyUiMessageRows(messages: readonly unknown[], storageDir: string, conversationDir: string): void;
|
|
31
|
+
interface LocalTranscriptSessionHeader {
|
|
32
|
+
type: "session";
|
|
33
|
+
version: 3;
|
|
34
|
+
id: string;
|
|
35
|
+
timestamp: string;
|
|
36
|
+
cwd: string;
|
|
37
|
+
}
|
|
38
|
+
interface LocalTranscriptEntryBase {
|
|
39
|
+
id: string;
|
|
40
|
+
parentId: string | null;
|
|
41
|
+
timestamp: string;
|
|
42
|
+
}
|
|
43
|
+
export interface LocalTranscriptSessionMessageEntry extends LocalTranscriptEntryBase {
|
|
44
|
+
type: "message";
|
|
45
|
+
message: LocalMessage;
|
|
46
|
+
}
|
|
47
|
+
export interface LocalTranscriptCompactionEntry extends LocalTranscriptEntryBase {
|
|
48
|
+
type: "compaction";
|
|
49
|
+
summary: string;
|
|
50
|
+
firstKeptEntryId: string | null;
|
|
51
|
+
tokensBefore: number;
|
|
52
|
+
message: LocalMessage;
|
|
53
|
+
details?: {
|
|
54
|
+
stats?: LocalCompactionStats;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
export type LocalTranscriptSessionEntry = LocalTranscriptSessionHeader | LocalTranscriptSessionMessageEntry | LocalTranscriptCompactionEntry;
|
|
58
|
+
export type LocalTranscriptAppendEntry = LocalTranscriptSessionMessageEntry | LocalTranscriptCompactionEntry;
|
|
59
|
+
export interface LocalTranscriptRowsResult {
|
|
60
|
+
messages: LocalMessage[];
|
|
61
|
+
entryIds: Set<string>;
|
|
62
|
+
entryIdByMessageId: Map<string, string>;
|
|
63
|
+
messageById: Map<string, LocalMessage>;
|
|
64
|
+
lastEntryId: string | null;
|
|
65
|
+
sourceStartIndex: number;
|
|
66
|
+
}
|
|
67
|
+
export declare function localMessagesHaveSameSnapshot(a: LocalMessage, b: LocalMessage): boolean;
|
|
68
|
+
export declare function createLocalTranscriptSessionHeader(conversation: StoredConversation): LocalTranscriptSessionHeader;
|
|
69
|
+
export declare function localTranscriptSessionEntries(conversation: StoredConversation, messages: readonly LocalMessage[]): LocalTranscriptSessionEntry[];
|
|
70
|
+
export declare function localTranscriptRowsResult(rows: readonly unknown[], messageFormat: LocalTranscriptMessageFormat, activeMessageIds?: readonly string[]): LocalTranscriptRowsResult;
|
|
71
|
+
export declare function createLocalTranscriptManifest(input?: {
|
|
72
|
+
migratedFrom?: string;
|
|
73
|
+
migratedAt?: string;
|
|
74
|
+
backupPath?: string;
|
|
75
|
+
}): LocalTranscriptManifest;
|
|
76
|
+
export declare function readJsonFile<T>(path: string): T | undefined;
|
|
77
|
+
export declare function readJsonlFile<T>(path: string): T[];
|
|
78
|
+
export declare function readJsonlFileSuffix<T>(path: string, maxBytes: number): {
|
|
79
|
+
items: T[];
|
|
80
|
+
reachedStart: boolean;
|
|
81
|
+
startOffset: number;
|
|
82
|
+
};
|
|
83
|
+
export declare function jsonl<T>(items: readonly T[]): string;
|
|
84
|
+
export declare function validateLocalTranscriptManifest(conversationDir: string, storageDir: string): LocalTranscriptManifest | undefined;
|
|
85
|
+
export declare function writeLocalTranscriptManifest(conversationDir: string, manifest?: LocalTranscriptManifest): void;
|
|
86
|
+
export declare function isSyntheticLocalTimestamp(value: string | null | undefined): boolean;
|
|
87
|
+
export declare function timestampFromIso(value: string): number;
|
|
88
|
+
export declare function createdAtForLocalMessage(message: LocalMessage): string | undefined;
|
|
89
|
+
export declare function localMessageDate(message: LocalMessage, fallbackDate: string): string;
|
|
90
|
+
export interface LocalTranscriptTiming {
|
|
91
|
+
createdAt?: string;
|
|
92
|
+
updatedAt?: string;
|
|
93
|
+
}
|
|
94
|
+
export declare function transcriptTimingForConversationDir(conversationDir: string, manifest?: LocalTranscriptManifest): LocalTranscriptTiming;
|
|
95
|
+
export declare function repairSyntheticLocalMessageTimestamps(messages: LocalMessage[], timing: LocalTranscriptTiming): LocalMessage[];
|
|
96
|
+
export declare function repairSyntheticConversationTimestamps(conversation: StoredConversation, messages: LocalMessage[], timing: LocalTranscriptTiming): StoredConversation;
|
|
97
|
+
export declare function normalizeLocalMessageForPi(message: LocalMessage): LocalMessage;
|
|
98
|
+
export interface LocalTranscriptTailReadResult {
|
|
99
|
+
transcript: LocalTranscriptRowsResult;
|
|
100
|
+
messages: LocalMessage[];
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Shared parse pipeline for bounded transcript tail reads: rows already read
|
|
104
|
+
* from a messages.jsonl suffix are converted to the normalized active-message
|
|
105
|
+
* view (orphan tool results dropped) without applying the full-load repair
|
|
106
|
+
* passes (timestamp interpolation, oversized tool-result clipping), which
|
|
107
|
+
* remain owned by the full-read path in local-store.ts.
|
|
108
|
+
*/
|
|
109
|
+
export declare function localTranscriptTailMessages(rows: readonly unknown[], messageFormat: LocalTranscriptMessageFormat, activeMessageIds: readonly string[], storageDir: string, conversationDir: string): LocalTranscriptTailReadResult;
|
|
110
|
+
/**
|
|
111
|
+
* Read the smallest messages.jsonl suffix that holds every in-context id (or
|
|
112
|
+
* `minMessages` messages when there is no in-context list), starting at a
|
|
113
|
+
* 64 KB window. Compacted-away rows older than the oldest in-context row stay
|
|
114
|
+
* unread, so a compacted conversation never re-reads its whole history.
|
|
115
|
+
*
|
|
116
|
+
* `liveInContextIds` is the in-context list minus ids the returned messages
|
|
117
|
+
* lack: ids with no row once the whole file was scanned (an in-flight
|
|
118
|
+
* assistant id left by a killed process) and orphan tool results the repair
|
|
119
|
+
* dropped. The returned window covers every live id.
|
|
120
|
+
*/
|
|
121
|
+
export declare function readLocalTranscriptTailWindow(messagesPath: string, messageFormat: LocalTranscriptMessageFormat, activeMessageIds: readonly string[], minMessages: number, storageDir: string, conversationDir: string): LocalTranscriptTailReadResult & {
|
|
122
|
+
reachedStart: boolean;
|
|
123
|
+
headBytes: number;
|
|
124
|
+
liveInContextIds: string[];
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Evict resident messages that left the in-context set, oldest first, while
|
|
128
|
+
* the window holds more than `floor` messages. In-context messages and the
|
|
129
|
+
* newest message (appended but not yet recorded as in context) always stay.
|
|
130
|
+
*/
|
|
131
|
+
export declare function spliceOutOfContextMessages(messages: LocalMessage[], inContextIds: readonly string[], floor: number): LocalMessage[];
|
|
132
|
+
/** Messages of a replaced window whose ids the new window no longer holds. */
|
|
133
|
+
export declare function messagesMissingFrom(replaced: readonly LocalMessage[] | undefined, next: readonly LocalMessage[]): LocalMessage[];
|
|
134
|
+
/**
|
|
135
|
+
* Whether a resident window holds every active id, so readers can serve the
|
|
136
|
+
* logical list from it without touching disk.
|
|
137
|
+
*/
|
|
138
|
+
export declare function residentCoversIds(resident: readonly LocalMessage[], activeMessageIds: readonly string[]): boolean;
|
|
139
|
+
/**
|
|
140
|
+
* One-time validation of the transcript head a bounded tail read never
|
|
141
|
+
* parsed, before the first append mutates anything. Parses each head line
|
|
142
|
+
* and applies the legacy-row check to raw rows and to the in-context
|
|
143
|
+
* messages the head holds, so a corrupt head blocks writes like the full
|
|
144
|
+
* read it replaces.
|
|
145
|
+
*/
|
|
146
|
+
export declare function validateUnreadTranscriptHead(messagesPath: string, headBytes: number, storageDir: string, conversationDir: string, activeMessageIds: readonly string[]): void;
|
|
147
|
+
/**
|
|
148
|
+
* Session-entry bookkeeping for a resident/active tail. The suffix parse may
|
|
149
|
+
* contain historical JSONL rows (especially after compaction, which appends
|
|
150
|
+
* rather than rewriting); persist and session maps must not pin those.
|
|
151
|
+
*/
|
|
152
|
+
export declare function restrictLocalTranscriptToResidentMessages(transcript: LocalTranscriptRowsResult, residentMessages: readonly LocalMessage[]): LocalTranscriptRowsResult;
|
|
153
|
+
/**
|
|
154
|
+
* Merge the authoritative on-disk message list with the resident tail window.
|
|
155
|
+
* The resident window is a suffix of the logical message list: disk rows not
|
|
156
|
+
* in the window come first, then the window in its own order (resident entries
|
|
157
|
+
* win by id — they may carry newer in-progress content, and a resident-only
|
|
158
|
+
* id is a trailing message not yet persisted). Order-preserving merge: the
|
|
159
|
+
* model must never see history resequenced.
|
|
160
|
+
*/
|
|
161
|
+
export declare function overlayResidentLocalMessageTail(diskMessages: readonly LocalMessage[], residentTail: readonly LocalMessage[]): LocalMessage[];
|
|
162
|
+
/**
|
|
163
|
+
* Overlay a resident tail onto a disk *suffix* (not the full transcript).
|
|
164
|
+
* Older resident-only ids belong before this suffix and must not be appended
|
|
165
|
+
* (that would disorder the page). Trailing unpersisted messages — the
|
|
166
|
+
* in-flight assistant that streams with `transcript: "skip"` — still trail.
|
|
167
|
+
* Overlapping ids take the resident snapshot.
|
|
168
|
+
*/
|
|
169
|
+
export declare function overlayResidentLocalMessageSuffix(diskSuffix: readonly LocalMessage[], residentTail: readonly LocalMessage[], isPersisted: (messageId: string) => boolean): LocalMessage[];
|
|
170
|
+
export {};
|
|
171
|
+
//# sourceMappingURL=local-transcript.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-transcript.d.ts","sourceRoot":"","sources":["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gB,iCAAiC,CAC/C,UAAU,EAAE,SAAS,YAAY,EAAE,EACnC,YAAY,EAAE,SAAS,YAAY,EAAE,EACrC,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,GAC1C,YAAY,EAAE,CAchB"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* systemPromptCompilation.
|
|
5
5
|
*/
|
|
6
6
|
import type { Message } from "@letta-ai/letta-client/resources/agents/messages";
|
|
7
|
+
import type { Conversation } from "@letta-ai/letta-client/resources/conversations/conversations";
|
|
7
8
|
export type StoredMessage = Message & {
|
|
8
9
|
id: string;
|
|
9
10
|
message_type: string;
|
|
@@ -23,4 +24,11 @@ export interface LocalAgentRecord {
|
|
|
23
24
|
hidden?: boolean | null;
|
|
24
25
|
compaction_settings?: Record<string, unknown> | null;
|
|
25
26
|
}
|
|
27
|
+
export type StoredConversation = Conversation & {
|
|
28
|
+
id: string;
|
|
29
|
+
agent_id: string;
|
|
30
|
+
in_context_message_ids: string[];
|
|
31
|
+
hidden?: boolean;
|
|
32
|
+
tags?: string[];
|
|
33
|
+
};
|
|
26
34
|
//# sourceMappingURL=local-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-types.d.ts","sourceRoot":"","sources":["../../../../src/backend/local/local-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kDAAkD,CAAC;
|
|
1
|
+
{"version":3,"file":"local-types.d.ts","sourceRoot":"","sources":["../../../../src/backend/local/local-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kDAAkD,CAAC;AAChF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAC;AAEjG,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CACtD;AAED,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,sBAAsB,EAAE,MAAM,EAAE,CAAC;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-prompt-compilation.d.ts","sourceRoot":"","sources":["../../../../src/backend/local/system-prompt-compilation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"system-prompt-compilation.d.ts","sourceRoot":"","sources":["../../../../src/backend/local/system-prompt-compilation.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAYtD,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,+BAA+B;IAC9C,KAAK,EAAE,gBAAgB,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAMD,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAEhE;AAkBD,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,GAChB,MAAM,GAAG,SAAS,CAYpB;AAwTD,wBAAgB,2BAA2B,CACzC,YAAY,GAAE,OAAO,EAAO,GAC3B,MAAM,CA4BR;AAED,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,MAAM,EACpB,YAAY,GAAE,OAAO,EAAO,GAC3B,MAAM,CAIR;AAED,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,+BAA+B,GACvC,yBAAyB,CA2B3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-channel-tool-definition.d.ts","sourceRoot":"","sources":["../../../src/channels/message-channel-tool-definition.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AACjF,OAAO,KAAK,EACV,2BAA2B,EAE3B,oCAAoC,EACrC,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,kBAAkB,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,cAAc,CAAC,EAAE,IAAI,CACnB,2BAA2B,EAC3B,qBAAqB,CACtB,GAAG,IAAI,CAAC;CACV;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AO,EAAE,8BAA8B,GACtC,6BAA6B,
|
|
1
|
+
{"version":3,"file":"message-channel-tool-definition.d.ts","sourceRoot":"","sources":["../../../src/channels/message-channel-tool-definition.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AACjF,OAAO,KAAK,EACV,2BAA2B,EAE3B,oCAAoC,EACrC,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,kBAAkB,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,cAAc,CAAC,EAAE,IAAI,CACnB,2BAA2B,EAC3B,qBAAqB,CACtB,GAAG,IAAI,CAAC;CACV;AAED,MAAM,WAAW,iCAAiC;IAChD,cAAc,EAAE,kBAAkB,EAAE,CAAC;IACrC,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,mBAAmB,EAAE,oCAAoC,EAAE,CAAC;CAC7D;AAED,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,EAAE,SAAS,yBAAyB,EAAE,CAAC;IAC/C,0EAA0E;IAC1E,MAAM,EAAE,OAAO,CAAC;IAChB,6EAA6E;IAC7E,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,oCAAoC;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAyBD,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,SAAS,yBAAyB,EAAE,GAC7C,iCAAiC,CA6BnC;AAcD,wBAAgB,sCAAsC,CACpD,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,SAAS,EAAE,iCAAiC,EAC5C,qBAAqB,UAAO,GAC3B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAyCzB;AAgDD,wBAAgB,2CAA2C,CACzD,eAAe,EAAE,MAAM,EACvB,SAAS,EAAE,iCAAiC,EAC5C,MAAM,EAAE,OAAO,EACf,qBAAqB,UAAO,GAC3B,MAAM,CA8ER;AAED,wBAAgB,oCAAoC,CAAC,MAAM,EAAE;IAC3D,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,SAAS,EAAE,iCAAiC,CAAC;IAC7C,MAAM,EAAE,OAAO,CAAC;IAChB,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,GAAG,oCAAoC,CAcvC;AAED,gFAAgF;AAChF,wBAAgB,yCAAyC,CACvD,OAAO,EAAE,8BAA8B,GACtC,6BAA6B,CAe/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-formatting.d.ts","sourceRoot":"","sources":["../../../src/channels/progress-formatting.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,2BAA2B,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"progress-formatting.d.ts","sourceRoot":"","sources":["../../../src/channels/progress-formatting.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAoD/C,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAIvE;AAED,wBAAgB,mBAAmB,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,SAAS,CAO5E;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,MAAM,SAAQ,GACb,MAAM,CAQR;AAmBD;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE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d.ts","sourceRoot":"","sources":["../../../../src/channels/slack/progress.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAGjE,eAAO,MAAM,8BAA8B,mBAAmB,CAAC;AAC/D,eAAO,MAAM,8BAA8B,kBAAkB,CAAC;AAI9D,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAChB,MAAM,CAOR;AAED,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../../src/channels/slack/progress.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAGjE,eAAO,MAAM,8BAA8B,mBAAmB,CAAC;AAC/D,eAAO,MAAM,8BAA8B,kBAAkB,CAAC;AAI9D,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAChB,MAAM,CAOR;AAED,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAYtE;AAED,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,wBAAwB,GAC9B,MAAM,GAAG,IAAI,CAgCf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-name-mapping.d.ts","sourceRoot":"","sources":["../../../../src/cli/helpers/tool-name-mapping.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"tool-name-mapping.d.ts","sourceRoot":"","sources":["../../../../src/cli/helpers/tool-name-mapping.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA+C1D;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAIhD;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U,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEhD"}
|
|
@@ -7,35 +7,24 @@
|
|
|
7
7
|
* - "cloud": durable Cloud schedules (`/v1/agents/:id/schedule`), fired by a
|
|
8
8
|
* cloud worker into a target listener or the agent's managed Cloud sandbox.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* the untargeted schedule (which already fires in the agent's Cloud sandbox).
|
|
14
|
-
* `--runner cloud` deliberately selects the managed Cloud sandbox;
|
|
15
|
-
* `--runner local` selects process-local storage. Local-backend agents
|
|
16
|
-
* (`agent-local-*`) always use the local runner, and servers that don't serve
|
|
17
|
-
* the Cloud schedule routes (self-hosted OSS core) fall back to it.
|
|
10
|
+
* Runner ownership follows the execution environment:
|
|
11
|
+
* - Letta-managed Cloud sandboxes use durable Cloud schedules.
|
|
12
|
+
* - User-managed computers and self-hosted runtimes use local schedules.
|
|
18
13
|
*
|
|
19
|
-
* Cloud
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
14
|
+
* Cloud's owning spawner assigns the listener a `sandbox:` identity. Listener
|
|
15
|
+
* bootstrap derives an inherited runtime marker before consuming that private
|
|
16
|
+
* relay identity. Device registration is not an execution-environment signal:
|
|
17
|
+
* Cloud API-backed laptops are still local computers, and a managed sandbox may
|
|
18
|
+
* have a transient or unregistered listener device id.
|
|
23
19
|
*/
|
|
24
|
-
import { type EnvironmentConnection } from "../backend/api/environments";
|
|
25
20
|
export type CronRunner = "local" | "cloud";
|
|
26
21
|
export declare const CLOUD_EXECUTION_TARGET = "cloud-sandbox";
|
|
22
|
+
export declare function isManagedCloudSandbox(env?: NodeJS.ProcessEnv): boolean;
|
|
27
23
|
export interface ResolveCronRunnerParams {
|
|
28
|
-
|
|
29
|
-
explicit?: string;
|
|
30
|
-
agentId: string;
|
|
24
|
+
managedCloudSandbox: boolean;
|
|
31
25
|
/** Active backend mode ("api" | "local"). */
|
|
32
26
|
backendMode: "api" | "local";
|
|
33
|
-
/**
|
|
34
|
-
* Whether the configured server serves the Cloud schedule routes, when
|
|
35
|
-
* known (from probing `GET /v1/agents/:id/schedule`). Omit for the
|
|
36
|
-
* pre-probe pass: cloud-eligible agents then resolve to "cloud" as a
|
|
37
|
-
* candidate, and the caller re-resolves once support is known.
|
|
38
|
-
*/
|
|
27
|
+
/** Whether the configured server serves the Cloud schedule routes. */
|
|
39
28
|
cloudSchedulesSupported?: boolean;
|
|
40
29
|
}
|
|
41
30
|
export type ResolveCronRunnerResult = {
|
|
@@ -45,8 +34,8 @@ export type ResolveCronRunnerResult = {
|
|
|
45
34
|
error: string;
|
|
46
35
|
};
|
|
47
36
|
export declare function resolveCronRunner(params: ResolveCronRunnerParams): ResolveCronRunnerResult;
|
|
48
|
-
/** Resolve
|
|
49
|
-
export declare function resolveCronRunnerForAgent(
|
|
37
|
+
/** Resolve schedule ownership from the current execution environment. */
|
|
38
|
+
export declare function resolveCronRunnerForAgent(agentId: string): Promise<ResolveCronRunnerResult>;
|
|
50
39
|
export type TargetDeviceValidity = {
|
|
51
40
|
ok: true;
|
|
52
41
|
} | {
|
|
@@ -69,61 +58,20 @@ export type TargetDeviceValidity = {
|
|
|
69
58
|
export declare function validateTargetDevice(deviceId: string, environment: {
|
|
70
59
|
organizationId?: string;
|
|
71
60
|
} | null): TargetDeviceValidity;
|
|
72
|
-
/**
|
|
73
|
-
* How a default (no --runner/--computer) schedule should execute:
|
|
74
|
-
* - "device": Cloud schedule targeting the current runtime's device so it
|
|
75
|
-
* keeps executing where it was created.
|
|
76
|
-
* - "cloud-sandbox": untargeted Cloud schedule; it fires in the agent's
|
|
77
|
-
* managed Cloud sandbox.
|
|
78
|
-
* - "local-fallback": the current runtime is not reachable by Cloud
|
|
79
|
-
* scheduling, so the schedule should be stored locally instead — that is
|
|
80
|
-
* the only way it can keep executing here.
|
|
81
|
-
*/
|
|
82
|
-
export type InferredTargetResolution = {
|
|
83
|
-
kind: "device";
|
|
84
|
-
} | {
|
|
85
|
-
kind: "cloud-sandbox";
|
|
86
|
-
} | {
|
|
87
|
-
kind: "local-fallback";
|
|
88
|
-
reason: string;
|
|
89
|
-
};
|
|
90
|
-
/**
|
|
91
|
-
* A default schedule preserves the current turn's execution locality: work
|
|
92
|
-
* scheduled from a runtime should keep running in that runtime, so a
|
|
93
|
-
* follow-up never races the active conversation from a second execution
|
|
94
|
-
* environment (the two don't share a turn queue).
|
|
95
|
-
*
|
|
96
|
-
* A managed-sandbox runtime (`sandbox-*` device id) resolves to
|
|
97
|
-
* "cloud-sandbox": an untargeted schedule already executes in the agent's
|
|
98
|
-
* managed sandbox, so the untargeted default IS locality-preserving there.
|
|
99
|
-
* The sandbox check must come first — sandbox rows are registered and
|
|
100
|
-
* online in the environments registry, but individual sandboxes get
|
|
101
|
-
* retired and recreated, so pinning one as a device target would be wrong.
|
|
102
|
-
*
|
|
103
|
-
* A runtime that is not a live registered external listener (desktop-local
|
|
104
|
-
* proxy connections, unregistered installations, offline rows) cannot be
|
|
105
|
-
* reached by the Cloud scheduler at all, so the locality-preserving answer
|
|
106
|
-
* is "local-fallback": store the schedule in this computer's local
|
|
107
|
-
* scheduler. The caller surfaces the durability tradeoff to the user.
|
|
108
|
-
*/
|
|
109
|
-
export declare function resolveInferredTargetDevice(deviceId: string, lookupEnvironment: () => Promise<EnvironmentConnection | null>): Promise<InferredTargetResolution>;
|
|
110
61
|
export type CronCreatePlacement = {
|
|
111
62
|
runner: CronRunner;
|
|
112
63
|
targetDeviceId?: string;
|
|
113
|
-
localFallbackNote?: string;
|
|
114
64
|
} | {
|
|
115
65
|
error: string;
|
|
116
66
|
};
|
|
117
67
|
/**
|
|
118
68
|
* Resolve where a newly-created schedule should live and execute.
|
|
119
69
|
*
|
|
120
|
-
* Both `letta cron` and Wake use this path.
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
* they fall back to the agent's Cloud sandbox when the device is offline.
|
|
70
|
+
* Both `letta cron` and Wake use this path. Managed Cloud sandboxes always
|
|
71
|
+
* create Cloud schedules; every other execution environment creates local
|
|
72
|
+
* schedules. `--computer` remains a Cloud-only target override.
|
|
124
73
|
*/
|
|
125
74
|
export declare function resolveCronCreatePlacement(params: {
|
|
126
|
-
explicitRunner?: string;
|
|
127
75
|
agentId: string;
|
|
128
76
|
targetDeviceId?: string;
|
|
129
77
|
}): Promise<CronCreatePlacement>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../../src/cron/runner.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../../src/cron/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAQH,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,OAAO,CAAC;AAE3C,eAAO,MAAM,sBAAsB,kBAAkB,CAAC;AAEtD,wBAAgB,qBAAqB,CACnC,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,OAAO,CAET;AAED,MAAM,WAAW,uBAAuB;IACtC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,6CAA6C;IAC7C,WAAW,EAAE,KAAK,GAAG,OAAO,CAAC;IAC7B,sEAAsE;IACtE,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,MAAM,MAAM,uBAAuB,GAC/B;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACtC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtB,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,uBAAuB,GAC9B,uBAAuB,CAsBzB;AAsBD,yEAAyE;AACzE,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,uBAAuB,CAAC,CAelC;AAcD,MAAM,MAAM,oBAAoB,GAAG;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,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AAM,CAAA;SAAE,CAAC;QAC/C,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC3B,CAAC;IACF,wCAAwC;IACxC,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,qHACoF,CAAC;AAErH,eAAO,MAAM,0BAA0B,kHAC0E,CAAC;AAElH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,wBAAwB,GAC/B,kBAAkB,CA+BpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../../../src/cron/scheduler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,KAAK,EAAuB,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAUhF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,QAAQ,EAWd,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,KAAK,gBAAgB,EAGtB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../../../src/cron/scheduler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,KAAK,EAAuB,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAUhF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,QAAQ,EAWd,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,KAAK,gBAAgB,EAGtB,MAAM,UAAU,CAAC;AAKlB,OAAO,EACL,KAAK,gBAAgB,EACrB,gBAAgB,EA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AoB,EAC1B,iBAAiB,EAAE,iBAAiB,EACpC,WAAW,SAAI,GACd,IAAI,CAsGN;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAmBpC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const MANAGED_CLOUD_RUNTIME_ENV = "LETTA_MANAGED_CLOUD_RUNTIME";
|
|
2
|
+
/**
|
|
3
|
+
* Preserve execution ownership after the listener consumes its non-inheritable
|
|
4
|
+
* relay identity. Cloud assigns the `sandbox:` namespace; Desktop and manual
|
|
5
|
+
* listeners use different identities.
|
|
6
|
+
*/
|
|
7
|
+
export declare function markManagedCloudRuntimeFromListenerIdentity(listenerInstanceId: string, env?: NodeJS.ProcessEnv): void;
|
|
8
|
+
export declare function isManagedCloudRuntime(env?: NodeJS.ProcessEnv): boolean;
|
|
9
|
+
//# sourceMappingURL=managed-cloud-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"managed-cloud-runtime.d.ts","sourceRoot":"","sources":["../../src/managed-cloud-runtime.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,gCAAgC,CAAC;AAIvE;;;;GAIG;AACH,wBAAgB,2CAA2C,CACzD,kBAAkB,EAAE,MAAM,EAC1B,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,IAAI,CAIN;AAED,wBAAgB,qBAAqB,CACnC,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,OAAO,CAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disabled-mod-adapter.d.ts","sourceRoot":"","sources":["../../../src/mods/disabled-mod-adapter.ts"],"names":[],"mappings":"AAKA,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AA2CrE,wBAAgB,wBAAwB;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"disabled-mod-adapter.d.ts","sourceRoot":"","sources":["../../../src/mods/disabled-mod-adapter.ts"],"names":[],"mappings":"AAKA,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AA2CrE,wBAAgB,wBAAwB;;;;;;;;;;;;;;yBAyCf,MAAM,IAAI;EAIlC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ModContext, ModEventEmissionResult, ModEventMap, ModEventName } from "./types";
|
|
2
2
|
export type ModEvents = {
|
|
3
|
+
/** Synchronous capability check used when execution cannot outlive a hook. */
|
|
4
|
+
hasHandlers?: (name: ModEventName) => boolean;
|
|
3
5
|
emit: <TName extends ModEventName>(name: TName, event: ModEventMap[TName], context: ModContext) => Promise<ModEventEmissionResult<TName>>;
|
|
4
6
|
};
|
|
5
7
|
export declare function emptyEventEmissionResult<TName extends ModEventName>(name: TName): ModEventEmissionResult<TName>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-emitter.d.ts","sourceRoot":"","sources":["../../../src/mods/event-emitter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,sBAAsB,EACtB,WAAW,EACX,YAAY,EACb,MAAM,cAAc,CAAC;AAKtB,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,CAAC,KAAK,SAAS,YAAY,EAC/B,IAAI,EAAE,KAAK,EACX,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,EACzB,OAAO,EAAE,UAAU,KAChB,OAAO,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC;CAC7C,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,KAAK,SAAS,YAAY,EACjE,IAAI,EAAE,KAAK,GACV,sBAAsB,CAAC,KAAK,CAAC,CAE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