@codions/portta 0.0.0-develop.176.sha-17c2847 → 0.0.0-develop.178.sha-7d97293

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/cli.js CHANGED
@@ -22501,7 +22501,7 @@ var init_package = __esm({
22501
22501
  "package.json"() {
22502
22502
  package_default = {
22503
22503
  name: "@codions/portta",
22504
- version: "0.0.0-develop.176.sha-17c2847",
22504
+ version: "0.0.0-develop.178.sha-7d97293",
22505
22505
  description: "Machine-first CLI for a shared Docker development gateway",
22506
22506
  license: "MIT",
22507
22507
  type: "module",
@@ -22572,7 +22572,7 @@ var init_version = __esm({
22572
22572
  "use strict";
22573
22573
  init_package();
22574
22574
  CLI_VERSION = package_default.version;
22575
- CLI_BUILD_DATE = true ? "2026-09-18T03:13:20Z" : void 0;
22575
+ CLI_BUILD_DATE = true ? "2026-09-18T03:42:39Z" : void 0;
22576
22576
  }
22577
22577
  });
22578
22578
 
@@ -52044,6 +52044,20 @@ var require_dist = __commonJS({
52044
52044
  });
52045
52045
 
52046
52046
  // ../host/src/modules/taskflow/adapters/config.ts
52047
+ var config_exports = {};
52048
+ __export(config_exports, {
52049
+ expandTemplate: () => expandTemplate,
52050
+ getDefaultProfileName: () => getDefaultProfileName,
52051
+ gitRoot: () => gitRoot,
52052
+ isDockerProfile: () => isDockerProfile,
52053
+ loadConfig: () => loadConfig,
52054
+ persistLocalCustomAgent: () => persistLocalCustomAgent,
52055
+ persistLocalGitHubConfig: () => persistLocalGitHubConfig,
52056
+ persistLocalLinearConfig: () => persistLocalLinearConfig,
52057
+ persistLocalMultiplexer: () => persistLocalMultiplexer,
52058
+ projectRoot: () => projectRoot,
52059
+ removeLocalCustomAgent: () => removeLocalCustomAgent
52060
+ });
52047
52061
  import { execFileSync } from "node:child_process";
52048
52062
  import { readFileSync as readFileSync10 } from "node:fs";
52049
52063
  import { mkdir, writeFile } from "node:fs/promises";
@@ -52214,6 +52228,32 @@ function parseCustomAgents(raw2) {
52214
52228
  return acc;
52215
52229
  }, {});
52216
52230
  }
52231
+ function cloneAcpProviders(providers) {
52232
+ return Object.fromEntries(
52233
+ Object.entries(providers).map(([id, provider]) => [id, { ...provider, args: [...provider.args] }])
52234
+ );
52235
+ }
52236
+ function parseAcpProvider(id, raw2) {
52237
+ if (!isRecord2(raw2)) return null;
52238
+ if (typeof raw2.command !== "string" || !raw2.command.trim()) return null;
52239
+ return {
52240
+ label: typeof raw2.label === "string" && raw2.label.trim() ? raw2.label.trim() : id,
52241
+ command: raw2.command.trim(),
52242
+ args: Array.isArray(raw2.args) ? raw2.args.filter((entry) => typeof entry === "string") : []
52243
+ };
52244
+ }
52245
+ function parseAcpProviders(raw2) {
52246
+ if (!isRecord2(raw2)) return {};
52247
+ return Object.entries(raw2).reduce((acc, [id, value3]) => {
52248
+ const key = id.trim();
52249
+ if (!key) return acc;
52250
+ const parsed = parseAcpProvider(key, value3);
52251
+ if (parsed) {
52252
+ acc[key] = parsed;
52253
+ }
52254
+ return acc;
52255
+ }, {});
52256
+ }
52217
52257
  function parseServices(raw2) {
52218
52258
  if (!Array.isArray(raw2)) return [];
52219
52259
  return raw2.filter(isRecord2).filter((entry) => typeof entry.name === "string" && typeof entry.portEnv === "string").map((entry) => ({
@@ -52309,6 +52349,7 @@ function parseProjectConfig2(parsed) {
52309
52349
  profiles: parseProfiles(parsed.profiles, true),
52310
52350
  exposure: parseExposure(parsed.exposure),
52311
52351
  agents: {},
52352
+ providers: parseAcpProviders(parsed.providers),
52312
52353
  services: parseServices(parsed.services),
52313
52354
  startupEnvs: parseStartupEnvs(parsed.startupEnvs),
52314
52355
  integrations: {
@@ -52383,6 +52424,7 @@ function loadLocalProjectConfigOverlay(root2) {
52383
52424
  worktreeRoot: null,
52384
52425
  profiles: {},
52385
52426
  agents: {},
52427
+ providers: {},
52386
52428
  lifecycleHooks: {},
52387
52429
  linear: null,
52388
52430
  github: null,
@@ -52396,6 +52438,7 @@ function loadLocalProjectConfigOverlay(root2) {
52396
52438
  worktreeRoot: ws ? parseWorktreeRoot(ws, "") || null : null,
52397
52439
  profiles: parseProfiles(parsed.profiles, false),
52398
52440
  agents: parseCustomAgents(parsed.agents),
52441
+ providers: parseAcpProviders(parsed.providers),
52399
52442
  lifecycleHooks: parseLifecycleHooks(parsed.lifecycleHooks),
52400
52443
  linear: parseLocalLinearOverlay(parsed),
52401
52444
  github: parseLocalGitHubOverlay(parsed),
@@ -52407,6 +52450,7 @@ function loadLocalProjectConfigOverlay(root2) {
52407
52450
  worktreeRoot: null,
52408
52451
  profiles: {},
52409
52452
  agents: {},
52453
+ providers: {},
52410
52454
  lifecycleHooks: {},
52411
52455
  linear: null,
52412
52456
  github: null,
@@ -52481,6 +52525,10 @@ function loadConfig(dir, options = {}) {
52481
52525
  ...cloneAgents(projectConfig.agents),
52482
52526
  ...cloneAgents(localOverlay.agents)
52483
52527
  },
52528
+ providers: {
52529
+ ...cloneAcpProviders(projectConfig.providers),
52530
+ ...cloneAcpProviders(localOverlay.providers)
52531
+ },
52484
52532
  lifecycleHooks: mergeLifecycleHooks(projectConfig.lifecycleHooks, localOverlay.lifecycleHooks),
52485
52533
  integrations
52486
52534
  };
@@ -52585,6 +52633,7 @@ var init_config5 = __esm({
52585
52633
  profiles: { default: DEFAULT_PROFILE },
52586
52634
  exposure: { local: { provider: "loopback", autoExpose: "all" } },
52587
52635
  agents: {},
52636
+ providers: {},
52588
52637
  services: [],
52589
52638
  startupEnvs: {},
52590
52639
  integrations: {
@@ -71202,6 +71251,9 @@ var init_acp_direct_session_service = __esm({
71202
71251
  });
71203
71252
 
71204
71253
  // ../host/src/modules/taskflow/workflows/dsl/types.ts
71254
+ function isBuiltinProvider(id) {
71255
+ return BUILTIN_PROVIDER_IDS.includes(id);
71256
+ }
71205
71257
  function emptyUsage() {
71206
71258
  return { inputTokens: 0, outputTokens: 0, costUsd: 0 };
71207
71259
  }
@@ -71212,11 +71264,11 @@ function addUsage(a3, b) {
71212
71264
  costUsd: a3.costUsd + b.costUsd
71213
71265
  };
71214
71266
  }
71215
- var PROVIDER_IDS, DEFAULTS;
71267
+ var BUILTIN_PROVIDER_IDS, DEFAULTS;
71216
71268
  var init_types2 = __esm({
71217
71269
  "../host/src/modules/taskflow/workflows/dsl/types.ts"() {
71218
71270
  "use strict";
71219
- PROVIDER_IDS = ["codex", "claude-code", "opencode", "pi"];
71271
+ BUILTIN_PROVIDER_IDS = ["codex", "claude-code", "opencode", "pi"];
71220
71272
  DEFAULTS = {
71221
71273
  provider: "codex",
71222
71274
  sandbox: "read-only",
@@ -71229,6 +71281,41 @@ var init_types2 = __esm({
71229
71281
  }
71230
71282
  });
71231
71283
 
71284
+ // ../host/src/modules/taskflow/services/acp-providers.ts
71285
+ var acp_providers_exports = {};
71286
+ __export(acp_providers_exports, {
71287
+ BUILTIN_ACP_PROVIDERS: () => BUILTIN_ACP_PROVIDERS,
71288
+ availableProviders: () => availableProviders,
71289
+ resolveAcpProviders: () => resolveAcpProviders
71290
+ });
71291
+ function resolveAcpProviders(declared) {
71292
+ const registry2 = /* @__PURE__ */ new Map();
71293
+ for (const id of BUILTIN_PROVIDER_IDS) {
71294
+ const provider = BUILTIN_ACP_PROVIDERS[id];
71295
+ registry2.set(id, { id, label: provider.label, command: provider.command, args: [...provider.args], builtin: true });
71296
+ }
71297
+ for (const [id, provider] of Object.entries(declared)) {
71298
+ registry2.set(id, { id, label: provider.label, command: provider.command, args: [...provider.args], builtin: false });
71299
+ }
71300
+ return registry2;
71301
+ }
71302
+ function availableProviders(registry2) {
71303
+ return Array.from(registry2.keys()).join(", ");
71304
+ }
71305
+ var BUILTIN_ACP_PROVIDERS;
71306
+ var init_acp_providers = __esm({
71307
+ "../host/src/modules/taskflow/services/acp-providers.ts"() {
71308
+ "use strict";
71309
+ init_types2();
71310
+ BUILTIN_ACP_PROVIDERS = {
71311
+ codex: { label: "Codex", command: "codex-acp", args: [] },
71312
+ "claude-code": { label: "Claude Code", command: "claude-agent-acp", args: [] },
71313
+ opencode: { label: "OpenCode", command: "opencode", args: ["acp"] },
71314
+ pi: { label: "Pi", command: "pi-acp", args: [] }
71315
+ };
71316
+ }
71317
+ });
71318
+
71232
71319
  // ../host/src/modules/taskflow/workflows/runtime/journal.ts
71233
71320
  import { appendFileSync as appendFileSync2, existsSync as existsSync10, mkdirSync as mkdirSync11, readdirSync as readdirSync3, readFileSync as readFileSync13, writeFileSync as writeFileSync8 } from "node:fs";
71234
71321
  import { dirname as dirname16, join as join23 } from "node:path";
@@ -81132,6 +81219,7 @@ var DefaultWorkerFactory;
81132
81219
  var init_factory = __esm({
81133
81220
  "../host/src/modules/taskflow/workflows/worker/factory.ts"() {
81134
81221
  "use strict";
81222
+ init_types2();
81135
81223
  init_claude();
81136
81224
  init_codex();
81137
81225
  init_fake();
@@ -81154,6 +81242,13 @@ var init_factory = __esm({
81154
81242
  }
81155
81243
  create(id) {
81156
81244
  if (this.opts.fake) return new FakeWorker();
81245
+ if (!isBuiltinProvider(id)) {
81246
+ throw new AgentError({
81247
+ provider: id,
81248
+ code: "unknown_provider",
81249
+ message: `unknown provider: ${id} \u2014 the workflow engine runs ${BUILTIN_PROVIDER_IDS.join(", ")}; a provider declared in taskflow.yaml needs the ACP transport`
81250
+ });
81251
+ }
81157
81252
  switch (id) {
81158
81253
  case "codex":
81159
81254
  return new CodexWorker({ bin: this.opts.codexBin });
@@ -81554,6 +81649,11 @@ function checkSpecEnum(field, value3) {
81554
81649
  throw new WorkflowError(`invalid ${field} "${value3}" \u2014 must be one of ${allowed.join(", ")}`);
81555
81650
  }
81556
81651
  }
81652
+ function checkProvider(value3, known) {
81653
+ if (value3 !== void 0 && !known.includes(value3)) {
81654
+ throw new WorkflowError(`invalid provider "${value3}" \u2014 must be one of ${known.join(", ")}`);
81655
+ }
81656
+ }
81557
81657
  function checkProviderModelPair(provider, model, site) {
81558
81658
  if (provider === void 0 === (model === void 0)) return;
81559
81659
  const given = provider !== void 0 ? `provider "${provider}" without model` : `model "${model}" without provider`;
@@ -81601,7 +81701,6 @@ var init_primitives = __esm({
81601
81701
  AgentFailedError = class extends WorkflowError {
81602
81702
  };
81603
81703
  SPEC_ENUMS = {
81604
- provider: PROVIDER_IDS,
81605
81704
  sandbox: ["read-only", "workspace-write", "danger-full-access"],
81606
81705
  effort: ["none", "minimal", "low", "medium", "high", "xhigh", "max"],
81607
81706
  approval: ["never", "on-request"]
@@ -81706,7 +81805,7 @@ var init_primitives = __esm({
81706
81805
  schema: opts?.schema,
81707
81806
  maxTurns: opts?.maxTurns
81708
81807
  };
81709
- checkSpecEnum("provider", spec.provider);
81808
+ checkProvider(spec.provider, this.o.knownProviders ?? BUILTIN_PROVIDER_IDS);
81710
81809
  checkSpecEnum("sandbox", spec.sandbox);
81711
81810
  checkSpecEnum("effort", spec.effort);
81712
81811
  checkSpecEnum("approval", spec.approval);
@@ -82304,6 +82403,7 @@ async function runWorkflow(opts) {
82304
82403
  runId,
82305
82404
  defaults,
82306
82405
  factory,
82406
+ knownProviders: opts.knownProviders ?? BUILTIN_PROVIDER_IDS,
82307
82407
  journal,
82308
82408
  loaded,
82309
82409
  events,
@@ -82353,7 +82453,7 @@ function resolveDefaults(meta3, opts) {
82353
82453
  checkSpecEnum("sandbox", sandbox);
82354
82454
  checkSpecEnum("effort", o2.effort);
82355
82455
  const provider = o2.provider ?? meta3.defaultProvider ?? DEFAULTS.provider;
82356
- checkSpecEnum("provider", provider);
82456
+ checkProvider(provider, opts.knownProviders ?? BUILTIN_PROVIDER_IDS);
82357
82457
  checkProviderModelPair(o2.provider, o2.model, "--provider/--model");
82358
82458
  checkProviderModelPair(meta3.defaultProvider, meta3.defaultModel, "meta.defaultProvider/defaultModel");
82359
82459
  const configuredCwd = o2.cwd ?? opts.roots?.workspaceRoot;
@@ -82445,26 +82545,23 @@ function eventProgress(event, context) {
82445
82545
  });
82446
82546
  }
82447
82547
  }
82448
- var launchByProvider, AcpWorker, AcpWorkerFactory;
82548
+ var AcpWorker, AcpWorkerFactory;
82449
82549
  var init_acp_worker_factory = __esm({
82450
82550
  "../host/src/modules/taskflow/services/acp-worker-factory.ts"() {
82451
82551
  "use strict";
82452
82552
  init_workflows();
82453
- launchByProvider = {
82454
- codex: { command: "codex-acp", args: [] },
82455
- "claude-code": { command: "claude-agent-acp", args: [] },
82456
- opencode: { command: "opencode", args: ["acp"] },
82457
- pi: { command: "pi-acp", args: [] }
82458
- };
82553
+ init_acp_providers();
82459
82554
  AcpWorker = class {
82460
82555
  id;
82556
+ launch;
82461
82557
  supervisor;
82462
82558
  runId;
82463
82559
  permissionMode;
82464
82560
  mcpServers;
82465
82561
  resolveExecution;
82466
- constructor(id, supervisor, runId, permissionMode, mcpServers, resolveExecution) {
82467
- this.id = id;
82562
+ constructor(provider, supervisor, runId, permissionMode, mcpServers, resolveExecution) {
82563
+ this.id = provider.id;
82564
+ this.launch = { command: provider.command, args: provider.args };
82468
82565
  this.supervisor = supervisor;
82469
82566
  this.runId = runId;
82470
82567
  this.permissionMode = permissionMode;
@@ -82472,7 +82569,7 @@ var init_acp_worker_factory = __esm({
82472
82569
  this.resolveExecution = resolveExecution;
82473
82570
  }
82474
82571
  async runAgent(spec, context) {
82475
- const launch = launchByProvider[this.id];
82572
+ const launch = this.launch;
82476
82573
  const operationId = `${this.runId}:${context.operationKey ?? crypto.randomUUID()}`;
82477
82574
  const route = this.resolveExecution(spec.cwd);
82478
82575
  await this.supervisor.start({
@@ -82522,13 +82619,15 @@ var init_acp_worker_factory = __esm({
82522
82619
  AcpWorkerFactory = class {
82523
82620
  workers = /* @__PURE__ */ new Map();
82524
82621
  supervisor;
82622
+ providers;
82525
82623
  runId;
82526
82624
  permissionMode;
82527
82625
  mcpServers;
82528
82626
  resolveExecution;
82529
82627
  onShutdown;
82530
- constructor(supervisor, runId, permissionMode, mcpServers, resolveExecution, onShutdown) {
82628
+ constructor(supervisor, providers, runId, permissionMode, mcpServers, resolveExecution, onShutdown) {
82531
82629
  this.supervisor = supervisor;
82630
+ this.providers = providers;
82532
82631
  this.runId = runId;
82533
82632
  this.permissionMode = permissionMode;
82534
82633
  this.mcpServers = mcpServers;
@@ -82538,8 +82637,16 @@ var init_acp_worker_factory = __esm({
82538
82637
  get(id) {
82539
82638
  const existing = this.workers.get(id);
82540
82639
  if (existing) return existing;
82640
+ const provider = this.providers.get(id);
82641
+ if (!provider) {
82642
+ throw new AgentError({
82643
+ provider: id,
82644
+ code: "unknown_provider",
82645
+ message: `unknown provider "${id}" \u2014 available: ${availableProviders(this.providers)}`
82646
+ });
82647
+ }
82541
82648
  const worker = new AcpWorker(
82542
- id,
82649
+ provider,
82543
82650
  this.supervisor,
82544
82651
  this.runId,
82545
82652
  this.permissionMode,
@@ -86520,10 +86627,12 @@ var init_workflow_runner = __esm({
86520
86627
  invoke;
86521
86628
  createExecutionPort;
86522
86629
  createWorkerFactory;
86630
+ knownProviders;
86523
86631
  constructor(dependencies = {}) {
86524
86632
  this.invoke = dependencies.runWorkflow ?? runWorkflow;
86525
86633
  this.createExecutionPort = dependencies.createExecutionPort;
86526
86634
  this.createWorkerFactory = dependencies.createWorkerFactory;
86635
+ this.knownProviders = dependencies.knownProviders;
86527
86636
  }
86528
86637
  run(spec, control = {}) {
86529
86638
  const emit = control.onMessage ?? (() => {
@@ -86555,6 +86664,7 @@ var init_workflow_runner = __esm({
86555
86664
  roots: { dataRoot: spec.spec.dataRoot, workspaceRoot: spec.spec.cwd },
86556
86665
  externalContext: spec.spec.externalContext,
86557
86666
  factory: this.createWorkerFactory?.(spec) ?? new DefaultWorkerFactory(spec.spec.fake ? { fake: true } : { fake: false, ...resolveWorkerBins() }),
86667
+ knownProviders: this.knownProviders?.(spec),
86558
86668
  executionPort: this.createExecutionPort?.(spec),
86559
86669
  signal: abort.signal,
86560
86670
  onEvent: (event) => {
@@ -88630,6 +88740,7 @@ function createProjectApp(runtime2, instancePrefix, host2) {
88630
88740
  const PROJECT_DIR = runtime2.projectDir;
88631
88741
  const installationId = `${RUNTIME_IDENTITY.tmuxPrefix}-${PORT}`;
88632
88742
  const config3 = runtime2.config;
88743
+ const acpProviders = resolveAcpProviders(config3.providers);
88633
88744
  const git5 = runtime2.git;
88634
88745
  const archiveStateService = runtime2.archiveStateService;
88635
88746
  const sessions3 = runtime2.sessions;
@@ -88747,6 +88858,7 @@ function createProjectApp(runtime2, instancePrefix, host2) {
88747
88858
  terminalCommand: terminalCommandForEnvironment
88748
88859
  },
88749
88860
  workflowRunner: new NodeWorkflowRunner({
88861
+ knownProviders: (spec) => workflowAgentRuntimeConfig(spec.spec.agentRuntime).transport === "acp" ? [...acpProviders.keys()] : BUILTIN_PROVIDER_IDS,
88750
88862
  createWorkerFactory: (spec) => {
88751
88863
  const agentRuntime = workflowAgentRuntimeConfig(spec.spec.agentRuntime);
88752
88864
  if (agentRuntime.transport === "acp") {
@@ -88755,6 +88867,7 @@ function createProjectApp(runtime2, instancePrefix, host2) {
88755
88867
  workflowEnvironmentPaths.set(spec.runId, paths4);
88756
88868
  return new AcpWorkerFactory(
88757
88869
  supervisor,
88870
+ acpProviders,
88758
88871
  spec.runId,
88759
88872
  agentRuntime.permissionMode,
88760
88873
  agentRuntime.mcpServers,
@@ -89461,6 +89574,7 @@ var init_project_app = __esm({
89461
89574
  init_http();
89462
89575
  init_log2();
89463
89576
  init_acp_direct_session_service();
89577
+ init_acp_providers();
89464
89578
  init_acp_worker_factory();
89465
89579
  init_agent_chat_service();
89466
89580
  init_agent_registry();
@@ -89493,6 +89607,7 @@ var init_project_app = __esm({
89493
89607
  init_workflow_runner();
89494
89608
  init_workspace_facade();
89495
89609
  init_worktree_conversation_service();
89610
+ init_workflows();
89496
89611
  init_project_environments();
89497
89612
  }
89498
89613
  });
@@ -90257,7 +90372,7 @@ function createDaemonTaskflowHost(context) {
90257
90372
  port: hostListen(env).port,
90258
90373
  workflowBuiltinsDir: taskflowAssets(env).workflowBuiltinsDir,
90259
90374
  version: env.PORTTA_VERSION || "0.0.0-local",
90260
- buildDate: true ? "2026-09-18T03:13:20Z" : (/* @__PURE__ */ new Date()).toISOString(),
90375
+ buildDate: true ? "2026-09-18T03:42:39Z" : (/* @__PURE__ */ new Date()).toISOString(),
90261
90376
  environmentStore: createEnvironmentStore(paths3.database),
90262
90377
  hostEnvironmentProvider: new HostEnvironmentProvider(),
90263
90378
  devContainerProvider: new DevContainerProvider(),
@@ -108785,6 +108900,14 @@ var init_server_port = __esm({
108785
108900
  });
108786
108901
 
108787
108902
  // ../host/src/modules/taskflow/lib/shell.ts
108903
+ var shell_exports = {};
108904
+ __export(shell_exports, {
108905
+ detectProjectName: () => detectProjectName,
108906
+ getGitRoot: () => getGitRoot,
108907
+ resolveExecutablePath: () => resolveExecutablePath,
108908
+ run: () => run,
108909
+ which: () => which
108910
+ });
108788
108911
  import { spawnSync as spawnSync8 } from "node:child_process";
108789
108912
  import { existsSync as existsSync26, readFileSync as readFileSync24 } from "node:fs";
108790
108913
  import { basename as basename16, join as join49 } from "node:path";
@@ -108801,6 +108924,12 @@ function run(cmd, args, opts) {
108801
108924
  stderr: result.stderr ?? Buffer.alloc(0)
108802
108925
  };
108803
108926
  }
108927
+ function resolveExecutablePath(tool) {
108928
+ return resolveHostTool(tool);
108929
+ }
108930
+ function which(tool) {
108931
+ return resolveExecutablePath(tool) !== null;
108932
+ }
108804
108933
  function getGitRoot() {
108805
108934
  const result = run("git", ["rev-parse", "--show-toplevel"]);
108806
108935
  if (!result.success) return null;
@@ -114271,6 +114400,16 @@ async function cmdDoctor() {
114271
114400
  ` opencode : ${withMin(check4(opencodeBin, ["--version"]), OPENCODE_MIN_VERSION2, "upgrade the opencode CLI")}`
114272
114401
  );
114273
114402
  console.log(` pi : ${withMin(piOut, PI_MIN_VERSION2, "npm i -g @earendil-works/pi-coding-agent")}`);
114403
+ const { loadConfig: loadConfig2 } = await Promise.resolve().then(() => (init_config5(), config_exports));
114404
+ const { resolveAcpProviders: resolveAcpProviders2 } = await Promise.resolve().then(() => (init_acp_providers(), acp_providers_exports));
114405
+ const { resolveExecutablePath: resolveExecutablePath2 } = await Promise.resolve().then(() => (init_shell2(), shell_exports));
114406
+ const providers = resolveAcpProviders2(loadConfig2(process.cwd()).providers);
114407
+ const width = Math.max(...Array.from(providers.keys(), (id) => id.length));
114408
+ for (const provider of providers.values()) {
114409
+ const resolved2 = resolveExecutablePath2(provider.command);
114410
+ const status = resolved2 ? resolved2 : provider.builtin ? `NOT FOUND \u2014 install the ${provider.label} ACP adapter` : `NOT FOUND \u2014 declared in .portta/taskflow.yaml; install "${provider.command}" or fix the command`;
114411
+ console.log(` acp ${provider.id.padEnd(width)} : ${status}`);
114412
+ }
114274
114413
  console.log(` data dir : ${dataRoot()}`);
114275
114414
  }
114276
114415
  function readSkill(skillPath) {
@@ -114383,7 +114522,7 @@ var init_cli = __esm({
114383
114522
  "project",
114384
114523
  "force"
114385
114524
  ]);
114386
- PROVIDERS = PROVIDER_IDS;
114525
+ PROVIDERS = BUILTIN_PROVIDER_IDS;
114387
114526
  SANDBOXES = ["read-only", "workspace-write", "danger-full-access"];
114388
114527
  EFFORTS = ["none", "minimal", "low", "medium", "high", "xhigh", "max"];
114389
114528
  if (invokedDirectly()) {
@@ -115391,6 +115530,7 @@ var RepositoryGitSummary = named(
115391
115530
  changed: external_exports.number().int().describe("staged + unstaged + untracked + unmerged"),
115392
115531
  ahead: external_exports.number().int(),
115393
115532
  behind: external_exports.number().int(),
115533
+ base: external_exports.string().nullable().describe("The upstream ref ahead and behind are measured against, such as origin/main"),
115394
115534
  collectedAt: unixSeconds,
115395
115535
  stale: external_exports.boolean()
115396
115536
  }).strict(),
@@ -116865,6 +117005,16 @@ var DevelopmentOverview = named4(
116865
117005
  }).strict(),
116866
117006
  "DevelopmentOverview"
116867
117007
  );
117008
+ var ContextWorktree = named4(
117009
+ external_exports.object({
117010
+ path: external_exports.string().describe("The checkout on the host"),
117011
+ branch: external_exports.string(),
117012
+ base: external_exports.string().nullable().describe("The branch it was cut from, when recorded"),
117013
+ environmentId: external_exports.string().nullable().describe("The Taskflow environment that runs it, when one does"),
117014
+ environment: external_exports.string().nullable().describe("The adopted Environment that runs it, by name, when the panel sees one")
117015
+ }).strict(),
117016
+ "ContextWorktree"
117017
+ );
116868
117018
  var ContextRepository = named4(
116869
117019
  external_exports.object({
116870
117020
  id: external_exports.string(),
@@ -116874,7 +117024,8 @@ var ContextRepository = named4(
116874
117024
  remoteUrl: external_exports.string().nullable(),
116875
117025
  git: RepositoryGitSummary.nullable(),
116876
117026
  instructions: external_exports.array(InstructionFile),
116877
- environments: external_exports.array(external_exports.string())
117027
+ environments: external_exports.array(external_exports.string()),
117028
+ worktrees: external_exports.array(ContextWorktree).describe("Linked worktrees of this repository; empty when Taskflow is off or knows none")
116878
117029
  }).strict(),
116879
117030
  "ContextRepository"
116880
117031
  );
@@ -116891,8 +117042,12 @@ var ContextEnvironment = named4(
116891
117042
  }).strict(),
116892
117043
  "ContextEnvironment"
116893
117044
  );
117045
+ var DEVELOPMENT_CONTEXT_SCHEMA = "development-context";
117046
+ var DEVELOPMENT_CONTEXT_VERSION = 1;
116894
117047
  var DevelopmentContext = named4(
116895
117048
  external_exports.object({
117049
+ schema: external_exports.literal(DEVELOPMENT_CONTEXT_SCHEMA),
117050
+ version: external_exports.literal(DEVELOPMENT_CONTEXT_VERSION),
116896
117051
  generatedAt: unixSeconds4,
116897
117052
  actor: external_exports.string().nullable(),
116898
117053
  /** What the caller may do here, as `resource:action`. */
@@ -116912,7 +117067,8 @@ var DevelopmentContext = named4(
116912
117067
  repositories: external_exports.array(external_exports.object({ repository: external_exports.string(), path: external_exports.string(), audience: external_exports.string(), content: external_exports.string().nullable(), truncated: external_exports.boolean() }).strict()),
116913
117068
  issue: external_exports.string().nullable().describe("The issue body and comments, when an issue was named")
116914
117069
  }).strict(),
116915
- commands: external_exports.record(external_exports.string(), external_exports.string()).describe("The CLI verbs that matter here, ready to copy")
117070
+ commands: external_exports.record(external_exports.string(), external_exports.string()).describe("The CLI verbs that matter here, ready to copy"),
117071
+ diagnostics: external_exports.array(Diagnostic).describe("What is observed and wrong here: a stale scan, a stopped Environment, a repository without a path")
116916
117072
  }).strict(),
116917
117073
  "DevelopmentContext"
116918
117074
  );
@@ -128668,7 +128824,7 @@ function registerTools(server, call2, resolvePath2) {
128668
128824
  }, async ({ project: project2 }) => asSdkResult2(call2("GET", `/projects/${ref(project2)}`)));
128669
128825
  server.registerTool("get_context", {
128670
128826
  title: "The Development Context of a Project",
128671
- description: "What to read before working: the Project, its repositories and branches, the issue (when given), the environments and how to reach them, and the instruction files that apply.",
128827
+ description: "What to read before working: the Project, its repositories with their branches and worktrees, the issue (when given), the environments and how to reach them, the instruction files that apply, and the diagnostics that say what needs doing first. The body names its own schema and version.",
128672
128828
  inputSchema: { project: PROJECT2, issue: ISSUE.optional() }
128673
128829
  }, async ({ project: project2, issue: issue2 }) => asSdkResult2(call2("GET", `/projects/${ref(project2)}/context${search({ issue: issue2 })}`)));
128674
128830
  server.registerTool("list_repositories", {
@@ -128843,13 +128999,17 @@ async function projectsContext(slug2, options, command) {
128843
128999
  const repositories = context["repositories"];
128844
129000
  const environments = context["environments"];
128845
129001
  const instructions = context["instructions"];
129002
+ const diagnostics = context["diagnostics"] ?? [];
128846
129003
  output2.line(`# ${project2.name} (${project2.slug})${project2.path ? ` \xB7 ${project2.path}` : ""}`);
128847
129004
  output2.line("");
128848
129005
  if (issue2) {
128849
129006
  output2.line(`issue: ${issueRefLabel(issue2.ref)} ${issue2.title} \xB7 ${issue2.state} \xB7 ${issue2.url}`);
128850
129007
  output2.line("");
128851
129008
  }
128852
- for (const r2 of repositories) output2.line(`repository ${r2.name}${r2.path ? ` at ${r2.path}` : ""}${r2.git ? ` \xB7 ${r2.git.branch ?? "detached"}${r2.git.dirty ? " (dirty)" : ""}` : ""}${r2.instructions.length ? ` \xB7 reads ${r2.instructions.map((f) => f.path).join(", ")}` : ""}`);
129009
+ for (const r2 of repositories) {
129010
+ output2.line(`repository ${r2.name}${r2.path ? ` at ${r2.path}` : ""}${r2.git ? ` \xB7 ${r2.git.branch ?? "detached"}${r2.git.base ? ` \u2190 ${r2.git.base}` : ""}${r2.git.dirty ? " (dirty)" : ""}` : ""}${r2.instructions.length ? ` \xB7 reads ${r2.instructions.map((f) => f.path).join(", ")}` : ""}`);
129011
+ for (const w of r2.worktrees ?? []) output2.line(` worktree ${w.path} \xB7 ${w.branch}${w.base ? ` \u2190 ${w.base}` : ""}${w.environment ? ` \xB7 ${w.environment}` : ""}`);
129012
+ }
128853
129013
  for (const e of environments) {
128854
129014
  output2.line(`environment ${e.name} \xB7 ${e.running ? "running" : `stopped (${e.startCommand})`}${e.branch ? ` \xB7 ${e.branch}` : ""}`);
128855
129015
  for (const s of e.services) output2.line(` ${s.name.padEnd(16)} ${s.state.padEnd(10)} ${s.access.primary?.url ?? "-"}`);
@@ -128858,6 +129018,12 @@ async function projectsContext(slug2, options, command) {
128858
129018
  output2.line("");
128859
129019
  output2.line(instructions.issue);
128860
129020
  }
129021
+ const rank = { fail: 0, warn: 1, info: 2, pass: 3 };
129022
+ const pending = diagnostics.filter((d) => d.status !== "pass").sort((a3, b) => (rank[a3.status] ?? 9) - (rank[b.status] ?? 9));
129023
+ if (pending.length > 0) {
129024
+ output2.line("");
129025
+ for (const d of pending) output2.line(`${d.status.padEnd(5)} ${d.title}: ${d.detail}${d.fix ? ` -> ${d.fix}` : ""}`);
129026
+ }
128861
129027
  output2.line("");
128862
129028
  output2.line("(the platform rules and the full instruction files are in --json)");
128863
129029
  }