@nervekit/tools 0.1.0 → 0.2.0
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/execution/shell/bash.d.ts.map +1 -1
- package/dist/execution/shell/bash.js +12 -1
- package/dist/execution/shell/bash.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/catalog/orchestration/process.tools.d.ts +0 -68
- package/dist/catalog/orchestration/process.tools.d.ts.map +0 -1
- package/dist/catalog/orchestration/process.tools.js +0 -96
- package/dist/catalog/orchestration/process.tools.js.map +0 -1
- package/dist/catalog/orchestration/subagent.tools.d.ts +0 -16
- package/dist/catalog/orchestration/subagent.tools.d.ts.map +0 -1
- package/dist/catalog/orchestration/subagent.tools.js +0 -25
- package/dist/catalog/orchestration/subagent.tools.js.map +0 -1
- package/dist/definitions.d.ts +0 -2
- package/dist/definitions.d.ts.map +0 -1
- package/dist/definitions.js +0 -2
- package/dist/definitions.js.map +0 -1
- package/dist/execution/atomic-write.d.ts +0 -2
- package/dist/execution/atomic-write.d.ts.map +0 -1
- package/dist/execution/atomic-write.js +0 -7
- package/dist/execution/atomic-write.js.map +0 -1
- package/dist/execution/bash.d.ts +0 -3
- package/dist/execution/bash.d.ts.map +0 -1
- package/dist/execution/bash.js +0 -133
- package/dist/execution/bash.js.map +0 -1
- package/dist/execution/common.d.ts +0 -2
- package/dist/execution/common.d.ts.map +0 -1
- package/dist/execution/common.js +0 -6
- package/dist/execution/common.js.map +0 -1
- package/dist/execution/dispatch.d.ts +0 -4
- package/dist/execution/dispatch.d.ts.map +0 -1
- package/dist/execution/dispatch.js +0 -54
- package/dist/execution/dispatch.js.map +0 -1
- package/dist/execution/edit.d.ts +0 -9
- package/dist/execution/edit.d.ts.map +0 -1
- package/dist/execution/edit.js +0 -175
- package/dist/execution/edit.js.map +0 -1
- package/dist/execution/file-mutation-queue.d.ts +0 -2
- package/dist/execution/file-mutation-queue.d.ts.map +0 -1
- package/dist/execution/file-mutation-queue.js +0 -19
- package/dist/execution/file-mutation-queue.js.map +0 -1
- package/dist/execution/filesystem/legacy-edit.d.ts +0 -9
- package/dist/execution/filesystem/legacy-edit.d.ts.map +0 -1
- package/dist/execution/filesystem/legacy-edit.js +0 -122
- package/dist/execution/filesystem/legacy-edit.js.map +0 -1
- package/dist/execution/find.d.ts +0 -3
- package/dist/execution/find.d.ts.map +0 -1
- package/dist/execution/find.js +0 -90
- package/dist/execution/find.js.map +0 -1
- package/dist/execution/list.d.ts +0 -3
- package/dist/execution/list.d.ts.map +0 -1
- package/dist/execution/list.js +0 -46
- package/dist/execution/list.js.map +0 -1
- package/dist/execution/path.d.ts +0 -7
- package/dist/execution/path.d.ts.map +0 -1
- package/dist/execution/path.js +0 -69
- package/dist/execution/path.js.map +0 -1
- package/dist/execution/read.d.ts +0 -3
- package/dist/execution/read.d.ts.map +0 -1
- package/dist/execution/read.js +0 -97
- package/dist/execution/read.js.map +0 -1
- package/dist/execution/search-utils.d.ts +0 -8
- package/dist/execution/search-utils.d.ts.map +0 -1
- package/dist/execution/search-utils.js +0 -110
- package/dist/execution/search-utils.js.map +0 -1
- package/dist/execution/search.d.ts +0 -3
- package/dist/execution/search.d.ts.map +0 -1
- package/dist/execution/search.js +0 -131
- package/dist/execution/search.js.map +0 -1
- package/dist/execution/truncate.d.ts +0 -21
- package/dist/execution/truncate.d.ts.map +0 -1
- package/dist/execution/truncate.js +0 -94
- package/dist/execution/truncate.js.map +0 -1
- package/dist/execution/web-fetch.d.ts +0 -3
- package/dist/execution/web-fetch.d.ts.map +0 -1
- package/dist/execution/web-fetch.js +0 -132
- package/dist/execution/web-fetch.js.map +0 -1
- package/dist/execution/web-search.d.ts +0 -3
- package/dist/execution/web-search.d.ts.map +0 -1
- package/dist/execution/web-search.js +0 -59
- package/dist/execution/web-search.js.map +0 -1
- package/dist/execution/write.d.ts +0 -3
- package/dist/execution/write.d.ts.map +0 -1
- package/dist/execution/write.js +0 -21
- package/dist/execution/write.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../../src/execution/shell/bash.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../../src/execution/shell/bash.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAkBhF,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CAuH9B"}
|
|
@@ -3,6 +3,16 @@ import { numberArg } from "../common/args.js";
|
|
|
3
3
|
import { boundLiveOutputChunk } from "../common/output-budget.js";
|
|
4
4
|
import { buildProcessResult } from "../common/process-result.js";
|
|
5
5
|
const FORCE_KILL_AFTER_MS = 2000;
|
|
6
|
+
function nonInteractiveShellEnv() {
|
|
7
|
+
return {
|
|
8
|
+
...process.env,
|
|
9
|
+
PAGER: "cat",
|
|
10
|
+
GIT_PAGER: "cat",
|
|
11
|
+
GIT_TERMINAL_PROMPT: "0",
|
|
12
|
+
TERM: "dumb",
|
|
13
|
+
CI: process.env.CI ?? "1",
|
|
14
|
+
};
|
|
15
|
+
}
|
|
6
16
|
export async function executeBash(args, context) {
|
|
7
17
|
if (typeof args.command !== "string" || args.command.trim().length === 0) {
|
|
8
18
|
throw new Error("Tool argument 'command' must be a non-empty string.");
|
|
@@ -23,7 +33,8 @@ export async function executeBash(args, context) {
|
|
|
23
33
|
cwd: context.cwd,
|
|
24
34
|
shell: true,
|
|
25
35
|
detached: process.platform !== "win32",
|
|
26
|
-
env:
|
|
36
|
+
env: nonInteractiveShellEnv(),
|
|
37
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
27
38
|
});
|
|
28
39
|
let settled = false;
|
|
29
40
|
let timedOut = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bash.js","sourceRoot":"","sources":["../../../src/execution/shell/bash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAEjC,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,IAA6B,EAC7B,OAA6B;IAE7B,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzE,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IACzE,CAAC;IAED,MAAM,cAAc,GAClB,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ;QAC9B,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACzC,CAAC,CAAC,SAAS,CAAC;IAChB,MAAM,YAAY,GAAa,EAAE,CAAC;IAClC,MAAM,YAAY,GAAa,EAAE,CAAC;IAClC,MAAM,cAAc,GAAa,EAAE,CAAC;IACpC,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;IAEpC,OAAO,MAAM,IAAI,OAAO,CAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAChE,IAAI,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC;YAC5B,MAAM,CA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,EACZ,cAAc,KAAK,SAAS;oBAC1B,CAAC,CAAC,2BAA2B,cAAc,SAAS,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,gBAAgB,GAAG;oBACtG,CAAC,CAAC,SAAS;aAChB,CACF;iBACE,IAAI,CAAC,OAAO,CAAC;iBACb,KAAK,CAAC,MAAM,CAAC,CAAC;QACnB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,WAAW,CACxB,YAAsB,EACtB,YAAsB,EACtB,cAAwB,EACxB,IAAmB,EACnB,MAA6B,EAC7B,OAA2B,EAC3B,UAKI,EAAE;IAEN,OAAO,kBAAkB,CAAC;QACxB,YAAY;QACZ,YAAY;QACZ,cAAc;QACd,IAAI;QACJ,MAAM;QACN,gBAAgB,EAAE,YAAY;QAC9B,iBAAiB,EAAE,SAAS;QAC5B,OAAO;QACP,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,aAAa,EAAE,OAAO,CAAC,aAAa;QACpC,cAAc,EAAE,OAAO,CAAC,cAAc;KACvC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ToolDescriptor, ToolName, ToolRisk } from "@nervekit/shared";
|
|
2
2
|
export * from "./catalog/index.js";
|
|
3
|
-
export { appendBoundedTextNotice, type BoundedTextResult, boundContentBlocks, boundLiveOutputChunk, boundText, buildProcessResult, buildProcessTextResult, executeEdit, executeTool, FILE_OUTPUT_MAX_LINE_CHARS, LIVE_OUTPUT_MAX_BYTES, LIVE_OUTPUT_MAX_LINE_CHARS, LIVE_OUTPUT_MAX_LINES, MODEL_TEXT_MAX_BYTES, MODEL_TEXT_MAX_LINE_CHARS, MODEL_TEXT_MAX_LINES, normalizeEditArgs, PROCESS_INLINE_MAX_LINE_CHARS, type PythonRuntime, type PythonRuntimeStatus, resolvePythonRuntime, resolveToolPath, type TextBoundaryDetails, type TextBudget, ToolExecutionError, textBoundaryDetails, } from "./execution/index.js";
|
|
3
|
+
export { appendBoundedTextNotice, type BoundedTextResult, boundContentBlocks, boundLiveOutputChunk, boundText, buildProcessResult, buildProcessTextResult, executeBash, executeEdit, executeTool, FILE_OUTPUT_MAX_LINE_CHARS, LIVE_OUTPUT_MAX_BYTES, LIVE_OUTPUT_MAX_LINE_CHARS, LIVE_OUTPUT_MAX_LINES, MODEL_TEXT_MAX_BYTES, MODEL_TEXT_MAX_LINE_CHARS, MODEL_TEXT_MAX_LINES, normalizeEditArgs, PROCESS_INLINE_MAX_LINE_CHARS, type PythonRuntime, type PythonRuntimeStatus, resolvePythonRuntime, resolveToolPath, type TextBoundaryDetails, type TextBudget, ToolExecutionError, textBoundaryDetails, } from "./execution/index.js";
|
|
4
4
|
export { hasDangerousCommandPattern, hasShellControlOperator, isAllowedPlanModeBashCommand, isKnownReadOnlyCommand, isLikelyLongRunningCommand, } from "./safety/command-policy.js";
|
|
5
5
|
export * from "./types.js";
|
|
6
6
|
export declare const coreToolDescriptors: ToolDescriptor[];
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAO3E,cAAc,oBAAoB,CAAC;AACnC,OAAO,EACL,uBAAuB,EACvB,KAAK,iBAAiB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,SAAS,EACT,kBAAkB,EAClB,sBAAsB,EACtB,WAAW,EACX,WAAW,EACX,0BAA0B,EAC1B,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EACzB,oBAAoB,EACpB,iBAAiB,EACjB,6BAA6B,EAC7B,KAAK,aAAa,EAClB,KAAK,mB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V,CAAC;AAEvC,eAAO,MAAM,kBAAkB,EAAE,cAAc,EACV,CAAC;AAEtC,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAExD"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { allToolDescriptorsFromDefinitions, coreToolDescriptorsFromDefinitions, coreToolRiskForName, } from "./catalog/index.js";
|
|
2
2
|
export * from "./catalog/index.js";
|
|
3
|
-
export { appendBoundedTextNotice, boundContentBlocks, boundLiveOutputChunk, boundText, buildProcessResult, buildProcessTextResult, executeEdit, executeTool, FILE_OUTPUT_MAX_LINE_CHARS, LIVE_OUTPUT_MAX_BYTES, LIVE_OUTPUT_MAX_LINE_CHARS, LIVE_OUTPUT_MAX_LINES, MODEL_TEXT_MAX_BYTES, MODEL_TEXT_MAX_LINE_CHARS, MODEL_TEXT_MAX_LINES, normalizeEditArgs, PROCESS_INLINE_MAX_LINE_CHARS, resolvePythonRuntime, resolveToolPath, ToolExecutionError, textBoundaryDetails, } from "./execution/index.js";
|
|
3
|
+
export { appendBoundedTextNotice, boundContentBlocks, boundLiveOutputChunk, boundText, buildProcessResult, buildProcessTextResult, executeBash, executeEdit, executeTool, FILE_OUTPUT_MAX_LINE_CHARS, LIVE_OUTPUT_MAX_BYTES, LIVE_OUTPUT_MAX_LINE_CHARS, LIVE_OUTPUT_MAX_LINES, MODEL_TEXT_MAX_BYTES, MODEL_TEXT_MAX_LINE_CHARS, MODEL_TEXT_MAX_LINES, normalizeEditArgs, PROCESS_INLINE_MAX_LINE_CHARS, resolvePythonRuntime, resolveToolPath, ToolExecutionError, textBoundaryDetails, } from "./execution/index.js";
|
|
4
4
|
export { hasDangerousCommandPattern, hasShellControlOperator, isAllowedPlanModeBashCommand, isKnownReadOnlyCommand, isLikelyLongRunningCommand, } from "./safety/command-policy.js";
|
|
5
5
|
export * from "./types.js";
|
|
6
6
|
export const coreToolDescriptors = coreToolDescriptorsFromDefinitions();
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iCAAiC,EACjC,kCAAkC,EAClC,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAE5B,cAAc,oBAAoB,CAAC;AACnC,OAAO,EACL,uBAAuB,EAEvB,kBAAkB,EAClB,oBAAoB,EACpB,SAAS,EACT,kBAAkB,EAClB,sBAAsB,EACtB,WAAW,EACX,WAAW,EACX,0BAA0B,EAC1B,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EACzB,oBAAoB,EACpB,iBAAiB,EACjB,6BAA6B,EAG7B,oBAAoB,EACpB,eAAe,EAGf,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,4BAA4B,EAC5B,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,4BAA4B,CAAC;AACpC,cAAc,YAAY,CAAC;AAE3B,MAAM,CAAC,MAAM,mBAAmB,GAC9B,kCAAkC,EAAE,CAAC;AAEvC,MAAM,CAAC,MAAM,kBAAkB,GAC7B,iCAAiC,EAAE,CAAC;AAEtC,MAAM,UAAU,eAAe,CAAC,IAAc;IAC5C,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iCAAiC,EACjC,kCAAkC,EAClC,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAE5B,cAAc,oBAAoB,CAAC;AACnC,OAAO,EACL,uBAAuB,EAEvB,kBAAkB,EAClB,oBAAoB,EACpB,SAAS,EACT,kBAAkB,EAClB,sBAAsB,EACtB,WAAW,EACX,WAAW,EACX,WAAW,EACX,0BAA0B,EAC1B,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EACzB,oBAAoB,EACpB,iBAAiB,EACjB,6BAA6B,EAG7B,oBAAoB,EACpB,eAAe,EAGf,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,4BAA4B,EAC5B,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,4BAA4B,CAAC;AACpC,cAAc,YAAY,CAAC;AAE3B,MAAM,CAAC,MAAM,mBAAmB,GAC9B,kCAAkC,EAAE,CAAC;AAEvC,MAAM,CAAC,MAAM,kBAAkB,GAC7B,iCAAiC,EAAE,CAAC;AAEtC,MAAM,UAAU,eAAe,CAAC,IAAc;IAC5C,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nervekit/tools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"author": "ThilinaTLM",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"node-html-markdown": "^2.0.0",
|
|
31
31
|
"shell-quote": "^1.8.4",
|
|
32
32
|
"typebox": "1.1.38",
|
|
33
|
-
"@nervekit/shared": "0.
|
|
33
|
+
"@nervekit/shared": "0.2.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/node": "24.10.1",
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { Type } from "typebox";
|
|
2
|
-
export declare const processToolDefinitions: ({
|
|
3
|
-
name: "process_start";
|
|
4
|
-
label: string;
|
|
5
|
-
description: string;
|
|
6
|
-
promptSnippet: string;
|
|
7
|
-
promptGuidelines: string[];
|
|
8
|
-
parameters: Type.TObject<{
|
|
9
|
-
name: Type.TOptional<Type.TString>;
|
|
10
|
-
cwd: Type.TOptional<Type.TString>;
|
|
11
|
-
command: Type.TString;
|
|
12
|
-
env: Type.TOptional<Type.TRecord<"^.*$", Type.TString>>;
|
|
13
|
-
readyOnUrl: Type.TOptional<Type.TBoolean>;
|
|
14
|
-
readyPattern: Type.TOptional<Type.TString>;
|
|
15
|
-
readyTimeoutMs: Type.TOptional<Type.TNumber>;
|
|
16
|
-
}>;
|
|
17
|
-
executionMode: "sequential";
|
|
18
|
-
} | {
|
|
19
|
-
name: "process_stop";
|
|
20
|
-
label: string;
|
|
21
|
-
description: string;
|
|
22
|
-
promptSnippet: string;
|
|
23
|
-
promptGuidelines: string[];
|
|
24
|
-
parameters: Type.TObject<{
|
|
25
|
-
processId: Type.TOptional<Type.TString>;
|
|
26
|
-
name: Type.TOptional<Type.TString>;
|
|
27
|
-
signal: Type.TOptional<Type.TUnion<[Type.TLiteral<"SIGTERM">, Type.TLiteral<"SIGINT">, Type.TLiteral<"SIGKILL">]>>;
|
|
28
|
-
timeoutMs: Type.TOptional<Type.TNumber>;
|
|
29
|
-
}>;
|
|
30
|
-
executionMode: "sequential";
|
|
31
|
-
} | {
|
|
32
|
-
name: "process_restart";
|
|
33
|
-
label: string;
|
|
34
|
-
description: string;
|
|
35
|
-
promptSnippet: string;
|
|
36
|
-
parameters: Type.TObject<{
|
|
37
|
-
processId: Type.TOptional<Type.TString>;
|
|
38
|
-
name: Type.TOptional<Type.TString>;
|
|
39
|
-
}>;
|
|
40
|
-
executionMode: "sequential";
|
|
41
|
-
promptGuidelines?: undefined;
|
|
42
|
-
} | {
|
|
43
|
-
name: "process_list";
|
|
44
|
-
label: string;
|
|
45
|
-
description: string;
|
|
46
|
-
promptSnippet: string;
|
|
47
|
-
parameters: Type.TObject<{}>;
|
|
48
|
-
executionMode: "parallel";
|
|
49
|
-
promptGuidelines?: undefined;
|
|
50
|
-
} | {
|
|
51
|
-
name: "process_logs";
|
|
52
|
-
label: string;
|
|
53
|
-
description: string;
|
|
54
|
-
promptSnippet: string;
|
|
55
|
-
promptGuidelines: string[];
|
|
56
|
-
parameters: Type.TObject<{
|
|
57
|
-
processId: Type.TOptional<Type.TString>;
|
|
58
|
-
name: Type.TOptional<Type.TString>;
|
|
59
|
-
mode: Type.TOptional<Type.TUnion<[Type.TLiteral<"recent">, Type.TLiteral<"errors">, Type.TLiteral<"warnings">, Type.TLiteral<"since_cursor">, Type.TLiteral<"first_failure">]>>;
|
|
60
|
-
sinceSeq: Type.TOptional<Type.TNumber>;
|
|
61
|
-
contains: Type.TOptional<Type.TString>;
|
|
62
|
-
regex: Type.TOptional<Type.TString>;
|
|
63
|
-
contextLines: Type.TOptional<Type.TNumber>;
|
|
64
|
-
limit: Type.TOptional<Type.TNumber>;
|
|
65
|
-
}>;
|
|
66
|
-
executionMode: "parallel";
|
|
67
|
-
})[];
|
|
68
|
-
//# sourceMappingURL=process.tools.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"process.tools.d.ts","sourceRoot":"","sources":["../../../src/catalog/orchestration/process.tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AA+E/B,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0DH,CAAC"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { Type } from "typebox";
|
|
2
|
-
const processStartParameters = Type.Object({
|
|
3
|
-
name: Type.Optional(Type.String({ description: "Stable process name" })),
|
|
4
|
-
cwd: Type.Optional(Type.String({ description: "Working directory relative to the project" })),
|
|
5
|
-
command: Type.String({ description: "Command to start and supervise" }),
|
|
6
|
-
env: Type.Optional(Type.Record(Type.String(), Type.String(), {
|
|
7
|
-
description: "Extra environment variables. Values are stored encrypted for restart and shown only as redacted keys.",
|
|
8
|
-
})),
|
|
9
|
-
readyOnUrl: Type.Optional(Type.Boolean({ description: "Treat first detected URL as ready" })),
|
|
10
|
-
readyPattern: Type.Optional(Type.String({ description: "Regex line that marks the process ready" })),
|
|
11
|
-
readyTimeoutMs: Type.Optional(Type.Number({ description: "Readiness wait timeout in milliseconds" })),
|
|
12
|
-
}, { additionalProperties: false });
|
|
13
|
-
const processTargetParameters = Type.Object({
|
|
14
|
-
processId: Type.Optional(Type.String({ description: "Process id" })),
|
|
15
|
-
name: Type.Optional(Type.String({ description: "Process name" })),
|
|
16
|
-
signal: Type.Optional(Type.Union([
|
|
17
|
-
Type.Literal("SIGTERM"),
|
|
18
|
-
Type.Literal("SIGINT"),
|
|
19
|
-
Type.Literal("SIGKILL"),
|
|
20
|
-
])),
|
|
21
|
-
timeoutMs: Type.Optional(Type.Number({ description: "Stop timeout in milliseconds" })),
|
|
22
|
-
}, { additionalProperties: false });
|
|
23
|
-
const processRestartParameters = Type.Object({
|
|
24
|
-
processId: Type.Optional(Type.String({ description: "Process id" })),
|
|
25
|
-
name: Type.Optional(Type.String({ description: "Process name" })),
|
|
26
|
-
}, { additionalProperties: false });
|
|
27
|
-
const processListParameters = Type.Object({}, { additionalProperties: false });
|
|
28
|
-
const processLogsParameters = Type.Object({
|
|
29
|
-
processId: Type.Optional(Type.String({ description: "Process id" })),
|
|
30
|
-
name: Type.Optional(Type.String({ description: "Process name" })),
|
|
31
|
-
mode: Type.Optional(Type.Union([
|
|
32
|
-
Type.Literal("recent"),
|
|
33
|
-
Type.Literal("errors"),
|
|
34
|
-
Type.Literal("warnings"),
|
|
35
|
-
Type.Literal("since_cursor"),
|
|
36
|
-
Type.Literal("first_failure"),
|
|
37
|
-
])),
|
|
38
|
-
sinceSeq: Type.Optional(Type.Number({ description: "Cursor sequence" })),
|
|
39
|
-
contains: Type.Optional(Type.String({ description: "Substring filter" })),
|
|
40
|
-
regex: Type.Optional(Type.String({ description: "Regex filter" })),
|
|
41
|
-
contextLines: Type.Optional(Type.Number({ description: "Context lines" })),
|
|
42
|
-
limit: Type.Optional(Type.Number({ description: "Maximum events" })),
|
|
43
|
-
}, { additionalProperties: false });
|
|
44
|
-
export const processToolDefinitions = [
|
|
45
|
-
{
|
|
46
|
-
name: "process_start",
|
|
47
|
-
label: "process_start",
|
|
48
|
-
description: "Start a managed long-running command such as a dev server, watcher, or daemon. Captures logs and readiness state for later process_logs queries.",
|
|
49
|
-
promptSnippet: "Start long-running commands with supervised logs and lifecycle management",
|
|
50
|
-
promptGuidelines: [
|
|
51
|
-
"Use process_start instead of bash for dev servers, file watchers, queue workers, and other long-running commands.",
|
|
52
|
-
"Provide readyOnUrl or readyPattern when possible so the tool can wait for readiness.",
|
|
53
|
-
],
|
|
54
|
-
parameters: processStartParameters,
|
|
55
|
-
executionMode: "sequential",
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
name: "process_stop",
|
|
59
|
-
label: "process_stop",
|
|
60
|
-
description: "Stop a managed process or clean up an orphaned process by processId or name.",
|
|
61
|
-
promptSnippet: "Stop supervised long-running processes, including best-effort cleanup of orphaned process trees after daemon restarts",
|
|
62
|
-
promptGuidelines: [
|
|
63
|
-
"Use process_stop on orphaned records before restarting if a daemon restart may have left the old process tree alive.",
|
|
64
|
-
],
|
|
65
|
-
parameters: processTargetParameters,
|
|
66
|
-
executionMode: "sequential",
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
name: "process_restart",
|
|
70
|
-
label: "process_restart",
|
|
71
|
-
description: "Restart a managed process by processId or name, preserving encrypted env overrides captured at start.",
|
|
72
|
-
promptSnippet: "Restart supervised long-running processes while preserving stored env overrides",
|
|
73
|
-
parameters: processRestartParameters,
|
|
74
|
-
executionMode: "sequential",
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
name: "process_list",
|
|
78
|
-
label: "process_list",
|
|
79
|
-
description: "List managed processes for the current project.",
|
|
80
|
-
promptSnippet: "List supervised processes",
|
|
81
|
-
parameters: processListParameters,
|
|
82
|
-
executionMode: "parallel",
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
name: "process_logs",
|
|
86
|
-
label: "process_logs",
|
|
87
|
-
description: "Query captured logs from a managed process, including recent output, errors, warnings, cursor-based updates, and first-failure context.",
|
|
88
|
-
promptSnippet: "Inspect logs from supervised processes",
|
|
89
|
-
promptGuidelines: [
|
|
90
|
-
"After code changes that trigger a running process to recompile, inspect process_logs instead of restarting the command just to see errors.",
|
|
91
|
-
],
|
|
92
|
-
parameters: processLogsParameters,
|
|
93
|
-
executionMode: "parallel",
|
|
94
|
-
},
|
|
95
|
-
];
|
|
96
|
-
//# sourceMappingURL=process.tools.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"process.tools.js","sourceRoot":"","sources":["../../../src/catalog/orchestration/process.tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAG/B,MAAM,sBAAsB,GAAG,IAAI,CAAC,MAAM,CACxC;IACE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC,CAAC;IACxE,GAAG,EAAE,IAAI,CAAC,QAAQ,CAChB,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,2CAA2C,EAAE,CAAC,CAC1E;IACD,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;IACvE,GAAG,EAAE,IAAI,CAAC,QAAQ,CAChB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE;QACxC,WAAW,EACT,uGAAuG;KAC1G,CAAC,CACH;IACD,UAAU,EAAE,IAAI,CAAC,QAAQ,CACvB,IAAI,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC,CACnE;IACD,YAAY,EAAE,IAAI,CAAC,QAAQ,CACzB,IAAI,CAAC,MAA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CAChC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC;QACE,IAAI,EAAE,eAAe;QACrB,KAAK,EAAE,eAAe;QACtB,WAAW,EACT,kJAAkJ;QACpJ,aAAa,EACX,2EAA2E;QAC7E,gBAAgB,EAAE;YAChB,mHAAmH;YACnH,sFAAsF;SACvF;QACD,UAAU,EAAE,sBAAsB;QAClC,aAAa,EAAE,YAAY;KAC5B;IACD;QACE,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE,cAAc;QACrB,WAAW,EACT,8EAA8E;QAChF,aAAa,EACX,uHAAuH;QACzH,gBAAgB,EAAE;YAChB,sHAAsH;SACvH;QACD,UAAU,EAAE,uBAAuB;QACnC,aAAa,EAAE,YAAY;KAC5B;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,KAAK,EAAE,iBAAiB;QACxB,WAAW,EACT,uGAAuG;QACzG,aAAa,EACX,iFAAiF;QACnF,UAAU,EAAE,wBAAwB;QACpC,aAAa,EAAE,YAAY;KAC5B;IACD;QACE,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE,cAAc;QACrB,WAAW,EAAE,iDAAiD;QAC9D,aAAa,EAAE,2BAA2B;QAC1C,UAAU,EAAE,qBAAqB;QACjC,aAAa,EAAE,UAAU;KAC1B;IACD;QACE,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE,cAAc;QACrB,WAAW,EACT,yIAAyI;QAC3I,aAAa,EAAE,wCAAwC;QACvD,gBAAgB,EAAE;YAChB,4IAA4I;SAC7I;QACD,UAAU,EAAE,qBAAqB;QACjC,aAAa,EAAE,UAAU;KAC1B;CAC6B,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Type } from "typebox";
|
|
2
|
-
export declare const subagentToolDefinitions: {
|
|
3
|
-
name: "subagent_run";
|
|
4
|
-
label: string;
|
|
5
|
-
description: string;
|
|
6
|
-
promptSnippet: string;
|
|
7
|
-
promptGuidelines: string[];
|
|
8
|
-
parameters: Type.TObject<{
|
|
9
|
-
task: Type.TString;
|
|
10
|
-
context: Type.TOptional<Type.TString>;
|
|
11
|
-
mode: Type.TOptional<Type.TUnion<[Type.TLiteral<"planning">, Type.TLiteral<"coding">]>>;
|
|
12
|
-
permissionLevel: Type.TOptional<Type.TUnion<[Type.TLiteral<"read_only">, Type.TLiteral<"supervised">, Type.TLiteral<"autonomous">]>>;
|
|
13
|
-
}>;
|
|
14
|
-
executionMode: "sequential";
|
|
15
|
-
}[];
|
|
16
|
-
//# sourceMappingURL=subagent.tools.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subagent.tools.d.ts","sourceRoot":"","sources":["../../../src/catalog/orchestration/subagent.tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAuB/B,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;GAaJ,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Type } from "typebox";
|
|
2
|
-
const subagentRunParameters = Type.Object({
|
|
3
|
-
task: Type.String({ description: "Task for the child agent" }),
|
|
4
|
-
context: Type.Optional(Type.String({ description: "Useful context for the child agent" })),
|
|
5
|
-
mode: Type.Optional(Type.Union([Type.Literal("planning"), Type.Literal("coding")])),
|
|
6
|
-
permissionLevel: Type.Optional(Type.Union([
|
|
7
|
-
Type.Literal("read_only"),
|
|
8
|
-
Type.Literal("supervised"),
|
|
9
|
-
Type.Literal("autonomous"),
|
|
10
|
-
])),
|
|
11
|
-
}, { additionalProperties: false });
|
|
12
|
-
export const subagentToolDefinitions = [
|
|
13
|
-
{
|
|
14
|
-
name: "subagent_run",
|
|
15
|
-
label: "subagent_run",
|
|
16
|
-
description: "Spawn a child agent to investigate an independent task with bounded authority.",
|
|
17
|
-
promptSnippet: "Run a bounded child agent for independent investigation",
|
|
18
|
-
promptGuidelines: [
|
|
19
|
-
"Use subagent_run only for substantial independent investigations, not simple lookups.",
|
|
20
|
-
],
|
|
21
|
-
parameters: subagentRunParameters,
|
|
22
|
-
executionMode: "sequential",
|
|
23
|
-
},
|
|
24
|
-
];
|
|
25
|
-
//# sourceMappingURL=subagent.tools.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subagent.tools.js","sourceRoot":"","sources":["../../../src/catalog/orchestration/subagent.tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAG/B,MAAM,qBAAqB,GAAG,IAAI,CAAC,MAAM,CACvC;IACE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;IAC9D,OAAO,EAAE,IAAI,CAAC,QAAQ,CACpB,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,oCAAoC,EAAE,CAAC,CACnE;IACD,IAAI,EAAE,IAAI,CAAC,QAAQ,CACjB,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAC/D;IACD,eAAe,EAAE,IAAI,CAAC,QAAQ,CAC5B,IAAI,CAAC,KAAK,CAAC;QACT,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;QACzB,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;QAC1B,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;KAC3B,CAAC,CACH;CACF,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAChC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC;QACE,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE,cAAc;QACrB,WAAW,EACT,gFAAgF;QAClF,aAAa,EAAE,yDAAyD;QACxE,gBAAgB,EAAE;YAChB,uFAAuF;SACxF;QACD,UAAU,EAAE,qBAAqB;QACjC,aAAa,EAAE,YAAY;KAC5B;CAC6B,CAAC"}
|
package/dist/definitions.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../src/definitions.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
package/dist/definitions.js
DELETED
package/dist/definitions.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../src/definitions.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"atomic-write.d.ts","sourceRoot":"","sources":["../../src/execution/atomic-write.ts"],"names":[],"mappings":"AAEA,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,CAIf"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { rename, writeFile } from "node:fs/promises";
|
|
2
|
-
export async function writeTextFileAtomically(path, content) {
|
|
3
|
-
const tempPath = `${path}.${process.pid}.${Date.now()}.tmp`;
|
|
4
|
-
await writeFile(tempPath, content, "utf8");
|
|
5
|
-
await rename(tempPath, path);
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=atomic-write.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"atomic-write.js","sourceRoot":"","sources":["../../src/execution/atomic-write.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAErD,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,IAAY,EACZ,OAAe;IAEf,MAAM,QAAQ,GAAG,GAAG,IAAI,IAAI,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC;IAC5D,MAAM,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC3C,MAAM,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAC/B,CAAC"}
|
package/dist/execution/bash.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../src/execution/bash.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAI7E,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CA+F9B"}
|
package/dist/execution/bash.js
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { spawn } from "node:child_process";
|
|
2
|
-
import { writeFile } from "node:fs/promises";
|
|
3
|
-
import { tmpdir } from "node:os";
|
|
4
|
-
import { join } from "node:path";
|
|
5
|
-
import { numberArg } from "./common.js";
|
|
6
|
-
import { truncateTail } from "./truncate.js";
|
|
7
|
-
export async function executeBash(args, context) {
|
|
8
|
-
if (typeof args.command !== "string" || args.command.trim().length === 0) {
|
|
9
|
-
throw new Error("Tool argument 'command' must be a non-empty string.");
|
|
10
|
-
}
|
|
11
|
-
const timeoutSeconds = typeof args.timeout === "number"
|
|
12
|
-
? Math.max(0, numberArg(args.timeout, 0))
|
|
13
|
-
: undefined;
|
|
14
|
-
const stdoutChunks = [];
|
|
15
|
-
const stderrChunks = [];
|
|
16
|
-
const combinedChunks = [];
|
|
17
|
-
return await new Promise((resolve, reject) => {
|
|
18
|
-
if (context.signal?.aborted) {
|
|
19
|
-
reject(new Error("Command aborted."));
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
const child = spawn(args.command, {
|
|
23
|
-
cwd: context.cwd,
|
|
24
|
-
shell: true,
|
|
25
|
-
detached: process.platform !== "win32",
|
|
26
|
-
env: process.env,
|
|
27
|
-
});
|
|
28
|
-
let settled = false;
|
|
29
|
-
let timeout;
|
|
30
|
-
const cleanup = () => {
|
|
31
|
-
if (timeout)
|
|
32
|
-
clearTimeout(timeout);
|
|
33
|
-
context.signal?.removeEventListener("abort", onAbort);
|
|
34
|
-
};
|
|
35
|
-
const kill = () => {
|
|
36
|
-
try {
|
|
37
|
-
if (process.platform !== "win32" && child.pid) {
|
|
38
|
-
process.kill(-child.pid, "SIGTERM");
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
child.kill("SIGTERM");
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
catch {
|
|
45
|
-
child.kill("SIGTERM");
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
const onAbort = () => {
|
|
49
|
-
if (settled)
|
|
50
|
-
return;
|
|
51
|
-
kill();
|
|
52
|
-
settled = true;
|
|
53
|
-
cleanup();
|
|
54
|
-
reject(new Error("Command aborted."));
|
|
55
|
-
};
|
|
56
|
-
context.signal?.addEventListener("abort", onAbort, { once: true });
|
|
57
|
-
if (timeoutSeconds !== undefined && timeoutSeconds > 0) {
|
|
58
|
-
timeout = setTimeout(() => {
|
|
59
|
-
if (settled)
|
|
60
|
-
return;
|
|
61
|
-
kill();
|
|
62
|
-
settled = true;
|
|
63
|
-
cleanup();
|
|
64
|
-
reject(new Error(`Command timed out after ${timeoutSeconds}s.`));
|
|
65
|
-
}, timeoutSeconds * 1000);
|
|
66
|
-
}
|
|
67
|
-
child.stdout?.on("data", (chunk) => {
|
|
68
|
-
stdoutChunks.push(chunk);
|
|
69
|
-
combinedChunks.push(chunk);
|
|
70
|
-
context.onUpdate?.({
|
|
71
|
-
kind: "output",
|
|
72
|
-
stream: "stdout",
|
|
73
|
-
chunk: chunk.toString("utf8"),
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
child.stderr?.on("data", (chunk) => {
|
|
77
|
-
stderrChunks.push(chunk);
|
|
78
|
-
combinedChunks.push(chunk);
|
|
79
|
-
context.onUpdate?.({
|
|
80
|
-
kind: "output",
|
|
81
|
-
stream: "stderr",
|
|
82
|
-
chunk: chunk.toString("utf8"),
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
child.on("error", (error) => {
|
|
86
|
-
if (settled)
|
|
87
|
-
return;
|
|
88
|
-
settled = true;
|
|
89
|
-
cleanup();
|
|
90
|
-
reject(error);
|
|
91
|
-
});
|
|
92
|
-
child.on("close", (code, signal) => {
|
|
93
|
-
if (settled)
|
|
94
|
-
return;
|
|
95
|
-
settled = true;
|
|
96
|
-
cleanup();
|
|
97
|
-
void buildResult(stdoutChunks, stderrChunks, combinedChunks, code, signal)
|
|
98
|
-
.then(resolve)
|
|
99
|
-
.catch(reject);
|
|
100
|
-
});
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
async function buildResult(stdoutChunks, stderrChunks, combinedChunks, code, signal) {
|
|
104
|
-
const stdout = Buffer.concat(stdoutChunks).toString("utf8");
|
|
105
|
-
const stderr = Buffer.concat(stderrChunks).toString("utf8");
|
|
106
|
-
const combined = Buffer.concat(combinedChunks).toString("utf8");
|
|
107
|
-
const exitCode = code ?? (signal ? 128 : 0);
|
|
108
|
-
const output = combined.length > 0 ? combined : "(no output)";
|
|
109
|
-
const truncated = truncateTail(output);
|
|
110
|
-
let content = truncated.text;
|
|
111
|
-
let fullOutputPath;
|
|
112
|
-
if (truncated.truncated) {
|
|
113
|
-
fullOutputPath = join(tmpdir(), `nerve-bash-${Date.now()}-${Math.random().toString(16).slice(2)}.log`);
|
|
114
|
-
await writeFile(fullOutputPath, output, "utf8");
|
|
115
|
-
content = `[...output truncated; full output saved to ${fullOutputPath}]\n${content}`;
|
|
116
|
-
}
|
|
117
|
-
if (exitCode !== 0) {
|
|
118
|
-
content += `${content.endsWith("\n") ? "" : "\n"}Command exited with code ${exitCode}.`;
|
|
119
|
-
}
|
|
120
|
-
return {
|
|
121
|
-
stdout,
|
|
122
|
-
stderr,
|
|
123
|
-
exitCode,
|
|
124
|
-
content,
|
|
125
|
-
contentBlocks: [{ type: "text", text: content }],
|
|
126
|
-
details: {
|
|
127
|
-
truncation: truncated.truncated ? truncated : undefined,
|
|
128
|
-
fullOutputPath,
|
|
129
|
-
signal,
|
|
130
|
-
},
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
//# sourceMappingURL=bash.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bash.js","sourceRoot":"","sources":["../../src/execution/bash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,IAA6B,EAC7B,OAA6B;IAE7B,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzE,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IACzE,CAAC;IAED,MAAM,cAAc,GAClB,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ;QAC9B,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACzC,CAAC,CAAC,SAAS,CAAC;IAChB,MAAM,YAAY,GAAa,EAAE,CAAC;IAClC,MAAM,YAAY,GAAa,EAAE,CAAC;IAClC,MAAM,cAAc,GAAa,EAAE,CAAC;IAEpC,OAAO,MAAM,IAAI,OAAO,CAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAChE,IAAI,OAAO,CAAC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;IAC7B,IAAI,cAAkC,CAAC;IACvC,IAAI,SAAS,CAAC,SAAS,EAAE,CAAC;QACxB,cAAc,GAAG,IAAI,CACnB,MAAM,EAAE,EACR,cAAc,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CACtE,CAAC;QACF,MAAM,SAAS,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAChD,OAAO,GAAG,8CAA8C,cAAc,MAAM,OAAO,EAAE,CAAC;IACxF,CAAC;IACD,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;QACnB,OAAO,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,4BAA4B,QAAQ,GAAG,CAAC;IAC1F,CAAC;IACD,OAAO;QACL,MAAM;QACN,MAAM;QACN,QAAQ;QACR,OAAO;QACP,aAAa,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QAChD,OAAO,EAAE;YACP,UAAU,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;YACvD,cAAc;YACd,MAAM;SACP;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/execution/common.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGlE"}
|
package/dist/execution/common.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/execution/common.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAC,KAAc,EAAE,QAAgB;IACxD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IAC1E,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ToolName } from "@nerve/shared";
|
|
2
|
-
import type { ToolExecutionContext, ToolExecutionResult } from "../types.js";
|
|
3
|
-
export declare function executeTool(name: ToolName, args: Record<string, unknown>, context: ToolExecutionContext): Promise<ToolExecutionResult>;
|
|
4
|
-
//# sourceMappingURL=dispatch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../src/execution/dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAW7E,wBAAsB,WAAW,CAC/B,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CAiD9B"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { executeBash } from "./bash.js";
|
|
2
|
-
import { executeEdit } from "./edit.js";
|
|
3
|
-
import { executeFind } from "./find.js";
|
|
4
|
-
import { executeLs } from "./list.js";
|
|
5
|
-
import { executeRead } from "./read.js";
|
|
6
|
-
import { executeGrep } from "./search.js";
|
|
7
|
-
import { executeWebFetch } from "./web-fetch.js";
|
|
8
|
-
import { executeWebSearch } from "./web-search.js";
|
|
9
|
-
import { executeWrite } from "./write.js";
|
|
10
|
-
export async function executeTool(name, args, context) {
|
|
11
|
-
switch (name) {
|
|
12
|
-
case "read":
|
|
13
|
-
return executeRead(args, context);
|
|
14
|
-
case "bash":
|
|
15
|
-
return executeBash(args, context);
|
|
16
|
-
case "edit":
|
|
17
|
-
return executeEdit(args, context);
|
|
18
|
-
case "write":
|
|
19
|
-
return executeWrite(args, context);
|
|
20
|
-
case "grep":
|
|
21
|
-
return executeGrep(args, context);
|
|
22
|
-
case "find":
|
|
23
|
-
return executeFind(args, context);
|
|
24
|
-
case "ls":
|
|
25
|
-
return executeLs(args, context);
|
|
26
|
-
case "web_search":
|
|
27
|
-
return executeWebSearch(args, context);
|
|
28
|
-
case "web_fetch":
|
|
29
|
-
return executeWebFetch(args, context);
|
|
30
|
-
case "ask_user":
|
|
31
|
-
throw new Error("ask_user is executed by the orchestrator user-interaction service.");
|
|
32
|
-
case "todos_set":
|
|
33
|
-
case "todos_get":
|
|
34
|
-
throw new Error(`${name} is executed by the orchestrator task-state service.`);
|
|
35
|
-
case "process_start":
|
|
36
|
-
case "process_stop":
|
|
37
|
-
case "process_restart":
|
|
38
|
-
case "process_list":
|
|
39
|
-
case "process_logs":
|
|
40
|
-
// packages/tools executes only core local tools. Managed process tools are
|
|
41
|
-
// orchestration tools: descriptors are shared for prompting/API purposes,
|
|
42
|
-
// but execution is mediated by the orchestrator process manager.
|
|
43
|
-
throw new Error(`${name} is executed by the orchestrator process manager.`);
|
|
44
|
-
case "subagent_run":
|
|
45
|
-
// Subagents require runtime/conversation authority checks owned by orchestrator.
|
|
46
|
-
throw new Error(`${name} is executed by the orchestrator agent runtime.`);
|
|
47
|
-
case "plan_mode_enter":
|
|
48
|
-
case "plan_mode_present":
|
|
49
|
-
case "plan_mode_force_exit":
|
|
50
|
-
// Plan mode requires runtime/conversation state and user-review waiters owned by orchestrator.
|
|
51
|
-
throw new Error(`${name} is executed by the orchestrator plan service.`);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=dispatch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-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