@nuvin/agent-core 0.3.1-rc.2 → 0.4.0-rc.3
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-6FBVJKFJ.js +1 -0
- package/dist/chunk-CVOXBVKH.js +1 -0
- package/dist/chunk-D5IVWJHX.js +1 -1
- package/dist/chunk-EQGBU73Q.js +1 -1
- package/dist/chunk-GAZGO6N7.js +1 -1
- package/dist/chunk-IUZALP6K.js +1 -1
- package/dist/chunk-LIE76IJA.js +1 -1
- package/dist/chunk-X7VAACWY.js +1 -1
- package/dist/chunk-YNOIG4FD.js +1 -1
- package/dist/formats/index.js +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/isolate/index.js +1 -1
- package/dist/models/index.js +1 -1
- package/dist/shared/bash-completion-visibility.d.ts +9 -0
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.js +1 -1
- package/dist/shared/types.d.ts +39 -3
- package/dist/tools/core/runtime-manager-tools.d.ts +48 -2
- package/dist/tools/file-editing/bash-artifact-read.d.ts +13 -0
- package/dist/tools/file-editing/file-read-tool.d.ts +1 -0
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/tools/shell/background-bash-controller.d.ts +20 -17
- package/dist/tools/shell/background-bash-process.d.ts +2 -10
- package/dist/tools/shell/bash-artifact.d.ts +62 -0
- package/dist/tools/shell/bash-tool.d.ts +21 -7
- package/package.json +2 -2
- package/dist/chunk-FFIZ6TKW.js +0 -1
- package/dist/chunk-IMXQOWD3.js +0 -1
- package/dist/tools/shell/bash-output-tool.d.ts +0 -21
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Trusted visibility is independent of display-only command presentation. */
|
|
2
|
+
export declare function isAgentOnlyBashCompletion(value: unknown): value is Record<string, unknown> & {
|
|
3
|
+
deliveryKind: "bash-completion";
|
|
4
|
+
transcriptVisibility: "agent-only";
|
|
5
|
+
subagentReport?: never;
|
|
6
|
+
presentation?: never;
|
|
7
|
+
noticeRole?: never;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=bash-completion-visibility.d.ts.map
|
package/dist/shared/index.d.ts
CHANGED
package/dist/shared/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x48d7c7(_0x514a53,_0x407323,_0x5151fb,_0x46489d){return _0xc294(_0x46489d-0x296,_0x514a53);}(function(_0x41be1e,_0x599626){const _0x24851f={_0x389447:0x2,_0x170bcb:0xb,_0x105a71:0x18,_0x1e9ed1:0x5,_0x14303a:0xc,_0x7ee229:0xbd,_0x36d20e:0xbf,_0x2a3e9b:0xcc,_0x4562b0:0xbc,_0x1441ab:0x9,_0x44fd76:0x8,_0x51b627:0x5,_0x127385:0x1,_0x207293:0x4,_0x3eb501:0xf,_0x288eec:0xbb,_0x20106f:0xb2,_0x5592e4:0x2,_0x33dbd0:0x10},_0x5632b6={_0x32e1f3:0x9d},_0x49afc6={_0x294481:0x16a};function _0xf3ae52(_0x3a622b,_0x130cc3,_0x31ad2e,_0x494186){return _0xc294(_0x3a622b- -_0x49afc6._0x294481,_0x494186);}const _0x71d41=_0x41be1e();function _0x4d279a(_0x331550,_0x6af4c3,_0xceaabc,_0xf4a248){return _0xc294(_0xceaabc- -_0x5632b6._0x32e1f3,_0x6af4c3);}while(!![]){try{const _0x7920c7=parseInt(_0x4d279a(_0x24851f._0x389447,-0x5,0x3,0xf))/0x1*(-parseInt(_0x4d279a(0x12,_0x24851f._0x170bcb,0xf,_0x24851f._0x105a71))/0x2)+parseInt(_0x4d279a(-_0x24851f._0x1e9ed1,_0x24851f._0x14303a,0x8,0xf))/0x3+parseInt(_0xf3ae52(-_0x24851f._0x7ee229,-0xc6,-_0x24851f._0x36d20e,-0xb1))/0x4*(-parseInt(_0xf3ae52(-_0x24851f._0x2a3e9b,-0xd3,-_0x24851f._0x2a3e9b,-0xca))/0x5)+-parseInt(_0xf3ae52(-0xbc,-_0x24851f._0x4562b0,-0xb2,-_0x24851f._0x36d20e))/0x6*(-parseInt(_0x4d279a(_0x24851f._0x1441ab,-0x1,_0x24851f._0x1e9ed1,-_0x24851f._0x44fd76))/0x7)+-parseInt(_0x4d279a(_0x24851f._0x51b627,_0x24851f._0x127385,_0x24851f._0x207293,_0x24851f._0x3eb501))/0x8+-parseInt(_0xf3ae52(-0xb4,-_0x24851f._0x288eec,-0xac,-_0x24851f._0x20106f))/0x9*(parseInt(_0xf3ae52(-0xb6,-0xb0,-_0x24851f._0x4562b0,-0xb8))/0xa)+parseInt(_0x4d279a(0x0,-_0x24851f._0x5592e4,0x2,_0x24851f._0x33dbd0))/0xb;if(_0x7920c7===_0x599626)break;else _0x71d41['push'](_0x71d41['shift']());}catch(_0x305549){_0x71d41['push'](_0x71d41['shift']());}}}(_0x5e62,0x298b1));import{modelIdentityFromParts}from'../chunk-D5IVWJHX.js';import{resolveAnthropicReasoningConfig,resolveOpenAiReasoningConfig}from'../chunk-IUZALP6K.js';import{TurnFailedError,isAgentOnlyBashCompletion}from'../chunk-CVOXBVKH.js';function _0x318eb4(_0x533b96,_0xc77572,_0x38d5bf,_0x41c058){const _0x571d08={_0x29c85a:0x308};return _0xc294(_0x38d5bf-_0x571d08._0x29c85a,_0xc77572);}function _0x5e62(){const _0x2bb267=['mtbSzgvlBM8','AxnjBNrLz2vY','mtKXmtKZm2XpvNPnyW','DxnLCG','CMvQzwn0','mtbVv3feu3m','nJaZodmYou9Wrw9WCW','mJGXntuYzePmEMLV','mJyXmZu0nffiquzZCa','mtC5ntqYm05OAMPNyq','Aw5KzxHpzG','AxngAw5PDgu','mtaXmty2ovnArMXhEa','Bwf4q29Uy3vYCMvUy3KGBxvZDcbIzsbHigzPBML0zsbWB3nPDgL2zsbPBNrLz2vY','CMvTB3zLqwjVCNrmAxn0zw5LCG','y2fUy2vSBgvK','yxnZAxn0yw50','C3bSAwnL','ywjVCNrLza','mLDOB2fPua','mZaZnJe2D1biwgLR','nKzrr1PVzq','CMvHC29U','zNjLzxPL','BgvUz3rO','CMvZB2X2zq','C2HPzNq'];_0x5e62=function(){return _0x2bb267;};return _0x5e62();}import{OperationAbortedError,addAbortListener,isAbortError,throwIfAborted,toAbortError}from'../chunk-X7VAACWY.js';function createAbortAwareSemaphore(_0x4b1d9e){const _0x10599e={_0x54d9f1:0x2b5,_0x18666a:0x2b7,_0x2007a5:0x2bd,_0x40a482:0x297,_0x34e6c4:0x2b4,_0xe7043d:0x2a6,_0x59a3d0:0x2b4},_0x304339={_0x22bdec:0x202,_0x4219cb:0x1f7,_0x560c83:0x208,_0x324bd2:0x20f,_0x4fff01:0x202,_0x2a975a:0x206,_0x4b733b:0x20b,_0x3e96f1:0x208,_0x5313fc:0x20c,_0x50938f:0x3b2,_0x280fc7:0x3a9},_0x49f313={_0xef7fdc:0x1a8,_0x476d04:0xd6,_0x154e46:0xd3},_0x5733f6={_0x116981:0x156,_0x41760b:0x6e,_0x2c962f:0xd9},_0x4221db={_0x31325d:0x359},_0x16ed76={_0x1b0994:0x18a,_0x439c22:0x19e,_0x5a214b:0x192,_0x264056:0x1a9,_0x2585c2:0x1aa,_0x4bbe83:0x1ab,_0x201384:0x1a4,_0x36c2c5:0x1a7,_0x4faea0:0x190,_0x58a3a0:0x196,_0x54126c:0x18e};if(!Number[_0x1c2a21(-_0x10599e._0x54d9f1,-_0x10599e._0x18666a,-0x2ab,-_0x10599e._0x2007a5)](_0x4b1d9e)||!Number[_0x1c2a21(-0x2a4,-0x2a9,-_0x10599e._0x40a482,-0x29b)](_0x4b1d9e)||_0x4b1d9e<=0x0)throw new Error(_0x1c2a21(-0x2b3,-_0x10599e._0x34e6c4,-_0x10599e._0xe7043d,-_0x10599e._0x59a3d0));let _0x178b3f=0x0;function _0x38cc07(_0x5bfdd7,_0x3ee967,_0x2f8a01,_0x4a8761){return _0xc294(_0x4a8761-0x230,_0x2f8a01);}const _0x5d2013=[],_0x699a58=()=>{let _0x4c7ea1=![];return()=>{if(_0x4c7ea1)return;_0x4c7ea1=!![],_0x178b3f-=0x1,_0x53480d();};},_0x53480d=()=>{function _0x2aa5e7(_0x47db0b,_0x23ce68,_0x543119,_0x2984a4){return _0x1c2a21(_0x23ce68-0x45b,_0x23ce68-0x184,_0x47db0b,_0x2984a4-0x1dc);}function _0x5c6c7f(_0x659310,_0x1d1ec2,_0x5c60d1,_0x1a3009){return _0x38cc07(_0x659310-0xc5,_0x1d1ec2-0x46,_0x1a3009,_0x5c60d1- -0x475);}while(_0x5d2013[_0x5c6c7f(-_0x16ed76._0x1b0994,-0x191,-0x194,-0x190)]>0x0){const _0x28468a=_0x5d2013[_0x5c6c7f(-_0x16ed76._0x439c22,-0x186,-_0x16ed76._0x5a214b,-0x19f)]();if(!_0x28468a||_0x28468a[_0x2aa5e7(0x1ac,0x1aa,0x19d,0x1b5)])continue;_0x28468a[_0x2aa5e7(_0x16ed76._0x264056,_0x16ed76._0x2585c2,_0x16ed76._0x4bbe83,_0x16ed76._0x201384)]=!![],_0x28468a[_0x5c6c7f(-_0x16ed76._0x36c2c5,-_0x16ed76._0x264056,-0x19e,-0x198)](),_0x178b3f+=0x1,_0x28468a[_0x5c6c7f(-_0x16ed76._0x4faea0,-_0x16ed76._0x58a3a0,-0x193,-_0x16ed76._0x54126c)](_0x699a58());return;}};function _0x1c2a21(_0x3c831a,_0x1860b3,_0x12dcf3,_0x48d5b6){return _0xc294(_0x3c831a- -_0x4221db._0x31325d,_0x12dcf3);}const _0x214c7b=()=>{if(_0x178b3f>=_0x4b1d9e)return void 0x0;return _0x178b3f+=0x1,_0x699a58();};return{'tryAcquire':_0x214c7b,'acquire'(_0x20566e){const _0x131a20={_0x3f6319:0x179,_0x14b288:0x171,_0x1f3b25:0x495,_0x5a1617:0x48b,_0x2a79fa:0x485,_0x141f74:0x167,_0x19e87d:0x172,_0x197c9b:0x179,_0x159895:0x186,_0x145be3:0x17c};function _0x50e507(_0x26b268,_0x503b86,_0x274281,_0xc5e4f2){return _0x38cc07(_0x26b268-_0x5733f6._0x116981,_0x503b86-_0x5733f6._0x41760b,_0x503b86,_0x26b268- -_0x5733f6._0x2c962f);}function _0x5835ed(_0x2ae4e3,_0x28d211,_0x4f3ae9,_0x42838d){return _0x38cc07(_0x2ae4e3-_0x49f313._0xef7fdc,_0x28d211-_0x49f313._0x476d04,_0x2ae4e3,_0x28d211-_0x49f313._0x154e46);}if(_0x20566e?.[_0x50e507(_0x304339._0x22bdec,_0x304339._0x4219cb,_0x304339._0x560c83,0x1fb)])return Promise[_0x50e507(_0x304339._0x324bd2,_0x304339._0x4fff01,0x21c,0x218)](toAbortError(_0x20566e[_0x50e507(_0x304339._0x2a975a,_0x304339._0x4b733b,_0x304339._0x3e96f1,_0x304339._0x5313fc)]));const _0x191313=_0x214c7b();if(_0x191313!==void 0x0)return Promise[_0x5835ed(0x3bf,0x3b5,_0x304339._0x50938f,_0x304339._0x280fc7)](_0x191313);return new Promise((_0x350daa,_0x1e3941)=>{const _0x2d4fe1={'resolve':_0x350daa,'reject':_0x1e3941,'cancelled':![],'removeAbortListener':()=>{}};_0x5d2013['push'](_0x2d4fe1),_0x2d4fe1['removeAbortListener']=addAbortListener(_0x20566e,()=>{if(_0x2d4fe1['cancelled'])return;_0x2d4fe1['cancelled']=!![];function _0x2d9f28(_0x33dd6c,_0x5ca8d2,_0x37ffb9,_0x7e8763){return _0xc294(_0x37ffb9-0x3e8,_0x7e8763);}function _0x344fbf(_0x4b4495,_0x448e0b,_0x5dbc3a,_0x4eba0f){return _0xc294(_0x5dbc3a-0xc8,_0x448e0b);}_0x2d4fe1[_0x344fbf(0x170,_0x131a20._0x3f6319,0x16f,_0x131a20._0x14b288)]();const _0x2f30cd=_0x5d2013[_0x2d9f28(_0x131a20._0x1f3b25,_0x131a20._0x5a1617,_0x131a20._0x5a1617,_0x131a20._0x2a79fa)](_0x2d4fe1);if(_0x2f30cd>=0x0)_0x5d2013[_0x344fbf(_0x131a20._0x141f74,0x17c,_0x131a20._0x19e87d,0x16a)](_0x2f30cd,0x1);_0x2d4fe1[_0x344fbf(_0x131a20._0x197c9b,_0x131a20._0x159895,0x180,_0x131a20._0x145be3)](toAbortError(_0x20566e?.['reason']));});});}};}var MESSAGE_ROLES=[_0x48d7c7(0x33e,0x333,0x338,0x33f),_0x48d7c7(0x348,0x34e,0x344,0x34d)];function _0xc294(_0x397aa8,_0x3917f0){_0x397aa8=_0x397aa8-0x9e;const _0x5e625a=_0x5e62();let _0xc294fb=_0x5e625a[_0x397aa8];if(_0xc294['rKHjMb']===undefined){var _0x2b71e0=function(_0x24a857){const _0x71de4a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4b1d9e='',_0x178b3f='';for(let _0x5d2013=0x0,_0x699a58,_0x53480d,_0x214c7b=0x0;_0x53480d=_0x24a857['charAt'](_0x214c7b++);~_0x53480d&&(_0x699a58=_0x5d2013%0x4?_0x699a58*0x40+_0x53480d:_0x53480d,_0x5d2013++%0x4)?_0x4b1d9e+=String['fromCharCode'](0xff&_0x699a58>>(-0x2*_0x5d2013&0x6)):0x0){_0x53480d=_0x71de4a['indexOf'](_0x53480d);}for(let _0x4c7ea1=0x0,_0x28468a=_0x4b1d9e['length'];_0x4c7ea1<_0x28468a;_0x4c7ea1++){_0x178b3f+='%'+('00'+_0x4b1d9e['charCodeAt'](_0x4c7ea1)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x178b3f);};_0xc294['brxaYS']=_0x2b71e0,_0xc294['PjaeyH']={},_0xc294['rKHjMb']=!![];}const _0x195ff9=_0x5e625a[0x0],_0x1d5291=_0x397aa8+_0x195ff9,_0x37c14c=_0xc294['PjaeyH'][_0x1d5291];return!_0x37c14c?(_0xc294fb=_0xc294['brxaYS'](_0xc294fb),_0xc294['PjaeyH'][_0x1d5291]=_0xc294fb):_0xc294fb=_0x37c14c,_0xc294fb;}Object[_0x48d7c7(0x34a,0x33d,0x342,0x346)](MESSAGE_ROLES);export{MESSAGE_ROLES,OperationAbortedError,TurnFailedError,addAbortListener,createAbortAwareSemaphore,isAbortError,isAgentOnlyBashCompletion,modelIdentityFromParts,resolveAnthropicReasoningConfig,resolveOpenAiReasoningConfig,throwIfAborted,toAbortError};
|
package/dist/shared/types.d.ts
CHANGED
|
@@ -431,7 +431,7 @@ export interface ChatModel {
|
|
|
431
431
|
export interface ModelExecutionOptions {
|
|
432
432
|
signal?: AbortSignal;
|
|
433
433
|
}
|
|
434
|
-
export
|
|
434
|
+
export type TurnMessageMeta = {
|
|
435
435
|
provider?: string;
|
|
436
436
|
model?: string;
|
|
437
437
|
modelIdentity?: string;
|
|
@@ -459,7 +459,18 @@ export interface TurnMessageMeta {
|
|
|
459
459
|
presentation?: "command-echo" | "command-notice";
|
|
460
460
|
/** Notice row kind for presentation === "command-notice". */
|
|
461
461
|
noticeRole?: "info" | "warning" | "error";
|
|
462
|
-
}
|
|
462
|
+
} & ({
|
|
463
|
+
deliveryKind?: never;
|
|
464
|
+
transcriptVisibility?: never;
|
|
465
|
+
} | {
|
|
466
|
+
submissionOrigin: "coordinator";
|
|
467
|
+
deliveryKind: "bash-completion";
|
|
468
|
+
transcriptVisibility: "agent-only";
|
|
469
|
+
senderAgentId?: never;
|
|
470
|
+
subagentReport?: never;
|
|
471
|
+
presentation?: never;
|
|
472
|
+
noticeRole?: never;
|
|
473
|
+
});
|
|
463
474
|
export interface EngineChatModel {
|
|
464
475
|
model: string;
|
|
465
476
|
modelIdentity: string;
|
|
@@ -505,6 +516,8 @@ export interface AgentEventContext {
|
|
|
505
516
|
turnId: string;
|
|
506
517
|
state: TurnState;
|
|
507
518
|
executionScope: ToolExecutionScope;
|
|
519
|
+
/** Internal execution cancellation, when this event originates from a tool. */
|
|
520
|
+
signal?: AbortSignal;
|
|
508
521
|
}
|
|
509
522
|
export type AskUserOption = {
|
|
510
523
|
label: string;
|
|
@@ -634,7 +647,19 @@ export interface AgentProviderStreamResetEvent {
|
|
|
634
647
|
assistantMessageId: string;
|
|
635
648
|
reasoningMessageId: string;
|
|
636
649
|
}
|
|
637
|
-
export type
|
|
650
|
+
export type DelegatedModelIdentity = Readonly<{
|
|
651
|
+
runId: string;
|
|
652
|
+
/** 1-based delegated lifecycle order, not Agent.turnIndex or event time. */
|
|
653
|
+
turnNumber: number;
|
|
654
|
+
/** Absent only for the existing implicit synchronous/legacy first turn. */
|
|
655
|
+
turnId?: string;
|
|
656
|
+
modelIdentity: string;
|
|
657
|
+
}>;
|
|
658
|
+
export type AgentDelegatedModelResolvedEvent = DelegatedModelIdentity & Readonly<{
|
|
659
|
+
type: "delegated_model_resolved";
|
|
660
|
+
parentToolCallId: string;
|
|
661
|
+
}>;
|
|
662
|
+
export type AgentLifecycleEvent = AgentAssistantChunkEvent | AgentAssistantMessageEvent | AgentDelegatedModelResolvedEvent | AgentFinalMessageEvent | AgentModelRequestEvent | AgentModelResponseEvent | AgentProviderRetryEvent | AgentProviderStreamResetEvent | AgentReasoningChunkEvent | AgentReasoningMessageEvent | AgentToolCallEvent | AgentToolUseChunkEvent | AgentToolUseMessageEvent | AgentToolResultEvent | AgentToolResultMessageEvent | AgentTurnCompleteEvent | AgentUserMessageEvent;
|
|
638
663
|
export type AgentEvent = AgentLifecycleEvent | ToolRuntimeEvent;
|
|
639
664
|
export type ToolRuntimeDispatchDecision = {
|
|
640
665
|
action: "reject";
|
|
@@ -761,15 +786,26 @@ export type AgentInput = MessageInput | string;
|
|
|
761
786
|
/** Immutable ownership metadata for the exact agent submission being sent. */
|
|
762
787
|
export type AgentSubmission = Readonly<{
|
|
763
788
|
origin: "user";
|
|
789
|
+
deliveryKind?: never;
|
|
790
|
+
transcriptVisibility?: never;
|
|
764
791
|
}> | Readonly<{
|
|
765
792
|
origin: "coordinator";
|
|
766
793
|
token: string;
|
|
767
794
|
/** Trusted delegated report delivery whose provider text must remain verbatim. */
|
|
768
795
|
deliveryKind?: "subagent-report";
|
|
796
|
+
transcriptVisibility?: never;
|
|
769
797
|
subagentReport?: SubagentReportMeta;
|
|
798
|
+
}> | Readonly<{
|
|
799
|
+
origin: "coordinator";
|
|
800
|
+
token: string;
|
|
801
|
+
deliveryKind: "bash-completion";
|
|
802
|
+
transcriptVisibility: "agent-only";
|
|
803
|
+
subagentReport?: never;
|
|
770
804
|
}> | Readonly<{
|
|
771
805
|
origin: "agent";
|
|
772
806
|
senderAgentId: string;
|
|
807
|
+
deliveryKind?: never;
|
|
808
|
+
transcriptVisibility?: never;
|
|
773
809
|
}>;
|
|
774
810
|
export type TurnSteeringInput = MessageInput | Readonly<{
|
|
775
811
|
input: MessageInput;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Agent } from "../../agent/agent.ts";
|
|
2
2
|
import type { AbortAwareSemaphore } from "../../shared/abort-aware-semaphore.ts";
|
|
3
|
-
import type { AgentDefinitionFactoryContext, AgentOptions } from "../../shared/types.ts";
|
|
3
|
+
import type { AgentDefinitionFactoryContext, AgentOptions, DelegatedModelIdentity, ModelUsageTotals } from "../../shared/types.ts";
|
|
4
4
|
export declare const MODEL_TIERS: readonly ["fast", "balanced", "powerful"];
|
|
5
5
|
export type ModelTier = (typeof MODEL_TIERS)[number];
|
|
6
6
|
export type BackgroundAssignmentState = "started" | "queued";
|
|
@@ -13,6 +13,10 @@ export type BackgroundAssignmentRequest = Readonly<{
|
|
|
13
13
|
parentSessionId: string;
|
|
14
14
|
parentToolCallId: string;
|
|
15
15
|
requestedModelTier?: ModelTier;
|
|
16
|
+
/** Short user-facing summary of the delegated work (AssignTask `description`). */
|
|
17
|
+
description?: string;
|
|
18
|
+
/** Optional short display name for the run (AssignTask `nickname`). */
|
|
19
|
+
nickname?: string;
|
|
16
20
|
}>;
|
|
17
21
|
export type BackgroundMessageRequest = Readonly<{
|
|
18
22
|
runId: string;
|
|
@@ -49,10 +53,33 @@ export type BackgroundStopResult = Readonly<{
|
|
|
49
53
|
agentId: string;
|
|
50
54
|
state: "idle" | "stopping";
|
|
51
55
|
}> | BackgroundDelegationRejection;
|
|
56
|
+
export type DelegatedRunState = "idle" | "queued" | "running" | "closing";
|
|
57
|
+
/** Snapshot of one live delegated conversation, as reported by ListAgents. */
|
|
58
|
+
export type DelegatedRunSummary = Readonly<{
|
|
59
|
+
runId: string;
|
|
60
|
+
agentId: string;
|
|
61
|
+
state: DelegatedRunState;
|
|
62
|
+
/** Set when state is "idle": the conversation is quiesced, awaiting SendMessage. */
|
|
63
|
+
waitingFor?: "steering";
|
|
64
|
+
task?: string;
|
|
65
|
+
description?: string;
|
|
66
|
+
nickname?: string;
|
|
67
|
+
requestedModelTier?: ModelTier;
|
|
68
|
+
childSessionId: string;
|
|
69
|
+
usage: ModelUsageTotals;
|
|
70
|
+
}>;
|
|
71
|
+
export type BackgroundListRequest = Readonly<{
|
|
72
|
+
parentSessionId: string;
|
|
73
|
+
runId?: string;
|
|
74
|
+
}>;
|
|
75
|
+
export type BackgroundListResult = Readonly<{
|
|
76
|
+
runs: readonly DelegatedRunSummary[];
|
|
77
|
+
}>;
|
|
52
78
|
export interface BackgroundDelegationCapability {
|
|
53
79
|
assign(request: BackgroundAssignmentRequest): Promise<BackgroundAssignmentResult>;
|
|
54
80
|
sendMessage(request: BackgroundMessageRequest): Promise<BackgroundMessageResult>;
|
|
55
81
|
stopAgent(request: BackgroundStopRequest): Promise<BackgroundStopResult>;
|
|
82
|
+
list(request: BackgroundListRequest): Promise<BackgroundListResult>;
|
|
56
83
|
}
|
|
57
84
|
export interface DelegatedAgentFactoryContext extends AgentDefinitionFactoryContext {
|
|
58
85
|
parentSessionId: string;
|
|
@@ -88,6 +115,7 @@ export type DelegatedRunOutcome = Readonly<{
|
|
|
88
115
|
}>;
|
|
89
116
|
export interface DelegatedRunLifecycleHooks {
|
|
90
117
|
start(agent: Agent, context: DelegatedAgentFactoryContext): Promise<void>;
|
|
118
|
+
modelResolved?(context: DelegatedAgentFactoryContext, model: DelegatedModelIdentity): Promise<void>;
|
|
91
119
|
finish(context: DelegatedAgentFactoryContext, outcome: DelegatedRunOutcome): Promise<void>;
|
|
92
120
|
}
|
|
93
121
|
export type DelegatedAgentDefinition = AgentOptions | ((ctx: DelegatedAgentFactoryContext) => DelegatedAgentFactoryResult | Promise<DelegatedAgentFactoryResult>);
|
|
@@ -117,6 +145,13 @@ export interface CreateDelegationToolsOptions {
|
|
|
117
145
|
export declare function isValidDelegatedRunId(value: unknown): value is string;
|
|
118
146
|
export declare function createDelegatedRunId(): string;
|
|
119
147
|
export declare function resolveDelegatedAgentOptions(definition: DelegatedAgentDefinition, ctx: DelegatedAgentFactoryContext): Promise<DelegatedAgentResolution>;
|
|
148
|
+
/**
|
|
149
|
+
* Canonical accepted-assignment output. This exact text is persisted in
|
|
150
|
+
* transcripts and re-validated verbatim by the runtime's transcript projection
|
|
151
|
+
* (transcript-message-projection.ts), so the grammar lives here, not in the
|
|
152
|
+
* consumer.
|
|
153
|
+
*/
|
|
154
|
+
export declare function formatBackgroundAssignmentOutput(runId: string, state: BackgroundAssignmentState): string;
|
|
120
155
|
export declare function createAssignTaskTool(options: CreateDelegationToolsOptions): import("../../shared/types.ts").ToolDefinition<{
|
|
121
156
|
description: string;
|
|
122
157
|
agentId: string;
|
|
@@ -186,6 +221,18 @@ export declare function createStopAgentTool(background: BackgroundDelegationCapa
|
|
|
186
221
|
required: string[];
|
|
187
222
|
additionalProperties: false;
|
|
188
223
|
}>;
|
|
224
|
+
export declare function createListAgentsTool(background: BackgroundDelegationCapability): import("../../shared/types.ts").ToolDefinition<{
|
|
225
|
+
runId: string;
|
|
226
|
+
}, never, import("../../shared/types.ts").ToolOutputEnvelope, {
|
|
227
|
+
type: "object";
|
|
228
|
+
properties: {
|
|
229
|
+
runId: {
|
|
230
|
+
type: "string";
|
|
231
|
+
description: string;
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
additionalProperties: false;
|
|
235
|
+
}>;
|
|
189
236
|
export declare const createDelegateToAgentTool: typeof createAssignTaskTool;
|
|
190
237
|
export declare function createDelegationTools(options: CreateDelegationToolsOptions): (import("../../shared/types.ts").ToolDefinition<{
|
|
191
238
|
description: string;
|
|
@@ -229,7 +276,6 @@ export declare function createDelegationTools(options: CreateDelegationToolsOpti
|
|
|
229
276
|
description: string;
|
|
230
277
|
};
|
|
231
278
|
};
|
|
232
|
-
required: string[];
|
|
233
279
|
additionalProperties: false;
|
|
234
280
|
}>)[];
|
|
235
281
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FileHandle } from "node:fs/promises";
|
|
2
|
+
import type { ToolOutputEnvelope } from "../../shared/types.ts";
|
|
3
|
+
/** Reads only the fstat byte snapshot of an already authorized descriptor.
|
|
4
|
+
* Memory is one 64 KiB read/decoder chunk plus a response-budget-sized prefix.
|
|
5
|
+
* A clipped line cannot be resumed with line pagination; only later lines can.
|
|
6
|
+
*/
|
|
7
|
+
export declare function readBashArtifactText(input: Readonly<{
|
|
8
|
+
file: FileHandle;
|
|
9
|
+
lineStart?: number;
|
|
10
|
+
lineEnd?: number;
|
|
11
|
+
maxBytes: number;
|
|
12
|
+
}>): Promise<ToolOutputEnvelope>;
|
|
13
|
+
//# sourceMappingURL=bash-artifact-read.d.ts.map
|
|
@@ -8,6 +8,7 @@ export interface FileReadToolOptions {
|
|
|
8
8
|
mode?: FileEditMode;
|
|
9
9
|
observations?: FileObservationStore;
|
|
10
10
|
outputBudgetBytes?: number;
|
|
11
|
+
bashArtifactSessionsRoot?: string;
|
|
11
12
|
}
|
|
12
13
|
export declare function createFileReadTool(options?: FileReadToolOptions): import("../../shared/types.ts").ToolDefinition<{
|
|
13
14
|
path: string;
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export * from "./session/skill-tool.ts";
|
|
|
37
37
|
export * from "./session/todo-write-tool.ts";
|
|
38
38
|
export * from "./shell/background-bash-controller.ts";
|
|
39
39
|
export * from "./shell/background-bash-process.ts";
|
|
40
|
-
export * from "./shell/bash-
|
|
40
|
+
export * from "./shell/bash-artifact.ts";
|
|
41
41
|
export * from "./shell/bash-tool.ts";
|
|
42
42
|
export * from "./shell/command-tool.ts";
|
|
43
43
|
export * from "./shell/kill-shell-tool.ts";
|