@linghun/tools 0.1.6 → 0.1.8

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.
@@ -1,15 +1,12 @@
1
1
  import {
2
2
  WebFetchTool
3
3
  } from "./chunk-LGZOG7IQ.js";
4
- import {
5
- WebSearchTool
6
- } from "./chunk-4EZHIDZ6.js";
7
4
  import {
8
5
  WriteTool
9
6
  } from "./chunk-I3Z4OKMS.js";
10
7
  import {
11
- ReadTool
12
- } from "./chunk-TZ6QK52L.js";
8
+ WebSearchTool
9
+ } from "./chunk-4EZHIDZ6.js";
13
10
  import {
14
11
  ReadSnippetsTool
15
12
  } from "./chunk-GI5XI4HN.js";
@@ -19,24 +16,27 @@ import {
19
16
  import {
20
17
  TodoTool
21
18
  } from "./chunk-4567YAXM.js";
19
+ import {
20
+ ReadTool
21
+ } from "./chunk-RBHQ5WNR.js";
22
22
  import {
23
23
  GrepTool
24
24
  } from "./chunk-AZCQL24J.js";
25
+ import {
26
+ BashTool
27
+ } from "./chunk-2DIXRINW.js";
28
+ import {
29
+ GlobTool
30
+ } from "./chunk-DN3KJZRV.js";
25
31
  import {
26
32
  MultiEditTool
27
33
  } from "./chunk-VJDLOFCF.js";
28
34
  import {
29
35
  EditTool
30
36
  } from "./chunk-WLQ7DGMG.js";
31
- import {
32
- GlobTool
33
- } from "./chunk-Z3H6SZBS.js";
34
37
  import {
35
38
  DiffTool
36
39
  } from "./chunk-7ZOADACP.js";
37
- import {
38
- BashTool
39
- } from "./chunk-2DIXRINW.js";
40
40
 
41
41
  // src/tools/prompts.ts
42
42
  var toolPrompts = {
@@ -1,15 +1,12 @@
1
1
  import {
2
2
  WebFetchTool
3
3
  } from "./chunk-LGZOG7IQ.js";
4
- import {
5
- WebSearchTool
6
- } from "./chunk-4EZHIDZ6.js";
7
4
  import {
8
5
  WriteTool
9
6
  } from "./chunk-I3Z4OKMS.js";
10
7
  import {
11
- ReadTool
12
- } from "./chunk-TZ6QK52L.js";
8
+ WebSearchTool
9
+ } from "./chunk-4EZHIDZ6.js";
13
10
  import {
14
11
  ReadSnippetsTool
15
12
  } from "./chunk-GI5XI4HN.js";
@@ -19,24 +16,27 @@ import {
19
16
  import {
20
17
  TodoTool
21
18
  } from "./chunk-4567YAXM.js";
19
+ import {
20
+ ReadTool
21
+ } from "./chunk-RBHQ5WNR.js";
22
22
  import {
23
23
  GrepTool
24
24
  } from "./chunk-AZCQL24J.js";
25
+ import {
26
+ BashTool
27
+ } from "./chunk-2DIXRINW.js";
28
+ import {
29
+ GlobTool
30
+ } from "./chunk-DN3KJZRV.js";
25
31
  import {
26
32
  MultiEditTool
27
33
  } from "./chunk-VJDLOFCF.js";
28
34
  import {
29
35
  EditTool
30
36
  } from "./chunk-WLQ7DGMG.js";
31
- import {
32
- GlobTool
33
- } from "./chunk-Z3H6SZBS.js";
34
37
  import {
35
38
  DiffTool
36
39
  } from "./chunk-7ZOADACP.js";
37
- import {
38
- BashTool
39
- } from "./chunk-2DIXRINW.js";
40
40
 
41
41
  // src/tools/ui.ts
42
42
  var toolUserFacingNames = {
package/dist/index.d.ts CHANGED
@@ -169,6 +169,16 @@ export type BashInput = {
169
169
  runInBackground?: boolean;
170
170
  run_in_background?: boolean;
171
171
  };
172
+ type BashDiagnosticType = "missing_command" | "missing_python_module" | "timeout" | "no_output" | "prompt" | "provider_or_network";
173
+ type BashDiagnosticSeverity = "info" | "recoverable" | "blocking";
174
+ type BashDiagnostic = {
175
+ type: BashDiagnosticType;
176
+ severity: BashDiagnosticSeverity;
177
+ evidence: string;
178
+ suggestion: string;
179
+ command?: string;
180
+ fallback?: string;
181
+ };
172
182
  export type TodoInput = {
173
183
  action: "list";
174
184
  } | {
@@ -241,6 +251,18 @@ type ShellCommandAdapter = {
241
251
  adapter: "native" | "powershell-adapted" | "blocked";
242
252
  logCommand?: string;
243
253
  };
254
+ type CommandDomain = "host" | "explicit_shell" | "remote_shell" | "ambiguous";
255
+ type CommandClassification = {
256
+ domain: CommandDomain;
257
+ program: string;
258
+ hostArgs: string[];
259
+ remotePayload?: string;
260
+ hasHostPipeline: boolean;
261
+ confidence: "high" | "medium" | "low";
262
+ };
263
+ export declare function __testCreateBashOutcomeDiagnostics(command: string, outcome: "completed" | "timeout" | "cancelled"): BashDiagnostic[];
264
+ export declare function __testCreateBashPromptDiagnostic(tail: string): BashDiagnostic | undefined;
265
+ export declare function __testClassifyWindowsShellCommand(command: string): CommandClassification;
244
266
  export declare function adaptShellCommand(command: string): ShellCommandAdapter;
245
267
  export declare function adaptShellCommandForPlatform(command: string, platform: NodeJS.Platform): ShellCommandAdapter;
246
268
  declare function globToRegExp(pattern: string): RegExp;
@@ -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;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;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Q,GAAG,QAAQ,EAAE,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,CA8K9E;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
@@ -1,12 +1,12 @@
1
- import {
2
- formatFetchOutput,
3
- webFetch
4
- } from "./chunk-4UHQWBFA.js";
5
1
  import {
6
2
  applyDomainFilter,
7
3
  bingSearch,
8
4
  formatSearchOutput
9
5
  } from "./chunk-EPIB4FSE.js";
6
+ import {
7
+ formatFetchOutput,
8
+ webFetch
9
+ } from "./chunk-4UHQWBFA.js";
10
10
  import {
11
11
  interpretCommandResult
12
12
  } from "./chunk-FI4YPDFE.js";
@@ -15,21 +15,19 @@ import {
15
15
  } from "./chunk-MMJX44V6.js";
16
16
  import {
17
17
  toolPrompts
18
- } from "./chunk-VVRFYPMG.js";
18
+ } from "./chunk-FZLD6M3Y.js";
19
19
  import {
20
20
  toolUserFacingNames
21
- } from "./chunk-24USSE7U.js";
21
+ } from "./chunk-X6DHCZQQ.js";
22
22
  import "./chunk-LGZOG7IQ.js";
23
- import "./chunk-ZYAEUABC.js";
24
- import "./chunk-SWK6XRZQ.js";
25
- import "./chunk-4EZHIDZ6.js";
26
- import "./chunk-YR4HWOR2.js";
27
- import "./chunk-VAFW24RN.js";
28
23
  import "./chunk-I3Z4OKMS.js";
29
24
  import "./chunk-PS2ZOFZ6.js";
30
25
  import "./chunk-NPKLGVDQ.js";
31
- import "./chunk-TZ6QK52L.js";
32
- import "./chunk-K3YDFDLP.js";
26
+ import "./chunk-4EZHIDZ6.js";
27
+ import "./chunk-YR4HWOR2.js";
28
+ import "./chunk-VAFW24RN.js";
29
+ import "./chunk-ZYAEUABC.js";
30
+ import "./chunk-SWK6XRZQ.js";
33
31
  import "./chunk-GI5XI4HN.js";
34
32
  import "./chunk-WEWXKRKL.js";
35
33
  import "./chunk-A6FUAM64.js";
@@ -37,25 +35,27 @@ import "./chunk-YCO6C7KF.js";
37
35
  import "./chunk-4567YAXM.js";
38
36
  import "./chunk-XZWSO5CM.js";
39
37
  import "./chunk-SZFZPQGL.js";
38
+ import "./chunk-RBHQ5WNR.js";
39
+ import "./chunk-HNIVNZIS.js";
40
+ import "./chunk-K3YDFDLP.js";
40
41
  import "./chunk-AZCQL24J.js";
41
42
  import "./chunk-HUIZOB4A.js";
42
43
  import "./chunk-MK3YP2VR.js";
44
+ import "./chunk-2DIXRINW.js";
45
+ import "./chunk-PKMIDA5A.js";
46
+ import "./chunk-GAWMEMXB.js";
47
+ import "./chunk-DN3KJZRV.js";
48
+ import "./chunk-2U4BZXAI.js";
49
+ import "./chunk-ITBZHMZQ.js";
43
50
  import "./chunk-VJDLOFCF.js";
44
51
  import "./chunk-3RP665TH.js";
45
52
  import "./chunk-IOC3BSPT.js";
46
- import "./chunk-HNIVNZIS.js";
47
53
  import "./chunk-WLQ7DGMG.js";
48
54
  import "./chunk-SQP6SJRP.js";
49
55
  import "./chunk-BRG64AEC.js";
50
- import "./chunk-Z3H6SZBS.js";
51
- import "./chunk-ITBZHMZQ.js";
52
- import "./chunk-2U4BZXAI.js";
53
56
  import "./chunk-7ZOADACP.js";
54
57
  import "./chunk-H5OOD2OS.js";
55
58
  import "./chunk-IQP3XE32.js";
56
- import "./chunk-2DIXRINW.js";
57
- import "./chunk-PKMIDA5A.js";
58
- import "./chunk-GAWMEMXB.js";
59
59
 
60
60
  // src/index.ts
61
61
  import { spawn } from "child_process";
@@ -1079,10 +1079,11 @@ outputPath: ${fullOutputPath}`,
1079
1079
  [`$ ${sanitizeSecrets(commandForLog)}`, ...adapterLines],
1080
1080
  context.abortSignal,
1081
1081
  (stream, text) => void context.onProgress?.({ toolName: "Bash", stream, text }),
1082
- context.trackChildProcess
1082
+ context.trackChildProcess,
1083
+ createBashNoOutputHint(input.command)
1083
1084
  );
1084
1085
  const cmdInterpretation = interpretCommandResult(input.command, result.exitCode);
1085
- const diagnostics = createBashOutcomeDiagnostics(result.outcome);
1086
+ const diagnostics = createBashOutcomeDiagnostics(input.command, result.outcome);
1086
1087
  const trailerLines = [
1087
1088
  "",
1088
1089
  `exit code ${result.exitCode}`,
@@ -1644,53 +1645,251 @@ function isHeadlessBenchContext(context) {
1644
1645
  const record = context;
1645
1646
  return record.headlessBench?.enabled === true || record.isHeadlessBench === true;
1646
1647
  }
1647
- function createBashOutcomeDiagnostics(outcome) {
1648
- if (outcome === "timeout") {
1649
- return [
1650
- {
1651
- type: "timeout",
1652
- severity: "recoverable",
1653
- evidence: "Bash outcome timeout",
1654
- suggestion: "Run the smallest focused check first and avoid repeating long blind commands."
1655
- }
1656
- ];
1648
+ function createBashOutcomeDiagnostics(command, outcome) {
1649
+ if (outcome !== "timeout") return [];
1650
+ const diagnostics = [
1651
+ {
1652
+ type: "timeout",
1653
+ severity: "recoverable",
1654
+ evidence: "Bash outcome timeout",
1655
+ suggestion: "Run the smallest focused check first and avoid repeating long blind commands."
1656
+ }
1657
+ ];
1658
+ const remoteShellDiagnostic = createRemoteShellNoOutputDiagnostic(command);
1659
+ if (remoteShellDiagnostic) diagnostics.push(remoteShellDiagnostic);
1660
+ return diagnostics;
1661
+ }
1662
+ function createRemoteShellNoOutputDiagnostic(command) {
1663
+ const classification = classifyWindowsShellCommand(command);
1664
+ if (classification.domain !== "remote_shell" && !isRemoteShellProgram(classification.program)) {
1665
+ return void 0;
1666
+ }
1667
+ return {
1668
+ type: "no_output",
1669
+ severity: "recoverable",
1670
+ evidence: `Remote shell command timed out or stayed silent: ${classification.program}`,
1671
+ suggestion: "Check device authorization, remote command interactivity, quote boundaries, and whether host-level pipes should be moved inside the quoted remote payload."
1672
+ };
1673
+ }
1674
+ function createBashNoOutputHint(command) {
1675
+ const classification = classifyWindowsShellCommand(command);
1676
+ if (classification.domain !== "remote_shell" && !isRemoteShellProgram(classification.program)) {
1677
+ return void 0;
1657
1678
  }
1658
- return [];
1679
+ return "\u8FDC\u7AEF/\u8BBE\u5907\u547D\u4EE4\u957F\u65F6\u95F4\u65E0\u8F93\u51FA\u65F6\uFF0C\u4F18\u5148\u68C0\u67E5\u8BBE\u5907\u6388\u6743\u3001\u4EA4\u4E92\u5F0F\u7B49\u5F85\u3001quote \u8FB9\u754C\uFF0C\u4EE5\u53CA\u5BBF\u4E3B\u5C42\u7BA1\u7EBF\u662F\u5426\u8BEF\u653E\u5728\u8FDC\u7AEF payload \u5916\u3002";
1659
1680
  }
1660
1681
  function tailLines(text, limit) {
1661
1682
  const lines = text.split(/\r?\n/u);
1662
1683
  return lines.slice(Math.max(0, lines.length - limit));
1663
1684
  }
1685
+ function __testCreateBashOutcomeDiagnostics(command, outcome) {
1686
+ return createBashOutcomeDiagnostics(command, outcome);
1687
+ }
1688
+ function __testCreateBashPromptDiagnostic(tail) {
1689
+ return createBashPromptDiagnostic(tail);
1690
+ }
1691
+ function __testClassifyWindowsShellCommand(command) {
1692
+ return classifyWindowsShellCommand(command);
1693
+ }
1664
1694
  function adaptShellCommand(command) {
1665
1695
  return adaptShellCommandForPlatform(command, process.platform);
1666
1696
  }
1667
1697
  function adaptShellCommandForPlatform(command, platform) {
1668
1698
  if (platform !== "win32") return { command, adapter: "native" };
1669
1699
  if (isExplicitPowerShellCommand(command)) return { command, adapter: "native" };
1670
- const fileWriteBlock = blockWindowsShellFileWriteCommand(command);
1671
- if (fileWriteBlock) return fileWriteBlock;
1672
- const heredoc = convertNodeHereDocForPowerShell(command);
1673
- if (heredoc) return heredoc;
1674
- const nativePowerShell = convertNativePowerShellCommand(command);
1675
- if (nativePowerShell) return nativePowerShell;
1676
- if (looksLikeUnsupportedUnixMultiline(command)) {
1677
- return createBlockedPowerShellAdapter(
1700
+ const classification = classifyWindowsShellCommand(command);
1701
+ for (const adapter of WINDOWS_SHELL_ADAPTER_REGISTRY) {
1702
+ const adapted = adapter.adapt(command, classification);
1703
+ if (adapted) return adapted;
1704
+ }
1705
+ return { command, adapter: "native" };
1706
+ }
1707
+ var WINDOWS_SHELL_ADAPTER_REGISTRY = [
1708
+ {
1709
+ name: "DiagnosticAdapter",
1710
+ adapt: (_command, classification) => {
1711
+ if (classification.domain !== "ambiguous" || !isRemoteShellProgram(classification.program)) {
1712
+ return void 0;
1713
+ }
1714
+ return createBlockedPowerShellAdapter(
1715
+ "Ambiguous remote shell command on Windows: host-level pipeline detected outside the remote payload; quote the remote command or use a PowerShell-safe host pipeline."
1716
+ );
1717
+ }
1718
+ },
1719
+ {
1720
+ name: "RemoteShellAdapter",
1721
+ adapt: (command, classification) => classification.domain === "remote_shell" ? { command, adapter: "native" } : void 0
1722
+ },
1723
+ {
1724
+ name: "BlockedWriteAdapter",
1725
+ adapt: (command) => blockWindowsShellFileWriteCommand(command)
1726
+ },
1727
+ {
1728
+ name: "ExplicitShellAdapter",
1729
+ adapt: (command, classification) => classification.domain === "explicit_shell" ? { command, adapter: "native" } : void 0
1730
+ },
1731
+ {
1732
+ name: "NodeHereDocAdapter",
1733
+ adapt: (command) => convertNodeHereDocForPowerShell(command)
1734
+ },
1735
+ {
1736
+ name: "NativePowerShellAdapter",
1737
+ adapt: (command) => convertNativePowerShellCommand(command)
1738
+ },
1739
+ {
1740
+ name: "UnsupportedMultilineAdapter",
1741
+ adapt: (command) => looksLikeUnsupportedUnixMultiline(command) ? createBlockedPowerShellAdapter(
1678
1742
  "Unsupported multi-line Unix shell syntax on Windows PowerShell; use PowerShell-safe commands or Node one-liners."
1679
- );
1743
+ ) : void 0
1744
+ },
1745
+ {
1746
+ name: "UnsupportedPosixAdapter",
1747
+ adapt: (command) => blockUnsupportedPosixShellSyntax(command)
1748
+ },
1749
+ {
1750
+ name: "WindowsPipelineAdapter",
1751
+ adapt: (command) => {
1752
+ const converted = convertUnixPipelineForPowerShell(command);
1753
+ return converted ? { command: converted, adapter: "powershell-adapted" } : void 0;
1754
+ }
1755
+ },
1756
+ {
1757
+ name: "WindowsReadOnlyAdapter",
1758
+ adapt: (command) => convertUnixReadOnlyCommandForPowerShell(command)
1759
+ },
1760
+ {
1761
+ name: "UnsupportedPipelineAdapter",
1762
+ adapt: (command) => looksLikeUnsupportedUnixPipeline(command) ? createBlockedPowerShellAdapter(
1763
+ "Unsupported Unix pipeline on Windows PowerShell; use PowerShell-safe commands or Node one-liners."
1764
+ ) : void 0
1765
+ },
1766
+ {
1767
+ name: "UnsupportedReadOnlyAdapter",
1768
+ adapt: (command) => blockUnsupportedUnixReadOnlyCommand(command)
1680
1769
  }
1681
- const unsupportedPosix = blockUnsupportedPosixShellSyntax(command);
1682
- if (unsupportedPosix) return unsupportedPosix;
1683
- const converted = convertUnixPipelineForPowerShell(command);
1684
- if (converted) return { command: converted, adapter: "powershell-adapted" };
1685
- const readOnlyCommand = convertUnixReadOnlyCommandForPowerShell(command);
1686
- if (readOnlyCommand) return readOnlyCommand;
1687
- if (looksLikeUnsupportedUnixPipeline(command)) {
1688
- const message = "Unsupported Unix pipeline on Windows PowerShell; use PowerShell-safe commands or Node one-liners.";
1689
- return createBlockedPowerShellAdapter(message);
1770
+ ];
1771
+ function classifyWindowsShellCommand(command) {
1772
+ const tokens = tokenizeShellCommandWords(command);
1773
+ const hasHostPipeline = hasUnquotedShellPipe(command);
1774
+ const program = tokens?.[0]?.toLowerCase() ?? "";
1775
+ const hostArgs = tokens?.slice(1) ?? [];
1776
+ if (!tokens || !program) {
1777
+ return { domain: "ambiguous", program, hostArgs, hasHostPipeline, confidence: "low" };
1778
+ }
1779
+ const remote = classifyRemoteShellCommand(program, hostArgs, hasHostPipeline);
1780
+ if (remote) return remote;
1781
+ if (isExplicitShellProgram(program)) {
1782
+ return {
1783
+ domain: "explicit_shell",
1784
+ program,
1785
+ hostArgs,
1786
+ hasHostPipeline,
1787
+ confidence: hasHostPipeline ? "medium" : "high"
1788
+ };
1690
1789
  }
1691
- const unsupportedReadOnlyCommand = blockUnsupportedUnixReadOnlyCommand(command);
1692
- if (unsupportedReadOnlyCommand) return unsupportedReadOnlyCommand;
1693
- return { command, adapter: "native" };
1790
+ return { domain: "host", program, hostArgs, hasHostPipeline, confidence: "high" };
1791
+ }
1792
+ function classifyRemoteShellCommand(program, hostArgs, hasHostPipeline) {
1793
+ if (program === "adb" && hostArgs[0]?.toLowerCase() === "shell") {
1794
+ return remoteShellClassification(program, hostArgs, hostArgs.slice(1).join(" "), hasHostPipeline);
1795
+ }
1796
+ if (program === "ssh" && hostArgs.length >= 2) {
1797
+ return remoteShellClassification(program, hostArgs, hostArgs.slice(1).join(" "), hasHostPipeline);
1798
+ }
1799
+ if (program === "docker" && hostArgs.some((arg) => arg.toLowerCase() === "exec")) {
1800
+ return remoteShellClassification(program, hostArgs, hostArgs.join(" "), hasHostPipeline);
1801
+ }
1802
+ return void 0;
1803
+ }
1804
+ function remoteShellClassification(program, hostArgs, remotePayload, hasHostPipeline) {
1805
+ if (hasHostPipeline) {
1806
+ return {
1807
+ domain: "ambiguous",
1808
+ program,
1809
+ hostArgs,
1810
+ remotePayload,
1811
+ hasHostPipeline,
1812
+ confidence: "medium"
1813
+ };
1814
+ }
1815
+ return {
1816
+ domain: "remote_shell",
1817
+ program,
1818
+ hostArgs,
1819
+ remotePayload,
1820
+ hasHostPipeline,
1821
+ confidence: "high"
1822
+ };
1823
+ }
1824
+ function isRemoteShellProgram(program) {
1825
+ return program === "adb" || program === "docker" || program === "ssh";
1826
+ }
1827
+ function isExplicitShellProgram(program) {
1828
+ return /^(?:powershell(?:\.exe)?|pwsh(?:\.exe)?|cmd(?:\.exe)?|bash|sh)$/iu.test(program);
1829
+ }
1830
+ function hasUnquotedShellPipe(command) {
1831
+ return scanShellCommand(command, (_char, quoted) => !quoted && _char === "|");
1832
+ }
1833
+ function tokenizeShellCommandWords(command) {
1834
+ const trimmed = command.trim();
1835
+ if (!trimmed) return void 0;
1836
+ const tokens = [];
1837
+ let current = "";
1838
+ let quote;
1839
+ for (let index = 0; index < trimmed.length; index += 1) {
1840
+ const char = trimmed[index];
1841
+ if (!char) continue;
1842
+ if (quote) {
1843
+ if (char === quote) {
1844
+ quote = void 0;
1845
+ continue;
1846
+ }
1847
+ current += char;
1848
+ continue;
1849
+ }
1850
+ if (char === "'" || char === '"') {
1851
+ quote = char;
1852
+ continue;
1853
+ }
1854
+ if (/\s/u.test(char)) {
1855
+ if (current) {
1856
+ tokens.push(current);
1857
+ current = "";
1858
+ }
1859
+ continue;
1860
+ }
1861
+ if (char === "|") {
1862
+ if (current) {
1863
+ tokens.push(current);
1864
+ current = "";
1865
+ }
1866
+ tokens.push(char);
1867
+ continue;
1868
+ }
1869
+ current += char;
1870
+ }
1871
+ if (quote) return void 0;
1872
+ if (current) tokens.push(current);
1873
+ return tokens.length > 0 ? tokens : void 0;
1874
+ }
1875
+ function scanShellCommand(command, predicate) {
1876
+ let quote;
1877
+ for (let index = 0; index < command.length; index += 1) {
1878
+ const char = command[index];
1879
+ if (!char) continue;
1880
+ if (quote) {
1881
+ if (char === quote) quote = void 0;
1882
+ if (predicate(char, true)) return true;
1883
+ continue;
1884
+ }
1885
+ if (char === "'" || char === '"') {
1886
+ quote = char;
1887
+ if (predicate(char, true)) return true;
1888
+ continue;
1889
+ }
1890
+ if (predicate(char, false)) return true;
1891
+ }
1892
+ return false;
1694
1893
  }
1695
1894
  function isExplicitPowerShellCommand(command) {
1696
1895
  return /^(?:powershell(?:\.exe)?|pwsh(?:\.exe)?)\b/iu.test(command.trim());
@@ -1860,6 +2059,16 @@ function convertUnixPipelineForPowerShell(command) {
1860
2059
  return void 0;
1861
2060
  }
1862
2061
  function convertUnixReadOnlyCommandForPowerShell(command) {
2062
+ const testPrint = convertPosixTestPrintForPowerShell(command);
2063
+ if (testPrint) {
2064
+ return {
2065
+ command: [
2066
+ "powershell.exe -NoProfile -NonInteractive -Command",
2067
+ quoteCmdArg(`$ErrorActionPreference='Stop'; ${testPrint}`)
2068
+ ].join(" "),
2069
+ adapter: "powershell-adapted"
2070
+ };
2071
+ }
1863
2072
  const tokens = tokenizeSimpleShellCommand(command);
1864
2073
  if (!tokens) return void 0;
1865
2074
  const [program = "", ...args] = tokens;
@@ -1892,6 +2101,29 @@ function convertUnixReadOnlyCommandForPowerShell(command) {
1892
2101
  adapter: "powershell-adapted"
1893
2102
  };
1894
2103
  }
2104
+ function convertPosixTestPrintForPowerShell(command) {
2105
+ const normalized = command.trim();
2106
+ const match = normalized.match(
2107
+ /^test\s+-(f|e|d)\s+((?:"[^"]+"|'[^']+'|[^\s&|;]+))\s*&&\s*(?:printf|echo)\s+((?:"[^"]+"|'[^']+'|[^\s|;]+))\s*\|\|\s*(?:printf|echo)\s+((?:"[^"]+"|'[^']+'|[^\s|;]+))$/iu
2108
+ );
2109
+ if (!match) return void 0;
2110
+ const flag = match[1]?.toLowerCase();
2111
+ const path = stripShellQuotes(match[2] ?? "");
2112
+ const success = normalizeShellLiteralOutput(match[3] ?? "");
2113
+ const failure = normalizeShellLiteralOutput(match[4] ?? "");
2114
+ if (!flag || !path || !success || !failure) return void 0;
2115
+ const pathType = flag === "f" ? " -PathType Leaf" : flag === "d" ? " -PathType Container" : "";
2116
+ return [
2117
+ `if (Test-Path -LiteralPath ${quotePowerShellString(path)}${pathType}) {`,
2118
+ `Write-Output ${quotePowerShellString(success)}`,
2119
+ "} else {",
2120
+ `Write-Output ${quotePowerShellString(failure)}`,
2121
+ "}"
2122
+ ].join(" ");
2123
+ }
2124
+ function normalizeShellLiteralOutput(value) {
2125
+ return stripShellQuotes(value).replace(/\\n$/u, "");
2126
+ }
1895
2127
  function convertLsForPowerShell(args) {
1896
2128
  let force = false;
1897
2129
  let path = ".";
@@ -2614,9 +2846,8 @@ async function runRipgrep(args, context, limit, mapLine = (line) => line) {
2614
2846
  context.abortSignal?.removeEventListener("abort", abort);
2615
2847
  resolvePromise(value);
2616
2848
  };
2617
- child.stdout.setEncoding("utf8");
2618
2849
  child.stdout.on("data", (chunk) => {
2619
- pending += chunk;
2850
+ pending += decodeShellChunk(chunk);
2620
2851
  const parts = pending.split(/\r?\n/u);
2621
2852
  pending = parts.pop() ?? "";
2622
2853
  for (const line of parts) {
@@ -2631,9 +2862,8 @@ async function runRipgrep(args, context, limit, mapLine = (line) => line) {
2631
2862
  }
2632
2863
  }
2633
2864
  });
2634
- child.stderr.setEncoding("utf8");
2635
2865
  child.stderr.on("data", (chunk) => {
2636
- stderr += chunk;
2866
+ stderr += decodeShellChunk(chunk);
2637
2867
  });
2638
2868
  child.on("error", () => finish(null));
2639
2869
  child.on("close", (code) => {
@@ -2668,7 +2898,7 @@ function globToRegExp(pattern) {
2668
2898
  }
2669
2899
  return new RegExp(result);
2670
2900
  }
2671
- function runShell(command, cwd, timeoutMs, fullOutputPath, headerLines, signal, onProgress, trackChildProcess) {
2901
+ function runShell(command, cwd, timeoutMs, fullOutputPath, headerLines, signal, onProgress, trackChildProcess, noOutputHint) {
2672
2902
  return new Promise((resolvePromise) => {
2673
2903
  const detached = process.platform !== "win32";
2674
2904
  const child = spawn(command, { cwd, shell: true, windowsHide: true, detached });
@@ -2696,6 +2926,9 @@ function runShell(command, cwd, timeoutMs, fullOutputPath, headerLines, signal,
2696
2926
  };
2697
2927
  let settled = false;
2698
2928
  let forcedKillTimer;
2929
+ let heartbeatTimer;
2930
+ let lastOutputTime = Date.now();
2931
+ const heartbeatMs = getForegroundBashHeartbeatMs();
2699
2932
  let stoppingOutcome;
2700
2933
  let childClosed = false;
2701
2934
  const finish = (exitCode, outcome = "completed") => {
@@ -2704,6 +2937,9 @@ function runShell(command, cwd, timeoutMs, fullOutputPath, headerLines, signal,
2704
2937
  }
2705
2938
  settled = true;
2706
2939
  clearTimeout(timer);
2940
+ if (heartbeatTimer) {
2941
+ clearTimeout(heartbeatTimer);
2942
+ }
2707
2943
  if (forcedKillTimer && outcome === "completed") {
2708
2944
  clearTimeout(forcedKillTimer);
2709
2945
  }
@@ -2777,13 +3013,37 @@ function runShell(command, cwd, timeoutMs, fullOutputPath, headerLines, signal,
2777
3013
  return;
2778
3014
  }
2779
3015
  signal?.addEventListener("abort", onAbort, { once: true });
3016
+ const markOutput = () => {
3017
+ lastOutputTime = Date.now();
3018
+ if (heartbeatTimer) {
3019
+ clearTimeout(heartbeatTimer);
3020
+ }
3021
+ heartbeatTimer = setTimeout(reportHeartbeat, heartbeatMs);
3022
+ };
3023
+ const reportHeartbeat = () => {
3024
+ if (settled) return;
3025
+ const idleMs = Date.now() - lastOutputTime;
3026
+ if (idleMs >= heartbeatMs) {
3027
+ const hint = noOutputHint ? ` ${noOutputHint}` : "";
3028
+ const message = `
3029
+ [bash] \u547D\u4EE4\u4ECD\u5728\u8FD0\u884C\uFF0C\u5DF2 ${Math.round(idleMs / 1e3)}s \u65E0\u8F93\u51FA\u3002${hint}\u5B8C\u6574\u65E5\u5FD7\uFF1A${fullOutputPath}
3030
+ `;
3031
+ appendSanitizedChunk(message, true);
3032
+ onProgress?.("system", message);
3033
+ lastOutputTime = Date.now();
3034
+ }
3035
+ heartbeatTimer = setTimeout(reportHeartbeat, heartbeatMs);
3036
+ };
3037
+ markOutput();
2780
3038
  child.stdout.on("data", (chunk) => {
2781
3039
  const text = decodeShellChunk(chunk);
3040
+ markOutput();
2782
3041
  appendSanitizedChunk(text, true);
2783
3042
  onProgress?.("stdout", text);
2784
3043
  });
2785
3044
  child.stderr.on("data", (chunk) => {
2786
3045
  const text = decodeShellChunk(chunk);
3046
+ markOutput();
2787
3047
  appendSanitizedChunk(text, true);
2788
3048
  onProgress?.("stderr", text);
2789
3049
  });
@@ -2802,6 +3062,7 @@ function runShell(command, cwd, timeoutMs, fullOutputPath, headerLines, signal,
2802
3062
  });
2803
3063
  }
2804
3064
  var STALL_THRESHOLD_MS = 45e3;
3065
+ var DEFAULT_FOREGROUND_BASH_HEARTBEAT_MS = 3e4;
2805
3066
  var PROMPT_PATTERNS = [
2806
3067
  /\(y\/n\)\s*$/i,
2807
3068
  /\[y\/n\]\s*$/i,
@@ -2813,10 +3074,25 @@ var PROMPT_PATTERNS = [
2813
3074
  /passphrase[:\s]*$/i,
2814
3075
  /\?\s*$/
2815
3076
  ];
3077
+ function getForegroundBashHeartbeatMs() {
3078
+ const raw = process.env.LINGHUN_BASH_HEARTBEAT_MS;
3079
+ if (!raw) return DEFAULT_FOREGROUND_BASH_HEARTBEAT_MS;
3080
+ const parsed = Number(raw);
3081
+ return Number.isFinite(parsed) && parsed > 0 ? Math.max(10, parsed) : DEFAULT_FOREGROUND_BASH_HEARTBEAT_MS;
3082
+ }
2816
3083
  function looksLikePrompt(tail) {
2817
3084
  const lastLine = tail.split(/\r?\n/).filter(Boolean).pop() ?? "";
2818
3085
  return PROMPT_PATTERNS.some((re) => re.test(lastLine));
2819
3086
  }
3087
+ function createBashPromptDiagnostic(tail) {
3088
+ if (!looksLikePrompt(tail)) return void 0;
3089
+ return {
3090
+ type: "prompt",
3091
+ severity: "recoverable",
3092
+ evidence: "Bash output ended with an interactive prompt.",
3093
+ suggestion: "Provide input explicitly, rerun with non-interactive flags, or cancel and use a safer command."
3094
+ };
3095
+ }
2820
3096
  async function runBackgroundBash(opts) {
2821
3097
  const {
2822
3098
  taskId,
@@ -2892,8 +3168,12 @@ async function runBackgroundBash(opts) {
2892
3168
  stallTimer = setTimeout(checkStall, STALL_THRESHOLD_MS);
2893
3169
  };
2894
3170
  const checkStall = () => {
2895
- if (Date.now() - lastOutputTime >= STALL_THRESHOLD_MS && looksLikePrompt(tailBuffer)) {
2896
- const msg = "\n[stall watchdog] \u68C0\u6D4B\u5230\u4EA4\u4E92\u5F0F\u63D0\u793A\uFF0C\u53EF\u80FD\u9700\u8981\u7528\u6237\u8F93\u5165\u3002\n";
3171
+ if (Date.now() - lastOutputTime >= STALL_THRESHOLD_MS) {
3172
+ const diagnostic = createBashPromptDiagnostic(tailBuffer);
3173
+ if (!diagnostic) return;
3174
+ const msg = `
3175
+ [stall watchdog] ${diagnostic.evidence} ${diagnostic.suggestion}
3176
+ `;
2897
3177
  fileStream.write(msg);
2898
3178
  onProgress?.("system", msg);
2899
3179
  }
@@ -3125,6 +3405,9 @@ var __testCanSafelyAliasPythonCommand = canSafelyAliasPythonCommand;
3125
3405
  var __testRunBackgroundBash = runBackgroundBash;
3126
3406
  export {
3127
3407
  __testCanSafelyAliasPythonCommand,
3408
+ __testClassifyWindowsShellCommand,
3409
+ __testCreateBashOutcomeDiagnostics,
3410
+ __testCreateBashPromptDiagnostic,
3128
3411
  __testDecodeShellChunk,
3129
3412
  __testGlobToRegExp,
3130
3413
  __testParseBashCommandIntent,
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  GlobTool
3
- } from "../../chunk-Z3H6SZBS.js";
4
- import "../../chunk-ITBZHMZQ.js";
3
+ } from "../../chunk-DN3KJZRV.js";
5
4
  import "../../chunk-2U4BZXAI.js";
5
+ import "../../chunk-ITBZHMZQ.js";
6
6
  export {
7
7
  GlobTool
8
8
  };
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  ReadTool
3
- } from "../../chunk-TZ6QK52L.js";
4
- import "../../chunk-K3YDFDLP.js";
3
+ } from "../../chunk-RBHQ5WNR.js";
5
4
  import "../../chunk-HNIVNZIS.js";
5
+ import "../../chunk-K3YDFDLP.js";
6
6
  export {
7
7
  ReadTool
8
8
  };
@@ -1,17 +1,15 @@
1
1
  import {
2
2
  toolPrompts
3
- } from "../chunk-VVRFYPMG.js";
3
+ } from "../chunk-FZLD6M3Y.js";
4
4
  import "../chunk-LGZOG7IQ.js";
5
- import "../chunk-ZYAEUABC.js";
6
- import "../chunk-SWK6XRZQ.js";
7
- import "../chunk-4EZHIDZ6.js";
8
- import "../chunk-YR4HWOR2.js";
9
- import "../chunk-VAFW24RN.js";
10
5
  import "../chunk-I3Z4OKMS.js";
11
6
  import "../chunk-PS2ZOFZ6.js";
12
7
  import "../chunk-NPKLGVDQ.js";
13
- import "../chunk-TZ6QK52L.js";
14
- import "../chunk-K3YDFDLP.js";
8
+ import "../chunk-4EZHIDZ6.js";
9
+ import "../chunk-YR4HWOR2.js";
10
+ import "../chunk-VAFW24RN.js";
11
+ import "../chunk-ZYAEUABC.js";
12
+ import "../chunk-SWK6XRZQ.js";
15
13
  import "../chunk-GI5XI4HN.js";
16
14
  import "../chunk-WEWXKRKL.js";
17
15
  import "../chunk-A6FUAM64.js";
@@ -19,25 +17,27 @@ import "../chunk-YCO6C7KF.js";
19
17
  import "../chunk-4567YAXM.js";
20
18
  import "../chunk-XZWSO5CM.js";
21
19
  import "../chunk-SZFZPQGL.js";
20
+ import "../chunk-RBHQ5WNR.js";
21
+ import "../chunk-HNIVNZIS.js";
22
+ import "../chunk-K3YDFDLP.js";
22
23
  import "../chunk-AZCQL24J.js";
23
24
  import "../chunk-HUIZOB4A.js";
24
25
  import "../chunk-MK3YP2VR.js";
26
+ import "../chunk-2DIXRINW.js";
27
+ import "../chunk-PKMIDA5A.js";
28
+ import "../chunk-GAWMEMXB.js";
29
+ import "../chunk-DN3KJZRV.js";
30
+ import "../chunk-2U4BZXAI.js";
31
+ import "../chunk-ITBZHMZQ.js";
25
32
  import "../chunk-VJDLOFCF.js";
26
33
  import "../chunk-3RP665TH.js";
27
34
  import "../chunk-IOC3BSPT.js";
28
- import "../chunk-HNIVNZIS.js";
29
35
  import "../chunk-WLQ7DGMG.js";
30
36
  import "../chunk-SQP6SJRP.js";
31
37
  import "../chunk-BRG64AEC.js";
32
- import "../chunk-Z3H6SZBS.js";
33
- import "../chunk-ITBZHMZQ.js";
34
- import "../chunk-2U4BZXAI.js";
35
38
  import "../chunk-7ZOADACP.js";
36
39
  import "../chunk-H5OOD2OS.js";
37
40
  import "../chunk-IQP3XE32.js";
38
- import "../chunk-2DIXRINW.js";
39
- import "../chunk-PKMIDA5A.js";
40
- import "../chunk-GAWMEMXB.js";
41
41
  export {
42
42
  toolPrompts
43
43
  };
package/dist/tools/ui.js CHANGED
@@ -1,17 +1,15 @@
1
1
  import {
2
2
  toolUserFacingNames
3
- } from "../chunk-24USSE7U.js";
3
+ } from "../chunk-X6DHCZQQ.js";
4
4
  import "../chunk-LGZOG7IQ.js";
5
- import "../chunk-ZYAEUABC.js";
6
- import "../chunk-SWK6XRZQ.js";
7
- import "../chunk-4EZHIDZ6.js";
8
- import "../chunk-YR4HWOR2.js";
9
- import "../chunk-VAFW24RN.js";
10
5
  import "../chunk-I3Z4OKMS.js";
11
6
  import "../chunk-PS2ZOFZ6.js";
12
7
  import "../chunk-NPKLGVDQ.js";
13
- import "../chunk-TZ6QK52L.js";
14
- import "../chunk-K3YDFDLP.js";
8
+ import "../chunk-4EZHIDZ6.js";
9
+ import "../chunk-YR4HWOR2.js";
10
+ import "../chunk-VAFW24RN.js";
11
+ import "../chunk-ZYAEUABC.js";
12
+ import "../chunk-SWK6XRZQ.js";
15
13
  import "../chunk-GI5XI4HN.js";
16
14
  import "../chunk-WEWXKRKL.js";
17
15
  import "../chunk-A6FUAM64.js";
@@ -19,25 +17,27 @@ import "../chunk-YCO6C7KF.js";
19
17
  import "../chunk-4567YAXM.js";
20
18
  import "../chunk-XZWSO5CM.js";
21
19
  import "../chunk-SZFZPQGL.js";
20
+ import "../chunk-RBHQ5WNR.js";
21
+ import "../chunk-HNIVNZIS.js";
22
+ import "../chunk-K3YDFDLP.js";
22
23
  import "../chunk-AZCQL24J.js";
23
24
  import "../chunk-HUIZOB4A.js";
24
25
  import "../chunk-MK3YP2VR.js";
26
+ import "../chunk-2DIXRINW.js";
27
+ import "../chunk-PKMIDA5A.js";
28
+ import "../chunk-GAWMEMXB.js";
29
+ import "../chunk-DN3KJZRV.js";
30
+ import "../chunk-2U4BZXAI.js";
31
+ import "../chunk-ITBZHMZQ.js";
25
32
  import "../chunk-VJDLOFCF.js";
26
33
  import "../chunk-3RP665TH.js";
27
34
  import "../chunk-IOC3BSPT.js";
28
- import "../chunk-HNIVNZIS.js";
29
35
  import "../chunk-WLQ7DGMG.js";
30
36
  import "../chunk-SQP6SJRP.js";
31
37
  import "../chunk-BRG64AEC.js";
32
- import "../chunk-Z3H6SZBS.js";
33
- import "../chunk-ITBZHMZQ.js";
34
- import "../chunk-2U4BZXAI.js";
35
38
  import "../chunk-7ZOADACP.js";
36
39
  import "../chunk-H5OOD2OS.js";
37
40
  import "../chunk-IQP3XE32.js";
38
- import "../chunk-2DIXRINW.js";
39
- import "../chunk-PKMIDA5A.js";
40
- import "../chunk-GAWMEMXB.js";
41
41
  export {
42
42
  toolUserFacingNames
43
43
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linghun/tools",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
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
+ }
package/LICENSE DELETED
@@ -1,190 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- Copyright 2026 Linghun contributors
179
-
180
- Licensed under the Apache License, Version 2.0 (the "License");
181
- you may not use this file except in compliance with the License.
182
- You may obtain a copy of the License at
183
-
184
- http://www.apache.org/licenses/LICENSE-2.0
185
-
186
- Unless required by applicable law or agreed to in writing, software
187
- distributed under the License is distributed on an "AS IS" BASIS,
188
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
- See the License for the specific language governing permissions and
190
- limitations under the License.
@@ -1,9 +1,9 @@
1
- import {
2
- userFacingName
3
- } from "./chunk-ITBZHMZQ.js";
4
1
  import {
5
2
  prompt
6
3
  } from "./chunk-2U4BZXAI.js";
4
+ import {
5
+ userFacingName
6
+ } from "./chunk-ITBZHMZQ.js";
7
7
 
8
8
  // src/tools/Glob/GlobTool.ts
9
9
  var GlobTool = { name: "Glob", prompt, userFacingName };
@@ -1,9 +1,9 @@
1
- import {
2
- userFacingName
3
- } from "./chunk-K3YDFDLP.js";
4
1
  import {
5
2
  prompt
6
3
  } from "./chunk-HNIVNZIS.js";
4
+ import {
5
+ userFacingName
6
+ } from "./chunk-K3YDFDLP.js";
7
7
 
8
8
  // src/tools/Read/ReadTool.ts
9
9
  var ReadTool = { name: "Read", prompt, userFacingName };