snow-ai 0.6.22 → 0.6.23
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/bundle/cli.mjs +80 -47
- package/bundle/package.json +1 -1
- package/package.json +1 -1
package/bundle/cli.mjs
CHANGED
|
@@ -1449,7 +1449,7 @@ var require_react_development = __commonJS({
|
|
|
1449
1449
|
var dispatcher = resolveDispatcher();
|
|
1450
1450
|
return dispatcher.useCallback(callback, deps);
|
|
1451
1451
|
}
|
|
1452
|
-
function
|
|
1452
|
+
function useMemo36(create3, deps) {
|
|
1453
1453
|
var dispatcher = resolveDispatcher();
|
|
1454
1454
|
return dispatcher.useMemo(create3, deps);
|
|
1455
1455
|
}
|
|
@@ -2221,7 +2221,7 @@ var require_react_development = __commonJS({
|
|
|
2221
2221
|
exports2.useImperativeHandle = useImperativeHandle2;
|
|
2222
2222
|
exports2.useInsertionEffect = useInsertionEffect;
|
|
2223
2223
|
exports2.useLayoutEffect = useLayoutEffect2;
|
|
2224
|
-
exports2.useMemo =
|
|
2224
|
+
exports2.useMemo = useMemo36;
|
|
2225
2225
|
exports2.useReducer = useReducer8;
|
|
2226
2226
|
exports2.useRef = useRef16;
|
|
2227
2227
|
exports2.useState = useState67;
|
|
@@ -48069,11 +48069,9 @@ PLACEHOLDER_FOR_WORKFLOW_SECTION
|
|
|
48069
48069
|
- Reduces cognitive load - AI doesn't need to remember everything
|
|
48070
48070
|
- Enables recovery if conversation is interrupted
|
|
48071
48071
|
|
|
48072
|
-
**Formatting rule
|
|
48073
|
-
- TODO item content
|
|
48072
|
+
**Formatting rule:**
|
|
48073
|
+
- TODO item content should be clear and actionable
|
|
48074
48074
|
- **REQUIRED: Get existing TODOs first** - BEFORE calling todo-add, ALWAYS run todo-get (paired with an action tool in the same call) to inspect current items
|
|
48075
|
-
- **Calculate next sequence number** - Extract the highest existing numeric prefix from todo-get results, then use max(existingPrefix)+1 for new items
|
|
48076
|
-
- **Example workflow**: todo-get + filesystem-read("file.ts") \u2192 see existing "1. Read file", "2. Analyze code" \u2192 add new items starting with "3. ..."
|
|
48077
48075
|
|
|
48078
48076
|
**WHEN TO USE (Default for most work):**
|
|
48079
48077
|
- ANY task touching 2+ files
|
|
@@ -48087,8 +48085,8 @@ PLACEHOLDER_FOR_WORKFLOW_SECTION
|
|
|
48087
48085
|
- Simple queries that don't change code
|
|
48088
48086
|
|
|
48089
48087
|
**STANDARD WORKFLOW - Always Plan First:**
|
|
48090
|
-
1. **Receive task** \u2192 Run todo-get (paired with an action tool) to see current list
|
|
48091
|
-
2. **Plan** \u2192 Create TODO with todo-add (batch add all steps at once
|
|
48088
|
+
1. **Receive task** \u2192 Run todo-get (paired with an action tool) to see current list
|
|
48089
|
+
2. **Plan** \u2192 Create TODO with todo-add (batch add all steps at once)
|
|
48092
48090
|
3. **Execute** \u2192 Update progress with todo-update as each step is completed
|
|
48093
48091
|
4. **Complete** \u2192 Clean up obsolete, incorrect, or superseded items with todo-delete
|
|
48094
48092
|
|
|
@@ -48106,10 +48104,10 @@ ALWAYS pair TODO tools with action tools in same call:
|
|
|
48106
48104
|
**Examples:**
|
|
48107
48105
|
\`\`\`
|
|
48108
48106
|
User: "Fix authentication bug and add logging"
|
|
48109
|
-
AI: todo-add(content=["
|
|
48107
|
+
AI: todo-add(content=["Fix auth bug in auth.ts", "Add logging to login flow", "Test login with new logs"]) + filesystem-read("auth.ts")
|
|
48110
48108
|
|
|
48111
48109
|
User: "Refactor utils module"
|
|
48112
|
-
AI: todo-add(content=["
|
|
48110
|
+
AI: todo-add(content=["Read utils module structure", "Identify refactor targets", "Extract common functions", "Update imports", "Run tests"]) + filesystem-read("utils/")
|
|
48113
48111
|
\`\`\`
|
|
48114
48112
|
|
|
48115
48113
|
|
|
@@ -363311,6 +363309,7 @@ var init_security_utils = __esm({
|
|
|
363311
363309
|
var useTerminalExecutionState_exports = {};
|
|
363312
363310
|
__export(useTerminalExecutionState_exports, {
|
|
363313
363311
|
appendTerminalOutput: () => appendTerminalOutput,
|
|
363312
|
+
flushOutputBuffer: () => flushOutputBuffer,
|
|
363314
363313
|
registerInputCallback: () => registerInputCallback,
|
|
363315
363314
|
sendTerminalInput: () => sendTerminalInput,
|
|
363316
363315
|
setTerminalExecutionState: () => setTerminalExecutionState,
|
|
@@ -363341,6 +363340,7 @@ function useTerminalExecutionState() {
|
|
|
363341
363340
|
});
|
|
363342
363341
|
}, []);
|
|
363343
363342
|
const endExecution = (0, import_react65.useCallback)(() => {
|
|
363343
|
+
flushOutputBuffer();
|
|
363344
363344
|
setState({
|
|
363345
363345
|
isExecuting: false,
|
|
363346
363346
|
command: null,
|
|
@@ -363369,13 +363369,33 @@ function setTerminalExecutionState(state) {
|
|
|
363369
363369
|
globalSetState(state);
|
|
363370
363370
|
}
|
|
363371
363371
|
}
|
|
363372
|
+
function flushOutputBuffer() {
|
|
363373
|
+
if (outputFlushTimer) {
|
|
363374
|
+
clearTimeout(outputFlushTimer);
|
|
363375
|
+
outputFlushTimer = null;
|
|
363376
|
+
}
|
|
363377
|
+
if (outputBuffer.length === 0 || !globalSetState || !globalState) {
|
|
363378
|
+
return;
|
|
363379
|
+
}
|
|
363380
|
+
const linesToFlush = outputBuffer.splice(0, outputBuffer.length);
|
|
363381
|
+
globalSetState({
|
|
363382
|
+
...globalState,
|
|
363383
|
+
output: [...globalState.output, ...linesToFlush]
|
|
363384
|
+
});
|
|
363385
|
+
}
|
|
363372
363386
|
function appendTerminalOutput(line) {
|
|
363373
|
-
if (globalSetState
|
|
363374
|
-
|
|
363375
|
-
|
|
363376
|
-
|
|
363377
|
-
|
|
363387
|
+
if (!globalSetState || !globalState) {
|
|
363388
|
+
return;
|
|
363389
|
+
}
|
|
363390
|
+
outputBuffer.push(line);
|
|
363391
|
+
if (outputBuffer.length >= OUTPUT_BATCH_SIZE) {
|
|
363392
|
+
flushOutputBuffer();
|
|
363393
|
+
return;
|
|
363378
363394
|
}
|
|
363395
|
+
if (outputFlushTimer) {
|
|
363396
|
+
clearTimeout(outputFlushTimer);
|
|
363397
|
+
}
|
|
363398
|
+
outputFlushTimer = setTimeout(flushOutputBuffer, OUTPUT_FLUSH_DELAY);
|
|
363379
363399
|
}
|
|
363380
363400
|
function setTerminalNeedsInput(needsInput, prompt) {
|
|
363381
363401
|
if (globalSetState && globalState) {
|
|
@@ -363394,13 +363414,17 @@ function sendTerminalInput(input2) {
|
|
|
363394
363414
|
globalInputCallback(input2);
|
|
363395
363415
|
}
|
|
363396
363416
|
}
|
|
363397
|
-
var import_react65, globalSetState, globalState, globalInputCallback;
|
|
363417
|
+
var import_react65, globalSetState, globalState, outputBuffer, outputFlushTimer, OUTPUT_BATCH_SIZE, OUTPUT_FLUSH_DELAY, globalInputCallback;
|
|
363398
363418
|
var init_useTerminalExecutionState = __esm({
|
|
363399
363419
|
"dist/hooks/execution/useTerminalExecutionState.js"() {
|
|
363400
363420
|
"use strict";
|
|
363401
363421
|
import_react65 = __toESM(require_react(), 1);
|
|
363402
363422
|
globalSetState = null;
|
|
363403
363423
|
globalState = null;
|
|
363424
|
+
outputBuffer = [];
|
|
363425
|
+
outputFlushTimer = null;
|
|
363426
|
+
OUTPUT_BATCH_SIZE = 10;
|
|
363427
|
+
OUTPUT_FLUSH_DELAY = 50;
|
|
363404
363428
|
globalInputCallback = null;
|
|
363405
363429
|
}
|
|
363406
363430
|
});
|
|
@@ -363918,6 +363942,7 @@ var init_bash = __esm({
|
|
|
363918
363942
|
clearInterval(inputCheckInterval);
|
|
363919
363943
|
registerInputCallback(null);
|
|
363920
363944
|
setTerminalNeedsInput(false);
|
|
363945
|
+
flushOutputBuffer();
|
|
363921
363946
|
if (backgroundProcessId) {
|
|
363922
363947
|
const status = code2 === 0 ? "completed" : "failed";
|
|
363923
363948
|
Promise.resolve().then(() => (init_useBackgroundProcesses(), useBackgroundProcesses_exports)).then(({ updateBackgroundProcessStatus: updateBackgroundProcessStatus2 }) => {
|
|
@@ -442522,8 +442547,8 @@ This ensures efficient workflow and prevents unnecessary wait times.`,
|
|
|
442522
442547
|
},
|
|
442523
442548
|
status: {
|
|
442524
442549
|
type: "string",
|
|
442525
|
-
enum: ["pending", "completed"],
|
|
442526
|
-
description: 'New status - "pending" (not
|
|
442550
|
+
enum: ["pending", "inProgress", "completed"],
|
|
442551
|
+
description: 'New status - "pending" (not started), "inProgress" (currently working on), or "completed" (100% finished and verified)'
|
|
442527
442552
|
},
|
|
442528
442553
|
content: {
|
|
442529
442554
|
type: "string",
|
|
@@ -442540,12 +442565,6 @@ This ensures efficient workflow and prevents unnecessary wait times.`,
|
|
|
442540
442565
|
PARALLEL CALLS ONLY: MUST pair with other tools (todo-add + filesystem-read/etc).
|
|
442541
442566
|
NEVER call todo-add alone - always combine with an action tool.
|
|
442542
442567
|
|
|
442543
|
-
SEQUENCE NUMBERING - CRITICAL:
|
|
442544
|
-
- ALWAYS run todo-get FIRST (in the same parallel call) to check existing items before adding new ones
|
|
442545
|
-
- Extract the highest numeric prefix from existing TODOs, then continue from max+1
|
|
442546
|
-
- Example: If todo-get returns "1. Read file", "2. Analyze code", new items must start with "3. ..."
|
|
442547
|
-
- This prevents duplicate numbering in continuous conversations
|
|
442548
|
-
|
|
442549
442568
|
WHEN TO USE (Very common):
|
|
442550
442569
|
- Start ANY multi-step task \u2192 Create TODO list immediately
|
|
442551
442570
|
- User adds new requirements \u2192 Add tasks for new work
|
|
@@ -442553,10 +442572,7 @@ WHEN TO USE (Very common):
|
|
|
442553
442572
|
|
|
442554
442573
|
SUPPORTS BATCH ADDING:
|
|
442555
442574
|
- Single: content="Task description"
|
|
442556
|
-
- Multiple: content=["Task 1", "Task 2", "Task 3"] (recommended for multi-step work)
|
|
442557
|
-
|
|
442558
|
-
EXAMPLE (FIRST TIME): todo-add(content=["1. Read file", "2. Modify code"]) + filesystem-read("file.ts")
|
|
442559
|
-
EXAMPLE (CONTINUING): todo-get + todo-add(content=["3. Test changes", "4. Run build"])`,
|
|
442575
|
+
- Multiple: content=["Task 1", "Task 2", "Task 3"] (recommended for multi-step work)`,
|
|
442560
442576
|
inputSchema: {
|
|
442561
442577
|
type: "object",
|
|
442562
442578
|
properties: {
|
|
@@ -556682,10 +556698,19 @@ function TodoTree({ todos }) {
|
|
|
556682
556698
|
const completedCount = todos.reduce((acc, t2) => acc + (t2.status === "completed" ? 1 : 0), 0);
|
|
556683
556699
|
const sortedTodos = (0, import_react104.useMemo)(() => {
|
|
556684
556700
|
return todos.map((t2, originalIndex) => ({ t: t2, originalIndex })).slice().sort((a, b) => {
|
|
556685
|
-
const
|
|
556686
|
-
|
|
556687
|
-
|
|
556688
|
-
|
|
556701
|
+
const getPriority = (status) => {
|
|
556702
|
+
if (status === "inProgress")
|
|
556703
|
+
return 0;
|
|
556704
|
+
if (status === "pending")
|
|
556705
|
+
return 1;
|
|
556706
|
+
if (status === "completed")
|
|
556707
|
+
return 2;
|
|
556708
|
+
return 1;
|
|
556709
|
+
};
|
|
556710
|
+
const aPriority = getPriority(a.t.status);
|
|
556711
|
+
const bPriority = getPriority(b.t.status);
|
|
556712
|
+
if (aPriority !== bPriority)
|
|
556713
|
+
return aPriority - bPriority;
|
|
556689
556714
|
return a.originalIndex - b.originalIndex;
|
|
556690
556715
|
}).map(({ t: t2 }) => t2);
|
|
556691
556716
|
}, [todos]);
|
|
@@ -556702,10 +556727,18 @@ function TodoTree({ todos }) {
|
|
|
556702
556727
|
const visibleTodos = sortedTodos.slice(pageIndex * PAGE_SIZE2, pageIndex * PAGE_SIZE2 + PAGE_SIZE2);
|
|
556703
556728
|
const hiddenCount = Math.max(0, sortedTodos.length - visibleTodos.length);
|
|
556704
556729
|
const getStatusIcon = (status) => {
|
|
556705
|
-
|
|
556730
|
+
if (status === "completed")
|
|
556731
|
+
return "\u2713";
|
|
556732
|
+
if (status === "inProgress")
|
|
556733
|
+
return "~";
|
|
556734
|
+
return "\u25CB";
|
|
556706
556735
|
};
|
|
556707
556736
|
const getStatusColor = (status) => {
|
|
556708
|
-
|
|
556737
|
+
if (status === "completed")
|
|
556738
|
+
return theme14.colors.success;
|
|
556739
|
+
if (status === "inProgress")
|
|
556740
|
+
return theme14.colors.warning;
|
|
556741
|
+
return theme14.colors.menuSecondary;
|
|
556709
556742
|
};
|
|
556710
556743
|
const renderTodoLine = (todo, index) => {
|
|
556711
556744
|
const statusIcon = getStatusIcon(todo.status);
|
|
@@ -558094,11 +558127,7 @@ var init_AskUserQuestion = __esm({
|
|
|
558094
558127
|
|
|
558095
558128
|
// dist/ui/components/bash/BashCommandConfirmation.js
|
|
558096
558129
|
function sanitizePreviewLine(text3) {
|
|
558097
|
-
|
|
558098
|
-
const withoutAnsi = withoutOsc.replace(/\x1B\[[0-?]*[ -/]*[@-~]/g, "");
|
|
558099
|
-
const withoutControls = withoutAnsi.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g, "");
|
|
558100
|
-
const withoutTabs = withoutControls.replace(/\t/g, " ");
|
|
558101
|
-
return withoutTabs.replace(/[\s\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]+$/g, "").trim();
|
|
558130
|
+
return text3.replace(/\x1B\][^\x07]*(?:\x07|\x1B\\)/g, "").replace(/\x1B\[[0-?]*[ -/]*[@-~]/g, "").replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g, "").replace(/\t/g, " ").replace(/[\s\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]+$/g, "").trim();
|
|
558102
558131
|
}
|
|
558103
558132
|
function truncateCommand2(text3, maxWidth = 100) {
|
|
558104
558133
|
if (text3.length <= maxWidth) {
|
|
@@ -558267,13 +558296,16 @@ function BashCommandExecutionStatus({ command, timeout: timeout2 = 3e4, terminal
|
|
|
558267
558296
|
}
|
|
558268
558297
|
};
|
|
558269
558298
|
}, []);
|
|
558270
|
-
const
|
|
558271
|
-
|
|
558272
|
-
|
|
558273
|
-
|
|
558274
|
-
|
|
558275
|
-
|
|
558276
|
-
|
|
558299
|
+
const processedOutput = (0, import_react112.useMemo)(() => {
|
|
558300
|
+
const omittedCount = Math.max(0, totalCommittedLineCountRef.current - maxOutputLines);
|
|
558301
|
+
const visibleOutputLines = omittedCount > 0 ? displayOutputLines.slice(-(maxOutputLines - 1)) : displayOutputLines.slice(-maxOutputLines);
|
|
558302
|
+
const rawProcessedOutput = omittedCount > 0 ? [...visibleOutputLines, `... (${omittedCount} lines omitted)`] : visibleOutputLines;
|
|
558303
|
+
const output3 = [...rawProcessedOutput];
|
|
558304
|
+
while (output3.length < maxOutputLines) {
|
|
558305
|
+
output3.unshift("");
|
|
558306
|
+
}
|
|
558307
|
+
return output3;
|
|
558308
|
+
}, [displayOutputLines, maxOutputLines]);
|
|
558277
558309
|
const handleInputSubmit = (value) => {
|
|
558278
558310
|
sendTerminalInput(value);
|
|
558279
558311
|
setInputValue("");
|
|
@@ -558297,7 +558329,7 @@ function BashCommandExecutionStatus({ command, timeout: timeout2 = 3e4, terminal
|
|
|
558297
558329
|
{ paddingLeft: 2 },
|
|
558298
558330
|
import_react112.default.createElement(Text, { dimColor: true, wrap: "truncate" }, displayCommand)
|
|
558299
558331
|
),
|
|
558300
|
-
import_react112.default.createElement(Box_default, { flexDirection: "column", paddingLeft: 2, marginTop: 1, height: maxOutputLines }, processedOutput.map((line, index) => import_react112.default.createElement(Text, { key: index, wrap: "truncate", dimColor: true }, truncateText2(
|
|
558332
|
+
import_react112.default.createElement(Box_default, { flexDirection: "column", paddingLeft: 2, marginTop: 1, height: maxOutputLines }, processedOutput.map((line, index) => import_react112.default.createElement(Text, { key: index, wrap: "truncate", dimColor: true }, truncateText2(line, maxCommandWidth)))),
|
|
558301
558333
|
needsInput && import_react112.default.createElement(
|
|
558302
558334
|
Box_default,
|
|
558303
558335
|
{ flexDirection: "column", marginTop: 1, paddingLeft: 2 },
|
|
@@ -564804,6 +564836,7 @@ function formatTodoContext(todos) {
|
|
|
564804
564836
|
}
|
|
564805
564837
|
const statusSymbol = {
|
|
564806
564838
|
pending: "[ ]",
|
|
564839
|
+
inProgress: "[~]",
|
|
564807
564840
|
completed: "[x]"
|
|
564808
564841
|
};
|
|
564809
564842
|
const lines = [
|
package/bundle/package.json
CHANGED