pantheon-opencode 1.6.0 → 1.6.2-beta.1

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.
Files changed (115) hide show
  1. package/AGENTS.global.md +11 -11
  2. package/AGENTS.md +2 -2
  3. package/CHANGELOG.md +45 -0
  4. package/README.md +122 -6
  5. package/README.pt-BR.md +14 -9
  6. package/bin/pantheon-init.mjs +255 -39
  7. package/package.json +8 -6
  8. package/plugin.json +1 -1
  9. package/pyproject.toml +1 -1
  10. package/scripts/build-agents-md.mjs +1 -1
  11. package/scripts/doctor.mjs +231 -46
  12. package/scripts/install/agents-md.mjs +2 -1
  13. package/scripts/install/config-migration.mjs +344 -393
  14. package/scripts/install/config-paths.mjs +15 -0
  15. package/scripts/install/interactive.mjs +30 -9
  16. package/scripts/install/interrupt.mjs +78 -0
  17. package/scripts/install/mcp-permissions.mjs +164 -0
  18. package/scripts/install/opencode-state.mjs +91 -0
  19. package/scripts/install/opencode-version.mjs +31 -13
  20. package/scripts/install/opencode-wildcard.mjs +106 -0
  21. package/scripts/install/opencode.mjs +508 -108
  22. package/scripts/install/plan-artifact.mjs +12 -1
  23. package/scripts/install/plugin.mjs +17 -1
  24. package/scripts/install/run-record.mjs +115 -0
  25. package/scripts/install/strings.mjs +35 -6
  26. package/scripts/install/v2-capabilities.mjs +204 -0
  27. package/scripts/package-evidence.mjs +1 -0
  28. package/scripts/release-gates.mjs +7 -2
  29. package/scripts/sandbox-env.sh +174 -0
  30. package/scripts/setup-v2-config.mjs +1703 -0
  31. package/scripts/setup.mjs +415 -0
  32. package/scripts/sync-tui.mjs +9 -1
  33. package/scripts/test-opencode-v2-sandbox.sh +438 -151
  34. package/scripts/update-skills-lock.mjs +30 -0
  35. package/skills-lock.json +10 -10
  36. package/src/agents/aphrodite.md +5 -2
  37. package/src/agents/apollo.md +5 -0
  38. package/src/agents/athena.md +6 -1
  39. package/src/agents/demeter.md +5 -1
  40. package/src/agents/gaia.md +4 -0
  41. package/src/agents/hephaestus.md +6 -1
  42. package/src/agents/hermes.md +6 -3
  43. package/src/agents/iris.md +5 -1
  44. package/src/agents/mnemosyne.md +20 -50
  45. package/src/agents/nyx.md +5 -1
  46. package/src/agents/prometheus.md +4 -0
  47. package/src/agents/talos.md +4 -0
  48. package/src/agents/themis.md +4 -0
  49. package/src/agents/zeus.md +9 -3
  50. package/src/instructions/agent-return-format.instructions.md +1 -1
  51. package/src/instructions/memory-protocol.instructions.md +3 -3
  52. package/src/instructions/test-economy.instructions.md +6 -6
  53. package/src/mcp/pantheon_vision.py +37 -36
  54. package/src/mcp/requirements-mcp.txt +1 -1
  55. package/src/mcp/requirements-vision.txt +1 -1
  56. package/src/pantheon/cost-command.ts +127 -40
  57. package/src/pantheon/delegation-enforce.ts +160 -23
  58. package/src/pantheon/guard-path.ts +162 -0
  59. package/src/pantheon/v2-bounded-read.ts +15 -1
  60. package/src/pantheon/v2-bridge.ts +27 -0
  61. package/src/pantheon/v2-shell-hooks.ts +260 -0
  62. package/src/pantheon/v2-unsupported.mjs +32 -4
  63. package/src/pantheon/v2-vision.ts +34 -29
  64. package/src/pantheon/vision.ts +49 -11
  65. package/src/plugin-v2.ts +413 -60
  66. package/src/plugin.ts +22 -2
  67. package/src/plugins/tui/dist/quota-adapters.d.ts +89 -0
  68. package/src/plugins/tui/dist/quota-adapters.d.ts.map +1 -0
  69. package/src/plugins/tui/dist/quota-adapters.js +1142 -0
  70. package/src/plugins/tui/dist/quota-adapters.js.map +1 -0
  71. package/src/plugins/tui/dist/quota-cli.d.ts +17 -0
  72. package/src/plugins/tui/dist/quota-cli.d.ts.map +1 -0
  73. package/src/plugins/tui/dist/quota-cli.js +184 -0
  74. package/src/plugins/tui/dist/quota-cli.js.map +1 -0
  75. package/src/plugins/tui/dist/quota-rpc-UL2HuFRJ.js +390 -0
  76. package/src/plugins/tui/dist/quota-rpc-UL2HuFRJ.js.map +1 -0
  77. package/src/plugins/tui/dist/server-v2.d.ts +14 -0
  78. package/src/plugins/tui/dist/server-v2.d.ts.map +1 -0
  79. package/src/plugins/tui/dist/server-v2.js +673 -0
  80. package/src/plugins/tui/dist/server-v2.js.map +1 -0
  81. package/src/plugins/tui/dist/tui-v2.d.ts +247 -52
  82. package/src/plugins/tui/dist/tui-v2.d.ts.map +1 -1
  83. package/src/plugins/tui/dist/tui-v2.js +2492 -529
  84. package/src/plugins/tui/dist/tui-v2.js.map +1 -1
  85. package/src/plugins/tui/dist/tui.js +1 -1
  86. package/src/plugins/tui/index-v2.ts +3 -6
  87. package/src/plugins/tui/package-lock.json +11 -11
  88. package/src/plugins/tui/package.json +6 -4
  89. package/src/plugins/tui/src/context-gauge.ts +59 -0
  90. package/src/plugins/tui/src/go-key-diagnostic-ui.ts +100 -0
  91. package/src/plugins/tui/src/go-key-diagnostic.ts +125 -0
  92. package/src/plugins/tui/src/index-v2.tsx +199 -240
  93. package/src/plugins/tui/src/model-usage-limits.ts +4 -0
  94. package/src/plugins/tui/src/quota-adapters.ts +1598 -0
  95. package/src/plugins/tui/src/quota-cli.ts +237 -0
  96. package/src/plugins/tui/src/quota-rpc.ts +209 -0
  97. package/src/plugins/tui/src/quota-v2-model.ts +1032 -0
  98. package/src/plugins/tui/src/quota-v2.tsx +986 -0
  99. package/src/plugins/tui/src/server-v2.ts +841 -0
  100. package/src/plugins/tui/src/sidebar-width.ts +129 -0
  101. package/src/plugins/tui/tsconfig.typecheck.json +1 -1
  102. package/src/plugins/tui/tsdown.config.ts +8 -1
  103. package/src/routing.yml +72 -13
  104. package/src/skills/README.md +4 -0
  105. package/src/skills/agent-coordination/SKILL.md +0 -3
  106. package/src/skills/artifact-management/SKILL.md +0 -3
  107. package/src/skills/auto-continue/SKILL.md +0 -3
  108. package/src/skills/code-review-checklist/SKILL.md +0 -3
  109. package/src/skills/context-compression/SKILL.md +0 -3
  110. package/src/skills/memory-bank/SKILL.md +6 -28
  111. package/src/skills/session-goal/SKILL.md +0 -3
  112. package/src/skills/simplify/SKILL.md +5 -4
  113. package/src/skills/tdd-with-agents/SKILL.md +0 -3
  114. package/src/skills/visual-review-pipeline/SKILL.md +0 -1
  115. package/src/pantheon/memory-context.ts +0 -1017
@@ -11,24 +11,32 @@
11
11
  * under BOTH OpenCode V1 (`opencode` 1.18.x) and V2 (`opencode2`, OpenCode 2.x —
12
12
  * `opencode2 --version` prints "opencode v2.0.22"; an early 2.x prerelease
13
13
  * printed "0.0.0-next-17444", which is history and not a host observation).
14
- * V2 reads the same config locations and normalizes V1
15
- * fields in memory — no native V2 conversion. `--version v2` labels the
16
- * install for the operator; state isolation is a runtime concern
17
- * (OPENCODE_DB ~/.local/share/opencode/opencode-v2.db, service port 49375).
14
+ * V2 reads the same config locations and normalizes V1 fields in memory through
15
+ * migrateV1toV2() (scripts/install/config-migration.mjs), then writes the
16
+ * V2-native `plugins` list. `--version v2` selects that path.
17
+ *
18
+ * State is NOT isolated per generation: both host generations read one OpenCode
19
+ * store, so this CLI claims neither a separate database nor a service port. The
20
+ * installer prints the path an actual resolver returns
21
+ * (scripts/install/opencode-state.mjs).
18
22
  */
19
23
  import fs from 'node:fs'
20
- import os from 'node:os'
21
24
  import path from 'node:path'
22
25
  import { fileURLToPath } from 'node:url'
23
- import { configure as configureUi, tag } from '../scripts/install/cli-ui.mjs'
26
+ import { configure as configureUi, endGaugeLine, tag } from '../scripts/install/cli-ui.mjs'
24
27
  import { resolveComponentSelection } from '../scripts/install/component-selection.mjs'
28
+ import { resolveGlobalConfigDirectory } from '../scripts/install/config-paths.mjs'
25
29
  import { resolveInstallExitCode } from '../scripts/install/exit-codes.mjs'
30
+ import { createInterruptHandler } from '../scripts/install/interrupt.mjs'
31
+ import { parseOpenCodeVersion } from '../scripts/install/opencode-version.mjs'
26
32
  import {
27
33
  createPlanArtifact,
28
34
  loadPlanArtifact,
35
+ planArtifactDigest,
29
36
  savePlanArtifact,
30
37
  } from '../scripts/install/plan-artifact.mjs'
31
38
  import { PROMPT_CANCELED } from '../scripts/install/prompt-result.mjs'
39
+ import { buildRunRecord, readRunRecord, writeRunRecord } from '../scripts/install/run-record.mjs'
32
40
  import {
33
41
  isSupportedNodeVersion,
34
42
  unsupportedNodeVersionMessage,
@@ -233,9 +241,7 @@ async function main() {
233
241
  }
234
242
  }
235
243
 
236
- const presetDir = isProject
237
- ? process.cwd()
238
- : path.join(process.env.XDG_CONFIG_HOME || path.join(os.homedir(), '.config'), 'opencode')
244
+ const presetDir = isProject ? process.cwd() : resolveGlobalConfigDirectory(process.env)
239
245
  const filePath = path.join(presetDir, '.pantheon', 'active-preset.json')
240
246
  const bakPath = path.join(presetDir, '.pantheon', 'active-preset.json.bak')
241
247
 
@@ -323,7 +329,24 @@ async function main() {
323
329
  }
324
330
  }
325
331
  const isProject = reviewedPlan ? reviewedPlan.options.isProject : args.includes('--project')
332
+ const setupTarget = !reviewedPlan ? process.env.PANTHEON_SETUP_TARGET : undefined
333
+ if (setupTarget !== undefined) {
334
+ const expectedGlobalTarget = path.resolve(resolveGlobalConfigDirectory(process.env))
335
+ if (isProject || path.resolve(setupTarget) !== expectedGlobalTarget) {
336
+ console.error(
337
+ '❌ Invalid setup target; it must match the selected global OpenCode config directory',
338
+ )
339
+ process.exit(1)
340
+ }
341
+ }
326
342
  const isDryRun = reviewedPlan ? false : args.includes('--dry-run')
343
+ const setupConfigPreview = args.includes('--setup-config-preview-stdin')
344
+ const setupPlanJson = args.includes('--setup-plan-json')
345
+ const setupApprovedPlanInput = args.includes('--setup-approved-plan-stdin')
346
+ if (setupConfigPreview && !isDryRun) {
347
+ console.error('❌ Setup config previews are accepted only by init --dry-run')
348
+ process.exit(1)
349
+ }
327
350
  // --clean is an alias of --force (both wipe component dirs + recreate venv).
328
351
  const forceReinstall = reviewedPlan
329
352
  ? reviewedPlan.options.clean
@@ -333,6 +356,17 @@ async function main() {
333
356
  const forceHeadless = args.includes('--headless')
334
357
  let autoYes = args.includes('--yes') || args.includes('-y')
335
358
  const isJson = args.includes('--json')
359
+ if (setupPlanJson && (!isDryRun || !isJson || reviewedPlan)) {
360
+ console.error('❌ Setup plan output is available only with init --dry-run --json')
361
+ process.exit(1)
362
+ }
363
+ if (
364
+ setupApprovedPlanInput &&
365
+ (isDryRun || !autoYes || !forceHeadless || reviewedPlan || setupConfigPreview)
366
+ ) {
367
+ console.error('❌ An approved setup plan is accepted only by authorized headless init')
368
+ process.exit(1)
369
+ }
336
370
  const savePlanIndex = args.indexOf('--save-plan')
337
371
  const inlineSavePlan = args.find((arg) => arg.startsWith('--save-plan='))
338
372
  const savePlanPath =
@@ -394,6 +428,9 @@ async function main() {
394
428
  '--yes',
395
429
  '-y',
396
430
  '--json',
431
+ '--setup-config-preview-stdin',
432
+ '--setup-plan-json',
433
+ '--setup-approved-plan-stdin',
397
434
  '--verbose',
398
435
  ].includes(bare)
399
436
  ) {
@@ -434,16 +471,7 @@ async function main() {
434
471
  // --version v1|v2|auto labels the install target. `auto` resolves the
435
472
  // generation from the opencode binary at install time (see
436
473
  // scripts/install/opencode-version.mjs). Invalid values fail fast.
437
- const versionIndex = args.indexOf('--version')
438
- const legacyVersionIndex = args.indexOf('--opencode-version')
439
- const inlineVersion = args.find((arg) => arg.startsWith('--opencode-version='))
440
- const versionOpt = reviewedPlan
441
- ? reviewedPlan.options.version
442
- : versionIndex >= 0
443
- ? (args[versionIndex + 1] ?? null)
444
- : legacyVersionIndex >= 0
445
- ? (args[legacyVersionIndex + 1] ?? null)
446
- : (inlineVersion?.split('=', 2)[1] ?? null)
474
+ const versionOpt = reviewedPlan ? reviewedPlan.options.version : parseOpenCodeVersion(args)
447
475
  if (
448
476
  versionOpt !== null &&
449
477
  versionOpt !== 'v1' &&
@@ -484,16 +512,77 @@ async function main() {
484
512
  process.exit(1)
485
513
  }
486
514
 
515
+ // Version info (resolved BEFORE the authorization prompts: every
516
+ // termination path below has to name its reason from the same table).
517
+ const version = readVersion()
518
+ const { strings } = await import('../scripts/install/strings.mjs')
519
+ const S = strings()
520
+ // Declared before the authorization prompts so a cancel/decline can record
521
+ // what the run decided; filled by the apply below.
522
+ let result = null
523
+ // Where a run record goes when the installer never reports a target: the
524
+ // interactive prompts can cancel before a location is chosen. Mirrors the
525
+ // installer's own default (`~/.config/opencode`), so the record lands next
526
+ // to the config the next run will read.
527
+ const fallbackTarget = isProject ? process.cwd() : resolveGlobalConfigDirectory(process.env)
528
+ /**
529
+ * Persist the one-line record of this run. Bookkeeping is best-effort: a
530
+ * failure is reported, never fatal, and never changes the exit code.
531
+ *
532
+ * @param {{status: string, reason?: string|null, cancelPoint?: string|null, applied: boolean, target?: string}} outcome
533
+ */
534
+ const recordRun = (outcome) => {
535
+ const recordTarget = outcome.target ?? result?.target ?? fallbackTarget
536
+ const record = buildRunRecord({
537
+ status: outcome.status,
538
+ reason: outcome.reason ?? null,
539
+ cancelPoint: outcome.cancelPoint ?? null,
540
+ mode: 'apply',
541
+ applied: outcome.applied,
542
+ pantheonVersion: version,
543
+ })
544
+ const written = writeRunRecord(recordTarget, record)
545
+ if (!written.written) {
546
+ console.error(S.runRecordFailed(written.error ?? written.path))
547
+ }
548
+ }
549
+
550
+ // A previous run that applied nothing is worth one line on the next run:
551
+ // "canceled at the review prompt" is otherwise a thing the user has to
552
+ // rediscover. Only non-applied outcomes are surfaced; a normal re-install is
553
+ // not news.
554
+ if (!isDryRun && !isJson) {
555
+ const previous = readRunRecord(reviewedPlan ? reviewedPlan.target.path : fallbackTarget)
556
+ if (previous !== null && previous.applied === false && previous.status !== 'plan') {
557
+ console.log(` ${S.previousRun(previous.summary ?? previous.status)}`)
558
+ }
559
+ }
560
+
487
561
  if (reviewedPlan && !autoYes) {
488
562
  if (!forceHeadless && process.stdin.isTTY && process.stdout.isTTY) {
489
563
  const authorization = await authorizeReviewedPlan(reviewedPlan)
490
564
  if (authorization === PROMPT_CANCELED) {
491
- console.log('❌ Install canceled; no files were written.')
565
+ // The prompt already printed the single cancel line, naming the
566
+ // review point; only the exit code and the record are left.
567
+ recordRun({
568
+ status: 'canceled',
569
+ reason: 'canceled',
570
+ cancelPoint: 'review',
571
+ applied: false,
572
+ target: reviewedPlan.target.path,
573
+ })
492
574
  process.exitCode = 130
493
575
  return
494
576
  }
495
577
  if (!authorization) {
496
- console.log('❌ Install declined; no files were written.')
578
+ console.error(S.declinedAt(S.cancelPoints.review))
579
+ recordRun({
580
+ status: 'declined',
581
+ reason: 'declined',
582
+ cancelPoint: 'review',
583
+ applied: false,
584
+ target: reviewedPlan.target.path,
585
+ })
497
586
  return
498
587
  }
499
588
  } else {
@@ -503,11 +592,6 @@ async function main() {
503
592
  autoYes = true
504
593
  }
505
594
 
506
- // Version info
507
- const version = readVersion()
508
- const { strings } = await import('../scripts/install/strings.mjs')
509
- const S = strings()
510
-
511
595
  const planTimestamp = reviewedPlan?.planned_at ?? new Date().toISOString()
512
596
  const stdoutWrite = process.stdout.write
513
597
  if (isJson) process.stdout.write = () => true
@@ -519,11 +603,74 @@ async function main() {
519
603
  }
520
604
  }
521
605
 
522
- let result
606
+ // Ctrl-C was unhandled anywhere in bin/ or scripts/install/, so an
607
+ // interrupted install died without printing anything and without leaving a
608
+ // trace. The handler makes the interrupt behave like every other cancel:
609
+ // ONE explainable line, a record on disk, and exit 130. The prompt library
610
+ // consumes Ctrl-C in raw mode while a question is on screen (that path is
611
+ // the interactive cancel above), so this covers the rest of the run.
612
+ const onInterrupt = createInterruptHandler({
613
+ message: S.canceledAt(S.cancelPoints.interrupt),
614
+ json: isJson,
615
+ endGaugeLine,
616
+ onInterrupt: () => {
617
+ if (!isDryRun) {
618
+ recordRun({
619
+ status: 'canceled',
620
+ reason: 'canceled',
621
+ cancelPoint: 'interrupt',
622
+ applied: false,
623
+ })
624
+ }
625
+ },
626
+ })
627
+
523
628
  let installError = null
524
629
  try {
525
630
  const { installOpenCode } = await import('../scripts/install/opencode.mjs')
526
- const target = reviewedPlan ? reviewedPlan.target.path : isProject ? process.cwd() : undefined
631
+ let configPreview = null
632
+ let setupApprovedPlan = null
633
+ if (setupConfigPreview) {
634
+ try {
635
+ configPreview = fs.readFileSync(0, 'utf8')
636
+ if (configPreview.length === 0) throw new Error('empty')
637
+ } catch {
638
+ throw new Error('The setup config preview input is invalid.')
639
+ }
640
+ }
641
+ if (setupApprovedPlanInput) {
642
+ try {
643
+ const envelope = JSON.parse(fs.readFileSync(0, 'utf8'))
644
+ if (
645
+ envelope?.schema_version !== 1 ||
646
+ !envelope.plan ||
647
+ !Array.isArray(envelope.configPreconditions) ||
648
+ typeof envelope.digest !== 'string' ||
649
+ planArtifactDigest(envelope.plan) !== envelope.digest
650
+ ) {
651
+ throw new Error('invalid setup plan envelope')
652
+ }
653
+ if (envelope.configPreconditions.length > 0) {
654
+ const { verifyConfigPreconditions } = await import('../scripts/setup-v2-config.mjs')
655
+ if (
656
+ !verifyConfigPreconditions(envelope.configPreconditions, {
657
+ configDir: setupTarget,
658
+ stage: 'expected',
659
+ })
660
+ ) {
661
+ throw new Error('reviewed config inputs changed')
662
+ }
663
+ }
664
+ setupApprovedPlan = envelope
665
+ } catch {
666
+ throw new Error('The approved setup plan or config snapshots are invalid or drifted.')
667
+ }
668
+ }
669
+ const target = reviewedPlan
670
+ ? reviewedPlan.target.path
671
+ : isProject
672
+ ? process.cwd()
673
+ : setupTarget
527
674
  result = await installOpenCode(target, isDryRun, forceReinstall, components, {
528
675
  interactive: forceInteractive,
529
676
  headless: reviewedPlan ? true : forceHeadless,
@@ -533,12 +680,14 @@ async function main() {
533
680
  preset: presetOpt,
534
681
  version: versionOpt ?? 'auto',
535
682
  mergeDevConfig: mergeDevConfigOpt,
536
- expectedPlan: reviewedPlan,
683
+ expectedPlan: reviewedPlan ?? setupApprovedPlan?.plan ?? null,
684
+ isProject,
537
685
  requestedComponents: requestedComponentsForPrompt,
538
686
  noMcp: skipMCP,
539
687
  planTimestamp,
540
688
  quiet: isJson,
541
689
  verbose: args.includes('--verbose') && !isJson,
690
+ configPreview,
542
691
  })
543
692
  } catch (err) {
544
693
  installError = err
@@ -557,14 +706,13 @@ async function main() {
557
706
  })}\n`,
558
707
  )
559
708
  console.error(`❌ Init dry-run failed: ${installError.message}`)
560
- } else if (installError?.message === 'Canceled') {
561
- console.error(S.canceled)
562
- process.exit(130)
563
709
  } else {
564
710
  console.error(
565
711
  `${S.installFailed(installError.message)}\n${S.failHintNoMcp}\n${S.failHintForce}`,
566
712
  )
567
713
  }
714
+ // No record for a thrown failure: the error itself is the explanation,
715
+ // and a run that failed has nothing to remember beyond its message.
568
716
  process.exitCode = 1
569
717
  return
570
718
  }
@@ -616,6 +764,26 @@ async function main() {
616
764
  if (Object.hasOwn(totals, file.action)) totals[file.action] += 1
617
765
  }
618
766
  const mcpServers = result.mcpServers ?? []
767
+ const setupPlan = setupPlanJson
768
+ ? createPlanArtifact({
769
+ target: result.target,
770
+ packageRoot: ROOT,
771
+ packageVersion: version,
772
+ plannedAt: planTimestamp,
773
+ options: {
774
+ clean: forceReinstall,
775
+ components,
776
+ version: result.openCodeVersion,
777
+ isProject,
778
+ model: modelOpt,
779
+ smallModel: smallModelOpt,
780
+ preset: presetOpt,
781
+ mergeDevConfig: mergeDevConfigOpt,
782
+ },
783
+ files: result.files,
784
+ snapshots: result.snapshots,
785
+ })
786
+ : null
619
787
  process.stdout.write(
620
788
  `${JSON.stringify({
621
789
  schema_version: 1,
@@ -624,12 +792,23 @@ async function main() {
624
792
  status: 'planned',
625
793
  target: result.target,
626
794
  open_code_version: result.openCodeVersion,
627
- advisories: result.versionAssumed
628
- ? [
629
- 'The OpenCode host generation could not be detected; this plan assumes V1 ' +
630
- 'and may diverge from the apply. Pass --opencode-version v1|v2 to pin it.',
631
- ]
632
- : [],
795
+ advisories: [
796
+ ...(result.versionAssumed
797
+ ? [
798
+ 'The OpenCode host generation could not be detected; this plan assumes V1 ' +
799
+ 'and may diverge from the apply. Pass --opencode-version v1|v2 to pin it.',
800
+ ]
801
+ : []),
802
+ // Warnings printed in text mode are suppressed by --quiet, so the
803
+ // machine-readable plan carries them too (e.g. a sibling
804
+ // opencode.jsonc the installer neither reads nor writes).
805
+ ...(result.configAdvisories ?? []),
806
+ ],
807
+ // A V2 plan carries the same capability facts the text notice prints:
808
+ // what the generation registers, what it does not (the static seed),
809
+ // and whether the written plugin entry can receive `options` at all.
810
+ v2_capabilities: result.v2Capabilities ?? null,
811
+ plugin_options: result.pluginOptions ?? null,
633
812
  totals,
634
813
  mcp_servers: mcpServers,
635
814
  mcp_server_count: mcpServers.length,
@@ -639,6 +818,9 @@ async function main() {
639
818
  bytes,
640
819
  })),
641
820
  saved_plan: savePlanPath ? path.resolve(savePlanPath) : null,
821
+ ...(setupPlan
822
+ ? { setup_plan: setupPlan, setup_plan_digest: planArtifactDigest(setupPlan) }
823
+ : {}),
642
824
  })}\n`,
643
825
  )
644
826
  return
@@ -650,7 +832,25 @@ async function main() {
650
832
  // 130 canceled · 1 failure (thrown above).
651
833
  if (result?.applied === false) {
652
834
  if (!isDryRun) {
653
- if (result.reason === 'canceled') console.error(S.canceled)
835
+ // The installer already printed the ONE line for this outcome naming
836
+ // its reason (cancel point / decline / not-authorized). Printing
837
+ // another here is what made a cancel appear twice on two paths. All
838
+ // that is left is to make the DECISION survive the terminal.
839
+ //
840
+ // Gate refusals (`not-authorized`, `drift`) are deliberately NOT
841
+ // recorded: those runs are refused before anything is written, and
842
+ // "an unauthorized run writes nothing" is a guarantee of this
843
+ // installer, not an accident. They still print their own reason and
844
+ // their own exit code.
845
+ if (result.reason === 'canceled' || result.reason === 'declined') {
846
+ recordRun({
847
+ status: result.reason,
848
+ reason: result.reason,
849
+ cancelPoint: result.cancelPoint ?? null,
850
+ applied: false,
851
+ target: result.target,
852
+ })
853
+ }
654
854
  process.exit(resolveInstallExitCode(result, isDryRun))
655
855
  }
656
856
  // Dry-run preview: report honestly instead of the "installed!" banner.
@@ -659,6 +859,22 @@ async function main() {
659
859
  return
660
860
  }
661
861
 
862
+ // Applied: record it, so the next run can tell an apply from a cancel or a
863
+ // decline without reading install-state.json (written only on apply).
864
+ if (!isDryRun) {
865
+ recordRun({
866
+ status: 'applied',
867
+ reason: 'applied',
868
+ applied: true,
869
+ target: result?.target,
870
+ })
871
+ // The interrupt handler describes an install that was in flight. It must
872
+ // not outlive it: `--doctor` runs AFTER this point, and a Ctrl-C there
873
+ // would otherwise rewrite a completed install as canceled/applied:false
874
+ // and print "nothing was applied".
875
+ onInterrupt.deactivate()
876
+ }
877
+
662
878
  if (runDoctor && !isDryRun) {
663
879
  console.log('')
664
880
  console.log(` ${S.runningHealthCheck}`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pantheon-opencode",
3
- "version": "1.6.0",
3
+ "version": "1.6.2-beta.1",
4
4
  "description": "Multi-agent orchestration for OpenCode — 14 specialized agents, TDD, Themis review gates.",
5
5
  "type": "module",
6
6
  "workspaces": [
@@ -18,8 +18,9 @@
18
18
  "scripts": {
19
19
  "postinstall": "node scripts/postinstall.mjs && node scripts/sync-tui.mjs",
20
20
  "prepare": "husky",
21
- "setup": "node bin/pantheon-init.mjs init --yes",
21
+ "setup": "node scripts/setup.mjs",
22
22
  "build:agents-md": "node scripts/build-agents-md.mjs",
23
+ "skills:lock": "node scripts/update-skills-lock.mjs",
23
24
  "setup:lite": "node bin/pantheon-init.mjs init --yes --clean --components agents,skills,instructions",
24
25
  "doctor": "node scripts/doctor.mjs",
25
26
  "prune": "node scripts/prune.mjs",
@@ -51,7 +52,7 @@
51
52
  "coverage:plugin-v2": "node scripts/check-plugin-v2-coverage.mjs",
52
53
  "test:ts": "for f in tests/pantheon/*.test.ts; do if [ \"$f\" = tests/pantheon/plugin-v2-contract.test.ts ]; then NODE_OPTIONS=--conditions=import tsx \"$f\"; else tsx \"$f\"; fi || exit 1; done",
53
54
  "test:hooks": "node scripts/run-node-tests.mjs --label 'test:hooks' 'tests/pantheon/plugin-v2-hook-canary.test.mjs'",
54
- "test:tool-canary": "node scripts/run-node-tests.mjs --label 'test:tool-canary' 'tests/canary/plugin-v2-tool-canary.test.mjs'",
55
+ "test:tool-canary": "node scripts/run-node-tests.mjs --label 'test:tool-canary' 'tests/canary/tool-canary-support.test.mjs' 'tests/canary/plugin-v2-tool-canary.test.mjs'",
55
56
  "test:all": "npm run test:ci && npm run test:node && npm run test:ts",
56
57
  "test": "npm run test:all",
57
58
  "test:ci": "python3 -m pytest -q --tb=short 2>&1"
@@ -107,7 +108,7 @@
107
108
  "@opencode-ai/plugin": "1.18.33",
108
109
  "@opencode-ai/sdk": "1.18.33",
109
110
  "js-yaml": "^5.4.2",
110
- "zod": "4.1.8"
111
+ "zod": "4.6.6"
111
112
  },
112
113
  "devDependencies": {
113
114
  "@biomejs/biome": "2.5.14",
@@ -123,9 +124,10 @@
123
124
  "seroval": "1.6.8",
124
125
  "solid-js": "1.9.12",
125
126
  "rolldown": "1.2.7",
126
- "toml": "5.0.1"
127
+ "toml": "5.0.1",
128
+ "zod": "4.6.6"
127
129
  },
128
- "//overrides": "TUI production advisory fixes: Babel >=7.29.6 and Seroval >=1.6.3; Solid stays at 1.9.12 to satisfy OpenTUI's exact peer. Remove only after upstream ranges include fixed versions; Seroval compatibility is covered by the Solid serializer regression test.",
130
+ "//overrides": "TUI production advisory fixes: Babel >=7.29.6 and Seroval >=1.6.3; zod >=4.6.6 for GHSA-mrhx-c7xc-m3w5 (@opencode-ai/plugin pins zod 4.1.8 exactly, so the override is the only way to move it, and the same entry is mirrored in src/plugins/tui/package.json for the shipped TUI lock); Solid stays at 1.9.12 to satisfy OpenTUI's exact peer. Remove only after upstream ranges include fixed versions; Seroval compatibility is covered by the Solid serializer regression test.",
129
131
  "repository": {
130
132
  "type": "git",
131
133
  "url": "https://github.com/ils15/pantheon-opencode.git"
package/plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pantheon",
3
3
  "publisher": "ils15",
4
- "version": "1.6.0",
4
+ "version": "1.6.2-beta.1",
5
5
  "displayName": "Pantheon",
6
6
  "description": "Conductor-Delegate orchestration platform with 14 specialized agents, 20 skills, and OpenCode support.",
7
7
  "agents": "./src/agents",
package/pyproject.toml CHANGED
@@ -4,7 +4,7 @@ build-backend = "setuptools.backends._legacy:_Backend"
4
4
 
5
5
  [project]
6
6
  name = "pantheon"
7
- version = "1.6.0"
7
+ version = "1.6.2-beta.1"
8
8
  description = "Multi-agent orchestration framework"
9
9
  requires-python = ">=3.11"
10
10
  # Python sources under src/mcp/ import fastmcp/pydantic at runtime, but those
@@ -133,7 +133,7 @@ const PROJECT_HEADER = `# Pantheon — Repository Setup
133
133
 
134
134
  Setup: [INSTALLATION.md](docs/INSTALLATION.md).
135
135
 
136
- - Build/Test: \`npm test\`
136
+ - Test: focused checks by default; \`npm test\` for CI/release or broad/high-risk changes
137
137
  - Lint: \`npm run lint\`
138
138
 
139
139
  ## Teste de Instalação Global (sandbox)