@letta-ai/letta-code 0.30.26 → 0.30.28

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 (55) hide show
  1. package/dist/agent-presets.js +17 -17
  2. package/dist/agent-presets.js.map +1 -1
  3. package/dist/mcp-client.js +2 -2
  4. package/dist/mcp-client.js.map +1 -1
  5. package/dist/types/agent/turn-recovery-policy.d.ts +33 -0
  6. package/dist/types/agent/turn-recovery-policy.d.ts.map +1 -1
  7. package/dist/types/tools/impl/apply-patch.d.ts.map +1 -1
  8. package/dist/types/tools/secret-substitution.d.ts.map +1 -1
  9. package/dist/types/types/loop-status-protocol.d.ts +17 -0
  10. package/dist/types/types/loop-status-protocol.d.ts.map +1 -0
  11. package/dist/types/types/protocol_v2.d.ts +2 -19
  12. package/dist/types/types/protocol_v2.d.ts.map +1 -1
  13. package/dist/types/websocket/listener/inbound-queue.d.ts +5 -0
  14. package/dist/types/websocket/listener/inbound-queue.d.ts.map +1 -0
  15. package/dist/types/websocket/listener/protocol-outbound-routing.d.ts +9 -0
  16. package/dist/types/websocket/listener/protocol-outbound-routing.d.ts.map +1 -0
  17. package/dist/types/websocket/listener/protocol-outbound.d.ts.map +1 -1
  18. package/dist/types/websocket/listener/runtime.d.ts.map +1 -1
  19. package/dist/types/websocket/listener/turn-correlation.d.ts +10 -0
  20. package/dist/types/websocket/listener/turn-correlation.d.ts.map +1 -0
  21. package/dist/types/websocket/listener/types.d.ts +4 -0
  22. package/dist/types/websocket/listener/types.d.ts.map +1 -1
  23. package/letta.js +545 -120
  24. package/package.json +1 -1
  25. package/scripts/claude-watch/agent-watch.ts +622 -0
  26. package/scripts/claude-watch/docs-snapshot.test.ts +259 -0
  27. package/scripts/claude-watch/docs-snapshot.ts +672 -0
  28. package/scripts/claude-watch/fixtures/historical-replays.json +52 -0
  29. package/scripts/claude-watch/github.ts +137 -0
  30. package/scripts/claude-watch/release-analysis.test.ts +235 -0
  31. package/scripts/claude-watch/release-analysis.ts +297 -0
  32. package/scripts/claude-watch/release-source.test.ts +179 -0
  33. package/scripts/claude-watch/release-source.ts +369 -0
  34. package/scripts/claude-watch/runtime-observations.ts +98 -0
  35. package/scripts/claude-watch/runtime-probe.test.ts +576 -0
  36. package/scripts/claude-watch/runtime-probe.ts +911 -0
  37. package/scripts/claude-watch/runtime-sandbox.ts +170 -0
  38. package/scripts/claude-watch/state-branch.test.ts +211 -0
  39. package/scripts/claude-watch/state-branch.ts +316 -0
  40. package/scripts/claude-watch/tracker.test.ts +148 -0
  41. package/scripts/claude-watch/tracker.ts +325 -0
  42. package/scripts/claude-watch/types.ts +186 -0
  43. package/scripts/claude-watch/update-tracker.ts +201 -0
  44. package/scripts/codex-watch/agent-watch.ts +2 -2
  45. package/scripts/codex-watch/release-analysis.ts +14 -2
  46. package/scripts/codex-watch/tracker.ts +1 -3
  47. package/scripts/run-unit-tests.cjs +2 -0
  48. package/scripts/source-file-size-baseline.json +6 -5
  49. package/skills/creating-mods/references/commands.md +1 -1
  50. package/skills/creating-mods/references/ui.md +1 -1
  51. package/skills/customizing-commands/SKILL.md +1 -1
  52. package/skills/initializing-memory/SKILL.md +7 -7
  53. package/skills/self-configuration/SKILL.md +4 -4
  54. package/scripts/codex-watch/check-release.ts +0 -128
  55. package/scripts/codex-watch/render-issue.ts +0 -273
@@ -1,273 +0,0 @@
1
- /**
2
- * Renders a GitHub issue body summarizing a Codex release's impact on the
3
- * letta-code harness.
4
- */
5
-
6
- import type { ModelsDiff, Verdict } from "./diff-models-json.ts";
7
-
8
- const ACTION_REVIEWERS = ["@kl2806", "@devanshrj"];
9
-
10
- export interface PathChangeSummary {
11
- path: string;
12
- /** One-line commit subjects under this path between the two refs. */
13
- commits: string[];
14
- }
15
-
16
- export interface RenderInput {
17
- previous_tag: string;
18
- current_tag: string;
19
- release_url: string;
20
- release_notes_md: string;
21
- verdict: Verdict;
22
- models_diff: ModelsDiff | null;
23
- prompt_md_changed: boolean;
24
- prompt_md_diff_preview: string | null;
25
- path_changes: PathChangeSummary[];
26
- workflow_run_url: string;
27
- }
28
-
29
- /** Mapping from upstream concept to local letta-code file(s) to inspect. */
30
- const LOCAL_MIRRORS: Record<string, string[]> = {
31
- apply_patch_tool_type: [
32
- "src/agent/prompts/source_codex.md",
33
- "src/tools/impl/",
34
- "src/tools/schemas/ApplyPatch.json",
35
- "src/tools/descriptions/ApplyPatch.md",
36
- ],
37
- web_search_tool_type: ["src/tools/toolDefinitions.ts", "src/tools/impl/"],
38
- shell_type: [
39
- "src/tools/toolDefinitions.ts",
40
- "src/tools/schemas/ShellCommand.json",
41
- "src/tools/descriptions/ShellCommand.md",
42
- "src/tools/impl/",
43
- "src/agent/prompts/source_codex.md",
44
- ],
45
- supports_search_tool: ["src/tools/filter.ts", "src/tools/toolDefinitions.ts"],
46
- supports_parallel_tool_calls: ["src/agent/prompts/source_codex.md"],
47
- experimental_supported_tools: [
48
- "src/tools/toolDefinitions.ts",
49
- "src/tools/schemas/",
50
- "src/tools/descriptions/",
51
- "src/tools/impl/",
52
- ],
53
- input_modalities: ["src/tools/toolDefinitions.ts", "src/tools/impl/"],
54
- truncation_policy: ["src/agent/prompts/source_codex.md"],
55
- prompt_tool_mentions: ["src/agent/prompts/source_codex.md"],
56
- };
57
-
58
- function localMirror(field: string): string {
59
- const mirrors = LOCAL_MIRRORS[field];
60
- if (!mirrors || mirrors.length === 0) return "—";
61
- return mirrors.join(", ");
62
- }
63
-
64
- function fmtVal(v: unknown): string {
65
- if (v === undefined) return "_(unset)_";
66
- if (v === null) return "`null`";
67
- const s = JSON.stringify(v);
68
- return s.length > 80 ? `\`${s.slice(0, 77)}...\`` : `\`${s}\``;
69
- }
70
-
71
- export function renderTitle(input: RenderInput): string {
72
- return `[codex-watch] openai/codex ${input.current_tag} — ${input.verdict}`;
73
- }
74
-
75
- export function renderBody(input: RenderInput): string {
76
- const parts: string[] = [];
77
-
78
- // Verdict
79
- parts.push(`## Verdict`);
80
- parts.push("");
81
- parts.push(`**${input.verdict}**`);
82
- parts.push("");
83
- parts.push(verdictRationale(input));
84
- parts.push("");
85
- if (needsReviewerAttention(input)) {
86
- parts.push(`Reviewers: ${ACTION_REVIEWERS.join(" ")}`);
87
- parts.push("");
88
- }
89
-
90
- // Tool / schema deltas
91
- parts.push(`## Tool / schema deltas`);
92
- parts.push("");
93
- if (
94
- input.models_diff &&
95
- (input.models_diff.field_deltas.length > 0 ||
96
- input.models_diff.added_models.length > 0 ||
97
- input.models_diff.removed_models.length > 0)
98
- ) {
99
- if (input.models_diff.added_models.length > 0) {
100
- parts.push(
101
- `**Added models:** ${input.models_diff.added_models.map((s) => `\`${s}\``).join(", ")}`,
102
- );
103
- parts.push("");
104
- }
105
- if (input.models_diff.removed_models.length > 0) {
106
- parts.push(
107
- `**Removed models:** ${input.models_diff.removed_models.map((s) => `\`${s}\``).join(", ")}`,
108
- );
109
- parts.push("");
110
- }
111
- if (input.models_diff.field_deltas.length > 0) {
112
- parts.push(
113
- "| Model | Field | Previous | New | Affected letta-code path |",
114
- );
115
- parts.push(
116
- "|-------|-------|----------|-----|--------------------------|",
117
- );
118
- for (const d of input.models_diff.field_deltas) {
119
- parts.push(
120
- `| \`${d.slug}\` | \`${d.field}\` | ${fmtVal(d.previous)} | ${fmtVal(d.current)} | ${localMirror(d.field)} |`,
121
- );
122
- }
123
- parts.push("");
124
- }
125
- } else {
126
- parts.push("_No tool-field deltas detected in `models.json`._");
127
- parts.push("");
128
- }
129
-
130
- // Upstream changes by path
131
- parts.push(`## Upstream changes by path`);
132
- parts.push("");
133
- if (input.path_changes.length > 0) {
134
- for (const p of input.path_changes) {
135
- parts.push(`### \`${p.path}\``);
136
- if (p.commits.length === 0) {
137
- parts.push("_No commits touching this path between releases._");
138
- } else {
139
- for (const c of p.commits) parts.push(`- ${c}`);
140
- }
141
- parts.push("");
142
- }
143
- } else {
144
- parts.push("_No changes under watched paths._");
145
- parts.push("");
146
- }
147
-
148
- const impacts = potentialImpacts(input);
149
- if (impacts.length > 0) {
150
- parts.push(`## Potential letta-code impact`);
151
- parts.push("");
152
- for (const impact of impacts) parts.push(`- ${impact}`);
153
- parts.push("");
154
- }
155
-
156
- // Prompt diff preview
157
- if (input.prompt_md_changed && input.prompt_md_diff_preview) {
158
- parts.push(`## \`codex-rs/models-manager/prompt.md\` diff (preview)`);
159
- parts.push("");
160
- parts.push("```diff");
161
- parts.push(input.prompt_md_diff_preview);
162
- parts.push("```");
163
- parts.push("");
164
- }
165
-
166
- // Suggested actions
167
- parts.push(`## Suggested actions`);
168
- parts.push("");
169
- for (const a of suggestedActions(input)) parts.push(`- [ ] ${a}`);
170
- parts.push("");
171
-
172
- // Provenance
173
- parts.push(`## How this was generated`);
174
- parts.push("");
175
- parts.push(`- Release/notes: ${input.release_url}`);
176
- parts.push(
177
- `- Compare: https://github.com/openai/codex/compare/${input.previous_tag}...${input.current_tag}`,
178
- );
179
- parts.push(`- Workflow run: ${input.workflow_run_url}`);
180
-
181
- return parts.join("\n");
182
- }
183
-
184
- function needsReviewerAttention(input: RenderInput): boolean {
185
- return input.verdict !== "no-op";
186
- }
187
-
188
- function verdictRationale(input: RenderInput): string {
189
- switch (input.verdict) {
190
- case "no-op":
191
- return "No watched tool-surface changes detected.";
192
- case "prompt-only update":
193
- return "Prompt text or tool mentions changed; `src/agent/prompts/source_codex.md` may need re-extraction.";
194
- case "tool-schema update needed":
195
- return "Upstream changed tool-config fields in `models.json`. Review local mirrors only where the model contract changed.";
196
- case "tool-surface review needed":
197
- return "No `models.json` tool-field deltas, but upstream tool implementation paths changed. Check whether letta-code has a mirror.";
198
- case "manual review required":
199
- return "Could not classify automatically; review the upstream diff manually.";
200
- }
201
- }
202
-
203
- function hasPath(input: RenderInput, prefix: string): boolean {
204
- return input.path_changes.some((p) => p.path.startsWith(prefix));
205
- }
206
-
207
- function potentialImpacts(input: RenderInput): string[] {
208
- const out: string[] = [];
209
-
210
- if (input.models_diff?.field_deltas.length) {
211
- out.push(
212
- "`models.json` field deltas: inspect listed local mirrors for schema, availability, or prompt drift.",
213
- );
214
- }
215
-
216
- if (hasPath(input, "codex-rs/core/src/tools")) {
217
- out.push(
218
- "Core tools changed: compare relevant commits against `src/tools/toolDefinitions.ts`, `schemas/`, `descriptions/`, `impl/`, and `manager.ts`.",
219
- );
220
- out.push(
221
- "Likely mirrors: `view_image` → `ViewImage`, shell/exec → `ShellCommand`/`Bash`, `apply_patch` → `ApplyPatch`; MCP/search/approval may be upstream-only.",
222
- );
223
- }
224
-
225
- if (hasPath(input, "codex-rs/apply-patch")) {
226
- out.push(
227
- "`apply-patch` changed: compare parser/failure semantics with `ApplyPatch.ts`, `MemoryApplyPatch.ts`, descriptions, and tests.",
228
- );
229
- }
230
-
231
- if (input.prompt_md_changed) {
232
- out.push(
233
- "Prompt changed: reconcile `src/agent/prompts/source_codex.md` and README provenance.",
234
- );
235
- }
236
-
237
- if (input.verdict === "no-op") {
238
- out.push(
239
- "No watched tool surfaces changed. Skim release notes, then close if nothing applies.",
240
- );
241
- }
242
-
243
- return out;
244
- }
245
-
246
- function suggestedActions(input: RenderInput): string[] {
247
- const out: string[] = [];
248
- if (input.verdict === "no-op") {
249
- out.push("Skim release notes; close if nothing stands out.");
250
- return out;
251
- }
252
- if (input.verdict === "prompt-only update" || input.prompt_md_changed) {
253
- out.push(
254
- "Re-extract/reconcile `src/agent/prompts/source_codex.md` if prompt semantics changed.",
255
- );
256
- }
257
- if (input.verdict === "tool-schema update needed") {
258
- out.push(
259
- "Inspect each `models.json` delta; update local schema/description/impl/tests only if the exposed contract changed.",
260
- );
261
- }
262
- if (input.verdict === "tool-surface review needed") {
263
- out.push(
264
- "Review watched-path commits; if a change has a letta-code mirror, update schema/description/impl/prompt/tests together.",
265
- );
266
- }
267
- if (input.verdict === "manual review required") {
268
- out.push(
269
- "Diff `openai/codex` between the two tags manually and decide whether letta-code needs to react.",
270
- );
271
- }
272
- return out;
273
- }