opencode-agent-skill 13.0.0-beta.2 → 14.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/README.md +1571 -607
  2. package/bin/ocskill.mjs +172 -24
  3. package/docs/OPENCODE-COMPAT.md +34 -97
  4. package/docs/PI-COMPAT.md +203 -0
  5. package/docs/V14-CONTEXT-MEMORY-FABRIC.md +70 -0
  6. package/docs/V14.1-QUALITY-PERFORMANCE-FABRIC.md +114 -0
  7. package/docs/V14.2-TURBO-WEAK-MODEL-RUNTIME.md +448 -0
  8. package/evals/v14/tasks.json +46 -0
  9. package/global-config/agents/executor.md +7 -0
  10. package/global-config/agents/visual-verifier.md +22 -3
  11. package/global-config/plugins/ues-router/index.js +13 -8
  12. package/global-config/plugins/ues-router/policy-runtime.js +7 -0
  13. package/global-config/plugins/ues-router/router.js +12 -2
  14. package/global-config/skills/ecommerce-engineering/SKILL.md +1 -1
  15. package/global-config/skills/file-upload-engineering/SKILL.md +1 -1
  16. package/global-config/skills/git-safety/SKILL.md +1 -1
  17. package/global-config/skills/nestjs-engineering/SKILL.md +1 -1
  18. package/global-config/skills/performance-engineering/SKILL.md +1 -1
  19. package/global-config/skills/react-native-engineering/SKILL.md +1 -1
  20. package/global-config/skills/rest-api-design/SKILL.md +1 -1
  21. package/global-config/skills/ui-ux-engineering/SKILL.md +1 -1
  22. package/lib/adaptive-context-budget.mjs +97 -0
  23. package/lib/affected-tests.mjs +260 -0
  24. package/lib/benchmark-confidence.mjs +41 -2
  25. package/lib/browser-mcp-routing.mjs +166 -0
  26. package/lib/capability-fabric.mjs +359 -0
  27. package/lib/capability-registry.mjs +9 -0
  28. package/lib/code-intelligence/edit-anchor.mjs +102 -0
  29. package/lib/code-intelligence/index.mjs +95 -0
  30. package/lib/code-intelligence/lsp-provider.mjs +189 -0
  31. package/lib/completion-auditor.mjs +82 -0
  32. package/lib/context-engine-v11.mjs +65 -1
  33. package/lib/context-graph-rank.mjs +118 -0
  34. package/lib/context-manifest.mjs +97 -18
  35. package/lib/control-center.mjs +19 -1
  36. package/lib/document-ingestion.mjs +60 -0
  37. package/lib/dynamic-workflow.mjs +3 -1
  38. package/lib/evidence-store.mjs +82 -1
  39. package/lib/fast-verification-gate.mjs +69 -0
  40. package/lib/hierarchical-context.mjs +215 -0
  41. package/lib/mcp-health.mjs +144 -0
  42. package/lib/mcp-tool-policy.mjs +19 -0
  43. package/lib/memory-engine.mjs +493 -0
  44. package/lib/model-performance.mjs +33 -8
  45. package/lib/model-policy.mjs +3 -3
  46. package/lib/orchestrator-policy.mjs +5 -209
  47. package/lib/performance-fabric.mjs +229 -0
  48. package/lib/pi-rpc-pool.mjs +433 -0
  49. package/lib/process-hang-detector.mjs +83 -0
  50. package/lib/process-supervisor.mjs +193 -0
  51. package/lib/prompt-cache.mjs +27 -11
  52. package/lib/repo-graph.mjs +53 -2
  53. package/lib/reversible-context.mjs +49 -0
  54. package/lib/runtime-config.mjs +31 -0
  55. package/lib/safety.mjs +132 -0
  56. package/lib/semantic-index.mjs +52 -3
  57. package/lib/skill-compiler.mjs +128 -0
  58. package/lib/skill-quality.mjs +48 -2
  59. package/lib/task-engine.mjs +62 -5
  60. package/lib/task-policy.mjs +291 -0
  61. package/lib/verification-broker.mjs +284 -0
  62. package/lib/verification-command.mjs +111 -0
  63. package/lib/windows-shim.mjs +35 -0
  64. package/lib/workspace-fingerprint.mjs +198 -0
  65. package/package.json +52 -42
  66. package/pi/extensions/ues-child-runtime.ts +393 -0
  67. package/pi/extensions/ues.ts +3327 -0
  68. package/pi/prompts/ues-audit.md +9 -0
  69. package/pi/prompts/ues-critique.md +9 -0
  70. package/pi/prompts/ues-debug.md +9 -0
  71. package/pi/prompts/ues-feature.md +9 -0
  72. package/pi/prompts/ues-fix.md +9 -0
  73. package/pi/prompts/ues-plan.md +9 -0
  74. package/pi/prompts/ues-research.md +9 -0
  75. package/pi/prompts/ues-resume.md +9 -0
  76. package/pi/prompts/ues-review.md +7 -0
  77. package/pi/prompts/ues-run.md +17 -0
  78. package/pi/prompts/ues-verify.md +9 -0
  79. package/scripts/check-release-consistency.mjs +119 -185
  80. package/scripts/check-runtime-exports.mjs +66 -0
  81. package/scripts/check-source-integrity.mjs +246 -0
  82. package/scripts/eval-pi.mjs +492 -0
  83. package/scripts/install.mjs +16 -0
  84. package/scripts/smoke-package-closure.mjs +110 -0
  85. package/scripts/smoke-packed-install.mjs +24 -11
  86. package/scripts/smoke-pi-extension.mjs +144 -0
  87. package/scripts/uninstall.mjs +44 -0
  88. package/CHANGELOG.md +0 -415
  89. package/docs/DETERMINISTIC-TOOLS.md +0 -105
  90. package/docs/ENGINEERING-DESIGN.md +0 -194
  91. package/docs/EVALS.md +0 -158
  92. package/docs/GITHUB-RULESET.md +0 -50
  93. package/docs/NPM-PUBLISH.md +0 -116
  94. package/docs/RESEARCH-SOURCES.md +0 -37
  95. package/docs/TRACE-SCHEMA.md +0 -122
  96. package/docs/V11-PERCEPTION-ADAPTIVE-EXECUTION.md +0 -75
  97. package/docs/V11-PERCEPTION-ADAPTIVE.md +0 -220
  98. package/docs/V12-WEAK-MODEL-INTELLIGENCE.md +0 -27
  99. package/docs/V13-PARALLEL-WEAK-MODEL-RUNTIME.md +0 -86
  100. package/docs/V7-INTELLIGENCE-RUNTIME.md +0 -166
  101. package/docs/V8-INTELLIGENCE-RELIABILITY.md +0 -206
  102. package/docs/V9-SPEED-INTELLIGENCE.md +0 -102
package/bin/ocskill.mjs CHANGED
@@ -15,6 +15,7 @@ import {
15
15
  import { compareVersions } from "../lib/version.mjs"
16
16
  import { resolveLatestPublishedVersion } from "../lib/update-resolver.mjs"
17
17
  import { readRouterConfig, writeRouterConfig } from "../lib/router-config.mjs"
18
+ import { getUesConfigDir } from "../lib/runtime-config.mjs"
18
19
  import { resolveWindowsCommand } from "../lib/windows-shim.mjs"
19
20
  import {
20
21
  detectStack,
@@ -66,8 +67,11 @@ import { createTaskSandbox, integrateTaskSandbox, listTaskSandboxes, removeTaskS
66
67
  import { analyzeEvalTraces, saveLearningAnalysis, readLearningState, acceptLearning, promoteLearning } from "../lib/learning-engine.mjs"
67
68
  import { hermesStatus, buildHermesDelegationPrompt, buildHermesWorkflowPrompt, hermesOneShotArgs, hermesSidecarPlan } from "../lib/hermes-bridge.mjs"
68
69
  import { readModelPolicy, recordModelPerformance, validateModelID, writeModelPolicy } from "../lib/model-config.mjs"
69
- import { evidenceStoreStatus, gcEvidenceStore, getEvidence, putEvidence } from "../lib/evidence-store.mjs"
70
+ import { evidenceStoreStatus, gcEvidenceStore, getEvidenceSelected, putEvidence } from "../lib/evidence-store.mjs"
70
71
  import { inferTaskCapabilities } from "../lib/capability-registry.mjs"
72
+ import { capabilityFabricStatus } from "../lib/capability-fabric.mjs"
73
+ import { queryContextHierarchy } from "../lib/hierarchical-context.mjs"
74
+ import { memoryStatus, proposeMemory, retrieveMemories, supersedeMemory, verifyMemory } from "../lib/memory-engine.mjs"
71
75
  import { MODEL_TASK_CLASSES } from "../lib/model-performance.mjs"
72
76
  import { browserCapability, buildBrowserVerificationPlan } from "../lib/browser-adapter.mjs"
73
77
  import { inspectBrowserPage, summarizeBrowserInspection } from "../lib/browser-runtime.mjs"
@@ -107,14 +111,12 @@ const packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "
107
111
 
108
112
  function printHelp() {
109
113
  console.log(`
110
- OpenCode Universal Engineering System
111
-
112
- Usage:
113
- ocskill install [--force] Install or re-sync bundled OpenCode resources
114
+ Universal Engineering System for Pi Agent\n\nUsage (preferred CLI: ues; ocskill remains a compatibility alias):\n ocskill install [--force] Legacy: install/re-sync OpenCode compatibility resources
114
115
  ocskill status Show package/resource synchronization status
115
- ocskill doctor Check Node, npm, OpenCode and installed resources
116
+ ocskill doctor Legacy migration doctor for OpenCode compatibility resources
116
117
  ocskill eval Validate the bundled static skill-routing suite
117
- ocskill eval-live [options] Run baseline-vs-UES live behavioral evals
118
+ ocskill eval-live [options] Run legacy OpenCode baseline-vs-UES behavioral evals
119
+ ocskill eval-pi [options] Run Pi-native baseline-vs-UES weak-model benchmark
118
120
  ocskill eval-report [paths] Aggregate live eval pass-rate/cost/tool telemetry
119
121
  ocskill inspect [dir] Deterministic repository/stack/test-command map
120
122
  ocskill impact <query> [dir] Search likely impact paths and matching lines
@@ -147,6 +149,10 @@ Usage:
147
149
  ocskill hermes <action> ... Optional Hermes sidecar/status/task/workflow planning
148
150
  ocskill store <status|put|get|gc> ... Content-addressed evidence storage and bounded retrieval
149
151
  ocskill capabilities <text> Infer required execution/model capabilities
152
+ ocskill capability-fabric <status|select> ... Health-check and select tool/provider backends
153
+ ocskill hierarchy <query> [dir] [--full]
154
+ Progressive L0/L1 scope routing; compact by default, --full includes complete file lists
155
+ ocskill memory <action> ... Verified persistent project memory and hybrid retrieval
150
156
  ocskill visual <action> ... Geometry receipts, PNG diff/crop and viewport matrix
151
157
  ocskill browser <action> ... Browser capability, plan and bounded Playwright inspection
152
158
  ocskill ui <tokens|layout> ... Extract design tokens or verify responsive geometry
@@ -154,11 +160,7 @@ Usage:
154
160
  ocskill skills lint [dir] Lint skill size, metadata and routing-description collisions
155
161
  ocskill dashboard [dir] [--serve] [--port N]
156
162
  Generate/serve the local UES Control Center
157
- ocskill models <status|on|off|set|role> ...
158
- Configure role/tier model routing, then re-sync
159
- ocskill router [status|on|off] [--max N]
160
- Configure the OpenCode v2 automatic skill router
161
- ocskill update Update the global npm package and re-sync resources
163
+ ues models <status|on|off|set|role> ...\n Configure Pi runtime role/tier model routing immediately\n ocskill router [status|on|off] [--max N]\n Legacy: configure the OpenCode v2 compatibility router\n ocskill update Update the global npm package and re-sync resources
162
164
  ocskill remove [--force] Remove managed resources and uninstall the npm package
163
165
  ocskill version Show package version
164
166
  ocskill help Show this help
@@ -426,6 +428,16 @@ async function doctor() {
426
428
  if (code !== 0) process.exitCode = code
427
429
  }
428
430
  await status()
431
+ try {
432
+ const fabric = await capabilityFabricStatus(process.cwd())
433
+ console.log("Capability fabric:")
434
+ for (const row of fabric.rows || []) {
435
+ const fallbacks = row.fallbacks?.length ? " -> " + row.fallbacks.join(" -> ") : ""
436
+ console.log(` ${row.capability}: ${row.selected || "UNAVAILABLE"}${fallbacks} [${row.status}]`)
437
+ }
438
+ } catch (error) {
439
+ console.log("Capability fabric: unavailable (" + errorMessage(error) + ")")
440
+ }
429
441
  }
430
442
 
431
443
  async function evaluate() {
@@ -441,6 +453,14 @@ async function evaluateLive() {
441
453
  if (code !== 0) process.exitCode = code
442
454
  }
443
455
 
456
+ async function evaluatePi() {
457
+ const code = run(
458
+ process.execPath,
459
+ [path.join(packageRoot, "scripts", "eval-pi.mjs"), ...args.slice(1)],
460
+ )
461
+ if (code !== 0) process.exitCode = code
462
+ }
463
+
444
464
  function printJson(value) {
445
465
  console.log(JSON.stringify(value, null, 2))
446
466
  }
@@ -982,7 +1002,7 @@ async function modelPolicy() {
982
1002
  return
983
1003
  }
984
1004
  const attempt = optionInt(args, "--attempt", 1)
985
- const policy = await readModelPolicy(getConfigDir())
1005
+ const policy = await readModelPolicy(getUesConfigDir())
986
1006
  const normalizedAttempt = Number.isInteger(attempt) && attempt > 0 ? attempt : 1
987
1007
  const taskText = optionValue(args, "--text")
988
1008
  if (taskText) {
@@ -996,16 +1016,16 @@ async function modelPolicy() {
996
1016
 
997
1017
  async function modelsControl() {
998
1018
  const action = args[1] || "status"
999
- let policy = await readModelPolicy(getConfigDir())
1019
+ let policy = await readModelPolicy(getUesConfigDir())
1000
1020
 
1001
1021
  if (action === "status") {
1002
1022
  printJson(policy)
1003
1023
  return
1004
1024
  }
1005
1025
  if (action === "on" || action === "off") {
1006
- policy = await writeModelPolicy(getConfigDir(), { enabled: action === "on" })
1026
+ policy = await writeModelPolicy(getUesConfigDir(), { enabled: action === "on" })
1007
1027
  printJson(policy)
1008
- console.log("[ocskill] Run 'ocskill install' to rewrite managed agent frontmatter.")
1028
+ console.log("[ocskill] Model routing is active immediately for Pi child-agent dispatch.")
1009
1029
  return
1010
1030
  }
1011
1031
  if (action === "set") {
@@ -1015,12 +1035,12 @@ async function modelsControl() {
1015
1035
  printCliError(Object.assign(new Error("Usage: ocskill models set <light|standard|heavy> <provider/model[#variant]>"), { code: "UES_USAGE", exitCode: 2 }))
1016
1036
  return
1017
1037
  }
1018
- policy = await writeModelPolicy(getConfigDir(), {
1038
+ policy = await writeModelPolicy(getUesConfigDir(), {
1019
1039
  enabled: true,
1020
1040
  tiers: { [tier]: model },
1021
1041
  })
1022
1042
  printJson(policy)
1023
- console.log("[ocskill] Run 'ocskill install' to apply model mappings to managed agents.")
1043
+ console.log("[ocskill] Model routing is active immediately for Pi child-agent dispatch.")
1024
1044
  return
1025
1045
  }
1026
1046
  if (action === "role") {
@@ -1030,11 +1050,11 @@ async function modelsControl() {
1030
1050
  printCliError(Object.assign(new Error("Usage: ocskill models role <role> <light|standard|heavy>"), { code: "UES_USAGE", exitCode: 2 }))
1031
1051
  return
1032
1052
  }
1033
- policy = await writeModelPolicy(getConfigDir(), {
1053
+ policy = await writeModelPolicy(getUesConfigDir(), {
1034
1054
  roleTiers: { [role]: tier },
1035
1055
  })
1036
1056
  printJson(policy)
1037
- console.log("[ocskill] Run 'ocskill install' to apply role-tier changes.")
1057
+ console.log("[ocskill] Role-tier routing is active immediately for Pi child-agent dispatch.")
1038
1058
  return
1039
1059
  }
1040
1060
 
@@ -1048,7 +1068,7 @@ async function modelsControl() {
1048
1068
  if (!MODEL_TASK_CLASSES.includes(taskClass)) throw new Error("--task-class must be one of: " + MODEL_TASK_CLASSES.join(", "))
1049
1069
  const passedRaw = String(optionValue(args, "--passed") || "").toLowerCase()
1050
1070
  if (!["on","off","true","false","pass","fail"].includes(passedRaw)) throw new Error("--passed must be on/off, true/false, or pass/fail")
1051
- policy = await recordModelPerformance(getConfigDir(), {
1071
+ policy = await recordModelPerformance(getUesConfigDir(), {
1052
1072
  model, taskClass, passed: ["on","true","pass"].includes(passedRaw),
1053
1073
  retries: optionInt(args, "--retries", 0) || 0,
1054
1074
  tokens: optionInt(args, "--tokens", 0) || 0,
@@ -1078,7 +1098,7 @@ async function modelsControl() {
1078
1098
  const latency = optionValue(args, "--latency") || current.latencyClass
1079
1099
  if (cost && !["low", "medium", "high"].includes(cost)) throw new Error("--cost must be low|medium|high")
1080
1100
  if (latency && !["fast", "medium", "slow"].includes(latency)) throw new Error("--latency must be fast|medium|slow")
1081
- policy = await writeModelPolicy(getConfigDir(), {
1101
+ policy = await writeModelPolicy(getUesConfigDir(), {
1082
1102
  capabilities: {
1083
1103
  [model]: {
1084
1104
  ...current,
@@ -1357,7 +1377,7 @@ async function evidenceStoreControl() {
1357
1377
  const ref = args[2]
1358
1378
  const root = positionalArg(args, 3) || process.cwd()
1359
1379
  if (!ref) throw new Error("Usage: ocskill store get <evidence-ref> [dir] [--max N] [--start N]")
1360
- printJson(await getEvidence(root, ref, {
1380
+ printJson(await getEvidenceSelected(root, ref, {
1361
1381
  maxChars: optionInt(args, "--max", 24_000),
1362
1382
  start: optionInt(args, "--start", 0),
1363
1383
  }))
@@ -1386,6 +1406,122 @@ async function capabilityControl() {
1386
1406
  printJson(inferTaskCapabilities(text))
1387
1407
  }
1388
1408
 
1409
+
1410
+ async function capabilityFabricControl() {
1411
+ const action = args[1] || "status"
1412
+ try {
1413
+ if (action === "status") {
1414
+ printJson(await capabilityFabricStatus(positionalArg(args, 2) || process.cwd()))
1415
+ return
1416
+ }
1417
+ if (action === "select") {
1418
+ const capability = args[2]
1419
+ const root = positionalArg(args, 3) || process.cwd()
1420
+ if (!capability) throw new Error("Usage: ocskill capability-fabric select <capability> [dir]")
1421
+ const status = await capabilityFabricStatus(root)
1422
+ const selected = status.capabilities?.[capability]
1423
+ if (!selected) throw new Error("Unknown capability: " + capability)
1424
+ printJson(selected)
1425
+ return
1426
+ }
1427
+ throw new Error("Usage: ocskill capability-fabric <status|select> ...")
1428
+ } catch (error) {
1429
+ printCliError(error)
1430
+ }
1431
+ }
1432
+
1433
+ async function hierarchyControl() {
1434
+ const query = args[1]
1435
+ const root = positionalArg(args, 2) || process.cwd()
1436
+ if (!query) {
1437
+ printCliError(Object.assign(new Error("Usage: ocskill hierarchy <query> [dir] [--max-scopes N] [--full]"), { code: "UES_USAGE", exitCode: 2 }))
1438
+ return
1439
+ }
1440
+ try {
1441
+ const result = await queryContextHierarchy(root, query, { maxScopes: optionInt(args, "--max-scopes", 6) })
1442
+ if (args.includes("--full")) {
1443
+ printJson(result)
1444
+ return
1445
+ }
1446
+ printJson({
1447
+ ...result,
1448
+ compact: true,
1449
+ scopes: (result.scopes || []).map((scope) => ({
1450
+ path: scope.path,
1451
+ score: scope.score,
1452
+ reasons: scope.reasons,
1453
+ fileCount: scope.fileCount,
1454
+ bytes: scope.bytes,
1455
+ l0: scope.l0,
1456
+ l1: scope.l1,
1457
+ topFiles: (scope.files || []).slice(0, 12),
1458
+ topSymbols: (scope.symbols || []).slice(0, 12),
1459
+ childCount: (scope.children || []).length,
1460
+ })),
1461
+ })
1462
+ } catch (error) {
1463
+ printCliError(error)
1464
+ }
1465
+ }
1466
+
1467
+ async function memoryControl() {
1468
+ const action = args[1] || "status"
1469
+ try {
1470
+ if (action === "status") {
1471
+ printJson(await memoryStatus(positionalArg(args, 2) || process.cwd()))
1472
+ return
1473
+ }
1474
+ if (action === "search") {
1475
+ const query = args[2]
1476
+ const root = positionalArg(args, 3) || process.cwd()
1477
+ if (!query) throw new Error("Usage: ocskill memory search <query> [dir] [--limit N] [--file <path>]")
1478
+ const files = []
1479
+ const file = optionValue(args, "--file")
1480
+ if (file) files.push(file)
1481
+ printJson(await retrieveMemories(root, query, { limit: optionInt(args, "--limit", 6), files }))
1482
+ return
1483
+ }
1484
+ if (action === "propose") {
1485
+ const content = args[2]
1486
+ const root = positionalArg(args, 3) || process.cwd()
1487
+ if (!content) throw new Error("Usage: ocskill memory propose <text> [dir] [--type <type>] [--scope <scope>] [--evidence <ref>] [--file <path>]")
1488
+ const evidence = optionValue(args, "--evidence")
1489
+ const file = optionValue(args, "--file")
1490
+ printJson(await proposeMemory(root, {
1491
+ content,
1492
+ type: optionValue(args, "--type") || "episodic",
1493
+ scope: optionValue(args, "--scope") || "project",
1494
+ evidenceRefs: evidence ? [evidence] : [],
1495
+ files: file ? [file] : [],
1496
+ }))
1497
+ return
1498
+ }
1499
+ if (action === "verify") {
1500
+ const id = args[2]
1501
+ const root = positionalArg(args, 3) || process.cwd()
1502
+ if (!id) throw new Error("Usage: ocskill memory verify <id> [dir] --verdict PASS --verifier <name> [--evidence <ref>]")
1503
+ const evidence = optionValue(args, "--evidence")
1504
+ printJson(await verifyMemory(root, id, {
1505
+ verdict: optionValue(args, "--verdict"),
1506
+ verifier: optionValue(args, "--verifier"),
1507
+ evidenceRefs: evidence ? [evidence] : [],
1508
+ }))
1509
+ return
1510
+ }
1511
+ if (action === "supersede") {
1512
+ const id = args[2]
1513
+ const replacement = args[3]
1514
+ const root = positionalArg(args, 4) || process.cwd()
1515
+ if (!id || !replacement) throw new Error("Usage: ocskill memory supersede <id> <replacement-id> [dir]")
1516
+ printJson(await supersedeMemory(root, id, replacement))
1517
+ return
1518
+ }
1519
+ throw new Error("Usage: ocskill memory <status|search|propose|verify|supersede> ...")
1520
+ } catch (error) {
1521
+ printCliError(error)
1522
+ }
1523
+ }
1524
+
1389
1525
  async function visualControl() {
1390
1526
  const action = args[1]
1391
1527
  try {
@@ -1724,6 +1860,9 @@ async function main() {
1724
1860
  case "eval-live":
1725
1861
  await evaluateLive()
1726
1862
  break
1863
+ case "eval-pi":
1864
+ await evaluatePi()
1865
+ break
1727
1866
  case "eval-report":
1728
1867
  await evaluateReport()
1729
1868
  break
@@ -1787,6 +1926,15 @@ async function main() {
1787
1926
  case "capabilities":
1788
1927
  await capabilityControl()
1789
1928
  break
1929
+ case "capability-fabric":
1930
+ await capabilityFabricControl()
1931
+ break
1932
+ case "hierarchy":
1933
+ await hierarchyControl()
1934
+ break
1935
+ case "memory":
1936
+ await memoryControl()
1937
+ break
1790
1938
  case "visual":
1791
1939
  await visualControl()
1792
1940
  break
@@ -1856,4 +2004,4 @@ try {
1856
2004
  await main()
1857
2005
  } catch (error) {
1858
2006
  printCliError(error)
1859
- }
2007
+ }
@@ -1,124 +1,61 @@
1
- # OpenCode compatibility
1
+ # Legacy OpenCode compatibility
2
2
 
3
- V13 ships one npm package for OpenCode 1.x and 2.x. CLI/state/verification features remain available on both lines, while V2-native fresh-session and parallel runtime features are enabled only when the required V2 capabilities are detected.
3
+ > Deprecated compatibility surface. The supported runtime in this repository is **Pi Agent**.
4
4
 
5
- ## Detection
5
+ UES no longer depends on the OpenCode router for its core task policy, model routing, context construction, specialist dispatch, scheduling, verification, or benchmark path. The canonical runtime lives under `pi/` and `lib/`.
6
6
 
7
- During resource sync, UES reads:
7
+ ## Why these files still exist
8
8
 
9
- ```text
10
- opencode --version
11
- ```
12
-
13
- Tests may override with:
14
-
15
- ```text
16
- UES_OPENCODE_MAJOR=1
17
- UES_OPENCODE_MAJOR=2
18
- ```
19
-
20
- The detected major is recorded in the managed state.
21
-
22
- ## OpenCode 1.x
23
-
24
- UES installs:
9
+ A small compatibility layer is retained temporarily so older installations can be inspected or migrated without silently deleting user-managed resources. It is not loaded by the Pi package manifest and should not be used for new development.
25
10
 
26
- - 48 namespaced skills
27
- - 11 namespaced commands
28
- - 12 namespaced subagents using compatible V1 `permission` frontmatter
29
- - managed global `AGENTS.md` block
30
-
31
- The V2 runtime plugin is not installed.
32
-
33
- Durable CLI state, task DAG, plan/integration gates, Windows UTF text recovery and model-policy configuration remain available. `ues.dispatch_task` and `ues.dispatch_parallel` are unavailable because those tools live in the V2 router plugin.
34
-
35
- ## OpenCode 2.x
36
-
37
- UES converts managed agent permission frontmatter to V2 ordered `permissions` and installs:
38
-
39
- ```text
40
- <global-config>/plugins/ues-router/
41
- ```
11
+ Legacy-only surfaces include:
42
12
 
43
- V13 also installs the 11 UES slash-command templates inside the managed router as V2 **prompt aliases** instead of registering them as native global custom commands. Typing `/ues-run ...`, `/ues-fix ...`, and the other `/ues-*` aliases therefore travels through `session.prompt`; the router expands the same bundled command contract before routing skills. This is a compatibility workaround for V2 custom-command transport failures such as `UnsupportedContentType` from the `session.command` path. Re-syncing with `ocskill install` removes stale UES-managed native command files from older installs.
13
+ - `global-config/commands/`;
14
+ - `global-config/plugins/ues-router/`;
15
+ - OpenCode installer/router compatibility code in `lib/installer.mjs`, `lib/opencode-compat.mjs`, and `lib/router-config.mjs`;
16
+ - `scripts/eval-live.mjs`, which exists only for historical OpenCode benchmark comparison.
44
17
 
45
- For `/ues-run`, V13.0.0-beta.2 adds adaptive admission before the prompt is sent to the model. The router classifies the real user arguments, not the expanded command template. FAST and STANDARD work receive compact envelopes, while only DEEP/long-horizon/high-risk work keeps the full durable workflow. `/ues-resume` stays explicitly durable. This prevents a trivial or bounded request from being turned into a long-running repository workflow simply because the user typed `/ues-run`.
18
+ The old router policy file is now a compatibility shim that re-exports the canonical Pi-native `lib/task-policy.mjs`, preventing policy drift.
46
19
 
47
- The plugin provides:
20
+ ## Current Pi equivalents
48
21
 
49
- - prompt-admission skill routing
50
- - long-task context guardrails
51
- - permission safety evaluation when that hook exists
52
- - durable-state/task-graph/context-pack tools
53
- - `ues.dispatch_task` bounded fresh executor runtime
54
- - `ues.cancel_task` and `ues.recover_task` when session interruption is supported
55
- - `ues.dispatch_parallel` when the full fresh-dispatch surface is present; it runs independent approved tasks in isolated same-model sessions, verifies each task independently, and serializes integration
22
+ | Legacy surface | Pi-native replacement |
23
+ |---|---|
24
+ | OpenCode router task admission | `lib/task-policy.mjs` + `ues_execute` |
25
+ | OpenCode dispatch | `ues_execute` / `ues_dispatch` |
26
+ | OpenCode model routing | `lib/model-policy.mjs` consumed directly by Pi dispatch |
27
+ | OpenCode prompt aliases | `pi/prompts/*.md` |
28
+ | OpenCode live eval | `ues eval-pi ...` / `scripts/eval-pi.mjs` |
29
+ | Manual writer worktree preparation | structured-plan safe-wave scheduler in `ues_execute` |
56
30
 
57
- `ues.dispatch_task` uses V2 session APIs to create a fresh session rooted at the selected execution directory, bind its session ID to the task lease, select `ues-executor`, optionally switch model tier, prompt one approved task, heartbeat while waiting, and interrupt on timeout. Concurrent writing tasks can be isolated in Git worktrees.
31
+ ## Migration guidance
58
32
 
59
- ## Router control
33
+ New installs should use Pi:
60
34
 
61
35
  ```cmd
62
- ocskill router status
63
- ocskill router on
64
- ocskill router on --max 3
65
- ocskill router off
36
+ npm install -g @earendil-works/pi-coding-agent
37
+ pi install git:github.com/laivannha0202/opencode-agent-skill-
38
+ pi
66
39
  ```
67
40
 
68
- Default maximum is 4 selected skills; supported range is 1–6.
69
-
70
- ## Model routing
41
+ Use the UES-native CLI alias for deterministic operations:
71
42
 
72
43
  ```cmd
73
- ocskill models status
74
- ocskill models on
75
- ocskill models set standard provider/model
76
- ocskill models set heavy provider/strong-model
44
+ ues task-policy "fix a payment callback race" --json
45
+ ues models status --json
46
+ ues eval-pi --model provider/model --mode both
77
47
  ```
78
48
 
79
- Re-run `ocskill install` after changing static managed-agent model frontmatter. Runtime `ues.dispatch_task` also reads the current model policy for attempt-based executor escalation.
80
-
81
- ## Upgrading OpenCode
49
+ `ocskill` remains an alias during the migration window so existing scripts do not break immediately.
82
50
 
83
- After moving between V1/V2 lines:
51
+ For an existing OpenCode installation that still needs the deprecated compatibility resources, synchronization is now explicit rather than an npm lifecycle side effect:
84
52
 
85
53
  ```cmd
86
54
  ocskill install
87
- ocskill status
88
55
  ```
89
56
 
90
- Only UES-managed resources are rewritten/removed. Unrelated user plugins/resources are preserved.
91
-
92
- ## Primary references
93
-
94
- - https://opencode.ai/v2/docs/build/plugins
95
- - https://opencode.ai/v2/docs/build/plugins/migrate-v1
96
- - https://opencode.ai/v2/docs/permissions
97
- - https://opencode.ai/v2/docs/plugins
98
- - https://opencode.ai/v2/docs/skills
99
-
100
-
101
- ## V8 capability probing
102
-
103
- Version detection remains useful for install-time compatibility, but V8 runtime dispatch does not assume that a major version proves the availability of every session API.
104
-
105
- The managed V2 plugin probes for:
106
-
107
- - session creation
108
- - prompting
109
- - waiting
110
- - interruption
111
- - context retrieval
112
- - agent switching
113
- - model switching
114
- - session hooks
115
- - permission hooks
116
-
117
- `ues.capabilities` exposes the observed surface. Fresh dispatch fails closed when the minimum create/prompt/wait/interrupt/context/switch-agent surface is unavailable. Optional context/prompt/permission hooks degrade safely instead of preventing the plugin from loading.
118
-
119
-
120
- ## V13 parallel compatibility
57
+ The npm package intentionally has no `postinstall` or `preuninstall` compatibility hooks. Installing UES for Pi must not silently mutate OpenCode configuration.
121
58
 
122
- `ues.dispatch_parallel` is capability-gated, not version-string-gated. It requires the complete fresh-dispatch surface reported by `ues.capabilities`: session create, prompt, wait, interrupt, context retrieval and agent switching. If any required API is missing, V13 fails closed and the durable CLI workflow remains usable in serial mode.
59
+ ## Removal rule
123
60
 
124
- OpenCode 1.x users can still use V13 CLI hardening, durable `.ues-work/<slug>/` state, receipts, task graphs and Windows text normalization. To use native multi-session parallel execution, use a runtime that exposes the V2 fresh-session APIs.
61
+ Do not add new features to the legacy OpenCode compatibility surface. New runtime features must land in Pi/`lib` first. Legacy files may be removed once migration coverage proves that no supported Pi command imports or packages them.