managed-deepagents 0.5.0-dev.90 → 0.5.0-dev.96

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 (150) hide show
  1. package/README.md +36 -37
  2. package/dist/channels/manifest.d.ts +1 -1
  3. package/dist/channels/manifest.d.ts.map +1 -1
  4. package/dist/channels/slack/adapter.d.ts.map +1 -1
  5. package/dist/channels/slack/adapter.js +0 -1
  6. package/dist/channels/slack/adapter.js.map +1 -1
  7. package/dist/channels/slack/http.d.ts +3 -1
  8. package/dist/channels/slack/http.d.ts.map +1 -1
  9. package/dist/channels/slack/http.js +40 -5
  10. package/dist/channels/slack/http.js.map +1 -1
  11. package/dist/channels/slack/index.d.ts +23 -8
  12. package/dist/channels/slack/index.d.ts.map +1 -1
  13. package/dist/channels/slack/index.js +32 -29
  14. package/dist/channels/slack/index.js.map +1 -1
  15. package/dist/channels/slack/normalize.d.ts +4 -1
  16. package/dist/channels/slack/normalize.d.ts.map +1 -1
  17. package/dist/channels/slack/normalize.js +46 -10
  18. package/dist/channels/slack/normalize.js.map +1 -1
  19. package/dist/channels/store.d.ts +14 -0
  20. package/dist/channels/store.d.ts.map +1 -1
  21. package/dist/channels/store.js +41 -27
  22. package/dist/channels/store.js.map +1 -1
  23. package/dist/define-deep-agent.d.ts.map +1 -1
  24. package/dist/define-deep-agent.js +9 -3
  25. package/dist/define-deep-agent.js.map +1 -1
  26. package/dist/extension.d.ts +6 -14
  27. package/dist/extension.d.ts.map +1 -1
  28. package/dist/extension.js +5 -24
  29. package/dist/extension.js.map +1 -1
  30. package/dist/identity/github/connect-http.d.ts +1 -2
  31. package/dist/identity/github/connect-http.d.ts.map +1 -1
  32. package/dist/identity/github/connect-http.js +5 -8
  33. package/dist/identity/github/connect-http.js.map +1 -1
  34. package/dist/identity/github/credentials-store.d.ts.map +1 -1
  35. package/dist/identity/github/credentials-store.js +26 -10
  36. package/dist/identity/github/credentials-store.js.map +1 -1
  37. package/dist/identity/index.d.ts +15 -71
  38. package/dist/identity/index.d.ts.map +1 -1
  39. package/dist/identity/index.js +30 -223
  40. package/dist/identity/index.js.map +1 -1
  41. package/dist/identity/oauth-env.d.ts +4 -3
  42. package/dist/identity/oauth-env.d.ts.map +1 -1
  43. package/dist/identity/oauth-env.js +4 -3
  44. package/dist/identity/oauth-env.js.map +1 -1
  45. package/dist/identity/options.d.ts +12 -71
  46. package/dist/identity/options.d.ts.map +1 -1
  47. package/dist/identity/options.js +38 -112
  48. package/dist/identity/options.js.map +1 -1
  49. package/dist/identity/slack/links.d.ts +1 -1
  50. package/dist/identity/slack/links.d.ts.map +1 -1
  51. package/dist/identity/slack/links.js +27 -11
  52. package/dist/identity/slack/links.js.map +1 -1
  53. package/dist/identity/types.d.ts +11 -42
  54. package/dist/identity/types.d.ts.map +1 -1
  55. package/dist/index.d.ts +7 -9
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +3 -2
  58. package/dist/index.js.map +1 -1
  59. package/dist/ingress/index.d.ts.map +1 -1
  60. package/dist/ingress/index.js +26 -10
  61. package/dist/ingress/index.js.map +1 -1
  62. package/dist/memory/define-memory.d.ts +39 -0
  63. package/dist/memory/define-memory.d.ts.map +1 -0
  64. package/dist/memory/define-memory.js +78 -0
  65. package/dist/memory/define-memory.js.map +1 -0
  66. package/dist/memory/index.d.ts +9 -0
  67. package/dist/memory/index.d.ts.map +1 -0
  68. package/dist/memory/index.js +8 -0
  69. package/dist/memory/index.js.map +1 -0
  70. package/dist/memory/instructions-middleware.d.ts +74 -0
  71. package/dist/memory/instructions-middleware.d.ts.map +1 -0
  72. package/dist/memory/instructions-middleware.js +115 -0
  73. package/dist/memory/instructions-middleware.js.map +1 -0
  74. package/dist/memory/slices.d.ts +21 -0
  75. package/dist/memory/slices.d.ts.map +1 -0
  76. package/dist/memory/slices.js +61 -0
  77. package/dist/memory/slices.js.map +1 -0
  78. package/dist/memory/types.d.ts +71 -0
  79. package/dist/memory/types.d.ts.map +1 -0
  80. package/dist/memory/types.js +10 -0
  81. package/dist/memory/types.js.map +1 -0
  82. package/dist/namespaces.d.ts +3 -9
  83. package/dist/namespaces.d.ts.map +1 -1
  84. package/dist/namespaces.js +2 -19
  85. package/dist/namespaces.js.map +1 -1
  86. package/dist/runtime/auth.d.ts +30 -18
  87. package/dist/runtime/auth.d.ts.map +1 -1
  88. package/dist/runtime/auth.js +179 -65
  89. package/dist/runtime/auth.js.map +1 -1
  90. package/dist/runtime/backend.d.ts.map +1 -1
  91. package/dist/runtime/backend.js +26 -18
  92. package/dist/runtime/backend.js.map +1 -1
  93. package/dist/runtime/identity-http.d.ts +1 -3
  94. package/dist/runtime/identity-http.d.ts.map +1 -1
  95. package/dist/runtime/identity-http.js +23 -40
  96. package/dist/runtime/identity-http.js.map +1 -1
  97. package/dist/runtime/identity-runtime.d.ts +0 -18
  98. package/dist/runtime/identity-runtime.d.ts.map +1 -1
  99. package/dist/runtime/identity-runtime.js +0 -27
  100. package/dist/runtime/identity-runtime.js.map +1 -1
  101. package/dist/runtime/index.d.ts +2 -3
  102. package/dist/runtime/index.d.ts.map +1 -1
  103. package/dist/runtime/index.js +29 -31
  104. package/dist/runtime/index.js.map +1 -1
  105. package/dist/runtime/memory/index.d.ts +0 -3
  106. package/dist/runtime/memory/index.d.ts.map +1 -1
  107. package/dist/runtime/memory/index.js +0 -3
  108. package/dist/runtime/memory/index.js.map +1 -1
  109. package/dist/runtime/memory/mounts.d.ts +2 -10
  110. package/dist/runtime/memory/mounts.d.ts.map +1 -1
  111. package/dist/runtime/memory/mounts.js +3 -11
  112. package/dist/runtime/memory/mounts.js.map +1 -1
  113. package/dist/runtime/sandbox-manager.d.ts +5 -0
  114. package/dist/runtime/sandbox-manager.d.ts.map +1 -1
  115. package/dist/runtime/sandbox-manager.js +21 -15
  116. package/dist/runtime/sandbox-manager.js.map +1 -1
  117. package/dist/runtime/sandbox-stream-retry.d.ts +15 -7
  118. package/dist/runtime/sandbox-stream-retry.d.ts.map +1 -1
  119. package/dist/runtime/sandbox-stream-retry.js +24 -12
  120. package/dist/runtime/sandbox-stream-retry.js.map +1 -1
  121. package/dist/runtime/types.d.ts +8 -0
  122. package/dist/runtime/types.d.ts.map +1 -1
  123. package/dist/runtime/validated-token.d.ts +7 -12
  124. package/dist/runtime/validated-token.d.ts.map +1 -1
  125. package/dist/runtime/validated-token.js +10 -66
  126. package/dist/runtime/validated-token.js.map +1 -1
  127. package/dist/sandbox.d.ts +16 -38
  128. package/dist/sandbox.d.ts.map +1 -1
  129. package/dist/sandbox.js +9 -16
  130. package/dist/sandbox.js.map +1 -1
  131. package/dist/types.d.ts +4 -3
  132. package/dist/types.d.ts.map +1 -1
  133. package/dist/types.js.map +1 -1
  134. package/package.json +8 -8
  135. package/dist/identity/memory-slices.d.ts +0 -21
  136. package/dist/identity/memory-slices.d.ts.map +0 -1
  137. package/dist/identity/memory-slices.js +0 -105
  138. package/dist/identity/memory-slices.js.map +0 -1
  139. package/dist/runtime/memory/lazy-context-backend.d.ts +0 -74
  140. package/dist/runtime/memory/lazy-context-backend.d.ts.map +0 -1
  141. package/dist/runtime/memory/lazy-context-backend.js +0 -166
  142. package/dist/runtime/memory/lazy-context-backend.js.map +0 -1
  143. package/dist/runtime/memory/seed.d.ts +0 -30
  144. package/dist/runtime/memory/seed.d.ts.map +0 -1
  145. package/dist/runtime/memory/seed.js +0 -199
  146. package/dist/runtime/memory/seed.js.map +0 -1
  147. package/dist/runtime/memory/user-repo.d.ts +0 -18
  148. package/dist/runtime/memory/user-repo.d.ts.map +0 -1
  149. package/dist/runtime/memory/user-repo.js +0 -50
  150. package/dist/runtime/memory/user-repo.js.map +0 -1
@@ -1,105 +0,0 @@
1
- /**
2
- * Memory slice helpers shared by identity normalize and the runtime.
3
- *
4
- * Resolved memory is always a list of concrete slices (empty = no memory).
5
- * Mounts are always read/write.
6
- */
7
- /** True when the agent (deployment-shared) slice is enabled. */
8
- export function hasAgentMemorySlice(memory) {
9
- return memory.some((slice) => slice.kind === "agent");
10
- }
11
- /** True when the private user slice is enabled. */
12
- export function hasUserMemorySlice(memory) {
13
- return memory.some((slice) => slice.kind === "user");
14
- }
15
- /** Hot-memory paths for enabled slices (agent first, user last). */
16
- export function hotMemoryPaths(memory) {
17
- const paths = [];
18
- if (hasAgentMemorySlice(memory)) {
19
- paths.push("/memories/agent/AGENTS.md");
20
- }
21
- if (hasUserMemorySlice(memory)) {
22
- paths.push("/memories/user/AGENTS.md");
23
- }
24
- return paths;
25
- }
26
- /**
27
- * Normalize authoring `scope.memory` into a resolved slice list.
28
- *
29
- * Rejects object slice syntax, legacy flat `"organization"`, any `partition`
30
- * field, and any `access` field (mounts are always R/W).
31
- */
32
- export function normalizeMemoryScope(input) {
33
- if (input === "none") {
34
- return [];
35
- }
36
- // Runtime guard for pre-slice authoring (`"organization"` is not in the type).
37
- if (input === "organization") {
38
- throw new Error('defineIdentity(...) `scope.memory: "organization"` is not supported. ' +
39
- "Organization identity is not supported.");
40
- }
41
- const raw = Array.isArray(input) ? input : [input];
42
- if (raw.length === 0) {
43
- return [];
44
- }
45
- const resolved = [];
46
- let sawAgent = false;
47
- let sawUser = false;
48
- for (const entry of raw) {
49
- const slice = normalizeMemorySlice(entry);
50
- if (slice.kind === "agent") {
51
- if (sawAgent) {
52
- throw new Error("defineIdentity(...) `scope.memory` lists the agent slice more than once.");
53
- }
54
- sawAgent = true;
55
- resolved.push(slice);
56
- continue;
57
- }
58
- if (sawUser) {
59
- throw new Error("defineIdentity(...) `scope.memory` lists the user slice more than once.");
60
- }
61
- sawUser = true;
62
- resolved.push(slice);
63
- }
64
- // Stable order: agent then user (matches hot-memory injection order).
65
- resolved.sort((a, b) => {
66
- if (a.kind === b.kind)
67
- return 0;
68
- return a.kind === "agent" ? -1 : 1;
69
- });
70
- return resolved;
71
- }
72
- function normalizeMemorySlice(entry) {
73
- if (entry === "user") {
74
- return { kind: "user" };
75
- }
76
- if (entry === "agent") {
77
- return { kind: "agent" };
78
- }
79
- // Runtime guard: object form is not in MemorySliceInput (reserved for later).
80
- const unknownEntry = entry;
81
- if (unknownEntry !== null && typeof unknownEntry === "object") {
82
- assertNoRetiredSliceFields(unknownEntry);
83
- throw new Error(`defineIdentity(...) unknown \`scope.memory\` entry ${JSON.stringify(unknownEntry)}. ` +
84
- 'Use string shorthands "user" or "agent".');
85
- }
86
- throw new Error(`defineIdentity(...) unknown \`scope.memory\` entry ${JSON.stringify(unknownEntry)}. ` +
87
- 'Use string shorthands "user" or "agent".');
88
- }
89
- /** Reject retired / vestigial fields on slice objects. */
90
- function assertNoRetiredSliceFields(entry) {
91
- if ("partition" in entry) {
92
- const partition = entry.partition;
93
- if (partition === "organization") {
94
- throw new Error('defineIdentity(...) memory `partition: "organization"` is not supported. ' +
95
- "Organization identity is not supported.");
96
- }
97
- throw new Error("defineIdentity(...) memory `partition` is not supported. " +
98
- "User memory is always per-caller keyed — omit `partition`.");
99
- }
100
- if ("access" in entry) {
101
- throw new Error("defineIdentity(...) memory `access` is not supported. " +
102
- "Memory mounts are always read/write — omit `access`.");
103
- }
104
- }
105
- //# sourceMappingURL=memory-slices.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"memory-slices.js","sourceRoot":"","sources":["../../src/identity/memory-slices.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,gEAAgE;AAChE,MAAM,UAAU,mBAAmB,CAAC,MAAmB;IACrD,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC;AACxD,CAAC;AAED,mDAAmD;AACnD,MAAM,UAAU,kBAAkB,CAAC,MAAmB;IACpD,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC;AACvD,CAAC;AAED,oEAAoE;AACpE,MAAM,UAAU,cAAc,CAAC,MAAmB;IAChD,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B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I,KAAiC,CAAC,SAAS,CAAC;QAC/D,IAAI,SAAS,KAAK,cAAc,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CACb,2EAA2E;gBACzE,yCAAyC,CAC5C,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,KAAK,CACb,2DAA2D;YACzD,4DAA4D,CAC/D,CAAC;IACJ,CAAC;IACD,IAAI,QAAQ,IAAI,KAAK,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CACb,wDAAwD;YACtD,sDAAsD,CACzD,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -1,74 +0,0 @@
1
- /**
2
- * Lazy per-run CompositeBackend for identity-scoped user memory (+ optional
3
- * always-on agent slice from the deploy Hub).
4
- *
5
- * deepagents prefers a pre-constructed BackendProtocol instance over a factory.
6
- * This facade remounts `/memories/user` from the ambient LangGraph configurable
7
- * on each operation — the TypeScript counterpart of Python
8
- * `LazyPerRunContextBackend`.
9
- */
10
- import type { BackendProtocolV2 } from "deepagents";
11
- import { type IdentityConfig } from "../../identity/index.js";
12
- import type { LazyManagedSandboxBackend } from "../backend.js";
13
- export type LazyPerRunContextBackendDeps = {
14
- contextBackend: BackendProtocolV2;
15
- localRoot: string | undefined;
16
- deployHandle: string;
17
- sandboxBackend: LazyManagedSandboxBackend | undefined;
18
- identityConfig: IdentityConfig;
19
- };
20
- /**
21
- * Lazy CompositeBackend facade that remounts per-user memory.
22
- *
23
- * Construct unbound via {@link LazyPerRunContextBackend.create}, or call
24
- * {@link forRuntime} so concurrent requests each freeze their own
25
- * `configurable`.
26
- *
27
- * Only the memory mount (open + seed) is cached by user repo handle. The
28
- * CompositeBackend is rebuilt per operation with a fresh `forRuntime` sandbox
29
- * so thread-scoped sandboxes stay isolated across concurrent runs.
30
- */
31
- export declare class LazyPerRunContextBackend {
32
- private readonly deps;
33
- private readonly memoryCache;
34
- private readonly pendingMemory;
35
- private readonly boundConfigurable;
36
- /** Matches deepagents CompositeBackend; FilesystemMiddleware reads this. */
37
- readonly artifactsRoot = "/";
38
- private constructor();
39
- /** Build the unbound backend used at compile time. */
40
- static create(deps: LazyPerRunContextBackendDeps): LazyPerRunContextBackend;
41
- /** Per-run sibling with this request's `configurable` frozen. */
42
- forRuntime(runtime: unknown): LazyPerRunContextBackend;
43
- /**
44
- * Duck-type as CompositeBackend for deepagents
45
- * (`CompositeBackend.isInstance` checks `Array.isArray(routePrefixes)`).
46
- */
47
- get routePrefixes(): string[];
48
- /**
49
- * Mirror CompositeBackend: expose the sandbox default's id so deepagents'
50
- * `isSandboxBackend` / `adaptSandboxProtocol` keep `execute` mounted.
51
- *
52
- * Without this, user memory remounts strip shell even when
53
- * {@link LazyManagedSandboxBackend} itself advertises a pending id.
54
- */
55
- get id(): string;
56
- ls(path?: string): Promise<import("deepagents").LsResult>;
57
- read(filePath: string, offset?: number, limit?: number): Promise<import("deepagents").ReadResult>;
58
- readRaw(filePath: string): Promise<unknown>;
59
- grep(pattern: string, path?: string | null, glob?: string | null): Promise<import("deepagents").GrepResult>;
60
- glob(pattern: string, path?: string): Promise<import("deepagents").GlobResult>;
61
- write(filePath: string, content: string): Promise<import("deepagents").WriteResult>;
62
- edit(filePath: string, oldString: string, newString: string, replaceAll?: boolean): Promise<import("deepagents").EditResult>;
63
- delete(filePath: string): Promise<unknown>;
64
- uploadFiles(files: Array<[string, Uint8Array]>): Promise<import("deepagents").FileUploadResponse[]>;
65
- downloadFiles(paths: string[]): Promise<import("deepagents").FileDownloadResponse[]>;
66
- execute(command: string): Promise<import("deepagents").ExecuteResponse>;
67
- private memoryCacheKey;
68
- private runtimeBag;
69
- /** Rebuild composite each call with a per-run sandbox + cached memory mount. */
70
- private composite;
71
- private memoryUser;
72
- private resolveMemoryUser;
73
- }
74
- //# sourceMappingURL=lazy-context-backend.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lazy-context-backend.d.ts","sourceRoot":"","sources":["../../../src/runtime/memory/lazy-context-backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;G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GAAG,IAAI,4CAErE;IAEK,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,4CAExC;IAEK,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,6CAE5C;IAEK,IAAI,CACR,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,UAAU,UAAQ,4CAQnB;IAEK,MAAM,CAAC,QAAQ,EAAE,MAAM,oBAQ5B;IAEK,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,sDAEnD;IAEK,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,wDAElC;IAEK,OAAO,CAAC,OAAO,EAAE,MAAM,iDAE5B;IAED,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,UAAU;IAOlB,gFAAgF;YAClE,SAAS;IAWvB,OAAO,CAAC,UAAU;YA0BJ,iBAAiB;CAqBhC"}
@@ -1,166 +0,0 @@
1
- /**
2
- * Lazy per-run CompositeBackend for identity-scoped user memory (+ optional
3
- * always-on agent slice from the deploy Hub).
4
- *
5
- * deepagents prefers a pre-constructed BackendProtocol instance over a factory.
6
- * This facade remounts `/memories/user` from the ambient LangGraph configurable
7
- * on each operation — the TypeScript counterpart of Python
8
- * `LazyPerRunContextBackend`.
9
- */
10
- import { hasAgentMemorySlice, } from "../../identity/index.js";
11
- import { resolveRuntimeConfigurable } from "../identity-runtime.js";
12
- import { managedContextBackend } from "./mounts.js";
13
- import { ensureUserMemorySeed } from "./seed.js";
14
- import { openUserMemoryBackend, resolveRunMemoryRepoHandle, } from "./user-repo.js";
15
- const UNAUTHENTICATED_KEY = "__unauthenticated__";
16
- /**
17
- * Lazy CompositeBackend facade that remounts per-user memory.
18
- *
19
- * Construct unbound via {@link LazyPerRunContextBackend.create}, or call
20
- * {@link forRuntime} so concurrent requests each freeze their own
21
- * `configurable`.
22
- *
23
- * Only the memory mount (open + seed) is cached by user repo handle. The
24
- * CompositeBackend is rebuilt per operation with a fresh `forRuntime` sandbox
25
- * so thread-scoped sandboxes stay isolated across concurrent runs.
26
- */
27
- export class LazyPerRunContextBackend {
28
- deps;
29
- memoryCache;
30
- pendingMemory;
31
- boundConfigurable;
32
- /** Matches deepagents CompositeBackend; FilesystemMiddleware reads this. */
33
- artifactsRoot = "/";
34
- constructor(deps, memoryCache, pendingMemory, boundConfigurable) {
35
- this.deps = deps;
36
- this.memoryCache = memoryCache;
37
- this.pendingMemory = pendingMemory;
38
- this.boundConfigurable = boundConfigurable;
39
- }
40
- /** Build the unbound backend used at compile time. */
41
- static create(deps) {
42
- return new LazyPerRunContextBackend(deps, new Map(), new Map(), undefined);
43
- }
44
- /** Per-run sibling with this request's `configurable` frozen. */
45
- forRuntime(runtime) {
46
- const configurable = resolveRuntimeConfigurable(runtime);
47
- return new LazyPerRunContextBackend(this.deps, this.memoryCache, this.pendingMemory, configurable);
48
- }
49
- /**
50
- * Duck-type as CompositeBackend for deepagents
51
- * (`CompositeBackend.isInstance` checks `Array.isArray(routePrefixes)`).
52
- */
53
- get routePrefixes() {
54
- const prefixes = ["/instructions.md", "/skills/", "/memories/user/"];
55
- if (hasAgentMemorySlice(this.deps.identityConfig.scope.memory)) {
56
- prefixes.push("/memories/agent/");
57
- }
58
- return prefixes;
59
- }
60
- /**
61
- * Mirror CompositeBackend: expose the sandbox default's id so deepagents'
62
- * `isSandboxBackend` / `adaptSandboxProtocol` keep `execute` mounted.
63
- *
64
- * Without this, user memory remounts strip shell even when
65
- * {@link LazyManagedSandboxBackend} itself advertises a pending id.
66
- */
67
- get id() {
68
- return this.deps.sandboxBackend?.id ?? "";
69
- }
70
- async ls(path = "/") {
71
- return (await this.composite()).ls(path);
72
- }
73
- async read(filePath, offset, limit) {
74
- return (await this.composite()).read(filePath, offset, limit);
75
- }
76
- async readRaw(filePath) {
77
- const backend = await this.composite();
78
- const readRaw = backend.readRaw;
79
- if (typeof readRaw === "function") {
80
- return readRaw.call(backend, filePath);
81
- }
82
- return backend.read(filePath);
83
- }
84
- async grep(pattern, path, glob) {
85
- return (await this.composite()).grep(pattern, path, glob);
86
- }
87
- async glob(pattern, path) {
88
- return (await this.composite()).glob(pattern, path);
89
- }
90
- async write(filePath, content) {
91
- return (await this.composite()).write(filePath, content);
92
- }
93
- async edit(filePath, oldString, newString, replaceAll = false) {
94
- return (await this.composite()).edit(filePath, oldString, newString, replaceAll);
95
- }
96
- async delete(filePath) {
97
- const backend = await this.composite();
98
- const del = backend.delete;
99
- return del?.call(backend, filePath);
100
- }
101
- async uploadFiles(files) {
102
- return (await this.composite()).uploadFiles?.(files);
103
- }
104
- async downloadFiles(paths) {
105
- return (await this.composite()).downloadFiles?.(paths);
106
- }
107
- async execute(command) {
108
- return (await this.composite()).execute(command);
109
- }
110
- memoryCacheKey(runtime) {
111
- const handle = resolveRunMemoryRepoHandle(this.deps.deployHandle, this.deps.identityConfig, runtime);
112
- return handle ?? UNAUTHENTICATED_KEY;
113
- }
114
- runtimeBag() {
115
- if (this.boundConfigurable === undefined) {
116
- return undefined;
117
- }
118
- return { configurable: this.boundConfigurable };
119
- }
120
- /** Rebuild composite each call with a per-run sandbox + cached memory mount. */
121
- async composite() {
122
- const runtime = this.runtimeBag();
123
- const scopedSandbox = this.deps.sandboxBackend?.forRuntime(runtime);
124
- return managedContextBackend(this.deps.contextBackend, scopedSandbox, await this.memoryUser(runtime), hasAgentMemorySlice(this.deps.identityConfig.scope.memory));
125
- }
126
- memoryUser(runtime) {
127
- const key = this.memoryCacheKey(runtime);
128
- const hit = this.memoryCache.get(key);
129
- if (hit !== undefined) {
130
- return Promise.resolve(hit);
131
- }
132
- const pending = this.pendingMemory.get(key);
133
- if (pending) {
134
- return pending;
135
- }
136
- // Cache only successful mounts. Clear pending on settle so a rejected
137
- // open/seed (e.g. transient Context Hub failure) can retry next call.
138
- const resolving = this.resolveMemoryUser(runtime)
139
- .then((mount) => {
140
- this.memoryCache.set(key, mount);
141
- return mount;
142
- })
143
- .finally(() => {
144
- if (this.pendingMemory.get(key) === resolving) {
145
- this.pendingMemory.delete(key);
146
- }
147
- });
148
- this.pendingMemory.set(key, resolving);
149
- return resolving;
150
- }
151
- async resolveMemoryUser(runtime) {
152
- const userRepo = resolveRunMemoryRepoHandle(this.deps.deployHandle, this.deps.identityConfig, runtime);
153
- if (userRepo === null) {
154
- return null;
155
- }
156
- const memoryBackend = await openUserMemoryBackend(userRepo, this.deps.localRoot);
157
- await ensureUserMemorySeed({
158
- userBackend: memoryBackend.backend,
159
- deployBackend: this.deps.contextBackend,
160
- localRoot: memoryBackend.rootDir,
161
- deployRoot: this.deps.localRoot,
162
- });
163
- return { kind: "repo", backend: memoryBackend.backend };
164
- }
165
- }
166
- //# sourceMappingURL=lazy-context-backend.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lazy-context-backend.js","sourceRoot":"","sources":["../../../src/runtime/memory/lazy-context-backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EACL,mBAAmB,GAEpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAwB,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EACL,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AAExB,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAUlD;;;;;;;;;;GAUG;AACH,MAAM,OAAO,wBAAwB;IAKhB,IAAI;IACJ,WAAW;IACX,aAAa;IACb,iBAAiB;IAPpC,4EAA4E;IACnE,aAAa,GAAG,GAAG,CAAC;IAE7B,YACmB,IAAkC,EAClC,WAAyC,EACzC,aAAoD,EACpD,iBAAsD;oBAHtD,IAAI;2BACJ,WAAW;6BACX,aAAa;iCACb,iBAAiB;IACjC,CAAC;IAEJ,s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MAAM,qBAAqB,CAC/C,QAAQ,EACR,IAAI,CAAC,IAAI,CAAC,SAAS,CACpB,CAAC;QACF,MAAM,oBAAoB,CAAC;YACzB,WAAW,EAAE,aAAa,CAAC,OAAO;YAClC,aAAa,EAAE,IAAI,CAAC,IAAI,CAAC,cAAc;YACvC,SAAS,EAAE,aAAa,CAAC,OAAO;YAChC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS;SAChC,CAAC,CAAC;QACH,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,CAAC,OAAO,EAAE,CAAC;IAC1D,CAAC;CACF"}
@@ -1,30 +0,0 @@
1
- import type { BackendProtocolV2 } from "deepagents";
2
- /** Fallback hot-memory seed when the hub has no agent/flat AGENTS.md. */
3
- export declare const LOCAL_MEMORY_SEED = "<!-- MANAGED-DEEPAGENTS MEMORY INSTRUCTIONS: DO NOT DELETE -->\n# Memory Instructions\n\nManaged Deep Agents mounts durable memory under `/memories/` when enabled:\n\n- `/memories/agent/` \u2014 deployment-shared procedural memory (read/write; all callers)\n- `/memories/user/` \u2014 this run's private personal slice (read/write)\n\n## Hot memory (always loaded when the slice is enabled)\n\n- `/memories/agent/AGENTS.md` \u2014 shared processes, playbooks, agent-wide facts\n- `/memories/user/AGENTS.md` \u2014 compact personal preferences for this caller\n\nRules:\n\n- Keep hot files small. Prefer bullet points over long prose.\n- When adding new hot entries, remove or compress stale ones in the same edit.\n- Use only `read_file` / `edit_file` on these paths (not shell paths).\n- Cold files go under the matching tree (for example `/memories/user/archive/` or `/memories/agent/processes/`).\n- Do not store secrets, API keys, OAuth tokens, or passwords in any memory file.\n\n<!-- END MANAGED-DEEPAGENTS MEMORY INSTRUCTIONS: DO NOT DELETE -->\n";
4
- /**
5
- * True when a managed memory seed still teaches an obsolete layout.
6
- *
7
- * Stale templates omit `/memories/agent/` or still mention removed `/memories/org`.
8
- */
9
- export declare function memorySeedNeedsRefresh(content: string | undefined): boolean;
10
- /**
11
- * Replace only the managed instruction block, preserving author notes outside it.
12
- *
13
- * When the end marker is missing (truncated legacy templates), replaces from the
14
- * start marker through EOF. Content before the start marker is kept.
15
- */
16
- export declare function refreshManagedMemoryInstructions(content: string, template?: string): string;
17
- /**
18
- * Seed `/AGENTS.md` in a per-user memory repo from the deploy agent template.
19
- * First write creates the Hub repo via LangSmith `pushAgent`.
20
- *
21
- * Stale managed instruction blocks are refreshed in place; notes outside the
22
- * managed markers are preserved.
23
- */
24
- export declare function ensureUserMemorySeed(options: {
25
- userBackend: BackendProtocolV2;
26
- deployBackend: BackendProtocolV2;
27
- localRoot?: string;
28
- deployRoot?: string;
29
- }): Promise<void>;
30
- //# sourceMappingURL=seed.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"seed.d.ts","sourceRoot":"","sources":["../../../src/runtime/memory/seed.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAuDpD,yEAAyE;AACzE,eAAO,MAAM,iBAAiB,kiCAsB7B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAY3E;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,MAA0B,GACnC,MAAM,CAiBR;AAqCD;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,EAAE;IAClD,WAAW,EAAE,iBAAiB,CAAC;IAC/B,aAAa,EAAE,iBAAiB,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC,IAAI,CAAC,CA6DhB"}
@@ -1,199 +0,0 @@
1
- import { mkdir, open, readFile, writeFile } from "node:fs/promises";
2
- import { dirname, join } from "node:path";
3
- import { downloadContextFile, pathExists } from "./context-io.js";
4
- const MEMORY_SEED_START = "<!-- MANAGED-DEEPAGENTS MEMORY INSTRUCTIONS: DO NOT DELETE -->";
5
- const MEMORY_SEED_END = "<!-- END MANAGED-DEEPAGENTS MEMORY INSTRUCTIONS: DO NOT DELETE -->";
6
- /**
7
- * True when hot memory has inject-able body text.
8
- *
9
- * deepagents' Python MemoryMiddleware drops `<!-- ... -->` before injection, so
10
- * blank or comment-only files surface as "(No memory loaded)". Uses a linear
11
- * scan (no regex) so CodeQL does not flag sanitization / ReDoS patterns.
12
- */
13
- function hotMemoryHasBody(content) {
14
- if (content === undefined) {
15
- return false;
16
- }
17
- return nonCommentBodyLength(content) > 0;
18
- }
19
- /** Count non-whitespace characters outside HTML comments. */
20
- function nonCommentBodyLength(content) {
21
- let i = 0;
22
- let count = 0;
23
- const n = content.length;
24
- while (i < n) {
25
- if (content.startsWith("<!--", i)) {
26
- const end = content.indexOf("-->", i + 4);
27
- if (end === -1) {
28
- // Unclosed comment: ignore the remainder (no inject-able body).
29
- break;
30
- }
31
- i = end + 3;
32
- continue;
33
- }
34
- const code = content.charCodeAt(i);
35
- // Whitespace: space, tab, LF, CR, FF, VT
36
- if (code !== 32 &&
37
- code !== 9 &&
38
- code !== 10 &&
39
- code !== 13 &&
40
- code !== 12 &&
41
- code !== 11) {
42
- count += 1;
43
- }
44
- i += 1;
45
- }
46
- return count;
47
- }
48
- /** Fallback hot-memory seed when the hub has no agent/flat AGENTS.md. */
49
- export const LOCAL_MEMORY_SEED = `<!-- MANAGED-DEEPAGENTS MEMORY INSTRUCTIONS: DO NOT DELETE -->
50
- # Memory Instructions
51
-
52
- Managed Deep Agents mounts durable memory under \`/memories/\` when enabled:
53
-
54
- - \`/memories/agent/\` — deployment-shared procedural memory (read/write; all callers)
55
- - \`/memories/user/\` — this run's private personal slice (read/write)
56
-
57
- ## Hot memory (always loaded when the slice is enabled)
58
-
59
- - \`/memories/agent/AGENTS.md\` — shared processes, playbooks, agent-wide facts
60
- - \`/memories/user/AGENTS.md\` — compact personal preferences for this caller
61
-
62
- Rules:
63
-
64
- - Keep hot files small. Prefer bullet points over long prose.
65
- - When adding new hot entries, remove or compress stale ones in the same edit.
66
- - Use only \`read_file\` / \`edit_file\` on these paths (not shell paths).
67
- - Cold files go under the matching tree (for example \`/memories/user/archive/\` or \`/memories/agent/processes/\`).
68
- - Do not store secrets, API keys, OAuth tokens, or passwords in any memory file.
69
-
70
- <!-- END MANAGED-DEEPAGENTS MEMORY INSTRUCTIONS: DO NOT DELETE -->
71
- `;
72
- /**
73
- * True when a managed memory seed still teaches an obsolete layout.
74
- *
75
- * Stale templates omit `/memories/agent/` or still mention removed `/memories/org`.
76
- */
77
- export function memorySeedNeedsRefresh(content) {
78
- if (content === undefined) {
79
- return false;
80
- }
81
- if (!content.includes("MANAGED-DEEPAGENTS MEMORY INSTRUCTIONS")) {
82
- return false;
83
- }
84
- return (!content.includes("/memories/agent/") ||
85
- content.includes("/memories/org") ||
86
- !content.includes("/memories/user/AGENTS.md"));
87
- }
88
- /**
89
- * Replace only the managed instruction block, preserving author notes outside it.
90
- *
91
- * When the end marker is missing (truncated legacy templates), replaces from the
92
- * start marker through EOF. Content before the start marker is kept.
93
- */
94
- export function refreshManagedMemoryInstructions(content, template = LOCAL_MEMORY_SEED) {
95
- const start = content.indexOf(MEMORY_SEED_START);
96
- if (start === -1) {
97
- return template;
98
- }
99
- const endMarker = content.indexOf(MEMORY_SEED_END, start);
100
- const end = endMarker === -1 ? content.length : endMarker + MEMORY_SEED_END.length;
101
- const before = content.slice(0, start).replace(/\s+$/u, "");
102
- const after = content.slice(end).replace(/^\s+/u, "");
103
- const mid = template.replace(/\s+$/u, "");
104
- const parts = [before, mid, after].filter((part) => part.length > 0);
105
- let out = parts.join("\n");
106
- if (template.endsWith("\n") && !out.endsWith("\n")) {
107
- out += "\n";
108
- }
109
- return out;
110
- }
111
- function selectMemorySeed(agentHot, flatHot) {
112
- const candidate = agentHot !== undefined && hotMemoryHasBody(agentHot)
113
- ? agentHot
114
- : flatHot !== undefined && hotMemoryHasBody(flatHot)
115
- ? flatHot
116
- : LOCAL_MEMORY_SEED;
117
- return memorySeedNeedsRefresh(candidate)
118
- ? refreshManagedMemoryInstructions(candidate)
119
- : candidate;
120
- }
121
- async function writeSeedFileExclusive(path, content) {
122
- let handle;
123
- try {
124
- handle = await open(path, "wx", 0o600);
125
- }
126
- catch (err) {
127
- if (err.code === "EEXIST") {
128
- return;
129
- }
130
- throw err;
131
- }
132
- try {
133
- await handle.writeFile(content, "utf8");
134
- }
135
- finally {
136
- await handle.close();
137
- }
138
- }
139
- /**
140
- * Seed `/AGENTS.md` in a per-user memory repo from the deploy agent template.
141
- * First write creates the Hub repo via LangSmith `pushAgent`.
142
- *
143
- * Stale managed instruction blocks are refreshed in place; notes outside the
144
- * managed markers are preserved.
145
- */
146
- export async function ensureUserMemorySeed(options) {
147
- const { userBackend, deployBackend, localRoot, deployRoot } = options;
148
- if (localRoot !== undefined) {
149
- const hotPath = join(localRoot, "AGENTS.md");
150
- if (await pathExists(hotPath)) {
151
- const existing = await readFile(hotPath, "utf8");
152
- if (hotMemoryHasBody(existing) && !memorySeedNeedsRefresh(existing)) {
153
- return;
154
- }
155
- if (hotMemoryHasBody(existing) && memorySeedNeedsRefresh(existing)) {
156
- await writeFile(hotPath, refreshManagedMemoryInstructions(existing), "utf8");
157
- return;
158
- }
159
- }
160
- await mkdir(dirname(hotPath), { recursive: true, mode: 0o700 });
161
- let agentHot;
162
- let flatHot;
163
- if (deployRoot !== undefined) {
164
- const agentPath = join(deployRoot, "memories", "agent", "AGENTS.md");
165
- const flatPath = join(deployRoot, "memories", "AGENTS.md");
166
- if (await pathExists(agentPath)) {
167
- agentHot = await readFile(agentPath, "utf8");
168
- }
169
- if (await pathExists(flatPath)) {
170
- flatHot = await readFile(flatPath, "utf8");
171
- }
172
- }
173
- const seed = selectMemorySeed(agentHot, flatHot);
174
- if (await pathExists(hotPath)) {
175
- // Blank / comment-only leftovers: overwrite.
176
- await writeFile(hotPath, seed, "utf8");
177
- return;
178
- }
179
- await writeSeedFileExclusive(hotPath, seed);
180
- return;
181
- }
182
- const existing = await downloadContextFile(userBackend, "/AGENTS.md");
183
- if (hotMemoryHasBody(existing) && !memorySeedNeedsRefresh(existing)) {
184
- return;
185
- }
186
- const content = existing !== undefined &&
187
- hotMemoryHasBody(existing) &&
188
- memorySeedNeedsRefresh(existing)
189
- ? refreshManagedMemoryInstructions(existing)
190
- : selectMemorySeed(await downloadContextFile(deployBackend, "/memories/agent/AGENTS.md"), await downloadContextFile(deployBackend, "/memories/AGENTS.md"));
191
- const result = await userBackend.write("/AGENTS.md", content);
192
- const error = result && typeof result === "object" && "error" in result
193
- ? result.error
194
- : undefined;
195
- if (error != null && error !== "") {
196
- throw new Error(`failed to seed user hot memory: ${String(error)}`);
197
- }
198
- }
199
- //# sourceMappingURL=seed.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"seed.js","sourceRoot":"","sources":["../../../src/runtime/memory/seed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAG1C,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElE,MAAM,iBAAiB,GACrB,gEAAgE,CAAC;AACnE,MAAM,eAAe,GACnB,oEAAoE,CAAC;AAEvE;;;;;;GAMG;AACH,SAAS,gBAAgB,CAAC,OAA2B;IACnD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,oBAAoB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC3C,CAAC;AAED,6DAA6D;AAC7D,SAAS,oBAAoB,CAAC,OAAe;IAC3C,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,MAAM,CAAC,GA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AAsB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC5C,OAAO;IACT,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,mBAAmB,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;IACtE,IAAI,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,EAAE,CAAC;QACpE,OAAO;IACT,CAAC;IACD,MAAM,OAAO,GACX,QAAQ,KAAK,SAAS;QACtB,gBAAgB,CAAC,QAAQ,CAAC;QAC1B,sBAAsB,CAAC,QAAQ,CAAC;QAC9B,CAAC,CAAC,gCAAgC,CAAC,QAAQ,CAAC;QAC5C,CAAC,CAAC,gBAAgB,CACd,MAAM,mBAAmB,CAAC,aAAa,EAAE,2BAA2B,CAAC,EACrE,MAAM,mBAAmB,CAAC,aAAa,EAAE,qBAAqB,CAAC,CAChE,CAAC;IACR,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC9D,MAAM,KAAK,GACT,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,OAAO,IAAI,MAAM;QACvD,CAAC,CAAE,MAA8B,CAAC,KAAK;QACvC,CAAC,CAAC,SAAS,CAAC;IAChB,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CAAC,mCAAmC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACtE,CAAC;AACH,CAAC"}
@@ -1,18 +0,0 @@
1
- import type { BackendProtocolV2 } from "deepagents";
2
- import { type IdentityConfig } from "../../identity/index.js";
3
- /**
4
- * Resolve the dedicated Hub repo handle for private user memory on this run.
5
- */
6
- export declare function resolveRunMemoryRepoHandle(deployRepo: string, identityConfig: IdentityConfig, runtime: unknown): string | null;
7
- export type UserMemoryBackend = {
8
- backend: BackendProtocolV2;
9
- rootDir?: string;
10
- };
11
- /** Open (or create-on-write) the per-user Hub repo / local mock root. */
12
- export declare function openUserMemoryBackend(repoHandle: string, deployRoot: string | undefined): Promise<UserMemoryBackend>;
13
- /**
14
- * Prefer the agent-scoped Hub slice (`memories/agent`). Fall back to the legacy
15
- * flat `memories/` layout for older Context Hub repos (open agents).
16
- */
17
- export declare function resolveMemoryRepoPrefix(backend: BackendProtocolV2, rootDir?: string): Promise<string>;
18
- //# sourceMappingURL=user-repo.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user-repo.d.ts","sourceRoot":"","sources":["../../../src/runtime/memory/user-repo.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;AAQjC;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,OAAO,GACf,MAAM,GAAG,IAAI,CASf;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,yEAAyE;AACzE,wBAAsB,qBAAqB,CACzC,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,OAAO,CAAC,iBAAiB,CAAC,CAa5B;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,iBAAiB,EAC1B,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC,CAejB"}