@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.
@@ -1 +1 @@
1
- (function(_0x2cd82a,_0x454dea){var _0x442099={_0x30b1cf:0x2f8,_0x4a1ed8:0x2fc,_0x1a2acb:0x2fa,_0x54f30a:0x248,_0x351893:0x248,_0x5de95b:0x245,_0x152bb3:0x243,_0x2e653:0x23f,_0x547ca7:0x246,_0x2e4a14:0x24a,_0x51fd05:0x247,_0x81594a:0x2f7,_0x582f03:0x2fb,_0x289fe3:0x300,_0x5504cb:0x249,_0x13f5ee:0x303},_0x5e8892={_0x446dbf:0x181},_0x5613d3=_0x2cd82a();function _0x195084(_0x48f541,_0x59df2a,_0x21bb1b,_0x2d2b4d){return _0x2f7b(_0x59df2a-0xcc,_0x48f541);}function _0x1e9e03(_0x152a4c,_0x2e1266,_0x1c116a,_0x180d1e){return _0x2f7b(_0x180d1e-_0x5e8892._0x446dbf,_0x1c116a);}while(!![]){try{var _0x5c52bb=parseInt(_0x1e9e03(_0x442099._0x30b1cf,0x2ff,0x2f6,0x2fa))/0x1+parseInt(_0x1e9e03(_0x442099._0x4a1ed8,0x2f9,_0x442099._0x1a2acb,0x2fc))/0x2*(parseInt(_0x195084(_0x442099._0x54f30a,_0x442099._0x351893,0x24d,_0x442099._0x5de95b))/0x3)+parseInt(_0x1e9e03(_0x442099._0x1a2acb,0x2f7,0x2f6,0x2f8))/0x4*(-parseInt(_0x195084(0x248,0x244,_0x442099._0x152bb3,_0x442099._0x2e653))/0x5)+-parseInt(_0x195084(0x247,_0x442099._0x547ca7,_0x442099._0x2e4a14,_0x442099._0x51fd05))/0x6*(parseInt(_0x1e9e03(0x2f5,0x2f9,0x2f3,_0x442099._0x81594a))/0x7)+parseInt(_0x1e9e03(0x2fe,_0x442099._0x582f03,0x305,_0x442099._0x289fe3))/0x8+-parseInt(_0x195084(0x24d,0x249,0x24e,_0x442099._0x5504cb))/0x9+-parseInt(_0x1e9e03(0x301,_0x442099._0x13f5ee,0x2fd,0x2ff))/0xa;if(_0x5c52bb===_0x454dea)break;else _0x5613d3['push'](_0x5613d3['shift']());}catch(_0x5a27b0){_0x5613d3['push'](_0x5613d3['shift']());}}}(_0x3adc,0x6237c));import{mapAutoReasoningEffortToBudgetTokens,resolveAnthropicThinkingConfig,resolveOpenAiReasoningConfig}from'../chunk-NYZR4XKO.js';function _0x2f7b(_0x2bba3a,_0x50aedd){_0x2bba3a=_0x2bba3a-0x176;var _0x3adc84=_0x3adc();var _0x2f7b23=_0x3adc84[_0x2bba3a];if(_0x2f7b['ePFOAF']===undefined){var _0x371c37=function(_0xbff65b){var _0x59219f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x200a0a='',_0x532180='';for(var _0x3e4b2e=0x0,_0x1d7cac,_0x2a442f,_0x5e6b11=0x0;_0x2a442f=_0xbff65b['charAt'](_0x5e6b11++);~_0x2a442f&&(_0x1d7cac=_0x3e4b2e%0x4?_0x1d7cac*0x40+_0x2a442f:_0x2a442f,_0x3e4b2e++%0x4)?_0x200a0a+=String['fromCharCode'](0xff&_0x1d7cac>>(-0x2*_0x3e4b2e&0x6)):0x0){_0x2a442f=_0x59219f['indexOf'](_0x2a442f);}for(var _0xbc7e1b=0x0,_0x2738a3=_0x200a0a['length'];_0xbc7e1b<_0x2738a3;_0xbc7e1b++){_0x532180+='%'+('00'+_0x200a0a['charCodeAt'](_0xbc7e1b)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x532180);};_0x2f7b['UFPXgL']=_0x371c37,_0x2f7b['ramQTw']={},_0x2f7b['ePFOAF']=!![];}var _0x41ccbc=_0x3adc84[0x0],_0x230b79=_0x2bba3a+_0x41ccbc,_0x465971=_0x2f7b['ramQTw'][_0x230b79];return!_0x465971?(_0x2f7b23=_0x2f7b['UFPXgL'](_0x2f7b23),_0x2f7b['ramQTw'][_0x230b79]=_0x2f7b23):_0x2f7b23=_0x465971,_0x2f7b23;}import{TurnFailedError}from'../chunk-FFIZ6TKW.js';import{OperationAbortedError,addAbortListener,isAbortError,throwIfAborted,toAbortError}from'../chunk-X7VAACWY.js';export{OperationAbortedError,TurnFailedError,addAbortListener,isAbortError,mapAutoReasoningEffortToBudgetTokens,resolveAnthropicThinkingConfig,resolveOpenAiReasoningConfig,throwIfAborted,toAbortError};function _0x3adc(){var _0x144d6d=['mJi2mJqXmhbPweDoEq','nJmWody2neP0u2jgAq','nJqWnta3qKvYq2XA','mtiYodyYofDSAKXKvW','nvbPtMLgBG','ntK4mta0qKfHAgPh','nMH1u0nHsa','ndu2CfzdtxvN','mZi0m1jPBxnMzq','ntq1mZyWneXPBMLyBW'];_0x3adc=function(){return _0x144d6d;};return _0x3adc();}
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
  }>;
@@ -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";