@1agents/acp-service 0.10.4 → 0.10.6
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/src/a2a/gateway.d.ts +75 -0
- package/dist/src/a2a/gateway.js +54 -7
- package/dist/src/a2a/index.d.ts +1 -1
- package/dist/src/a2a/index.js +1 -1
- package/dist/src/a2a/job-directory.d.ts +9 -0
- package/dist/src/a2a/job-directory.js +14 -1
- package/dist/src/a2a/preflight.d.ts +6 -0
- package/dist/src/a2a/preflight.js +46 -0
- package/dist/src/a2a/result-metadata.js +18 -7
- package/dist/src/a2a/standalone.d.ts +4 -0
- package/dist/src/a2a/standalone.js +3 -0
- package/dist/src/a2a/types.d.ts +6 -0
- package/dist/src/a2a/workbench-ui.js +6 -2
- package/dist/src/execution/handoff.d.ts +141 -0
- package/dist/src/execution/handoff.js +193 -0
- package/dist/src/execution/ledger.d.ts +18 -0
- package/dist/src/execution/ledger.js +95 -3
- package/dist/src/execution/spaces.d.ts +13 -0
- package/dist/src/execution/spaces.js +32 -0
- package/dist/src/execution/workbench.d.ts +8 -2
- package/dist/src/execution/workbench.js +24 -3
- package/dist/workbench-ui/app.js +1 -1
- package/package.json +17 -12
- package/skills/acp-service/references/roles-and-tasks.md +3 -1
- package/vendor/dsh/a2a-executor.d.ts +2 -2
- package/vendor/dsh/adapter.d.ts +4 -4
- package/vendor/dsh/client.js +9 -33
- package/vendor/dsh/cordis.patch.yml +3 -1
- package/vendor/dsh/index.js +0 -3
- package/vendor/dsh/service-process.js +3 -1
- package/vendor/dsh/ticket-tools.d.ts +1 -1
- package/vendor/runtime/dist/{cli-BwanDcOo.js → cli-DXmYwv3U.js} +4 -4
- package/vendor/runtime/dist/{cli-BwanDcOo.js.map → cli-DXmYwv3U.js.map} +1 -1
- package/vendor/runtime/dist/cli.js +8 -8
- package/vendor/runtime/dist/{client-C5zneoBs.d.ts → client-VQsqcIOJ.d.ts} +1 -3
- package/vendor/runtime/dist/{client-C5zneoBs.d.ts.map → client-VQsqcIOJ.d.ts.map} +1 -1
- package/vendor/runtime/dist/{flows-CzLUHUTS.js → flows-DJ17ajbw.js} +4 -4
- package/vendor/runtime/dist/{flows-CzLUHUTS.js.map → flows-DJ17ajbw.js.map} +1 -1
- package/vendor/runtime/dist/flows.d.ts +1 -1
- package/vendor/runtime/dist/flows.js +1 -1
- package/vendor/runtime/dist/{invocation-options-B6pIpdpR.js → invocation-options-PBfCgrdi.js} +4 -4
- package/vendor/runtime/dist/{invocation-options-B6pIpdpR.js.map → invocation-options-PBfCgrdi.js.map} +1 -1
- package/vendor/runtime/dist/{ipc-ivLtSAdL.js → ipc-BQQpcEdP.js} +3 -21
- package/vendor/runtime/dist/ipc-BQQpcEdP.js.map +1 -0
- package/vendor/runtime/dist/{output-BqKnXXb0.js → output-B3MDn7kv.js} +3 -3
- package/vendor/runtime/dist/{output-BqKnXXb0.js.map → output-B3MDn7kv.js.map} +1 -1
- package/vendor/runtime/dist/{queue-owner-runtime-DXJND10J.js → queue-owner-runtime-DXCVngwU.js} +2 -11
- package/vendor/runtime/dist/queue-owner-runtime-DXCVngwU.js.map +1 -0
- package/vendor/runtime/dist/runtime.d.ts +1 -1
- package/vendor/runtime/dist/runtime.d.ts.map +1 -1
- package/vendor/runtime/dist/runtime.js +3 -3
- package/vendor/runtime/dist/{session-watch-BHB3_PXm.js → session-watch-DURyCw31.js} +4 -4
- package/vendor/runtime/dist/{session-watch-BHB3_PXm.js.map → session-watch-DURyCw31.js.map} +1 -1
- package/vendor/runtime/dist/{watch-UjokHUfS.js → watch-CIpoMaWD.js} +2 -2
- package/vendor/runtime/dist/{watch-UjokHUfS.js.map → watch-CIpoMaWD.js.map} +1 -1
- package/vendor/dsh/workbench.d.ts +0 -18
- package/vendor/dsh/workbench.js +0 -91
- package/vendor/runtime/dist/docs-site/.nojekyll +0 -0
- package/vendor/runtime/dist/docs-site/CLI.html +0 -833
- package/vendor/runtime/dist/docs-site/VISION.html +0 -415
- package/vendor/runtime/dist/docs-site/agents.html +0 -391
- package/vendor/runtime/dist/docs-site/compare.html +0 -359
- package/vendor/runtime/dist/docs-site/config.html +0 -450
- package/vendor/runtime/dist/docs-site/custom-agents.html +0 -408
- package/vendor/runtime/dist/docs-site/exit-codes.html +0 -347
- package/vendor/runtime/dist/docs-site/favicon.svg +0 -21
- package/vendor/runtime/dist/docs-site/flows.html +0 -498
- package/vendor/runtime/dist/docs-site/index.html +0 -367
- package/vendor/runtime/dist/docs-site/install.html +0 -386
- package/vendor/runtime/dist/docs-site/llms.txt +0 -36
- package/vendor/runtime/dist/docs-site/output-formats.html +0 -407
- package/vendor/runtime/dist/docs-site/permissions.html +0 -422
- package/vendor/runtime/dist/docs-site/prompting.html +0 -460
- package/vendor/runtime/dist/docs-site/quickstart.html +0 -382
- package/vendor/runtime/dist/docs-site/releasing.html +0 -341
- package/vendor/runtime/dist/docs-site/runtime-environment.html +0 -329
- package/vendor/runtime/dist/docs-site/runtime-process-lifecycle.html +0 -336
- package/vendor/runtime/dist/docs-site/safe-errors.html +0 -323
- package/vendor/runtime/dist/docs-site/session-control.html +0 -408
- package/vendor/runtime/dist/docs-site/session-watch.html +0 -354
- package/vendor/runtime/dist/docs-site/sessions.html +0 -488
- package/vendor/runtime/dist/docs-site/shared-sessions.html +0 -377
- package/vendor/runtime/dist/ipc-ivLtSAdL.js.map +0 -1
- package/vendor/runtime/dist/queue-owner-runtime-DXJND10J.js.map +0 -1
|
@@ -6,7 +6,9 @@ const leases = new Map();
|
|
|
6
6
|
export function resolveServiceOptions(input) {
|
|
7
7
|
const result = {
|
|
8
8
|
serviceUrl: input.serviceUrl ?? 'http://127.0.0.1:36812',
|
|
9
|
-
|
|
9
|
+
// The ACP daemon is a shared local service. Host plugins connect to it by default;
|
|
10
|
+
// per-host child ownership remains available only through the explicit `auto` mode.
|
|
11
|
+
serviceMode: input.serviceMode ?? 'external',
|
|
10
12
|
serviceStartupTimeoutMs: input.serviceStartupTimeoutMs ?? 15_000,
|
|
11
13
|
serviceShutdownTimeoutMs: input.serviceShutdownTimeoutMs ?? 5_000,
|
|
12
14
|
};
|
|
@@ -18,4 +18,4 @@ export declare function createTicketGateway(options: {
|
|
|
18
18
|
}): TicketGateway;
|
|
19
19
|
/** Runs one tool for a session; a rule the gateway enforces comes back as text for the agent. */
|
|
20
20
|
export declare function runTicketTool(gateway: TicketGateway, sessionId: string, tool: TicketTool, args?: ExecutorTicketArgs, via?: 'dsh' | 'mcp'): Promise<string>;
|
|
21
|
-
export declare function ticketTools(gateway: TicketGateway):
|
|
21
|
+
export declare function ticketTools(gateway: TicketGateway): any[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { rt as permissionModeSatisfies } from "./queue-owner-runtime-
|
|
2
|
-
import { C as resolvePermissionMode, S as resolveOutputPolicy, b as resolveAgentInvocation, l as hasExplicitPermissionModeFlag, r as sessionOptionsFromGlobalFlags, t as resolvePermissionPolicyFromFlags, x as resolveGlobalFlags } from "./invocation-options-
|
|
3
|
-
import { c as validateFlowDefinition, h as isDefinedFlow, o as FlowRunner } from "./flows-
|
|
1
|
+
import { rt as permissionModeSatisfies } from "./queue-owner-runtime-DXCVngwU.js";
|
|
2
|
+
import { C as resolvePermissionMode, S as resolveOutputPolicy, b as resolveAgentInvocation, l as hasExplicitPermissionModeFlag, r as sessionOptionsFromGlobalFlags, t as resolvePermissionPolicyFromFlags, x as resolveGlobalFlags } from "./invocation-options-PBfCgrdi.js";
|
|
3
|
+
import { c as validateFlowDefinition, h as isDefinedFlow, o as FlowRunner } from "./flows-DJ17ajbw.js";
|
|
4
4
|
import Module, { register } from "node:module";
|
|
5
5
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
6
6
|
import path from "node:path";
|
|
@@ -179,4 +179,4 @@ function printFlowRunResult(result, globalFlags) {
|
|
|
179
179
|
//#endregion
|
|
180
180
|
export { handleFlowRun };
|
|
181
181
|
|
|
182
|
-
//# sourceMappingURL=cli-
|
|
182
|
+
//# sourceMappingURL=cli-DXmYwv3U.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-BwanDcOo.js","names":[],"sources":["../src/flows/module-resolution.ts","../src/flows/cli.ts"],"sourcesContent":["import Module, { register } from \"node:module\";\nimport { fileURLToPath } from \"node:url\";\n\ntype ResolveFilename = (\n specifier: string,\n parent: unknown,\n isMain?: boolean,\n options?: unknown,\n) => string;\n\nconst moduleResolver = Module as unknown as { _resolveFilename: ResolveFilename };\nconst resolveFilenameKey = \"_resolveFilename\";\nlet installed = false;\n\n/** Resolve the public flow entrypoint in both ESM and CommonJS dependency graphs. */\nexport function installFlowRuntimeResolution(runtimeUrl: string): void {\n if (installed) {\n return;\n }\n const hook = `\n let runtimeUrl;\n const flowSpecifiers = new Set([\"acpx/flows\", \"@scottzx/1acp/flows\"]);\n export function initialize(data) { runtimeUrl = data.runtimeUrl; }\n export function resolve(specifier, context, nextResolve) {\n return nextResolve(flowSpecifiers.has(specifier) ? runtimeUrl : specifier, context);\n }\n `;\n register(`data:text/javascript,${encodeURIComponent(hook)}`, { data: { runtimeUrl } });\n // Node 22.13 supports ESM hooks but predates synchronous CommonJS hooks.\n const resolve = moduleResolver[resolveFilenameKey];\n const runtimePath = fileURLToPath(runtimeUrl);\n const flowSpecifiers = new Set([\"acpx/flows\", \"@scottzx/1acp/flows\"]);\n moduleResolver[resolveFilenameKey] = function (specifier, parent, isMain, options) {\n return resolve.call(\n this,\n flowSpecifiers.has(specifier) ? runtimePath : specifier,\n parent,\n isMain,\n options,\n );\n };\n installed = true;\n}\n","import { randomUUID } from \"node:crypto\";\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport { InvalidArgumentError, type Command } from \"commander\";\nimport type { ResolvedAcpxConfig } from \"../cli/config.js\";\nimport {\n hasExplicitPermissionModeFlag,\n resolveAgentInvocation,\n resolveGlobalFlags,\n resolveOutputPolicy,\n resolvePermissionMode,\n type GlobalFlags,\n} from \"../cli/flags.js\";\nimport {\n resolvePermissionPolicyFromFlags,\n sessionOptionsFromGlobalFlags,\n} from \"../cli/invocation-options.js\";\nimport { type FlowDefinition, FlowRunner } from \"../flows.js\";\nimport { permissionModeSatisfies } from \"../permissions.js\";\nimport type { PermissionMode } from \"../types.js\";\nimport { isDefinedFlow } from \"./authoring.js\";\nimport { validateFlowDefinition } from \"./graph.js\";\nimport { installFlowRuntimeResolution } from \"./module-resolution.js\";\n\ntype FlowRunFlags = {\n inputJson?: string;\n inputFile?: string;\n defaultAgent?: string;\n};\n\nexport async function handleFlowRun(\n flowFile: string,\n flags: FlowRunFlags,\n command: Command,\n config: ResolvedAcpxConfig,\n): Promise<void> {\n const globalFlags = resolveGlobalFlags(command, config);\n const permissionMode = resolvePermissionMode(globalFlags, config.defaultPermissions);\n const permissionPolicy = await resolvePermissionPolicyFromFlags(globalFlags);\n const outputPolicy = resolveOutputPolicy(globalFlags.format, globalFlags.jsonStrict === true);\n const input = await readFlowInput(flags);\n const flowPath = path.resolve(flowFile);\n const flow = await loadFlowModule(flowPath);\n assertFlowPermissionRequirements(flow, permissionMode, globalFlags);\n\n const runner = new FlowRunner({\n resolveAgent: (profile?: string) => {\n return resolveAgentInvocation(profile ?? flags.defaultAgent, globalFlags, config);\n },\n permissionMode,\n mcpServers: config.mcpServers,\n nonInteractivePermissions: globalFlags.nonInteractivePermissions,\n permissionPolicy,\n authCredentials: config.auth,\n authPolicy: globalFlags.authPolicy,\n fs: globalFlags.fs,\n timeoutMs: globalFlags.timeout,\n ttlMs: globalFlags.ttl,\n verbose: globalFlags.verbose,\n suppressSdkConsoleErrors: outputPolicy.suppressSdkConsoleErrors,\n sessionOptions: sessionOptionsFromGlobalFlags(globalFlags),\n });\n\n const result = await runner.run(flow, input, {\n flowPath,\n });\n\n printFlowRunResult(result, globalFlags);\n}\n\nfunction assertFlowPermissionRequirements(\n flow: FlowDefinition,\n permissionMode: PermissionMode,\n globalFlags: GlobalFlags,\n): void {\n const permissions = flow.permissions;\n if (!permissions) {\n return;\n }\n\n if (permissions.requireExplicitGrant && !hasExplicitPermissionModeFlag(globalFlags)) {\n throw new InvalidArgumentError(\n buildFlowPermissionFailureMessage(flow, permissions.requiredMode, permissions.reason, true),\n );\n }\n\n if (!permissionModeSatisfies(permissionMode, permissions.requiredMode)) {\n throw new InvalidArgumentError(\n buildFlowPermissionFailureMessage(flow, permissions.requiredMode, permissions.reason, false),\n );\n }\n}\n\nfunction buildFlowPermissionFailureMessage(\n flow: FlowDefinition,\n requiredMode: PermissionMode,\n reason?: string,\n explicit = false,\n): string {\n return [\n explicit\n ? `Flow \"${flow.name}\" requires an explicit ${requiredMode} grant.`\n : `Flow \"${flow.name}\" requires permission mode ${requiredMode}.`,\n `Rerun with --${requiredMode}.`,\n ...(reason ? [`Reason: ${reason}`] : []),\n ].join(\" \");\n}\n\nasync function readFlowInput(flags: FlowRunFlags): Promise<unknown> {\n if (flags.inputJson && flags.inputFile) {\n throw new InvalidArgumentError(\"Use only one of --input-json or --input-file\");\n }\n\n if (flags.inputJson) {\n return parseJsonInput(flags.inputJson, \"--input-json\");\n }\n\n if (flags.inputFile) {\n const inputPath = path.resolve(flags.inputFile);\n const payload = await fs.readFile(inputPath, \"utf8\");\n return parseJsonInput(payload, \"--input-file\");\n }\n\n return {};\n}\n\nasync function loadFlowModule(flowPath: string): Promise<FlowDefinition> {\n const extension = path.extname(flowPath).toLowerCase();\n installFlowRuntimeResolution(pathToFileURL(resolveFlowRuntimeImportSpecifier()).href);\n const module = await loadFlowRuntimeModule(pathToFileURL(flowPath).href, extension);\n const candidate = findFlowDefinition(module);\n if (!candidate) {\n throw new Error(\n `Flow module must export default defineFlow({...}) from \"acpx/flows\" (or \"@scottzx/1acp/flows\"): ${flowPath}`,\n );\n }\n validateFlowDefinition(candidate);\n return candidate;\n}\n\nfunction resolveFlowRuntimeImportSpecifier(): string {\n const selfPath = fileURLToPath(import.meta.url);\n let runtimePath: string;\n\n if (selfPath.endsWith(`${path.sep}src${path.sep}flows${path.sep}cli.ts`)) {\n runtimePath = fileURLToPath(new URL(\"../flows.ts\", import.meta.url));\n } else if (selfPath.endsWith(`${path.sep}src${path.sep}flows${path.sep}cli.js`)) {\n runtimePath = fileURLToPath(new URL(\"../flows.js\", import.meta.url));\n } else {\n runtimePath = fileURLToPath(new URL(\"./flows.js\", import.meta.url));\n }\n return runtimePath.replaceAll(path.sep, \"/\");\n}\n\ntype FlowModule = {\n default?: unknown;\n \"module.exports\"?: unknown;\n};\n\nasync function loadFlowRuntimeModule(flowUrl: string, extension: string): Promise<FlowModule> {\n if (extension === \".ts\" || extension === \".tsx\" || extension === \".cts\") {\n const { register } = await import(\"tsx/cjs/api\");\n const loader = register({ namespace: randomUUID() });\n try {\n return loader.require(flowUrl, import.meta.url) as FlowModule;\n } finally {\n loader.unregister();\n }\n }\n\n if (extension === \".mts\") {\n const { register } = await import(\"tsx/esm/api\");\n const loader = register({ namespace: randomUUID() });\n try {\n return (await loader.import(flowUrl, import.meta.url)) as FlowModule;\n } finally {\n await loader.unregister();\n }\n }\n\n return (await import(flowUrl)) as FlowModule;\n}\n\nfunction findFlowDefinition(module: FlowModule): FlowDefinition | null {\n const candidates = [\n module,\n module.default,\n module[\"module.exports\"],\n getNestedDefault(module.default),\n getNestedDefault(module[\"module.exports\"]),\n ];\n\n for (const candidate of candidates) {\n if (isDefinedFlow(candidate)) {\n return candidate;\n }\n }\n\n return null;\n}\n\nfunction getNestedDefault(value: unknown): unknown {\n if (!value || typeof value !== \"object\" || !(\"default\" in value)) {\n return null;\n }\n return (value as { default?: unknown }).default ?? null;\n}\n\nfunction parseJsonInput(raw: string, label: string): unknown {\n try {\n return JSON.parse(raw);\n } catch (error) {\n throw new InvalidArgumentError(\n `${label} must contain valid JSON: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n}\n\nfunction printFlowRunResult(\n result: Awaited<ReturnType<FlowRunner[\"run\"]>>,\n globalFlags: GlobalFlags,\n): void {\n const payload = {\n action: \"flow_run_result\",\n runId: result.state.runId,\n flowName: result.state.flowName,\n runTitle: result.state.runTitle,\n flowPath: result.state.flowPath,\n status: result.state.status,\n currentNode: result.state.currentNode,\n currentNodeType: result.state.currentNodeType,\n currentNodeStartedAt: result.state.currentNodeStartedAt,\n lastHeartbeatAt: result.state.lastHeartbeatAt,\n statusDetail: result.state.statusDetail,\n waitingOn: result.state.waitingOn,\n runDir: result.runDir,\n outputs: result.state.outputs,\n sessionBindings: result.state.sessionBindings,\n };\n\n if (globalFlags.format === \"json\") {\n process.stdout.write(`${JSON.stringify(payload)}\\n`);\n return;\n }\n\n if (globalFlags.format === \"quiet\") {\n process.stdout.write(`${result.state.runId}\\n`);\n return;\n }\n\n process.stdout.write(`runId: ${payload.runId}\\n`);\n process.stdout.write(`flow: ${payload.flowName}\\n`);\n if (payload.runTitle) {\n process.stdout.write(`title: ${payload.runTitle}\\n`);\n }\n process.stdout.write(`status: ${payload.status}\\n`);\n process.stdout.write(`runDir: ${payload.runDir}\\n`);\n if (payload.currentNode) {\n process.stdout.write(`currentNode: ${payload.currentNode}\\n`);\n }\n if (payload.statusDetail) {\n process.stdout.write(`statusDetail: ${payload.statusDetail}\\n`);\n }\n if (payload.waitingOn) {\n process.stdout.write(`waitingOn: ${payload.waitingOn}\\n`);\n }\n process.stdout.write(`${JSON.stringify(payload.outputs, null, 2)}\\n`);\n}\n"],"mappings":";;;;;;;;;;AAUA,MAAM,iBAAiB;AACvB,MAAM,qBAAqB;AAC3B,IAAI,YAAY;;AAGhB,SAAgB,6BAA6B,YAA0B;CACrE,IAAI,WACF;CAUF,SAAS,wBAAwB,mBAAmB;;;;;;;GAAI,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;CAErF,MAAM,UAAU,eAAe;CAC/B,MAAM,cAAc,cAAc,UAAU;CAC5C,MAAM,iCAAiB,IAAI,IAAI,CAAC,cAAc,qBAAqB,CAAC;CACpE,eAAe,sBAAsB,SAAU,WAAW,QAAQ,QAAQ,SAAS;E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,OAAO,MAAM;EACvB,UAAU,OAAO,MAAM;EACvB,QAAQ,OAAO,MAAM;EACrB,aAAa,OAAO,MAAM;EAC1B,iBAAiB,OAAO,MAAM;EAC9B,sBAAsB,OAAO,MAAM;EACnC,iBAAiB,OAAO,MAAM;EAC9B,cAAc,OAAO,MAAM;EAC3B,WAAW,OAAO,MAAM;EACxB,QAAQ,OAAO;EACf,SAAS,OAAO,MAAM;EACtB,iBAAiB,OAAO,MAAM;CAChC;CAEA,IAAI,YAAY,WAAW,QAAQ;EACjC,QAAQ,OAAO,MAAM,GAAG,KAAK,UAAU,OAAO,EAAE,GAAG;EACnD;CACF;CAEA,IAAI,YAAY,WAAW,SAAS;EAClC,QAAQ,OAAO,MAAM,GAAG,OAAO,MAAM,MAAM,GAAG;EAC9C;CACF;CAEA,QAAQ,OAAO,MAAM,UAAU,QAAQ,MAAM,GAAG;CAChD,QAAQ,OAAO,MAAM,SAAS,QAAQ,SAAS,GAAG;CAClD,IAAI,QAAQ,UACV,QAAQ,OAAO,MAAM,UAAU,QAAQ,SAAS,GAAG;CAErD,QAAQ,OAAO,MAAM,WAAW,QAAQ,OAAO,GAAG;CAClD,QAAQ,OAAO,MAAM,WAAW,QAAQ,OAAO,GAAG;CAClD,IAAI,QAAQ,aACV,QAAQ,OAAO,MAAM,gBAAgB,QAAQ,YAAY,GAAG;CAE9D,IAAI,QAAQ,cACV,QAAQ,OAAO,MAAM,iBAAiB,QAAQ,aAAa,GAAG;CAEhE,IAAI,QAAQ,WACV,QAAQ,OAAO,MAAM,cAAc,QAAQ,UAAU,GAAG;CAE1D,QAAQ,OAAO,MAAM,GAAG,KAAK,UAAU,QAAQ,SAAS,MAAM,CAAC,EAAE,GAAG;AACtE"}
|
|
1
|
+
{"version":3,"file":"cli-DXmYwv3U.js","names":[],"sources":["../src/flows/module-resolution.ts","../src/flows/cli.ts"],"sourcesContent":["import Module, { register } from \"node:module\";\nimport { fileURLToPath } from \"node:url\";\n\ntype ResolveFilename = (\n specifier: string,\n parent: unknown,\n isMain?: boolean,\n options?: unknown,\n) => string;\n\nconst moduleResolver = Module as unknown as { _resolveFilename: ResolveFilename };\nconst resolveFilenameKey = \"_resolveFilename\";\nlet installed = false;\n\n/** Resolve the public flow entrypoint in both ESM and CommonJS dependency graphs. */\nexport function installFlowRuntimeResolution(runtimeUrl: string): void {\n if (installed) {\n return;\n }\n const hook = `\n let runtimeUrl;\n const flowSpecifiers = new Set([\"acpx/flows\", \"@scottzx/1acp/flows\"]);\n export function initialize(data) { runtimeUrl = data.runtimeUrl; }\n export function resolve(specifier, context, nextResolve) {\n return nextResolve(flowSpecifiers.has(specifier) ? runtimeUrl : specifier, context);\n }\n `;\n register(`data:text/javascript,${encodeURIComponent(hook)}`, { data: { runtimeUrl } });\n // Node 22.13 supports ESM hooks but predates synchronous CommonJS hooks.\n const resolve = moduleResolver[resolveFilenameKey];\n const runtimePath = fileURLToPath(runtimeUrl);\n const flowSpecifiers = new Set([\"acpx/flows\", \"@scottzx/1acp/flows\"]);\n moduleResolver[resolveFilenameKey] = function (specifier, parent, isMain, options) {\n return resolve.call(\n this,\n flowSpecifiers.has(specifier) ? runtimePath : specifier,\n parent,\n isMain,\n options,\n );\n };\n installed = true;\n}\n","import { randomUUID } from \"node:crypto\";\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport { InvalidArgumentError, type Command } from \"commander\";\nimport type { ResolvedAcpxConfig } from \"../cli/config.js\";\nimport {\n hasExplicitPermissionModeFlag,\n resolveAgentInvocation,\n resolveGlobalFlags,\n resolveOutputPolicy,\n resolvePermissionMode,\n type GlobalFlags,\n} from \"../cli/flags.js\";\nimport {\n resolvePermissionPolicyFromFlags,\n sessionOptionsFromGlobalFlags,\n} from \"../cli/invocation-options.js\";\nimport { type FlowDefinition, FlowRunner } from \"../flows.js\";\nimport { permissionModeSatisfies } from \"../permissions.js\";\nimport type { PermissionMode } from \"../types.js\";\nimport { isDefinedFlow } from \"./authoring.js\";\nimport { validateFlowDefinition } from \"./graph.js\";\nimport { installFlowRuntimeResolution } from \"./module-resolution.js\";\n\ntype FlowRunFlags = {\n inputJson?: string;\n inputFile?: string;\n defaultAgent?: string;\n};\n\nexport async function handleFlowRun(\n flowFile: string,\n flags: FlowRunFlags,\n command: Command,\n config: ResolvedAcpxConfig,\n): Promise<void> {\n const globalFlags = resolveGlobalFlags(command, config);\n const permissionMode = resolvePermissionMode(globalFlags, config.defaultPermissions);\n const permissionPolicy = await resolvePermissionPolicyFromFlags(globalFlags);\n const outputPolicy = resolveOutputPolicy(globalFlags.format, globalFlags.jsonStrict === true);\n const input = await readFlowInput(flags);\n const flowPath = path.resolve(flowFile);\n const flow = await loadFlowModule(flowPath);\n assertFlowPermissionRequirements(flow, permissionMode, globalFlags);\n\n const runner = new FlowRunner({\n resolveAgent: (profile?: string) => {\n return resolveAgentInvocation(profile ?? flags.defaultAgent, globalFlags, config);\n },\n permissionMode,\n mcpServers: config.mcpServers,\n nonInteractivePermissions: globalFlags.nonInteractivePermissions,\n permissionPolicy,\n authCredentials: config.auth,\n authPolicy: globalFlags.authPolicy,\n fs: globalFlags.fs,\n timeoutMs: globalFlags.timeout,\n ttlMs: globalFlags.ttl,\n verbose: globalFlags.verbose,\n suppressSdkConsoleErrors: outputPolicy.suppressSdkConsoleErrors,\n sessionOptions: sessionOptionsFromGlobalFlags(globalFlags),\n });\n\n const result = await runner.run(flow, input, {\n flowPath,\n });\n\n printFlowRunResult(result, globalFlags);\n}\n\nfunction assertFlowPermissionRequirements(\n flow: FlowDefinition,\n permissionMode: PermissionMode,\n globalFlags: GlobalFlags,\n): void {\n const permissions = flow.permissions;\n if (!permissions) {\n return;\n }\n\n if (permissions.requireExplicitGrant && !hasExplicitPermissionModeFlag(globalFlags)) {\n throw new InvalidArgumentError(\n buildFlowPermissionFailureMessage(flow, permissions.requiredMode, permissions.reason, true),\n );\n }\n\n if (!permissionModeSatisfies(permissionMode, permissions.requiredMode)) {\n throw new InvalidArgumentError(\n buildFlowPermissionFailureMessage(flow, permissions.requiredMode, permissions.reason, false),\n );\n }\n}\n\nfunction buildFlowPermissionFailureMessage(\n flow: FlowDefinition,\n requiredMode: PermissionMode,\n reason?: string,\n explicit = false,\n): string {\n return [\n explicit\n ? `Flow \"${flow.name}\" requires an explicit ${requiredMode} grant.`\n : `Flow \"${flow.name}\" requires permission mode ${requiredMode}.`,\n `Rerun with --${requiredMode}.`,\n ...(reason ? [`Reason: ${reason}`] : []),\n ].join(\" \");\n}\n\nasync function readFlowInput(flags: FlowRunFlags): Promise<unknown> {\n if (flags.inputJson && flags.inputFile) {\n throw new InvalidArgumentError(\"Use only one of --input-json or --input-file\");\n }\n\n if (flags.inputJson) {\n return parseJsonInput(flags.inputJson, \"--input-json\");\n }\n\n if (flags.inputFile) {\n const inputPath = path.resolve(flags.inputFile);\n const payload = await fs.readFile(inputPath, \"utf8\");\n return parseJsonInput(payload, \"--input-file\");\n }\n\n return {};\n}\n\nasync function loadFlowModule(flowPath: string): Promise<FlowDefinition> {\n const extension = path.extname(flowPath).toLowerCase();\n installFlowRuntimeResolution(pathToFileURL(resolveFlowRuntimeImportSpecifier()).href);\n const module = await loadFlowRuntimeModule(pathToFileURL(flowPath).href, extension);\n const candidate = findFlowDefinition(module);\n if (!candidate) {\n throw new Error(\n `Flow module must export default defineFlow({...}) from \"acpx/flows\" (or \"@scottzx/1acp/flows\"): ${flowPath}`,\n );\n }\n validateFlowDefinition(candidate);\n return candidate;\n}\n\nfunction resolveFlowRuntimeImportSpecifier(): string {\n const selfPath = fileURLToPath(import.meta.url);\n let runtimePath: string;\n\n if (selfPath.endsWith(`${path.sep}src${path.sep}flows${path.sep}cli.ts`)) {\n runtimePath = fileURLToPath(new URL(\"../flows.ts\", import.meta.url));\n } else if (selfPath.endsWith(`${path.sep}src${path.sep}flows${path.sep}cli.js`)) {\n runtimePath = fileURLToPath(new URL(\"../flows.js\", import.meta.url));\n } else {\n runtimePath = fileURLToPath(new URL(\"./flows.js\", import.meta.url));\n }\n return runtimePath.replaceAll(path.sep, \"/\");\n}\n\ntype FlowModule = {\n default?: unknown;\n \"module.exports\"?: unknown;\n};\n\nasync function loadFlowRuntimeModule(flowUrl: string, extension: string): Promise<FlowModule> {\n if (extension === \".ts\" || extension === \".tsx\" || extension === \".cts\") {\n const { register } = await import(\"tsx/cjs/api\");\n const loader = register({ namespace: randomUUID() });\n try {\n return loader.require(flowUrl, import.meta.url) as FlowModule;\n } finally {\n loader.unregister();\n }\n }\n\n if (extension === \".mts\") {\n const { register } = await import(\"tsx/esm/api\");\n const loader = register({ namespace: randomUUID() });\n try {\n return (await loader.import(flowUrl, import.meta.url)) as FlowModule;\n } finally {\n await loader.unregister();\n }\n }\n\n return (await import(flowUrl)) as FlowModule;\n}\n\nfunction findFlowDefinition(module: FlowModule): FlowDefinition | null {\n const candidates = [\n module,\n module.default,\n module[\"module.exports\"],\n getNestedDefault(module.default),\n getNestedDefault(module[\"module.exports\"]),\n ];\n\n for (const candidate of candidates) {\n if (isDefinedFlow(candidate)) {\n return candidate;\n }\n }\n\n return null;\n}\n\nfunction getNestedDefault(value: unknown): unknown {\n if (!value || typeof value !== \"object\" || !(\"default\" in value)) {\n return null;\n }\n return (value as { default?: unknown }).default ?? null;\n}\n\nfunction parseJsonInput(raw: string, label: string): unknown {\n try {\n return JSON.parse(raw);\n } catch (error) {\n throw new InvalidArgumentError(\n `${label} must contain valid JSON: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n}\n\nfunction printFlowRunResult(\n result: Awaited<ReturnType<FlowRunner[\"run\"]>>,\n globalFlags: GlobalFlags,\n): void {\n const payload = {\n action: \"flow_run_result\",\n runId: result.state.runId,\n flowName: result.state.flowName,\n runTitle: result.state.runTitle,\n flowPath: result.state.flowPath,\n status: result.state.status,\n currentNode: result.state.currentNode,\n currentNodeType: result.state.currentNodeType,\n currentNodeStartedAt: result.state.currentNodeStartedAt,\n lastHeartbeatAt: result.state.lastHeartbeatAt,\n statusDetail: result.state.statusDetail,\n waitingOn: result.state.waitingOn,\n runDir: result.runDir,\n outputs: result.state.outputs,\n sessionBindings: result.state.sessionBindings,\n };\n\n if (globalFlags.format === \"json\") {\n process.stdout.write(`${JSON.stringify(payload)}\\n`);\n return;\n }\n\n if (globalFlags.format === \"quiet\") {\n process.stdout.write(`${result.state.runId}\\n`);\n return;\n }\n\n process.stdout.write(`runId: ${payload.runId}\\n`);\n process.stdout.write(`flow: ${payload.flowName}\\n`);\n if (payload.runTitle) {\n process.stdout.write(`title: ${payload.runTitle}\\n`);\n }\n process.stdout.write(`status: ${payload.status}\\n`);\n process.stdout.write(`runDir: ${payload.runDir}\\n`);\n if (payload.currentNode) {\n process.stdout.write(`currentNode: ${payload.currentNode}\\n`);\n }\n if (payload.statusDetail) {\n process.stdout.write(`statusDetail: ${payload.statusDetail}\\n`);\n }\n if (payload.waitingOn) {\n process.stdout.write(`waitingOn: ${payload.waitingOn}\\n`);\n }\n process.stdout.write(`${JSON.stringify(payload.outputs, null, 2)}\\n`);\n}\n"],"mappings":";;;;;;;;;;AAUA,MAAM,iBAAiB;AACvB,MAAM,qBAAqB;AAC3B,IAAI,YAAY;;AAGhB,SAAgB,6BAA6B,YAA0B;CACrE,IAAI,WACF;CAUF,SAAS,wBAAwB,mBAAmB;;;;;;;GAAI,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;CAErF,MAAM,UAAU,eAAe;CAC/B,MAAM,cAAc,cAAc,UAAU;CAC5C,MAAM,iCAAiB,IAAI,IAAI,CAAC,cAAc,qBAAqB,CAAC;CACpE,eAAe,sBAAsB,SAAU,WAAW,QAAQ,QAAQ,SAAS;EACjF,OAAO,QAAQ,KACb,MACA,eAAe,IAAI,SAAS,IAAI,cAAc,WAC9C,QACA,QACA,OACF;CACF;CACA,YAAY;AACd;;;ACXA,eAAsB,cACpB,UACA,OACA,SACA,QACe;CACf,MAAM,cAAc,mBAAmB,SAAS,MAAM;CACtD,MAAM,iBAAiB,sBAAsB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,OAAO,MAAM;EACxB,QAAQ,OAAO;EACf,SAAS,OAAO,MAAM;EACtB,iBAAiB,OAAO,MAAM;CAChC;CAEA,IAAI,YAAY,WAAW,QAAQ;EACjC,QAAQ,OAAO,MAAM,GAAG,KAAK,UAAU,OAAO,EAAE,GAAG;EACnD;CACF;CAEA,IAAI,YAAY,WAAW,SAAS;EAClC,QAAQ,OAAO,MAAM,GAAG,OAAO,MAAM,MAAM,GAAG;EAC9C;CACF;CAEA,QAAQ,OAAO,MAAM,UAAU,QAAQ,MAAM,GAAG;CAChD,QAAQ,OAAO,MAAM,SAAS,QAAQ,SAAS,GAAG;CAClD,IAAI,QAAQ,UACV,QAAQ,OAAO,MAAM,UAAU,QAAQ,SAAS,GAAG;CAErD,QAAQ,OAAO,MAAM,WAAW,QAAQ,OAAO,GAAG;CAClD,QAAQ,OAAO,MAAM,WAAW,QAAQ,OAAO,GAAG;CAClD,IAAI,QAAQ,aACV,QAAQ,OAAO,MAAM,gBAAgB,QAAQ,YAAY,GAAG;CAE9D,IAAI,QAAQ,cACV,QAAQ,OAAO,MAAM,iBAAiB,QAAQ,aAAa,GAAG;CAEhE,IAAI,QAAQ,WACV,QAAQ,OAAO,MAAM,cAAc,QAAQ,UAAU,GAAG;CAE1D,QAAQ,OAAO,MAAM,GAAG,KAAK,UAAU,QAAQ,SAAS,MAAM,CAAC,EAAE,GAAG;AACtE"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { c as __exportAll, n as getTextErrorRemediationHints, o as toTimerMilliseconds, t as createOutputFormatter } from "./output-
|
|
3
|
-
import { A as findSession, C as textPrompt, Ct as exitCodeForOutputErrorCode, Dt as normalizeOutputError, F as normalizeName, Ft as OUTPUT_FORMATS, G as normalizeAgentSessionId, N as listSessions, Nt as EXIT_CODES, O as absolutePath, St as isProcessAlive, U as serializeSessionRecordForDisk, Ut as AgentSpawnError, V as parseSessionRecord, Vt as AcpxOperationalError, _t as sessionEventLockPath, b as mergePromptSourceWithText, c as probeQueueOwnerHealth, dt as boundedEventMaxSegments, ft as defaultSessionEventLog, gt as sessionEventActivePath, j as findSessionByDirectoryWalk, k as findGitRepositoryRoot, v as PromptInputValidationError, x as parsePromptSource, xt as _usingCtx, yt as writePrivateFile, z as writeSessionRecord } from "./ipc-
|
|
2
|
+
import { c as __exportAll, n as getTextErrorRemediationHints, o as toTimerMilliseconds, t as createOutputFormatter } from "./output-B3MDn7kv.js";
|
|
3
|
+
import { A as findSession, C as textPrompt, Ct as exitCodeForOutputErrorCode, Dt as normalizeOutputError, F as normalizeName, Ft as OUTPUT_FORMATS, G as normalizeAgentSessionId, N as listSessions, Nt as EXIT_CODES, O as absolutePath, St as isProcessAlive, U as serializeSessionRecordForDisk, Ut as AgentSpawnError, V as parseSessionRecord, Vt as AcpxOperationalError, _t as sessionEventLockPath, b as mergePromptSourceWithText, c as probeQueueOwnerHealth, dt as boundedEventMaxSegments, ft as defaultSessionEventLog, gt as sessionEventActivePath, j as findSessionByDirectoryWalk, k as findGitRepositoryRoot, v as PromptInputValidationError, x as parsePromptSource, xt as _usingCtx, yt as writePrivateFile, z as writeSessionRecord } from "./ipc-BQQpcEdP.js";
|
|
4
4
|
import { A as renderArgvIdentity, i as DEFAULT_AGENT_NAME, l as normalizeAgentName$1, s as listBuiltInAgents } from "./agent-registry-R7A3MSpr.js";
|
|
5
|
-
import { ct as listSessionEvents, d as flushPerfMetricsCapture, dt as TimeoutError, f as installPerfMetricsCapture, i as runOnce, lt as isLegacyZedCodexAcpInvocation, n as runSessionQueueOwner, nt as getAcpxVersion, ot as acquireSessionImport, s as DISCARD_OUTPUT_FORMATTER, st as acquireSessionScope, u as buildQueueOwnerArgOverride, ut as InterruptedError } from "./queue-owner-runtime-
|
|
6
|
-
import { C as resolvePermissionMode, E as resolveSessionsListFlags, S as resolveOutputPolicy, T as resolveSessionNameFromFlags, _ as parseSessionName, a as addGlobalFlags, b as resolveAgentInvocation, c as addSessionOption, d as parseDaysOlderThan, f as parseHistoryLimit, g as parsePruneBeforeDate, h as parseOutputFormat$1, i as addExecConfigOption, m as parseNonEmptyValue, n as sessionConnectionOptions, o as addPromptInputOption, p as parseMaxTurns, r as sessionOptionsFromGlobalFlags, s as addSessionNameOption, t as resolvePermissionPolicyFromFlags, u as parseAllowedTools, v as parseTimeoutSeconds, w as resolvePromptFlags, x as resolveGlobalFlags, y as parseTtlSeconds } from "./invocation-options-
|
|
5
|
+
import { ct as listSessionEvents, d as flushPerfMetricsCapture, dt as TimeoutError, f as installPerfMetricsCapture, i as runOnce, lt as isLegacyZedCodexAcpInvocation, n as runSessionQueueOwner, nt as getAcpxVersion, ot as acquireSessionImport, s as DISCARD_OUTPUT_FORMATTER, st as acquireSessionScope, u as buildQueueOwnerArgOverride, ut as InterruptedError } from "./queue-owner-runtime-DXCVngwU.js";
|
|
6
|
+
import { C as resolvePermissionMode, E as resolveSessionsListFlags, S as resolveOutputPolicy, T as resolveSessionNameFromFlags, _ as parseSessionName, a as addGlobalFlags, b as resolveAgentInvocation, c as addSessionOption, d as parseDaysOlderThan, f as parseHistoryLimit, g as parsePruneBeforeDate, h as parseOutputFormat$1, i as addExecConfigOption, m as parseNonEmptyValue, n as sessionConnectionOptions, o as addPromptInputOption, p as parseMaxTurns, r as sessionOptionsFromGlobalFlags, s as addSessionNameOption, t as resolvePermissionPolicyFromFlags, u as parseAllowedTools, v as parseTimeoutSeconds, w as resolvePromptFlags, x as resolveGlobalFlags, y as parseTtlSeconds } from "./invocation-options-PBfCgrdi.js";
|
|
7
7
|
import { realpathSync } from "node:fs";
|
|
8
8
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
9
9
|
import path from "node:path";
|
|
@@ -416,11 +416,11 @@ let sessionModulePromise;
|
|
|
416
416
|
let outputModulePromise;
|
|
417
417
|
let outputRenderModulePromise;
|
|
418
418
|
function loadSessionModule() {
|
|
419
|
-
sessionModulePromise ??= import("./output-
|
|
419
|
+
sessionModulePromise ??= import("./output-B3MDn7kv.js").then((n) => n.s);
|
|
420
420
|
return sessionModulePromise;
|
|
421
421
|
}
|
|
422
422
|
function loadOutputModule() {
|
|
423
|
-
outputModulePromise ??= import("./output-
|
|
423
|
+
outputModulePromise ??= import("./output-B3MDn7kv.js").then((n) => n.r);
|
|
424
424
|
return outputModulePromise;
|
|
425
425
|
}
|
|
426
426
|
function loadOutputRenderModule() {
|
|
@@ -902,7 +902,7 @@ async function handleSessionsWatch(explicitAgentName, flags, command, config) {
|
|
|
902
902
|
includeClosed: true
|
|
903
903
|
});
|
|
904
904
|
if (!record) throw new Error(missingScopedSessionMessage(agent, sessionName));
|
|
905
|
-
const { runSessionWatch } = await import("./session-watch-
|
|
905
|
+
const { runSessionWatch } = await import("./session-watch-DURyCw31.js");
|
|
906
906
|
await runSessionWatch(record, {
|
|
907
907
|
cursor: flags.cursor,
|
|
908
908
|
policy: resolveRequestedOutputPolicy(globalFlags)
|
|
@@ -2149,7 +2149,7 @@ function registerAgentCommand(program, agentName, config) {
|
|
|
2149
2149
|
}
|
|
2150
2150
|
function registerFlowCommand(program, config) {
|
|
2151
2151
|
program.command("flow").description("Run multi-step ACP workflows from flow files").command("run").description("Run a flow file").argument("<file>", "Flow module path").option("--input-json <json>", "Flow input as JSON").option("--input-file <path>", "Read flow input JSON from file").option("--default-agent <name>", "Default agent profile for ACP nodes without profile", (value) => parseNonEmptyValue("Default agent", value)).action(async function(file, flags) {
|
|
2152
|
-
const { handleFlowRun } = await import("./cli-
|
|
2152
|
+
const { handleFlowRun } = await import("./cli-DXmYwv3U.js");
|
|
2153
2153
|
await handleFlowRun(file, flags, this, config);
|
|
2154
2154
|
});
|
|
2155
2155
|
}
|
|
@@ -197,8 +197,6 @@ declare class AcpClient {
|
|
|
197
197
|
private selectAuthMethod;
|
|
198
198
|
private readAgentSpecificEnvCredential;
|
|
199
199
|
private selectAgentManagedAuthMethod;
|
|
200
|
-
/** Cursor stores the login itself; `cursor_login` has no client credential. */
|
|
201
|
-
private usesCursorCliLogin;
|
|
202
200
|
private isGrokBuildAcpCommand;
|
|
203
201
|
private applyGrokPermissionModeCompatibility;
|
|
204
202
|
private resolveGrokPermissionModeDecision;
|
|
@@ -261,4 +259,4 @@ declare class AcpClient {
|
|
|
261
259
|
}
|
|
262
260
|
//#endregion
|
|
263
261
|
export { AcpControlAuthority as n, AcpClient as t };
|
|
264
|
-
//# sourceMappingURL=client-
|
|
262
|
+
//# sourceMappingURL=client-VQsqcIOJ.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-
|
|
1
|
+
{"version":3,"file":"client-VQsqcIOJ.d.ts","names":[],"sources":["../src/async-control.ts","../src/acp/model-config-state.ts","../src/acp/client.ts"],"mappings":";;;KAcY;EACV,SAAS;EACT;;;;KChBU;EACV;EACA;EACA,iBAAiB;IACf;IACA;;;;;KCsVC;EACH,YAAY;EACZ;EACA;EACA;;KAGU;EACV;EACA;EACA,gBAAgB;EAChB,SAAS;EACT;EACA;;KAGU;EACV;EACA,gBAAgB;EAChB,SAAS;EACT;EACA;;KAGU,sBAAsB;KA4C7B;KAwFO;EACV;EACA,QAAQ,OAAO;EACf;EACA,QAAQ;EACR;;KAGU;EACV;EACA;EACA;EACA,WAAW;;cAoBA;UACH;UACA;UACA;mBACS;mBACA;mBACA;UACT;UACA;UACA;mBAQS;mBAMA;mBACA;UACT;UACA;UACA;UACA;UAMA;0BACgB;UAChB;UACA;mBACS;mBACA;mBACA;UACT;UACA;UAEA;UACA;UACA;UACA;mBACS;mBACA;mBACA;mBACA;mBACA;mBACA;EAEL,YAAA,SAAS;MAsEjB,oBAAoB;EAIxB;EAIA,sBAAsB;EAItB,6BAA6B;EAW7B;EAIA;EAIA;EAIA;EAIA;EAIA;EAIA;EAIA,iBACE,UAAU,KACR;EA0BJ;UAIQ;EAUR,qBAAqB;IACnB,iBAAiB;IACjB,4BAA4B;IAC5B,mBAAmB;IACnB;IACA;IACA;IACA;;UAuBM;UASA;UAcA;EAUR,mBAAmB;E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UA8BN;UAoBA;UAiBM;UAwBN;UAqBA;UAQA;UAQA;UA6BA;UAmBA;UAmBA;UAmBA;UAyBA;UAKA;UAwBA;UASA;UAUM;UAqDN;UAYM;UAmBA;UASA;UASA;UAoBN;UASA;UAMA;UAaA;UAWM;;UAkBN;UAiBA;UAWM;EAgCR,0BAA0B;IAC9B;IACA;MACE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as MAX_TIMER_DELAY_MS, t as createOutputFormatter } from "./output-
|
|
2
|
-
import { C as textPrompt, It as PERMISSION_MODES, R as resolveSessionRecord, Rt as SESSION_RECORD_SCHEMA, S as promptToDisplayText, bt as writePrivateJsonFile, ft as defaultSessionEventLog, yt as writePrivateFile } from "./ipc-
|
|
1
|
+
import { a as MAX_TIMER_DELAY_MS, t as createOutputFormatter } from "./output-B3MDn7kv.js";
|
|
2
|
+
import { C as textPrompt, It as PERMISSION_MODES, R as resolveSessionRecord, Rt as SESSION_RECORD_SCHEMA, S as promptToDisplayText, bt as writePrivateJsonFile, ft as defaultSessionEventLog, yt as writePrivateFile } from "./ipc-BQQpcEdP.js";
|
|
3
3
|
import { P as runTimedExecFile } from "./agent-registry-R7A3MSpr.js";
|
|
4
|
-
import { G as recordSessionUpdate, H as createSessionConversation, U as recordClientOperation, W as recordPromptSubmission, dt as TimeoutError, i as runOnce, m as createSessionWithClient, mt as withTimeout, o as sendSessionDirect, pt as withInterrupt, q as cloneSessionAcpxState, ut as InterruptedError } from "./queue-owner-runtime-
|
|
4
|
+
import { G as recordSessionUpdate, H as createSessionConversation, U as recordClientOperation, W as recordPromptSubmission, dt as TimeoutError, i as runOnce, m as createSessionWithClient, mt as withTimeout, o as sendSessionDirect, pt as withInterrupt, q as cloneSessionAcpxState, ut as InterruptedError } from "./queue-owner-runtime-DXCVngwU.js";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { spawn } from "node:child_process";
|
|
7
7
|
import fs from "node:fs/promises";
|
|
@@ -2471,4 +2471,4 @@ function formatDecisionPrompt(question, choices, field) {
|
|
|
2471
2471
|
//#endregion
|
|
2472
2472
|
export { parseStrictJsonObject as a, validateFlowDefinition as c, checkpoint as d, compute as f, isDefinedFlow as h, parseJsonObject as i, acp as l, shell as m, decisionEdge as n, FlowRunner as o, defineFlow as p, extractJsonObject as r, flowRunsBaseDir as s, decision as t, action as u };
|
|
2473
2473
|
|
|
2474
|
-
//# sourceMappingURL=flows-
|
|
2474
|
+
//# sourceMappingURL=flows-DJ17ajbw.js.map
|