@x-otto/tools 0.1.0-alpha.27 → 0.1.0-alpha.28
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/index.d.ts +48 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -13
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/dist/index.d.ts
CHANGED
|
@@ -273,7 +273,8 @@ interface SandboxWrapResult {
|
|
|
273
273
|
* M4 1b-2:可选 ctx 让提供者按当前操作裁决——被批准 bypass 的命令返回 undefined(该次不套沙箱)。
|
|
274
274
|
*/
|
|
275
275
|
type SandboxProvider = (ctx?: {
|
|
276
|
-
command?: string;
|
|
276
|
+
command?: string; /** RFC-455 D3:命令所属会话——宿主据此识别只读会话(强制只读档 + 禁 bypass)。 */
|
|
277
|
+
sessionId?: string;
|
|
277
278
|
}) => SandboxStrategy | undefined;
|
|
278
279
|
//#endregion
|
|
279
280
|
//#region src/shell/background-types.d.ts
|
|
@@ -481,14 +482,18 @@ type ReadMemory = (name: string) => Promise<string | null>;
|
|
|
481
482
|
* mode=fork/team 吸收(§10 C5),类型抽到此中性处供工具面与 register-builtin 共用。
|
|
482
483
|
*/
|
|
483
484
|
/** mode=fork:在全新隔离会话里跑 prompt-only 子任务(不继承父上下文,§10 C15)。 */
|
|
484
|
-
type ForkRunner = (prompt: string, depth?: number, signal?: AbortSignal
|
|
485
|
+
type ForkRunner = (prompt: string, depth?: number, signal?: AbortSignal, /** Phase 0 补漏:发起 fork 的父会话 id——宿主据此解析只读性(只读边界沿委派链传播)。 */
|
|
486
|
+
|
|
487
|
+
parentSessionId?: string) => Promise<{
|
|
485
488
|
ok: boolean;
|
|
486
489
|
value?: string;
|
|
487
490
|
error?: string;
|
|
488
491
|
}>;
|
|
489
492
|
/** mode=team:跑声明式多 agent team(topology 由 swarm 决,.otto/teams/*.md)。
|
|
490
493
|
* parentTaskId:RFC-371 M-A 父任务锚点——team 成员 turn 内再委派时计入该 parent 的扇出治理。 */
|
|
491
|
-
type RunTeam = (team: string, input: string, signal?: AbortSignal, depth?: number, parentTaskId?: string
|
|
494
|
+
type RunTeam = (team: string, input: string, signal?: AbortSignal, depth?: number, parentTaskId?: string, /** T3:发起 team 的父会话 id——只读会话据此被 fail-closed 拒绝(成员链无 readOnly 概念)。 */
|
|
495
|
+
|
|
496
|
+
parentSessionId?: string) => Promise<{
|
|
492
497
|
success: boolean;
|
|
493
498
|
output?: string;
|
|
494
499
|
pattern?: string;
|
|
@@ -834,8 +839,8 @@ declare function buildDelegationAgentListDescription(profiles: AgentSummary[]):
|
|
|
834
839
|
declare const TaskInspectArgsSchema: z.ZodObject<{
|
|
835
840
|
action: z.ZodEnum<{
|
|
836
841
|
output: "output";
|
|
837
|
-
list: "list";
|
|
838
842
|
get: "get";
|
|
843
|
+
list: "list";
|
|
839
844
|
}>;
|
|
840
845
|
taskId: z.ZodOptional<z.ZodString>;
|
|
841
846
|
statusFilter: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
@@ -1181,6 +1186,12 @@ interface MacOsSeatbeltOptions {
|
|
|
1181
1186
|
* 项目根目录和临时目录已默认允许;额外路径按需添加。
|
|
1182
1187
|
*/
|
|
1183
1188
|
writablePaths?: string[];
|
|
1189
|
+
/**
|
|
1190
|
+
* RFC-455 D1:**只读档**——不加任何可写根(连 projectRoot/tmpdir 也不加),
|
|
1191
|
+
* 写只允许 `/dev/*` 字面量。用于只读会话「保留 shell + 内核级只读」。
|
|
1192
|
+
* 注意:只读档使可写集合**严格收窄**(R4),绝不放宽。
|
|
1193
|
+
*/
|
|
1194
|
+
readOnly?: boolean;
|
|
1184
1195
|
/**
|
|
1185
1196
|
* 凭证读隔离(opt-in,endgame review 余 backlog #1 的真正落点):拒绝读取这些子树。
|
|
1186
1197
|
* seatbelt 默认 `(allow file-read* /)` 整盘可读 → 凭证目录(~/.ssh 等)默认可被读出外泄;
|
|
@@ -1198,6 +1209,7 @@ interface MacOsSeatbeltOptions {
|
|
|
1198
1209
|
*
|
|
1199
1210
|
* 约束:
|
|
1200
1211
|
* - 文件系统:只读访问系统路径,可写仅限 projectRoot + /tmp + 指定额外路径
|
|
1212
|
+
* (RFC-455 D1 只读档例外:不加任何可写根)
|
|
1201
1213
|
* - 网络:按 options.network 控制
|
|
1202
1214
|
* - 进程:允许 fork(bash 命令常需 fork 子进程)
|
|
1203
1215
|
*
|
|
@@ -1210,8 +1222,6 @@ declare class MacOsSeatbeltSandbox implements SandboxStrategy {
|
|
|
1210
1222
|
constructor(options?: MacOsSeatbeltOptions);
|
|
1211
1223
|
wrap(input: SandboxWrapInput): SandboxWrapResult;
|
|
1212
1224
|
dispose(): Promise<void>;
|
|
1213
|
-
/** 生成 Seatbelt profile 文本 */
|
|
1214
|
-
private buildProfile;
|
|
1215
1225
|
/**
|
|
1216
1226
|
* 同步确保 profile 临时文件存在(spawn 调用点同步执行,需要文件立即可读)。
|
|
1217
1227
|
* 同内容复用缓存路径;文件被外部清理(如系统 tmp 清扫)时重写。
|
|
@@ -1243,6 +1253,12 @@ interface BubblewrapOptions {
|
|
|
1243
1253
|
* 恰为 $HOME → `--bind $HOME` 把 ~/.ssh 也暴露了)时,用 `--tmpfs <dir>` 以空 tmpfs 遮蔽。
|
|
1244
1254
|
*/
|
|
1245
1255
|
denyReadPaths?: string[];
|
|
1256
|
+
/**
|
|
1257
|
+
* RFC-455 D1:**只读档**——项目根改 `--ro-bind`(可见可读、不可写),额外可写路径不绑定;
|
|
1258
|
+
* `/tmp` 保持隔离 tmpfs(写只存内存、不触宿主)。用于只读会话「保留 shell + 内核级只读」。
|
|
1259
|
+
* 只读档使可写集合**严格收窄**(R4),绝不放宽。
|
|
1260
|
+
*/
|
|
1261
|
+
readOnly?: boolean;
|
|
1246
1262
|
}
|
|
1247
1263
|
/**
|
|
1248
1264
|
* Linux Bubblewrap (bwrap) 沙箱策略。
|
|
@@ -1288,6 +1304,12 @@ interface PlatformSandboxOptions {
|
|
|
1288
1304
|
* 标准凭证集见 {@link credentialDenyReadPaths}。seatbelt 末尾追加 deny;bwrap 仅遮蔽落在绑定区内者。
|
|
1289
1305
|
*/
|
|
1290
1306
|
denyReadPaths?: string[];
|
|
1307
|
+
/**
|
|
1308
|
+
* RFC-455 D1:**只读档**——不加任何可写根(seatbelt:仅 `/dev/*` 字面量;
|
|
1309
|
+
* bwrap:项目根改 `--ro-bind` 且不绑定额外可写路径)。用于只读会话「保留 shell + 内核级只读」。
|
|
1310
|
+
* 只读档使可写集合**严格收窄**(R4),绝不放宽。
|
|
1311
|
+
*/
|
|
1312
|
+
readOnly?: boolean;
|
|
1291
1313
|
/**
|
|
1292
1314
|
* 强制指定平台策略名,跳过 process.platform 自动检测。
|
|
1293
1315
|
* 用于测试或强制使用特定后端。
|
|
@@ -1321,5 +1343,24 @@ declare function createPlatformSandbox(options?: PlatformSandboxOptions): Sandbo
|
|
|
1321
1343
|
*/
|
|
1322
1344
|
declare function isPlatformSandboxAvailable(): boolean;
|
|
1323
1345
|
//#endregion
|
|
1324
|
-
|
|
1346
|
+
//#region src/shell/sandbox/select.d.ts
|
|
1347
|
+
/**
|
|
1348
|
+
* RFC-455 D3:按**会话只读性**选沙箱策略(纯函数——可单测/可突变)。
|
|
1349
|
+
*
|
|
1350
|
+
* 规则(fail-closed,只读档不得被绕过):
|
|
1351
|
+
* - 只读会话 ⇒ **一律**走只读档(`readOnly`);**永不 bypass**——RFC-380 的「获批即跳过
|
|
1352
|
+
* 沙箱」沿用到只读会话等于开后门,故此处不参 bypass 判定。
|
|
1353
|
+
* 只读档缺席(例如用户会话中途关闭了 sandbox,两侧策略同时置空)⇒ 退回 undefined
|
|
1354
|
+
* (与其它会话同语义:无沙箱),此窗口为已记录的已知边界,靠"三闸在会话创建期评估"
|
|
1355
|
+
* 收窄(见 RFC-455 §7)。
|
|
1356
|
+
* - 非只读会话 ⇒ 维持既有语义:bypass 命中 ⇒ 无沙箱;否则用当前策略。
|
|
1357
|
+
*/
|
|
1358
|
+
declare function selectSandboxStrategy(input: {
|
|
1359
|
+
readOnlySession: boolean;
|
|
1360
|
+
bypassed: boolean;
|
|
1361
|
+
normal: SandboxStrategy | null;
|
|
1362
|
+
readOnly: SandboxStrategy | null;
|
|
1363
|
+
}): SandboxStrategy | undefined;
|
|
1364
|
+
//#endregion
|
|
1365
|
+
export { type BackgroundProcessInfo, type BackgroundProcessPort, type BackgroundProcessRegisterInput, type BackgroundProcessStatus, BinaryToolExecutorRegistry, type BubblewrapOptions, type CaptureFileState, type DocumentSymbol, type ExecuteSkill, type ForkRunner, LSPClient, type LSPServerConfig, type LearnCallback, type LoadSkill, type Location, type LocationLink, type MacOsSeatbeltOptions, ORCHESTRATION_TOOL_NAMES, type PlatformSandboxOptions, type PrepareRenameResult, type ReadMemory, type RecordMemory, type RegisterBuiltinOptions, type RegisteredTool, type ResolvedServer, type RunTeam, type SandboxConfig, type SandboxProvider, type SandboxStrategy, type SandboxWrapInput, type SandboxWrapResult, type ServerLookupResult, type SessionGrill, type SessionManagerTool, type SymbolInfo, TOOL_NODES, type ToolMetadata, type ToolNode, type ToolNodeContext, type ToolRegistrationOptions, ToolRegistry, type WebSearchOptions, type WebSearchProvider, type WorkspaceEdit, buildDelegationAgentListDescription, createBinaryToolExecutorRegistry, createBubblewrapSandbox, createCaptureFileState, createEdit, createGrillMe, createLearn, createLspDefinition, createLspDiagnostics, createLspPrepareRename, createLspReferences, createLspRename, createLspSymbols, createMacOsSeatbeltSandbox, createNoopSandbox, createPlatformSandbox, createRead, createSessionManagerTool, createTaskControl, createTaskInspect, createToolRegistry, createToolSearch, createWebFetch, createWebSearch, createWrite, createWriteTodos, credentialDenyReadPaths, findWorkspaceRoot, isPlatformSandboxAvailable, lspManager, registerBuiltinTools, selectSandboxStrategy, withLspClient };
|
|
1325
1366
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/hitl/grill-me.ts","../src/binary/binary-executor.ts","../src/binary/binary-executor-registry.ts","../src/orchestration/delegate-job.ts","../src/memory/memory-archive.ts","../src/scheduling/create.ts","../src/scheduling/list.ts","../src/scheduling/delete.ts","../src/scheduling/run.ts","../src/scheduling/cancel.ts","../src/shell/execution-backend.ts","../src/shell/process.ts","../src/shell/sandbox/types.ts","../src/shell/background-types.ts","../src/orchestration/capture-file-state.ts","../src/orchestration/learn.ts","../src/web/search.ts","../src/orchestration/list-models.ts","../src/session/session-manager.ts","../src/skill/skill.ts","../src/memory/memory-record.ts","../src/memory/memory-read.ts","../src/orchestration/delegation-runners.ts","../src/register-builtin.ts","../src/types.ts","../src/tool-registry.ts","../src/tool-nodes.ts","../src/fs/read.ts","../src/fs/write.ts","../src/fs/edit.ts","../src/orchestration/write-todos.ts","../src/orchestration/agent-call-description.ts","../src/orchestration/task-inspect.ts","../src/orchestration/task-control.ts","../src/orchestration/tool-search.ts","../src/orchestration/constants.ts","../src/web/fetch.ts","../src/lsp/types.ts","../src/lsp/lsp-server-manager.ts","../src/lsp/lsp-client.ts","../src/lsp/lsp-wrapper.ts","../src/lsp/definition.ts","../src/lsp/references.ts","../src/lsp/symbols.ts","../src/lsp/diagnostics.ts","../src/lsp/rename.ts","../src/shell/sandbox/noop.ts","../src/shell/sandbox/macos-seatbelt.ts","../src/shell/sandbox/bubblewrap.ts","../src/shell/sandbox/platform.ts"],"mappings":";;;;;;;;KAIY,YAAA,IACV,SAAA,UACA,QAAA,EAAU,IAAA,CAAK,aAAA,YACZ,OAAA,CAAQ,WAAA;AAAA,cASP,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;KAWlB,WAAA,GAAc,CAAA,CAAE,KAAA,QAAa,iBAAA;AAAA,iBAElB,aAAA,CAAc,YAAA,UAAsB,KAAA,GAAQ,YAAA,GAAe,mBAAA,CAAoB,WAAA;;;UCC9E,0BAAA,SAAmC,wBAAA;;;;;EAKlD,SAAA;AAAA;AAAA,UAGe,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AA,GAAS,oBAAA;EAQrB,IAAA,CAAK,KAAA,EAAO,gBAAA,GAAmB,iBAAA;EAezB,OAAA,CAAA,GAAW,OAAA;;UAOT,YAAA;;;;;UAyDA,iBAAA;AAAA;AAAA,iBAYM,0BAAA,CAA2B,OAAA,GAAU,oBAAA,GAAuB,oBAAA;;;;;;UC9I3D,iBAAA;;;;AhDJjB;EgDSE,OAAA;;;;;;EAMA,aAAA;EhDZU;;;;;;EgDmBV,aAAA;AAAA;;AhDnBuB;;;;;;;;;;;;;;;;;cgDwCZ,iBAAA,YAA6B,eAAA;EAAA,SAC/B,IAAA;EAAA,iBAEQ,OAAA;cAEL,OAAA,GAAS,iBAAA;EAQrB,IAAA,CAAK,KAAA,EAAO,gBAAA,GAAmB,iBAAA;EAuEzB,OAAA,CAAA,GAAW,OAAA;AAAA;AAAA,iBASH,uBAAA,CAAwB,OAAA,GAAU,iBAAA,GAAoB,iBAAA;;;;;;UC7HrD,sBAAA;;EAEf,OAAA;;AjDbF;;;EiDkBE,aAAA;EjDhBU;;;;EiDqBV,aAAA;EjDtBA;;;;EiD2BA,KAAA;AAAA;;;AjDzBuB;;;iBiDiCT,uBAAA,CAAA;;;;;;;;;iBAmBA,qBAAA,CAAsB,OAAA,GAAS,sBAAA,GAA8B,eAAA;;;;;;;;;;;iBA8C7D,0BAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/hitl/grill-me.ts","../src/binary/binary-executor.ts","../src/binary/binary-executor-registry.ts","../src/orchestration/delegate-job.ts","../src/memory/memory-archive.ts","../src/scheduling/create.ts","../src/scheduling/list.ts","../src/scheduling/delete.ts","../src/scheduling/run.ts","../src/scheduling/cancel.ts","../src/shell/execution-backend.ts","../src/shell/process.ts","../src/shell/sandbox/types.ts","../src/shell/background-types.ts","../src/orchestration/capture-file-state.ts","../src/orchestration/learn.ts","../src/web/search.ts","../src/orchestration/list-models.ts","../src/session/session-manager.ts","../src/skill/skill.ts","../src/memory/memory-record.ts","../src/memory/memory-read.ts","../src/orchestration/delegation-runners.ts","../src/register-builtin.ts","../src/types.ts","../src/tool-registry.ts","../src/tool-nodes.ts","../src/fs/read.ts","../src/fs/write.ts","../src/fs/edit.ts","../src/orchestration/write-todos.ts","../src/orchestration/agent-call-description.ts","../src/orchestration/task-inspect.ts","../src/orchestration/task-control.ts","../src/orchestration/tool-search.ts","../src/orchestration/constants.ts","../src/web/fetch.ts","../src/lsp/types.ts","../src/lsp/lsp-server-manager.ts","../src/lsp/lsp-client.ts","../src/lsp/lsp-wrapper.ts","../src/lsp/definition.ts","../src/lsp/references.ts","../src/lsp/symbols.ts","../src/lsp/diagnostics.ts","../src/lsp/rename.ts","../src/shell/sandbox/noop.ts","../src/shell/sandbox/macos-seatbelt.ts","../src/shell/sandbox/bubblewrap.ts","../src/shell/sandbox/platform.ts","../src/shell/sandbox/select.ts"],"mappings":";;;;;;;;KAIY,YAAA,IACV,SAAA,UACA,QAAA,EAAU,IAAA,CAAK,aAAA,YACZ,OAAA,CAAQ,WAAA;AAAA,cASP,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;KAWlB,WAAA,GAAc,CAAA,CAAE,KAAA,QAAa,iBAAA;AAAA,iBAElB,aAAA,CAAc,YAAA,UAAsB,KAAA,GAAQ,YAAA,GAAe,mBAAA,CAAoB,WAAA;;;UCC9E,0BAAA,SAAmC,wBAAA;;;;;EAKlD,SAAA;AAAA;AAAA,UAGe,yBAAA;EACf,MAAA;EACA,MAAA;EACA,QAAA;EDlCW;ECoCX,SAAA;AAAA;AAAA,UAGe,UAAA;EACf,IAAA;EACA,OAAA;EACA,OAAA,CAAQ,IAAA,YAAgB,OAAA,GAAU,0BAAA,GAA6B,OAAA,CAAQ,yBAAA;AAAA;;;cCzC5D,0BAAA;EAAA,QACH,QAAA;EAER,GAAA,CAAI,IAAA;EAIJ,GAAA,CAAI,IAAA,WAAe,UAAA;EAInB,QAAA,CAAS,IAAA,EAAM,UAAA;EAQf,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mBV,aAAA;EhDnBsB;;AAAC;;;EgDyBvB,QAAA;AAAA;;;;;;;;;;;;;;;;;;;cAqBW,iBAAA,YAA6B,eAAA;EAAA,SAC/B,IAAA;EAAA,iBAEQ,OAAA;cAEL,OAAA,GAAS,iBAAA;EASrB,IAAA,CAAK,KAAA,EAAO,gBAAA,GAAmB,iBAAA;EA2EzB,OAAA,CAAA,GAAW,OAAA;AAAA;AAAA,iBASH,uBAAA,CAAwB,OAAA,GAAU,iBAAA,GAAoB,iBAAA;;;;;;UCxIrD,sBAAA;;EAEf,OAAA;;AjDbF;;;EiDkBE,aAAA;EjDhBU;;;;EiDqBV,aAAA;EjDtBA;;;;;EiD4BA,QAAA;EjD1BsB;;AAAC;;EiD+BvB,KAAA;AAAA;;;;;;iBAQc,uBAAA,CAAA;;;;;;;;;iBAmBA,qBAAA,CAAsB,OAAA,GAAS,sBAAA,GAA8B,eAAA;;;;;;;;;;;iBAiD7D,0BAAA,CAAA;;;;;;;;;;AjD9GhB;;;;iBkDSgB,qBAAA,CAAsB,KAAA;EACpC,eAAA;EACA,QAAA;EACA,MAAA,EAAQ,eAAA;EACR,QAAA,EAAU,eAAA;AAAA,IACR,eAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import{z as e}from"zod";import{API_IMAGE_DIMENSION_LIMIT_PX as t,PROVIDER_IMAGE_INLINE_MAX_BYTES as n,acquireFileLock as r,buildAllowedEnv as i,createLogger as a,createProjectOverflowLogPath as o,createTempLoggerPath as s,exists as c,formatBytes as l,getHomeDir as u,getThirdPartyToolBinaryDir as d,getThirdPartyToolDir as f,invariant as p,isDirectory as m,isFile as h,mime as g,mkdirp as _,normalizePath as v,parseJsonc as y,probeImageDimensions as ee,releaseFileLock as b,sweepStaleProjectOverflowLogs as te,sweepStaleTempLogs as ne,toTruncationMeta as x,truncateHead as S,truncateLine as C,truncateTail as w}from"@x-otto/shared";import T from"os";import E,{homedir as re,tmpdir as ie}from"node:os";import{appendFileSync as ae,chmodSync as oe,closeSync as se,copyFileSync as ce,createReadStream as le,createWriteStream as ue,existsSync as D,mkdirSync as O,openSync as de,readFileSync as fe,readdirSync as pe,realpathSync as me,rmSync as he,statSync as ge,writeFileSync as _e}from"node:fs";import{glob as ve,readFile as k,rename as ye,stat as be,unlink as xe,writeFile as A}from"node:fs/promises";import{createHash as Se,randomUUID as Ce}from"node:crypto";import{dirname as j,extname as we,isAbsolute as Te,join as M,relative as N,resolve as P,sep as Ee}from"node:path";import{Readable as De}from"node:stream";import{pipeline as Oe}from"node:stream/promises";import{setTimeout as ke}from"node:timers/promises";import{spawn as F}from"node:child_process";import{OTTO_PROJECT_DIR as Ae,OTTO_USER_AGENT as je,SETTING_OFFLINE_MODE_ENABLED as Me,normalizeEnv as I}from"@x-otto/env";import{createInterface as Ne}from"node:readline";import{Worker as Pe}from"node:worker_threads";import{diffLines as Fe}from"diff";import{WORKFLOW_SLOTS as Ie}from"@x-otto/ai";import{checkDelegationDepth as Le,createTodoStore as Re,resolveTodoSyncTargets as ze}from"@x-otto/orchestration-contracts";import{fileURLToPath as Be,pathToFileURL as L}from"node:url";const Ve=e.object({label:e.string(),rationale:e.string().describe(`选这项的含义/利弊(plain language)`),recommended:e.boolean().optional(),preview:e.string().optional().describe(`两段具体产物并排对比`)}),He=e.object({header:e.string().max(24).describe(`短主题标签(≤24 字),便于 UI/日志`),question:e.string().describe(`一个清晰具体的关键问题`),background:e.string().describe(`详细背景与前因后果(grill 纪律:必填)`),recommendation:e.string().describe(`推荐答案 + 理由(必填);无真人应答时被自动采纳`),options:e.array(Ve).optional(),allowFreeform:e.boolean().optional().default(!0),multiSelect:e.boolean().optional().default(!1),evidence:e.array(e.string()).optional().describe(`引用的本地证据/社区方案`)});function Ue(e,t){return{name:`grill_me`,description:`Background and recommendation are required fields; advisory only — side effects still pass permission/approval. Otherwise decide yourself.`,parameters:He,readonly:!1,async execute({params:e,agentName:n,sessionId:r}){if(!t||!r)return{content:[{type:`text`,text:`grill_me is not available in this context. If you need clarification, return your open question in your result so the lead/main agent can ask the human.`}],isError:!0,errorKind:`runtime`};let i=await t(r,{header:e.header,question:e.question,background:e.background,recommendation:e.recommendation,options:e.options,allowFreeform:e.allowFreeform,multiSelect:e.multiSelect,evidence:e.evidence,askedBy:n??`agent`});return{content:[{type:`text`,text:`${i.resolvedBy===`auto_recommendation`?`(无真人应答,已采纳推荐)`:``}${i.answer}`}],details:{resolvedBy:i.resolvedBy,acceptedRecommendation:i.acceptedRecommendation,selectedOptionLabels:i.selectedOptionLabels,freeformText:i.freeformText}}}}}const R=I(process.env.TOOLS_MAX_OUTPUT_LINES,2e3),z=I(process.env.TOOLS_MAX_OUTPUT_BYTES,60*1024),B=I(process.env.TOOLS_EXECUTE_TIMEOUT_MS,3e4),We=I(process.env.TOOLS_BINARY_DOWNLOAD_TIMEOUT_MS,12e5),Ge=I(process.env.TOOLS_MAX_WRITE_BYTES,10*1024*1024),V=I(process.env.TOOLS_MAX_FETCH_BYTES,5*1024*1024),Ke=I(process.env.TOOLS_BINARY_PROBE_TIMEOUT_MS,5e3);function H(e,t){return Object.assign(Error(e),{errorKind:t})}const qe=a(`@x-otto/tools:binary`),Je=256*1024;async function Ye(e,t=[`--version`]){try{return(await Xe(e,t,{timeout:Ke})).status===0}catch{return!1}}function Xe(e,t,n){return new Promise((r,i)=>{let a=F(e,t,{stdio:[`ignore`,`ignore`,`pipe`]}),o=``;a.stderr?.on(`data`,e=>{o+=e.toString()}),n?.timeout&&setTimeout(()=>{a.kill(),i(Error(`timeout`))},n.timeout),a.on(`close`,e=>r({status:e,stderr:o})),a.on(`error`,i)})}async function Ze(e,t=e){let n=E.platform()===`win32`?`.exe`:``,r=d(t,e)+n;try{if(D(r))return r}catch{qe.debug(`Error checking existence of ${r}, will try PATH lookup: %s`,r)}return await Ye(e)?e:null}const Qe=`tool-download`;async function $e(e,t,n){if(!t){qe.warn(`No checksum configured for %s — integrity not verified`,n);return}let r=Se(`sha256`);r.update(await k(e));let i=r.digest(`hex`);if(i.toLowerCase()!==t.toLowerCase())throw H(`Checksum mismatch for ${n}: expected ${t}, got ${i}`,`validation`)}async function et(e,t,n){let r=async(t,n)=>{try{let{status:e,stderr:r}=await Xe(t,n);if(e!==0)throw Error(r?.trim()||`exit code ${e}`)}catch(t){throw H(`Failed to extract ${e}: ${t instanceof Error?t.message:String(t)}`,`io`)}};if(e.endsWith(`.tar.gz`)||e.endsWith(`.tgz`)){await r(`tar`,[`xzf`,t,`-C`,n]);return}if(e.endsWith(`.zip`)){E.platform()===`win32`?await r(`powershell`,[`-NoProfile`,`-Command`,`Expand-Archive -LiteralPath '${t}' -DestinationPath '${n}' -Force`]):await r(`unzip`,[`-o`,`-q`,t,`-d`,n]);return}throw H(`Unsupported archive format: ${e}`,`validation`)}async function tt(e,t,n){let i=Date.now()+We,a={prefix:Qe,timeoutMs:3e5};for(;;){if(await r(e,t,a))return!0;if(D(n)||Date.now()>i)return!1;await ke(200)}}async function nt(e){let{name:t,cacheDir:n,url:r,checksum:i}=e,a=E.platform(),o=f(),s=t+(a===`win32`?`.exe`:``),c=P(o,n),l=P(c,s),u=Ce(),d=P(o,`${n}-${u}.download`),p=P(o,`${n}-extract-${u}`);if(O(o,{recursive:!0}),await tt(o,n,l))try{if(D(l))return;let e=await fetch(r,{headers:{"User-Agent":je},signal:AbortSignal.timeout(We)});if(!e.ok||!e.body)throw H(`Failed to download: ${e.status}`,`network`);let t=ue(d);await Oe(De.fromWeb(e.body),t),await $e(d,i,r),O(c,{recursive:!0}),O(p,{recursive:!0}),await et(r,d,p);let n=rt(p,s);if(!n)throw H(`Binary ${s} not found in archive`,`not_found`);ce(n,l),a!==`win32`&&oe(l,493)}catch(e){return qe.warn(e),e instanceof Error?e:Error(String(e))}finally{he(d,{force:!0}),he(p,{recursive:!0,force:!0}),await b(o,n,{prefix:Qe})}}function rt(e,t){let n=[e];for(;n.length>0;){let e=n.pop(),r;try{r=pe(e,{encoding:`utf-8`})}catch{continue}for(let i of r){let r=M(e,i);try{let e=ge(r);if(e.isDirectory())n.push(r);else if(e.isFile()&&i===t)return r}catch{continue}}}}var U=class{get cacheDir(){return`${this.name}-${this.version}`}projectRoot;downloadTask=null;lastDownloadError;processTracker;constructor(e,t){this.projectRoot=e,this.processTracker=t}resolveChecksum(){}async ensure(){let e=await Ze(this.name,this.cacheDir);if(e)return e;if(Me)throw H(`${this.name} not found and offline mode is enabled`,`not_found`);this.downloadTask||=this.download().finally(()=>{this.downloadTask=null}),await this.downloadTask;let t=await Ze(this.name,this.cacheDir);if(!t){let e=this.lastDownloadError,t=H(`${this.name}: download failed${e?` — ${e.message}`:` (binary not found)`}`,`not_found`);throw e&&(t.cause=e),t}return t}async download(){let e=this.resolveUrl();p(e,`No download URL for ${this.name}`),this.lastDownloadError=await nt({name:this.name,cacheDir:this.cacheDir,url:e,checksum:this.resolveChecksum()})}async execute(e,t){let n=await this.ensure(),r=t?.maxBuffer;return new Promise((i,a)=>{let o=F(n,e,{cwd:t?.cwd,env:t?.env,timeout:t?.timeout,signal:t?.signal});this.processTracker?.registerChild({command:n,args:e,owner:{type:`agent-tool`,id:`binary`},category:`tool`,lifecycle:`evictable`,cwd:typeof t?.cwd==`string`?t.cwd:void 0},o);let s=[],c=[],l=0,u=0,d=!1,f,p=()=>{try{o.kill(`SIGTERM`)}catch{}f=setTimeout(()=>{try{o.kill(`SIGKILL`)}catch{}},2e3),f.unref?.()};o.stdout.on(`data`,e=>{if(!d){if(r!==void 0&&l+e.byteLength>r){let t=r-l;t>0&&(s.push(e.subarray(0,t)),l=r),d=!0,p();return}s.push(e),l+=e.byteLength}}),o.stderr.on(`data`,e=>{if(u>=Je)return;let t=Je-u;e.byteLength>t?(c.push(e.subarray(0,t)),u=Je):(c.push(e),u+=e.byteLength)}),o.on(`error`,e=>{f&&clearTimeout(f),a(e)}),o.on(`close`,e=>{if(f&&clearTimeout(f),!d&&e!==0)return a(Error(`Process exited with code ${e}: ${Buffer.concat(c).toString()}`));i({stdout:Buffer.concat(s).toString(),stderr:Buffer.concat(c).toString(),exitCode:d?0:e,truncated:d})})})}};function it(e,t,n){return`https://github.com/${e}/releases/download/v${t}/${n}`}const at={"fd-v10.4.2-aarch64-apple-darwin.tar.gz":`623dc0afc81b92e4d4606b380d7bc91916ba7b97814263e554d50923a39e480a`,"fd-v10.4.2-aarch64-unknown-linux-gnu.tar.gz":`6c51f7c5446b3338b1e401ff15dc194c590bb2fa64fd43ff3278300f073adec5`,"fd-v10.4.2-x86_64-unknown-linux-gnu.tar.gz":`def59805cd14b5651b68990855f426ad087f3b96881296d963910431ba3143c8`,"fd-v10.4.2-aarch64-pc-windows-msvc.zip":`4f9110c2d5b33a7f760bfa5510f4c113d828109f7277d421b1053a9943c0fc92`,"fd-v10.4.2-x86_64-pc-windows-msvc.zip":`b2816e506390a89941c63c9187d58a3cc10e9a55f2ef0685f9ea0eccaf7c98c8`},W=`10.4.2`,ot={"darwin/arm64":`fd-v${W}-aarch64-apple-darwin.tar.gz`,"darwin/x64":`fd-v${W}-x86_64-apple-darwin.tar.gz`,"linux/arm64":`fd-v${W}-aarch64-unknown-linux-gnu.tar.gz`,"linux/x64":`fd-v${W}-x86_64-unknown-linux-gnu.tar.gz`,"win32/arm64":`fd-v${W}-aarch64-pc-windows-msvc.zip`,"win32/x64":`fd-v${W}-x86_64-pc-windows-msvc.zip`};var st=class extends U{name=`fd`;version=W;repository=`sharkdp/fd`;constructor(e,t){super(e,t)}resolveAsset(){let e=`${T.platform()}/${T.arch()}`,t=ot[e];if(!t)throw Error(`Unsupported platform/architecture: ${e}`);return t}resolveUrl(){return it(this.repository,this.version,this.resolveAsset())}resolveChecksum(){return at[this.resolveAsset()]}};const ct=(e,t)=>new st(e,t);function lt(e,t,n){return`https://github.com/${e}/releases/download/${t}/${n}`}const ut={"ripgrep-15.1.0-aarch64-apple-darwin.tar.gz":`378e973289176ca0c6054054ee7f631a065874a352bf43f0fa60ef079b6ba715`,"ripgrep-15.1.0-x86_64-apple-darwin.tar.gz":`64811cb24e77cac3057d6c40b63ac9becf9082eedd54ca411b475b755d334882`,"ripgrep-15.1.0-aarch64-unknown-linux-gnu.tar.gz":`2b661c6ef508e902f388e9098d9c4c5aca72c87b55922d94abdba830b4dc885e`,"ripgrep-15.1.0-x86_64-unknown-linux-musl.tar.gz":`1c9297be4a084eea7ecaedf93eb03d058d6faae29bbc57ecdaf5063921491599`,"ripgrep-15.1.0-aarch64-pc-windows-msvc.zip":`00d931fb5237c9696ca49308818edb76d8eb6fc132761cb2a1bd616b2df02f8e`,"ripgrep-15.1.0-x86_64-pc-windows-msvc.zip":`124510b94b6baa3380d051fdf4650eaa80a302c876d611e9dba0b2e18d87493a`};var dt=class extends U{name=`rg`;repository=`BurntSushi/ripgrep`;version=`15.1.0`;constructor(e,t){super(e,t)}resolveAsset(){let e=T.platform(),t=T.arch();switch(e){case`darwin`:return t===`arm64`?`ripgrep-${this.version}-aarch64-apple-darwin.tar.gz`:`ripgrep-${this.version}-x86_64-apple-darwin.tar.gz`;case`linux`:return t===`arm64`?`ripgrep-${this.version}-aarch64-unknown-linux-gnu.tar.gz`:`ripgrep-${this.version}-x86_64-unknown-linux-musl.tar.gz`;case`win32`:return t===`arm64`?`ripgrep-${this.version}-aarch64-pc-windows-msvc.zip`:`ripgrep-${this.version}-x86_64-pc-windows-msvc.zip`}throw Error(`Unsupported platform/architecture: ${e}/${t}`)}resolveUrl(){return lt(this.repository,this.version,this.resolveAsset())}resolveChecksum(){return ut[this.resolveAsset()]}};const ft=(e,t)=>new dt(e,t),pt=a(`@x-otto/tools:binary-executor-registry`);var mt=class{binaries=new Map;has(e){return this.binaries.has(e)}get(e){return this.binaries.get(e)}register(e){this.binaries.has(e.name)?pt.warn(`Tool ${e.name} is already registered, skipping`):this.binaries.set(e.name,e)}unregister(e){this.binaries.has(e)?this.binaries.delete(e):pt.warn(`Tool ${e} is not registered, skipping`)}async ensureAll(){for(let e of this.binaries.values())e instanceof U&&await e.ensure()}async ensure(e){let t=this.binaries.get(e);if(!t)throw Error(`Tool ${e} not found in registry`);return t instanceof U&&await t.ensure(),t}dispose(){this.binaries.clear()}};const ht=(e,t)=>{let n=new mt;return n.register(ct(e,t)),n.register(ft(e,t)),n};function gt(e){return typeof e==`function`?e():e}const _t=()=>({chunks:Buffer.alloc(0),stdout:Buffer.alloc(0),stderr:Buffer.alloc(0),exitCode:-1,timedOut:!1}),vt=(e,t)=>{try{process.kill(-e,t)}catch{try{process.kill(e,t)}catch{}}},yt=new class{name=`local`;execute(e,t,n,r){let{cwd:a,env:o,timeout:s,signal:c}=n;return new Promise((n,l)=>{if(c?.aborted){l(Error(`Process execution aborted before start`));return}let u=_t(),d=[],f=[],p=[],m,h=()=>{let e=y.pid;if(e!==void 0){if(process.platform===`win32`){F(`taskkill`,[`/F`,`/T`,`/PID`,`${e}`],{stdio:`ignore`,detached:!0});return}vt(e,`SIGTERM`),m=setTimeout(()=>vt(e,`SIGKILL`),2e3)}},g=setTimeout(()=>{u.timedOut=!0,h()},s),_=()=>h();c?.addEventListener(`abort`,_,{once:!0});let v=()=>{clearTimeout(g),m&&clearTimeout(m),c?.removeEventListener(`abort`,_)},y=F(e,t,{cwd:a,env:i(o),stdio:[`ignore`,`pipe`,`pipe`],detached:process.platform!==`win32`});y.stdout?.on(`data`,e=>{d.push(e),p.push(e),r?.(e,`stdout`)}),y.stderr?.on(`data`,e=>{f.push(e),p.push(e),r?.(e,`stderr`)}),y.on(`error`,e=>{v(),l(e)}),y.on(`close`,e=>{u.exitCode=e??-1,u.stdout=Buffer.concat(d),u.stderr=Buffer.concat(f),u.chunks=Buffer.concat(p),v(),u.timedOut?l(Error(`Process timed out after ${s}ms`)):n(u)})})}};function bt(e,t,n){let r=e,a=t,o=n.cwd,s=n.env;if(n.sandbox){let e=n.projectRoot??o,t=n.sandbox.wrap({command:r,args:a,options:{timeout:0,cwd:o,env:s,projectRoot:e},projectRoot:e});r=t.command,a=t.args,o=t.options.cwd??o,s=t.options.env}let c=n.onOutputChunk!==void 0,l,u;if(c){u=de(n.logPath,`a`),l=F(r,a,{cwd:o,env:i(s),stdio:[`ignore`,`pipe`,`pipe`],detached:process.platform!==`win32`});let e=(e,t)=>{if(u!==void 0)try{ae(u,e)}catch{}n.onOutputChunk?.(e,t)};l.stdout?.on(`data`,t=>e(t,`stdout`)),l.stderr?.on(`data`,t=>e(t,`stderr`)),l.once(`exit`,()=>{if(u!==void 0){try{se(u)}catch{}u=void 0}}),l.stdout?.unref?.(),l.stderr?.unref?.()}else{let e=de(n.logPath,`a`);try{l=F(r,a,{cwd:o,env:i(s),stdio:[`ignore`,e,e],detached:process.platform!==`win32`})}finally{se(e)}}l.once(`error`,e=>{try{ae(n.logPath,`\n[otto] background spawn error: ${e.message}\n`)}catch{}}),l.unref();let d=l.pid;if(d===void 0)throw Error(`Failed to spawn background process (no pid)`);return{child:l,pid:d}}function xt(e,t,n){let r=n.sandbox;if(r){let i=n.projectRoot??n.cwd??process.cwd(),a=r.wrap({command:e,args:t,options:n,projectRoot:i});e=a.command,t=a.args,n=a.options}let{cwd:i,env:a,timeout:o,signal:s,onProgress:c}=n;return(gt(n.backend)??yt).execute(e,t,{cwd:i,env:a,timeout:o,signal:s},c)}const St=new Set([2,126,127]),Ct={seatbelt:{fatal:[/operation not permitted/i,/permission denied/i,/deny file-write/i,/sandbox.*denied/i,/not allowed by sandbox/i],benign:[]},bubblewrap:{fatal:[/bwrap.*(?:denied|refused|not permitted)/i,/operation not permitted/i,/read-only file system/i,/no such file or directory: \/proc/i],benign:[/^bwrap: warning/i,/^bwrap: creating new namespace/i]},"windows-acl":{fatal:[/access is denied/i,/eacces/i,/erofs/i,/file.*denied/i],benign:[]},unknown:{fatal:[/permission denied/i,/eacces/i,/eperm/i,/erofs/i,/read-only file system/i,/seccomp/i,/landlock/i,/operation not permitted/i],benign:[]}};function wt(e,t,n=`unknown`){if(e===159)return{denied:!0,reason:`exit code 159 (128+SIGSYS, seccomp violation)`,backend:n};if(e!==null&&e!==2&&St.has(e))return{denied:!1,backend:n};let r=Tt(t,Ct[n].benign),i=Et(r,Ct[n].fatal);if(i)return{denied:!0,reason:`${n} dialect: ${i}`,backend:n};let a=Et(r,Ct.unknown.fatal);return a?{denied:!0,reason:`generic signature: ${a}`,backend:`unknown`}:{denied:!1,backend:n}}function Tt(e,t){return t.length===0?e:e.split(`
|
|
2
2
|
`).filter(e=>!t.some(t=>t.test(e))).join(`
|
|
3
|
-
`)}function Et(e,t){for(let n of t){let t=n.exec(e);if(t)return t[0]}}const Dt=/\b(https?|wss?):\/\/([-\w.]+)(?::(\d{2,5}))?(\/[^\s)\],."']*)?/i,Ot=/\b(?:listening on\s+(?:port\s+)?|(?:running\s+)?at\s+:|on\s+:|port[:\s]+)(\d{2,5})\b/i;function kt(e){return/^wss?$/i.test(e)?`ws`:`http`}function At(e){let t=e.match(Dt);if(t){let[e,n,,r]=t,i=r?Number(r):void 0;return{url:e,port:i!==void 0&&i>0&&i<=65535?i:void 0,protocol:kt(n)}}let n=e.match(Ot);if(n){let e=Number(n[1]);if(e>0&&e<=65535)return{port:e,protocol:`tcp`}}return null}const jt=e.object({command:e.string().describe(`Shell command to execute`),targetDir:e.string().optional().describe(`Working directory (relative to project root)`),timeout:e.number().int().min(1e3).optional().describe(`Timeout (ms), default 30000`),run_in_background:e.boolean().optional().describe(`Run as a long-lived background process (dev servers, watchers). Returns immediately with a background id.`)}),Mt=a(`@x-otto/tools:bash`);function Nt(e,t,n,r,i,a){return{name:`bash`,description:`Execute a shell command and return stdout/stderr. Default timeout is 30 seconds; set reasonable timeouts for long-running commands rather than waiting indefinitely. Avoid commands requiring interactive input. Prefer non-interactive flags (e.g. git --no-pager, --non-interactive).`,parameters:jt,regenerableOutput:!0,async execute({params:o,signal:s,id:c,sessionId:l}){let u=P(e,o.targetDir??`.`),d=o.timeout??B,f=typeof n==`function`?n({command:o.command}):n,p=gt(i);return o.run_in_background?!r||!l?{content:[{type:`text`,text:`Background execution is unavailable in this context (no process registry / session). Re-run without run_in_background, or run a short-lived foreground command.`}],isError:!0,errorKind:`runtime`}:It(o.command,u,e,f,r,l,c,a?.()):await Bt(o.command,u,e,d,t,s,f,p,a?.())}}}function Pt(e){let t=e.match(/(?:--port[ =]|-p\s+|localhost:|0\.0\.0\.0:|127\.0\.0\.1:|http\.server\s+)(\d{2,5})\b/i);if(t){let e=Number(t[1]);if(e>0&&e<=65535)return e}}function Ft(e){let t=``;return n=>{t+=n.toString(`utf-8`);let r;for(;(r=t.indexOf(`
|
|
3
|
+
`)}function Et(e,t){for(let n of t){let t=n.exec(e);if(t)return t[0]}}const Dt=/\b(https?|wss?):\/\/([-\w.]+)(?::(\d{2,5}))?(\/[^\s)\],."']*)?/i,Ot=/\b(?:listening on\s+(?:port\s+)?|(?:running\s+)?at\s+:|on\s+:|port[:\s]+)(\d{2,5})\b/i;function kt(e){return/^wss?$/i.test(e)?`ws`:`http`}function At(e){let t=e.match(Dt);if(t){let[e,n,,r]=t,i=r?Number(r):void 0;return{url:e,port:i!==void 0&&i>0&&i<=65535?i:void 0,protocol:kt(n)}}let n=e.match(Ot);if(n){let e=Number(n[1]);if(e>0&&e<=65535)return{port:e,protocol:`tcp`}}return null}const jt=e.object({command:e.string().describe(`Shell command to execute`),targetDir:e.string().optional().describe(`Working directory (relative to project root)`),timeout:e.number().int().min(1e3).optional().describe(`Timeout (ms), default 30000`),run_in_background:e.boolean().optional().describe(`Run as a long-lived background process (dev servers, watchers). Returns immediately with a background id.`)}),Mt=a(`@x-otto/tools:bash`);function Nt(e,t,n,r,i,a){return{name:`bash`,description:`Execute a shell command and return stdout/stderr. Default timeout is 30 seconds; set reasonable timeouts for long-running commands rather than waiting indefinitely. Avoid commands requiring interactive input. Prefer non-interactive flags (e.g. git --no-pager, --non-interactive).`,parameters:jt,regenerableOutput:!0,async execute({params:o,signal:s,id:c,sessionId:l}){let u=P(e,o.targetDir??`.`),d=o.timeout??B,f=typeof n==`function`?n({command:o.command,sessionId:l}):n,p=gt(i);return o.run_in_background?!r||!l?{content:[{type:`text`,text:`Background execution is unavailable in this context (no process registry / session). Re-run without run_in_background, or run a short-lived foreground command.`}],isError:!0,errorKind:`runtime`}:It(o.command,u,e,f,r,l,c,a?.()):await Bt(o.command,u,e,d,t,s,f,p,a?.())}}}function Pt(e){let t=e.match(/(?:--port[ =]|-p\s+|localhost:|0\.0\.0\.0:|127\.0\.0\.1:|http\.server\s+)(\d{2,5})\b/i);if(t){let e=Number(t[1]);if(e>0&&e<=65535)return e}}function Ft(e){let t=``;return n=>{t+=n.toString(`utf-8`);let r;for(;(r=t.indexOf(`
|
|
4
4
|
`))!==-1;){let n=t.slice(0,r);t=t.slice(r+1);let i=At(n);i&&e(i)}}}function It(e,t,n,r,i,a,o,c){let l=`bg_${a}_${o}`,u=s();ne(Lt,Date.now());try{let o=Ft(e=>{i.updateDetectedService(l,e)}),{child:s,pid:d}=bt(`sh`,[`-c`,e],{cwd:t,projectRoot:n,sandbox:r,env:c,logPath:u,onOutputChunk:e=>o(e)}),f=Pt(e);try{i.register({id:l,sessionId:a,child:s,command:e,cwd:t,logPath:u,port:f})}catch(e){try{process.kill(-d,`SIGKILL`)}catch{try{s.kill(`SIGKILL`)}catch{}}throw e}return{content:[{type:`text`,text:`Started in background.\nid: ${l}\npid: ${d}\nlog: ${u}${f?`\nlikely port: ${f}`:``}\n\nRead output with bash_output(background_id="${l}"); stop it with kill_shell(background_id="${l}"). It is auto-killed when the session ends.`}],details:{backgroundProcessId:l,pid:d,logPath:u,port:f}}}catch(e){let t=e instanceof Error?e.message:String(e);return Mt.warn({err:t},`Failed to start background process`),{content:[{type:`text`,text:`Failed to start background process: ${t}`}],isError:!0,errorKind:`runtime`}}}const Lt=60*6e4;function Rt(e){return e?e.includes(`seatbelt`)?`seatbelt`:e.includes(`bubblewrap`)||e.includes(`bwrap`)?`bubblewrap`:`unknown`:`unknown`}function zt(e){let t=e.trim();return t?(t.length>2048?`${t.slice(0,2048)}…`:t).split(`
|
|
5
5
|
`).slice(0,8).join(`
|
|
6
6
|
`):``}async function Bt(e,t,n,r,i,a,c,u,d){let f=z*2,p=[],m=0,h=0,g=0,_=0,v,y,ee=()=>{if(!i)return;let e=w(Buffer.concat(p).toString(`utf-8`),{maxLines:R,maxBytes:z});i({content:[{type:`text`,text:e.content||``}],details:{truncation:x(e),outputPath:v}})},b=await xt(`sh`,[`-c`,e],{timeout:r,signal:a,cwd:t,sandbox:c,projectRoot:n,backend:u,env:d,onProgress:e=>{if(p.push(e),m+=e.byteLength,h+=e.byteLength,m>z&&!v){ne(Lt,Date.now()),te(6048e5,Date.now());let e=o();try{O(j(e),{recursive:!0})}catch{e=s()}v=e,y=ue(e),y.on(`error`,e=>{Mt.warn({err:e.message},`bash overflow log write failed; disabling overflow log`),y=void 0,v=void 0});for(let e of p)y.write(e)}else y&&y.write(e);for(;h>f&&p.length>1;){let e=p.shift();e&&(h-=e.byteLength)}g+=e.byteLength;let t=Date.now();g>=4096&&t-_>=100&&(g=0,_=t,ee())}});y?.end();let S=Buffer.concat(p).toString(`utf-8`),C=w(S,{maxLines:R,maxBytes:z}),T=C.content||`(no output)`,E={truncation:x(C),outputPath:v};if(C.truncated){let e=C.totalLines-C.outputLines+1,t=C.totalLines,n=v?` Full output: ${v}`:``;if(C.lastLinePartial){let e=l(Buffer.byteLength(S.split(`
|
|
@@ -83,8 +83,8 @@ import{z as e}from"zod";import{API_IMAGE_DIMENSION_LIMIT_PX as t,PROVIDER_IMAGE_
|
|
|
83
83
|
`).trim();return n||(i+=`
|
|
84
84
|
|
|
85
85
|
(Note: results were scraped from search HTML and may be incomplete or out of date. Set BRAVE_SEARCH_API_KEY to use the official Brave Search API for reliable results.)`),i}var or=class{id=`brave-api`;reliable=!0;constructor(e,t=fetch){this.apiKey=e,this.fetchImpl=t}async search(e,t,n){let r=new URLSearchParams({q:e,count:String(t)}),i=await this.fetchImpl(`https://api.search.brave.com/res/v1/web/search?${r}`,{headers:{"X-Subscription-Token":this.apiKey,Accept:`application/json`},signal:n??AbortSignal.timeout(B)});if(!i.ok)throw Error(`Brave Search API error: HTTP ${i.status}`);return((await i.json()).web?.results??[]).slice(0,t).map(e=>({title:e.title??``,url:e.url??``,snippet:e.description??``})).filter(e=>e.url)}},sr=class{id=`brave-html`;reliable=!1;constructor(e=fetch){this.fetchImpl=e}async search(e,t,n){let r=new URLSearchParams({q:e,source:`web`}),i=await this.fetchImpl(`https://search.brave.com/search?${r}`,{headers:{"User-Agent":`Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36`,Accept:`text/html,application/xhtml+xml`,"Accept-Language":`en-US,en;q=0.9`},redirect:`follow`,signal:n??AbortSignal.timeout(B)});if(!i.ok)throw Error(`Search request failed: HTTP ${i.status}`);return ir(await i.text(),t)}};function cr(e={},t=process.env){if(e.provider)return e.provider;let n=e.apiKey??t.BRAVE_SEARCH_API_KEY;return n?new or(n,e.fetchImpl):new sr(e.fetchImpl)}function lr(e,t={}){return{name:`web_search`,description:`Search the web and return results with titles, URLs, and snippets. Use this to discover relevant pages before fetching them with web_fetch.`,parameters:rr,readonly:!0,regenerableOutput:!0,async execute({params:e,signal:n}){let{query:r,limit:i=10}=e,a=cr(t),o;try{o=await a.search(r,i,n)}catch(e){return{content:[{type:`text`,text:e instanceof Error?e.message:`Search request failed`}],isError:!0,errorKind:`network`}}return{content:[{type:`text`,text:ar(r,o,a.reliable)}],details:{query:r,provider:a.id,reliable:a.reliable,resultCount:o.length,results:o}}}}}function K(e,t){return{content:[{type:`text`,text:`${e} not available: this capability is not configured in the host.${t?` ${t}`:``}`}],isError:!0,errorKind:`runtime`}}function ur(e){if(e.length===0)return``;let t=e.slice(0,8),n=e.length>8?`… and ${e.length-8} more — pass any name, fuzzy match applies.`:``;return[`Available agents:`,...t.map(e=>{let t=e.description.length>80?e.description.slice(0,77)+`…`:e.description,n=[];e.slot&&n.push(`slot=${e.slot}`),e.readOnly&&n.push(`read-only`);let r=n.length>0?` (${n.join(`, `)})`:``;return`- **${e.name}**: ${t}${r}`}),n,`Pass the agent name — fuzzy match applies for unknown names.`].filter(Boolean).join(`
|
|
86
|
-
`)}const dr=e.string().optional().describe(
|
|
87
|
-
`)}],details:{mode:e.mode,status:r,sessionId:e.sessionId,sessionMode:e.sessionMode,...o?{todoSync:o}:{}}}}return{content:[{type:`text`,text:`Task delegation failed: ${p.error}`}],isError:!0,errorKind:`runtime`}}}}const yr=e.object({prompt:e.string().describe(`Self-contained instruction for the background job. It runs in an isolated git worktree with full tools (incl. file edits + MCP), so include all needed context.`),title:e.string().optional().describe(`Short label for the job (shown in the /jobs panel). Defaults to a slice of the prompt.`)});function br(e){return{name:`delegate_job`,description:`Delegate a file-changing task to an isolated background job. Runs in a separate git worktree with full tools (edits + MCP), then produces a REVIEWABLE DIFF — it does NOT touch your working tree directly. Use for independent changes you want isolated and audited (e.g. a self-contained refactor) while you keep working. The diff is applied by the user via /job apply (autonomous apply is off by default). For read-only background analysis use task_delegate(background); for in-conversation edits use task_delegate(sync).`,parameters:yr,async execute({params:t,sessionId:n}){if(!e)return K(`delegate_job`);if(!n)return{isError:!0,errorKind:`validation`,content:[{type:`text`,text:`delegate_job requires a session context (no sessionId available).`}]};let r=t.title?.trim()||t.prompt.replace(/\s+/g,` `).slice(0,48),{jobId:i}=e({prompt:t.prompt,title:r,sessionId:n});return{content:[{type:`text`,text:`Delegated background job ${i} (isolated worktree). It will produce a reviewable diff; you'll get a notification when it's ready. The user applies it with /job apply ${i} (or reviews it in the /jobs panel). It does not modify the current working tree.`}],details:{jobId:i,origin:`main`}}}}}const xr=e.object({action:e.enum([`get`,`list`,`output`]).describe(`get task by ID, list all tasks, or get background task output`),taskId:e.string().optional().describe(`Task ID (required for get/output actions)`),statusFilter:e.enum([`all`,`pending`,`running`,`completed`,`failed`,`cancelled`]).optional().default(`all`).describe(`Filter by status (list action only)`)});function Sr(e,t){let{get:n,list:r,output:i}=t;return{name:`task_inspect`,description:`Inspect tasks: get details by ID, list with optional status filter, or get background task output.`,parameters:xr,readonly:!0,async execute({params:e}){switch(e.action){case`get`:{if(!n)return K(`task_inspect(get)`);if(!e.taskId)return{content:[{type:`text`,text:`taskId is required for get action`}],isError:!0,errorKind:`validation`};let t=await n(e.taskId);if(!t.ok)return{content:[{type:`text`,text:t.error}],isError:!0,errorKind:`runtime`};let r=t.value,i=r.status===`failed`||!!r.error;return{content:[{type:`text`,text:[`Task: ${r.id}`,`Status: ${r.status}`,r.prompt?`Prompt: ${r.prompt}`:void 0,`Output: ${r.output??`N/A`}`,r.error?`Error: ${r.error}`:void 0].filter(e=>!!e).join(`
|
|
86
|
+
`)}const dr=e.string().optional().describe("Optional child session ID; with sticky mode, later calls reuse the same child context. It is also the RESUME handle: when a sub-task fails with its tool budget exhausted, its task record shows `Resumable` + that sessionId — pass the id back with sessionMode=sticky and a prompt built on the partial output to continue the SAME child instead of restarting (read-only children included; the handle is bounded and expires)."),fr=e.enum([`ephemeral`,`sticky`]).optional().default(`ephemeral`).describe(`Child session lifecycle: ephemeral deletes after the task; sticky keeps for later reuse.`),pr=e.enum(Ie).optional().describe(`Model slot to use for this task`),mr=e.object({prompt:e.string().describe(`Task description to delegate (for mode=team, the input handed to the team)`),subagent:e.string().optional().describe(`Agent name to delegate to (e.g. "explore"). Used by sync/background.`),category:e.string().optional().describe(`Task category — drives auto model selection: "search"/"quick" → cheap/fast, "deep"/"critique"/"review" → powerful. Set on sync/background whenever fitting, even without a named subagent.`),team:e.string().optional().describe(`Declared team name (see .otto/teams/*.md). Required for mode=team.`),mode:e.enum([`sync`,`background`,`fork`,`team`]).optional().default(`sync`).describe(`Execution mode. 'sync' (default): sub-agent in shared workspace, returns inline — for tracked subtasks that edit files or whose output you need now. 'background': same but detached and READ-ONLY — the child has NO shell and no file-mutating tool (bash/edit/write are removed from it) and cannot delegate further, so use it only for work a reader could do (read, search, compare, summarize); anything that must run commands (tests, builds, git, log inspection) or change files belongs to 'sync'. 'fork': fresh isolated session that does NOT carry your conversation, your custom system prompt, or your session-level tool customization — it gets the default main-preset prompt and the default tool set (so put all needed context in its prompt) — best for summarization, batch checks, in-context Q&A. Every mode starts a NEW session seeded only with your prompt — none of them see this conversation.`),sessionId:dr,sessionMode:fr,slot:pr,model:e.string().optional().describe("Explicit model id by capability strength (overrides slot/category). Pick only models marked usable by list_models; others are rejected and fall back. Prefer unset + `category` so the host picks a usable model automatically."),taskIds:e.array(e.string()).optional().describe(`Parent write_todos task IDs this sub-agent is responsible for completing.`),tracked:e.boolean().optional().default(!0).describe(`Host governance: true (default) = full tracking (recorded, retryable, todo-sync). false = lightweight probe (no record/retry, ephemeral, synchronous) — for quick agent opinions/reviews; requires explicit subagent.`)}).refine(e=>{let t=e.mode??`sync`;return e.tracked===!1?t===`sync`&&e.subagent!==void 0&&e.category===void 0&&e.team===void 0&&e.sessionId===void 0&&e.sessionMode===void 0&&e.taskIds===void 0:t===`team`?e.team!==void 0:t===`fork`?!0:e.subagent!==void 0||e.category!==void 0},{message:`mode=sync/background requires subagent or category; mode=team requires team; mode=fork needs only prompt; tracked:false requires explicit subagent with mode=sync (no category/team/sessionId/sessionMode/taskIds)`});async function hr(e,t,n,r){if(!e)return;let i=ze(r,n);if(i.length!==0&&(await e({action:`update`,todos:r.map(e=>i.includes(e.id)?{...e,status:`done`}:e),sessionId:t})).ok)return`✓ auto-synced parent task list: ${i.join(`, `)} → done`}async function gr(e,t,n,r,i,a){if(!e)return K(`task_delegate (mode=fork)`);let{childDepth:o,exceeded:s}=Le(n,i);if(s)return{isError:!0,errorKind:`validation`,content:[{type:`text`,text:`fork rejected: delegation depth ${o} exceeds max ${i}`}]};let c=await e(t,o,r,a);return c.ok?{content:[{type:`text`,text:c.value||`(no output)`}]}:{content:[{type:`text`,text:`Fork failed: ${c.error}`}],isError:!0,errorKind:`runtime`}}async function _r(e,t,n,r,i,a,o){if(!e)return K(`task_delegate (mode=team)`,`Declare a team in .otto/teams/*.md.`);if(!t)return{content:[{type:`text`,text:`mode=team requires a team name`}],isError:!0,errorKind:`validation`};let s=await e(t,n,r,i,a,o);return s.success?{content:[{type:`text`,text:s.output??``}],details:{team:t,pattern:s.pattern}}:{content:[{type:`text`,text:`Team "${t}" failed: ${s.error}`}],isError:!0,errorKind:`runtime`}}function vr(e,t,n,r,i,a=1,o,s){let c=ur((s??[]).map(e=>({name:e.name,description:e.description,slot:e.preferredModelTier})));return{name:`task_delegate`,description:`Delegate work to a sub-agent, an isolated fork, or a declared team. Modes: sync/background/fork/team — semantics in the mode parameter. tracked:false (sync only, explicit subagent) → lightweight probe: no record, no retry, returns inline — use for quick agent opinions/reviews.`+(c?`\n${c}`:``),parameters:mr,isConcurrencySafe:e=>e?.mode===`fork`||e?.mode===`team`||e?.sessionMode!==`sticky`,lifecycleAsync:e=>(e?.mode===`sync`||e?.mode===void 0)&&e?.sessionMode!==`sticky`&&e?.tracked!==!1,lifecycleAsyncNote:`Note: the delegated sub-agent may edit files in the shared workspace while it runs. Until you receive its completion notice, do not read or write paths its task may touch.`,async execute({params:e,depth:s,signal:c,sessionId:l,parentTaskId:u}){if(e.tracked===!1){if((e.mode??`sync`)!==`sync`||e.category!==void 0||e.team!==void 0||e.sessionId!==void 0||e.sessionMode!==void 0||e.taskIds!==void 0||e.subagent===void 0)return{isError:!0,errorKind:`validation`,content:[{type:`text`,text:`tracked:false requires explicit subagent with mode=sync (no category/team/sessionId/sessionMode/taskIds)`}]};if(!o)return K(`task_delegate (tracked:false)`);let t=await o(e.subagent,e.prompt,{slot:e.slot,model:e.model,depth:s,signal:c,parentTaskId:u,parentSessionId:l});return t.ok?{content:[{type:`text`,text:t.value||`(no output)`}]}:{content:[{type:`text`,text:`Agent call failed: ${t.error}`}],isError:!0,errorKind:`runtime`}}if(e.mode===`fork`)return gr(r,e.prompt,s,c,a,l);if(e.mode===`team`)return _r(i,e.team,e.prompt,c,s,u,l);if(!t)return K(`task_delegate`);let d=[];if(e.mode!==`background`&&n){let e=await n({action:`update`,todos:[],sessionId:l});e.ok&&(d=e.value)}let f=e.prompt;e.taskIds&&e.taskIds.length>0&&(f=`You are responsible for completing parent task item(s): ${e.taskIds.map(e=>`"${e}"`).join(`, `)}. When done, your host will auto-sync these to "done". No need to call write_todos for parent items.\n\n${e.prompt}`);let p=await t({prompt:f,subagent:e.subagent,category:e.category,mode:e.mode,sessionId:e.sessionId,sessionMode:e.sessionMode,slot:e.slot,model:e.model,depth:s,signal:c,parentTaskId:u,parentSessionId:l});if(p.ok){let{id:t,status:r,output:i}=p.value,a=e.mode===`background`,o=a?void 0:await hr(n,l,e.taskIds,d),s=[];return a?s.push(`Task delegated in background${t?`: ${t}`:``}`):s.push(`Task delegated successfully`),i&&s.push(i),o&&s.push(o),{content:[{type:`text`,text:s.join(`
|
|
87
|
+
`)}],details:{mode:e.mode,status:r,sessionId:e.sessionId,sessionMode:e.sessionMode,...o?{todoSync:o}:{}}}}return{content:[{type:`text`,text:`Task delegation failed: ${p.error}`}],isError:!0,errorKind:`runtime`}}}}const yr=e.object({prompt:e.string().describe(`Self-contained instruction for the background job. It runs in an isolated git worktree with full tools (incl. file edits + MCP), so include all needed context.`),title:e.string().optional().describe(`Short label for the job (shown in the /jobs panel). Defaults to a slice of the prompt.`)});function br(e){return{name:`delegate_job`,description:`Delegate a file-changing task to an isolated background job. Runs in a separate git worktree with full tools (edits + MCP), then produces a REVIEWABLE DIFF — it does NOT touch your working tree directly. Use for independent changes you want isolated and audited (e.g. a self-contained refactor) while you keep working. The diff is applied by the user via /job apply (autonomous apply is off by default). For read-only background analysis use task_delegate(background); for in-conversation edits use task_delegate(sync).`,parameters:yr,async execute({params:t,sessionId:n}){if(!e)return K(`delegate_job`);if(!n)return{isError:!0,errorKind:`validation`,content:[{type:`text`,text:`delegate_job requires a session context (no sessionId available).`}]};let r=t.title?.trim()||t.prompt.replace(/\s+/g,` `).slice(0,48),{jobId:i}=e({prompt:t.prompt,title:r,sessionId:n});return{content:[{type:`text`,text:`Delegated background job ${i} (isolated worktree). It will produce a reviewable diff; you'll get a notification when it's ready. The user applies it with /job apply ${i} (or reviews it in the /jobs panel). It does not modify the current working tree.`}],details:{jobId:i,origin:`main`}}}}}const xr=e.object({action:e.enum([`get`,`list`,`output`]).describe(`get task by ID, list all tasks, or get background task output`),taskId:e.string().optional().describe(`Task ID (required for get/output actions)`),statusFilter:e.enum([`all`,`pending`,`running`,`completed`,`failed`,`cancelled`]).optional().default(`all`).describe(`Filter by status (list action only)`)});function Sr(e,t){let{get:n,list:r,output:i}=t;return{name:`task_inspect`,description:`Inspect tasks: get details by ID, list with optional status filter, or get background task output.`,parameters:xr,readonly:!0,async execute({params:e}){switch(e.action){case`get`:{if(!n)return K(`task_inspect(get)`);if(!e.taskId)return{content:[{type:`text`,text:`taskId is required for get action`}],isError:!0,errorKind:`validation`};let t=await n(e.taskId);if(!t.ok)return{content:[{type:`text`,text:t.error}],isError:!0,errorKind:`runtime`};let r=t.value,i=r.status===`failed`||!!r.error;return{content:[{type:`text`,text:[`Task: ${r.id}`,`Status: ${r.status}`,r.prompt?`Prompt: ${r.prompt}`:void 0,`Output: ${r.output??`N/A`}`,r.error?`Error: ${r.error}`:void 0,r.extensionsUsed!==void 0&&r.extensionsUsed>0?`Budget extensions used: ${r.extensionsUsed} (hard stop was extended)`:void 0,r.resumable&&r.sessionId?`Resumable: yes — continue this task by delegating with sessionMode:'sticky', sessionId:'${r.sessionId}' and a prompt built on the partial output above`:void 0].filter(e=>!!e).join(`
|
|
88
88
|
`)}],isError:i,details:{task:r}}}case`list`:{if(!r)return K(`task_inspect(list)`);let t=await r(e.statusFilter===`all`?void 0:e.statusFilter);if(t.ok){let e=t.value;return e.length===0?{content:[{type:`text`,text:`No tasks found.`}]}:{content:[{type:`text`,text:e.map(e=>`- [${e.status}] ${e.id}: ${e.prompt.slice(0,80)}`).join(`
|
|
89
89
|
`)}]}}throw Error(t.error)}case`output`:{if(!i)return K(`task_inspect(output)`);if(!e.taskId)return{content:[{type:`text`,text:`taskId is required for output action`}],isError:!0,errorKind:`validation`};let t=await i(e.taskId);if(t.ok){let{status:e,output:n}=t.value;return{content:[{type:`text`,text:`Status: ${e}\nOutput:\n${n??`(no output)`}`}],details:{status:e}}}return{content:[{type:`text`,text:t.error}],isError:!0,errorKind:`runtime`}}}}}}const Cr=e.object({action:e.enum([`cancel`,`retry`]).describe(`cancel a running task, or retry a failed task`),taskId:e.string().describe(`Task ID to act on`)});function wr(e,t){let{update:n,cancelBackground:r}=t;return{name:`task_control`,description:`Control tasks: cancel a running task or retry a failed one.`,parameters:Cr,async execute({params:e}){switch(e.action){case`cancel`:if(n){let t=await n(e.taskId,`cancel`);return t.ok?{content:[{type:`text`,text:t.value}]}:{content:[{type:`text`,text:t.error}],isError:!0,errorKind:`runtime`}}if(r){let t=await r(e.taskId);return t.ok?{content:[{type:`text`,text:`Task ${e.taskId} cancelled successfully`}]}:{content:[{type:`text`,text:t.error}],isError:!0,errorKind:`runtime`}}return K(`task_control(cancel)`);case`retry`:{if(!n)return K(`task_control(retry)`);let t=await n(e.taskId,`retry`);return t.ok?{content:[{type:`text`,text:t.value}]}:{content:[{type:`text`,text:t.error}],isError:!0,errorKind:`runtime`}}}}}}const Tr=e.object({availableOnly:e.boolean().optional().describe(`Only list models usable by the current account (authenticated, not rate-limit-risky) — recommended before picking a subagent model`)});function Er(e,t){return{name:`list_models`,description:"List models with their capability strengths (planning/knowledge/coding/reasoning/vision/speed/long-context) and usability. Use this to choose the best model for a sub-agent via the `model` param of task_delegate. Only pick models marked ✓ (usable); ✗ models are unauthenticated or rate-limit-risky and will be rejected.",parameters:Tr,readonly:!0,isConcurrencySafe:()=>!0,async execute({params:n}){if(!e)return K(`list_models`);let r=await e(t);return n.availableOnly&&(r=r.filter(e=>e.usable!==!1)),r.length===0?{content:[{type:`text`,text:`No usable models. Run /login or /model refresh first.`}]}:{content:[{type:`text`,text:`Models (✓ = usable, ✗ = unauthenticated/rate-limit-risky):\n${r.map(e=>{let t=e.usable===!1?`✗`:`✓`,n=e.usable===!1&&e.unusableReason?` (${e.unusableReason})`:``;return`${t} ${e.id} [${e.strengths.join(`/`)||`general`}]${n}`}).join(`
|
|
90
90
|
`)}`}]}}}}const Dr=e.object({id:e.string().describe(`Unique identifier`),title:e.string().describe(`Short description of the task`),status:e.enum([`pending`,`in_progress`,`done`,`skipped`,`failed`]).describe(`Current status`)}),Or=e.object({title:e.string().optional().describe(`Optional list title (e.g. "Bug fixes"); defaults to "Task".`),action:e.enum([`set`,`update`]).describe(`set: replace all todos; update: merge by id`),todos:e.array(Dr).describe(`Todo items`)});function kr(e){let t=e??Re();return{name:`write_todos`,description:`Track progress with a lightweight todo list (shown pinned above the input). "set" replaces all todos; "update" merges by id. Optional "title" labels the list (defaults to "Task"). Use for multi-step tasks (3+ steps). Keep exactly ONE item in_progress; mark items done the moment you finish (no batching). Never end a turn with pending/in_progress items — finish them or mark skipped/failed with a reason.`,parameters:Or,async execute({params:e,sessionId:n}){let r=await t({title:e.title,action:e.action,todos:e.todos,sessionId:n});if(r.ok){let e=r.value;return{content:[{type:`text`,text:e.map(e=>`[${e.status}] ${e.id}: ${e.title}`).join(`
|
|
@@ -129,28 +129,25 @@ Use schedule (type:list) to view all schedules, schedule (type:delete) to remove
|
|
|
129
129
|
|
|
130
130
|
`))}let o=e.TOOL_GUIDANCE_BUDGET_TOKENS,s=0,c=[],l=0;for(let t of a){let n=e.estimatedTokens(t);s+n<=o?(c.push(t),s+=n):l++}return l>0&&c.push(`> ⚠ [${l} additional tool guidance section(s) omitted — guidance budget (${o} tokens) reached; use tool_search or the tool's own description]`),r.length>0&&c.push(`> ${r.length} additional tool(s) discoverable via tool_search (not shown here to keep this section focused; use tool_search to look them up by name or capability).`),c.length===0?``:`### Tool Reference (per category)\n\n${c.join(`
|
|
131
131
|
|
|
132
|
-
`)}`}clear(){this.tools.size>0&&this.tools.clear()}dispose(){this.clear(),this.binaryToolExecutors&&=(this.binaryToolExecutors.dispose(),null);for(let e of this.disposers.splice(0))Promise.resolve().then(e).catch(()=>void 0)}};const pa=(e,t)=>{let n=new fa,r=ht(e,t.processTracker);return n.setBinaryToolExecutors(r),ua(n,e,t),n},ma=new Set([`task_delegate`]),ha=new class{name=`noop`;wrap(e){return{command:e.command,args:e.args,options:e.options}}async dispose(){}};function ga(){return ha}var _a=class{name=`macos-seatbelt`;options;profilePathByContent=new Map;constructor(e={}){this.options={network:e.network??`allow`,writablePaths:e.writablePaths??[],denyReadPaths:e.denyReadPaths??[]}}wrap(e){let t=
|
|
133
|
-
`),o=
|
|
132
|
+
`)}`}clear(){this.tools.size>0&&this.tools.clear()}dispose(){this.clear(),this.binaryToolExecutors&&=(this.binaryToolExecutors.dispose(),null);for(let e of this.disposers.splice(0))Promise.resolve().then(e).catch(()=>void 0)}};const pa=(e,t)=>{let n=new fa,r=ht(e,t.processTracker);return n.setBinaryToolExecutors(r),ua(n,e,t),n},ma=new Set([`task_delegate`]),ha=new class{name=`noop`;wrap(e){return{command:e.command,args:e.args,options:e.options}}async dispose(){}};function ga(){return ha}var _a=class{name=`macos-seatbelt`;options;profilePathByContent=new Map;constructor(e={}){this.options={network:e.network??`allow`,writablePaths:e.writablePaths??[],denyReadPaths:e.denyReadPaths??[],readOnly:e.readOnly??!1}}wrap(e){let t=va({projectRoot:e.projectRoot,writablePaths:this.options.writablePaths,denyReadPaths:this.options.denyReadPaths,network:this.options.network,readOnly:this.options.readOnly});return{command:`/usr/bin/sandbox-exec`,args:[`-f`,this.ensureProfileSync(t),e.command,...e.args],options:{...e.options}}}async dispose(){let e=[...this.profilePathByContent.values()];this.profilePathByContent.clear(),await Promise.allSettled(e.map(e=>xe(e).catch(()=>void 0)))}ensureProfileSync(e){let t=this.profilePathByContent.get(e);if(t&&D(t))return t;let n=`${ie()}/otto-sandbox-${Ce()}.sb`;return _e(n,e,`utf-8`),this.profilePathByContent.set(e,n),n}};function va(e){let t=P(e.projectRoot),n=ie(),r=new Set;if(e.readOnly!==!0)for(let i of[t,n,...(e.writablePaths??[]).map(e=>P(e))]){r.add(i);try{r.add(me(i))}catch{}}let i=e=>e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`),a=[...r].map(e=>`(subpath "${i(e)}")`).join(`
|
|
133
|
+
`),o=a.length>0?`(allow file-read* file-write*\n ${a}\n)\n`:``,s=e.network===`deny`?`(deny network*)
|
|
134
134
|
`:`(allow network*)
|
|
135
|
-
`,
|
|
135
|
+
`,c=new Set;for(let t of e.denyReadPaths??[]){let e=P(t);c.add(e);try{c.add(me(e))}catch{}}return`(version 1)
|
|
136
136
|
(allow default)
|
|
137
137
|
(deny file-write*)
|
|
138
138
|
(allow file-read* file-write* (literal "/dev/null"))
|
|
139
139
|
(allow file-read* file-write* (literal "/dev/zero"))
|
|
140
140
|
(allow file-read* file-write* (literal "/dev/tty"))
|
|
141
|
-
${
|
|
141
|
+
${s}(allow process-fork)
|
|
142
142
|
(allow process-exec)
|
|
143
143
|
(allow signal)
|
|
144
144
|
(allow sysctl-read)
|
|
145
145
|
(allow file-read*
|
|
146
146
|
(subpath "/")
|
|
147
147
|
)
|
|
148
|
-
|
|
149
|
-
${a}
|
|
150
|
-
)
|
|
151
|
-
${s.size>0?`
|
|
148
|
+
${o}${c.size>0?`
|
|
152
149
|
; credential read isolation (opt-in) — last match wins, denies even within writable roots
|
|
153
|
-
`+[...
|
|
150
|
+
`+[...c].map(e=>`(deny file-read* (subpath "${i(e)}"))`).join(`
|
|
154
151
|
`)+`
|
|
155
|
-
`:``}`}
|
|
152
|
+
`:``}`}function ya(e){return new _a(e)}var ba=class{name=`bubblewrap`;options;constructor(e={}){this.options={network:e.network??`allow`,writablePaths:e.writablePaths??[],readOnly:e.readOnly??!1,denyReadPaths:e.denyReadPaths??[]}}wrap(e){let t=P(e.projectRoot),n=P(e.options.cwd??t),r=[`--unshare-all`,`--cap-drop`,`ALL`,`--die-with-parent`];for(let e of xa)D(e)&&r.push(`--ro-bind`,e,e);r.push(`--tmpfs`,`/tmp`);let i=[t];if(this.options.readOnly===!0)r.push(`--ro-bind`,t,t);else{r.push(`--bind`,t,t);for(let e of this.options.writablePaths){let t=P(e);i.push(t),r.push(`--bind`,t,t)}}for(let e of this.options.denyReadPaths){let t=P(e);i.some(e=>t===e||t.startsWith(`${e}/`))&&r.push(`--tmpfs`,t)}return r.push(`--proc`,`/proc`),this.options.network===`deny`?r.push(`--unshare-net`):r.push(`--share-net`),r.push(`--chdir`,n),r.push(e.command,...e.args),{command:`bwrap`,args:r,options:{...e.options}}}async dispose(){}};const xa=[`/usr`,`/bin`,`/lib`,`/lib64`,`/etc`,`/dev`,`/sys`];function Sa(e){return new ba(e)}function Ca(){let e=re(),t=process.env.OTTO_AUTH_PATH;return[M(e,`.ssh`),M(e,`.aws`),M(e,`.gnupg`),t?j(t):M(e,`.config`,`otto`)]}function wa(e={}){switch(e.force??Ta()){case`seatbelt`:return ya({network:e.network,writablePaths:e.writablePaths,denyReadPaths:e.denyReadPaths,...e.readOnly===void 0?{}:{readOnly:e.readOnly}});case`bubblewrap`:return Sa({network:e.network,writablePaths:e.writablePaths,denyReadPaths:e.denyReadPaths,...e.readOnly===void 0?{}:{readOnly:e.readOnly}});default:return ga()}}function Ta(){return process.platform===`darwin`?`seatbelt`:process.platform===`linux`?`bubblewrap`:`noop`}function Ea(){let e=Ta();return e===`seatbelt`?D(`/usr/bin/sandbox-exec`):e===`bubblewrap`?[`/usr/bin/bwrap`,`/usr/local/bin/bwrap`,`/bin/bwrap`].some(e=>D(e))?!0:(process.env.PATH??``).split(`:`).filter(Boolean).some(e=>D(`${e}/bwrap`)):!1}function Da(e){if(e.readOnlySession)return e.readOnly??void 0;if(!e.bypassed)return e.normal??void 0}export{mt as BinaryToolExecutorRegistry,ii as LSPClient,ma as ORCHESTRATION_TOOL_NAMES,sa as TOOL_NODES,fa as ToolRegistry,ur as buildDelegationAgentListDescription,ht as createBinaryToolExecutorRegistry,Sa as createBubblewrapSandbox,jr as createCaptureFileState,Fn as createEdit,Ue as createGrillMe,Nr as createLearn,vi as createLspDefinition,wi as createLspDiagnostics,Ei as createLspPrepareRename,bi as createLspReferences,Oi as createLspRename,Si as createLspSymbols,ya as createMacOsSeatbeltSandbox,ga as createNoopSandbox,wa as createPlatformSandbox,dn as createRead,Ai as createSessionManagerTool,wr as createTaskControl,Sr as createTaskInspect,pa as createToolRegistry,Fr as createToolSearch,tr as createWebFetch,lr as createWebSearch,_n as createWrite,kr as createWriteTodos,Ca as credentialDenyReadPaths,hi as findWorkspaceRoot,Ea as isPlatformSandboxAvailable,Y as lspManager,ua as registerBuiltinTools,Da as selectSandboxStrategy,Z as withLspClient};
|
|
156
153
|
//# sourceMappingURL=index.js.map
|