pantheon-opencode 1.7.0 → 2.0.0-beta.2
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/AGENTS.global.md +2 -2
- package/AGENTS.md +3 -3
- package/CHANGELOG.md +85 -59
- package/README.md +74 -48
- package/README.pt-BR.md +19 -19
- package/bin/pantheon-init.mjs +11 -48
- package/package.json +9 -13
- package/plugin.json +2 -2
- package/pyproject.toml +1 -1
- package/scripts/build-agents-md.mjs +7 -6
- package/scripts/{check-plugin-v2-coverage.mjs → check-plugin-coverage.mjs} +7 -7
- package/scripts/{decision-router-v2-budget.mjs → decision-router-budget-gates.mjs} +1 -1
- package/scripts/{decision-router-v2-egress.mjs → decision-router-egress.mjs} +1 -1
- package/scripts/decision-router.mjs +2 -2
- package/scripts/docs-media.mjs +1 -1
- package/scripts/doctor.mjs +225 -136
- package/scripts/install/behavior-overrides.bundle.mjs +123 -0
- package/scripts/install/{v2-capabilities.mjs → capabilities.mjs} +7 -7
- package/scripts/install/config-migration.mjs +60 -253
- package/scripts/install/file-inventory.mjs +6 -4
- package/scripts/install/interactive.mjs +1 -1
- package/scripts/install/opencode-state.mjs +13 -12
- package/scripts/install/opencode-version.mjs +97 -162
- package/scripts/install/opencode.mjs +271 -428
- package/scripts/install/plan.mjs +1 -9
- package/scripts/install/plugin.mjs +19 -35
- package/scripts/install/shared.mjs +40 -1
- package/scripts/package-evidence.mjs +1 -4
- package/scripts/probe-pantheon-cost.mjs +1 -1
- package/scripts/reconcile.mjs +5 -7
- package/scripts/release-gates.mjs +22 -61
- package/scripts/setup-v2-config.mjs +10 -8
- package/scripts/setup.mjs +12 -22
- package/scripts/sync-tui.mjs +9 -17
- package/scripts/{test-opencode-v2-sandbox.sh → test-opencode-sandbox.sh} +9 -9
- package/scripts/update-skills-lock.mjs +24 -12
- package/scripts/update.mjs +17 -1
- package/scripts/validate-routing.mjs +79 -4
- package/scripts/validate-sandbox-install.mjs +3 -3
- package/skills-lock.json +25 -8
- package/src/agents/zeus.md +1 -0
- package/src/pantheon/behavior-overrides.ts +191 -0
- package/src/pantheon/{v2-bounded-read.ts → bounded-read.ts} +1 -1
- package/src/pantheon/cost-command.ts +1 -1
- package/src/pantheon/{v2-decision-contracts.ts → decision-contracts.ts} +3 -3
- package/src/pantheon/{v2-decision-points → decision-points}/p1-agent.ts +3 -3
- package/src/pantheon/{v2-decision-points → decision-points}/p10-claims.ts +2 -2
- package/src/pantheon/{v2-decision-points → decision-points}/p11-catalog.ts +2 -2
- package/src/pantheon/{v2-decision-points → decision-points}/p2-skill.ts +3 -3
- package/src/pantheon/{v2-decision-points → decision-points}/p3-complexity.ts +6 -6
- package/src/pantheon/{v2-decision-points → decision-points}/p4-memory.ts +2 -2
- package/src/pantheon/{v2-decision-points → decision-points}/p5-themis-verify.ts +2 -2
- package/src/pantheon/{v2-decision-points → decision-points}/p6-council.ts +3 -3
- package/src/pantheon/{v2-decision-points → decision-points}/p7-loop.ts +5 -5
- package/src/pantheon/{v2-decision-points → decision-points}/p8-guardrail.ts +2 -2
- package/src/pantheon/{v2-decision-points → decision-points}/p9-memory-compaction.ts +2 -2
- package/src/pantheon/{v2-decision-points.ts → decision-points.ts} +5 -5
- package/src/pantheon/{v2-decision-policy.ts → decision-policy.ts} +2 -2
- package/src/pantheon/{v2-decision-prompt-surface.ts → decision-prompt-surface.ts} +3 -3
- package/src/pantheon/{v2-decision-registry.ts → decision-registry.ts} +10 -13
- package/src/pantheon/{v2-decision-resource-ids.ts → decision-resource-ids.ts} +1 -1
- package/src/pantheon/{v2-decision-shadow.ts → decision-shadow.ts} +1 -1
- package/src/pantheon/{v2-decision-telemetry.ts → decision-telemetry.ts} +1 -1
- package/src/pantheon/{v2-execute-after.ts → execute-after.ts} +4 -4
- package/src/pantheon/goal-store.ts +7 -0
- package/src/pantheon/{v2-hook-engine.ts → hook-engine.ts} +3 -3
- package/src/pantheon/jev-decision-tool.ts +3 -3
- package/src/pantheon/jev-decisions.ts +12 -6
- package/src/pantheon/jev-escalation.ts +6 -6
- package/src/pantheon/jev-quality-score.ts +2 -2
- package/src/pantheon/jev-rank-verify.ts +2 -2
- package/src/pantheon/jev-risk-gate.ts +4 -4
- package/src/pantheon/local-decision-agents.ts +1 -1
- package/src/pantheon/local-decision-router.ts +1 -1
- package/src/pantheon/local-decision-tool.ts +2 -2
- package/src/pantheon/local-orchestration.ts +1 -1
- package/src/pantheon/model-command.ts +1 -1
- package/src/pantheon/{v2-vision.ts → native-vision.ts} +12 -15
- package/src/pantheon/pantheon-decision-catalog.ts +12 -0
- package/src/pantheon/{v2-shell-hooks.ts → shell-hooks.ts} +4 -4
- package/src/pantheon/{v2-tools.ts → tools.ts} +4 -4
- package/src/pantheon/{v2-unsupported.d.mts → unsupported.d.mts} +3 -3
- package/src/pantheon/{v2-unsupported.mjs → unsupported.mjs} +8 -8
- package/src/pantheon/update-notifier.ts +101 -0
- package/src/pantheon/vision-local.ts +12 -3
- package/src/pantheon/vision.ts +120 -2
- package/src/{plugin-v2 → plugin}/index.ts +7 -7
- package/src/plugin.ts +2870 -500
- package/src/plugins/hook-runner.ts +3 -3
- package/src/plugins/tui/dist/server.d.ts +23 -9
- package/src/plugins/tui/dist/server.d.ts.map +1 -1
- package/src/plugins/tui/dist/server.js +25 -12
- package/src/plugins/tui/dist/server.js.map +1 -1
- package/src/plugins/tui/dist/tui.d.ts +1023 -494
- package/src/plugins/tui/dist/tui.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui.js +5612 -2086
- package/src/plugins/tui/dist/tui.js.map +1 -1
- package/src/plugins/tui/{index-v2.ts → index.ts} +1 -1
- package/src/plugins/tui/package-lock.json +2 -42
- package/src/plugins/tui/package.json +4 -10
- package/src/plugins/tui/src/cost-data.ts +1 -1
- package/src/plugins/tui/src/decision-router-state.ts +242 -0
- package/src/plugins/tui/src/doctor-state.ts +198 -0
- package/src/plugins/tui/src/index.tsx +4222 -2822
- package/src/plugins/tui/src/j1-gate-status.ts +85 -0
- package/src/plugins/tui/src/pantheon-settings-state.ts +245 -0
- package/src/plugins/tui/src/pantheon-settings.tsx +442 -0
- package/src/plugins/tui/src/preset-state.ts +143 -0
- package/src/plugins/tui/src/server.ts +23 -10
- package/src/plugins/tui/src/update-notice.ts +90 -0
- package/src/plugins/tui/src/update-status.ts +98 -0
- package/src/plugins/tui/tsconfig.typecheck.json +9 -2
- package/src/plugins/tui/tsdown.config.ts +3 -5
- package/src/plugins/tui/tui.ts +1 -2
- package/src/routing.yml +36 -0
- package/src/skills/README.md +16 -1
- package/src/skills/artifact-management/SKILL.md +10 -67
- package/src/skills/artifact-management/references/artifact-templates.md +71 -0
- package/src/skills/auto-continue/SKILL.md +10 -0
- package/src/skills/code-review-checklist/SKILL.md +11 -44
- package/src/skills/code-review-checklist/references/review-checklists.md +54 -0
- package/src/skills/instruction-forge/SKILL.md +57 -0
- package/src/skills/instruction-forge/references/agents-md-doctrine.md +50 -0
- package/src/skills/instruction-forge/references/eval-doctrine.md +37 -0
- package/src/skills/instruction-forge/references/skill-doctrine.md +62 -0
- package/src/skills/memory-bank/SKILL.md +11 -90
- package/src/skills/memory-bank/references/anti-patterns.md +33 -0
- package/src/skills/memory-bank/references/product-adoption.md +19 -0
- package/src/skills/memory-bank/references/storage-model.md +21 -0
- package/src/skills/memory-bank/references/structure-and-frequency.md +44 -0
- package/src/skills/reflect/SKILL.md +1 -0
- package/src/skills/session-goal/SKILL.md +7 -54
- package/src/skills/session-goal/references/goal-format.md +26 -0
- package/src/skills/session-goal/references/session-reuse.md +44 -0
- package/src/skills/tdd-with-agents/SKILL.md +11 -101
- package/src/skills/tdd-with-agents/references/advanced-testing-patterns.md +58 -0
- package/src/skills/tdd-with-agents/references/testing-by-layer.md +60 -0
- package/src/skills/visual-review-pipeline/SKILL.md +11 -120
- package/src/skills/visual-review-pipeline/references/findings-schema.md +49 -0
- package/src/skills/visual-review-pipeline/references/workflow-steps.md +111 -0
- package/scripts/hooks/log-session-start.sh +0 -48
- package/scripts/hooks/validate-post-conditions.sh +0 -21
- package/scripts/hooks/validate-talos-scope.sh +0 -50
- package/scripts/hooks/validate-tool-safety.sh +0 -49
- package/src/pantheon/goal-loop.ts +0 -314
- package/src/pantheon/idle-continuation.ts +0 -52
- package/src/pantheon/todo-preserve.ts +0 -301
- package/src/pantheon/tool-ceiling.ts +0 -159
- package/src/pantheon/v2-bridge.ts +0 -153
- package/src/plugin-v2.ts +0 -2954
- package/src/plugins/pantheon-hooks.ts +0 -1433
- package/src/plugins/tui/dist/server-v2.d.ts +0 -30
- package/src/plugins/tui/dist/server-v2.d.ts.map +0 -1
- package/src/plugins/tui/dist/server-v2.js +0 -33
- package/src/plugins/tui/dist/server-v2.js.map +0 -1
- package/src/plugins/tui/dist/tui-v2.d.ts +0 -1039
- package/src/plugins/tui/dist/tui-v2.d.ts.map +0 -1
- package/src/plugins/tui/dist/tui-v2.js +0 -4597
- package/src/plugins/tui/dist/tui-v2.js.map +0 -1
- package/src/plugins/tui/src/index-v2.tsx +0 -4496
- package/src/plugins/tui/src/server-v2.ts +0 -28
- package/src/plugins/tui/tui-v2.ts +0 -2
- /package/src/pantheon/{v2-decision-budget.ts → decision-budget.ts} +0 -0
- /package/src/pantheon/{v2-decision-egress.ts → decision-egress.ts} +0 -0
- /package/src/pantheon/{v2-decision-events.ts → decision-events.ts} +0 -0
- /package/src/pantheon/{v2-decision-heuristic.ts → decision-heuristic.ts} +0 -0
- /package/src/pantheon/{v2-decision-premises.ts → decision-premises.ts} +0 -0
- /package/src/pantheon/{v2-decision-rank.ts → decision-rank.ts} +0 -0
- /package/src/pantheon/{v2-decision-verify.ts → decision-verify.ts} +0 -0
- /package/src/pantheon/{v2-delegation-enforce.ts → delegation-policy.ts} +0 -0
- /package/src/pantheon/{v2-model-overrides.ts → model-overrides.ts} +0 -0
- /package/src/pantheon/{v2-native-decisions.ts → native-decisions.ts} +0 -0
- /package/src/plugins/tui/src/{opencode-v2.d.ts → opencode.d.ts} +0 -0
package/bin/pantheon-init.mjs
CHANGED
|
@@ -7,16 +7,14 @@
|
|
|
7
7
|
* Thin CLI wrapper that parses arguments and delegates to
|
|
8
8
|
* installOpenCode() from scripts/install/opencode.mjs.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* V2
|
|
15
|
-
* migrateV1toV2() (scripts/install/config-migration.mjs), then writes the
|
|
16
|
-
* V2-native `plugins` list. `--version v2` selects that path.
|
|
10
|
+
* V2-only install: the host must be OpenCode 2.x. The generation gate in
|
|
11
|
+
* scripts/install/opencode-version.mjs refuses a confirmed 1.x host before any
|
|
12
|
+
* write; legacy V1-shaped config keys are normalized by
|
|
13
|
+
* normalizeLegacyV1Config() (scripts/install/config-migration.mjs) and the
|
|
14
|
+
* V2-native `plugins` list is what gets written.
|
|
17
15
|
*
|
|
18
|
-
* State is NOT isolated per generation:
|
|
19
|
-
*
|
|
16
|
+
* State is NOT isolated per generation: the host reads one OpenCode store, so
|
|
17
|
+
* this CLI claims neither a separate database nor a service port. The
|
|
20
18
|
* installer prints the path an actual resolver returns
|
|
21
19
|
* (scripts/install/opencode-state.mjs).
|
|
22
20
|
*/
|
|
@@ -28,7 +26,6 @@ import { resolveComponentSelection } from '../scripts/install/component-selectio
|
|
|
28
26
|
import { resolveGlobalConfigDirectory } from '../scripts/install/config-paths.mjs'
|
|
29
27
|
import { resolveInstallExitCode } from '../scripts/install/exit-codes.mjs'
|
|
30
28
|
import { createInterruptHandler } from '../scripts/install/interrupt.mjs'
|
|
31
|
-
import { parseOpenCodeVersion } from '../scripts/install/opencode-version.mjs'
|
|
32
29
|
import {
|
|
33
30
|
createPlanArtifact,
|
|
34
31
|
loadPlanArtifact,
|
|
@@ -97,7 +94,6 @@ function printUsage() {
|
|
|
97
94
|
console.log(
|
|
98
95
|
' npx pantheon-opencode init --decision-model opencode-console-jev/jev-1.13 --decision-monthly-usd 5 --decision-per-decision-usd 0.10',
|
|
99
96
|
)
|
|
100
|
-
console.log(' npx pantheon-opencode init --opencode-version v1|v2|auto')
|
|
101
97
|
console.log(' npx pantheon-opencode init --preset <name> # Install and activate model preset')
|
|
102
98
|
console.log(
|
|
103
99
|
' npx pantheon-opencode init --merge-dev-config <path> # Merge a dev config (off by default)',
|
|
@@ -109,8 +105,9 @@ function printUsage() {
|
|
|
109
105
|
console.log(
|
|
110
106
|
' npx pantheon-opencode decision-router select|enable|consent|caps|period # explicit actions',
|
|
111
107
|
)
|
|
108
|
+
console.log(' npx pantheon-opencode update [--stable] [--allow-prerelease]')
|
|
112
109
|
console.log(
|
|
113
|
-
'
|
|
110
|
+
' # Update + re-run init. Default channel is beta; a stable install never jumps to a beta without --allow-prerelease.',
|
|
114
111
|
)
|
|
115
112
|
console.log(
|
|
116
113
|
' npx pantheon-opencode set-tier <name> --project # Set active model preset (project)',
|
|
@@ -368,7 +365,6 @@ async function main() {
|
|
|
368
365
|
].includes(component),
|
|
369
366
|
) ||
|
|
370
367
|
options.clean !== false ||
|
|
371
|
-
!['v1', 'v2', 'auto'].includes(options.version) ||
|
|
372
368
|
typeof options.isProject !== 'boolean'
|
|
373
369
|
) {
|
|
374
370
|
console.error('❌ Install-plan options are invalid or unsupported')
|
|
@@ -446,8 +442,6 @@ async function main() {
|
|
|
446
442
|
'--preset',
|
|
447
443
|
'--model',
|
|
448
444
|
'--small-model',
|
|
449
|
-
'--version',
|
|
450
|
-
'--opencode-version',
|
|
451
445
|
'--components',
|
|
452
446
|
'--merge-dev-config',
|
|
453
447
|
'--apply-plan',
|
|
@@ -518,28 +512,6 @@ async function main() {
|
|
|
518
512
|
: smallModelIndex >= 0
|
|
519
513
|
? (args[smallModelIndex + 1] ?? null)
|
|
520
514
|
: null
|
|
521
|
-
// --version v1|v2|auto labels the install target. `auto` resolves the
|
|
522
|
-
// generation from the opencode binary at install time (see
|
|
523
|
-
// scripts/install/opencode-version.mjs). Invalid values fail fast.
|
|
524
|
-
const versionOpt = reviewedPlan ? reviewedPlan.options.version : parseOpenCodeVersion(args)
|
|
525
|
-
if (
|
|
526
|
-
versionOpt !== null &&
|
|
527
|
-
versionOpt !== 'v1' &&
|
|
528
|
-
versionOpt !== 'v2' &&
|
|
529
|
-
versionOpt !== 'auto'
|
|
530
|
-
) {
|
|
531
|
-
console.error(`❌ Invalid --version "${versionOpt}" — expected v1, v2 or auto`)
|
|
532
|
-
process.exit(1)
|
|
533
|
-
}
|
|
534
|
-
// The 2.0 deprecation front-run: the legacy plugin line is end-of-life.
|
|
535
|
-
// Loud warning now (the v1 code path still exists for legacy installs);
|
|
536
|
-
// the 2.0 removal turns this into a hard refusal.
|
|
537
|
-
if (versionOpt === 'v1') {
|
|
538
|
-
console.error(
|
|
539
|
-
'⚠️ --opencode-version v1 is DEPRECATED and will be removed in Pantheon 2.0 — the legacy plugin line is end-of-life. OpenCode 2.x hosts are the supported generation; remove the flag (auto detects the host).',
|
|
540
|
-
)
|
|
541
|
-
}
|
|
542
|
-
|
|
543
515
|
// Resolve the user's explicit selection separately from the defaults.
|
|
544
516
|
// Runtime and prompt templates are opt-in in both TTY and headless mode.
|
|
545
517
|
let componentSelection
|
|
@@ -743,7 +715,6 @@ async function main() {
|
|
|
743
715
|
model: modelOpt,
|
|
744
716
|
smallModel: smallModelOpt,
|
|
745
717
|
preset: presetOpt,
|
|
746
|
-
version: versionOpt ?? 'auto',
|
|
747
718
|
mergeDevConfig: mergeDevConfigOpt,
|
|
748
719
|
expectedPlan: reviewedPlan ?? setupApprovedPlan?.plan ?? null,
|
|
749
720
|
isProject,
|
|
@@ -814,7 +785,6 @@ async function main() {
|
|
|
814
785
|
options: {
|
|
815
786
|
clean: forceReinstall,
|
|
816
787
|
components,
|
|
817
|
-
version: result.openCodeVersion,
|
|
818
788
|
isProject,
|
|
819
789
|
model: modelOpt,
|
|
820
790
|
smallModel: smallModelOpt,
|
|
@@ -859,7 +829,6 @@ async function main() {
|
|
|
859
829
|
options: {
|
|
860
830
|
clean: forceReinstall,
|
|
861
831
|
components,
|
|
862
|
-
version: result.openCodeVersion,
|
|
863
832
|
isProject,
|
|
864
833
|
model: modelOpt,
|
|
865
834
|
smallModel: smallModelOpt,
|
|
@@ -879,19 +848,13 @@ async function main() {
|
|
|
879
848
|
target: result.target,
|
|
880
849
|
open_code_version: result.openCodeVersion,
|
|
881
850
|
advisories: [
|
|
882
|
-
...(result.versionAssumed
|
|
883
|
-
? [
|
|
884
|
-
'The OpenCode host generation could not be detected; this plan assumes V1 ' +
|
|
885
|
-
'and may diverge from the apply. Pass --opencode-version v1|v2 to pin it.',
|
|
886
|
-
]
|
|
887
|
-
: []),
|
|
888
851
|
// Warnings printed in text mode are suppressed by --quiet, so the
|
|
889
852
|
// machine-readable plan carries them too (e.g. a sibling
|
|
890
853
|
// opencode.jsonc the installer neither reads nor writes).
|
|
891
854
|
...(result.configAdvisories ?? []),
|
|
892
855
|
],
|
|
893
|
-
//
|
|
894
|
-
// what the
|
|
856
|
+
// The plan carries the same capability facts the text notice prints:
|
|
857
|
+
// what the install registers, what it does not (the static seed),
|
|
895
858
|
// and whether the written plugin entry can receive `options` at all.
|
|
896
859
|
v2_capabilities: result.v2Capabilities ?? null,
|
|
897
860
|
plugin_options: result.pluginOptions ?? null,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pantheon-opencode",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-beta.2",
|
|
4
4
|
"description": "Multi-agent orchestration for OpenCode \u2014 14 specialized agents, TDD, Themis review gates.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"workspaces": [
|
|
@@ -12,13 +12,11 @@
|
|
|
12
12
|
},
|
|
13
13
|
"exports": {
|
|
14
14
|
"./local-decision-router": "./src/pantheon/local-decision-router.ts",
|
|
15
|
-
"./plugin": "./src/plugin.ts"
|
|
16
|
-
"./plugin-v2": "./src/plugin-v2.ts",
|
|
17
|
-
"./v2-bridge": "./src/pantheon/v2-bridge.ts"
|
|
15
|
+
"./plugin": "./src/plugin.ts"
|
|
18
16
|
},
|
|
19
17
|
"scripts": {
|
|
20
18
|
"postinstall": "node scripts/postinstall.mjs && node scripts/sync-tui.mjs",
|
|
21
|
-
"prepare": "husky",
|
|
19
|
+
"prepare": "git rev-parse --is-inside-work-tree >/dev/null 2>&1 && husky",
|
|
22
20
|
"setup": "node scripts/setup.mjs",
|
|
23
21
|
"build:agents-md": "node scripts/build-agents-md.mjs",
|
|
24
22
|
"build:decision-router": "node scripts/build-decision-router.mjs",
|
|
@@ -50,13 +48,13 @@
|
|
|
50
48
|
"hooks:install": "pre-commit install",
|
|
51
49
|
"hooks:update": "pre-commit autoupdate",
|
|
52
50
|
"test:security": "npm run secret-scan",
|
|
53
|
-
"test:node": "node scripts/run-node-tests.mjs --label 'test:node' --exclude 'tests/install-opencode.test.mjs' --exclude 'tests/install-e2e.test.mjs' 'tests/*.mjs' 'tests/pantheon/*.mjs'",
|
|
51
|
+
"test:node": "node scripts/run-node-tests.mjs --label 'test:node' --exclude 'tests/install-opencode.test.mjs' --exclude 'tests/install-e2e.test.mjs' 'tests/*.mjs' 'tests/pantheon/*.mjs' 'tests/eval/*.mjs'",
|
|
54
52
|
"test:install": "PANTHEON_RUN_INSTALL_TESTS=1 node scripts/run-node-tests.mjs --label 'test:install' 'tests/install-opencode.test.mjs' 'tests/install-e2e.test.mjs'",
|
|
55
53
|
"coverage": "echo 'Node coverage (report-only, NO threshold is enforced).' && echo 'Covers: the .mjs/.js modules under scripts/, src/ and bin/ that test:node exercises.' && echo 'Does NOT cover: test:ts (hand-rolled tsx loop, no node --test runner) and test:ci (pytest).' && echo ' TypeScript under src/ (41 files) is therefore entirely unmeasured here.' && echo '' && node scripts/run-node-tests.mjs --label 'coverage' --exclude 'tests/install-opencode.test.mjs' --exclude 'tests/install-e2e.test.mjs' -- --experimental-test-coverage --test-coverage-include='scripts/**/*.mjs' --test-coverage-include='src/**/*.mjs' --test-coverage-include='src/**/*.js' --test-coverage-include='bin/**/*.mjs' 'tests/*.mjs' 'tests/pantheon/*.mjs'",
|
|
56
|
-
"coverage:plugin
|
|
57
|
-
"test:ts": "for f in tests/pantheon/*.test.ts; do if [ \"$f\" = tests/pantheon/plugin-
|
|
58
|
-
"test:hooks": "node scripts/run-node-tests.mjs --label 'test:hooks' 'tests/pantheon/plugin-
|
|
59
|
-
"test:tool-canary": "node scripts/run-node-tests.mjs --label 'test:tool-canary' 'tests/canary/tool-canary-support.test.mjs' 'tests/canary/plugin-
|
|
54
|
+
"coverage:plugin": "node scripts/check-plugin-coverage.mjs",
|
|
55
|
+
"test:ts": "for f in tests/pantheon/*.test.ts; do if [ \"$f\" = tests/pantheon/plugin-contract.test.ts ]; then NODE_OPTIONS=--conditions=import tsx \"$f\"; else tsx \"$f\"; fi || exit 1; done",
|
|
56
|
+
"test:hooks": "node scripts/run-node-tests.mjs --label 'test:hooks' 'tests/pantheon/plugin-hook-canary.test.mjs'",
|
|
57
|
+
"test:tool-canary": "node scripts/run-node-tests.mjs --label 'test:tool-canary' 'tests/canary/tool-canary-support.test.mjs' 'tests/canary/plugin-tool-canary.test.mjs'",
|
|
60
58
|
"test:all": "npm run test:ci && npm run test:node && npm run test:ts",
|
|
61
59
|
"test": "npm run test:all",
|
|
62
60
|
"test:ci": "PANTHEON_PY=${PYTHON:-python3}; if [ -x .venv/bin/python3 ]; then PANTHEON_PY=.venv/bin/python3; fi; $PANTHEON_PY -m pytest -q --tb=short 2>&1"
|
|
@@ -71,10 +69,8 @@
|
|
|
71
69
|
"pyproject.toml",
|
|
72
70
|
"scripts/install/*.mjs",
|
|
73
71
|
"scripts/*.py",
|
|
72
|
+
"src/plugin",
|
|
74
73
|
"src/plugin.ts",
|
|
75
|
-
"src/plugin-v2.ts",
|
|
76
|
-
"src/plugin-v2",
|
|
77
|
-
"src/pantheon/v2-bridge.ts",
|
|
78
74
|
"README.md",
|
|
79
75
|
"src/mcp/*.txt",
|
|
80
76
|
"commands/*.md",
|
package/plugin.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pantheon",
|
|
3
3
|
"publisher": "ils15",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.0-beta.2",
|
|
5
5
|
"displayName": "Pantheon",
|
|
6
|
-
"description": "Conductor-Delegate orchestration platform with 14 specialized agents,
|
|
6
|
+
"description": "Conductor-Delegate orchestration platform with 14 specialized agents, 23 skills, and OpenCode support.",
|
|
7
7
|
"agents": "./src/agents",
|
|
8
8
|
"skills": "./src/skills",
|
|
9
9
|
"instructions": "./src/instructions",
|
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 = "
|
|
7
|
+
version = "2.0.0-beta.2"
|
|
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
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* build-agents-md.mjs — Generate BOTH AGENTS.md artifacts from canonical sources.
|
|
4
4
|
*
|
|
5
|
-
* AGENTS.md files are instruction files
|
|
6
|
-
* auto-
|
|
7
|
-
* key is accepted-but-ignored by
|
|
5
|
+
* AGENTS.md files are instruction files the OpenCode 2.x host loads
|
|
6
|
+
* (auto-discovered in the project, loaded explicitly from the global config
|
|
7
|
+
* dir; the `instructions` config key is accepted-but-ignored by the host).
|
|
8
|
+
* Every session pays for global AND
|
|
8
9
|
* project AGENTS.md content, so a single duplicated file is paid twice per
|
|
9
10
|
* session. To keep the payload disjoint (beta-10 latency slice, phase 1),
|
|
10
11
|
* this script emits TWO artifacts in ONE pass over the same sources:
|
|
@@ -133,6 +134,7 @@ const PROJECT_HEADER = `# Pantheon — Repository Setup
|
|
|
133
134
|
|
|
134
135
|
Setup: [INSTALLATION.md](docs/INSTALLATION.md).
|
|
135
136
|
|
|
137
|
+
- Requires a supported host: OpenCode 2.x (the V1 contract was removed in 2.0).
|
|
136
138
|
- Test: focused checks by default; \`npm test\` for CI/release or broad/high-risk changes
|
|
137
139
|
- Lint: \`npm run lint\`
|
|
138
140
|
|
|
@@ -143,12 +145,11 @@ Valide a instalação global COMO UM USUÁRIO REAL no sandbox \`~/pantheon-sandb
|
|
|
143
145
|
- Rodar: \`bash ~/pantheon-sandbox/run-test.sh\` (MCPs, doctor, TUI)
|
|
144
146
|
- Regra para agentes: valide instalação global (npm pack, \`init\`, MCPs, hooks) no sandbox — NUNCA no ambiente de dev
|
|
145
147
|
- Descarte: \`rm -rf ~/pantheon-sandbox\`
|
|
146
|
-
- Detalhes: \`~/pantheon-sandbox/README.md\`
|
|
147
148
|
|
|
148
149
|
## Worktrees
|
|
149
150
|
|
|
150
151
|
- Nunca crie worktrees dentro do projeto principal; use \`<project-parent>/.pantheon-worktrees/<basename-do-repo>/<task>\`.
|
|
151
|
-
-
|
|
152
|
+
- worktrees não vivem dentro de \`.pantheon/\`.
|
|
152
153
|
|
|
153
154
|
## Conventions
|
|
154
155
|
|
|
@@ -163,7 +164,7 @@ const INSTRUCTIONS_PREAMBLE = `---
|
|
|
163
164
|
|
|
164
165
|
# Agent Instructions
|
|
165
166
|
|
|
166
|
-
Shared rules from \`src/instructions/*.instructions.md\`,
|
|
167
|
+
Shared rules from \`src/instructions/*.instructions.md\`, embedded here because the OpenCode 2.x host ignores the \`instructions\` config key. Repo-specific setup stays in that project's AGENTS.md, so no rule loads twice; agent-scoped rules live only in the matching prompt.`
|
|
167
168
|
|
|
168
169
|
// ---------------------------------------------------------------------------
|
|
169
170
|
// Frontmatter parsing (stdlib only — no yaml dependency)
|
|
@@ -135,11 +135,11 @@ function formatMetric(metric) {
|
|
|
135
135
|
|
|
136
136
|
function listTypeScriptTests(repoRoot) {
|
|
137
137
|
const directory = join(repoRoot, 'tests', 'pantheon')
|
|
138
|
-
// This is the only TypeScript test file that imports src/plugin
|
|
138
|
+
// This is the only TypeScript test file that imports src/plugin.ts. Its
|
|
139
139
|
// isolated measured coverage matches the full-suite baseline; `test:ts`
|
|
140
140
|
// remains the separate full TypeScript suite.
|
|
141
141
|
return readdirSync(directory)
|
|
142
|
-
.filter((file) => file === 'plugin-
|
|
142
|
+
.filter((file) => file === 'plugin-contract.test.ts')
|
|
143
143
|
.sort()
|
|
144
144
|
.map((file) => join(directory, file))
|
|
145
145
|
}
|
|
@@ -147,16 +147,16 @@ function listTypeScriptTests(repoRoot) {
|
|
|
147
147
|
function runCoverage() {
|
|
148
148
|
if (!isSupportedNodeVersion(process.versions.node)) {
|
|
149
149
|
throw new Error(
|
|
150
|
-
`plugin
|
|
150
|
+
`plugin coverage requires Node.js >= ${MIN_SUPPORTED_NODE_VERSION}; got ${process.version}`,
|
|
151
151
|
)
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
const repoRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..')
|
|
155
|
-
const targetPath = resolve(repoRoot, 'src', 'plugin
|
|
155
|
+
const targetPath = resolve(repoRoot, 'src', 'plugin.ts')
|
|
156
156
|
const testFiles = listTypeScriptTests(repoRoot)
|
|
157
157
|
if (testFiles.length === 0) throw new Error('no tests/pantheon/*.test.ts files found')
|
|
158
158
|
|
|
159
|
-
const tempRoot = mkdtempSync(join(tmpdir(), 'pantheon-plugin-
|
|
159
|
+
const tempRoot = mkdtempSync(join(tmpdir(), 'pantheon-plugin-coverage-'))
|
|
160
160
|
try {
|
|
161
161
|
const lcovPath = join(tempRoot, 'coverage.lcov')
|
|
162
162
|
const nodeOptions = [process.env.NODE_OPTIONS, '--conditions=import'].filter(Boolean).join(' ')
|
|
@@ -198,9 +198,9 @@ function runCoverage() {
|
|
|
198
198
|
console.log(`Branches (informational): ${formatMetric(coverage.branches)}`)
|
|
199
199
|
console.log(`Functions (informational): ${formatMetric(coverage.functions)}`)
|
|
200
200
|
if (!passesLineThreshold(coverage)) {
|
|
201
|
-
throw new Error('src/plugin
|
|
201
|
+
throw new Error('src/plugin.ts line coverage is below the required 80%')
|
|
202
202
|
}
|
|
203
|
-
console.log('src/plugin
|
|
203
|
+
console.log('src/plugin.ts line coverage: PASS (>= 80%)')
|
|
204
204
|
} finally {
|
|
205
205
|
rmSync(tempRoot, { recursive: true, force: true })
|
|
206
206
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// import TypeScript from node_modules, so it imports this prebuilt ESM bundle
|
|
3
3
|
// instead. Do not edit: run `npm run build:decision-router`.
|
|
4
4
|
|
|
5
|
-
// src/pantheon/
|
|
5
|
+
// src/pantheon/decision-budget.ts
|
|
6
6
|
import { lstatSync } from "node:fs";
|
|
7
7
|
import { DatabaseSync } from "node:sqlite";
|
|
8
8
|
function isPositiveCaps(value) {
|
|
@@ -186,7 +186,7 @@ function cloneDefaultUserConfig() {
|
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
// src/pantheon/
|
|
189
|
+
// src/pantheon/decision-egress.ts
|
|
190
190
|
var V2_DECISION_EGRESS_DEFAULT = "off";
|
|
191
191
|
var DECLARED_EGRESS_ENDPOINTS = Object.freeze([
|
|
192
192
|
{ url: "https://api.openai.com/v1/decisions", wireStatus: "unwired" },
|
|
@@ -14,12 +14,12 @@ import {
|
|
|
14
14
|
inspectDecisionBudget,
|
|
15
15
|
listDecisionHoldsReadOnly,
|
|
16
16
|
utcPeriodOf,
|
|
17
|
-
} from './decision-router-
|
|
17
|
+
} from './decision-router-budget-gates.mjs'
|
|
18
18
|
import {
|
|
19
19
|
resolveV2DecisionEgress,
|
|
20
20
|
V2_DECISION_EGRESS_DEFAULT,
|
|
21
21
|
V2_DECISION_EGRESS_TRANSPORT,
|
|
22
|
-
} from './decision-router-
|
|
22
|
+
} from './decision-router-egress.mjs'
|
|
23
23
|
import {
|
|
24
24
|
applyDecisionLayerPlan,
|
|
25
25
|
buildDecisionLayerPlan,
|
package/scripts/docs-media.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* Regenerate the terminal captures embedded in docs/opencode
|
|
3
|
+
* Regenerate the terminal captures embedded in docs/opencode.md.
|
|
4
4
|
*
|
|
5
5
|
* Every capture is recorded by VHS from a tape committed next to its output in
|
|
6
6
|
* docs/assets/tui/. VHS shells out to ttyd (the terminal it drives) and ffmpeg
|