@letta-ai/letta-agent-sdk 0.3.2 → 0.3.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/AGENTS.md +47 -0
- package/README.md +17 -0
- package/dist/client-entry.js +800 -732
- package/dist/client-entry.js.map +8 -5
- package/dist/cloud-sandbox.d.ts +33 -0
- package/dist/cloud-sandbox.d.ts.map +1 -0
- package/dist/cloud-session.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +799 -732
- package/dist/index.js.map +9 -6
- package/dist/remote-client-session-core.d.ts +6 -93
- package/dist/remote-client-session-core.d.ts.map +1 -1
- package/dist/remote-session-protocol.d.ts +130 -0
- package/dist/remote-session-protocol.d.ts.map +1 -0
- package/dist/remote-turn-coordinator.d.ts +49 -0
- package/dist/remote-turn-coordinator.d.ts.map +1 -0
- package/dist/types.d.ts +2 -20
- package/dist/types.d.ts.map +1 -1
- package/package.json +5 -2
- package/src/app-server-management.ts +641 -0
- package/src/app-server-session.ts +948 -0
- package/src/cli-resolver.ts +46 -0
- package/src/client-base.ts +482 -0
- package/src/client-entry.ts +31 -0
- package/src/client.ts +138 -0
- package/src/cloud-management.ts +360 -0
- package/src/cloud-sandbox.ts +117 -0
- package/src/cloud-session.ts +1313 -0
- package/src/index.ts +440 -0
- package/src/interactiveToolPolicy.ts +62 -0
- package/src/local-app-server-session.ts +39 -0
- package/src/local-app-server.ts +137 -0
- package/src/management-types.ts +133 -0
- package/src/management.ts +206 -0
- package/src/protocol.ts +249 -0
- package/src/remote-client-session-core.ts +786 -0
- package/src/remote-session-protocol.ts +660 -0
- package/src/remote-turn-coordinator.ts +505 -0
- package/src/remote.ts +177 -0
- package/src/repositories.ts +340 -0
- package/src/request-ids.ts +33 -0
- package/src/session.ts +1638 -0
- package/src/stream-events.ts +88 -0
- package/src/tool-helpers.ts +147 -0
- package/src/transport.ts +484 -0
- package/src/types.ts +1328 -0
- package/src/validation.ts +223 -0
- package/src/websocket.ts +22 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Letta Agent SDK contributor map
|
|
2
|
+
|
|
3
|
+
## Canonical source
|
|
4
|
+
|
|
5
|
+
Work in `src/`. `dist/` is generated by `bun run build`, ignored by Git, and
|
|
6
|
+
published as a bundle. A repeated class or method in `dist/index.js` or
|
|
7
|
+
`dist/client-entry.js` can represent separate source-layer responsibilities
|
|
8
|
+
that Bun placed in one file; trace it back to `src/` before changing it.
|
|
9
|
+
|
|
10
|
+
## Session architecture
|
|
11
|
+
|
|
12
|
+
- `client-base.ts` selects the backend and constructs a session.
|
|
13
|
+
- Remote, Cloud, and the default local app-server path share
|
|
14
|
+
`remote-client-session-core.ts`.
|
|
15
|
+
- `remote-session-protocol.ts` owns portable protocol types, validation, and
|
|
16
|
+
wire-to-domain normalization.
|
|
17
|
+
- `remote-turn-coordinator.ts` owns active/queued turn correlation and the
|
|
18
|
+
`SDKMessage` stream queue.
|
|
19
|
+
- `app-server-session.ts` adapts an app-server connection to the runtime
|
|
20
|
+
controller used by the portable session core.
|
|
21
|
+
- `cloud-session.ts` resolves Cloud runtimes and managed sandboxes, then uses
|
|
22
|
+
the same runtime controller and portable session core.
|
|
23
|
+
- `session.ts` is the separate legacy stdio implementation used only when
|
|
24
|
+
`transport: "stdio"` is selected and by the historical agent-less
|
|
25
|
+
`createSession()` helper.
|
|
26
|
+
- `types.ts` defines the stable public SDK surface. Internal protocol types
|
|
27
|
+
belong beside their implementation rather than in the public type barrel.
|
|
28
|
+
|
|
29
|
+
For `session.listMessages()` on an app-server or Cloud session, the call path
|
|
30
|
+
is:
|
|
31
|
+
|
|
32
|
+
`RemoteClientSessionCore.listMessages` →
|
|
33
|
+
`RemoteClientRuntimeController.listMessages` →
|
|
34
|
+
the selected transport adapter.
|
|
35
|
+
|
|
36
|
+
Those methods operate at different layers and should not be combined merely
|
|
37
|
+
because they share a name.
|
|
38
|
+
|
|
39
|
+
## Change discipline
|
|
40
|
+
|
|
41
|
+
- Keep transport parsing out of the session facade.
|
|
42
|
+
- Keep turn correlation and stream buffering in `RemoteTurnCoordinator`.
|
|
43
|
+
- Preserve exports from the package root and `/client` unless a change is
|
|
44
|
+
explicitly intended to be breaking.
|
|
45
|
+
- Treat source-size exceptions in `scripts/check-source-size.ts` as debt
|
|
46
|
+
ceilings: reduce them when a file shrinks and do not raise them casually.
|
|
47
|
+
- Run `bun run check`, `bun test`, and `bun run build` before opening a PR.
|
package/README.md
CHANGED
|
@@ -108,6 +108,23 @@ await using session = client.createSession(agentId, {
|
|
|
108
108
|
});
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
+
### Managed Cloud sandbox repositories
|
|
112
|
+
|
|
113
|
+
Cloud sessions can clone up to 10 GitHub repositories into the managed
|
|
114
|
+
sandbox. Public repositories clone directly; private repositories require
|
|
115
|
+
access through the organization's GitHub integration.
|
|
116
|
+
|
|
117
|
+
```ts
|
|
118
|
+
await using session = client.createSession(agentId, {
|
|
119
|
+
sandbox: {
|
|
120
|
+
githubRepositories: [
|
|
121
|
+
{ owner: "letta-ai", repo: "letta-docs-md" },
|
|
122
|
+
{ owner: "letta-ai", repo: "letta-code" },
|
|
123
|
+
],
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
```
|
|
127
|
+
|
|
111
128
|
### Remote App Server
|
|
112
129
|
|
|
113
130
|
```ts
|