@nuvin/agent-core 0.0.0 → 0.1.0-rc.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/VERSION +2 -2
- package/dist/agent/index.js +1 -1
- package/dist/chunk-FFIZ6TKW.js +1 -1
- package/dist/chunk-HRU363DY.js +1 -1
- package/dist/chunk-NHBKADBW.js +1 -1
- package/dist/chunk-NYZR4XKO.js +1 -1
- package/dist/chunk-QDOE7NWO.js +1 -1
- package/dist/chunk-X7VAACWY.js +1 -1
- package/dist/formats/index.js +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/models/index.js +1 -1
- package/dist/shared/index.js +1 -1
- package/dist/tools/background-process-registry.d.ts +64 -0
- package/dist/tools/bash-internals.d.ts +5 -0
- package/dist/tools/bash-output-tool.d.ts +20 -0
- package/dist/tools/bash-tool.d.ts +12 -0
- package/dist/tools/index.d.ts +3 -0
- package/dist/tools/index.js +1 -1
- package/dist/tools/kill-shell-tool.d.ts +16 -0
- package/package.json +2 -2
package/dist/shared/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x359ba2,_0x1bfa38){var _0x383263={_0x195de7:0x190,_0x2b4fd:0x194,_0x25791b:0x47,_0x28d93e:0x3e,_0x2bf6e5:0x44,_0x1e5102:0x49,_0x2531b1:0x18b,_0x474321:0x18d,_0x307bb0:0x18e,_0x48192b:0x189,_0x3d398a:0x46,_0x4c4e0a:0x47},_0x2e99b3={_0x37f282:0x1eb},_0x46e5bc={_0x296ab7:0x15},_0x5a7361=_0x359ba2();function _0x16e9b5(_0x2dbfe0,_0x7fdbda,_0x29a43c,_0x281f21){return _0x12d9(_0x2dbfe0- -_0x46e5bc._0x296ab7,_0x29a43c);}function _0x547459(_0x16c061,_0x45800e,_0x38192f,_0x5acf68){return _0x12d9(_0x5acf68- -_0x2e99b3._0x37f282,_0x45800e);}while(!![]){try{var _0x458e8e=-parseInt(_0x16e9b5(_0x383263._0x195de7,0x190,_0x383263._0x2b4fd,0x18c))/0x1+-parseInt(_0x547459(-0x40,-_0x383263._0x25791b,-_0x383263._0x28d93e,-0x43))/0x2*(-parseInt(_0x547459(-_0x383263._0x2bf6e5,-0x49,-0x4d,-_0x383263._0x1e5102))/0x3)+parseInt(_0x16e9b5(_0x383263._0x2531b1,_0x383263._0x474321,0x18e,0x188))/0x4*(-parseInt(_0x16e9b5(_0x383263._0x307bb0,0x18a,0x191,0x18e))/0x5)+parseInt(_0x16e9b5(0x18c,0x191,_0x383263._0x48192b,_0x383263._0x48192b))/0x6+parseInt(_0x547459(-0x46,-0x45,-0x49,-0x45))/0x7+parseInt(_0x547459(-_0x383263._0x3d398a,-_0x383263._0x4c4e0a,-0x45,-0x47))/0x8+-parseInt(_0x547459(-0x44,-0x45,-0x48,-_0x383263._0x2bf6e5))/0x9;if(_0x458e8e===_0x1bfa38)break;else _0x5a7361['push'](_0x5a7361['shift']());}catch(_0x30d074){_0x5a7361['push'](_0x5a7361['shift']());}}}(_0x7d3c,0x3e099));import{mapAutoReasoningEffortToBudgetTokens,resolveAnthropicThinkingConfig,resolveOpenAiReasoningConfig}from'../chunk-NYZR4XKO.js';function _0x7d3c(){var _0x229a8b=['mJyYnZe4r0vcu1nV','mtGYntmYme9YANLHAa','mZqYmtu4nhHIz3f4zq','mtK2mdm4u3jztMDU','nJy4y0fMrgDg','mJa5mZiWog1zugPhvG','ouj0u1DzDW','mte3mdvLEvfyt1C','mZa3nda4oe1dC0H2Ba'];_0x7d3c=function(){return _0x229a8b;};return _0x7d3c();}import{TurnFailedError}from'../chunk-FFIZ6TKW.js';function _0x12d9(_0x3bdc7b,_0x247a58){_0x3bdc7b=_0x3bdc7b-0x1a0;var _0x7d3c55=_0x7d3c();var _0x12d959=_0x7d3c55[_0x3bdc7b];if(_0x12d9['PcldTZ']===undefined){var _0x2c1356=function(_0x411296){var _0x4249c6='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x105669='',_0x170a80='';for(var _0x4b46b1=0x0,_0xb02cb7,_0x506b1b,_0x4826fb=0x0;_0x506b1b=_0x411296['charAt'](_0x4826fb++);~_0x506b1b&&(_0xb02cb7=_0x4b46b1%0x4?_0xb02cb7*0x40+_0x506b1b:_0x506b1b,_0x4b46b1++%0x4)?_0x105669+=String['fromCharCode'](0xff&_0xb02cb7>>(-0x2*_0x4b46b1&0x6)):0x0){_0x506b1b=_0x4249c6['indexOf'](_0x506b1b);}for(var _0x53bd23=0x0,_0x14d96e=_0x105669['length'];_0x53bd23<_0x14d96e;_0x53bd23++){_0x170a80+='%'+('00'+_0x105669['charCodeAt'](_0x53bd23)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x170a80);};_0x12d9['VKHuYF']=_0x2c1356,_0x12d9['FQDIgu']={},_0x12d9['PcldTZ']=!![];}var _0x568125=_0x7d3c55[0x0],_0x3f6a27=_0x3bdc7b+_0x568125,_0x468091=_0x12d9['FQDIgu'][_0x3f6a27];return!_0x468091?(_0x12d959=_0x12d9['VKHuYF'](_0x12d959),_0x12d9['FQDIgu'][_0x3f6a27]=_0x12d959):_0x12d959=_0x468091,_0x12d959;}import{OperationAbortedError,addAbortListener,isAbortError,throwIfAborted,toAbortError}from'../chunk-X7VAACWY.js';export{OperationAbortedError,TurnFailedError,addAbortListener,isAbortError,mapAutoReasoningEffortToBudgetTokens,resolveAnthropicThinkingConfig,resolveOpenAiReasoningConfig,throwIfAborted,toAbortError};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { ChildProcess } from "node:child_process";
|
|
2
|
+
import { StringDecoder } from "node:string_decoder";
|
|
3
|
+
export type BackgroundProcessStatus = "running" | "exited" | "killed" | "error";
|
|
4
|
+
export interface BackgroundProcessEntry {
|
|
5
|
+
shellId: string;
|
|
6
|
+
command: string;
|
|
7
|
+
cwd: string;
|
|
8
|
+
pid: number | undefined;
|
|
9
|
+
status: BackgroundProcessStatus;
|
|
10
|
+
exitCode: number | null;
|
|
11
|
+
signal: NodeJS.Signals | null;
|
|
12
|
+
startedAt: number;
|
|
13
|
+
error?: string;
|
|
14
|
+
child: ChildProcess | null;
|
|
15
|
+
buffer: string[];
|
|
16
|
+
bufferChars: number;
|
|
17
|
+
totalProduced: number;
|
|
18
|
+
totalDropped: number;
|
|
19
|
+
readCursor: number;
|
|
20
|
+
stdoutDecoder: StringDecoder;
|
|
21
|
+
stderrDecoder: StringDecoder;
|
|
22
|
+
stripAnsi: boolean;
|
|
23
|
+
killRequested: boolean;
|
|
24
|
+
processExited: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface BackgroundProcessReadResult {
|
|
27
|
+
output: string;
|
|
28
|
+
status: BackgroundProcessStatus;
|
|
29
|
+
exitCode: number | null;
|
|
30
|
+
signal: NodeJS.Signals | null;
|
|
31
|
+
truncated: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface BackgroundProcessRegistryOptions {
|
|
34
|
+
maxConcurrent?: number;
|
|
35
|
+
maxEntries?: number;
|
|
36
|
+
capChars?: number;
|
|
37
|
+
}
|
|
38
|
+
export declare class BackgroundProcessRegistry {
|
|
39
|
+
private readonly entries;
|
|
40
|
+
private readonly maxConcurrent;
|
|
41
|
+
private readonly maxEntries;
|
|
42
|
+
private readonly capChars;
|
|
43
|
+
private counter;
|
|
44
|
+
constructor(opts?: BackgroundProcessRegistryOptions);
|
|
45
|
+
spawn(opts: {
|
|
46
|
+
child: ChildProcess;
|
|
47
|
+
command: string;
|
|
48
|
+
cwd: string;
|
|
49
|
+
stripAnsi: boolean;
|
|
50
|
+
}): BackgroundProcessEntry;
|
|
51
|
+
read(shellId: string, opts?: {
|
|
52
|
+
regex?: string;
|
|
53
|
+
}): BackgroundProcessReadResult;
|
|
54
|
+
list(): BackgroundProcessEntry[];
|
|
55
|
+
kill(shellId: string): {
|
|
56
|
+
status: BackgroundProcessStatus;
|
|
57
|
+
exitCode: number | null;
|
|
58
|
+
signal: NodeJS.Signals | null;
|
|
59
|
+
};
|
|
60
|
+
closeAll(): Promise<void>;
|
|
61
|
+
private append;
|
|
62
|
+
private evictIfNeeded;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=background-process-registry.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
export declare function isErrnoException(error: unknown): error is NodeJS.ErrnoException;
|
|
3
|
+
export declare function stripAnsiAndControls(s: string): string;
|
|
4
|
+
export declare function killProcessGroup(child: ReturnType<typeof spawn>, isWindows: boolean, signal?: NodeJS.Signals): void;
|
|
5
|
+
//# sourceMappingURL=bash-internals.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { BackgroundProcessRegistry } from "./background-process-registry.ts";
|
|
2
|
+
export interface BashOutputToolOptions {
|
|
3
|
+
registry: BackgroundProcessRegistry;
|
|
4
|
+
}
|
|
5
|
+
export declare function createBashOutputTool(options: BashOutputToolOptions): import("../shared/types.ts").ToolDefinition<{
|
|
6
|
+
shellId: string;
|
|
7
|
+
regex?: string | undefined;
|
|
8
|
+
}, never, import("../shared/types.ts").ToolOutputEnvelope, {
|
|
9
|
+
type: "object";
|
|
10
|
+
properties: {
|
|
11
|
+
shellId: {
|
|
12
|
+
type: "string";
|
|
13
|
+
};
|
|
14
|
+
regex: {
|
|
15
|
+
type: "string";
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
required: readonly ["shellId"];
|
|
19
|
+
}>;
|
|
20
|
+
//# sourceMappingURL=bash-output-tool.d.ts.map
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import type { BackgroundProcessRegistry } from "./background-process-registry.ts";
|
|
1
2
|
export interface BashToolInput {
|
|
2
3
|
command: string;
|
|
3
4
|
cwd?: string;
|
|
4
5
|
timeoutMs?: number;
|
|
5
6
|
ignoreOutput?: boolean;
|
|
7
|
+
runInBackground?: boolean;
|
|
6
8
|
}
|
|
7
9
|
export interface BashToolOptions {
|
|
8
10
|
allowedDirs?: readonly string[];
|
|
@@ -13,12 +15,15 @@ export interface BashToolOptions {
|
|
|
13
15
|
name?: string;
|
|
14
16
|
shellPath?: string;
|
|
15
17
|
stripAnsi?: boolean;
|
|
18
|
+
scrubEnvKeys?: readonly string[];
|
|
19
|
+
backgroundRegistry?: BackgroundProcessRegistry;
|
|
16
20
|
}
|
|
17
21
|
export declare function createBashTool(options?: BashToolOptions): import("../shared/types.ts").ToolDefinition<{
|
|
18
22
|
command: string;
|
|
19
23
|
timeoutMs?: number | undefined;
|
|
20
24
|
cwd?: string | undefined;
|
|
21
25
|
ignoreOutput?: boolean | undefined;
|
|
26
|
+
runInBackground?: boolean | undefined;
|
|
22
27
|
}, string, import("../shared/types.ts").ToolOutputEnvelope, {
|
|
23
28
|
type: "object";
|
|
24
29
|
properties: {
|
|
@@ -34,6 +39,9 @@ export declare function createBashTool(options?: BashToolOptions): import("../sh
|
|
|
34
39
|
ignoreOutput: {
|
|
35
40
|
type: "boolean";
|
|
36
41
|
};
|
|
42
|
+
runInBackground: {
|
|
43
|
+
type: "boolean";
|
|
44
|
+
};
|
|
37
45
|
};
|
|
38
46
|
required: readonly ["command"];
|
|
39
47
|
}>;
|
|
@@ -42,6 +50,7 @@ export declare function createShellExecTool(options?: BashToolOptions): import("
|
|
|
42
50
|
timeoutMs?: number | undefined;
|
|
43
51
|
cwd?: string | undefined;
|
|
44
52
|
ignoreOutput?: boolean | undefined;
|
|
53
|
+
runInBackground?: boolean | undefined;
|
|
45
54
|
}, string, import("../shared/types.ts").ToolOutputEnvelope, {
|
|
46
55
|
type: "object";
|
|
47
56
|
properties: {
|
|
@@ -57,6 +66,9 @@ export declare function createShellExecTool(options?: BashToolOptions): import("
|
|
|
57
66
|
ignoreOutput: {
|
|
58
67
|
type: "boolean";
|
|
59
68
|
};
|
|
69
|
+
runInBackground: {
|
|
70
|
+
type: "boolean";
|
|
71
|
+
};
|
|
60
72
|
};
|
|
61
73
|
required: readonly ["command"];
|
|
62
74
|
}>;
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from "../lsp/index.ts";
|
|
2
2
|
export * from "./ask-user-tool.ts";
|
|
3
|
+
export * from "./background-process-registry.ts";
|
|
4
|
+
export * from "./bash-output-tool.ts";
|
|
3
5
|
export * from "./bash-tool.ts";
|
|
4
6
|
export * from "./command-tool.ts";
|
|
5
7
|
export * from "./file-edit-tool.ts";
|
|
@@ -8,6 +10,7 @@ export * from "./file-read-tool.ts";
|
|
|
8
10
|
export * from "./glob-tool.ts";
|
|
9
11
|
export * from "./grep-tool.ts";
|
|
10
12
|
export * from "./internal-tool-runtime.ts";
|
|
13
|
+
export * from "./kill-shell-tool.ts";
|
|
11
14
|
export * from "./ls-tool.ts";
|
|
12
15
|
export * from "./lsp-tool.ts";
|
|
13
16
|
export * from "./mcp-oauth-provider.ts";
|