@letta-ai/letta-code 0.34.75 → 0.34.76
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/dist/mcp-client.js +2 -2
- package/dist/mcp-client.js.map +1 -1
- package/dist/mcp-oauth.js +2 -2
- package/dist/mcp-oauth.js.map +1 -1
- package/dist/types/tools/impl/monitor-pr-hint.d.ts +2 -0
- package/dist/types/tools/impl/monitor-pr-hint.d.ts.map +1 -0
- package/dist/types/tools/impl/monitor.d.ts.map +1 -1
- package/letta.js +73 -27
- package/npm-shrinkwrap.json +5 -5
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monitor-pr-hint.d.ts","sourceRoot":"","sources":["../../../../src/tools/impl/monitor-pr-hint.ts"],"names":[],"mappings":"AAaA,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CA2B1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monitor.d.ts","sourceRoot":"","sources":["../../../../src/tools/impl/monitor.ts"],"names":[],"mappings":"AAeA,OAAO,EAGL,wBAAwB,EACzB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,KAAK,EAAE,WAAW,EAA0B,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"monitor.d.ts","sourceRoot":"","sources":["../../../../src/tools/impl/monitor.ts"],"names":[],"mappings":"AAeA,OAAO,EAGL,wBAAwB,EACzB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,KAAK,EAAE,WAAW,EAA0B,MAAM,gBAAgB,CAAC;AAsB1E,OAAO,EAEL,KAAK,iBAAiB,EAOvB,MAAM,sBAAsB,CAAC;AAS9B,eAAO,MAAM,yBAAyB,QAAc,CAAC;AAWrD,UAAU,aAAa;IACrB,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;K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.js
CHANGED
|
@@ -6156,7 +6156,7 @@ var package_default;
|
|
|
6156
6156
|
var init_package = __esm(() => {
|
|
6157
6157
|
package_default = {
|
|
6158
6158
|
name: "@letta-ai/letta-code",
|
|
6159
|
-
version: "0.34.
|
|
6159
|
+
version: "0.34.76",
|
|
6160
6160
|
lettaStartupLogProtocol: 1,
|
|
6161
6161
|
lettaConfigDirProtocol: 1,
|
|
6162
6162
|
description: "Letta Code is a CLI tool for interacting with stateful Letta agents from the terminal.",
|
|
@@ -6410,7 +6410,7 @@ var init_package = __esm(() => {
|
|
|
6410
6410
|
},
|
|
6411
6411
|
lettaLifecycleProtocol: 1,
|
|
6412
6412
|
lettaRuntimeGraphProtocol: 1,
|
|
6413
|
-
lettaRuntimeGraphSha512: "sha512-
|
|
6413
|
+
lettaRuntimeGraphSha512: "sha512-K0fGAAQKChkUuniz2QJadssvSJdREgANwvR1Kth6SCY7C/K+Coy7HMTuON5QpKHfrpxekJWRMWG55yORzW/7uA==",
|
|
6414
6414
|
patchedDependencies: {
|
|
6415
6415
|
"@earendil-works/pi-ai@1.6.0": "patches/@earendil-works%2Fpi-ai@1.6.0.patch"
|
|
6416
6416
|
}
|
|
@@ -212280,7 +212280,7 @@ var init_mcp_client = __esm(() => {
|
|
|
212280
212280
|
init_streamableHttp();
|
|
212281
212281
|
DEFAULT_CLIENT_INFO = {
|
|
212282
212282
|
name: "letta-code",
|
|
212283
|
-
version: "0.34.
|
|
212283
|
+
version: "0.34.76"
|
|
212284
212284
|
};
|
|
212285
212285
|
});
|
|
212286
212286
|
|
|
@@ -244127,6 +244127,47 @@ var init_monitor_event_stream = __esm(() => {
|
|
|
244127
244127
|
MONITOR_EVENT_BUFFER_CHARS = 1024 * 1024;
|
|
244128
244128
|
});
|
|
244129
244129
|
|
|
244130
|
+
// src/tools/impl/monitor-pr-hint.ts
|
|
244131
|
+
function prUrl(repo, number6) {
|
|
244132
|
+
return `https://github.com/${repo}/pull/${number6}`;
|
|
244133
|
+
}
|
|
244134
|
+
function monitorPullRequestHint(command) {
|
|
244135
|
+
let url2;
|
|
244136
|
+
let matched = false;
|
|
244137
|
+
const api2 = command.match(GH_API_PULL);
|
|
244138
|
+
if (api2?.[1] && api2[2]) {
|
|
244139
|
+
matched = true;
|
|
244140
|
+
url2 = prUrl(api2[1], api2[2]);
|
|
244141
|
+
}
|
|
244142
|
+
const pr = matched ? null : command.match(GH_PR_SUBCOMMAND);
|
|
244143
|
+
if (pr) {
|
|
244144
|
+
const args = pr[1] ?? "";
|
|
244145
|
+
const direct = args.match(PR_URL);
|
|
244146
|
+
const number6 = args.match(PR_NUMBER_ARG)?.[1];
|
|
244147
|
+
const repo = pr[0].match(REPO_FLAG)?.[1];
|
|
244148
|
+
matched = true;
|
|
244149
|
+
if (direct?.[1] && direct[2])
|
|
244150
|
+
url2 = prUrl(direct[1], direct[2]);
|
|
244151
|
+
else if (number6 && repo)
|
|
244152
|
+
url2 = prUrl(repo, number6);
|
|
244153
|
+
}
|
|
244154
|
+
if (!matched && GH_PR_STATUS.test(command))
|
|
244155
|
+
matched = true;
|
|
244156
|
+
if (!matched)
|
|
244157
|
+
return;
|
|
244158
|
+
const target = url2 ?? "that pull request";
|
|
244159
|
+
return `This command polls a GitHub pull request. WatchPR also reports reviews, comments, conflicts and pushes; stop this monitor with TaskStop and call WatchPR on ${target} instead.`;
|
|
244160
|
+
}
|
|
244161
|
+
var REPO_FLAG, PR_URL, GH_PR_SUBCOMMAND, PR_NUMBER_ARG, GH_PR_STATUS, GH_API_PULL;
|
|
244162
|
+
var init_monitor_pr_hint = __esm(() => {
|
|
244163
|
+
REPO_FLAG = /(?:^|\s)(?:-R|--repo)(?:\s+|=)["']?([\w.-]+\/[\w.-]+)/;
|
|
244164
|
+
PR_URL = /https?:\/\/github\.com\/([\w.-]+\/[\w.-]+)\/pull\/(\d+)/;
|
|
244165
|
+
GH_PR_SUBCOMMAND = /\bgh\b[^\n;|&]*?\bpr\s+(?:view|checks)\b([^\n;|&)]*)/;
|
|
244166
|
+
PR_NUMBER_ARG = /(?:^|\s)["']?#?(\d+)(?=["']?(?:\s|$))/;
|
|
244167
|
+
GH_PR_STATUS = /\bgh\s+pr\s+status\b/;
|
|
244168
|
+
GH_API_PULL = /\bgh\s+api\b[^\n;|&]*?\brepos\/([\w.-]+\/[\w.-]+)\/pulls\/(\d+)\b/;
|
|
244169
|
+
});
|
|
244170
|
+
|
|
244130
244171
|
// src/tools/impl/monitor-result.ts
|
|
244131
244172
|
function buildMonitorResult(taskId, timeoutMs, persistent, outputFile) {
|
|
244132
244173
|
const lifetime = persistent ? "persistent — runs until TaskStop or session end" : `timeout ${timeoutMs}ms`;
|
|
@@ -245480,20 +245521,24 @@ async function monitor(args) {
|
|
|
245480
245521
|
const sourceArgs = { ...normalized, taskId };
|
|
245481
245522
|
return normalized.script !== undefined ? startScriptSource(sourceArgs) : normalized.command !== undefined ? startCommandMonitor(sourceArgs) : startWebSocketMonitor(sourceArgs);
|
|
245482
245523
|
});
|
|
245483
|
-
|
|
245484
|
-
|
|
245485
|
-
|
|
245486
|
-
|
|
245487
|
-
|
|
245488
|
-
|
|
245489
|
-
|
|
245490
|
-
|
|
245491
|
-
|
|
245492
|
-
|
|
245524
|
+
const notes = [];
|
|
245525
|
+
if (normalized.backup_after_seconds !== undefined) {
|
|
245526
|
+
notes.push(await armMonitorBackup({
|
|
245527
|
+
taskId: result3.taskId,
|
|
245528
|
+
description: normalized.description,
|
|
245529
|
+
afterSeconds: normalized.backup_after_seconds,
|
|
245530
|
+
prompt: normalized.backup_prompt,
|
|
245531
|
+
scope: backupScopeFor(result3.taskId),
|
|
245532
|
+
isRunning: () => backgroundProcesses.get(result3.taskId)?.status === "running"
|
|
245533
|
+
}));
|
|
245534
|
+
}
|
|
245535
|
+
const prHint = monitorPullRequestHint(normalized.command ?? normalized.script ?? "");
|
|
245536
|
+
if (prHint)
|
|
245537
|
+
notes.push(prHint);
|
|
245493
245538
|
const first = result3.content[0];
|
|
245494
|
-
if (first)
|
|
245495
|
-
first.text =
|
|
245496
|
-
|
|
245539
|
+
if (first && notes.length > 0)
|
|
245540
|
+
first.text = [first.text, ...notes].join(`
|
|
245541
|
+
`);
|
|
245497
245542
|
return result3;
|
|
245498
245543
|
}
|
|
245499
245544
|
function stopMonitorOnShutdown(processState) {
|
|
@@ -245545,6 +245590,7 @@ var init_monitor = __esm(() => {
|
|
|
245545
245590
|
init_bash();
|
|
245546
245591
|
init_monitor_backup();
|
|
245547
245592
|
init_monitor_event_stream();
|
|
245593
|
+
init_monitor_pr_hint();
|
|
245548
245594
|
init_monitor_resume();
|
|
245549
245595
|
init_monitor_script();
|
|
245550
245596
|
init_monitor_state();
|
|
@@ -251038,7 +251084,7 @@ class CodexAppServerClient {
|
|
|
251038
251084
|
await this.request("initialize", {
|
|
251039
251085
|
clientInfo: {
|
|
251040
251086
|
name: "letta-code",
|
|
251041
|
-
version: "0.34.
|
|
251087
|
+
version: "0.34.76"
|
|
251042
251088
|
},
|
|
251043
251089
|
capabilities: null
|
|
251044
251090
|
});
|
|
@@ -255566,7 +255612,7 @@ async function fetchParentConversationMessages(params) {
|
|
|
255566
255612
|
}
|
|
255567
255613
|
return messages.reverse();
|
|
255568
255614
|
}
|
|
255569
|
-
function
|
|
255615
|
+
function contentText3(content) {
|
|
255570
255616
|
if (typeof content === "string")
|
|
255571
255617
|
return content;
|
|
255572
255618
|
if (!Array.isArray(content))
|
|
@@ -255592,7 +255638,7 @@ function renderToolCall(call) {
|
|
|
255592
255638
|
}
|
|
255593
255639
|
function renderToolResult(result3) {
|
|
255594
255640
|
const raw2 = result3.tool_return ?? result3.func_response;
|
|
255595
|
-
const text2 = typeof raw2 === "string" ? raw2 :
|
|
255641
|
+
const text2 = typeof raw2 === "string" ? raw2 : contentText3(raw2) || (raw2 == null ? "" : JSON.stringify(raw2));
|
|
255596
255642
|
return {
|
|
255597
255643
|
type: "tool_result",
|
|
255598
255644
|
call_id: result3.tool_call_id ?? undefined,
|
|
@@ -255628,11 +255674,11 @@ function userEvents(text2, speaker) {
|
|
|
255628
255674
|
function renderMessage(message2) {
|
|
255629
255675
|
switch (message2.message_type) {
|
|
255630
255676
|
case "user_message": {
|
|
255631
|
-
const text2 = stripNonScheduledSystemReminders(
|
|
255677
|
+
const text2 = stripNonScheduledSystemReminders(contentText3(message2.content)).trim();
|
|
255632
255678
|
return userEvents(text2, message2.name ?? undefined);
|
|
255633
255679
|
}
|
|
255634
255680
|
case "assistant_message": {
|
|
255635
|
-
const text2 =
|
|
255681
|
+
const text2 = contentText3(message2.content).trim();
|
|
255636
255682
|
return text2 ? [
|
|
255637
255683
|
{
|
|
255638
255684
|
type: "message",
|
|
@@ -457560,12 +457606,12 @@ function rowToolCalls(row, index, diagnostics2) {
|
|
|
457560
457606
|
}
|
|
457561
457607
|
return calls;
|
|
457562
457608
|
}
|
|
457563
|
-
function
|
|
457609
|
+
function contentText4(content) {
|
|
457564
457610
|
if (typeof content === "string") {
|
|
457565
457611
|
if (content.startsWith(CONTENT_JSON_PREFIX)) {
|
|
457566
457612
|
const encoded = content.slice(CONTENT_JSON_PREFIX.length);
|
|
457567
457613
|
try {
|
|
457568
|
-
return
|
|
457614
|
+
return contentText4(JSON.parse(encoded));
|
|
457569
457615
|
} catch {
|
|
457570
457616
|
return encoded;
|
|
457571
457617
|
}
|
|
@@ -457651,7 +457697,7 @@ var init_hermes = __esm(() => {
|
|
|
457651
457697
|
});
|
|
457652
457698
|
};
|
|
457653
457699
|
if (row.role === "user") {
|
|
457654
|
-
const content =
|
|
457700
|
+
const content = contentText4(row.content);
|
|
457655
457701
|
if (content) {
|
|
457656
457702
|
emit({
|
|
457657
457703
|
type: "message",
|
|
@@ -457671,7 +457717,7 @@ var init_hermes = __esm(() => {
|
|
|
457671
457717
|
...timestamp ? { timestamp } : {}
|
|
457672
457718
|
});
|
|
457673
457719
|
}
|
|
457674
|
-
const content =
|
|
457720
|
+
const content = contentText4(row.content);
|
|
457675
457721
|
if (content) {
|
|
457676
457722
|
emit({
|
|
457677
457723
|
type: "message",
|
|
@@ -457694,7 +457740,7 @@ var init_hermes = __esm(() => {
|
|
|
457694
457740
|
if (row.role === "tool") {
|
|
457695
457741
|
emit({
|
|
457696
457742
|
type: "tool_result",
|
|
457697
|
-
content:
|
|
457743
|
+
content: contentText4(row.content),
|
|
457698
457744
|
...typeof row.tool_call_id === "string" && row.tool_call_id ? { callId: row.tool_call_id } : {},
|
|
457699
457745
|
...timestamp ? { timestamp } : {}
|
|
457700
457746
|
});
|
|
@@ -548346,4 +548392,4 @@ function registerBunOAuthFlows() {
|
|
|
548346
548392
|
registerBunOAuthFlows();
|
|
548347
548393
|
await init_src5().then(() => exports_src2);
|
|
548348
548394
|
|
|
548349
|
-
//# debugId=
|
|
548395
|
+
//# debugId=B5002FC0CB07EA2264756E2164756E21
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@letta-ai/letta-code",
|
|
3
|
-
"version": "0.34.
|
|
3
|
+
"version": "0.34.76",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"packages": {
|
|
6
6
|
"node_modules/@alcalzone/ansi-tokenize": {
|
|
@@ -2184,9 +2184,9 @@
|
|
|
2184
2184
|
"license": "MIT"
|
|
2185
2185
|
},
|
|
2186
2186
|
"node_modules/brace-expansion": {
|
|
2187
|
-
"version": "5.1.
|
|
2188
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.1.
|
|
2189
|
-
"integrity": "sha512-
|
|
2187
|
+
"version": "5.1.2",
|
|
2188
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.1.2.tgz",
|
|
2189
|
+
"integrity": "sha512-ELhY3JEerIBbhgW+rh0/8glkZAaMqn1x3BAvp3yTULSEGozMK/5PT6WTdBgsdvJqwwmv7MAQNOydfYbvK1Vgfw==",
|
|
2190
2190
|
"license": "MIT",
|
|
2191
2191
|
"dependencies": {
|
|
2192
2192
|
"balanced-match": "^4.0.2"
|
|
@@ -5091,7 +5091,7 @@
|
|
|
5091
5091
|
},
|
|
5092
5092
|
"": {
|
|
5093
5093
|
"name": "@letta-ai/letta-code",
|
|
5094
|
-
"version": "0.34.
|
|
5094
|
+
"version": "0.34.76",
|
|
5095
5095
|
"dependencies": {
|
|
5096
5096
|
"@cursor/sdk": "1.1.0",
|
|
5097
5097
|
"@earendil-works/pi-ai": "^1.6.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@letta-ai/letta-code",
|
|
3
|
-
"version": "0.34.
|
|
3
|
+
"version": "0.34.76",
|
|
4
4
|
"lettaStartupLogProtocol": 1,
|
|
5
5
|
"lettaConfigDirProtocol": 1,
|
|
6
6
|
"description": "Letta Code is a CLI tool for interacting with stateful Letta agents from the terminal.",
|
|
@@ -254,7 +254,7 @@
|
|
|
254
254
|
},
|
|
255
255
|
"lettaLifecycleProtocol": 1,
|
|
256
256
|
"lettaRuntimeGraphProtocol": 1,
|
|
257
|
-
"lettaRuntimeGraphSha512": "sha512-
|
|
257
|
+
"lettaRuntimeGraphSha512": "sha512-K0fGAAQKChkUuniz2QJadssvSJdREgANwvR1Kth6SCY7C/K+Coy7HMTuON5QpKHfrpxekJWRMWG55yORzW/7uA==",
|
|
258
258
|
"patchedDependencies": {
|
|
259
259
|
"@earendil-works/pi-ai@1.6.0": "patches/@earendil-works%2Fpi-ai@1.6.0.patch"
|
|
260
260
|
}
|