nolo-cli 0.225.0-alpha.1 → 0.226.0-alpha.2
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-L5VHAXSU.js → _executeModel-IKZGZZXW.js} +13 -13
- package/{agentDeleteCommand-4WC7INCX.js → agentDeleteCommand-IZY3VF5F.js} +12 -12
- package/{agentEmailCommands-3XFR6WY7.js → agentEmailCommands-YWL567CL.js} +13 -13
- package/{agentListCommands-BBCP5XYW.js → agentListCommands-YBNOQ5T3.js} +2 -2
- package/{agentMachineCommands-YZDCOLQL.js → agentMachineCommands-AXJ4A772.js} +1 -1
- package/{agentRecordCommands-KLYKI4Z7.js → agentRecordCommands-WUUC2CX7.js} +13 -13
- package/{agentRunCommand-NHYBV4G5.js → agentRunCommand-W6MDKVLJ.js} +13 -13
- package/{agentRunControl-7A2FOXIJ.js → agentRunControl-DFEEOFC7.js} +2 -2
- package/{agentSlice-O6IGTM3Y.js → agentSlice-5F5U5X2U.js} +1 -1
- package/{chunk-XQBIZRGW.js → chunk-2COEG5ZV.js} +2 -2
- package/{chunk-IUD7YR3B.js → chunk-4AMQZTE7.js} +1 -1
- package/{chunk-YI5CDUJD.js → chunk-6O5YP6FX.js} +2 -2
- package/{chunk-KDAGMRDA.js → chunk-AZQZ5XPM.js} +1 -1
- package/{chunk-K44HIUBX.js → chunk-BLSNUIZD.js} +3 -3
- package/{chunk-F3YK7KIU.js → chunk-BYH3HMUP.js} +2 -2
- package/{chunk-XZGQ6ZCV.js → chunk-E5EIYI34.js} +2 -2
- package/{chunk-LS2MGTUS.js → chunk-EFX3Q5SM.js} +2 -2
- package/{chunk-HOK3ILHA.js → chunk-EJU6WCDH.js} +9 -9
- package/{chunk-WQEMD4Z4.js → chunk-F7DU25CE.js} +1 -1
- package/{chunk-TZEP5J4A.js → chunk-GBUDWITV.js} +382 -8
- package/{chunk-Z6USB65D.js → chunk-HHL7WG65.js} +2 -2
- package/{chunk-YXMBJ7UH.js → chunk-JHRQXQ4A.js} +1 -1
- package/{chunk-WG2LFJYB.js → chunk-L4NFXFFF.js} +2 -2
- package/{chunk-P25E3CKY.js → chunk-NEKH3XDV.js} +2 -2
- package/{chunk-652XYZGP.js → chunk-OLMJR6UM.js} +5 -0
- package/{chunk-JCK3EFZS.js → chunk-QTMIHVLE.js} +6 -6
- package/{chunk-7XS4W5KP.js → chunk-RRVQ446B.js} +6 -6
- package/{chunk-EOJZGQAE.js → chunk-T3T57NVP.js} +2 -2
- package/{chunk-AMEOV5VZ.js → chunk-VQUWV3YR.js} +32 -32
- package/{chunk-FNDSBM4J.js → chunk-W772FYAQ.js} +10 -10
- package/{chunk-ZRAARRA3.js → chunk-WSJMT3FA.js} +16 -16
- package/{commandRegistry-HJDPQSQ4.js → commandRegistry-6EQXVODF.js} +28 -28
- package/{contentThunks-I6OR5ENG.js → contentThunks-ANUP57QV.js} +3 -3
- package/{createAgentAutomationAction-7BCCTWO5.js → createAgentAutomationAction-XMUWUDKQ.js} +3 -3
- package/{createDialogAction-CU27KSCJ.js → createDialogAction-43QJIQDH.js} +4 -4
- package/{createPageAction-CWRTEYVA.js → createPageAction-SJO7UC3J.js} +4 -4
- package/{dialogCommands-OPTRZWTE.js → dialogCommands-V5IYEOQP.js} +3 -3
- package/{dialogSlice-XODSLDHY.js → dialogSlice-FQ6WOKWJ.js} +2 -2
- package/{docStore-TVN4SNVE.js → docStore-BZ2O7WLF.js} +1 -1
- package/{handleSendMessageAction-NSEMVHWX.js → handleSendMessageAction-I5J7QR7K.js} +9 -9
- package/{hostCredentialCreate-WBZY7DZB.js → hostCredentialCreate-AVPMK7EQ.js} +13 -13
- package/index.js +3 -3
- package/{localRuntimeAdapter-OAIWERFA.js → localRuntimeAdapter-S56R76HN.js} +12 -12
- package/{machineCommands-OI37ZUQ4.js → machineCommands-77NFB2AE.js} +13 -13
- package/{machineWsRunDispatch-73HKPV6D.js → machineWsRunDispatch-5XWFUJ53.js} +13 -13
- package/package.json +1 -1
- package/{projectArchive-GVEARCOG.js → projectArchive-GNOSYH6F.js} +4 -4
- package/{readlineWorkspace-5DWUGNSU.js → readlineWorkspace-2PONGBUP.js} +3426 -3440
- package/{runAgentClientLoop-RDXIPF34.js → runAgentClientLoop-WEXFFHVS.js} +11 -11
- package/{streamAgentChatTurn-XEYQZPDJ.js → streamAgentChatTurn-D2WFS5MF.js} +14 -14
- package/{tools-6DFTHCFX.js → tools-YKE6PQHT.js} +8 -8
- package/{updateDialogTitleAction-AMSBV2H7.js → updateDialogTitleAction-D5NCA4FC.js} +3 -3
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
withholdIfSecretLike,
|
|
50
50
|
wrapLocalCommandWorkspaceObservation,
|
|
51
51
|
writeUsage
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-WSJMT3FA.js";
|
|
53
53
|
import {
|
|
54
54
|
clearCredentialAvailability,
|
|
55
55
|
readEffectiveCredentialEntry
|
|
@@ -113,21 +113,21 @@ import {
|
|
|
113
113
|
} from "./chunk-BMQ2MJUK.js";
|
|
114
114
|
import {
|
|
115
115
|
resolveCliLocalRuntimeKeyCapability
|
|
116
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-EJU6WCDH.js";
|
|
117
117
|
import {
|
|
118
118
|
isTransientFetchError
|
|
119
119
|
} from "./chunk-KFHREHUQ.js";
|
|
120
120
|
import {
|
|
121
121
|
parseUiCard,
|
|
122
122
|
uiCardFallback
|
|
123
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-T3T57NVP.js";
|
|
124
124
|
import {
|
|
125
125
|
isGatewayHttpStatus
|
|
126
126
|
} from "./chunk-NF64D32W.js";
|
|
127
127
|
import {
|
|
128
128
|
buildMemorySubjectsForAgent,
|
|
129
129
|
resolveAgentMemoryPolicy
|
|
130
|
-
} from "./chunk-
|
|
130
|
+
} from "./chunk-HHL7WG65.js";
|
|
131
131
|
import {
|
|
132
132
|
chooseMemoryOwners,
|
|
133
133
|
loadMemoryCandidatesFromDb,
|
|
@@ -142,7 +142,7 @@ import {
|
|
|
142
142
|
resolveAgentContextWindow,
|
|
143
143
|
resolveOccupancy,
|
|
144
144
|
resolveOccupancyWindow
|
|
145
|
-
} from "./chunk-
|
|
145
|
+
} from "./chunk-W772FYAQ.js";
|
|
146
146
|
import {
|
|
147
147
|
isCliAuthorityBrokerProtocolError,
|
|
148
148
|
isCliAuthorityBrokerTimeoutError,
|
|
@@ -259,7 +259,7 @@ import {
|
|
|
259
259
|
serverOriginForDialog,
|
|
260
260
|
settleRunTerminalAuthoritatively,
|
|
261
261
|
spawnLocalBackgroundRun
|
|
262
|
-
} from "./chunk-
|
|
262
|
+
} from "./chunk-F7DU25CE.js";
|
|
263
263
|
import {
|
|
264
264
|
formatAgentListCard,
|
|
265
265
|
formatFinishedRunCard,
|
|
@@ -270,7 +270,7 @@ import {
|
|
|
270
270
|
formatStopRunCard,
|
|
271
271
|
getAgentRunStatusIcon,
|
|
272
272
|
isAgentRunTerminalStatus
|
|
273
|
-
} from "./chunk-
|
|
273
|
+
} from "./chunk-VQUWV3YR.js";
|
|
274
274
|
import {
|
|
275
275
|
QUOTA_ERROR_PATTERNS,
|
|
276
276
|
isQuotaExhaustedError
|
|
@@ -8768,6 +8768,374 @@ function resolveHistoryViewportHeight(terminalRows, composerRows, foregroundRese
|
|
|
8768
8768
|
return Math.max(0, rows - composer - reserved);
|
|
8769
8769
|
}
|
|
8770
8770
|
|
|
8771
|
+
// packages/cli/tui/shellCommandGist.ts
|
|
8772
|
+
function baseName(path2) {
|
|
8773
|
+
const cleaned = path2.replace(/^['"]|['"]$/g, "").replace(/\/+$/, "");
|
|
8774
|
+
if (!cleaned || cleaned === "." || cleaned === "..") return void 0;
|
|
8775
|
+
const parts = cleaned.split("/").filter(Boolean);
|
|
8776
|
+
const base = parts.pop();
|
|
8777
|
+
return base || void 0;
|
|
8778
|
+
}
|
|
8779
|
+
function splitSegments(command) {
|
|
8780
|
+
const segments = [];
|
|
8781
|
+
let current = "";
|
|
8782
|
+
let quote = null;
|
|
8783
|
+
let hasFallback = false;
|
|
8784
|
+
for (let i = 0; i < command.length; i++) {
|
|
8785
|
+
const ch = command[i];
|
|
8786
|
+
const next = command[i + 1];
|
|
8787
|
+
if (quote) {
|
|
8788
|
+
if (ch === "\\" && next && quote === '"') {
|
|
8789
|
+
current += ch + next;
|
|
8790
|
+
i++;
|
|
8791
|
+
continue;
|
|
8792
|
+
}
|
|
8793
|
+
current += ch;
|
|
8794
|
+
if (ch === quote) quote = null;
|
|
8795
|
+
continue;
|
|
8796
|
+
}
|
|
8797
|
+
if (ch === '"' || ch === "'") {
|
|
8798
|
+
quote = ch;
|
|
8799
|
+
current += ch;
|
|
8800
|
+
continue;
|
|
8801
|
+
}
|
|
8802
|
+
if (ch === "\\" && next) {
|
|
8803
|
+
current += ch + next;
|
|
8804
|
+
i++;
|
|
8805
|
+
continue;
|
|
8806
|
+
}
|
|
8807
|
+
if (ch === "&" && next === "&") {
|
|
8808
|
+
const trimmed = current.trim();
|
|
8809
|
+
if (trimmed) segments.push(trimmed);
|
|
8810
|
+
current = "";
|
|
8811
|
+
i++;
|
|
8812
|
+
continue;
|
|
8813
|
+
}
|
|
8814
|
+
if (ch === "|" && next === "|") {
|
|
8815
|
+
hasFallback = true;
|
|
8816
|
+
current = "";
|
|
8817
|
+
i++;
|
|
8818
|
+
continue;
|
|
8819
|
+
}
|
|
8820
|
+
if (ch === ";") {
|
|
8821
|
+
const trimmed = current.trim();
|
|
8822
|
+
if (trimmed) segments.push(trimmed);
|
|
8823
|
+
current = "";
|
|
8824
|
+
continue;
|
|
8825
|
+
}
|
|
8826
|
+
current += ch;
|
|
8827
|
+
}
|
|
8828
|
+
const tail = current.trim();
|
|
8829
|
+
if (tail) segments.push(tail);
|
|
8830
|
+
return { segments, hasFallback };
|
|
8831
|
+
}
|
|
8832
|
+
function stripEnvAssignments(segment) {
|
|
8833
|
+
let rest = segment;
|
|
8834
|
+
while (/^[A-Za-z_][A-Za-z0-9_]*=\S*\s+/.test(rest)) {
|
|
8835
|
+
rest = rest.replace(/^[A-Za-z_][A-Za-z0-9_]*=\S*\s+/, "");
|
|
8836
|
+
}
|
|
8837
|
+
return rest;
|
|
8838
|
+
}
|
|
8839
|
+
function firstVerbToken(segment) {
|
|
8840
|
+
let rest = stripEnvAssignments(segment).trim();
|
|
8841
|
+
const wrappers = /* @__PURE__ */ new Set(["sudo", "env", "command", "time", "nohup", "exec"]);
|
|
8842
|
+
let guard = 0;
|
|
8843
|
+
while (guard++ < 5) {
|
|
8844
|
+
const before = rest;
|
|
8845
|
+
rest = stripEnvAssignments(rest).trim();
|
|
8846
|
+
const m = rest.match(/^(\S+)\s*(.*)$/s);
|
|
8847
|
+
if (!m) return { verb: "", rest: "" };
|
|
8848
|
+
const [, word, restAfter] = m;
|
|
8849
|
+
if (wrappers.has(word) && restAfter.trim()) {
|
|
8850
|
+
rest = restAfter.trim();
|
|
8851
|
+
continue;
|
|
8852
|
+
}
|
|
8853
|
+
if (before !== rest && !rest) return { verb: "", rest: "" };
|
|
8854
|
+
return { verb: word.replace(/^.*\//, ""), rest: restAfter.trim() };
|
|
8855
|
+
}
|
|
8856
|
+
return { verb: "", rest };
|
|
8857
|
+
}
|
|
8858
|
+
function classifySegment(segment) {
|
|
8859
|
+
const { verb, rest } = firstVerbToken(segment);
|
|
8860
|
+
if (!verb) return null;
|
|
8861
|
+
switch (verb) {
|
|
8862
|
+
case "cd":
|
|
8863
|
+
return { verb: "\u8FDB\u5165\u76EE\u5F55", target: baseName(rest) };
|
|
8864
|
+
case "mkdir":
|
|
8865
|
+
return { verb: "\u5EFA\u76EE\u5F55", target: baseName(rest.replace(/^-\S+\s+/, "")) };
|
|
8866
|
+
case "cp":
|
|
8867
|
+
return { verb: "\u590D\u5236", target: baseName(rest.split(/\s+/).pop() ?? "") };
|
|
8868
|
+
case "mv":
|
|
8869
|
+
return { verb: "\u79FB\u52A8", target: baseName(rest.split(/\s+/).pop() ?? "") };
|
|
8870
|
+
case "rm":
|
|
8871
|
+
return { verb: "\u5220\u9664", target: baseName(rest.split(/\s+/).pop() ?? "") };
|
|
8872
|
+
case "touch":
|
|
8873
|
+
return { verb: "\u521B\u5EFA\u6587\u4EF6", target: baseName(rest) };
|
|
8874
|
+
case "cat":
|
|
8875
|
+
return { verb: "\u8BFB\u53D6", target: baseName(rest.split(/\s+/)[0] ?? "") };
|
|
8876
|
+
case "ls":
|
|
8877
|
+
return { verb: "\u5217\u51FA\u76EE\u5F55" };
|
|
8878
|
+
case "grep":
|
|
8879
|
+
case "rg":
|
|
8880
|
+
return { verb: "\u641C\u7D22" };
|
|
8881
|
+
case "chmod":
|
|
8882
|
+
return { verb: "\u6539\u6743\u9650", target: baseName(rest.split(/\s+/).pop() ?? "") };
|
|
8883
|
+
case "chown":
|
|
8884
|
+
return { verb: "\u6539\u5C5E\u4E3B", target: baseName(rest.split(/\s+/).pop() ?? "") };
|
|
8885
|
+
case "tar":
|
|
8886
|
+
case "unzip":
|
|
8887
|
+
return { verb: "\u89E3\u538B" };
|
|
8888
|
+
case "git": {
|
|
8889
|
+
const rawTokens = rest.split(/\s+/).filter(Boolean);
|
|
8890
|
+
const subIndex = rawTokens.findIndex((t2) => !t2.startsWith("-"));
|
|
8891
|
+
const sub = subIndex >= 0 ? rawTokens[subIndex] : "";
|
|
8892
|
+
if (sub === "checkout") {
|
|
8893
|
+
const args = rawTokens.slice(subIndex + 1);
|
|
8894
|
+
const looksLikePath = args.some(
|
|
8895
|
+
(t2) => t2 === "." || t2 === "--" || t2.includes("/") || t2.endsWith("*")
|
|
8896
|
+
);
|
|
8897
|
+
if (looksLikePath) return null;
|
|
8898
|
+
}
|
|
8899
|
+
const gitVerbs = {
|
|
8900
|
+
clone: "\u514B\u9686\u4ED3\u5E93",
|
|
8901
|
+
status: "\u67E5\u72B6\u6001",
|
|
8902
|
+
add: "\u6682\u5B58\u6539\u52A8",
|
|
8903
|
+
commit: "\u63D0\u4EA4",
|
|
8904
|
+
push: "\u63A8\u9001",
|
|
8905
|
+
pull: "\u62C9\u53D6",
|
|
8906
|
+
fetch: "\u6293\u53D6\u8FDC\u7AEF",
|
|
8907
|
+
checkout: "\u5207\u6362\u5206\u652F",
|
|
8908
|
+
switch: "\u5207\u6362\u5206\u652F",
|
|
8909
|
+
merge: "\u5408\u5E76",
|
|
8910
|
+
rebase: "\u53D8\u57FA",
|
|
8911
|
+
log: "\u67E5\u5386\u53F2",
|
|
8912
|
+
diff: "\u770B\u5DEE\u5F02",
|
|
8913
|
+
worktree: "\u7BA1\u7406\u5DE5\u4F5C\u533A",
|
|
8914
|
+
branch: "\u7BA1\u7406\u5206\u652F",
|
|
8915
|
+
stash: "\u6682\u5B58",
|
|
8916
|
+
reset: "\u91CD\u7F6E",
|
|
8917
|
+
restore: "\u6062\u590D\u6587\u4EF6"
|
|
8918
|
+
};
|
|
8919
|
+
const mapped = gitVerbs[sub];
|
|
8920
|
+
return mapped ? { verb: mapped } : null;
|
|
8921
|
+
}
|
|
8922
|
+
case "sed": {
|
|
8923
|
+
const replaceCount = (rest.match(/s[|/#][^|/#]*[|/#][^|/#]*[|/#]/g) ?? []).length;
|
|
8924
|
+
const tokens2 = rest.split(/\s+/).filter((t2) => t2 && !t2.startsWith("-"));
|
|
8925
|
+
const fileToken = [...tokens2].reverse().find((t2) => !/[|/#]/.test(t2));
|
|
8926
|
+
return {
|
|
8927
|
+
verb: "\u7F16\u8F91",
|
|
8928
|
+
target: baseName(fileToken ?? ""),
|
|
8929
|
+
count: replaceCount > 1 ? replaceCount : void 0,
|
|
8930
|
+
unit: "\u5904\u66FF\u6362"
|
|
8931
|
+
};
|
|
8932
|
+
}
|
|
8933
|
+
case "dnf":
|
|
8934
|
+
case "yum": {
|
|
8935
|
+
const sub = rest.split(/\s+/)[0] ?? "";
|
|
8936
|
+
if (sub === "install") return { verb: "\u88C5\u8F6F\u4EF6\u5305" };
|
|
8937
|
+
if (sub === "remove" || sub === "erase") return { verb: "\u5378\u8F7D\u8F6F\u4EF6\u5305" };
|
|
8938
|
+
if (sub === "update" || sub === "upgrade") return { verb: "\u66F4\u65B0\u7CFB\u7EDF" };
|
|
8939
|
+
if (sub === "search") return { verb: "\u641C\u7D22\u8F6F\u4EF6\u5305" };
|
|
8940
|
+
if (sub === "list") return { verb: "\u5217\u51FA\u8F6F\u4EF6\u5305" };
|
|
8941
|
+
if (sub === "history") return { verb: "\u67E5\u5B89\u88C5\u5386\u53F2" };
|
|
8942
|
+
return null;
|
|
8943
|
+
}
|
|
8944
|
+
case "rpm":
|
|
8945
|
+
case "pacman":
|
|
8946
|
+
case "apt":
|
|
8947
|
+
case "apt-get":
|
|
8948
|
+
return { verb: "\u7BA1\u8F6F\u4EF6\u5305" };
|
|
8949
|
+
case "systemctl":
|
|
8950
|
+
case "journalctl": {
|
|
8951
|
+
const tokens2 = rest.split(/\s+/).filter((t2) => t2 && !t2.startsWith("-"));
|
|
8952
|
+
const sub = tokens2[0] ?? "";
|
|
8953
|
+
if (verb === "journalctl") return { verb: "\u67E5\u65E5\u5FD7" };
|
|
8954
|
+
const sysVerbs = {
|
|
8955
|
+
start: "\u542F\u52A8\u670D\u52A1",
|
|
8956
|
+
stop: "\u505C\u6B62\u670D\u52A1",
|
|
8957
|
+
restart: "\u91CD\u542F\u670D\u52A1",
|
|
8958
|
+
status: "\u67E5\u670D\u52A1\u72B6\u6001",
|
|
8959
|
+
enable: "\u542F\u7528\u670D\u52A1",
|
|
8960
|
+
disable: "\u505C\u7528\u670D\u52A1",
|
|
8961
|
+
"daemon-reload": "\u91CD\u8F7D\u670D\u52A1\u914D\u7F6E",
|
|
8962
|
+
"list-units": "\u5217\u670D\u52A1",
|
|
8963
|
+
"list-unit-files": "\u5217\u670D\u52A1",
|
|
8964
|
+
is: "\u67E5\u670D\u52A1\u72B6\u6001",
|
|
8965
|
+
cat: "\u770B\u670D\u52A1\u5B9A\u4E49"
|
|
8966
|
+
};
|
|
8967
|
+
const mapped = sysVerbs[sub];
|
|
8968
|
+
return mapped ? { verb: mapped } : null;
|
|
8969
|
+
}
|
|
8970
|
+
case "awk":
|
|
8971
|
+
return { verb: "\u5904\u7406\u6587\u672C" };
|
|
8972
|
+
case "find": {
|
|
8973
|
+
if (/(?:^|\s)(?:-delete|-exec|-execdir|-ok|-okdir)(?:\s|$)/.test(rest)) return null;
|
|
8974
|
+
return { verb: "\u67E5\u627E\u6587\u4EF6" };
|
|
8975
|
+
}
|
|
8976
|
+
case "curl":
|
|
8977
|
+
case "wget":
|
|
8978
|
+
return { verb: "\u4E0B\u8F7D" };
|
|
8979
|
+
case "bun":
|
|
8980
|
+
case "npm":
|
|
8981
|
+
case "pnpm":
|
|
8982
|
+
case "yarn": {
|
|
8983
|
+
const tokens2 = rest.split(/\s+/).filter(Boolean);
|
|
8984
|
+
const sub = tokens2[0] ?? "";
|
|
8985
|
+
if (sub === "test") {
|
|
8986
|
+
const target = tokens2.slice(1).find((t2) => !t2.startsWith("-"));
|
|
8987
|
+
return { verb: "\u8DD1\u6D4B\u8BD5", target: target ? baseName(target) : void 0 };
|
|
8988
|
+
}
|
|
8989
|
+
if (sub === "install" || sub === "i" || sub === "add") return { verb: "\u88C5\u4F9D\u8D56" };
|
|
8990
|
+
if (sub === "run") {
|
|
8991
|
+
const script = tokens2[1];
|
|
8992
|
+
return { verb: "\u8DD1\u811A\u672C", target: script };
|
|
8993
|
+
}
|
|
8994
|
+
if (sub === "build") return { verb: "\u6784\u5EFA" };
|
|
8995
|
+
if (sub === "x" || sub === "exec") {
|
|
8996
|
+
return { verb: "\u6267\u884C", target: tokens2[1] };
|
|
8997
|
+
}
|
|
8998
|
+
return null;
|
|
8999
|
+
}
|
|
9000
|
+
case "node":
|
|
9001
|
+
case "python":
|
|
9002
|
+
case "python3":
|
|
9003
|
+
case "bash":
|
|
9004
|
+
case "sh":
|
|
9005
|
+
case "zsh": {
|
|
9006
|
+
if (/(?:^|\s)-[A-Za-z]*[ce](?:\s|$)/.test(rest)) return null;
|
|
9007
|
+
const script = rest.split(/\s+/).find((t2) => t2 && !t2.startsWith("-"));
|
|
9008
|
+
return { verb: "\u6267\u884C\u811A\u672C", target: baseName(script ?? "") };
|
|
9009
|
+
}
|
|
9010
|
+
case "echo":
|
|
9011
|
+
case "printf":
|
|
9012
|
+
return { verb: "\u8F93\u51FA" };
|
|
9013
|
+
case "head":
|
|
9014
|
+
case "tail":
|
|
9015
|
+
case "wc":
|
|
9016
|
+
case "sort":
|
|
9017
|
+
case "uniq":
|
|
9018
|
+
return { verb: "\u67E5\u770B\u8F93\u51FA" };
|
|
9019
|
+
default:
|
|
9020
|
+
return null;
|
|
9021
|
+
}
|
|
9022
|
+
}
|
|
9023
|
+
function summarizeActions(actions) {
|
|
9024
|
+
const cds = actions.filter((a) => a.verb === "\u8FDB\u5165\u76EE\u5F55");
|
|
9025
|
+
const body = actions.filter((a) => a.verb !== "\u8FDB\u5165\u76EE\u5F55");
|
|
9026
|
+
const merged = [];
|
|
9027
|
+
for (const action of body) {
|
|
9028
|
+
const last = merged[merged.length - 1];
|
|
9029
|
+
if (last && last.verb === action.verb && last.target === action.target) {
|
|
9030
|
+
last.count = (last.count ?? 1) + (action.count ?? 1);
|
|
9031
|
+
continue;
|
|
9032
|
+
}
|
|
9033
|
+
merged.push({ ...action });
|
|
9034
|
+
}
|
|
9035
|
+
const renderOne = (a) => {
|
|
9036
|
+
if (a.count && a.count > 1) {
|
|
9037
|
+
const suffix = a.unit ?? (a.verb === "\u590D\u5236" || a.verb === "\u79FB\u52A8" || a.verb === "\u5220\u9664" ? "\u4E2A\u6587\u4EF6" : "\u9879");
|
|
9038
|
+
const head = a.unit && a.target ? `${a.verb} ${a.target}` : a.verb;
|
|
9039
|
+
return `${head} ${a.count} ${suffix}`;
|
|
9040
|
+
}
|
|
9041
|
+
return a.target ? `${a.verb} ${a.target}` : a.verb;
|
|
9042
|
+
};
|
|
9043
|
+
const parts = merged.map(renderOne);
|
|
9044
|
+
const cdPart = cds.length > 0 && cds[0].target ? `\u8FDB\u5165 ${cds[0].target}` : "";
|
|
9045
|
+
const joined = parts.length > 0 ? parts.join("\u3001") : "";
|
|
9046
|
+
if (cdPart && joined) return `${cdPart}\uFF1A${joined}`;
|
|
9047
|
+
return cdPart || joined;
|
|
9048
|
+
}
|
|
9049
|
+
var PIPELINE_FILTER_COMMANDS = /* @__PURE__ */ new Set([
|
|
9050
|
+
"head",
|
|
9051
|
+
"tail",
|
|
9052
|
+
"cat",
|
|
9053
|
+
"wc",
|
|
9054
|
+
"sort",
|
|
9055
|
+
"uniq",
|
|
9056
|
+
"cut",
|
|
9057
|
+
"tr",
|
|
9058
|
+
"nl",
|
|
9059
|
+
"column",
|
|
9060
|
+
"grep",
|
|
9061
|
+
"rg",
|
|
9062
|
+
"ag",
|
|
9063
|
+
"ack",
|
|
9064
|
+
"jq",
|
|
9065
|
+
"less",
|
|
9066
|
+
"more",
|
|
9067
|
+
"bat",
|
|
9068
|
+
"awk",
|
|
9069
|
+
"sed"
|
|
9070
|
+
]);
|
|
9071
|
+
function hasNonFilterPipeline(command) {
|
|
9072
|
+
let quote = null;
|
|
9073
|
+
for (let i = 0; i < command.length; i++) {
|
|
9074
|
+
const ch = command[i];
|
|
9075
|
+
const next = command[i + 1];
|
|
9076
|
+
if (quote) {
|
|
9077
|
+
if (ch === "\\" && next && quote === '"') {
|
|
9078
|
+
i++;
|
|
9079
|
+
continue;
|
|
9080
|
+
}
|
|
9081
|
+
if (ch === quote) quote = null;
|
|
9082
|
+
continue;
|
|
9083
|
+
}
|
|
9084
|
+
if (ch === '"' || ch === "'") {
|
|
9085
|
+
quote = ch;
|
|
9086
|
+
continue;
|
|
9087
|
+
}
|
|
9088
|
+
if (ch === "\\" && next) {
|
|
9089
|
+
i++;
|
|
9090
|
+
continue;
|
|
9091
|
+
}
|
|
9092
|
+
if (ch === "|" && next !== "|" && command[i - 1] !== "|") {
|
|
9093
|
+
const afterPipe = command.slice(i + 1).trimStart();
|
|
9094
|
+
const m = afterPipe.match(/^(\S+)\s*(.*)$/s);
|
|
9095
|
+
if (!m) return true;
|
|
9096
|
+
let word = m[1].replace(/^.*\//, "");
|
|
9097
|
+
let restAfter = m[2];
|
|
9098
|
+
let guard = 0;
|
|
9099
|
+
while (guard++ < 4) {
|
|
9100
|
+
if (word === "sudo") {
|
|
9101
|
+
const opt = restAfter.match(/^(?:-\S+\s+)*(\S+)\s*(.*)$/s);
|
|
9102
|
+
if (!opt) return true;
|
|
9103
|
+
word = opt[1].replace(/^.*\//, "");
|
|
9104
|
+
restAfter = opt[2];
|
|
9105
|
+
continue;
|
|
9106
|
+
}
|
|
9107
|
+
if (word === "env" || word === "xargs") {
|
|
9108
|
+
const nxt = restAfter.match(/^(?:[A-Za-z_]\w*=\S*\s+|-\S+\s+)*(\S+)\s*(.*)$/s);
|
|
9109
|
+
if (!nxt) return true;
|
|
9110
|
+
word = nxt[1].replace(/^.*\//, "");
|
|
9111
|
+
restAfter = nxt[2];
|
|
9112
|
+
continue;
|
|
9113
|
+
}
|
|
9114
|
+
break;
|
|
9115
|
+
}
|
|
9116
|
+
if (!PIPELINE_FILTER_COMMANDS.has(word)) return true;
|
|
9117
|
+
}
|
|
9118
|
+
}
|
|
9119
|
+
return false;
|
|
9120
|
+
}
|
|
9121
|
+
function summarizeShellCommand(command) {
|
|
9122
|
+
const normalized = command.split(/\r?\n/).map((line) => line.replace(/\s+/g, " ").trim()).filter(Boolean).join(" && ");
|
|
9123
|
+
if (!normalized) return null;
|
|
9124
|
+
if (hasNonFilterPipeline(normalized)) return null;
|
|
9125
|
+
const { segments, hasFallback } = splitSegments(normalized);
|
|
9126
|
+
if (segments.length === 0) return null;
|
|
9127
|
+
if (hasFallback) return null;
|
|
9128
|
+
const actions = [];
|
|
9129
|
+
for (const segment of segments) {
|
|
9130
|
+
const action = classifySegment(segment);
|
|
9131
|
+
if (!action) return null;
|
|
9132
|
+
actions.push(action);
|
|
9133
|
+
}
|
|
9134
|
+
const summary = summarizeActions(actions);
|
|
9135
|
+
if (!summary) return null;
|
|
9136
|
+
return { summary, foldedSegments: segments.length };
|
|
9137
|
+
}
|
|
9138
|
+
|
|
8771
9139
|
// node_modules/diff/libesm/diff/base.js
|
|
8772
9140
|
var Diff = class {
|
|
8773
9141
|
diff(oldStr, newStr, options = {}) {
|
|
@@ -9723,6 +10091,8 @@ function normalToolGistRaw(event) {
|
|
|
9723
10091
|
if (isRunToolName(toolName)) {
|
|
9724
10092
|
const command2 = typeof metadata.command === "string" ? metadata.command : "";
|
|
9725
10093
|
if (command2) {
|
|
10094
|
+
const gist = summarizeShellCommand(command2);
|
|
10095
|
+
if (gist) return truncateByDisplayWidth(redactSecrets(gist.summary), normalRunGistMaxWidth());
|
|
9726
10096
|
return commandFullGist(command2, normalRunGistMaxWidth());
|
|
9727
10097
|
}
|
|
9728
10098
|
}
|
|
@@ -9731,7 +10101,11 @@ function normalToolGistRaw(event) {
|
|
|
9731
10101
|
const path2 = typeof metadata.path === "string" ? metadata.path : "";
|
|
9732
10102
|
if (path2) return pathBasenameGist(path2);
|
|
9733
10103
|
const command = typeof metadata.command === "string" ? metadata.command : "";
|
|
9734
|
-
if (command)
|
|
10104
|
+
if (command) {
|
|
10105
|
+
const gist = summarizeShellCommand(command);
|
|
10106
|
+
if (gist) return truncateByDisplayWidth(redactSecrets(gist.summary), normalRunGistMaxWidth());
|
|
10107
|
+
return commandFullGist(command, normalRunGistMaxWidth());
|
|
10108
|
+
}
|
|
9735
10109
|
const query = typeof metadata.query === "string" ? metadata.query : "";
|
|
9736
10110
|
if (query) return clipCompactText(query, 64, "\u2026");
|
|
9737
10111
|
return "";
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
} from "./chunk-BJF2MHJ3.js";
|
|
5
5
|
import {
|
|
6
6
|
addContentToSpace
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-JHRQXQ4A.js";
|
|
8
8
|
import {
|
|
9
9
|
prepareAndPersistMessage,
|
|
10
10
|
uiAskChoiceFunc,
|
|
11
11
|
uiAskChoiceFunctionSchema
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-W772FYAQ.js";
|
|
13
13
|
import {
|
|
14
14
|
require_format
|
|
15
15
|
} from "./chunk-BUDVRYES.js";
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
clipMultilineText,
|
|
3
3
|
fetchAndSerializeTable,
|
|
4
4
|
waitForAbortableDelay
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-T3T57NVP.js";
|
|
6
6
|
import {
|
|
7
7
|
isGatewayHttpStatus
|
|
8
8
|
} from "./chunk-NF64D32W.js";
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from "./chunk-BGGHA5DV.js";
|
|
22
22
|
import {
|
|
23
23
|
fetchAndCacheMessages
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-W772FYAQ.js";
|
|
25
25
|
import {
|
|
26
26
|
createSpaceKey
|
|
27
27
|
} from "./chunk-UAD2WT54.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
fetchReferenceContents,
|
|
3
3
|
resolveReferenceAssets
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-L4NFXFFF.js";
|
|
5
5
|
import {
|
|
6
6
|
updateTokensAction
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-W772FYAQ.js";
|
|
8
8
|
import {
|
|
9
9
|
applyUpdateTokensFulfilled
|
|
10
10
|
} from "./chunk-S2NTVGA2.js";
|
|
@@ -61,7 +61,12 @@ var buildAgentSkillPreferenceDiagnostic = (input) => {
|
|
|
61
61
|
};
|
|
62
62
|
var DIAGNOSTIC_PREFIX = "[nolo.skill.diagnostics] ";
|
|
63
63
|
var seenSignatures = /* @__PURE__ */ new Set();
|
|
64
|
+
function skillDiagnosticsEnabled(env = process.env) {
|
|
65
|
+
const flag = env.NOLO_SKILL_DIAGNOSTICS?.trim();
|
|
66
|
+
return flag === "1" || flag === "true";
|
|
67
|
+
}
|
|
64
68
|
var reportAgentSkillPreferenceDiagnostic = (diagnostic, sink) => {
|
|
69
|
+
if (!sink && !skillDiagnosticsEnabled()) return false;
|
|
65
70
|
const signature = JSON.stringify(diagnostic);
|
|
66
71
|
if (seenSignatures.has(signature)) return false;
|
|
67
72
|
seenSignatures.add(signature);
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
inlineImageUrlsForCustomProvider,
|
|
6
6
|
prepareTools,
|
|
7
7
|
shouldInlineImageUrlsForAgent
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-2COEG5ZV.js";
|
|
9
9
|
import {
|
|
10
10
|
CONFIRMATION_INPUT_KEYS,
|
|
11
11
|
INVALID_TOOL_ARGS_REPLACEMENT,
|
|
@@ -14,11 +14,11 @@ import {
|
|
|
14
14
|
performFetchRequest,
|
|
15
15
|
sanitizeOutboundMessages,
|
|
16
16
|
stripModelToolArgs
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-E5EIYI34.js";
|
|
18
18
|
import {
|
|
19
19
|
findToolExecutor,
|
|
20
20
|
toolDefinitionsByName
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-EJU6WCDH.js";
|
|
22
22
|
import {
|
|
23
23
|
createSSEParser,
|
|
24
24
|
createToolRunId,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
toolRunSetPending,
|
|
28
28
|
toolRunStarted,
|
|
29
29
|
toolRunSucceeded
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-T3T57NVP.js";
|
|
31
31
|
import {
|
|
32
32
|
addToolMessage,
|
|
33
33
|
messageStreamEnd,
|
|
@@ -35,10 +35,10 @@ import {
|
|
|
35
35
|
toast,
|
|
36
36
|
toolResultNeedsUserConfirmation,
|
|
37
37
|
updateToolMessage
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-W772FYAQ.js";
|
|
39
39
|
import {
|
|
40
40
|
streamAgentChatTurn
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-BLSNUIZD.js";
|
|
42
42
|
import {
|
|
43
43
|
getCurrentSpaceId
|
|
44
44
|
} from "./chunk-MOMR7NMG.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildStaticUserPolicyContext,
|
|
3
3
|
resolveSpaceContextPreloadPlan
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OLMJR6UM.js";
|
|
5
5
|
import {
|
|
6
6
|
fetchReferenceContents,
|
|
7
7
|
mergeReferences,
|
|
8
8
|
resolveReferenceAssets,
|
|
9
9
|
resolveToolsFromKeys
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-L4NFXFFF.js";
|
|
11
11
|
import {
|
|
12
12
|
UI_CARD_ENVELOPE_MAX_BYTES,
|
|
13
13
|
getAllToolRuns,
|
|
@@ -18,21 +18,21 @@ import {
|
|
|
18
18
|
selectSpaceContextLevel,
|
|
19
19
|
selectUserTonePreset,
|
|
20
20
|
uiCardFallback
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-T3T57NVP.js";
|
|
22
22
|
import {
|
|
23
23
|
getDocState
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-BYH3HMUP.js";
|
|
25
25
|
import {
|
|
26
26
|
resolveToolBaseUrl
|
|
27
27
|
} from "./chunk-4JVNURX4.js";
|
|
28
28
|
import {
|
|
29
29
|
getTableState
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-JHRQXQ4A.js";
|
|
31
31
|
import {
|
|
32
32
|
PERSONALIZATION_DIALOG_CATEGORY,
|
|
33
33
|
buildPersonalizationDialogPolicyContext,
|
|
34
34
|
selectAllMsgs
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-W772FYAQ.js";
|
|
36
36
|
import {
|
|
37
37
|
getCurrentSpaceIdRaw,
|
|
38
38
|
getViewMode
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "./chunk-GIABSSWQ.js";
|
|
16
16
|
import {
|
|
17
17
|
fetchAndCacheTableRows
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-JHRQXQ4A.js";
|
|
19
19
|
import {
|
|
20
20
|
getActiveDialogKey
|
|
21
21
|
} from "./chunk-S2NTVGA2.js";
|
|
@@ -783,7 +783,7 @@ var executeToolRun = createAsyncThunk(
|
|
|
783
783
|
if (!executionInput) {
|
|
784
784
|
throw new Error(`ToolRun ${id} has no input to execute with.`);
|
|
785
785
|
}
|
|
786
|
-
const { findToolExecutor } = await import("./tools-
|
|
786
|
+
const { findToolExecutor } = await import("./tools-YKE6PQHT.js");
|
|
787
787
|
const { executor } = findToolExecutor(run.toolName);
|
|
788
788
|
toolRunStarted({
|
|
789
789
|
id: run.id,
|