@letta-ai/letta-agent-sdk 0.2.6 → 0.3.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 (86) hide show
  1. package/README.md +71 -333
  2. package/dist/app-server-management.d.ts +26 -0
  3. package/dist/app-server-management.d.ts.map +1 -0
  4. package/dist/app-server-session.d.ts +13 -15
  5. package/dist/app-server-session.d.ts.map +1 -1
  6. package/dist/client-base.d.ts +60 -0
  7. package/dist/client-base.d.ts.map +1 -0
  8. package/dist/client-entry.d.ts +19 -0
  9. package/dist/client-entry.d.ts.map +1 -0
  10. package/dist/client-entry.js +8806 -0
  11. package/dist/client-entry.js.map +25 -0
  12. package/dist/client.d.ts +8 -49
  13. package/dist/client.d.ts.map +1 -1
  14. package/dist/cloud-management.d.ts +23 -0
  15. package/dist/cloud-management.d.ts.map +1 -0
  16. package/dist/cloud-session.d.ts.map +1 -1
  17. package/dist/index.d.ts +3 -3
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +8828 -7020
  20. package/dist/index.js.map +21 -38
  21. package/dist/local-app-server-session.d.ts +4 -0
  22. package/dist/local-app-server-session.d.ts.map +1 -0
  23. package/dist/management-types.d.ts +100 -0
  24. package/dist/management-types.d.ts.map +1 -0
  25. package/dist/management.d.ts +17 -0
  26. package/dist/management.d.ts.map +1 -0
  27. package/dist/remote-client-session-core.d.ts +3 -7
  28. package/dist/remote-client-session-core.d.ts.map +1 -1
  29. package/dist/session.d.ts +3 -1
  30. package/dist/session.d.ts.map +1 -1
  31. package/dist/tests/advanced-session.d.ts +1 -9
  32. package/dist/tests/advanced-session.d.ts.map +1 -1
  33. package/dist/transport.d.ts.map +1 -1
  34. package/dist/types.d.ts +64 -12
  35. package/dist/types.d.ts.map +1 -1
  36. package/dist/websocket.d.ts +9 -0
  37. package/dist/websocket.d.ts.map +1 -0
  38. package/package.json +14 -3
  39. package/dist/dream/agent.d.ts +0 -55
  40. package/dist/dream/agent.d.ts.map +0 -1
  41. package/dist/dream/aggregate.d.ts +0 -38
  42. package/dist/dream/aggregate.d.ts.map +0 -1
  43. package/dist/dream/batching.d.ts +0 -12
  44. package/dist/dream/batching.d.ts.map +0 -1
  45. package/dist/dream/clone.d.ts +0 -14
  46. package/dist/dream/clone.d.ts.map +0 -1
  47. package/dist/dream/cursors.d.ts +0 -7
  48. package/dist/dream/cursors.d.ts.map +0 -1
  49. package/dist/dream/index.d.ts +0 -67
  50. package/dist/dream/index.d.ts.map +0 -1
  51. package/dist/dream/memfs.d.ts +0 -75
  52. package/dist/dream/memfs.d.ts.map +0 -1
  53. package/dist/dream/normalize-core.d.ts +0 -67
  54. package/dist/dream/normalize-core.d.ts.map +0 -1
  55. package/dist/dream/prompts.d.ts +0 -26
  56. package/dist/dream/prompts.d.ts.map +0 -1
  57. package/dist/dream/redact.d.ts +0 -3
  58. package/dist/dream/redact.d.ts.map +0 -1
  59. package/dist/dream/reflect.d.ts +0 -49
  60. package/dist/dream/reflect.d.ts.map +0 -1
  61. package/dist/dream/registry.d.ts +0 -4
  62. package/dist/dream/registry.d.ts.map +0 -1
  63. package/dist/dream/runner.d.ts +0 -30
  64. package/dist/dream/runner.d.ts.map +0 -1
  65. package/dist/dream/sdk-messages.d.ts +0 -4
  66. package/dist/dream/sdk-messages.d.ts.map +0 -1
  67. package/dist/dream/select.d.ts +0 -6
  68. package/dist/dream/select.d.ts.map +0 -1
  69. package/dist/dream/sources/claude-code.d.ts +0 -18
  70. package/dist/dream/sources/claude-code.d.ts.map +0 -1
  71. package/dist/dream/sources/codex.d.ts +0 -20
  72. package/dist/dream/sources/codex.d.ts.map +0 -1
  73. package/dist/dream/sources/letta.d.ts +0 -3
  74. package/dist/dream/sources/letta.d.ts.map +0 -1
  75. package/dist/dream/sources/openhands.d.ts +0 -43
  76. package/dist/dream/sources/openhands.d.ts.map +0 -1
  77. package/dist/dream/sources/transcript-file.d.ts +0 -8
  78. package/dist/dream/sources/transcript-file.d.ts.map +0 -1
  79. package/dist/dream/store-utils.d.ts +0 -21
  80. package/dist/dream/store-utils.d.ts.map +0 -1
  81. package/dist/dream/transcripts.d.ts +0 -27
  82. package/dist/dream/transcripts.d.ts.map +0 -1
  83. package/dist/dream/types.d.ts +0 -48
  84. package/dist/dream/types.d.ts.map +0 -1
  85. package/dist/dream/workers.d.ts +0 -12
  86. package/dist/dream/workers.d.ts.map +0 -1
@@ -1,38 +0,0 @@
1
- import type { LettaAgentClient } from "../client.js";
2
- import { type MemfsWritePolicy } from "./memfs.js";
3
- import type { BatchReflectionResult } from "./reflect.js";
4
- export interface DreamAggregationOutcome {
5
- success: boolean;
6
- /** The aggregator's final report (or the skip reason). */
7
- report: string;
8
- error?: string;
9
- conversationId?: string;
10
- /** Commits the aggregator landed on the target, relative to the base. */
11
- commitCount: number;
12
- }
13
- export declare function runDreamAggregation(params: {
14
- client: LettaAgentClient;
15
- aggregatorAgentId: string;
16
- /** The target memory filesystem the synthesis lands on. */
17
- memoryDir: string;
18
- runRoot: string;
19
- reflections: BatchReflectionResult[];
20
- /** Write policy enforced on the canonical MemFS and checked afterward. */
21
- memfsPolicy: MemfsWritePolicy;
22
- /**
23
- * Persona text prepended to the prompt when the aggregating agent doesn't
24
- * carry a dedicated aggregator persona block (a dream agent synthesizing
25
- * its own memory).
26
- */
27
- personaPreamble?: string;
28
- /**
29
- * Additional caller instruction. The aggregator is the only stage that
30
- * edits the target memory, so instructions about maintaining specific
31
- * files (e.g. a projected AGENTS.md) must reach it here.
32
- */
33
- instruction?: string;
34
- /** Abort: close the aggregator session and stop nudging. */
35
- signal?: AbortSignal;
36
- log?: (line: string) => void;
37
- }): Promise<DreamAggregationOutcome>;
38
- //# sourceMappingURL=aggregate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"aggregate.d.ts","sourceRoot":"","sources":["../../src/dream/aggregate.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,YAAY,CAAC;AAKpB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAI1D,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yEAAyE;IACzE,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAsB,mBAAmB,CAAC,MAAM,EAAE;IAChD,MAAM,EAAE,gBAAgB,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,qBAAqB,EAAE,CAAC;IACrC,0EAA0E;IAC1E,WAAW,EAAE,gBAAgB,CAAC;IAC9B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B,GAAG,OAAO,CAAC,uBAAuB,CAAC,CA+PnC"}
@@ -1,12 +0,0 @@
1
- import type { DiscoveredSession } from "./types.js";
2
- export declare const DEFAULT_BATCH_TOKEN_BUDGET = 60000;
3
- export declare const DEFAULT_MAX_SESSIONS_PER_BATCH = 10;
4
- export interface DreamBatch {
5
- index: number;
6
- sessions: DiscoveredSession[];
7
- estTokens: number;
8
- startTime: string;
9
- endTime: string;
10
- }
11
- export declare function packDreamBatches(sessions: DiscoveredSession[], tokenBudget: number, maxSessions: number): DreamBatch[];
12
- //# sourceMappingURL=batching.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"batching.d.ts","sourceRoot":"","sources":["../../src/dream/batching.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,eAAO,MAAM,0BAA0B,QAAS,CAAC;AACjD,eAAO,MAAM,8BAA8B,KAAK,CAAC;AAEjD,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,iBAAiB,EAAE,EAC7B,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,UAAU,EAAE,CAmCd"}
@@ -1,14 +0,0 @@
1
- export declare function gitOutput(cwd: string, args: string[]): Promise<string>;
2
- /**
3
- * Clone the memory filesystem into outputDir and return the base revision the
4
- * clone starts from (the revision batch diffs are taken against).
5
- */
6
- export declare function cloneMemoryTree(memoryDir: string, outputDir: string): Promise<string>;
7
- /** Commits past the base revision, and whether the tree has uncommitted edits. */
8
- export declare function inspectMemoryTree(memoryDir: string, baseRevision: string): Promise<{
9
- commitCount: number;
10
- dirty: boolean;
11
- }>;
12
- /** Record an immutable checkout of the final memory tree with a run. */
13
- export declare function snapshotMemoryTree(memoryDir: string, outputDir: string): Promise<void>;
14
- //# sourceMappingURL=clone.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"clone.d.ts","sourceRoot":"","sources":["../../src/dream/clone.ts"],"names":[],"mappings":"AAaA,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAG5E;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,CAOjB;AAED,kFAAkF;AAClF,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC,CAelD;AAED,wEAAwE;AACxE,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAMf"}
@@ -1,7 +0,0 @@
1
- /** sessionKey ("openhands:<conversation-id>") → last reflected timestamp. */
2
- export type DreamCursors = Record<string, {
3
- reflectedThrough: string;
4
- }>;
5
- export declare function loadDreamCursors(stateDir: string): Promise<DreamCursors>;
6
- export declare function saveDreamCursors(stateDir: string, cursors: DreamCursors): Promise<void>;
7
- //# sourceMappingURL=cursors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cursors.d.ts","sourceRoot":"","sources":["../../src/dream/cursors.ts"],"names":[],"mappings":"AAiBA,6EAA6E;AAC7E,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,gBAAgB,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAExE,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,YAAY,CAAC,CAUvB;AAED,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC,IAAI,CAAC,CAIf"}
@@ -1,67 +0,0 @@
1
- import type { LettaAgentClient } from "../client.js";
2
- import { type DreamBatch } from "./batching.js";
3
- import { type DreamAggregationOutcome } from "./aggregate.js";
4
- import { type BatchReflectionResult } from "./reflect.js";
5
- import type { DiscoveredSession, NormalizedSession } from "./types.js";
6
- export type { DreamBatch } from "./batching.js";
7
- export type { DreamAggregationOutcome } from "./aggregate.js";
8
- export type { BatchReflectionResult } from "./reflect.js";
9
- export { packDreamBatches } from "./batching.js";
10
- export { AGGREGATOR_PERSONA, REFLECTION_SYSTEM_PROMPT, } from "./prompts.js";
11
- export { getTrajectorySource, listTrajectorySourceTypes } from "./registry.js";
12
- export { type DreamAgentConfig, type DreamAgentGuardOptions, type InitDreamAgentOptions, type LoadedDreamAgent, initDreamAgent, loadDreamAgent, } from "./agent.js";
13
- export { type MemfsOperation, type MemfsOperationRule, type MemfsStructure, type MemfsWritePolicy, } from "./memfs.js";
14
- export { collectTranscripts, type CollectTranscriptsOptions, type Transcript, type TranscriptSourceSpec, } from "./transcripts.js";
15
- export type { DiscoveredSession, NormalizedRecord, NormalizedSession, TrajectorySource, } from "./types.js";
16
- export interface DreamOptions {
17
- client: LettaAgentClient;
18
- /** Initialized dream-agent id returned by initDreamAgent(). */
19
- agentId: string;
20
- /** Immutable normalized transcript snapshots to reflect on. */
21
- transcripts: readonly NormalizedSession[];
22
- /**
23
- * Additional caller instruction for the run, provided to every reflection
24
- * batch AND to the aggregation pass. The aggregator is the stage that
25
- * lands the final commit on the memory filesystem, so instructions about
26
- * maintaining specific files (e.g. a projected AGENTS.md) reach it too —
27
- * an instruction that steered only the batches would be unreliable.
28
- */
29
- instruction?: string;
30
- /** Override the harness agents directory (tests). */
31
- agentsDir?: string;
32
- /** Per-batch token budget (default 60k, measured on normalized content). */
33
- batchTokenBudget?: number;
34
- /** Maximum transcripts in one batch (default 10). */
35
- maxTranscriptsPerBatch?: number;
36
- /** Concurrent reflection sessions; default: every batch at once. */
37
- concurrency?: number;
38
- /** Preview cursor filtering and batch packing without running agents. */
39
- planOnly?: boolean;
40
- /**
41
- * Abort the run: in-flight reflector/aggregator sessions are closed, no
42
- * new batches start, the run's artifacts (clones, runRoot) are removed,
43
- * cursors are NOT advanced, and dream() rejects with the abort reason.
44
- * Shutting down a spawned app-server remains the caller's job via
45
- * client.close().
46
- */
47
- signal?: AbortSignal;
48
- log?: (line: string) => void;
49
- }
50
- export type DreamResult = {
51
- kind: "nothing_to_dream";
52
- } | {
53
- kind: "plan";
54
- transcripts: DiscoveredSession[];
55
- batches: DreamBatch[];
56
- } | {
57
- kind: "completed";
58
- runRoot: string;
59
- success: boolean;
60
- transcripts: DiscoveredSession[];
61
- batches: BatchReflectionResult[];
62
- aggregation: DreamAggregationOutcome;
63
- reflectorAgentId: string;
64
- aggregatorAgentId: string;
65
- };
66
- export declare function dream(options: DreamOptions): Promise<DreamResult>;
67
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dream/index.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAGL,KAAK,UAAU,EAEhB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,qBAAqB,EAE3B,MAAM,cAAc,CAAC;AAUtB,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAOpB,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,YAAY,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC9D,YAAY,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EACL,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,cAAc,EACd,cAAc,GACf,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,gBAAgB,GACtB,MAAM,YAAY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,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAuCN,wBAAsB,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAyKvE"}
@@ -1,75 +0,0 @@
1
- export interface MemfsStructure {
2
- /** UTF-8 file contents keyed by path relative to the MemFS root. */
3
- files?: Readonly<Record<string, string>>;
4
- /** Directories to materialize even when they contain no tracked files. */
5
- directories?: readonly string[];
6
- }
7
- export interface ValidatedMemfsStructure {
8
- files: readonly {
9
- path: string;
10
- content: string;
11
- }[];
12
- directories: readonly string[];
13
- }
14
- export type MemfsOperation = "create" | "modify" | "delete";
15
- export interface MemfsOperationRule {
16
- /** Exact relative path, or directory path when recursive is true. */
17
- path: string;
18
- recursive?: boolean;
19
- operations: readonly MemfsOperation[];
20
- }
21
- /**
22
- * Default policy semantics:
23
- * - paths in existingPaths may be modified (but not created or deleted);
24
- * - paths below allowedNewFilePrefixes may be created, modified, or deleted;
25
- * - everything else is denied.
26
- *
27
- * A matching allowedOperations rule overrides those defaults. This permits,
28
- * for example, an existing AGENTS.md to be modifiable but not deletable.
29
- */
30
- export interface MemfsWritePolicy {
31
- existingPaths: readonly string[];
32
- allowedNewFilePrefixes?: readonly string[];
33
- allowedOperations?: readonly MemfsOperationRule[];
34
- /** Empty directories that must be recreated after a Git clone. */
35
- declaredDirectories?: readonly string[];
36
- }
37
- export interface MemfsGuardInstallation {
38
- hooksDir: string;
39
- preCommitPath: string;
40
- postCommitPath: string;
41
- /** Directories present when the guard was installed, excluding .git. */
42
- baselineDirectories: readonly string[];
43
- }
44
- export interface MemfsPolicyViolation {
45
- path: string;
46
- operation?: MemfsOperation;
47
- source: "commit" | "working-tree" | "untracked" | "directory";
48
- commit?: string;
49
- reason: string;
50
- }
51
- export interface MemfsValidationResult {
52
- valid: boolean;
53
- violations: readonly MemfsPolicyViolation[];
54
- }
55
- export declare function validateMemfsStructure(structure: MemfsStructure): ValidatedMemfsStructure;
56
- export declare function createMemfsWritePolicy(structure: MemfsStructure | ValidatedMemfsStructure, options?: {
57
- allowedNewFilePrefixes?: readonly string[];
58
- allowedOperations?: readonly MemfsOperationRule[];
59
- }): MemfsWritePolicy;
60
- export declare function validateMemfsWritePolicy(policy: MemfsWritePolicy): MemfsWritePolicy;
61
- export declare function recreateMemfsDirectories(memoryDir: string, directories: readonly string[]): Promise<readonly string[]>;
62
- export declare function materializeMemfsStructure(memoryDir: string, structure: MemfsStructure): Promise<ValidatedMemfsStructure>;
63
- export declare function installMemfsGuard(memoryDir: string, policy: MemfsWritePolicy): Promise<MemfsGuardInstallation>;
64
- /** Configure a freshly cloned MemFS repo, whose hooks and local config Git did not copy. */
65
- export declare function configureMemfsCloneGuard(sourceMemoryDir: string, cloneMemoryDir: string, policy: MemfsWritePolicy): Promise<MemfsGuardInstallation>;
66
- /**
67
- * Defense-in-depth validation after an agent run. Every commit is inspected,
68
- * so an illegal add followed by a delete cannot disappear in an endpoint diff.
69
- */
70
- export declare function validateMemfsChanges(memoryDir: string, baseRevision: string, policy: MemfsWritePolicy, options?: {
71
- baselineDirectories?: readonly string[];
72
- }): Promise<MemfsValidationResult>;
73
- /** Read a materialized file in tests/callers without exposing path traversal. */
74
- export declare function readMemfsFile(memoryDir: string, path: string): Promise<string>;
75
- //# sourceMappingURL=memfs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"memfs.d.ts","sourceRoot":"","sources":["../../src/dream/memfs.ts"],"names":[],"mappings":"AAkBA,MAAM,WAAW,cAAc;IAC7B,oEAAoE;IACpE,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACzC,0EAA0E;IAC1E,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACjC;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAA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EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,iBAAiB,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;CAC9C,GACL,gBAAgB,CAUlB;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,gBAAgB,GACvB,gBAAgB,CAQlB;AAgED,wBAAsB,wBAAwB,CAC5C,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,SAAS,MAAM,EAAE,GAC7B,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAc5B;AAED,wBAAsB,yBAAyB,CAC7C,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,cAAc,GACxB,OAAO,CAAC,uBAAuB,CAAC,CAelC;AA0MD,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,sBAAsB,CAAC,CAiCjC;AAgBD,4FAA4F;AAC5F,wBAAsB,wBAAwB,CAC5C,eAAe,EAAE,MAAM,EACvB,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,sBAAsB,CAAC,CAMjC;AAwHD;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE;IAAE,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAAO,GACxD,OAAO,CAAC,qBAAqB,CAAC,CA+EhC;AAED,iFAAiF;AACjF,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAGpF"}
@@ -1,67 +0,0 @@
1
- import type { NormalizedRecord } from "./types.js";
2
- export declare const TOOL_INPUT_MAX_CHARS = 20000;
3
- export declare const TOOL_RESULT_MAX_CHARS = 2500;
4
- export declare const CODEX_INJECTED_PREFIXES: string[];
5
- export declare function truncateText(text: string, limit: number): string;
6
- /**
7
- * Timestamp from the raw formats: ISO string or epoch millis. Suffix-less
8
- * (naive) timestamps are treated as UTC so ordering is stable.
9
- */
10
- export declare function parseTimestamp(value: unknown): Date | null;
11
- /**
12
- * ISO timestamps for n records: real where present, interpolated in gaps,
13
- * synthesized monotonically when the source recorded none.
14
- */
15
- export declare function fillTimestamps(n: number, anchors: Map<number, Date>, createdAt: Date | null, durationSeconds: number | null): string[];
16
- /**
17
- * Return the args string (and whether it was reshaped). Byte-verbatim when
18
- * under the cap and already a JSON object; otherwise reshaped to a valid JSON
19
- * object, trimming the longest string values until the serialization fits.
20
- */
21
- export declare function shrinkArgs(rawInput: string): {
22
- args: string;
23
- shrunk: boolean;
24
- };
25
- /**
26
- * Flatten a content field (string | block list) into text; image blocks
27
- * render as a placeholder.
28
- */
29
- export declare function blocksText(content: unknown): string;
30
- /** One raw content block, as emitted by a per-harness parser. */
31
- export interface PseudoRow {
32
- role: "user" | "assistant" | "tool_use" | "tool_result";
33
- turnType: "user_prompt" | "system_injected" | "assistant_thinking" | "assistant_response" | "tool_use" | "tool_result";
34
- content?: string;
35
- timestamp?: Date | null;
36
- toolName?: string;
37
- toolCallId?: string;
38
- toolInputJson?: string;
39
- model?: string;
40
- }
41
- /** Session-level context mined from the raw store during parsing. */
42
- export interface SessionContext {
43
- source: string;
44
- cwd?: string;
45
- gitBranch?: string;
46
- model?: string;
47
- createdAt?: Date | null;
48
- durationSeconds?: number | null;
49
- }
50
- export type NormalizeRowsResult = {
51
- status: "ok";
52
- records: NormalizedRecord[];
53
- } | {
54
- status: string;
55
- records?: undefined;
56
- };
57
- /**
58
- * Normalize ordered pseudo-rows into v1 records. Returns `{status: "ok",
59
- * records}` or a `skipped:…` / `invalid:…` status with no output records.
60
- */
61
- export declare function normalizeSessionRows(rows: PseudoRow[], context: SessionContext): NormalizeRowsResult;
62
- /**
63
- * Minimal structural validation of the normalized-v1 contract. Returns an
64
- * error string, or null when valid.
65
- */
66
- export declare function validateRecords(records: NormalizedRecord[]): string | null;
67
- //# sourceMappingURL=normalize-core.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"normalize-core.d.ts","sourceRoot":"","sources":["../../src/dream/normalize-core.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAInD,eAAO,MAAM,oBAAoB,QAAS,CAAC;AAC3C,eAAO,MAAM,qBAAqB,OAAQ,CAAC;AAgB3C,eAAO,MAAM,uBAAuB,UAKnC,CAAC;AAYF,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAGhE;AAMD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CAW1D;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,CAAC,EAAE,MAAM,EACT,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,EAC1B,SAAS,EAAE,IAAI,GAAG,IAAI,EACtB,eAAe,EAAE,MAAM,GAAG,IAAI,GAC7B,MAAM,EAAE,CAmCV;AAID;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;CACjB,CAuDA;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAmBnD;AAED,iEAAiE;AACjE,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,aAAa,CAAC;IACxD,QAAQ,EACJ,aAAa,GACb,iBAAiB,GACjB,oBAAoB,GACpB,oBAAoB,GACpB,UAAU,GACV,aAAa,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qEAAqE;AACrE,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,MAAM,MAAM,mBAAmB,GAC3B;IAAE,MAAM,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,gBAAgB,EAAE,CAAA;CAAE,GAC7C;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC;AAE5C;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,SAAS,EAAE,EACjB,OAAO,EAAE,cAAc,GACtB,mBAAmB,CA2GrB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,EAAE,GAAG,MAAM,GAAG,IAAI,CAwD1E"}
@@ -1,26 +0,0 @@
1
- export declare const MEMORY_ROUTING_CONTRACT: string;
2
- export declare const REFLECTION_SYSTEM_PROMPT: string;
3
- export declare const AGGREGATOR_PERSONA: string;
4
- export declare const AGGREGATOR_CONTINUE_PROMPT: string;
5
- export declare function buildReflectionUserPrompt(input: {
6
- batchIndex: number;
7
- inputDir: string;
8
- sessionFileNames: string[];
9
- memoryDir: string;
10
- timeRange: {
11
- start: string;
12
- end: string;
13
- };
14
- instruction?: string;
15
- }): string;
16
- export declare function buildReflectionContinuePrompt(input: {
17
- memoryDir: string;
18
- }): string;
19
- export declare function buildAggregatorUserPrompt(input: {
20
- batchesDir: string;
21
- batchCount: number;
22
- memoryDir: string;
23
- /** Additional caller instruction for the aggregation pass. */
24
- instruction?: string;
25
- }): string;
26
- //# sourceMappingURL=prompts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/dream/prompts.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,uBAAuB,EAAE,MAAuC,CAAC;AAC9E,eAAO,MAAM,wBAAwB,EAAE,MAErC,CAAC;AACH,eAAO,MAAM,kBAAkB,EAAE,MAE/B,CAAC;AACH,eAAO,MAAM,0BAA0B,EAAE,MAAoC,CAAC;AAuB9E,wBAAgB,yBAAyB,CAAC,KAAK,EAAE;IAC/C,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,MAAM,CAWT;AAED,wBAAgB,6BAA6B,CAAC,KAAK,EAAE;IACnD,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,MAAM,CAET;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE;IAC/C,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,MAAM,CAOT"}
@@ -1,3 +0,0 @@
1
- /** Remove credential-shaped values before transcripts become run artifacts. */
2
- export declare function redactSensitiveText(text: string): string;
3
- //# sourceMappingURL=redact.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../../src/dream/redact.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOxD"}
@@ -1,49 +0,0 @@
1
- import type { LettaAgentClient } from "../client.js";
2
- import type { DreamBatch } from "./batching.js";
3
- import { type MemfsWritePolicy } from "./memfs.js";
4
- export interface BatchReflectionResult {
5
- batchIndex: number;
6
- /** The reflector agent this batch ran on. */
7
- agentId: string;
8
- /** Conversation on the reflector agent this batch ran as. */
9
- conversationId?: string;
10
- sessionIds: string[];
11
- timeRange: {
12
- start: string;
13
- end: string;
14
- };
15
- outputDir: string;
16
- reportPath: string;
17
- /** Target memfs revision the batch's clone (and diff.patch) is based on. */
18
- baseRevision: string;
19
- success: boolean;
20
- error?: string;
21
- /** Commits the agent made past the base revision. */
22
- commitCount: number;
23
- /** Uncommitted edits left behind (agent broke protocol; contents on disk). */
24
- dirty: boolean;
25
- durationMs: number;
26
- }
27
- export interface RunBatchReflectionsParams {
28
- client: LettaAgentClient;
29
- reflectorAgentId: string;
30
- /** Dream agent whose memfs is being reflected on. */
31
- parentAgentId: string;
32
- /** The target memory filesystem batches clone. */
33
- memoryDir: string;
34
- runRoot: string;
35
- batches: DreamBatch[];
36
- /** sessionKey(session) → normalized-v1 JSON (already serialized). */
37
- normalizedJsonByKey: Map<string, string>;
38
- /** Write policy installed on every isolated clone and checked afterward. */
39
- memfsPolicy: MemfsWritePolicy;
40
- concurrency: number;
41
- /** Additional caller instruction, also provided to the aggregation pass. */
42
- instruction?: string;
43
- /** Abort: stop dispatching new batches and close in-flight sessions. */
44
- signal?: AbortSignal;
45
- log?: (line: string) => void;
46
- }
47
- /** Run all batches with bounded concurrency; results ordered by batch index. */
48
- export declare function runBatchReflections(params: RunBatchReflectionsParams): Promise<BatchReflectionResult[]>;
49
- //# sourceMappingURL=reflect.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reflect.d.ts","sourceRoot":"","sources":["../../src/dream/reflect.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CA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,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B;AA8ND,gFAAgF;AAChF,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAoBlC"}
@@ -1,4 +0,0 @@
1
- import type { TrajectorySource } from "./types.js";
2
- export declare function getTrajectorySource(type: string): TrajectorySource;
3
- export declare function listTrajectorySourceTypes(): string[];
4
- //# sourceMappingURL=registry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/dream/registry.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAUnD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAUlE;AAED,wBAAgB,yBAAyB,IAAI,MAAM,EAAE,CAEpD"}
@@ -1,30 +0,0 @@
1
- import type { LettaAgentClient } from "../client.js";
2
- import type { SDKMessage, SkillSource } from "../types.js";
3
- export interface RunAgentOptions {
4
- agentId: string;
5
- userPrompt: string;
6
- cwd: string;
7
- /** Progress label for logging. */
8
- label: string;
9
- /** Continue this existing conversation instead of starting a new one. */
10
- resumeConversationId?: string;
11
- /** Extra env for the session's harness process (see session options). */
12
- env?: Record<string, string>;
13
- /** Restrict Letta Code skills for this runtime. [] disables every source. */
14
- skillSources?: SkillSource[];
15
- /** Abort: closes the session and returns a failed result promptly. */
16
- signal?: AbortSignal;
17
- onProgress?: (line: string) => void;
18
- }
19
- export interface RunAgentResult {
20
- agentId: string;
21
- conversationId: string | null;
22
- success: boolean;
23
- error?: string;
24
- /** Final assistant report (result.result when present, else last assistant message). */
25
- report: string;
26
- durationMs: number;
27
- messages: SDKMessage[];
28
- }
29
- export declare function runAgentToCompletion(client: LettaAgentClient, options: RunAgentOptions): Promise<RunAgentResult>;
30
- //# sourceMappingURL=runner.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/dream/runner.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE3D,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,yEAAyE;IACzE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,6EAA6E;IAC7E,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,sEAAsE;IACtE,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wFAAwF;IACxF,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,UAAU,EAAE,CAAC;CACxB;AAED,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,cAAc,CAAC,CAgFzB"}
@@ -1,4 +0,0 @@
1
- import type { SDKMessage } from "../types.js";
2
- import type { NormalizedRecord } from "./types.js";
3
- export declare function normalizeSdkMessages(userPrompt: string, messages: SDKMessage[]): NormalizedRecord[] | null;
4
- //# sourceMappingURL=sdk-messages.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sdk-messages.d.ts","sourceRoot":"","sources":["../../src/dream/sdk-messages.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAyEnD,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,UAAU,EAAE,GACrB,gBAAgB,EAAE,GAAG,IAAI,CAgE3B"}
@@ -1,6 +0,0 @@
1
- import type { DiscoveredSession } from "./types.js";
2
- /** A stable identity for a discovered session across sources. */
3
- export declare function sessionKey(session: DiscoveredSession): string;
4
- /** Filesystem-safe file name for one normalized session. */
5
- export declare function sessionFileName(session: DiscoveredSession): string;
6
- //# sourceMappingURL=select.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/dream/select.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,iEAAiE;AACjE,wBAAgB,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAE7D;AAED,4DAA4D;AAC5D,wBAAgB,eAAe,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAGlE"}
@@ -1,18 +0,0 @@
1
- import type { PseudoRow } from "../normalize-core.js";
2
- import type { TrajectorySource } from "../types.js";
3
- interface CcParseOutput {
4
- rows: PseudoRow[];
5
- extras: {
6
- cwd?: string;
7
- gitBranch?: string;
8
- };
9
- }
10
- /** Claude Code session JSONL → pseudo-rows plus mined session context. */
11
- export declare function parseClaudeCodeJsonl(text: string): CcParseOutput;
12
- /**
13
- * Trajectory source for local Claude Code sessions. `storeDir` overrides the
14
- * default store (~/.claude/projects), mainly for tests.
15
- */
16
- export declare function createClaudeCodeSource(storeDir?: string): TrajectorySource;
17
- export {};
18
- //# sourceMappingURL=claude-code.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../../src/dream/sources/claude-code.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,SAAS,EAEV,MAAM,sBAAsB,CAAC;AAY9B,OAAO,KAAK,EAIV,gBAAgB,EACjB,MAAM,aAAa,CAAC;AAkBrB,UAAU,aAAa;IACrB,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,MAAM,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9C;AAED,0EAA0E;AAC1E,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CA0HhE;AAsCD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAmD1E"}
@@ -1,20 +0,0 @@
1
- import type { PseudoRow } from "../normalize-core.js";
2
- import type { TrajectorySource } from "../types.js";
3
- interface CodexParseOutput {
4
- rows: PseudoRow[];
5
- extras: {
6
- cwd?: string;
7
- gitBranch?: string;
8
- model?: string;
9
- createdAt?: Date;
10
- };
11
- }
12
- /** Codex rollout JSONL → pseudo-rows plus mined session context. */
13
- export declare function parseCodexRollout(text: string): CodexParseOutput;
14
- /**
15
- * Trajectory source for local Codex CLI sessions. `storeDir` overrides the
16
- * default store (~/.codex/sessions), mainly for tests.
17
- */
18
- export declare function createCodexSource(storeDir?: string): TrajectorySource;
19
- export {};
20
- //# sourceMappingURL=codex.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../../src/dream/sources/codex.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,SAAS,EAEV,MAAM,sBAAsB,CAAC;AAa9B,OAAO,KAAK,EAIV,gBAAgB,EACjB,MAAM,aAAa,CAAC;AAErB,UAAU,gBAAgB;IACxB,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,MAAM,EAAE;QACN,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,IAAI,CAAC;KAClB,CAAC;CACH;AAED,oEAAoE;AACpE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAgJhE;AA2CD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAkDrE"}
@@ -1,3 +0,0 @@
1
- import type { TrajectorySource } from "../types.js";
2
- export declare function createLettaSource(transcriptRoot?: string): TrajectorySource;
3
- //# sourceMappingURL=letta.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"letta.d.ts","sourceRoot":"","sources":["../../../src/dream/sources/letta.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAGV,gBAAgB,EACjB,MAAM,aAAa,CAAC;AAkHrB,wBAAgB,iBAAiB,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAoE3E"}
@@ -1,43 +0,0 @@
1
- import type { PseudoRow } from "../normalize-core.js";
2
- import type { TrajectorySource } from "../types.js";
3
- interface OpenHandsTextContent {
4
- type?: string;
5
- text?: string;
6
- }
7
- interface OpenHandsEvent {
8
- kind?: string;
9
- id?: string;
10
- timestamp?: string;
11
- source?: string;
12
- llm_message?: {
13
- role?: string;
14
- content?: OpenHandsTextContent[];
15
- };
16
- thought?: OpenHandsTextContent[];
17
- action?: Record<string, unknown> | null;
18
- tool_name?: string;
19
- tool_call_id?: string;
20
- tool_call?: {
21
- arguments?: string;
22
- } | null;
23
- action_id?: string;
24
- observation?: {
25
- content?: OpenHandsTextContent[];
26
- is_error?: boolean;
27
- } | null;
28
- error?: string;
29
- rejection_reason?: string;
30
- }
31
- /**
32
- * Convert OpenHands conversation events into pseudo-rows. Non-conversational
33
- * events (system prompts, state updates, condensation, streaming deltas) are
34
- * skipped.
35
- */
36
- export declare function openHandsEventsToRows(events: OpenHandsEvent[]): PseudoRow[];
37
- /**
38
- * Trajectory source for OpenHands conversation exports. There is no default
39
- * local store, so `discover` requires a locator.
40
- */
41
- export declare function createOpenHandsSource(): TrajectorySource;
42
- export {};
43
- //# sourceMappingURL=openhands.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"openhands.d.ts","sourceRoot":"","sources":["../../../src/dream/sources/openhands.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EACV,SAAS,EAEV,MAAM,sBAAsB,CAAC;AAS9B,OAAO,KAAK,EAIV,gBAAgB,EACjB,MAAM,aAAa,CAAC;AAErB,UAAU,oBAAoB;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,UAAU,cAAc;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE;QACZ,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,oBAAoB,EAAE,CAAC;KAClC,CAAC;IAEF,OAAO,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAE1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE;QACZ,OAAO,CAAC,EAAE,oBAAoB,EAAE,CAAC;QACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,GAAG,IAAI,CAAC;IACT,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAyCD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,SAAS,EAAE,CAwE3E;AAsID;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,gBAAgB,CAyDxD"}
@@ -1,8 +0,0 @@
1
- import type { TrajectorySource } from "../types.js";
2
- /**
3
- * Trajectory source for normalized-v1 transcript files: a single `.json`
4
- * file, or a directory tree of them. There is no default store, so `discover`
5
- * requires a locator.
6
- */
7
- export declare function createTranscriptFileSource(): TrajectorySource;
8
- //# sourceMappingURL=transcript-file.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transcript-file.d.ts","sourceRoot":"","sources":["../../../src/dream/sources/transcript-file.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAIV,gBAAgB,EACjB,MAAM,aAAa,CAAC;AAuDrB;;;;GAIG;AACH,wBAAgB,0BAA0B,IAAI,gBAAgB,CAoC7D"}
@@ -1,21 +0,0 @@
1
- import type { Stats } from "node:fs";
2
- import type { NormalizeRowsResult } from "./normalize-core.js";
3
- import type { DiscoveredSession } from "./types.js";
4
- export declare function statOrNull(path: string): Stats | null;
5
- /** Recursively list files under `dir` whose basename matches `match`. */
6
- export declare function listFilesRecursive(dir: string, match: (name: string) => boolean): string[];
7
- /**
8
- * Build a DiscoveredSession from a normalize result, or null when the session
9
- * was skipped or invalid. Time bounds come from the conversation records
10
- * (meta excluded); estTokens is ~chars/4 of the serialized transcript.
11
- */
12
- export declare function buildDiscoveredSession(harness: string, sessionId: string, path: string, mtimeMs: number, result: NormalizeRowsResult): DiscoveredSession | null;
13
- /**
14
- * Resolve a session-id locator against ids of store sessions: exact match
15
- * first, then unique-prefix semantics (all sessions whose id starts with the
16
- * locator).
17
- */
18
- export declare function matchSessionIds<T extends {
19
- sessionId: string;
20
- }>(locator: string, candidates: T[]): T[];
21
- //# sourceMappingURL=store-utils.d.ts.map