@ordewell/core 0.5.6 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{IFileSystem-BkPX7mLD.d.mts → IFileSystem-CFYf4yR2.d.mts} +1 -1
- package/dist/{IFileSystem-C0l-4MGT.d.ts → IFileSystem-D4dAl2r8.d.ts} +1 -1
- package/dist/{ModeResolver--16lh7dS.d.mts → ModeResolver-DVYVRbJp.d.ts} +6 -2
- package/dist/{ModeResolver-CjpG5Wli.d.ts → ModeResolver-a4xJFlEp.d.mts} +6 -2
- package/dist/{Task-Dyxp67s2.d.mts → Task-CZJr6rmz.d.mts} +47 -12
- package/dist/{Task-Dyxp67s2.d.ts → Task-CZJr6rmz.d.ts} +47 -12
- package/dist/{chunk-ROVYWEBI.mjs → chunk-2SOVKO7P.mjs} +3 -2
- package/dist/chunk-2SOVKO7P.mjs.map +1 -0
- package/dist/{chunk-JBEFAJ2W.mjs → chunk-OM4D274O.mjs} +19 -1
- package/dist/chunk-OM4D274O.mjs.map +1 -0
- package/dist/index.d.mts +207 -45
- package/dist/index.d.ts +207 -45
- package/dist/index.js +5290 -4409
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4878 -4015
- package/dist/index.mjs.map +1 -1
- package/dist/order-labels.d.mts +1 -1
- package/dist/order-labels.d.ts +1 -1
- package/dist/{parsing-EcmCsF1y.d.ts → parsing-Bd6-b644.d.ts} +2 -2
- package/dist/{parsing-DPEpAszP.d.mts → parsing-DIaGZmiQ.d.mts} +2 -2
- package/dist/parsing.d.mts +3 -3
- package/dist/parsing.d.ts +3 -3
- package/dist/parsing.js.map +1 -1
- package/dist/parsing.mjs +1 -1
- package/dist/{plan-utils-BAvW3hvl.d.mts → plan-utils-Ba-l8EZS.d.mts} +2 -2
- package/dist/{plan-utils-BMyEiDKv.d.ts → plan-utils-_T5S7Mnk.d.ts} +2 -2
- package/dist/plan-utils.d.mts +3 -3
- package/dist/plan-utils.d.ts +3 -3
- package/dist/plan-utils.js +2 -1
- package/dist/plan-utils.js.map +1 -1
- package/dist/plan-utils.mjs +1 -1
- package/dist/testing.d.mts +2 -2
- package/dist/testing.d.ts +2 -2
- package/package.json +1 -1
- package/dist/chunk-JBEFAJ2W.mjs.map +0 -1
- package/dist/chunk-ROVYWEBI.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/services/ModeResolver.ts","../src/services/PlanValidator.ts","../src/services/PartialPlanParser.ts"],"sourcesContent":["import type { RunnerId } from '../models/Task';\n\nexport interface RunnerModeInfo {\n id: string;\n label: string;\n description: string;\n autonomous?: boolean;\n safe?: boolean;\n}\n\n/** The slice of RunnerRegistry this module needs — structural, so nothing here depends on the plugin layer. */\nexport interface ManifestLookup {\n getManifest(runner: RunnerId): { modes?: RunnerModeInfo[] } | undefined;\n}\n\n/**\n * A runner's modes are declared only in its manifest, never through a service,\n * so every caller that needs them fuses registry and runner list by hand. This\n * is that fusion, in one place: the planner prompt, the mode pickers on each\n * surface, and the runner-change retarget all read modes the same way.\n *\n * A runner with no modes maps to `[]` rather than being dropped — callers\n * distinguish \"declares no modes\" from \"not asked about\".\n */\nexport function runnerModesFrom(registry: ManifestLookup, runners: RunnerId[]): Record<RunnerId, RunnerModeInfo[]> {\n return Object.fromEntries(runners.map((r) => [r, registry.getManifest(r)?.modes ?? []] as const));\n}\n\n/**\n * Find the mode ID a runner resolves to under the given toggle state.\n * Tag-based first (autonomous/safe); falls back to positional last non-plan\n * if no tag is present on any mode (degrades gracefully on untagged manifests).\n * Returns undefined if `modes` is empty or undefined.\n */\nexport function resolveDefaultMode(\n modes: RunnerModeInfo[] | undefined,\n autonomousDefault = true,\n): string | undefined {\n if (!modes || modes.length === 0) return undefined;\n const tag: 'autonomous' | 'safe' = autonomousDefault ? 'autonomous' : 'safe';\n const tagged = modes.find((m) => m[tag]);\n if (tagged) return tagged.id;\n for (let i = modes.length - 1; i >= 0; i--) {\n if (modes[i].id !== 'plan') return modes[i].id;\n }\n return undefined;\n}\n\nfunction isDefaultMode(m: RunnerModeInfo, autonomousDefault: boolean): boolean {\n return autonomousDefault ? !!m.autonomous : !!m.safe;\n}\n\nfunction modeConflictsWithToggle(\n mode: RunnerModeInfo,\n autonomousDefault: boolean,\n): boolean {\n if (autonomousDefault) return !!mode.safe && !mode.autonomous;\n return !!mode.autonomous && !mode.safe;\n}\n\n/**\n * Build modes compatible with the current toggle. Plan is excluded from the\n * build-mode list (it is never a default for implementation tasks). Modes\n * tagged exclusively for the OPPOSITE toggle are hidden — the LLM cannot see\n * or select them. A dual-tagged mode (both autonomous + safe) is shown under\n * either toggle.\n */\nexport function filteredBuildModes(modes: RunnerModeInfo[], autonomousDefault: boolean): RunnerModeInfo[] {\n const buildModes = modes.filter((m) => m.id !== 'plan' && !modeConflictsWithToggle(m, autonomousDefault));\n const defaultIdx = buildModes.findIndex((m) => isDefaultMode(m, autonomousDefault));\n if (defaultIdx > 0) {\n const [def] = buildModes.splice(defaultIdx, 1);\n buildModes.unshift(def);\n }\n return buildModes;\n}\n\n/** The user-facing name of the `autonomousMode` boolean's two states. */\nexport function autonomyLevelLabel(autonomous: boolean): 'Full auto' | 'Auto' {\n return autonomous ? 'Full auto' : 'Auto';\n}\n\n/** `full`/`auto` name the levels; `on`/`off` are the toggle's old words for them. Null for anything else. */\nexport function parseAutonomyLevel(arg: string | undefined): boolean | null {\n switch (arg?.trim().toLowerCase()) {\n case 'full': case 'on': return true;\n case 'auto': case 'off': return false;\n default: return null;\n }\n}\n\nexport function buildModeGuide(\n runnerModes: Record<RunnerId, RunnerModeInfo[]>,\n autonomousDefault = true,\n): string {\n const lines: string[] = [];\n for (const [runnerId, modes] of Object.entries(runnerModes)) {\n if (!modes || modes.length === 0) continue;\n const filtered = filteredBuildModes(modes, autonomousDefault);\n if (filtered.length === 0) continue;\n const modeStr = filtered\n .map((m) => {\n const tag = isDefaultMode(m, autonomousDefault) ? ' (DEFAULT)' : '';\n return `${m.id}${tag} (${m.description})`;\n })\n .join(', ');\n lines.push(`- ${runnerId}: ${modeStr}`);\n }\n if (lines.length === 0) return '';\n\n return [\n `Autonomy level: ${autonomyLevelLabel(autonomousDefault)}.`,\n 'AVAILABLE MODES PER RUNNER:',\n ...lines,\n '',\n 'For each AI task, use the mode marked (DEFAULT) unless the task needs a different compatible mode listed above. Avoid the \"plan\" mode (read-only) unless the user explicitly requested analysis-only.',\n ].join('\\n');\n}\n\nexport function resolveTaskMode(\n emittedMode: string | undefined,\n runnerId: RunnerId,\n runnerModes: Record<RunnerId, RunnerModeInfo[]> | undefined,\n autonomousDefault = true,\n): string {\n const rawMode = (emittedMode as string) || 'build';\n\n if (!runnerModes) return rawMode === 'plan' ? 'plan' : 'build';\n\n const modes = runnerModes[runnerId];\n\n if (!modes || modes.length === 0) return rawMode;\n\n // A missing mode is an invalid emission, not a request for legacy `build` —\n // which on Codex aliases the workspace-write sandbox, not full access.\n if (!emittedMode) return resolveDefaultMode(modes, autonomousDefault) ?? 'build';\n\n const validIds = new Set(modes.map((m) => m.id));\n\n if (rawMode === 'build' || validIds.has(rawMode)) {\n if (rawMode === 'plan' || rawMode === 'build') return rawMode;\n const modeObj = modes.find((m) => m.id === rawMode);\n if (modeObj && modeConflictsWithToggle(modeObj, autonomousDefault)) {\n const fallback = resolveDefaultMode(modes, autonomousDefault);\n return fallback ?? 'build';\n }\n return rawMode;\n }\n\n const fallback = resolveDefaultMode(modes, autonomousDefault);\n return fallback ?? 'build';\n}\n","import { Task, createTask, TaskModelAssignment, RunnerId, type ValidationContext, type ValidationResult } from '../models/Task';\nimport { extractObjectsWithKey, stripTrailingCommas, escapeControlCharsInStrings, PlanParseError, PLAN_ENVELOPE_KEY } from './JsonExtractor';\nimport { resolveTaskMode, type RunnerModeInfo } from './ModeResolver';\n\nexport function parsePlanJson(\n raw: string,\n runners: RunnerId[],\n runnerModes?: Record<RunnerId, RunnerModeInfo[]>,\n autonomousDefault = true,\n): Task[] {\n const { matches, fallback, sawUnbalanced } = extractObjectsWithKey(raw, PLAN_ENVELOPE_KEY);\n\n // A reply can carry several tasks-keyed objects — a schema echo from the\n // prompt, an inline draft, then the real plan. The model's LAST emission is\n // its final answer, so candidates are tried back to front and the first one\n // that fully parses and validates wins.\n const candidates = matches.length > 0 ? [...matches].reverse() : [fallback.json];\n\n let lastError: PlanParseError | null = null;\n for (const json of candidates) {\n try {\n return parsePlanObject(json, raw, runners, runnerModes, autonomousDefault);\n } catch (err) {\n if (!(err instanceof PlanParseError)) throw err;\n // Prefer surfacing the error from the most plan-like candidate: the\n // last one carrying a tasks key (tried first).\n if (!lastError) lastError = err;\n }\n }\n\n // No usable tasks object anywhere, but an object ran off the end of the\n // text: the plan was almost certainly cut off mid-stream.\n if (matches.length === 0 && sawUnbalanced) {\n throw new PlanParseError(\n 'Plan response appears truncated — the model likely hit its output length limit before finishing the JSON.',\n raw,\n { truncated: true },\n );\n }\n throw lastError ?? new PlanParseError('Invalid plan: missing tasks array', raw);\n}\n\nfunction parsePlanObject(\n json: string,\n raw: string,\n runners: RunnerId[],\n runnerModes?: Record<RunnerId, RunnerModeInfo[]>,\n autonomousDefault = true,\n): Task[] {\n const cleaned = stripTrailingCommas(escapeControlCharsInStrings(json));\n\n let parsed: unknown;\n try {\n parsed = JSON.parse(cleaned);\n } catch (err) {\n const detail = err instanceof Error ? err.message : String(err);\n throw new PlanParseError(`Plan response was not valid JSON: ${detail}`, raw);\n }\n\n if (!parsed || typeof parsed !== 'object' || !Array.isArray((parsed as { tasks?: unknown }).tasks)) {\n throw new PlanParseError('Invalid plan: missing tasks array', raw);\n }\n\n const rawTasks = (parsed as { tasks: Record<string, unknown>[] }).tasks;\n if (rawTasks.length === 0) {\n throw new PlanParseError('Plan contained no tasks', raw);\n }\n\n const tasks = rawTasks.map((t) => parseTask(t, runners, runnerModes, autonomousDefault));\n\n validateVerticalSliceShape(tasks, raw);\n\n for (const t of tasks) {\n if (!runners.includes(t.assignedRunner)) {\n throw new PlanParseError(\n `Task \"${t.title}\" has invalid assignedRunner \"${t.assignedRunner}\". Expected one of: ${runners.join(', ')}`,\n raw,\n { semantic: true },\n );\n }\n }\n\n return tasks;\n}\n\n/**\n * Whether a reply that failed {@link parsePlanJson} actually LOOKED like a\n * plan attempt — a balanced tasks-keyed object, or JSON that got cut off.\n * Distinguishes \"the model tried to emit a plan and botched it\" (worth a\n * corrective retry) from prose that merely mentions `\"tasks\"` (leave alone).\n */\nexport function looksLikePlanAttempt(raw: string): boolean {\n const { matches, sawUnbalanced } = extractObjectsWithKey(raw, PLAN_ENVELOPE_KEY);\n if (matches.length > 0) return true;\n return sawUnbalanced && raw.includes(`\"${PLAN_ENVELOPE_KEY}\"`);\n}\n\n/**\n * The parent's slice classification, handed to `ai` subtasks that omit their\n * own. Budget models emit sub-steps as bare `{id, order, title, description,\n * type}` — neither prompt has ever shown a populated `subtasks` entry — and the\n * recursive slice contract then rejected the whole plan. Inheriting invents no\n * information: an `ai` sub-step of an AFK slice is AFK. Deliberately NOT a\n * blanket `'AFK'` default, which would silently strip a human gate the planner\n * intended (`sliceType` is what puts ORDEWELL_CHECKPOINT in the runner prompt,\n * and subtasks are schedulable — PlanStore.rebuild flattens them into\n * _allTasks). `type: 'user'` subtasks inherit nothing and must still declare\n * HITL themselves.\n */\ntype InheritedSlice = { sliceType?: Task['sliceType']; autonomy?: Task['autonomy'] };\n\nfunction parseTask(\n raw: Record<string, unknown>,\n runners: RunnerId[],\n runnerModes?: Record<RunnerId, RunnerModeInfo[]>,\n autonomousDefault = true,\n inherited?: InheritedSlice,\n): Task {\n const assignedRunner = typeof raw.assignedRunner === 'string' ? raw.assignedRunner : (runners[0] ?? 'claude-code');\n const taskType = (raw.type === 'user' ? 'user' : 'ai') as Task['type'];\n const title = String(raw.title ?? '');\n const description = String(raw.description ?? '');\n // Explicit child values always win; inheritance only fills a gap, and only\n // for `ai` tasks.\n const autonomy = taskType === 'ai' && typeof raw.autonomy === 'string' && (raw.autonomy === 'AFK' || raw.autonomy === 'HITL')\n ? raw.autonomy\n : (taskType === 'ai' ? inherited?.autonomy : undefined);\n const sliceType = typeof raw.sliceType === 'string' && (raw.sliceType === 'HITL' || raw.sliceType === 'AFK')\n ? raw.sliceType\n : (taskType === 'ai' ? inherited?.sliceType : undefined);\n return createTask({\n id: String(raw.id ?? ''),\n order: Number(raw.order ?? 0),\n title,\n description,\n type: taskType,\n dependencies: Array.isArray(raw.dependencies)\n ? raw.dependencies.map(String)\n : [],\n // The planner sometimes omits `prompt` on an AI task while still filling in\n // description/title — same fallback TaskOps.applyTaskOps uses for `add`, so\n // a task never silently ends up unschedulable (getReadyTasks requires prompt).\n prompt: raw.prompt ? String(raw.prompt) : (description || title || undefined),\n userSteps: Array.isArray(raw.userSteps)\n ? raw.userSteps.map((s: Record<string, unknown>) => ({\n order: Number(s.order ?? 0),\n instruction: String(s.instruction ?? ''),\n completed: false,\n }))\n : undefined,\n subtasks: Array.isArray(raw.subtasks)\n ? raw.subtasks.map((s: Record<string, unknown>) =>\n parseTask(s, runners, runnerModes, autonomousDefault, { sliceType, autonomy }))\n : [],\n assignedModel: raw.assignedModel\n ? {\n modelId: String((raw.assignedModel as Record<string, unknown>).modelId ?? ''),\n modelLabel: String((raw.assignedModel as Record<string, unknown>).modelLabel ?? ''),\n thinkingEffort: (raw.assignedModel as Record<string, unknown>).thinkingEffort as TaskModelAssignment['thinkingEffort'],\n }\n : undefined,\n assignedRunner,\n thinkingEffort: raw.thinkingEffort ? String(raw.thinkingEffort) : undefined,\n taskMode: resolveTaskMode(\n raw.taskMode !== undefined ? String(raw.taskMode) : undefined,\n assignedRunner,\n runnerModes,\n autonomousDefault,\n ),\n autonomy,\n sliceType,\n userStoriesCovered: Array.isArray(raw.userStoriesCovered)\n ? raw.userStoriesCovered.map(String)\n : undefined,\n });\n}\n\nfunction validateVerticalSliceShape(tasks: Task[], raw: string, parentTitle?: string): void {\n // Without this the message names a title that appears nowhere in the plan's\n // top-level `tasks` array, and neither the corrective nor a human can find\n // the offending object.\n const where = (t: Task) => (parentTitle ? `subtask \"${t.title}\" of \"${parentTitle}\"` : `Task \"${t.title}\"`);\n const semantic = { semantic: true };\n\n for (const t of tasks) {\n if (!t.sliceType) {\n throw new PlanParseError(\n `${where(t)} is missing sliceType. Every task must specify sliceType (\"AFK\" or \"HITL\").`,\n raw,\n semantic,\n );\n }\n\n if (t.type === 'ai' && !t.autonomy) {\n throw new PlanParseError(\n `AI ${where(t)} is missing autonomy. Every AI task must specify autonomy (\"AFK\" or \"HITL\").`,\n raw,\n semantic,\n );\n }\n\n if (t.autonomy === 'AFK' && t.userSteps && t.userSteps.length > 0) {\n throw new PlanParseError(\n `${where(t)} has autonomy \"AFK\" but contains userSteps. AFK tasks must not have user touchpoints.`,\n raw,\n semantic,\n );\n }\n\n if (t.type === 'user' && t.sliceType !== 'HITL') {\n throw new PlanParseError(\n `User ${where(t)} has sliceType \"${t.sliceType}\". User tasks must have sliceType \"HITL\".`,\n raw,\n semantic,\n );\n }\n\n if (t.subtasks.length > 0) {\n validateVerticalSliceShape(t.subtasks, raw, t.title);\n }\n }\n}\n\nexport function checkUniqueIds(ctx: ValidationContext): ValidationResult {\n const seen = new Set<string>();\n const errors: string[] = [];\n for (const t of ctx.newPending) {\n if (seen.has(t.id)) {\n errors.push(`Duplicate task ID in modified plan: ${t.id}`);\n }\n seen.add(t.id);\n }\n return { valid: errors.length === 0, errors };\n}\n\nexport function checkNoCycles(ctx: ValidationContext): ValidationResult {\n const ids = new Set(ctx.newPending.map((t) => t.id));\n const adj = new Map<string, string[]>();\n for (const t of ctx.newPending) {\n adj.set(t.id, t.dependencies.filter((d) => ids.has(d)));\n }\n\n const visited = new Set<string>();\n const inStack = new Set<string>();\n const errors: string[] = [];\n\n function dfs(node: string): boolean {\n if (inStack.has(node)) {\n errors.push(`Cycle detected in task dependencies involving task: ${node}`);\n return true;\n }\n if (visited.has(node)) return false;\n visited.add(node);\n inStack.add(node);\n for (const dep of adj.get(node) ?? []) {\n if (dfs(dep)) return true;\n }\n inStack.delete(node);\n return false;\n }\n\n for (const id of ids) {\n if (dfs(id)) break;\n }\n\n return { valid: errors.length === 0, errors };\n}\n\nexport function checkDepsResolve(ctx: ValidationContext): ValidationResult {\n const existingIds = new Set<string>();\n for (const t of ctx.executionLog) existingIds.add(t.id);\n for (const t of ctx.newPending) existingIds.add(t.id);\n\n const errors: string[] = [];\n for (const t of ctx.newPending) {\n for (const dep of t.dependencies) {\n if (!existingIds.has(dep)) {\n errors.push(`Task \"${t.title}\" depends on \"${dep}\" which is not in the execution log or pending tasks`);\n }\n }\n }\n return { valid: errors.length === 0, errors };\n}\n\nexport function checkImmutableLog(ctx: ValidationContext): ValidationResult {\n const logIds = new Map(ctx.executionLog.map((t) => [t.id, t]));\n\n const errors: string[] = [];\n\n for (const t of ctx.newPending) {\n const logEntry = logIds.get(t.id);\n if (logEntry) {\n if (logEntry.status === 'completed' && logEntry.finalized) {\n errors.push(`Task \"${t.id}\" was already completed in the execution log and cannot be re-added`);\n }\n }\n }\n\n return { valid: errors.length === 0, errors };\n}\n\nexport function checkInProgress(ctx: ValidationContext): ValidationResult {\n const oldInProgress = new Map(\n ctx.oldPending.filter((t) => t.status === 'in_progress').map((t) => [t.id, t])\n );\n const newIds = new Set(ctx.newPending.map((t) => t.id));\n const errors: string[] = [];\n\n for (const [id, oldTask] of oldInProgress) {\n if (!newIds.has(id)) {\n errors.push(`In-progress task \"${oldTask.title}\" was removed from the modified plan`);\n continue;\n }\n const newTask = ctx.newPending.find((t) => t.id === id)!;\n if (newTask.prompt !== oldTask.prompt || newTask.assignedModel?.modelId !== oldTask.assignedModel?.modelId) {\n errors.push(`In-progress task \"${oldTask.title}\" was modified in the new plan`);\n }\n const oldDeps = new Set(oldTask.dependencies);\n const newDeps = new Set(newTask.dependencies);\n if (oldDeps.size !== newDeps.size || [...oldDeps].some((d) => !newDeps.has(d))) {\n errors.push(`In-progress task \"${oldTask.title}\" had dependencies modified`);\n }\n }\n\n return { valid: errors.length === 0, errors };\n}\n\nexport function validatePlanModification(ctx: ValidationContext): ValidationResult {\n const checks = [\n checkUniqueIds,\n checkNoCycles,\n checkDepsResolve,\n checkImmutableLog,\n checkInProgress,\n ];\n const allErrors: string[] = [];\n for (const check of checks) {\n const result = check(ctx);\n allErrors.push(...result.errors);\n }\n return { valid: allErrors.length === 0, errors: allErrors };\n}\n","import { stripModelNoise } from './JsonExtractor';\n\n/** A task as seen in a still-streaming plan: its title (possibly partial) and whether its object has closed. */\nexport interface PartialPlanTask {\n title: string;\n status: 'streaming' | 'complete';\n /** Assigned model label, once it has streamed in — for the live row's chip. */\n model?: string;\n /** Task mode (\"build\"|\"plan\"), once it has streamed in — for the live row's chip. */\n mode?: string;\n}\n\n/**\n * Parse a partial (still-streaming) plan-JSON string into an ordered list of task\n * rows for the live progress view. Pure and lenient: it walks the characters of the\n * `tasks` array, emitting one row per task object once it has opened, with the title\n * read incrementally and the status flipping to `complete` when the object's brace\n * closes. The currently-streaming object stays `streaming` even with a partial title.\n * The React view is a thin renderer over this — it never parses JSON itself.\n */\nexport function parsePartialPlan(partial: string): PartialPlanTask[] {\n const text = stripModelNoise(partial);\n const arrayStart = findTasksArrayStart(text);\n if (arrayStart === -1) return [];\n\n const tasks: PartialPlanTask[] = [];\n let depth = 0; // brace depth relative to a task object (0 = between objects)\n let objText = ''; // accumulated text of the in-progress task object\n let inString = false;\n let escaped = false;\n\n for (let i = arrayStart; i < text.length; i++) {\n const ch = text[i];\n if (depth > 0) objText += ch;\n\n if (inString) {\n if (escaped) escaped = false;\n else if (ch === '\\\\') escaped = true;\n else if (ch === '\"') inString = false;\n continue;\n }\n if (ch === '\"') { inString = true; continue; }\n if (ch === ']' && depth === 0) break; // end of the tasks array\n if (ch === '{') {\n if (depth === 0) objText = '{';\n depth++;\n } else if (ch === '}') {\n depth--;\n if (depth === 0) {\n tasks.push(rowFromObject(objText, 'complete'));\n objText = '';\n }\n }\n }\n\n // A task object that opened but never closed is the row currently streaming in.\n if (depth > 0) tasks.push(rowFromObject(objText, 'streaming'));\n return tasks;\n}\n\n/** Index just after the `[` that opens the top-level `tasks` array, or -1 if not present yet. */\nfunction findTasksArrayStart(text: string): number {\n const key = /\"tasks\"\\s*:\\s*\\[/.exec(text);\n return key ? key.index + key[0].length : -1;\n}\n\n/** Build a live row from a (possibly unterminated) task-object fragment. */\nfunction rowFromObject(objText: string, status: PartialPlanTask['status']): PartialPlanTask {\n const model = stringField(objText, 'modelLabel');\n const mode = stringField(objText, 'taskMode');\n return {\n title: titleFromObject(objText),\n status,\n ...(model ? { model } : {}),\n ...(mode ? { mode } : {}),\n };\n}\n\n/** Read the `title` value out of a (possibly unterminated) task-object fragment. */\nfunction titleFromObject(objText: string): string {\n const m = /\"title\"\\s*:\\s*\"((?:[^\"\\\\]|\\\\.)*)/.exec(objText);\n if (!m) return '';\n // The captured group may include a trailing closing quote's content only up to an\n // unescaped quote; for a completed value that's the whole title, for a streaming\n // one it's whatever has arrived so far.\n return m[1].replace(/\\\\\"/g, '\"');\n}\n\n/** Read a fully-streamed (closing-quote present) string field's value, or undefined. */\nfunction stringField(objText: string, key: string): string | undefined {\n const m = new RegExp(`\"${key}\"\\\\s*:\\\\s*\"((?:[^\"\\\\\\\\]|\\\\\\\\.)*)\"`).exec(objText);\n return m ? m[1].replace(/\\\\\"/g, '\"') : undefined;\n}\n"],"mappings":";;;;;;;;;;;AAwBO,SAAS,gBAAgB,UAA0B,SAAyD;AACjH,SAAO,OAAO,YAAY,QAAQ,IAAI,CAAC,MAAM,CAAC,GAAG,SAAS,YAAY,CAAC,GAAG,SAAS,CAAC,CAAC,CAAU,CAAC;AAClG;AAQO,SAAS,mBACd,OACA,oBAAoB,MACA;AACpB,MAAI,CAAC,SAAS,MAAM,WAAW,EAAG,QAAO;AACzC,QAAM,MAA6B,oBAAoB,eAAe;AACtE,QAAM,SAAS,MAAM,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC;AACvC,MAAI,OAAQ,QAAO,OAAO;AAC1B,WAAS,IAAI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E,MAAM,IAAI,CAAC;AAAA,IACzB,GAAI,OAAO,EAAE,KAAK,IAAI,CAAC;AAAA,EACzB;AACF;AAGA,SAAS,gBAAgB,SAAyB;AAChD,QAAM,IAAI,mCAAmC,KAAK,OAAO;AACzD,MAAI,CAAC,EAAG,QAAO;AAIf,SAAO,EAAE,CAAC,EAAE,QAAQ,QAAQ,GAAG;AACjC;AAGA,SAAS,YAAY,SAAiB,KAAiC;AACrE,QAAM,IAAI,IAAI,OAAO,IAAI,GAAG,mCAAmC,EAAE,KAAK,OAAO;AAC7E,SAAO,IAAI,EAAE,CAAC,EAAE,QAAQ,QAAQ,GAAG,IAAI;AACzC;","names":["fallback"]}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { aG as RunnerId, ag as PlanStatus, a6 as LegacyPlanState, I as IApproval, k as ApprovalDecision, p as ApprovalRequest, j as ApprovalAnswer, L as ITerminalRunner, J as IConfig, h as AiProvider, as as ProviderModelLists, m as ApprovalMode, X as IsolationMergeResult, T as IsolationLandedTask, N as IWorktreeIsolation, a2 as IsolationTaskStatus, ad as PlanIsolation, aL as RunnerTransport, az as RepoGroupLayout, M as ITerminalSession, w as DiscoveredModel, aU as Task, f as AgentProcessDeps, c as AgentAdapter, aB as ResearchProgress, aA as ResearchLogEntry, u as ConversationMessage, b9 as UsageRecord, b1 as TaskSnapshot, r as AwaitingReason, Q as IsolationHandoff, $ as IsolationRun, a0 as IsolationTaskRecord, aV as TaskIsolation, a3 as IsolationView, Y as IsolationOutcome, ay as RepairEvidence, bg as Verdict, aJ as RunnerRegistry, ax as QueuedTaskMessage, aw as QueuedMessage, b as ActiveTaskSession, ac as OrchestratorOption, aY as TaskModeAgentAdapter, g as AgentStartOptions, e as AgentEvent, aE as ResearchToolType, ai as PlannerUsage, n as ApprovalPolicy, af as PlanState, aH as RunnerInvocation, A as AbstractRunner, a as AbstractTerminalSession, aQ as StructuredSessionCapability, b2 as TaskStartOptions, aR as StructuredTurnEnd, aP as StructuredEvent, aK as RunnerSpawnOptions, K as IPluginStore, aI as RunnerPluginManifest, aF as ResolveContext } from './Task-
|
|
2
|
-
export { d as AgentAdapterFactory, i as AllProviderModels, l as ApprovalKind, o as ApprovalPolicyOptions, q as ApprovalSource, B as BlockingPrompt, C as CMD_EXE_MAX_COMMAND_LINE, s as CatalogModel, t as CommandLineTooLongError, D as DENY_ALL, v as DiscoveredMode, x as DiscoveryCommand, E as EmbeddedNewlineError, y as ExecutableNotFoundError, F as FetchAllProviderModelsOptions, H as HeadlessRunner, z as HeadlessRunnerDeps, G as HeadlessSession, O as IntegrationDisposal, P as IsolationAvailability, R as IsolationHandoffRepo, S as IsolationInactiveReason, U as IsolationLanding, V as IsolationMergeBlock, W as IsolationMergeBlockReason, Z as IsolationPruneResult, _ as IsolationRepo, a1 as IsolationTaskRepo, a4 as LaunchDeps, a5 as LaunchPlan, a7 as LineBuffer, a8 as Message, a9 as ModelCatalog, aa as ModelShortcut, ab as ORCHESTRATOR_SHORTCUTS, ae as PlanModificationWarnings, ah as PlannerStartOptions, aj as PluginCloneFn, ak as PluginEntry, al as PluginFeatures, am as PluginMode, an as PluginModelDiscovery, ao as PluginRunnerDef, ap as PreparedLaunch, aq as PreparedTask, ar as ProviderCredentialSource, at as ProviderModelsResult, au as PtySize, av as PtyWrapOptions, aC as ResearchStep, aD as ResearchStepOutcome, aM as StreamEvent, aN as StreamStepEvent, aO as StreamThinkingEvent, aS as SubagentLogEntry, aT as SubagentOutcome, aW as TaskIsolationState, aX as TaskMode, aZ as TaskModeUnsupportedError, a_ as TaskModelAssignment, a$ as TaskOutputSummary,
|
|
3
|
-
import { t as TaskOp, l as SessionBroadcaster, A as ApplyTaskOpsResult, m as SessionMessage, n as SessionNotice, r as TaskLogEvent } from './plan-utils-
|
|
4
|
-
export { a as ApprovalBlock, b as ApprovalStatus, C as CHECKPOINT_TRUNCATE_LENGTH, c as ConversationInput, d as ConversationView, D as DisplayBlock, E as EMPTY_CONVERSATION, e as EMPTY_HOLD, f as EMPTY_TASK_LOG, G as GatedConversation, L as LocalEntry, M as MessageBlock, g as MessageRole, N as NO_TURN, O as OutputPreview, P as PlanBlock, h as PlanMarkerStatus, i as PromptHold, S as SerializedPlan, j as SerializedTask, k as SerializedTaskStatus, o as SubagentBlock, p as SubagentChild, q as SubagentStatus, T as TakenPrompt, s as TaskLogView, u as TaskRef, v as ThinkingDisplayBlock, w as ToolBlock, x as ToolHeadline, y as ToolStatus, z as TurnGate, U as UsageBlock, B as aheadOfDraft, F as applyTaskOps, H as canMergeTasks, I as canSetDependencies, J as canSplitTask, K as capConflictFiles, Q as classifyOutcome, R as coalesceTaskLog, V as dependencyCandidates, W as dependentsOf, X as drainNext, Y as executionSummary, Z as followTurn, _ as fromTranscript, $ as hasHiddenDetail, a0 as holdPrompt, a1 as outputLines, a2 as outputPreview, a3 as parseTaskOpsJson, a4 as reduceConversation, a5 as reduceTaskLog, a6 as replayTaskLog, a7 as runnerToolSubject, a8 as serializePlan, a9 as serializeTask, aa as serializeTaskStatus, ab as stopTurn, ac as summarizeToolCall, ad as taskStartedNotice, ae as textHasTaskOps, af as toTaskLogEvent, ag as toolHeadline, ah as trimToolOutput, ai as truncateCheckpointSummary, aj as unsendAll, ak as unsendLatest } from './plan-utils-
|
|
5
|
-
import { I as IFileSystem, R as ReadFileOpts, T as ToolOutcome, b as GrepOptions, a as GlobOptions, F as FindSymbolOptions } from './IFileSystem-
|
|
6
|
-
export { G as GREP_DEFAULT_HEAD_LIMIT, c as GrepOutputMode, S as SEARCH_EXCLUSIONS } from './IFileSystem-
|
|
7
|
-
import { R as RunnerModeInfo } from './ModeResolver
|
|
8
|
-
export { M as ManifestLookup, b as buildModeGuide, f as filteredBuildModes, r as resolveDefaultMode,
|
|
1
|
+
import { aG as RunnerId, ag as PlanStatus, a6 as LegacyPlanState, I as IApproval, k as ApprovalDecision, p as ApprovalRequest, j as ApprovalAnswer, L as ITerminalRunner, J as IConfig, h as AiProvider, as as ProviderModelLists, m as ApprovalMode, X as IsolationMergeResult, T as IsolationLandedTask, N as IWorktreeIsolation, a2 as IsolationTaskStatus, ad as PlanIsolation, aL as RunnerTransport, az as RepoGroupLayout, M as ITerminalSession, w as DiscoveredModel, aU as Task, f as AgentProcessDeps, c as AgentAdapter, aB as ResearchProgress, aA as ResearchLogEntry, u as ConversationMessage, b9 as UsageRecord, b1 as TaskSnapshot, r as AwaitingReason, Q as IsolationHandoff, $ as IsolationRun, a0 as IsolationTaskRecord, aV as TaskIsolation, a3 as IsolationView, Y as IsolationOutcome, ay as RepairEvidence, bg as Verdict, aJ as RunnerRegistry, ax as QueuedTaskMessage, aw as QueuedMessage, b as ActiveTaskSession, ac as OrchestratorOption, aY as TaskModeAgentAdapter, g as AgentStartOptions, e as AgentEvent, aE as ResearchToolType, ai as PlannerUsage, n as ApprovalPolicy, af as PlanState, aH as RunnerInvocation, A as AbstractRunner, a as AbstractTerminalSession, aQ as StructuredSessionCapability, b2 as TaskStartOptions, aR as StructuredTurnEnd, aP as StructuredEvent, aK as RunnerSpawnOptions, K as IPluginStore, aI as RunnerPluginManifest, aF as ResolveContext, b0 as TaskRunnerFlags } from './Task-CZJr6rmz.mjs';
|
|
2
|
+
export { d as AgentAdapterFactory, i as AllProviderModels, l as ApprovalKind, o as ApprovalPolicyOptions, q as ApprovalSource, B as BlockingPrompt, C as CMD_EXE_MAX_COMMAND_LINE, s as CatalogModel, t as CommandLineTooLongError, D as DENY_ALL, v as DiscoveredMode, x as DiscoveryCommand, E as EmbeddedNewlineError, y as ExecutableNotFoundError, F as FetchAllProviderModelsOptions, H as HeadlessRunner, z as HeadlessRunnerDeps, G as HeadlessSession, O as IntegrationDisposal, P as IsolationAvailability, R as IsolationHandoffRepo, S as IsolationInactiveReason, U as IsolationLanding, V as IsolationMergeBlock, W as IsolationMergeBlockReason, Z as IsolationPruneResult, _ as IsolationRepo, a1 as IsolationTaskRepo, a4 as LaunchDeps, a5 as LaunchPlan, a7 as LineBuffer, a8 as Message, a9 as ModelCatalog, aa as ModelShortcut, ab as ORCHESTRATOR_SHORTCUTS, ae as PlanModificationWarnings, ah as PlannerStartOptions, aj as PluginCloneFn, ak as PluginEntry, al as PluginFeatures, am as PluginMode, an as PluginModelDiscovery, ao as PluginRunnerDef, ap as PreparedLaunch, aq as PreparedTask, ar as ProviderCredentialSource, at as ProviderModelsResult, au as PtySize, av as PtyWrapOptions, aC as ResearchStep, aD as ResearchStepOutcome, aM as StreamEvent, aN as StreamStepEvent, aO as StreamThinkingEvent, aS as SubagentLogEntry, aT as SubagentOutcome, aW as TaskIsolationState, aX as TaskMode, aZ as TaskModeUnsupportedError, a_ as TaskModelAssignment, a$ as TaskOutputSummary, b3 as TaskStatus, b4 as TaskTransport, b5 as TaskType, b6 as TaskWithParent, b7 as ThinkingBlock, b8 as UsageLine, ba as UsageTotals, bb as UserPromptEntry, bc as UserStep, bd as ValidationCheck, be as ValidationContext, bf as ValidationResult, bh as VerificationCheck, bi as WINDOWS_MAX_COMMAND_LINE, bj as addPlannerUsage, bk as addTaskToPlan, bl as addUsage, bm as approvalScopes, bn as buildShellInvocation, bo as collectProviderCredentials, bp as createEmptyPlan, bq as createTask, br as emptyWarnings, bs as enabledRunners, bt as fetchAllProviderModels, bu as flattenTasks, bv as flattenTasksWithParents, bw as isAwaitingReason, bx as isExecutableResolved, by as isGranted, bz as isMeasured, bA as isReservedRunnerName, bB as isRunnerApproval, bC as isRunnerTransport, bD as isStructuredSession, bE as keepExecutionState, bF as knownModelId, bG as migrateLegacyPlan, bH as migratePlanState, bI as migrateTask, bJ as partedPromptUsage, bK as planDirectLaunch, bL as planShellLaunch, bM as plannerContextFill, bN as posixShellQuote, bO as removeTaskFromPlan, bP as renumberTasks, bQ as resolveModelShortcut, bR as resolveProvider, bS as stripAnsi, bT as toApprovalDecision, bU as toOrchestratorOptions, bV as updateTaskInPlan, bW as usageLine, bX as validateModifiedPlan, bY as warningsText, bZ as windowsCommandLine, b_ as wrapWithPty } from './Task-CZJr6rmz.mjs';
|
|
3
|
+
import { t as TaskOp, l as SessionBroadcaster, A as ApplyTaskOpsResult, m as SessionMessage, n as SessionNotice, r as TaskLogEvent } from './plan-utils-Ba-l8EZS.mjs';
|
|
4
|
+
export { a as ApprovalBlock, b as ApprovalStatus, C as CHECKPOINT_TRUNCATE_LENGTH, c as ConversationInput, d as ConversationView, D as DisplayBlock, E as EMPTY_CONVERSATION, e as EMPTY_HOLD, f as EMPTY_TASK_LOG, G as GatedConversation, L as LocalEntry, M as MessageBlock, g as MessageRole, N as NO_TURN, O as OutputPreview, P as PlanBlock, h as PlanMarkerStatus, i as PromptHold, S as SerializedPlan, j as SerializedTask, k as SerializedTaskStatus, o as SubagentBlock, p as SubagentChild, q as SubagentStatus, T as TakenPrompt, s as TaskLogView, u as TaskRef, v as ThinkingDisplayBlock, w as ToolBlock, x as ToolHeadline, y as ToolStatus, z as TurnGate, U as UsageBlock, B as aheadOfDraft, F as applyTaskOps, H as canMergeTasks, I as canSetDependencies, J as canSplitTask, K as capConflictFiles, Q as classifyOutcome, R as coalesceTaskLog, V as dependencyCandidates, W as dependentsOf, X as drainNext, Y as executionSummary, Z as followTurn, _ as fromTranscript, $ as hasHiddenDetail, a0 as holdPrompt, a1 as outputLines, a2 as outputPreview, a3 as parseTaskOpsJson, a4 as reduceConversation, a5 as reduceTaskLog, a6 as replayTaskLog, a7 as runnerToolSubject, a8 as serializePlan, a9 as serializeTask, aa as serializeTaskStatus, ab as stopTurn, ac as summarizeToolCall, ad as taskStartedNotice, ae as textHasTaskOps, af as toTaskLogEvent, ag as toolHeadline, ah as trimToolOutput, ai as truncateCheckpointSummary, aj as unsendAll, ak as unsendLatest } from './plan-utils-Ba-l8EZS.mjs';
|
|
5
|
+
import { I as IFileSystem, R as ReadFileOpts, T as ToolOutcome, b as GrepOptions, a as GlobOptions, F as FindSymbolOptions } from './IFileSystem-CFYf4yR2.mjs';
|
|
6
|
+
export { G as GREP_DEFAULT_HEAD_LIMIT, c as GrepOutputMode, S as SEARCH_EXCLUSIONS } from './IFileSystem-CFYf4yR2.mjs';
|
|
7
|
+
import { R as RunnerModeInfo } from './ModeResolver-a4xJFlEp.mjs';
|
|
8
|
+
export { M as ManifestLookup, a as autonomyLevelLabel, b as buildModeGuide, f as filteredBuildModes, p as parseAutonomyLevel, r as resolveDefaultMode, c as resolveTaskMode, d as runnerModesFrom } from './ModeResolver-a4xJFlEp.mjs';
|
|
9
9
|
import { ChildProcess } from 'child_process';
|
|
10
|
-
import { b as PlanParseError } from './parsing-
|
|
11
|
-
export { P as PLAN_ENVELOPE_KEY, a as PartialPlanTask, T as TASK_OPS_ENVELOPE_KEY, c as TASK_QUERY_ENVELOPE_KEY, d as checkDepsResolve, e as checkImmutableLog, f as checkInProgress, g as checkNoCycles, h as checkUniqueIds, i as escapeControlCharsInStrings, j as extractJsonObject, k as extractObjectWithBalance, l as extractObjectsWithKey, m as looksLikePlanAttempt, o as opensWithJsonObject, p as parsePartialPlan, n as parsePlanJson, s as stripModelNoise, q as stripTrailingCommas, v as validatePlanModification } from './parsing-
|
|
10
|
+
import { b as PlanParseError } from './parsing-DIaGZmiQ.mjs';
|
|
11
|
+
export { P as PLAN_ENVELOPE_KEY, a as PartialPlanTask, T as TASK_OPS_ENVELOPE_KEY, c as TASK_QUERY_ENVELOPE_KEY, d as checkDepsResolve, e as checkImmutableLog, f as checkInProgress, g as checkNoCycles, h as checkUniqueIds, i as escapeControlCharsInStrings, j as extractJsonObject, k as extractObjectWithBalance, l as extractObjectsWithKey, m as looksLikePlanAttempt, o as opensWithJsonObject, p as parsePartialPlan, n as parsePlanJson, s as stripModelNoise, q as stripTrailingCommas, v as validatePlanModification } from './parsing-DIaGZmiQ.mjs';
|
|
12
12
|
export { resolveOrderLabel, taskOrderLabel } from './order-labels.mjs';
|
|
13
13
|
import 'events';
|
|
14
14
|
|
|
@@ -261,16 +261,19 @@ declare abstract class BaseFileSystem implements IFileSystem {
|
|
|
261
261
|
* Path confinement for `bash`: an `auto`-tier binary (`cat`, `find`, `rg`, …)
|
|
262
262
|
* is only auto because *reading* is read-only — its arguments can still
|
|
263
263
|
* name a path outside the workspace, which is the exact escape confinement
|
|
264
|
-
* closes for `readFile`/`glob`/`grep`. Each escaping path
|
|
265
|
-
*
|
|
266
|
-
* approve another, so a single command touching two external dirs prompts
|
|
267
|
-
* once per distinct scope rather than carrying the first grant to the rest.
|
|
264
|
+
* closes for `readFile`/`glob`/`grep`. Each escaping path is scoped to its
|
|
265
|
+
* containing directory, one entry per distinct scope.
|
|
268
266
|
*/
|
|
269
|
-
private
|
|
267
|
+
private outsidePaths;
|
|
270
268
|
/**
|
|
271
269
|
* Three tiers (see `commandPolicy.ts`): read-only inspection runs silently,
|
|
272
270
|
* anything else asks once and is remembered, and writes are refused outright
|
|
273
271
|
* because a planner that mutates the workspace has stopped being a planner.
|
|
272
|
+
*
|
|
273
|
+
* Everything a command needs — its own approval and every outside directory
|
|
274
|
+
* it touches — is one request, so one command is one prompt. Each scope is
|
|
275
|
+
* still granted separately: approving the pair does not approve another
|
|
276
|
+
* directory the next command names.
|
|
274
277
|
*/
|
|
275
278
|
bash(command: string, signal?: AbortSignal): Promise<ToolOutcome>;
|
|
276
279
|
}
|
|
@@ -698,8 +701,8 @@ interface UserSettings {
|
|
|
698
701
|
*/
|
|
699
702
|
enabledRunners?: string[];
|
|
700
703
|
/**
|
|
701
|
-
* How tasks' runners are driven (ADR-0018).
|
|
702
|
-
*
|
|
704
|
+
* How tasks' runners are driven (ADR-0018). A run copies it onto its plan
|
|
705
|
+
* when it starts, so a change applies from the next run.
|
|
703
706
|
*/
|
|
704
707
|
runnerTransport: RunnerTransport;
|
|
705
708
|
}
|
|
@@ -718,6 +721,12 @@ declare class SettingsService {
|
|
|
718
721
|
private filePath;
|
|
719
722
|
private cache;
|
|
720
723
|
private cachedMtimeMs;
|
|
724
|
+
/**
|
|
725
|
+
* Whether the transport on disk (or just set) is the user's own choice.
|
|
726
|
+
* Writing the default back out would turn it into one, and a later change of
|
|
727
|
+
* default would then never reach this user.
|
|
728
|
+
*/
|
|
729
|
+
private transportChosen;
|
|
721
730
|
constructor(filePath?: string);
|
|
722
731
|
getAll(): UserSettings;
|
|
723
732
|
private fileMtimeMs;
|
|
@@ -2568,6 +2577,8 @@ declare abstract class StdioAgentAdapter implements AgentAdapter {
|
|
|
2568
2577
|
private betweenTurns;
|
|
2569
2578
|
/** Set once a turn has ended: after that, out-of-turn events are stale, not startup. */
|
|
2570
2579
|
private hadTurn;
|
|
2580
|
+
/** A task's session, which wants what the agent says on its own after a turn closed; a planner registers none and drops it. */
|
|
2581
|
+
private outOfTurnListener;
|
|
2571
2582
|
private disposed;
|
|
2572
2583
|
/** Resolves when the process ends, so a handshake can lose the race instead of waiting out its timeout. */
|
|
2573
2584
|
protected processEnded: Promise<void>;
|
|
@@ -2590,6 +2601,7 @@ declare abstract class StdioAgentAdapter implements AgentAdapter {
|
|
|
2590
2601
|
protected handshake(_opts: AgentStartOptions): Promise<void>;
|
|
2591
2602
|
start(opts: AgentStartOptions): Promise<void>;
|
|
2592
2603
|
send(message: string, onEvent: (event: AgentEvent) => void, signal?: AbortSignal, onActivity?: () => void): Promise<void>;
|
|
2604
|
+
onOutOfTurn(listener: (event: AgentEvent) => void): void;
|
|
2593
2605
|
nativeSessionId(): string | null;
|
|
2594
2606
|
onProcessExit(listener: (code: number) => void): void;
|
|
2595
2607
|
dispose(): void;
|
|
@@ -2639,6 +2651,18 @@ declare class ClaudeCodeAdapter extends StdioAgentAdapter implements TaskModeAge
|
|
|
2639
2651
|
private readonly openSubagents;
|
|
2640
2652
|
/** Subagent messages already counted. A message arrives as one line per content block, each repeating its usage. */
|
|
2641
2653
|
private readonly countedSubagentMessages;
|
|
2654
|
+
/** Background tasks (shells, agents) the CLI reports as still running, as of its last `background_tasks_changed`. */
|
|
2655
|
+
private backgroundTaskCount;
|
|
2656
|
+
/**
|
|
2657
|
+
* A task's turn whose `result` arrived while background work was still open.
|
|
2658
|
+
* The CLI reports that result when the model stops talking, then opens a turn
|
|
2659
|
+
* of its own when the work finishes; a turn ended at the first result would
|
|
2660
|
+
* lose everything said after it, the completion marker included.
|
|
2661
|
+
*/
|
|
2662
|
+
private resultHeld;
|
|
2663
|
+
private followOnTimer;
|
|
2664
|
+
/** The mode a task asked for, to hold the CLI to it once its `init` says what it started in. */
|
|
2665
|
+
private requestedMode;
|
|
2642
2666
|
/** The session `--resume` asked for, until the CLI's `init` shows it was taken up. */
|
|
2643
2667
|
private pendingResume;
|
|
2644
2668
|
protected spawnSpec(opts: AgentStartOptions): SpawnSpec;
|
|
@@ -2672,8 +2696,18 @@ declare class ClaudeCodeAdapter extends StdioAgentAdapter implements TaskModeAge
|
|
|
2672
2696
|
* a grant of Ordewell's making.
|
|
2673
2697
|
*/
|
|
2674
2698
|
answerPermission(id: string, decision: ApprovalDecision): boolean;
|
|
2699
|
+
dispose(): void;
|
|
2700
|
+
private clearFollowOnTimer;
|
|
2675
2701
|
protected turnPayload(message: string): string;
|
|
2676
2702
|
protected handleLine(line: string, emit: (event: AgentEvent) => void): void;
|
|
2703
|
+
/**
|
|
2704
|
+
* `--permission-mode auto` on a model or account without auto mode is not
|
|
2705
|
+
* refused: the CLI says nothing and starts in `default`, then asks about every
|
|
2706
|
+
* write — a request nobody is there to answer. The plan, not the CLI, decides
|
|
2707
|
+
* the mode (ADR-0001), so a different one fails the turn rather than running.
|
|
2708
|
+
*/
|
|
2709
|
+
private refuseOtherMode;
|
|
2710
|
+
private awaitFollowOnTurn;
|
|
2677
2711
|
private startSubagent;
|
|
2678
2712
|
/**
|
|
2679
2713
|
* A subagent's messages do not stream, so each line's usage is the snapshot
|
|
@@ -2706,8 +2740,10 @@ declare class ClaudeCodeAdapter extends StdioAgentAdapter implements TaskModeAge
|
|
|
2706
2740
|
}
|
|
2707
2741
|
|
|
2708
2742
|
/**
|
|
2709
|
-
* Codex as a planner
|
|
2710
|
-
*
|
|
2743
|
+
* Codex as a planner (ADR-0009) and as a task's runner (ADR-0018, #54), over
|
|
2744
|
+
* its `app-server` stdio JSON-RPC transport. The start switch decides the
|
|
2745
|
+
* thread's settings and who answers its requests; everything a turn reports
|
|
2746
|
+
* is read the same way for both.
|
|
2711
2747
|
*
|
|
2712
2748
|
* Ordewell already speaks a slice of this protocol — `ModelDiscovery` drives
|
|
2713
2749
|
* `initialize` → `model/list` to build the Codex model catalog — so the
|
|
@@ -2719,7 +2755,7 @@ declare class ClaudeCodeAdapter extends StdioAgentAdapter implements TaskModeAge
|
|
|
2719
2755
|
* version that renames them will surface as a visible dead turn rather than a
|
|
2720
2756
|
* hang, because the base class watches the process as well as the protocol.
|
|
2721
2757
|
*/
|
|
2722
|
-
declare class CodexAdapter extends StdioAgentAdapter {
|
|
2758
|
+
declare class CodexAdapter extends StdioAgentAdapter implements TaskModeAgentAdapter {
|
|
2723
2759
|
readonly agentId = "codex";
|
|
2724
2760
|
private threadId;
|
|
2725
2761
|
/** The model Codex opened the thread with — usage records name it. */
|
|
@@ -2730,6 +2766,28 @@ declare class CodexAdapter extends StdioAgentAdapter {
|
|
|
2730
2766
|
private startOpts;
|
|
2731
2767
|
/** Whether this turn has already emitted prose — see the `agentMessage` case. */
|
|
2732
2768
|
private turnHasText;
|
|
2769
|
+
/**
|
|
2770
|
+
* The turn in flight. Its id arrives with `turn/started` or the `turn/start`
|
|
2771
|
+
* response, whichever lands first; `turn/interrupt` cannot be sent without it.
|
|
2772
|
+
*/
|
|
2773
|
+
private turn;
|
|
2774
|
+
/** The JSON-RPC id of the `turn/start` that opened {@link turn}. */
|
|
2775
|
+
private turnRequestId;
|
|
2776
|
+
/** The last turn this adapter ended — so its second end signal, landing late, ends nothing. */
|
|
2777
|
+
private endedTurnId;
|
|
2778
|
+
/** An interrupt was asked for during this turn, so however it ends, it was cut short. */
|
|
2779
|
+
private interruptRequested;
|
|
2780
|
+
/** An interrupt asked for before Codex named the turn, sent once it does. */
|
|
2781
|
+
private interruptOnStart;
|
|
2782
|
+
/** A task's approval requests still waiting for an answer, by the request id as a string. */
|
|
2783
|
+
private readonly openPermissions;
|
|
2784
|
+
/**
|
|
2785
|
+
* The files each in-flight `fileChange` item touches. Its approval request
|
|
2786
|
+
* names only the item, and a person deciding needs to see the files.
|
|
2787
|
+
*/
|
|
2788
|
+
private readonly fileChangePaths;
|
|
2789
|
+
/** Requests this adapter sent and awaits an answer to, by JSON-RPC id. */
|
|
2790
|
+
private readonly pendingRequests;
|
|
2733
2791
|
private resumeAttempted;
|
|
2734
2792
|
private resumeFallbackSent;
|
|
2735
2793
|
private sandbox;
|
|
@@ -2739,26 +2797,43 @@ declare class CodexAdapter extends StdioAgentAdapter {
|
|
|
2739
2797
|
* one stream; the thread id is what tells them apart (see {@link subagentOf}).
|
|
2740
2798
|
*/
|
|
2741
2799
|
private readonly subagents;
|
|
2742
|
-
/** Codex only plans for now (#54): its tasks stay on the terminal transport. */
|
|
2743
|
-
start(opts: AgentStartOptions): Promise<void>;
|
|
2744
2800
|
protected spawnSpec(opts: AgentStartOptions): SpawnSpec;
|
|
2745
2801
|
/**
|
|
2746
|
-
* `initialize`, then `thread/start`, both before the first user message.
|
|
2747
|
-
* thread is pinned to the read-only sandbox with approvals set to
|
|
2748
|
-
* with nobody watching a planner's prompts, "ask" would mean
|
|
2749
|
-
* ADR-0008's absent-is-denial invariant kept by
|
|
2802
|
+
* `initialize`, then `thread/start`, both before the first user message. A
|
|
2803
|
+
* planner's thread is pinned to the read-only sandbox with approvals set to
|
|
2804
|
+
* `never` — with nobody watching a planner's prompts, "ask" would mean
|
|
2805
|
+
* "hang", which is ADR-0008's absent-is-denial invariant kept by
|
|
2806
|
+
* construction. A task's runs as its mode says (see {@link threadParams}).
|
|
2750
2807
|
*/
|
|
2751
2808
|
protected handshake(opts: AgentStartOptions): Promise<void>;
|
|
2752
2809
|
/**
|
|
2753
|
-
* Open
|
|
2810
|
+
* Open this session's thread. A resume id means the previous
|
|
2754
2811
|
* process died mid-session: `thread/resume` puts the agent back in front of
|
|
2755
|
-
* the context it already paid to read. A failed resume is not an
|
|
2756
|
-
* response handler falls back to a fresh thread, which is the
|
|
2757
|
-
* degradation `restoreChat` performs on every surface (T4).
|
|
2812
|
+
* the context it already paid to read. A planner's failed resume is not an
|
|
2813
|
+
* error — the response handler falls back to a fresh thread, which is the
|
|
2814
|
+
* same degradation `restoreChat` performs on every surface (T4). A task's
|
|
2815
|
+
* is: Continue (K1) offers the session that did the work, and a fresh thread
|
|
2816
|
+
* in its place would pretend it was resumed.
|
|
2758
2817
|
*/
|
|
2759
2818
|
private startThread;
|
|
2819
|
+
private threadParams;
|
|
2820
|
+
private effort;
|
|
2821
|
+
/**
|
|
2822
|
+
* `turn/interrupt` names the turn as well as the thread, so an interrupt
|
|
2823
|
+
* asked for before Codex has named the turn waits for it. Codex acknowledges
|
|
2824
|
+
* with an empty result, then ends the turn as `interrupted`.
|
|
2825
|
+
*/
|
|
2826
|
+
interrupt(timeoutMs: number): Promise<boolean>;
|
|
2827
|
+
/**
|
|
2828
|
+
* Answer an open approval in its own result schema. Codex's decline carries
|
|
2829
|
+
* no message, so a deny note reaches the agent as input steered into the
|
|
2830
|
+
* running turn.
|
|
2831
|
+
*/
|
|
2832
|
+
answerPermission(id: string, decision: ApprovalDecision): boolean;
|
|
2760
2833
|
protected turnPayload(message: string): string;
|
|
2761
2834
|
protected handleLine(line: string, emit: (event: AgentEvent) => void): void;
|
|
2835
|
+
private turnStarted;
|
|
2836
|
+
private closeTurn;
|
|
2762
2837
|
/**
|
|
2763
2838
|
* The child thread id when `threadId` names a subagent's thread, or undefined
|
|
2764
2839
|
* for the planner's own. Codex replays both threads on one stream and only
|
|
@@ -2779,6 +2854,14 @@ declare class CodexAdapter extends StdioAgentAdapter {
|
|
|
2779
2854
|
* not added a second time. Codex reports no price.
|
|
2780
2855
|
*/
|
|
2781
2856
|
private emitUsage;
|
|
2857
|
+
/**
|
|
2858
|
+
* A task's server→client request. An approval stays open for someone to
|
|
2859
|
+
* answer (ADR-0018, A1); everything else is answered at once, because an
|
|
2860
|
+
* unanswered request stalls the turn forever.
|
|
2861
|
+
*/
|
|
2862
|
+
private openTaskRequest;
|
|
2863
|
+
/** The request as a person sees it, led by the field that says what it is about. */
|
|
2864
|
+
private approvalInput;
|
|
2782
2865
|
/**
|
|
2783
2866
|
* Refuse one server→client request. Requests whose result schema can express
|
|
2784
2867
|
* a refusal get that payload; everything else — a permission grant, a
|
|
@@ -2804,7 +2887,8 @@ declare class CodexAdapter extends StdioAgentAdapter {
|
|
|
2804
2887
|
}
|
|
2805
2888
|
|
|
2806
2889
|
/**
|
|
2807
|
-
* OpenCode as a planner, over its headless HTTP server
|
|
2890
|
+
* OpenCode as a planner or a task runner, over its headless HTTP server
|
|
2891
|
+
* (ADR-0009, ADR-0018).
|
|
2808
2892
|
*
|
|
2809
2893
|
* The odd one out: `opencode serve` is a real server rather than a stdio
|
|
2810
2894
|
* protocol, so this adapter owns both halves of the boundary — it spawns the
|
|
@@ -2812,31 +2896,80 @@ declare class CodexAdapter extends StdioAgentAdapter {
|
|
|
2812
2896
|
* talks to it through the injected `fetch`. Both are part of the one seam the
|
|
2813
2897
|
* tests drive.
|
|
2814
2898
|
*
|
|
2815
|
-
*
|
|
2899
|
+
* A planner turn ends when the message POST resolves, and its response is the
|
|
2816
2900
|
* authoritative copy of the reply's last message. Everything else — reply text
|
|
2817
2901
|
* as it streams, earlier model calls' text and reasoning, per-call usage, the
|
|
2818
2902
|
* subagents a `task` call runs — arrives only on the server's `/event` channel.
|
|
2819
2903
|
* An event name that changes between OpenCode versions therefore costs that
|
|
2820
|
-
* detail, never the final reply.
|
|
2904
|
+
* detail, never the final reply. A task turn is posted asynchronously and read
|
|
2905
|
+
* entirely from the stream — see {@link sendTask}.
|
|
2821
2906
|
*/
|
|
2822
|
-
declare class OpenCodeAdapter implements
|
|
2907
|
+
declare class OpenCodeAdapter implements TaskModeAgentAdapter {
|
|
2823
2908
|
private deps;
|
|
2824
2909
|
readonly agentId = "opencode";
|
|
2825
2910
|
private process;
|
|
2826
2911
|
private baseUrl;
|
|
2912
|
+
/** Sent on every request to a task's server, which a per-task password secures. */
|
|
2913
|
+
private authorization;
|
|
2827
2914
|
private sessionId;
|
|
2828
2915
|
private stderrTail;
|
|
2829
2916
|
private exited;
|
|
2917
|
+
private exitCode;
|
|
2830
2918
|
private disposed;
|
|
2831
|
-
private
|
|
2919
|
+
private markEnded;
|
|
2920
|
+
private readonly processEnded;
|
|
2921
|
+
private planner;
|
|
2922
|
+
private task;
|
|
2832
2923
|
/** Whether this turn has already emitted reply text — see {@link emitPart}. */
|
|
2833
2924
|
private turnHasText;
|
|
2834
2925
|
/** The last assistant message already settled — the baseline {@link recoverReply} measures a new reply against. */
|
|
2835
2926
|
private lastAssistantId;
|
|
2927
|
+
private taskTurn;
|
|
2928
|
+
/** An abort was posted during the current task turn, so the idle that follows ends it as interrupted. */
|
|
2929
|
+
private interruptRequested;
|
|
2930
|
+
/** A task's requests waiting for an answer, by request id, with the session that asked. */
|
|
2931
|
+
private readonly openPermissions;
|
|
2836
2932
|
constructor(deps: AgentProcessDeps);
|
|
2837
|
-
|
|
2838
|
-
start(options: AgentStartOptions): Promise<void>;
|
|
2933
|
+
start(opts: AgentStartOptions): Promise<void>;
|
|
2839
2934
|
send(message: string, onEvent: (event: AgentEvent) => void, signal?: AbortSignal, onActivity?: () => void): Promise<void>;
|
|
2935
|
+
/**
|
|
2936
|
+
* One task turn. `prompt_async` only queues the work, so the turn is over
|
|
2937
|
+
* when the session goes idle — OpenCode's own `run` rules: an idle frame
|
|
2938
|
+
* counts once `/session/status` confirms it, because a late idle can belong
|
|
2939
|
+
* to the turn before, and {@link pollStatus} stands behind the stream,
|
|
2940
|
+
* which can miss a status frame. No request is held open for the turn, so
|
|
2941
|
+
* fetch's 300s header timeout, the planner's reason for
|
|
2942
|
+
* {@link recoverReply}, never applies.
|
|
2943
|
+
*/
|
|
2944
|
+
private sendTask;
|
|
2945
|
+
/**
|
|
2946
|
+
* Whatever of the turn's own messages the stream missed. Each part is
|
|
2947
|
+
* emitted once, so a turn the stream saw whole adds nothing here; one that
|
|
2948
|
+
* lost its last text part still reaches the plain-text channel, where the
|
|
2949
|
+
* done marker is looked for.
|
|
2950
|
+
*/
|
|
2951
|
+
private readBack;
|
|
2952
|
+
/**
|
|
2953
|
+
* The stream can drop a status frame while still delivering the rest, so a
|
|
2954
|
+
* task turn also reads the status itself. A busy session is this turn's own
|
|
2955
|
+
* work as surely as a frame is.
|
|
2956
|
+
*/
|
|
2957
|
+
private pollStatus;
|
|
2958
|
+
/** An idle frame ends the turn only if the server agrees now. When it will not say, the frame is trusted, as upstream trusts it. */
|
|
2959
|
+
private confirmIdle;
|
|
2960
|
+
/** Whether the task's session is working, or null when the server will not say. A session absent from the map is idle. */
|
|
2961
|
+
private sessionBusy;
|
|
2962
|
+
/** What a frame of the task's own session says about the turn's end. */
|
|
2963
|
+
private followTaskTurn;
|
|
2964
|
+
/**
|
|
2965
|
+
* Abort the running turn, keeping the server and its session. OpenCode
|
|
2966
|
+
* acknowledges by going idle, which is also what ends the turn — as
|
|
2967
|
+
* interrupted, because the request is remembered.
|
|
2968
|
+
*/
|
|
2969
|
+
interrupt(timeoutMs: number): Promise<boolean>;
|
|
2970
|
+
onProcessExit(listener: (code: number) => void): void;
|
|
2971
|
+
answerPermission(id: string, decision: ApprovalDecision): boolean;
|
|
2972
|
+
private role;
|
|
2840
2973
|
/**
|
|
2841
2974
|
* Turn one settled assistant message into events. The settled response is
|
|
2842
2975
|
* authoritative: it names the assistant message, so its parts are the ones
|
|
@@ -2905,6 +3038,27 @@ declare class OpenCodeAdapter implements AgentAdapter {
|
|
|
2905
3038
|
* shows the planner reaching for something it may not have.
|
|
2906
3039
|
*/
|
|
2907
3040
|
private denyPermission;
|
|
3041
|
+
/**
|
|
3042
|
+
* A task's request. Under a mode whose manifest sets `approvals: auto` —
|
|
3043
|
+
* `build`, which the terminal transport runs with `--auto` — it is answered
|
|
3044
|
+
* at once with what `run --auto` answers, so the same plan behaves the same
|
|
3045
|
+
* on both transports (ADR-0001), and announced already decided so the log
|
|
3046
|
+
* still shows it. Any other mode leaves it open for an approval card.
|
|
3047
|
+
*/
|
|
3048
|
+
private askPermission;
|
|
3049
|
+
/**
|
|
3050
|
+
* `POST /permission/:id/reply` is the current answer. The per-session path
|
|
3051
|
+
* it replaced is tried only when a server too old to know the new one 404s.
|
|
3052
|
+
*/
|
|
3053
|
+
private replyPermission;
|
|
3054
|
+
/**
|
|
3055
|
+
* Open `/event` for one turn and wait until it is connected. The stream
|
|
3056
|
+
* stopped being best-effort the moment permission answers moved onto it: a
|
|
3057
|
+
* request raised before we connect is one nobody answers, and the turn
|
|
3058
|
+
* hangs on it. Waiting is bounded so a server that never opens `/event`
|
|
3059
|
+
* still gets its turn.
|
|
3060
|
+
*/
|
|
3061
|
+
private openStream;
|
|
2908
3062
|
/**
|
|
2909
3063
|
* Server-sent events from `/event`: the turn's live text, reasoning, tool
|
|
2910
3064
|
* activity and usage, and the only channel permission requests arrive on —
|
|
@@ -2912,6 +3066,8 @@ declare class OpenCodeAdapter implements AgentAdapter {
|
|
|
2912
3066
|
*/
|
|
2913
3067
|
private streamEvents;
|
|
2914
3068
|
private json;
|
|
3069
|
+
private request;
|
|
3070
|
+
private headers;
|
|
2915
3071
|
nativeSessionId(): string | null;
|
|
2916
3072
|
dispose(): void;
|
|
2917
3073
|
private exitMessage;
|
|
@@ -4625,7 +4781,16 @@ declare class StructuredSession extends AbstractTerminalSession implements Struc
|
|
|
4625
4781
|
*/
|
|
4626
4782
|
private restartInterrupted;
|
|
4627
4783
|
private startAdapter;
|
|
4784
|
+
private openTurn;
|
|
4628
4785
|
private deliver;
|
|
4786
|
+
private route;
|
|
4787
|
+
/**
|
|
4788
|
+
* The runner spoke with no message of ours in flight. When it is working — a
|
|
4789
|
+
* turn it opened itself once background work finished — that is a turn of the
|
|
4790
|
+
* task like any other: the state says working, a queued message waits, and its
|
|
4791
|
+
* end settles it. A message with no text in `turn_start` marks it as not ours.
|
|
4792
|
+
*/
|
|
4793
|
+
private handleOutOfTurn;
|
|
4629
4794
|
private openPermission;
|
|
4630
4795
|
private cancelPermission;
|
|
4631
4796
|
private handleEvent;
|
|
@@ -5007,14 +5172,11 @@ declare function resolveArgs(manifest: RunnerPluginManifest, ctx: ResolveContext
|
|
|
5007
5172
|
/**
|
|
5008
5173
|
* The manifest's meaning of a task's mode and effort, for a runner driven over
|
|
5009
5174
|
* its programmatic protocol rather than a command line built from
|
|
5010
|
-
* `argsTemplate` (ADR-0018, C1).
|
|
5011
|
-
* gate as the template path
|
|
5012
|
-
*
|
|
5175
|
+
* `argsTemplate` (ADR-0018, C1). The effort stays a raw id behind the same
|
|
5176
|
+
* `{{if thinking}}` gate as the template path: how an effort reaches the
|
|
5177
|
+
* runner is protocol, which each adapter owns.
|
|
5013
5178
|
*/
|
|
5014
|
-
declare function resolveTaskRunnerFlags(manifest: RunnerPluginManifest, ctx: Pick<ResolveContext, 'mode' | 'model' | 'thinkingEffort'>):
|
|
5015
|
-
permissionMode: string;
|
|
5016
|
-
effortArgs: string[];
|
|
5017
|
-
};
|
|
5179
|
+
declare function resolveTaskRunnerFlags(manifest: RunnerPluginManifest, ctx: Pick<ResolveContext, 'mode' | 'model' | 'thinkingEffort'>): TaskRunnerFlags;
|
|
5018
5180
|
|
|
5019
5181
|
declare const CLAUDE_CODE_MANIFEST: RunnerPluginManifest;
|
|
5020
5182
|
|
|
@@ -5145,4 +5307,4 @@ declare const DEFAULT_MAX_PARALLEL = 3;
|
|
|
5145
5307
|
*/
|
|
5146
5308
|
declare function parseMaxParallel(value: unknown): number | null;
|
|
5147
5309
|
|
|
5148
|
-
export { ALLOWED_PLUGIN_HOSTS, ALL_PROVIDERS, AUTO_COMMANDS, AbstractRunner, AbstractTerminalSession, ActiveTaskSession, type Adr0013IsolationRun, type Adr0013PlanIsolation, type Adr0013TaskRecord, AgentAdapter, AgentEvent, AgentProcessDeps, AgentStartOptions, AiProvider, ApplyTaskOpsResult, ApprovalAnswer, ApprovalDecision, ApprovalMode, ApprovalPolicy, ApprovalRequest, type AskOptions, AwaitingReason, BUILTIN_SKILL_NAMES, BaseAiService, BaseConfig, BaseFileSystem, BufferedTaskOutputSource, CLAUDE_CODE_MANIFEST, CLI_PROVIDERS, CORE_PLANNER_PROMPT, type CappedRows, type CheckpointListener, ClaudeCodeAdapter, CliAgentAiService, type CliAgentAiServiceDeps, CodexAdapter, type CommandClassification, type CommandTier, type ComposeOptions, ConsoleLogger, ContextCollector, type Continuability, ConversationBusyError, type ConversationCompaction, ConversationEditError, type ConversationFork, ConversationMessage, type ConversationRequest, type ConversationRewind, type ConversationTurn, type ConversationVariant, DAEMON_SUBPROTOCOL, DAEMON_TOKEN_SUBPROTOCOL_PREFIX, DEFAULT_MAX_PARALLEL, DiscoveredModel, type EnvAdmission, EnvConfig, type ExecFileFn, type ExecImpl, FindSymbolOptions, FsPluginStore, GIT_READONLY_SUBCOMMANDS, GeminiService, type GitExecFn, GlobOptions, type GrepInvocation, GrepOptions, type HasBinFn, HomeTranscriptReader, type IAiService, IApproval, IConfig, IFileSystem, type ILogger, type INotification, IPluginStore, ITerminalRunner, ITerminalSession, IWorktreeIsolation, IsolationHandoff, IsolationLandedTask, IsolationMergeResult, IsolationOutcome, IsolationRun, IsolationTaskRecord, IsolationTaskStatus, IsolationView, JSON_REPAIR_INSTRUCTION, type KillTreeDeps, LegacyPlanState, type LiveOutputLookup, type LiveTail, type LiveTailOptions, type MappedTool, ModelResolver, type ModelResolverDeps, type ModifyPlanRequest, type NotificationAction, OPENCODE_MANIFEST, ORDEWELL_SETTABLE_ENV, OUTPUT_LINES_DEFAULT, OUTPUT_LINES_MAX, OpenAiService, OpenCodeAdapter, type OrchestratorObserver, OrchestratorOption, PLUGIN_NAME_PATTERN, PROVIDER_CREDENTIAL_ENV, PROVIDER_DETECT_PRIORITY, PROVIDER_LABEL, PROVIDER_PRIORITY, PROVIDER_SHORT_LABEL, type PendingApproval, PendingApprovals, type PendingApprovalsOptions, PlanEditError, PlanIsolation, PlanParseError, type PlanRequest, PlanState, PlanStatus, PlanStore, Planner, type PlannerModelCandidate, type PlannerModelChoice, PlannerModelMemory, type PlannerModelRecall, type PlannerModelStore, type PlannerReplyClassification, type PlannerRuntimeToggles, PlannerUsage, type PluginSource, type PrdBlock, type PriorOutput, type ProbeFn, ProviderModelLists, type ProviderRegistration, QueuedMessage, QueuedTaskMessage, REFUSED_COMMANDS, ReadFileOpts, RepairEvidence, type RepairLoopOpts, type RepairVerdict, RepoGroupLayout, type ResearchChat, ResearchLogEntry, ResearchProgress, type ResearchShell, type ResearchShellDeps, ResearchToolType, type ResearchTurn, ResolveContext, type RewindTarget, RunnerApprovals, type RunnerCatalog, RunnerId, RunnerInstallation, RunnerInvocation, type RunnerMode, RunnerModeInfo, RunnerPluginManifest, RunnerRegistry, RunnerSpawnOptions, RunnerTransport, SETTINGS_ENV_ALLOWLIST, SETTINGS_ENV_REFUSED, STATE_DIR, STOPPED_TOOL_RESULT, SYMBOL_LANGUAGES, type SaveSession, Session, SessionBroadcaster, type SessionData, type SessionDeps, SessionMessage, type SessionMeta, SessionNotice, type SessionPlanner, type SessionRuntimeSettings, SettingsService, type ShellDialect, type SkillInfo, type SkillMetadata, SkillsService, type SpawnSpec, StdioAgentAdapter, StructuredEvent, StructuredRunner, type StructuredRunnerDeps, StructuredSession, StructuredSessionCapability, StructuredTurnEnd, TASK_QUERY_ANSWER_MAX_CHARS, TASK_QUERY_ANSWER_OR_OPS, TASK_QUERY_FIELDS, TASK_QUERY_PROTOCOL, TASK_QUERY_REMINDER, TRUNCATED_PLAN_REPAIR_INSTRUCTION, Task, type TaskAttemptSnapshot, TaskControlError, TaskIsolation, TaskLogEvent, type TaskLogFile, type TaskLogLocation, TaskLogRecorder, type TaskLogRecorderDeps, TaskModeAgentAdapter, TaskOp, TaskOrchestrator, type TaskOrchestratorDeps, type TaskOrchestratorOptions, type TaskOutputAttempt, type TaskOutputSource, type TaskQuery, type TaskQueryCatalog, type TaskQueryField, TaskSnapshot, TaskStartOptions, TmuxRunner, type TmuxRunnerDeps, type TokenCarriers, type ToolCall, ToolOutcome, type ToolResult, type TranscriptQuery, type TranscriptReader, type TransportRoute, TransportRouter, UsageRecord, type UserSettings, Verdict, VerdictEngine, type VerdictListener, type WorkspaceCheckDeps, WorkspaceNotAProjectError, WorkspaceNotFoundError, type WorkspaceProjectCheckDeps, type WorktreeIsolationDeps, admitSettingsEnv, applyHeadLimit, assertInstallablePluginUrl, assertPlainPluginName, assertWorkspaceExists, assertWorkspaceIsProject, augmentPromptWithPriorOutputs, augmentedPath, bearerHeaderValue, buildConflictRepairPrompt, buildConflictResolutionPrompt, buildConversationSystemPrompt, buildFallbackGrepArgs, buildGlobArgs, buildGrepArgs, buildMergePrompt, buildModifyDuringExecutionPrompt, buildModifyPlanPrompt, buildPlanWithResults, buildResearchPrompt, buildResearchToolsPrompt, buildRunnerInvocation, buildSplitPrompt, buildSubagentSystemPrompt, canContinue, clampThinkingEffort, classifyCommand, classifyPlannerReply, classifyPluginSource, clearAugmentedPathCache, clearDaemonToken, clearResearchShellCache, clearState, clipboardCopyCommand, coerceAssignments, collectDirectDependencyOutputs, composeAugmentedPrompt, composeContinuationPrompt, configuredProviders, continuability, createAiService, createSession, createSkillsService, createTaskAdapter, createTaskOrchestrator, createWorktreeIsolation, daemonTokenPath, defaultLogger, definitionPattern, deleteSession, describeMergeResult, discoverGeminiModels, effectiveAllowlist, ensureDir, ensurePrivateDir, ensureStateDirIgnored, executionLogBlock, extractPrdBlock, extractPresentedToken, filterFallbackByAnchoredInclude, filterModelsForPrompt, formatSearchOutput, generatePlanWithRepair, getLatestSession, getProviderMeta, getSettingsPath, getStateDir, globalDataDir, grantScopeFor, hasTmux, idSegment, includeGlobFor, isCliProvider, isOpenAiProvider, isPlainPluginName, isValidManifest, killTree, languageForId, listSessions, listTaskLogAttempts, loadSession, loadSessionPlanState, loadState, mapAgentTool, migrateOldConfigDir, migratePlanIsolation, mintDaemonToken, mintSessionId, modelContextBlock, modifyValidationFeedback, normalizeAgentArgs, normalizeGeminiModel, openTaskLog, parseMaxParallel, parseTaskQueryJson, pendingEditRulesBlock, prefixModelId, providerForRunner, reEmitPlanPrompt, reEmitTaskOpsPrompt, reEmitTaskQueryPrompt, readDaemonToken, readTaskLog, referencePattern, renderPlanMap, renderPriorOutputs, renderTaskQueryAnswer, repairLoop, researchShellWarning, researchToolsPath, resolveArgs, resolvePluginInstallDir, resolveProviderFromPrefix, resolveResearchShell, resolveSkillInvocation, resolveTaskRunnerFlags, resolveWithin, retargetTaskRunner, routeTransport, runnerAssignment, runnerForProvider, sanitizeSlug, savePrdMarkdown, saveSession, saveState, sessionDataDir, sessionRuntimeSettings, stateExists, stripModelPrefix, summarizeOutput, supportsTaskMode, taskOpsRejectedPrompt, taskQuerySignature, textHasTaskQuery, tmuxSessionName, tmuxSocketName, tmuxWindowName, tokenSubprotocols, tokensMatch, truncatedPlanReEmitPrompt, wellKnownBinDirs, withPath, writePrivateFile };
|
|
5310
|
+
export { ALLOWED_PLUGIN_HOSTS, ALL_PROVIDERS, AUTO_COMMANDS, AbstractRunner, AbstractTerminalSession, ActiveTaskSession, type Adr0013IsolationRun, type Adr0013PlanIsolation, type Adr0013TaskRecord, AgentAdapter, AgentEvent, AgentProcessDeps, AgentStartOptions, AiProvider, ApplyTaskOpsResult, ApprovalAnswer, ApprovalDecision, ApprovalMode, ApprovalPolicy, ApprovalRequest, type AskOptions, AwaitingReason, BUILTIN_SKILL_NAMES, BaseAiService, BaseConfig, BaseFileSystem, BufferedTaskOutputSource, CLAUDE_CODE_MANIFEST, CLI_PROVIDERS, CORE_PLANNER_PROMPT, type CappedRows, type CheckpointListener, ClaudeCodeAdapter, CliAgentAiService, type CliAgentAiServiceDeps, CodexAdapter, type CommandClassification, type CommandTier, type ComposeOptions, ConsoleLogger, ContextCollector, type Continuability, ConversationBusyError, type ConversationCompaction, ConversationEditError, type ConversationFork, ConversationMessage, type ConversationRequest, type ConversationRewind, type ConversationTurn, type ConversationVariant, DAEMON_SUBPROTOCOL, DAEMON_TOKEN_SUBPROTOCOL_PREFIX, DEFAULT_MAX_PARALLEL, DiscoveredModel, type EnvAdmission, EnvConfig, type ExecFileFn, type ExecImpl, FindSymbolOptions, FsPluginStore, GIT_READONLY_SUBCOMMANDS, GeminiService, type GitExecFn, GlobOptions, type GrepInvocation, GrepOptions, type HasBinFn, HomeTranscriptReader, type IAiService, IApproval, IConfig, IFileSystem, type ILogger, type INotification, IPluginStore, ITerminalRunner, ITerminalSession, IWorktreeIsolation, IsolationHandoff, IsolationLandedTask, IsolationMergeResult, IsolationOutcome, IsolationRun, IsolationTaskRecord, IsolationTaskStatus, IsolationView, JSON_REPAIR_INSTRUCTION, type KillTreeDeps, LegacyPlanState, type LiveOutputLookup, type LiveTail, type LiveTailOptions, type MappedTool, ModelResolver, type ModelResolverDeps, type ModifyPlanRequest, type NotificationAction, OPENCODE_MANIFEST, ORDEWELL_SETTABLE_ENV, OUTPUT_LINES_DEFAULT, OUTPUT_LINES_MAX, OpenAiService, OpenCodeAdapter, type OrchestratorObserver, OrchestratorOption, PLUGIN_NAME_PATTERN, PROVIDER_CREDENTIAL_ENV, PROVIDER_DETECT_PRIORITY, PROVIDER_LABEL, PROVIDER_PRIORITY, PROVIDER_SHORT_LABEL, type PendingApproval, PendingApprovals, type PendingApprovalsOptions, PlanEditError, PlanIsolation, PlanParseError, type PlanRequest, PlanState, PlanStatus, PlanStore, Planner, type PlannerModelCandidate, type PlannerModelChoice, PlannerModelMemory, type PlannerModelRecall, type PlannerModelStore, type PlannerReplyClassification, type PlannerRuntimeToggles, PlannerUsage, type PluginSource, type PrdBlock, type PriorOutput, type ProbeFn, ProviderModelLists, type ProviderRegistration, QueuedMessage, QueuedTaskMessage, REFUSED_COMMANDS, ReadFileOpts, RepairEvidence, type RepairLoopOpts, type RepairVerdict, RepoGroupLayout, type ResearchChat, ResearchLogEntry, ResearchProgress, type ResearchShell, type ResearchShellDeps, ResearchToolType, type ResearchTurn, ResolveContext, type RewindTarget, RunnerApprovals, type RunnerCatalog, RunnerId, RunnerInstallation, RunnerInvocation, type RunnerMode, RunnerModeInfo, RunnerPluginManifest, RunnerRegistry, RunnerSpawnOptions, RunnerTransport, SETTINGS_ENV_ALLOWLIST, SETTINGS_ENV_REFUSED, STATE_DIR, STOPPED_TOOL_RESULT, SYMBOL_LANGUAGES, type SaveSession, Session, SessionBroadcaster, type SessionData, type SessionDeps, SessionMessage, type SessionMeta, SessionNotice, type SessionPlanner, type SessionRuntimeSettings, SettingsService, type ShellDialect, type SkillInfo, type SkillMetadata, SkillsService, type SpawnSpec, StdioAgentAdapter, StructuredEvent, StructuredRunner, type StructuredRunnerDeps, StructuredSession, StructuredSessionCapability, StructuredTurnEnd, TASK_QUERY_ANSWER_MAX_CHARS, TASK_QUERY_ANSWER_OR_OPS, TASK_QUERY_FIELDS, TASK_QUERY_PROTOCOL, TASK_QUERY_REMINDER, TRUNCATED_PLAN_REPAIR_INSTRUCTION, Task, type TaskAttemptSnapshot, TaskControlError, TaskIsolation, TaskLogEvent, type TaskLogFile, type TaskLogLocation, TaskLogRecorder, type TaskLogRecorderDeps, TaskModeAgentAdapter, TaskOp, TaskOrchestrator, type TaskOrchestratorDeps, type TaskOrchestratorOptions, type TaskOutputAttempt, type TaskOutputSource, type TaskQuery, type TaskQueryCatalog, type TaskQueryField, TaskRunnerFlags, TaskSnapshot, TaskStartOptions, TmuxRunner, type TmuxRunnerDeps, type TokenCarriers, type ToolCall, ToolOutcome, type ToolResult, type TranscriptQuery, type TranscriptReader, type TransportRoute, TransportRouter, UsageRecord, type UserSettings, Verdict, VerdictEngine, type VerdictListener, type WorkspaceCheckDeps, WorkspaceNotAProjectError, WorkspaceNotFoundError, type WorkspaceProjectCheckDeps, type WorktreeIsolationDeps, admitSettingsEnv, applyHeadLimit, assertInstallablePluginUrl, assertPlainPluginName, assertWorkspaceExists, assertWorkspaceIsProject, augmentPromptWithPriorOutputs, augmentedPath, bearerHeaderValue, buildConflictRepairPrompt, buildConflictResolutionPrompt, buildConversationSystemPrompt, buildFallbackGrepArgs, buildGlobArgs, buildGrepArgs, buildMergePrompt, buildModifyDuringExecutionPrompt, buildModifyPlanPrompt, buildPlanWithResults, buildResearchPrompt, buildResearchToolsPrompt, buildRunnerInvocation, buildSplitPrompt, buildSubagentSystemPrompt, canContinue, clampThinkingEffort, classifyCommand, classifyPlannerReply, classifyPluginSource, clearAugmentedPathCache, clearDaemonToken, clearResearchShellCache, clearState, clipboardCopyCommand, coerceAssignments, collectDirectDependencyOutputs, composeAugmentedPrompt, composeContinuationPrompt, configuredProviders, continuability, createAiService, createSession, createSkillsService, createTaskAdapter, createTaskOrchestrator, createWorktreeIsolation, daemonTokenPath, defaultLogger, definitionPattern, deleteSession, describeMergeResult, discoverGeminiModels, effectiveAllowlist, ensureDir, ensurePrivateDir, ensureStateDirIgnored, executionLogBlock, extractPrdBlock, extractPresentedToken, filterFallbackByAnchoredInclude, filterModelsForPrompt, formatSearchOutput, generatePlanWithRepair, getLatestSession, getProviderMeta, getSettingsPath, getStateDir, globalDataDir, grantScopeFor, hasTmux, idSegment, includeGlobFor, isCliProvider, isOpenAiProvider, isPlainPluginName, isValidManifest, killTree, languageForId, listSessions, listTaskLogAttempts, loadSession, loadSessionPlanState, loadState, mapAgentTool, migrateOldConfigDir, migratePlanIsolation, mintDaemonToken, mintSessionId, modelContextBlock, modifyValidationFeedback, normalizeAgentArgs, normalizeGeminiModel, openTaskLog, parseMaxParallel, parseTaskQueryJson, pendingEditRulesBlock, prefixModelId, providerForRunner, reEmitPlanPrompt, reEmitTaskOpsPrompt, reEmitTaskQueryPrompt, readDaemonToken, readTaskLog, referencePattern, renderPlanMap, renderPriorOutputs, renderTaskQueryAnswer, repairLoop, researchShellWarning, researchToolsPath, resolveArgs, resolvePluginInstallDir, resolveProviderFromPrefix, resolveResearchShell, resolveSkillInvocation, resolveTaskRunnerFlags, resolveWithin, retargetTaskRunner, routeTransport, runnerAssignment, runnerForProvider, sanitizeSlug, savePrdMarkdown, saveSession, saveState, sessionDataDir, sessionRuntimeSettings, stateExists, stripModelPrefix, summarizeOutput, supportsTaskMode, taskOpsRejectedPrompt, taskQuerySignature, textHasTaskQuery, tmuxSessionName, tmuxSocketName, tmuxWindowName, tokenSubprotocols, tokensMatch, truncatedPlanReEmitPrompt, wellKnownBinDirs, withPath, writePrivateFile };
|