nolo-cli 0.49.0-alpha.1 → 0.49.1
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/{_executeModel-4BPV4B2U.js → _executeModel-KE4PQSZ3.js} +19 -19
- package/{agentDeleteCommand-KZSETRE3.js → agentDeleteCommand-Z67TJG3W.js} +10 -10
- package/{agentEmailCommands-C33KPOFP.js → agentEmailCommands-7LPIK7JE.js} +23 -23
- package/{agentListCommands-KVLURCS7.js → agentListCommands-5J2IM3IT.js} +12 -12
- package/{agentMachineCommands-ICOLSVID.js → agentMachineCommands-YXH6FXUQ.js} +11 -11
- package/{agentRecordCommands-OWKWVY3Y.js → agentRecordCommands-GZLCDVUS.js} +22 -22
- package/{agentRunCommand-FINKBYUN.js → agentRunCommand-WYH5Q54Q.js} +22 -22
- package/{agentRuntimeLocal-SIQYQGSK.js → agentRuntimeLocal-A6EF3RUY.js} +10 -10
- package/{agentSlice-VD3BAJAU.js → agentSlice-ARTDF6VD.js} +1 -1
- package/{appDeleteCommands-LSIIQFYN.js → appDeleteCommands-V2B7ZCLC.js} +10 -10
- package/{appDeployCommands-VYGKN7HU.js → appDeployCommands-AXQU44RD.js} +10 -10
- package/{appDeployStatusCommands-ODFHFUR7.js → appDeployStatusCommands-FWGSC2UM.js} +10 -10
- package/{appGetCommands-DPQY67UZ.js → appGetCommands-67R3RFZK.js} +10 -10
- package/{appListCommands-EFXENXWX.js → appListCommands-TTASJPGV.js} +10 -10
- package/{authCommand-WLWOEVYI.js → authCommand-QOPOEYEK.js} +7 -7
- package/{chatQueueReduxAdapter-N5432EP2.js → chatQueueReduxAdapter-6CAHUQ4O.js} +7 -7
- package/{chunk-Y7TGWSUN.js → chunk-56W233KG.js} +1 -1
- package/{chunk-C2WF2OY7.js → chunk-5WADL4O7.js} +1 -1
- package/{chunk-7M72YPM2.js → chunk-6SMMK7MD.js} +2 -2
- package/{chunk-4ZL2KBI7.js → chunk-757BGY6Y.js} +1 -1
- package/{chunk-IERBSHMR.js → chunk-AVKUDHJO.js} +3 -3
- package/{chunk-VKSBVRGP.js → chunk-CVT7L2WZ.js} +1 -1
- package/{chunk-MCX2LX27.js → chunk-EURF2SV6.js} +11 -11
- package/{chunk-7GRFFW7R.js → chunk-EXDR5D6X.js} +3 -3
- package/{chunk-AZ6DT2UD.js → chunk-GBADO3SM.js} +1 -1
- package/{chunk-XB7ACJFH.js → chunk-GDGIEGHV.js} +2 -2
- package/{chunk-QDNFRWAX.js → chunk-GFD7TIZU.js} +2 -2
- package/{chunk-QAG4ZQZ7.js → chunk-GFUOVFQA.js} +1 -1
- package/{chunk-RPO6WAZV.js → chunk-HCMFFI2G.js} +2 -2
- package/{chunk-4YAMAMNA.js → chunk-HPZL4IBN.js} +11 -10
- package/{chunk-S3HB4CQY.js → chunk-IKSFDJXB.js} +112 -19
- package/{chunk-W3RZLXMA.js → chunk-IKTHA3JH.js} +2 -2
- package/{chunk-VZGLZTG7.js → chunk-IRJVFYOH.js} +255 -79
- package/{chunk-6L6UPZNH.js → chunk-K524MUQC.js} +8 -8
- package/{chunk-HMMOAG2I.js → chunk-NN3AMBY3.js} +7 -4
- package/{chunk-BO3YFOZR.js → chunk-QDHZCAH3.js} +1 -1
- package/{chunk-33BBDA67.js → chunk-QUCSAM43.js} +106 -34
- package/{chunk-Z7A54NFZ.js → chunk-RU5D3B22.js} +1 -1
- package/{chunk-JBL24PK6.js → chunk-SP3DPVBH.js} +2 -2
- package/{chunk-F22JQTSX.js → chunk-SW7RCUGA.js} +2 -2
- package/{chunk-3YVCM5PE.js → chunk-U5Z7LFZF.js} +1 -1
- package/{chunk-OZ4JNDIL.js → chunk-UQWFIWHX.js} +1 -1
- package/{chunk-AV4Z57LV.js → chunk-VRJUIUIY.js} +2 -2
- package/{chunk-72COHDZR.js → chunk-WKOEOQCI.js} +13 -13
- package/{chunk-VFN256RI.js → chunk-WL3UOGYO.js} +25 -0
- package/{chunk-5JXRVJAC.js → chunk-WX5E6HZS.js} +3 -3
- package/{createAgentAutomationAction-IHKV53QC.js → createAgentAutomationAction-7BBF5YXN.js} +8 -8
- package/{createDialogAction-4ARDCKPP.js → createDialogAction-B5URPHP4.js} +9 -9
- package/{createPageAction-GQOCPICU.js → createPageAction-ISJKM5Q3.js} +8 -8
- package/{dialogCommands-YOTCP26N.js → dialogCommands-XHH4MVA4.js} +10 -10
- package/{dialogSlice-NX26W623.js → dialogSlice-NRAN5X7F.js} +7 -7
- package/{docCreateCommands-JVAMHES4.js → docCreateCommands-FUN2Z7HQ.js} +10 -10
- package/{docDeleteCommands-LW5DWICT.js → docDeleteCommands-OZDPFXPF.js} +10 -10
- package/{docReadCommands-AQOZS3I5.js → docReadCommands-FIPK7LE3.js} +10 -10
- package/{docStore-YAE7GYHZ.js → docStore-LUS7SWC3.js} +9 -9
- package/{docUpdateCommands-FFGGX5RG.js → docUpdateCommands-BZ5GKAN4.js} +10 -10
- package/{getPricing-JNOCWYDH.js → getPricing-HAU62AFM.js} +3 -3
- package/{handleSendMessageAction-7YKH4UBI.js → handleSendMessageAction-RA4OD2ZH.js} +7 -7
- package/index.js +47 -47
- package/{machineCommands-X7YMGFMB.js → machineCommands-WDAYEFBE.js} +22 -22
- package/{machineWsRunDispatch-KWWJ4HTI.js → machineWsRunDispatch-TPQ2FQVS.js} +22 -22
- package/{models-N4NXQ44D.js → models-4QF4BJVY.js} +2 -2
- package/package.json +1 -1
- package/{readlineWorkspace-GEZVQ7IM.js → readlineWorkspace-HN44KGIF.js} +198 -96
- package/{runAgentClientLoop-6NCW5AS6.js → runAgentClientLoop-ZYUI22EA.js} +17 -17
- package/{spaceCommands-7MJVL4XR.js → spaceCommands-OJ2567D4.js} +10 -10
- package/{spaceSlice-JVVDCGA3.js → spaceSlice-F7JCOZEF.js} +8 -8
- package/{streamAgentChatTurn-UAKCHWFN.js → streamAgentChatTurn-FNFMMGNN.js} +20 -20
- package/{tools-ROUITGAR.js → tools-QCDR3UMD.js} +12 -12
- package/{tuiSummaryLlmCaller-U4EGD2SX.js → tuiSummaryLlmCaller-LCGT62QC.js} +5 -5
- package/{updateDialogTitleAction-R4M6ZXCX.js → updateDialogTitleAction-Y3OGJWDB.js} +8 -8
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
providerHttpFailure,
|
|
8
8
|
readSseFrames,
|
|
9
9
|
throwIfChatCompletionStreamFailed
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-GDGIEGHV.js";
|
|
11
11
|
import {
|
|
12
12
|
FRESH_TOOL_OUTPUT_MAX_CHARS,
|
|
13
13
|
MAX_HISTORICAL_TOOL_CONTENT_CHARS,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
resolveHistoricalToolContentCap,
|
|
18
18
|
resolveToolOutputProfile,
|
|
19
19
|
stripImagePartsFromMessages
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-CVT7L2WZ.js";
|
|
21
21
|
import {
|
|
22
22
|
sanitizeForOutbound
|
|
23
23
|
} from "./chunk-T27IEBNQ.js";
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
requiresBareImageUrl,
|
|
37
37
|
resolveToolGuidedSections,
|
|
38
38
|
toBareImageUrlMessages
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-NN3AMBY3.js";
|
|
40
40
|
import {
|
|
41
41
|
convertMessagesToResponsesInput,
|
|
42
42
|
extractReasoningFromResponseOutput,
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
import {
|
|
51
51
|
buildProviderAuthHeaders,
|
|
52
52
|
buildProviderExecutionPlan
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-SP3DPVBH.js";
|
|
54
54
|
import {
|
|
55
55
|
NOLO_WORKSPACE_TOOL_NAMES,
|
|
56
56
|
buildNoloWorkspaceCommandArgs,
|
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
resolveEmptyAssistantFallbackMessage,
|
|
70
70
|
resolveEmptyAssistantOutcome,
|
|
71
71
|
resolveTruncatedReasoningTailLog
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-SW7RCUGA.js";
|
|
73
73
|
import {
|
|
74
74
|
COMPACTION_SUMMARY_SCHEMA_VERSION,
|
|
75
75
|
COMPACTION_SUMMARY_SYSTEM_PROMPT,
|
|
@@ -174,6 +174,26 @@ function readTitleParams(value) {
|
|
|
174
174
|
return Object.fromEntries(entries);
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
+
// packages/agent-runtime/fileWritePolicy.ts
|
|
178
|
+
function evaluateFileWritePolicy(args) {
|
|
179
|
+
if (args.sessionApproved) return { permissionDecision: "allow" };
|
|
180
|
+
return {
|
|
181
|
+
permissionDecision: "ask",
|
|
182
|
+
permissionRequest: {
|
|
183
|
+
id: "permission-file-write-session",
|
|
184
|
+
tool: args.tool,
|
|
185
|
+
action: "file_write",
|
|
186
|
+
title: "\u786E\u8BA4\u5199\u5165\u6587\u4EF6",
|
|
187
|
+
body: `\u672C\u4F1A\u8BDD\u9996\u6B21\u5199\u5165\u6587\u4EF6\uFF1A${args.path}\u3002\u6279\u51C6\u540E\u672C\u4F1A\u8BDD\u540E\u7EED\u5199\u5165\u4E0D\u518D\u9010\u6B21\u786E\u8BA4\u3002`,
|
|
188
|
+
command: args.path,
|
|
189
|
+
suggestedRule: {
|
|
190
|
+
scope: "session",
|
|
191
|
+
pattern: { capability: "file_write", target: "session" }
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
|
|
177
197
|
// packages/agent-runtime/toolCallPairing.ts
|
|
178
198
|
function readToolCallId(message) {
|
|
179
199
|
if (typeof message.tool_call_id === "string" && message.tool_call_id) {
|
|
@@ -1540,6 +1560,41 @@ function applyPersistedTurnInput(messages, persistedInput, persistedInputReferen
|
|
|
1540
1560
|
};
|
|
1541
1561
|
});
|
|
1542
1562
|
}
|
|
1563
|
+
var fileWriteSessionApproval = /* @__PURE__ */ new WeakMap();
|
|
1564
|
+
var fileWriteSessionKeys = /* @__PURE__ */ new Map();
|
|
1565
|
+
function getFileWriteSessionApproval(input) {
|
|
1566
|
+
if (input.fileWriteSessionId) {
|
|
1567
|
+
let key2 = fileWriteSessionKeys.get(input.fileWriteSessionId);
|
|
1568
|
+
if (!key2) {
|
|
1569
|
+
key2 = {};
|
|
1570
|
+
fileWriteSessionKeys.set(input.fileWriteSessionId, key2);
|
|
1571
|
+
}
|
|
1572
|
+
const existing2 = fileWriteSessionApproval.get(key2);
|
|
1573
|
+
if (existing2) return existing2;
|
|
1574
|
+
const created2 = { approved: false };
|
|
1575
|
+
fileWriteSessionApproval.set(key2, created2);
|
|
1576
|
+
return created2;
|
|
1577
|
+
}
|
|
1578
|
+
const key = input.adapter;
|
|
1579
|
+
const existing = fileWriteSessionApproval.get(key);
|
|
1580
|
+
if (existing) return existing;
|
|
1581
|
+
const created = { approved: false };
|
|
1582
|
+
fileWriteSessionApproval.set(key, created);
|
|
1583
|
+
return created;
|
|
1584
|
+
}
|
|
1585
|
+
function readToolPathForWriteGate(argumentsValue) {
|
|
1586
|
+
try {
|
|
1587
|
+
const parsed = JSON.parse(argumentsValue);
|
|
1588
|
+
return typeof parsed.path === "string" && parsed.path.trim() ? parsed.path.trim() : "the requested file";
|
|
1589
|
+
} catch {
|
|
1590
|
+
return "the requested file";
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
function isCompletedActionGateResult(value) {
|
|
1594
|
+
return Boolean(
|
|
1595
|
+
value && typeof value === "object" && value.status === "completed"
|
|
1596
|
+
);
|
|
1597
|
+
}
|
|
1543
1598
|
async function runLocalAgentTurn(input) {
|
|
1544
1599
|
const agentConfig = await input.adapter.loadAgentConfig(input.agentRef);
|
|
1545
1600
|
if (!agentConfig) {
|
|
@@ -1865,25 +1920,62 @@ ${reasoningTailLog}
|
|
|
1865
1920
|
}
|
|
1866
1921
|
);
|
|
1867
1922
|
try {
|
|
1868
|
-
const
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1923
|
+
const writeTool = toolName === "writeFile" || toolName === "editFile";
|
|
1924
|
+
if (writeTool && input.onActionGate) {
|
|
1925
|
+
const writeSession = getFileWriteSessionApproval(input);
|
|
1926
|
+
const policy = evaluateFileWritePolicy({
|
|
1927
|
+
tool: toolName,
|
|
1928
|
+
path: readToolPathForWriteGate(toolCall.function.arguments),
|
|
1929
|
+
sessionApproved: writeSession.approved
|
|
1930
|
+
});
|
|
1931
|
+
if (policy.permissionDecision === "ask") {
|
|
1932
|
+
const gate = {
|
|
1933
|
+
...policy.permissionRequest,
|
|
1934
|
+
id: `${policy.permissionRequest.id}-${toolCall.id}`,
|
|
1935
|
+
kind: "confirm",
|
|
1936
|
+
toolName,
|
|
1937
|
+
toolCallId: toolCall.id
|
|
1938
|
+
};
|
|
1939
|
+
const replacement = await raceWithAbort(
|
|
1940
|
+
input,
|
|
1941
|
+
input.onActionGate(gate),
|
|
1942
|
+
`${toolName} confirmation`
|
|
1943
|
+
);
|
|
1944
|
+
const gateResult = replacement?.metadata?.actionGateResult;
|
|
1945
|
+
if (replacement !== void 0 && isCompletedActionGateResult(gateResult)) {
|
|
1946
|
+
writeSession.approved = true;
|
|
1947
|
+
} else {
|
|
1948
|
+
toolResult = replacement ?? {
|
|
1949
|
+
content: `${toolName} cancelled: user declined file write confirmation.`,
|
|
1950
|
+
metadata: {
|
|
1951
|
+
cancelled: true,
|
|
1952
|
+
actionGateResult: { gateId: gate.id, status: "cancelled" }
|
|
1953
|
+
}
|
|
1954
|
+
};
|
|
1955
|
+
}
|
|
1956
|
+
}
|
|
1957
|
+
}
|
|
1958
|
+
if (!toolResult) {
|
|
1959
|
+
const executePromise = input.adapter.executeTool({
|
|
1960
|
+
id: toolCall.id,
|
|
1961
|
+
name: toolName,
|
|
1962
|
+
arguments: toolCall.function.arguments,
|
|
1963
|
+
...userInputText ? { userInput: userInputText } : {},
|
|
1964
|
+
...input.runtimeContext ? { runtimeContext: input.runtimeContext } : {},
|
|
1965
|
+
...input.abortSignal ? { abortSignal: input.abortSignal } : {}
|
|
1966
|
+
}, {
|
|
1967
|
+
...input.abortSignal ? { abortSignal: input.abortSignal } : {},
|
|
1968
|
+
...input.runtimeContext ? { runtimeContext: input.runtimeContext } : {}
|
|
1969
|
+
});
|
|
1970
|
+
toolResult = await raceWithAbort(input, executePromise, toolName);
|
|
1971
|
+
}
|
|
1880
1972
|
const actionGate = buildActionGate({
|
|
1881
1973
|
toolName,
|
|
1882
1974
|
toolCallId: toolCall.id,
|
|
1883
1975
|
metadata: toolResult.metadata
|
|
1884
1976
|
});
|
|
1885
1977
|
if (actionGate && input.onActionGate) {
|
|
1886
|
-
const replacement = await input.onActionGate(actionGate);
|
|
1978
|
+
const replacement = await raceWithAbort(input, input.onActionGate(actionGate), `${toolName} action gate`);
|
|
1887
1979
|
if (replacement) {
|
|
1888
1980
|
toolResult = replacement;
|
|
1889
1981
|
}
|
|
@@ -1899,7 +1991,7 @@ ${reasoningTailLog}
|
|
|
1899
1991
|
toolCallId: toolCall.id,
|
|
1900
1992
|
toolName,
|
|
1901
1993
|
atMs: finishedAt,
|
|
1902
|
-
ok: true,
|
|
1994
|
+
ok: toolResult.metadata?.cancelled !== true && toolResult.metadata?.actionGateResult?.status !== "cancelled" && toolResult.metadata?.actionGateResult?.status !== "failed",
|
|
1903
1995
|
elapsedMs: Math.max(0, finishedAt - startedAt),
|
|
1904
1996
|
...summary ? { summary } : {},
|
|
1905
1997
|
...safeMetadata ? { metadata: safeMetadata } : {}
|
|
@@ -6950,6 +7042,7 @@ Available skills: ${available.join(", ")}`;
|
|
|
6950
7042
|
export {
|
|
6951
7043
|
readCommandActionGatePayload,
|
|
6952
7044
|
readActionGate,
|
|
7045
|
+
evaluateFileWritePolicy,
|
|
6953
7046
|
summarizeToolArguments,
|
|
6954
7047
|
LOCAL_AGENT_CONFIG_MISSING_CODE,
|
|
6955
7048
|
LOCAL_TURN_ABORTED_CODE,
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
} from "./chunk-AGGIDPCZ.js";
|
|
7
7
|
import {
|
|
8
8
|
getModelConfig
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QDHZCAH3.js";
|
|
10
10
|
import {
|
|
11
11
|
isPlatformHostedImageModel
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-WL3UOGYO.js";
|
|
13
13
|
import {
|
|
14
14
|
asOptionalFiniteNumber
|
|
15
15
|
} from "./chunk-WWC7I6TA.js";
|