iosm-cli 0.2.14 → 0.2.16
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/CHANGELOG.md +50 -0
- package/README.md +18 -1
- package/dist/cli/args.d.ts +2 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +16 -3
- package/dist/cli/args.js.map +1 -1
- package/dist/core/agent-profiles.d.ts.map +1 -1
- package/dist/core/agent-profiles.js +3 -0
- package/dist/core/agent-profiles.js.map +1 -1
- package/dist/core/agent-session.d.ts +2 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +26 -10
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/agent-teams.d.ts.map +1 -1
- package/dist/core/agent-teams.js +12 -9
- package/dist/core/agent-teams.js.map +1 -1
- package/dist/core/checkpoint/fs-checkpoint.d.ts +14 -0
- package/dist/core/checkpoint/fs-checkpoint.d.ts.map +1 -0
- package/dist/core/checkpoint/fs-checkpoint.js +211 -0
- package/dist/core/checkpoint/fs-checkpoint.js.map +1 -0
- package/dist/core/command-dispatcher.d.ts +2 -0
- package/dist/core/command-dispatcher.d.ts.map +1 -1
- package/dist/core/command-dispatcher.js +78 -13
- package/dist/core/command-dispatcher.js.map +1 -1
- package/dist/core/mcp/cli.d.ts.map +1 -1
- package/dist/core/mcp/cli.js +26 -0
- package/dist/core/mcp/cli.js.map +1 -1
- package/dist/core/mcp/config.d.ts.map +1 -1
- package/dist/core/mcp/config.js +55 -0
- package/dist/core/mcp/config.js.map +1 -1
- package/dist/core/mcp/index.d.ts +1 -1
- package/dist/core/mcp/index.d.ts.map +1 -1
- package/dist/core/mcp/index.js.map +1 -1
- package/dist/core/mcp/runtime.d.ts +3 -1
- package/dist/core/mcp/runtime.d.ts.map +1 -1
- package/dist/core/mcp/runtime.js +21 -2
- package/dist/core/mcp/runtime.js.map +1 -1
- package/dist/core/mcp/types.d.ts +30 -2
- package/dist/core/mcp/types.d.ts.map +1 -1
- package/dist/core/mcp/types.js.map +1 -1
- package/dist/core/package-manager.d.ts +10 -0
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +100 -2
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/policy/engine.d.ts +77 -0
- package/dist/core/policy/engine.d.ts.map +1 -0
- package/dist/core/policy/engine.js +614 -0
- package/dist/core/policy/engine.js.map +1 -0
- package/dist/core/policy/index.d.ts +2 -0
- package/dist/core/policy/index.d.ts.map +1 -0
- package/dist/core/policy/index.js +2 -0
- package/dist/core/policy/index.js.map +1 -0
- package/dist/core/sandbox/executor.d.ts +13 -0
- package/dist/core/sandbox/executor.d.ts.map +1 -0
- package/dist/core/sandbox/executor.js +64 -0
- package/dist/core/sandbox/executor.js.map +1 -0
- package/dist/core/sdk.d.ts +2 -2
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +3 -3
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/security/index.d.ts +3 -0
- package/dist/core/security/index.d.ts.map +1 -0
- package/dist/core/security/index.js +3 -0
- package/dist/core/security/index.js.map +1 -0
- package/dist/core/security/source-security.d.ts +43 -0
- package/dist/core/security/source-security.d.ts.map +1 -0
- package/dist/core/security/source-security.js +94 -0
- package/dist/core/security/source-security.js.map +1 -0
- package/dist/core/security/trust-ledger.d.ts +24 -0
- package/dist/core/security/trust-ledger.d.ts.map +1 -0
- package/dist/core/security/trust-ledger.js +66 -0
- package/dist/core/security/trust-ledger.js.map +1 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +128 -15
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +6 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +22 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +9 -2
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/task-plan.d.ts +1 -0
- package/dist/core/task-plan.d.ts.map +1 -1
- package/dist/core/task-plan.js +103 -0
- package/dist/core/task-plan.js.map +1 -1
- package/dist/core/tools/apply-patch.d.ts +29 -0
- package/dist/core/tools/apply-patch.d.ts.map +1 -0
- package/dist/core/tools/apply-patch.js +167 -0
- package/dist/core/tools/apply-patch.js.map +1 -0
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +15 -1
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/git-common.d.ts.map +1 -1
- package/dist/core/tools/git-common.js +15 -1
- package/dist/core/tools/git-common.js.map +1 -1
- package/dist/core/tools/index.d.ts +20 -2
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +85 -25
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/permissions.d.ts +16 -0
- package/dist/core/tools/permissions.d.ts.map +1 -1
- package/dist/core/tools/permissions.js +34 -1
- package/dist/core/tools/permissions.js.map +1 -1
- package/dist/core/tools/task.d.ts.map +1 -1
- package/dist/core/tools/task.js +68 -24
- package/dist/core/tools/task.js.map +1 -1
- package/dist/core/tools/tool-search.d.ts +24 -0
- package/dist/core/tools/tool-search.d.ts.map +1 -0
- package/dist/core/tools/tool-search.js +85 -0
- package/dist/core/tools/tool-search.js.map +1 -0
- package/dist/core/tools/tool-suggest.d.ts +18 -0
- package/dist/core/tools/tool-suggest.d.ts.map +1 -0
- package/dist/core/tools/tool-suggest.js +94 -0
- package/dist/core/tools/tool-suggest.js.map +1 -0
- package/dist/core/tools/verification-runner.d.ts.map +1 -1
- package/dist/core/tools/verification-runner.js +15 -1
- package/dist/core/tools/verification-runner.js.map +1 -1
- package/dist/core/unified-exec.d.ts +39 -0
- package/dist/core/unified-exec.d.ts.map +1 -0
- package/dist/core/unified-exec.js +286 -0
- package/dist/core/unified-exec.js.map +1 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +93 -11
- package/dist/main.js.map +1 -1
- package/dist/modes/acp/acp-mode.d.ts +17 -0
- package/dist/modes/acp/acp-mode.d.ts.map +1 -0
- package/dist/modes/acp/acp-mode.js +352 -0
- package/dist/modes/acp/acp-mode.js.map +1 -0
- package/dist/modes/index.d.ts +2 -1
- package/dist/modes/index.d.ts.map +1 -1
- package/dist/modes/index.js +1 -0
- package/dist/modes/index.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +217 -0
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +8 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +159 -72
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +25 -1
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +33 -0
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts +13 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +189 -28
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +54 -1
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/modes/telegram/telegram-bridge-mode.js +51 -22
- package/dist/modes/telegram/telegram-bridge-mode.js.map +1 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +96 -9
- package/dist/utils/tools-manager.js.map +1 -1
- package/docs/README.md +2 -0
- package/docs/acp-rpc-mapping.md +38 -0
- package/docs/configuration.generated.md +81 -0
- package/docs/configuration.md +7 -0
- package/package.json +4 -1
|
@@ -50,6 +50,169 @@ function str(value) {
|
|
|
50
50
|
return "";
|
|
51
51
|
return null; // Invalid type
|
|
52
52
|
}
|
|
53
|
+
function normalizeChecklistStatus(value) {
|
|
54
|
+
if (typeof value !== "string")
|
|
55
|
+
return "pending";
|
|
56
|
+
const token = value.trim().toLowerCase().replace(/[\s-]+/g, "_");
|
|
57
|
+
switch (token) {
|
|
58
|
+
case "done":
|
|
59
|
+
case "complete":
|
|
60
|
+
case "completed":
|
|
61
|
+
case "success":
|
|
62
|
+
case "checked":
|
|
63
|
+
case "x":
|
|
64
|
+
return "done";
|
|
65
|
+
case "in_progress":
|
|
66
|
+
case "inprogress":
|
|
67
|
+
case "active":
|
|
68
|
+
case "current":
|
|
69
|
+
case "doing":
|
|
70
|
+
return "in_progress";
|
|
71
|
+
case "blocked":
|
|
72
|
+
case "waiting":
|
|
73
|
+
case "on_hold":
|
|
74
|
+
case "paused":
|
|
75
|
+
return "blocked";
|
|
76
|
+
default:
|
|
77
|
+
return "pending";
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function buildChecklistItem(value) {
|
|
81
|
+
if (typeof value === "string") {
|
|
82
|
+
const title = value.trim();
|
|
83
|
+
if (!title)
|
|
84
|
+
return undefined;
|
|
85
|
+
return { title, status: "pending" };
|
|
86
|
+
}
|
|
87
|
+
if (!value || typeof value !== "object") {
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
const candidate = value;
|
|
91
|
+
const title = (typeof candidate.subject === "string" && candidate.subject.trim()) ||
|
|
92
|
+
(typeof candidate.title === "string" && candidate.title.trim()) ||
|
|
93
|
+
(typeof candidate.step === "string" && candidate.step.trim()) ||
|
|
94
|
+
(typeof candidate.text === "string" && candidate.text.trim()) ||
|
|
95
|
+
(typeof candidate.description === "string" && candidate.description.trim()) ||
|
|
96
|
+
undefined;
|
|
97
|
+
if (!title)
|
|
98
|
+
return undefined;
|
|
99
|
+
const id = typeof candidate.id === "string" && candidate.id.trim() ? candidate.id.trim() : undefined;
|
|
100
|
+
const activeForm = typeof candidate.activeForm === "string" && candidate.activeForm.trim()
|
|
101
|
+
? candidate.activeForm.trim()
|
|
102
|
+
: undefined;
|
|
103
|
+
if (typeof candidate.completed === "boolean") {
|
|
104
|
+
return {
|
|
105
|
+
id,
|
|
106
|
+
title,
|
|
107
|
+
status: candidate.completed ? "done" : "pending",
|
|
108
|
+
activeForm,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
id,
|
|
113
|
+
title,
|
|
114
|
+
status: normalizeChecklistStatus(candidate.status),
|
|
115
|
+
activeForm,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
function parseChecklistMarkdown(markdown) {
|
|
119
|
+
const lines = markdown
|
|
120
|
+
.split(/\r?\n/g)
|
|
121
|
+
.map((line) => line.trim())
|
|
122
|
+
.filter((line) => line.length > 0);
|
|
123
|
+
const items = [];
|
|
124
|
+
for (const line of lines) {
|
|
125
|
+
const checklistMatch = line.match(/^(?:[-*]|\d+[.)])\s*\[([^\]]+)\]\s+(.+)$/) ?? line.match(/^\[([^\]]+)\]\s+(.+)$/);
|
|
126
|
+
if (checklistMatch) {
|
|
127
|
+
const title = checklistMatch[2]?.trim();
|
|
128
|
+
if (!title)
|
|
129
|
+
continue;
|
|
130
|
+
items.push({
|
|
131
|
+
title,
|
|
132
|
+
status: normalizeChecklistStatus(checklistMatch[1]),
|
|
133
|
+
});
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
const bulletMatch = line.match(/^(?:[-*]|\d+[.)])\s+(.+)$/);
|
|
137
|
+
if (!bulletMatch)
|
|
138
|
+
continue;
|
|
139
|
+
const title = bulletMatch[1]?.trim();
|
|
140
|
+
if (!title)
|
|
141
|
+
continue;
|
|
142
|
+
items.push({
|
|
143
|
+
title,
|
|
144
|
+
status: "pending",
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
return items;
|
|
148
|
+
}
|
|
149
|
+
function extractChecklistItems(value) {
|
|
150
|
+
if (typeof value === "string") {
|
|
151
|
+
return parseChecklistMarkdown(value);
|
|
152
|
+
}
|
|
153
|
+
if (!Array.isArray(value)) {
|
|
154
|
+
return [];
|
|
155
|
+
}
|
|
156
|
+
return value.map((item) => buildChecklistItem(item)).filter((item) => !!item);
|
|
157
|
+
}
|
|
158
|
+
function countChecklistByStatus(items) {
|
|
159
|
+
const counts = { done: 0, inProgress: 0, pending: 0, blocked: 0 };
|
|
160
|
+
for (const item of items) {
|
|
161
|
+
if (item.status === "done") {
|
|
162
|
+
counts.done += 1;
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
if (item.status === "in_progress") {
|
|
166
|
+
counts.inProgress += 1;
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
if (item.status === "blocked") {
|
|
170
|
+
counts.blocked += 1;
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
counts.pending += 1;
|
|
174
|
+
}
|
|
175
|
+
return counts;
|
|
176
|
+
}
|
|
177
|
+
function checklistStatusMarker(status) {
|
|
178
|
+
switch (status) {
|
|
179
|
+
case "done":
|
|
180
|
+
return "✓";
|
|
181
|
+
case "in_progress":
|
|
182
|
+
return "→";
|
|
183
|
+
case "blocked":
|
|
184
|
+
return "!";
|
|
185
|
+
case "pending":
|
|
186
|
+
default:
|
|
187
|
+
return "•";
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
function styleChecklistMarker(status, marker) {
|
|
191
|
+
switch (status) {
|
|
192
|
+
case "done":
|
|
193
|
+
return theme.fg("success", marker);
|
|
194
|
+
case "in_progress":
|
|
195
|
+
return theme.fg("accent", marker);
|
|
196
|
+
case "blocked":
|
|
197
|
+
return theme.fg("warning", marker);
|
|
198
|
+
case "pending":
|
|
199
|
+
default:
|
|
200
|
+
return theme.fg("muted", marker);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
function checklistStatusLabel(status) {
|
|
204
|
+
switch (status) {
|
|
205
|
+
case "done":
|
|
206
|
+
return "done";
|
|
207
|
+
case "in_progress":
|
|
208
|
+
return "in progress";
|
|
209
|
+
case "blocked":
|
|
210
|
+
return "blocked";
|
|
211
|
+
case "pending":
|
|
212
|
+
default:
|
|
213
|
+
return "pending";
|
|
214
|
+
}
|
|
215
|
+
}
|
|
53
216
|
function hasAnsiEscape(input) {
|
|
54
217
|
return /\x1b\[[0-9;]*m/.test(input);
|
|
55
218
|
}
|
|
@@ -882,6 +1045,60 @@ export class ToolExecutionComponent extends Container {
|
|
|
882
1045
|
}
|
|
883
1046
|
}
|
|
884
1047
|
}
|
|
1048
|
+
else if (this.toolName === "todo_write" || this.toolName === "todo_read") {
|
|
1049
|
+
const isWrite = this.toolName === "todo_write";
|
|
1050
|
+
const details = this.result?.details;
|
|
1051
|
+
const tasksFromDetails = extractChecklistItems(details?.tasks);
|
|
1052
|
+
const tasksFromArgs = isWrite ? extractChecklistItems(this.args?.tasks) : [];
|
|
1053
|
+
const tasks = tasksFromDetails.length > 0 ? tasksFromDetails : tasksFromArgs;
|
|
1054
|
+
const counts = countChecklistByStatus(tasks);
|
|
1055
|
+
const summaryParts = [];
|
|
1056
|
+
if (counts.inProgress > 0)
|
|
1057
|
+
summaryParts.push(`${counts.inProgress} in progress`);
|
|
1058
|
+
if (counts.pending > 0)
|
|
1059
|
+
summaryParts.push(`${counts.pending} pending`);
|
|
1060
|
+
if (counts.done > 0)
|
|
1061
|
+
summaryParts.push(`${counts.done} done`);
|
|
1062
|
+
if (counts.blocked > 0)
|
|
1063
|
+
summaryParts.push(`${counts.blocked} blocked`);
|
|
1064
|
+
const summary = summaryParts.length > 0 ? summaryParts.join(", ") : "no tasks";
|
|
1065
|
+
const subject = isWrite ? "Update task checklist" : "Read task checklist";
|
|
1066
|
+
if (this.isPartial) {
|
|
1067
|
+
text = toolHeader("tasks", subject, "pending");
|
|
1068
|
+
}
|
|
1069
|
+
else if (this.result?.isError) {
|
|
1070
|
+
text = toolHeader("tasks", subject, "error");
|
|
1071
|
+
}
|
|
1072
|
+
else if (this.result) {
|
|
1073
|
+
text = toolHeader("tasks", theme.fg("accent", subject), "success", `(${tasks.length} total: ${summary})`);
|
|
1074
|
+
}
|
|
1075
|
+
else {
|
|
1076
|
+
text = toolHeader("tasks", subject, "pending");
|
|
1077
|
+
}
|
|
1078
|
+
if (tasks.length > 0) {
|
|
1079
|
+
const maxLines = this.expanded ? tasks.length : 10;
|
|
1080
|
+
const displayTasks = tasks.slice(0, maxLines);
|
|
1081
|
+
const remaining = tasks.length - maxLines;
|
|
1082
|
+
const lines = displayTasks.map((task) => {
|
|
1083
|
+
const marker = styleChecklistMarker(task.status, checklistStatusMarker(task.status));
|
|
1084
|
+
const idPrefix = task.id ? `${theme.fg("dim", `[${task.id}]`)} ` : "";
|
|
1085
|
+
const label = theme.fg("toolOutput", task.title);
|
|
1086
|
+
const statusSuffix = theme.fg("dim", ` (${checklistStatusLabel(task.status)})`);
|
|
1087
|
+
const activeSuffix = task.status === "in_progress" && task.activeForm ? theme.fg("muted", ` — ${task.activeForm}`) : "";
|
|
1088
|
+
return `${marker} ${idPrefix}${label}${statusSuffix}${activeSuffix}`;
|
|
1089
|
+
});
|
|
1090
|
+
text += `\n\n${lines.join("\n")}`;
|
|
1091
|
+
if (remaining > 0) {
|
|
1092
|
+
text += expandHint(remaining, tasks.length);
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
if (this.result) {
|
|
1096
|
+
const output = this.getTextOutput().trim();
|
|
1097
|
+
if (output && (tasks.length === 0 || this.result.isError)) {
|
|
1098
|
+
text += `\n\n${theme.fg(this.result.isError ? "error" : "toolOutput", output)}`;
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
885
1102
|
else {
|
|
886
1103
|
// Generic tool (shouldn't reach here for custom tools)
|
|
887
1104
|
text = theme.fg("toolTitle", theme.bold(this.toolName));
|