@nuvin/agent-core 0.3.1-rc.2 → 0.4.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/VERSION +2 -2
- package/dist/agent/compaction-handoff.d.ts +70 -0
- package/dist/agent/context-compactor.d.ts +1 -1
- 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 +59 -1
- 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(_0x10c448,_0x533e85){const _0xbb9bdf={_0x5cef5c:0x4a9,_0x58943c:0x4af,_0x46d330:0x4bb,_0x5ddf1e:0x136,_0x3eb789:0x138,_0x4692e4:0x4a3,_0x397bd3:0x12e,_0x1397ab:0x157,_0x3ed419:0x4ab,_0x4a2db1:0x4be,_0x1be353:0x4bd,_0x568f0e:0x13c,_0x58fb01:0x149,_0x31eb6a:0x12a,_0x3bce6d:0x135,_0x8e006d:0x134,_0x2121c3:0x12c,_0x2e9c42:0x130,_0x187162:0x140,_0x4069e9:0x137},_0xee2169={_0x3fedfa:0x2a0};function _0x2ac6ef(_0xe4e48,_0x5c177e,_0x205e4c,_0x11f9fc){return _0x1a59(_0x5c177e-0x34c,_0xe4e48);}const _0x1d1aa8=_0x10c448();function _0x168d8b(_0x26c967,_0x558090,_0x232c0b,_0x5cb9ae){return _0x1a59(_0x5cb9ae- -_0xee2169._0x3fedfa,_0x232c0b);}while(!![]){try{const _0x7736a3=-parseInt(_0x2ac6ef(_0xbb9bdf._0x5cef5c,_0xbb9bdf._0x58943c,0x4af,_0xbb9bdf._0x46d330))/0x1*(parseInt(_0x168d8b(-_0xbb9bdf._0x5ddf1e,-0x143,-0x143,-_0xbb9bdf._0x3eb789))/0x2)+parseInt(_0x2ac6ef(0x4b4,0x4b3,_0xbb9bdf._0x46d330,_0xbb9bdf._0x5cef5c))/0x3*(-parseInt(_0x2ac6ef(0x4b7,0x4ac,0x4a8,_0xbb9bdf._0x4692e4))/0x4)+parseInt(_0x168d8b(-0x12a,-0x132,-0x138,-_0xbb9bdf._0x397bd3))/0x5+-parseInt(_0x168d8b(-0x142,-_0xbb9bdf._0x1397ab,-0x158,-0x14a))/0x6*(parseInt(_0x2ac6ef(0x4a1,0x4b0,0x4b1,_0xbb9bdf._0x3ed419))/0x7)+parseInt(_0x2ac6ef(_0xbb9bdf._0x4a2db1,0x4b8,_0xbb9bdf._0x1be353,0x4ae))/0x8*(-parseInt(_0x168d8b(-0x14b,-0x153,-_0xbb9bdf._0x568f0e,-_0xbb9bdf._0x58fb01))/0x9)+-parseInt(_0x168d8b(-0x12d,-_0xbb9bdf._0x31eb6a,-0x140,-_0xbb9bdf._0x3bce6d))/0xa+-parseInt(_0x168d8b(-_0xbb9bdf._0x8e006d,-_0xbb9bdf._0x2121c3,-0x135,-_0xbb9bdf._0x2e9c42))/0xb*(-parseInt(_0x168d8b(-_0xbb9bdf._0x187162,-0x137,-0x12b,-_0xbb9bdf._0x4069e9))/0xc);if(_0x7736a3===_0x533e85)break;else _0x1d1aa8['push'](_0x1d1aa8['shift']());}catch(_0x3cf4ec){_0x1d1aa8['push'](_0x1d1aa8['shift']());}}}(_0x1544,0xd4851));function _0x1a59(_0x30fb99,_0x2b0408){_0x30fb99=_0x30fb99-0x156;const _0x154425=_0x1544();let _0x1a5948=_0x154425[_0x30fb99];if(_0x1a59['PkOVpJ']===undefined){var _0xd23503=function(_0xb1f983){const _0x44a7d8='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x27a97a='',_0x4ded0b='';for(let _0x161b35=0x0,_0x2f3f1b,_0x2c909d,_0x4b1f36=0x0;_0x2c909d=_0xb1f983['charAt'](_0x4b1f36++);~_0x2c909d&&(_0x2f3f1b=_0x161b35%0x4?_0x2f3f1b*0x40+_0x2c909d:_0x2c909d,_0x161b35++%0x4)?_0x27a97a+=String['fromCharCode'](0xff&_0x2f3f1b>>(-0x2*_0x161b35&0x6)):0x0){_0x2c909d=_0x44a7d8['indexOf'](_0x2c909d);}for(let _0x220894=0x0,_0x1c1098=_0x27a97a['length'];_0x220894<_0x1c1098;_0x220894++){_0x4ded0b+='%'+('00'+_0x27a97a['charCodeAt'](_0x220894)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4ded0b);};_0x1a59['vGklfN']=_0xd23503,_0x1a59['QedsVJ']={},_0x1a59['PkOVpJ']=!![];}const _0x3b149c=_0x154425[0x0],_0x36c920=_0x30fb99+_0x3b149c,_0x299380=_0x1a59['QedsVJ'][_0x36c920];return!_0x299380?(_0x1a5948=_0x1a59['vGklfN'](_0x1a5948),_0x1a59['QedsVJ'][_0x36c920]=_0x1a5948):_0x1a5948=_0x299380,_0x1a5948;}import{modelIdentityFromParts}from'../chunk-D5IVWJHX.js';function _0x5c3365(_0x28e29c,_0x144907,_0x3142ca,_0x36a2f6){return _0x1a59(_0x28e29c- -0x107,_0x36a2f6);}import{resolveAnthropicReasoningConfig,resolveOpenAiReasoningConfig}from'../chunk-IUZALP6K.js';import{TurnFailedError,isAgentOnlyBashCompletion}from'../chunk-CVOXBVKH.js';import{OperationAbortedError,addAbortListener,isAbortError,throwIfAborted,toAbortError}from'../chunk-X7VAACWY.js';function createAbortAwareSemaphore(_0x27a97a){const _0x56b548={_0xf84e44:0xa5,_0x462764:0xaa,_0x19379e:0x3dc,_0x434d06:0x3e7,_0x14d871:0x3df,_0x5d5aca:0x3f0},_0x3d0202={_0x4b7377:0x13d,_0x25936e:0x2a1,_0x109a25:0x2b0,_0x3219c8:0x2c2,_0x5c2f2d:0x2b4,_0x4a1d83:0x2a9,_0x5c5d9c:0x2ab},_0x2839b7={_0x267328:0x431,_0x45fe8f:0x424,_0x2bec5c:0x446,_0x592fb1:0x438,_0x5b7ac0:0x4f4,_0x52b358:0x434,_0x1bfe14:0x428,_0x7e0cc:0x427,_0x36cc98:0x4f8,_0x5af935:0x4f5,_0x4ce817:0x4f2},_0x489d84={_0x27ea23:0x18f};function _0x1a0cf1(_0xbad1d8,_0xf32e7b,_0x582d9e,_0x4d7805){return _0x1a59(_0x582d9e-0x285,_0x4d7805);}function _0x3bb41f(_0x4428c5,_0x12db8b,_0x1b0cb2,_0x296a41){return _0x1a59(_0x1b0cb2- -0xc3,_0x4428c5);}if(!Number[_0x3bb41f(0xa2,_0x56b548._0xf84e44,_0x56b548._0x462764,0x9d)](_0x27a97a)||!Number[_0x1a0cf1(0x3f1,_0x56b548._0x19379e,_0x56b548._0x434d06,_0x56b548._0x14d871)](_0x27a97a)||_0x27a97a<=0x0)throw new Error(_0x1a0cf1(0x3e7,0x400,0x3f6,_0x56b548._0x5d5aca));let _0x4ded0b=0x0;const _0x161b35=[],_0x2f3f1b=()=>{let _0x220894=![];return()=>{if(_0x220894)return;_0x220894=!![],_0x4ded0b-=0x1,_0x2c909d();};},_0x2c909d=()=>{const _0x33ecd0={_0x354193:0xff};function _0x27b9da(_0x261b07,_0x59c30c,_0x2b9451,_0x45b304){return _0x3bb41f(_0x2b9451,_0x59c30c-_0x489d84._0x27ea23,_0x59c30c-0x45f,_0x45b304-0x168);}function _0x10bd21(_0x3e1c90,_0x2de2b1,_0x268b74,_0x4422e0){return _0x1a0cf1(_0x3e1c90-0x1e6,_0x2de2b1-_0x33ecd0._0x354193,_0x268b74-0x44,_0x2de2b1);}while(_0x161b35[_0x10bd21(_0x2839b7._0x267328,0x428,_0x2839b7._0x45fe8f,0x430)]>0x0){const _0x1c1098=_0x161b35[_0x10bd21(0x42a,_0x2839b7._0x2bec5c,_0x2839b7._0x592fb1,0x42a)]();if(!_0x1c1098||_0x1c1098[_0x27b9da(0x4ea,_0x2839b7._0x5b7ac0,0x4f8,0x4ff)])continue;_0x1c1098['cancelled']=!![],_0x1c1098[_0x10bd21(_0x2839b7._0x52b358,0x42b,_0x2839b7._0x1bfe14,_0x2839b7._0x7e0cc)](),_0x4ded0b+=0x1,_0x1c1098[_0x27b9da(0x500,_0x2839b7._0x36cc98,_0x2839b7._0x5af935,_0x2839b7._0x4ce817)](_0x2f3f1b());return;}},_0x4b1f36=()=>{if(_0x4ded0b>=_0x27a97a)return void 0x0;return _0x4ded0b+=0x1,_0x2f3f1b();};return{'tryAcquire':_0x4b1f36,'acquire'(_0x5351d7){const _0x9fe4e1={_0x3e9c16:0x31f,_0x44f97e:0x322,_0x4459de:0x32b,_0x539681:0x12f},_0x5d7d39={_0x321471:0x36b,_0xd80c51:0x37d,_0xdbfa05:0x370,_0x207e63:0x366,_0x4eb261:0x37a,_0x5cef29:0x37d,_0x825c41:0x377,_0x3bbb30:0x50d,_0x535d6d:0x513,_0x15fdab:0x51b,_0x2b6366:0x502,_0x9703ee:0x50b,_0xb01025:0x513,_0xa04b3c:0x512},_0x420c07={_0xc793b6:0xdb,_0x2cedd1:0x126,_0x25ab53:0x72},_0xe06652={_0x49c80a:0x8,_0x3bd571:0x1b7,_0xa44c27:0xb8},_0xbcaf0f={_0x5ed28a:0x1a,_0x102a56:0xf5,_0x34a1eb:0x136},_0x129dd4={_0x5e3026:0xb3,_0x47f2fe:0x51b};function _0x505cb0(_0x2196bb,_0x25a287,_0x316673,_0x539389){return _0x1a0cf1(_0x2196bb-_0x129dd4._0x5e3026,_0x25a287-0x100,_0x2196bb- -_0x129dd4._0x47f2fe,_0x539389);}if(_0x5351d7?.[_0x505cb0(-0x130,-0x12f,-0x125,-_0x3d0202._0x4b7377)])return Promise[_0x2bad5c(_0x3d0202._0x25936e,_0x3d0202._0x109a25,0x2a9,0x2ac)](toAbortError(_0x5351d7[_0x2bad5c(_0x3d0202._0x3219c8,0x2ae,0x2b1,0x2b4)]));function _0x2bad5c(_0x159fa6,_0x5d3b97,_0x52f822,_0x3f683d){return _0x1a0cf1(_0x159fa6-_0xbcaf0f._0x5ed28a,_0x5d3b97-_0xbcaf0f._0x102a56,_0x3f683d- -_0xbcaf0f._0x34a1eb,_0x159fa6);}const _0x4b3f20=_0x4b1f36();if(_0x4b3f20!==void 0x0)return Promise[_0x2bad5c(0x2a8,_0x3d0202._0x5c2f2d,_0x3d0202._0x4a1d83,_0x3d0202._0x5c5d9c)](_0x4b3f20);return new Promise((_0x1559c0,_0x10251c)=>{function _0x203e9f(_0x2c2fef,_0x436787,_0x359651,_0x500de9){return _0x505cb0(_0x500de9-_0xe06652._0x49c80a,_0x436787-_0xe06652._0x3bd571,_0x359651-_0xe06652._0xa44c27,_0x436787);}const _0x3c9972={'resolve':_0x1559c0,'reject':_0x10251c,'cancelled':![],'removeAbortListener':()=>{}};function _0x56515c(_0x2932a9,_0x39ae3d,_0x56dd0f,_0x20f65f){return _0x2bad5c(_0x56dd0f,_0x39ae3d-_0x420c07._0xc793b6,_0x56dd0f-_0x420c07._0x2cedd1,_0x39ae3d-_0x420c07._0x25ab53);}_0x161b35[_0x56515c(_0x9fe4e1._0x3e9c16,_0x9fe4e1._0x44f97e,_0x9fe4e1._0x4459de,0x317)](_0x3c9972),_0x3c9972[_0x203e9f(-0x129,-0x12c,-0x136,-_0x9fe4e1._0x539681)]=addAbortListener(_0x5351d7,()=>{const _0x2f9c1f={_0x3295f1:0x38},_0x14ccce={_0x145710:0x57};if(_0x3c9972[_0x3d4cec(_0x5d7d39._0x321471,_0x5d7d39._0xd80c51,0x365,_0x5d7d39._0xdbfa05)])return;_0x3c9972[_0x3d4cec(_0x5d7d39._0x207e63,_0x5d7d39._0x4eb261,_0x5d7d39._0x321471,0x370)]=!![],_0x3c9972[_0x3d4cec(0x37e,0x368,_0x5d7d39._0x5cef29,_0x5d7d39._0x825c41)]();const _0x50f3cd=_0x161b35[_0x19aca5(_0x5d7d39._0x3bbb30,_0x5d7d39._0x535d6d,0x515,_0x5d7d39._0x15fdab)](_0x3c9972);function _0x3d4cec(_0x6035e3,_0x15a41e,_0x441141,_0x56b3b8){return _0x56515c(_0x6035e3-0x43,_0x56b3b8-_0x14ccce._0x145710,_0x15a41e,_0x56b3b8-0x36);}if(_0x50f3cd>=0x0)_0x161b35[_0x19aca5(_0x5d7d39._0x2b6366,0x512,0x4ff,_0x5d7d39._0x9703ee)](_0x50f3cd,0x1);function _0x19aca5(_0x5a381f,_0x426833,_0x1dc11a,_0x30c740){return _0x56515c(_0x5a381f-_0x2f9c1f._0x3295f1,_0x30c740-0x1ec,_0x1dc11a,_0x30c740-0xa4);}_0x3c9972['reject'](toAbortError(_0x5351d7?.[_0x19aca5(_0x5d7d39._0xb01025,0x50d,0x50d,_0x5d7d39._0xa04b3c)]));});});}};}function _0x318f86(_0x563319,_0x10ccd9,_0x3035a6,_0x2f7feb){const _0x359b28={_0x91402f:0x385};return _0x1a59(_0x2f7feb-_0x359b28._0x91402f,_0x10ccd9);}var MESSAGE_ROLES=[_0x318f86(0x4ec,0x4e3,0x4e9,0x4df),_0x318f86(0x4db,0x4d6,0x4eb,0x4de)];Object[_0x318f86(0x4f5,0x4ed,0x4e1,0x4ef)](MESSAGE_ROLES);export{MESSAGE_ROLES,OperationAbortedError,TurnFailedError,addAbortListener,createAbortAwareSemaphore,isAbortError,isAgentOnlyBashCompletion,modelIdentityFromParts,resolveAnthropicReasoningConfig,resolveOpenAiReasoningConfig,throwIfAborted,toAbortError};function _0x1544(){const _0x45829c=['yxnZAxn0yw50','BgvUz3rO','CMvZB2X2zq','CMvQzwn0','C3bSAwnL','CMvTB3zLqwjVCNrmAxn0zw5LCG','ogDlrKPpyW','ChvZAa','AxnjBNrLz2vY','odq5nu1lAurSqW','mtG2ota3rKnxzxjm','CMvHC29U','ywjVCNrLza','ndm3odiZtK9xq0XY','mJKWCKDjvxH1','nJu2nZGYogzeyxHStW','zNjLzxPL','mtm1nJaWotbWBgvTrhG','nJqWodGYneDswM1RCG','AxngAw5PDgu','Aw5KzxHpzG','C2HPzNq','odHlAvryrK4','Bwf4q29Uy3vYCMvUy3KGBxvZDcbIzsbHigzPBML0zsbWB3nPDgL2zsbPBNrLz2vY','nZeZodu5mfzbtfDWBW','mtaYrKDWzgfI','mtHgu0LlsKu','y2fUy2vSBgvK','DxnLCG'];_0x1544=function(){return _0x45829c;};return _0x1544();}
|
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 | undefined;
|
|
226
|
+
}, never, import("../../shared/types.ts").ToolOutputEnvelope, {
|
|
227
|
+
type: "object";
|
|
228
|
+
properties: {
|
|
229
|
+
runId: {
|
|
230
|
+
type: "string";
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
required: never[];
|
|
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;
|
|
@@ -231,6 +278,17 @@ export declare function createDelegationTools(options: CreateDelegationToolsOpti
|
|
|
231
278
|
};
|
|
232
279
|
required: string[];
|
|
233
280
|
additionalProperties: false;
|
|
281
|
+
}> | import("../../shared/types.ts").ToolDefinition<{
|
|
282
|
+
runId?: string | undefined;
|
|
283
|
+
}, never, import("../../shared/types.ts").ToolOutputEnvelope, {
|
|
284
|
+
type: "object";
|
|
285
|
+
properties: {
|
|
286
|
+
runId: {
|
|
287
|
+
type: "string";
|
|
288
|
+
};
|
|
289
|
+
};
|
|
290
|
+
required: never[];
|
|
291
|
+
additionalProperties: false;
|
|
234
292
|
}>)[];
|
|
235
293
|
export {};
|
|
236
294
|
//# sourceMappingURL=runtime-manager-tools.d.ts.map
|
|
@@ -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";
|