@linghun/tools 0.1.3 → 0.1.4
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/{chunk-J7O24FJB.js → chunk-6BBM4UX3.js} +7 -7
- package/dist/{chunk-F7UOI3YR.js → chunk-ZGLZZKO6.js} +7 -7
- package/dist/index.d.ts +2 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +36 -224
- package/dist/tools/Glob/GlobTool.js +2 -2
- package/dist/tools/MultiEdit/MultiEditTool.js +2 -2
- package/dist/tools/prompts.js +9 -9
- package/dist/tools/ui.js +9 -9
- package/package.json +6 -10
- package/LICENSE +0 -190
- package/dist/chunk-236QJATI.js +0 -678
- package/dist/chunk-SPAD4DZS.js +0 -319
- package/dist/chunk-XG6HNLY6.js +0 -166
- package/dist/tools/Bash/artifact-checker.d.ts +0 -33
- package/dist/tools/Bash/artifact-checker.d.ts.map +0 -1
- package/dist/tools/Bash/artifact-checker.js +0 -6
- package/dist/tools/Bash/binary-helper.d.ts +0 -7
- package/dist/tools/Bash/binary-helper.d.ts.map +0 -1
- package/dist/tools/Bash/binary-helper.js +0 -6
- package/dist/tools/Bash/service-kernel.d.ts +0 -75
- package/dist/tools/Bash/service-kernel.d.ts.map +0 -1
- package/dist/tools/Bash/service-kernel.js +0 -8
- package/dist/{chunk-VJDLOFCF.js → chunk-3NZ3IOPM.js} +3 -3
- package/dist/{chunk-Z3H6SZBS.js → chunk-DN3KJZRV.js} +3 -3
|
@@ -4,9 +4,6 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
WriteTool
|
|
6
6
|
} from "./chunk-I3Z4OKMS.js";
|
|
7
|
-
import {
|
|
8
|
-
MultiEditTool
|
|
9
|
-
} from "./chunk-VJDLOFCF.js";
|
|
10
7
|
import {
|
|
11
8
|
WebFetchTool
|
|
12
9
|
} from "./chunk-LGZOG7IQ.js";
|
|
@@ -22,18 +19,21 @@ import {
|
|
|
22
19
|
import {
|
|
23
20
|
TodoTool
|
|
24
21
|
} from "./chunk-4567YAXM.js";
|
|
25
|
-
import {
|
|
26
|
-
EditTool
|
|
27
|
-
} from "./chunk-WLQ7DGMG.js";
|
|
28
22
|
import {
|
|
29
23
|
GrepTool
|
|
30
24
|
} from "./chunk-AZCQL24J.js";
|
|
25
|
+
import {
|
|
26
|
+
EditTool
|
|
27
|
+
} from "./chunk-WLQ7DGMG.js";
|
|
31
28
|
import {
|
|
32
29
|
DiffTool
|
|
33
30
|
} from "./chunk-7ZOADACP.js";
|
|
34
31
|
import {
|
|
35
32
|
GlobTool
|
|
36
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-DN3KJZRV.js";
|
|
34
|
+
import {
|
|
35
|
+
MultiEditTool
|
|
36
|
+
} from "./chunk-3NZ3IOPM.js";
|
|
37
37
|
import {
|
|
38
38
|
BashTool
|
|
39
39
|
} from "./chunk-2DIXRINW.js";
|
|
@@ -4,9 +4,6 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
WriteTool
|
|
6
6
|
} from "./chunk-I3Z4OKMS.js";
|
|
7
|
-
import {
|
|
8
|
-
MultiEditTool
|
|
9
|
-
} from "./chunk-VJDLOFCF.js";
|
|
10
7
|
import {
|
|
11
8
|
WebFetchTool
|
|
12
9
|
} from "./chunk-LGZOG7IQ.js";
|
|
@@ -22,18 +19,21 @@ import {
|
|
|
22
19
|
import {
|
|
23
20
|
TodoTool
|
|
24
21
|
} from "./chunk-4567YAXM.js";
|
|
25
|
-
import {
|
|
26
|
-
EditTool
|
|
27
|
-
} from "./chunk-WLQ7DGMG.js";
|
|
28
22
|
import {
|
|
29
23
|
GrepTool
|
|
30
24
|
} from "./chunk-AZCQL24J.js";
|
|
25
|
+
import {
|
|
26
|
+
EditTool
|
|
27
|
+
} from "./chunk-WLQ7DGMG.js";
|
|
31
28
|
import {
|
|
32
29
|
DiffTool
|
|
33
30
|
} from "./chunk-7ZOADACP.js";
|
|
34
31
|
import {
|
|
35
32
|
GlobTool
|
|
36
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-DN3KJZRV.js";
|
|
34
|
+
import {
|
|
35
|
+
MultiEditTool
|
|
36
|
+
} from "./chunk-3NZ3IOPM.js";
|
|
37
37
|
import {
|
|
38
38
|
BashTool
|
|
39
39
|
} from "./chunk-2DIXRINW.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { ChildProcess } from "node:child_process";
|
|
2
2
|
import { type ToolDefinition } from "./tool-runtime.js";
|
|
3
|
-
import type { BashArtifactCheckInput } from "./tools/Bash/artifact-checker.js";
|
|
4
|
-
import type { BashBinaryInspectInput } from "./tools/Bash/binary-helper.js";
|
|
5
|
-
import type { BashManagedServiceRecord, BashServiceInput } from "./tools/Bash/service-kernel.js";
|
|
6
3
|
export type { ToolDefinition, ToolFactoryDefinition, ToolInterruptBehavior, ToolLifecycleMetadata, ToolPermissionDecision, } from "./tool-runtime.js";
|
|
7
4
|
export { createTool } from "./tool-runtime.js";
|
|
8
5
|
export type ToolRisk = "low" | "medium" | "high";
|
|
@@ -78,7 +75,6 @@ export type ToolContext = {
|
|
|
78
75
|
sourcePackCandidates?: SourcePackCandidate[];
|
|
79
76
|
patchSummaries?: Record<string, DiffSummary>;
|
|
80
77
|
recentDiagnostics?: RecentToolDiagnostic[];
|
|
81
|
-
services?: BashManagedServiceRecord[];
|
|
82
78
|
abortSignal?: AbortSignal;
|
|
83
79
|
isHeadlessBench?: boolean;
|
|
84
80
|
onProgress?: (event: ToolProgressEvent) => void | Promise<void>;
|
|
@@ -150,11 +146,10 @@ export type GlobInput = {
|
|
|
150
146
|
};
|
|
151
147
|
export type BashInput = {
|
|
152
148
|
command?: string;
|
|
149
|
+
description?: string;
|
|
153
150
|
timeoutMs?: number;
|
|
154
|
-
service?: BashServiceInput;
|
|
155
|
-
binary?: BashBinaryInspectInput;
|
|
156
|
-
artifact?: BashArtifactCheckInput;
|
|
157
151
|
runInBackground?: boolean;
|
|
152
|
+
run_in_background?: boolean;
|
|
158
153
|
};
|
|
159
154
|
export type TodoInput = {
|
|
160
155
|
action: "list";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAKvD,OAAO,EACL,KAAK,cAAc,EAIpB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAKvD,OAAO,EACL,KAAK,cAAc,EAIpB,MAAM,mBAAmB,CAAC;AAS3B,YAAY,EACV,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEjD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,eAAe,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB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,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5E,iBAAiB,CAAC,EAAE,WAAW,CAAC,mBAAmB,CAAC,CAAC;IACrD,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,CAAC;CACrD,CAAC;AAEF,iBAAe,iBAAiB,CAAC,IAAI,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CA4K9E;AAED,iBAAS,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAgB/C;AA8HD,eAAO,MAAM,kBAAkB,qBAAe,CAAC;AAC/C,eAAO,MAAM,sBAAsB,yBAAmB,CAAC;AACvD,eAAO,MAAM,4BAA4B,+BAAyB,CAAC;AACnE,eAAO,MAAM,iCAAiC,oCAA8B,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,eAAO,MAAM,uBAAuB,0BAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -7,26 +7,19 @@ import {
|
|
|
7
7
|
bingSearch,
|
|
8
8
|
formatSearchOutput
|
|
9
9
|
} from "./chunk-EPIB4FSE.js";
|
|
10
|
-
import {
|
|
11
|
-
runBashServiceLifecycleAction,
|
|
12
|
-
startBashService
|
|
13
|
-
} from "./chunk-236QJATI.js";
|
|
14
10
|
import {
|
|
15
11
|
createTool
|
|
16
12
|
} from "./chunk-MMJX44V6.js";
|
|
17
13
|
import {
|
|
18
14
|
toolPrompts
|
|
19
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-ZGLZZKO6.js";
|
|
20
16
|
import {
|
|
21
17
|
toolUserFacingNames
|
|
22
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-6BBM4UX3.js";
|
|
23
19
|
import "./chunk-4EZHIDZ6.js";
|
|
24
20
|
import "./chunk-I3Z4OKMS.js";
|
|
25
21
|
import "./chunk-PS2ZOFZ6.js";
|
|
26
22
|
import "./chunk-NPKLGVDQ.js";
|
|
27
|
-
import "./chunk-VJDLOFCF.js";
|
|
28
|
-
import "./chunk-3RP665TH.js";
|
|
29
|
-
import "./chunk-IOC3BSPT.js";
|
|
30
23
|
import "./chunk-LGZOG7IQ.js";
|
|
31
24
|
import "./chunk-ZYAEUABC.js";
|
|
32
25
|
import "./chunk-SWK6XRZQ.js";
|
|
@@ -41,31 +34,28 @@ import "./chunk-YCO6C7KF.js";
|
|
|
41
34
|
import "./chunk-4567YAXM.js";
|
|
42
35
|
import "./chunk-XZWSO5CM.js";
|
|
43
36
|
import "./chunk-SZFZPQGL.js";
|
|
44
|
-
import "./chunk-WLQ7DGMG.js";
|
|
45
|
-
import "./chunk-SQP6SJRP.js";
|
|
46
|
-
import "./chunk-BRG64AEC.js";
|
|
47
37
|
import "./chunk-AZCQL24J.js";
|
|
48
38
|
import "./chunk-HUIZOB4A.js";
|
|
49
39
|
import "./chunk-MK3YP2VR.js";
|
|
40
|
+
import "./chunk-WLQ7DGMG.js";
|
|
41
|
+
import "./chunk-SQP6SJRP.js";
|
|
42
|
+
import "./chunk-BRG64AEC.js";
|
|
50
43
|
import "./chunk-HNIVNZIS.js";
|
|
51
44
|
import "./chunk-7ZOADACP.js";
|
|
52
45
|
import "./chunk-H5OOD2OS.js";
|
|
53
46
|
import "./chunk-IQP3XE32.js";
|
|
54
|
-
import "./chunk-
|
|
55
|
-
import "./chunk-ITBZHMZQ.js";
|
|
47
|
+
import "./chunk-DN3KJZRV.js";
|
|
56
48
|
import "./chunk-2U4BZXAI.js";
|
|
57
|
-
import
|
|
58
|
-
|
|
59
|
-
|
|
49
|
+
import "./chunk-ITBZHMZQ.js";
|
|
50
|
+
import "./chunk-3NZ3IOPM.js";
|
|
51
|
+
import "./chunk-IOC3BSPT.js";
|
|
52
|
+
import "./chunk-3RP665TH.js";
|
|
60
53
|
import "./chunk-2DIXRINW.js";
|
|
61
|
-
import "./chunk-PKMIDA5A.js";
|
|
62
|
-
import "./chunk-GAWMEMXB.js";
|
|
63
|
-
import {
|
|
64
|
-
inspectBinaryFile
|
|
65
|
-
} from "./chunk-XG6HNLY6.js";
|
|
66
54
|
import {
|
|
67
55
|
interpretCommandResult
|
|
68
56
|
} from "./chunk-FI4YPDFE.js";
|
|
57
|
+
import "./chunk-PKMIDA5A.js";
|
|
58
|
+
import "./chunk-GAWMEMXB.js";
|
|
69
59
|
|
|
70
60
|
// src/index.ts
|
|
71
61
|
import { spawn } from "child_process";
|
|
@@ -99,8 +89,7 @@ function createToolContext(workspaceRoot = process.cwd(), options = {}) {
|
|
|
99
89
|
readSnapshots: {},
|
|
100
90
|
sourcePackCandidates: options.sourcePackCandidates,
|
|
101
91
|
patchSummaries: {},
|
|
102
|
-
recentDiagnostics: []
|
|
103
|
-
services: []
|
|
92
|
+
recentDiagnostics: []
|
|
104
93
|
};
|
|
105
94
|
}
|
|
106
95
|
async function runTool(name, input, context) {
|
|
@@ -308,7 +297,7 @@ var toolDefinitions = {
|
|
|
308
297
|
call: bashTool,
|
|
309
298
|
prompt: () => toolPrompts.Bash,
|
|
310
299
|
userFacingName: () => toolUserFacingNames.Bash,
|
|
311
|
-
getToolUseSummary: (input) =>
|
|
300
|
+
getToolUseSummary: (input) => `Bash ${input.command}`,
|
|
312
301
|
getActivityDescription: () => "Running command"
|
|
313
302
|
}),
|
|
314
303
|
Todo: defineTool({
|
|
@@ -588,120 +577,17 @@ function validateGlobInput(input) {
|
|
|
588
577
|
function validateBashInput(input) {
|
|
589
578
|
const record = validateRecord(input, "Bash");
|
|
590
579
|
const command = readOptionalString(record, "command", "Bash");
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
const service = validateOptionalBashServiceInput(record.service);
|
|
594
|
-
const serviceAction = isBashServiceLifecycleAction(service);
|
|
595
|
-
if (command === void 0 && binary === void 0 && artifact === void 0 && !serviceAction) {
|
|
596
|
-
throw new Error("Bash.command\u3001Bash.binary\u3001Bash.artifact \u6216 Bash.service action \u5FC5\u987B\u63D0\u4F9B\u4E00\u4E2A\u3002");
|
|
597
|
-
}
|
|
598
|
-
const modeCount = [
|
|
599
|
-
command !== void 0,
|
|
600
|
-
binary !== void 0,
|
|
601
|
-
artifact !== void 0,
|
|
602
|
-
serviceAction
|
|
603
|
-
].filter(Boolean).length;
|
|
604
|
-
if (modeCount > 1 || (binary !== void 0 || artifact !== void 0) && service !== void 0) {
|
|
605
|
-
throw new Error("Bash.command\u3001Bash.binary\u3001Bash.artifact \u548C Bash.service \u4E0D\u80FD\u6DF7\u7528\u3002");
|
|
606
|
-
}
|
|
607
|
-
if (service !== void 0 && !serviceAction && command === void 0) {
|
|
608
|
-
throw new Error("Bash.service readiness \u5FC5\u987B\u548C Bash.command \u4E00\u8D77\u4F7F\u7528\u3002");
|
|
580
|
+
if (command === void 0) {
|
|
581
|
+
throw new Error("Bash.command \u5FC5\u987B\u63D0\u4F9B\u3002");
|
|
609
582
|
}
|
|
610
583
|
const runInBackground = record.runInBackground === true || record.run_in_background === true;
|
|
611
584
|
return {
|
|
612
585
|
command,
|
|
586
|
+
description: readOptionalString(record, "description", "Bash"),
|
|
613
587
|
timeoutMs: readOptionalPositiveInteger(record, "timeoutMs", "Bash"),
|
|
614
|
-
service,
|
|
615
|
-
binary,
|
|
616
|
-
artifact,
|
|
617
588
|
...runInBackground ? { runInBackground: true } : {}
|
|
618
589
|
};
|
|
619
590
|
}
|
|
620
|
-
function validateOptionalBashBinaryInspect(input) {
|
|
621
|
-
if (input === void 0) return void 0;
|
|
622
|
-
if (isEmptyOptionalObject(input)) return void 0;
|
|
623
|
-
const record = validateRecord(input, "Bash");
|
|
624
|
-
return {
|
|
625
|
-
path: readString(record, "path", "Bash"),
|
|
626
|
-
previewBytes: readOptionalPositiveInteger(record, "previewBytes", "Bash")
|
|
627
|
-
};
|
|
628
|
-
}
|
|
629
|
-
function validateOptionalBashArtifactCheck(input) {
|
|
630
|
-
if (input === void 0) return void 0;
|
|
631
|
-
if (isEmptyOptionalObject(input)) return void 0;
|
|
632
|
-
const record = validateRecord(input, "Bash");
|
|
633
|
-
return {
|
|
634
|
-
path: readString(record, "path", "Bash"),
|
|
635
|
-
expectHeader: readOptionalString(record, "expectHeader", "Bash"),
|
|
636
|
-
expectMagic: readOptionalString(record, "expectMagic", "Bash"),
|
|
637
|
-
json: readOptionalBoolean(record, "json", "Bash"),
|
|
638
|
-
executable: readOptionalBoolean(record, "executable", "Bash"),
|
|
639
|
-
protectPaths: readOptionalStringArray(record, "protectPaths", "Bash"),
|
|
640
|
-
text: validateOptionalBashArtifactTextCheck(record.text),
|
|
641
|
-
preserve: validateOptionalBashArtifactPreserveCheck(record.preserve)
|
|
642
|
-
};
|
|
643
|
-
}
|
|
644
|
-
function validateOptionalBashServiceInput(input) {
|
|
645
|
-
if (input === void 0) return void 0;
|
|
646
|
-
if (isEmptyOptionalObject(input)) return void 0;
|
|
647
|
-
const record = validateRecord(input, "Bash");
|
|
648
|
-
const action = readOptionalString(record, "action", "Bash");
|
|
649
|
-
if (action !== void 0) {
|
|
650
|
-
if (action === "fetch") {
|
|
651
|
-
const url = readString(record, "url", "Bash");
|
|
652
|
-
validateHttpUrl(url);
|
|
653
|
-
return {
|
|
654
|
-
action,
|
|
655
|
-
url,
|
|
656
|
-
expectStatus: readOptionalPositiveInteger(record, "expectStatus", "Bash"),
|
|
657
|
-
bodyContains: readOptionalStringOrStringArray(record, "bodyContains", "Bash"),
|
|
658
|
-
timeoutMs: readOptionalPositiveInteger(record, "timeoutMs", "Bash"),
|
|
659
|
-
retry: readOptionalPositiveInteger(record, "retry", "Bash"),
|
|
660
|
-
intervalMs: readOptionalPositiveInteger(record, "intervalMs", "Bash")
|
|
661
|
-
};
|
|
662
|
-
}
|
|
663
|
-
if (action === "status" || action === "probe" || action === "logs" || action === "stop") {
|
|
664
|
-
return {
|
|
665
|
-
action,
|
|
666
|
-
serviceId: readString(record, "serviceId", "Bash"),
|
|
667
|
-
...action === "logs" ? { tailBytes: readOptionalPositiveInteger(record, "tailBytes", "Bash") } : {}
|
|
668
|
-
};
|
|
669
|
-
}
|
|
670
|
-
throw new Error("Bash.service.action \u5FC5\u987B\u662F status/probe/logs/stop/fetch\u3002");
|
|
671
|
-
}
|
|
672
|
-
const type = readString(record, "type", "Bash");
|
|
673
|
-
const timeoutMs = readOptionalPositiveInteger(record, "timeoutMs", "Bash");
|
|
674
|
-
const intervalMs = readOptionalPositiveInteger(record, "intervalMs", "Bash");
|
|
675
|
-
if (type === "tcp") {
|
|
676
|
-
const rawPort = record.port;
|
|
677
|
-
if (!Number.isInteger(rawPort) || rawPort <= 0) {
|
|
678
|
-
throw new Error("Bash.service.port \u5FC5\u987B\u662F\u6B63\u6574\u6570\u3002");
|
|
679
|
-
}
|
|
680
|
-
const port = rawPort;
|
|
681
|
-
if (port > 65535) {
|
|
682
|
-
throw new Error("Bash.service.port \u5FC5\u987B\u5728 1-65535 \u8303\u56F4\u5185\u3002");
|
|
683
|
-
}
|
|
684
|
-
return {
|
|
685
|
-
type,
|
|
686
|
-
port,
|
|
687
|
-
host: readOptionalString(record, "host", "Bash"),
|
|
688
|
-
timeoutMs,
|
|
689
|
-
intervalMs
|
|
690
|
-
};
|
|
691
|
-
}
|
|
692
|
-
if (type === "http") {
|
|
693
|
-
const url = readString(record, "url", "Bash");
|
|
694
|
-
validateHttpUrl(url);
|
|
695
|
-
return { type, url, timeoutMs, intervalMs };
|
|
696
|
-
}
|
|
697
|
-
throw new Error("Bash.service.type \u5FC5\u987B\u662F tcp \u6216 http\u3002");
|
|
698
|
-
}
|
|
699
|
-
function isEmptyOptionalObject(input) {
|
|
700
|
-
return input === null || typeof input === "object" && !Array.isArray(input) && Object.keys(input).length === 0;
|
|
701
|
-
}
|
|
702
|
-
function isBashServiceLifecycleAction(input) {
|
|
703
|
-
return Boolean(input && "action" in input);
|
|
704
|
-
}
|
|
705
591
|
function validateTodoInput(input) {
|
|
706
592
|
const record = validateRecord(input, "Todo");
|
|
707
593
|
const action = readString(record, "action", "Todo");
|
|
@@ -759,53 +645,6 @@ function readOptionalStringArray(record, key, toolName) {
|
|
|
759
645
|
}
|
|
760
646
|
return value;
|
|
761
647
|
}
|
|
762
|
-
function readOptionalBoolean(record, key, toolName) {
|
|
763
|
-
const value = record[key];
|
|
764
|
-
if (value === void 0) return void 0;
|
|
765
|
-
if (typeof value !== "boolean") {
|
|
766
|
-
throw new Error(`${toolName}.${key} \u5FC5\u987B\u662F boolean \u6216 undefined\u3002`);
|
|
767
|
-
}
|
|
768
|
-
return value;
|
|
769
|
-
}
|
|
770
|
-
function readOptionalStringOrStringArray(record, key, toolName) {
|
|
771
|
-
const value = record[key];
|
|
772
|
-
if (value === void 0) return void 0;
|
|
773
|
-
if (typeof value === "string") return value;
|
|
774
|
-
if (Array.isArray(value) && value.every((item) => typeof item === "string")) return value;
|
|
775
|
-
throw new Error(`${toolName}.${key} \u5FC5\u987B\u662F\u5B57\u7B26\u4E32\u3001\u5B57\u7B26\u4E32\u6570\u7EC4\u6216 undefined\u3002`);
|
|
776
|
-
}
|
|
777
|
-
function validateOptionalBashArtifactTextCheck(input) {
|
|
778
|
-
if (input === void 0) return void 0;
|
|
779
|
-
const record = validateRecord(input, "Bash");
|
|
780
|
-
return {
|
|
781
|
-
exact: readOptionalString(record, "exact", "Bash"),
|
|
782
|
-
contains: readOptionalStringOrStringArray(record, "contains", "Bash"),
|
|
783
|
-
lineSet: readOptionalStringArray(record, "lineSet", "Bash")
|
|
784
|
-
};
|
|
785
|
-
}
|
|
786
|
-
function validateOptionalBashArtifactPreserveCheck(input) {
|
|
787
|
-
if (input === void 0) return void 0;
|
|
788
|
-
const record = validateRecord(input, "Bash");
|
|
789
|
-
const mode = readString(record, "mode", "Bash");
|
|
790
|
-
if (mode !== "rawPreserve" && mode !== "compareNormalizedHtml") {
|
|
791
|
-
throw new Error("Bash.artifact.preserve.mode \u5FC5\u987B\u662F rawPreserve \u6216 compareNormalizedHtml\u3002");
|
|
792
|
-
}
|
|
793
|
-
return {
|
|
794
|
-
mode,
|
|
795
|
-
expectedPath: readOptionalString(record, "expectedPath", "Bash"),
|
|
796
|
-
expectedText: readOptionalString(record, "expectedText", "Bash")
|
|
797
|
-
};
|
|
798
|
-
}
|
|
799
|
-
function validateHttpUrl(url) {
|
|
800
|
-
try {
|
|
801
|
-
const parsed = new URL(url);
|
|
802
|
-
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
|
|
803
|
-
throw new Error("protocol");
|
|
804
|
-
}
|
|
805
|
-
} catch {
|
|
806
|
-
throw new Error("Bash.service.url \u5FC5\u987B\u662F http/https URL\u3002");
|
|
807
|
-
}
|
|
808
|
-
}
|
|
809
648
|
async function readTool(input, context) {
|
|
810
649
|
const filePath = resolveWorkspacePath(context.workspaceRoot, input.path);
|
|
811
650
|
const content = await readFile(filePath, "utf8");
|
|
@@ -1182,43 +1021,14 @@ function sanitizeSecrets(text) {
|
|
|
1182
1021
|
return sanitized;
|
|
1183
1022
|
}
|
|
1184
1023
|
async function bashTool(input, context) {
|
|
1185
|
-
if (input.artifact) {
|
|
1186
|
-
return checkArtifact({
|
|
1187
|
-
input: input.artifact,
|
|
1188
|
-
target: resolveArtifactPath(context, input.artifact.path),
|
|
1189
|
-
protectPaths: (input.artifact.protectPaths ?? []).map((path) => resolveArtifactPath(context, path)),
|
|
1190
|
-
context
|
|
1191
|
-
});
|
|
1192
|
-
}
|
|
1193
|
-
if (input.binary) {
|
|
1194
|
-
return inspectBinaryFile(input.binary, resolveWorkspacePath(context.workspaceRoot, input.binary.path));
|
|
1195
|
-
}
|
|
1196
1024
|
if (!input.command) {
|
|
1197
|
-
|
|
1198
|
-
return runBashServiceLifecycleAction(input.service, context);
|
|
1199
|
-
}
|
|
1200
|
-
throw new Error("Bash.command\u3001Bash.binary \u6216 Bash.service action \u5FC5\u987B\u63D0\u4F9B\u4E00\u4E2A\u3002");
|
|
1025
|
+
throw new Error("Bash.command \u5FC5\u987B\u63D0\u4F9B\u3002");
|
|
1201
1026
|
}
|
|
1202
1027
|
const logRoot = context.logRoot ?? join(context.workspaceRoot, ".linghun", "logs", "tools");
|
|
1203
1028
|
await mkdir(logRoot, { recursive: true });
|
|
1204
1029
|
const fullOutputPath = join(logRoot, `bash-${Date.now()}-${randomUUID()}.log`);
|
|
1205
1030
|
const timeoutMs = input.timeoutMs ?? BASH_TIMEOUT_MS;
|
|
1206
1031
|
const adapted = adaptShellCommand(input.command);
|
|
1207
|
-
if (input.service && !isBashServiceLifecycleAction(input.service)) {
|
|
1208
|
-
const readiness = withDefaultServiceReadiness(input.service, context);
|
|
1209
|
-
return startBashService({
|
|
1210
|
-
command: adapted.command,
|
|
1211
|
-
logCommand: adapted.logCommand ?? adapted.command,
|
|
1212
|
-
cwd: context.workspaceRoot,
|
|
1213
|
-
fullOutputPath,
|
|
1214
|
-
readiness,
|
|
1215
|
-
context,
|
|
1216
|
-
abortSignal: context.abortSignal,
|
|
1217
|
-
onProgress: (stream, text) => void context.onProgress?.({ toolName: "Bash", stream, text }),
|
|
1218
|
-
trackChildProcess: context.trackChildProcess,
|
|
1219
|
-
sanitizeText: sanitizeSecrets
|
|
1220
|
-
});
|
|
1221
|
-
}
|
|
1222
1032
|
if (input.runInBackground === true) {
|
|
1223
1033
|
const taskId = randomUUID();
|
|
1224
1034
|
void runBackgroundBash({
|
|
@@ -1787,14 +1597,6 @@ function isHeadlessBenchContext(context) {
|
|
|
1787
1597
|
const record = context;
|
|
1788
1598
|
return record.headlessBench?.enabled === true || record.isHeadlessBench === true;
|
|
1789
1599
|
}
|
|
1790
|
-
function withDefaultServiceReadiness(readiness, context) {
|
|
1791
|
-
if (readiness.timeoutMs !== void 0) return readiness;
|
|
1792
|
-
const hasReadinessRisk = (context.recentDiagnostics ?? []).some(
|
|
1793
|
-
(diagnostic) => diagnostic.type === "service_readiness" || diagnostic.type === "timeout"
|
|
1794
|
-
);
|
|
1795
|
-
const timeoutMs = hasReadinessRisk ? 15e3 : isHeadlessBenchContext(context) ? 1e4 : 5e3;
|
|
1796
|
-
return { ...readiness, timeoutMs };
|
|
1797
|
-
}
|
|
1798
1600
|
function createBashOutcomeDiagnostics(outcome) {
|
|
1799
1601
|
if (outcome === "timeout") {
|
|
1800
1602
|
return [
|
|
@@ -1824,6 +1626,8 @@ function adaptShellCommandForPlatform(command, platform) {
|
|
|
1824
1626
|
"Unsupported multi-line Unix shell syntax on Windows PowerShell; use PowerShell-safe commands or Node one-liners."
|
|
1825
1627
|
);
|
|
1826
1628
|
}
|
|
1629
|
+
const nativePowerShell = convertNativePowerShellCommand(command);
|
|
1630
|
+
if (nativePowerShell) return nativePowerShell;
|
|
1827
1631
|
const converted = convertUnixPipelineForPowerShell(command);
|
|
1828
1632
|
if (converted) return { command: converted, adapter: "powershell-adapted" };
|
|
1829
1633
|
const readOnlyCommand = convertUnixReadOnlyCommandForPowerShell(command);
|
|
@@ -1836,6 +1640,22 @@ function adaptShellCommandForPlatform(command, platform) {
|
|
|
1836
1640
|
if (unsupportedReadOnlyCommand) return unsupportedReadOnlyCommand;
|
|
1837
1641
|
return { command, adapter: "native" };
|
|
1838
1642
|
}
|
|
1643
|
+
function convertNativePowerShellCommand(command) {
|
|
1644
|
+
const normalized = command.trim();
|
|
1645
|
+
if (!normalized) return void 0;
|
|
1646
|
+
if (/^(?:powershell(?:\.exe)?|pwsh(?:\.exe)?)\b/iu.test(normalized)) return void 0;
|
|
1647
|
+
if (!/^(?:Get|Set|New|Remove|Select|ForEach|Where|Test|Resolve|Join|Split|Copy|Move|Write|Out|Measure|Compare|Sort|Format)-[A-Za-z]+\b/u.test(normalized)) {
|
|
1648
|
+
return void 0;
|
|
1649
|
+
}
|
|
1650
|
+
return {
|
|
1651
|
+
command: [
|
|
1652
|
+
"powershell.exe -NoProfile -NonInteractive -Command",
|
|
1653
|
+
quoteCmdArg(`$ErrorActionPreference='Stop'; ${normalized}`)
|
|
1654
|
+
].join(" "),
|
|
1655
|
+
adapter: "powershell-adapted",
|
|
1656
|
+
logCommand: `powershell.exe -NoProfile -NonInteractive -Command <powershell cmdlet>`
|
|
1657
|
+
};
|
|
1658
|
+
}
|
|
1839
1659
|
function convertNodeHereDocForPowerShell(command) {
|
|
1840
1660
|
const normalized = command.replace(/\r\n/gu, "\n");
|
|
1841
1661
|
const match = normalized.match(
|
|
@@ -2182,14 +2002,6 @@ function resolveWorkspacePath(workspaceRoot, inputPath) {
|
|
|
2182
2002
|
function relativePath(workspaceRoot, filePath) {
|
|
2183
2003
|
return relative(workspaceRoot, filePath).replaceAll("\\", "/") || ".";
|
|
2184
2004
|
}
|
|
2185
|
-
function resolveArtifactPath(context, inputPath) {
|
|
2186
|
-
const absolute = resolveWorkspacePath(context.workspaceRoot, inputPath);
|
|
2187
|
-
return {
|
|
2188
|
-
input: inputPath,
|
|
2189
|
-
absolute,
|
|
2190
|
-
relative: relativePath(context.workspaceRoot, absolute)
|
|
2191
|
-
};
|
|
2192
|
-
}
|
|
2193
2005
|
function ensureUnique(content, oldText) {
|
|
2194
2006
|
if (!oldText) {
|
|
2195
2007
|
throw new Error("oldText \u4E0D\u80FD\u4E3A\u7A7A\u3002\u5EFA\u8BAE\uFF1A\u63D0\u4F9B\u8DB3\u591F\u4E0A\u4E0B\u6587\u7684\u552F\u4E00\u7247\u6BB5\u3002");
|
package/dist/tools/prompts.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
toolPrompts
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-ZGLZZKO6.js";
|
|
4
4
|
import "../chunk-4EZHIDZ6.js";
|
|
5
5
|
import "../chunk-I3Z4OKMS.js";
|
|
6
6
|
import "../chunk-PS2ZOFZ6.js";
|
|
7
7
|
import "../chunk-NPKLGVDQ.js";
|
|
8
|
-
import "../chunk-VJDLOFCF.js";
|
|
9
|
-
import "../chunk-3RP665TH.js";
|
|
10
|
-
import "../chunk-IOC3BSPT.js";
|
|
11
8
|
import "../chunk-LGZOG7IQ.js";
|
|
12
9
|
import "../chunk-ZYAEUABC.js";
|
|
13
10
|
import "../chunk-SWK6XRZQ.js";
|
|
@@ -22,19 +19,22 @@ import "../chunk-YCO6C7KF.js";
|
|
|
22
19
|
import "../chunk-4567YAXM.js";
|
|
23
20
|
import "../chunk-XZWSO5CM.js";
|
|
24
21
|
import "../chunk-SZFZPQGL.js";
|
|
25
|
-
import "../chunk-WLQ7DGMG.js";
|
|
26
|
-
import "../chunk-SQP6SJRP.js";
|
|
27
|
-
import "../chunk-BRG64AEC.js";
|
|
28
22
|
import "../chunk-AZCQL24J.js";
|
|
29
23
|
import "../chunk-HUIZOB4A.js";
|
|
30
24
|
import "../chunk-MK3YP2VR.js";
|
|
25
|
+
import "../chunk-WLQ7DGMG.js";
|
|
26
|
+
import "../chunk-SQP6SJRP.js";
|
|
27
|
+
import "../chunk-BRG64AEC.js";
|
|
31
28
|
import "../chunk-HNIVNZIS.js";
|
|
32
29
|
import "../chunk-7ZOADACP.js";
|
|
33
30
|
import "../chunk-H5OOD2OS.js";
|
|
34
31
|
import "../chunk-IQP3XE32.js";
|
|
35
|
-
import "../chunk-
|
|
36
|
-
import "../chunk-ITBZHMZQ.js";
|
|
32
|
+
import "../chunk-DN3KJZRV.js";
|
|
37
33
|
import "../chunk-2U4BZXAI.js";
|
|
34
|
+
import "../chunk-ITBZHMZQ.js";
|
|
35
|
+
import "../chunk-3NZ3IOPM.js";
|
|
36
|
+
import "../chunk-IOC3BSPT.js";
|
|
37
|
+
import "../chunk-3RP665TH.js";
|
|
38
38
|
import "../chunk-2DIXRINW.js";
|
|
39
39
|
import "../chunk-PKMIDA5A.js";
|
|
40
40
|
import "../chunk-GAWMEMXB.js";
|
package/dist/tools/ui.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
toolUserFacingNames
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-6BBM4UX3.js";
|
|
4
4
|
import "../chunk-4EZHIDZ6.js";
|
|
5
5
|
import "../chunk-I3Z4OKMS.js";
|
|
6
6
|
import "../chunk-PS2ZOFZ6.js";
|
|
7
7
|
import "../chunk-NPKLGVDQ.js";
|
|
8
|
-
import "../chunk-VJDLOFCF.js";
|
|
9
|
-
import "../chunk-3RP665TH.js";
|
|
10
|
-
import "../chunk-IOC3BSPT.js";
|
|
11
8
|
import "../chunk-LGZOG7IQ.js";
|
|
12
9
|
import "../chunk-ZYAEUABC.js";
|
|
13
10
|
import "../chunk-SWK6XRZQ.js";
|
|
@@ -22,19 +19,22 @@ import "../chunk-YCO6C7KF.js";
|
|
|
22
19
|
import "../chunk-4567YAXM.js";
|
|
23
20
|
import "../chunk-XZWSO5CM.js";
|
|
24
21
|
import "../chunk-SZFZPQGL.js";
|
|
25
|
-
import "../chunk-WLQ7DGMG.js";
|
|
26
|
-
import "../chunk-SQP6SJRP.js";
|
|
27
|
-
import "../chunk-BRG64AEC.js";
|
|
28
22
|
import "../chunk-AZCQL24J.js";
|
|
29
23
|
import "../chunk-HUIZOB4A.js";
|
|
30
24
|
import "../chunk-MK3YP2VR.js";
|
|
25
|
+
import "../chunk-WLQ7DGMG.js";
|
|
26
|
+
import "../chunk-SQP6SJRP.js";
|
|
27
|
+
import "../chunk-BRG64AEC.js";
|
|
31
28
|
import "../chunk-HNIVNZIS.js";
|
|
32
29
|
import "../chunk-7ZOADACP.js";
|
|
33
30
|
import "../chunk-H5OOD2OS.js";
|
|
34
31
|
import "../chunk-IQP3XE32.js";
|
|
35
|
-
import "../chunk-
|
|
36
|
-
import "../chunk-ITBZHMZQ.js";
|
|
32
|
+
import "../chunk-DN3KJZRV.js";
|
|
37
33
|
import "../chunk-2U4BZXAI.js";
|
|
34
|
+
import "../chunk-ITBZHMZQ.js";
|
|
35
|
+
import "../chunk-3NZ3IOPM.js";
|
|
36
|
+
import "../chunk-IOC3BSPT.js";
|
|
37
|
+
import "../chunk-3RP665TH.js";
|
|
38
38
|
import "../chunk-2DIXRINW.js";
|
|
39
39
|
import "../chunk-PKMIDA5A.js";
|
|
40
40
|
import "../chunk-GAWMEMXB.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linghun/tools",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -11,19 +11,15 @@
|
|
|
11
11
|
"import": "./dist/index.js"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
|
-
"files": [
|
|
15
|
-
"dist",
|
|
16
|
-
"!dist/**/*.test.*",
|
|
17
|
-
"!dist/**/tsconfig.tsbuildinfo"
|
|
18
|
-
],
|
|
14
|
+
"files": ["dist", "!dist/**/*.test.*", "!dist/**/tsconfig.tsbuildinfo"],
|
|
19
15
|
"publishConfig": {
|
|
20
16
|
"access": "public"
|
|
21
17
|
},
|
|
22
|
-
"dependencies": {
|
|
23
|
-
"parse5": "^8.0.1"
|
|
24
|
-
},
|
|
25
18
|
"scripts": {
|
|
26
19
|
"build": "tsup \"src/**/*.ts\" \"!src/**/*.test.ts\" --format esm --clean && tsc -p tsconfig.json --emitDeclarationOnly --noEmit false --tsBuildInfoFile dist/tsconfig.tsbuildinfo",
|
|
27
20
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"parse5": "^8.0.1"
|
|
28
24
|
}
|
|
29
|
-
}
|
|
25
|
+
}
|