opencode-agent-skill 13.0.0-beta.1 → 14.2.0-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.
- package/README.md +1557 -606
- package/bin/ocskill.mjs +172 -24
- package/docs/OPENCODE-COMPAT.md +34 -95
- package/docs/PI-COMPAT.md +188 -0
- package/docs/V14-CONTEXT-MEMORY-FABRIC.md +70 -0
- package/docs/V14.1-QUALITY-PERFORMANCE-FABRIC.md +114 -0
- package/docs/V14.2-TURBO-WEAK-MODEL-RUNTIME.md +448 -0
- package/evals/v14/tasks.json +46 -0
- package/global-config/agents/executor.md +7 -0
- package/global-config/agents/visual-verifier.md +22 -3
- package/global-config/commands/run.md +27 -20
- package/global-config/plugins/ues-router/command-runtime.js +54 -0
- package/global-config/plugins/ues-router/index.js +30 -24
- package/global-config/plugins/ues-router/policy-runtime.js +7 -0
- package/global-config/plugins/ues-router/router.js +12 -2
- package/global-config/skills/ecommerce-engineering/SKILL.md +1 -1
- package/global-config/skills/file-upload-engineering/SKILL.md +1 -1
- package/global-config/skills/git-safety/SKILL.md +1 -1
- package/global-config/skills/nestjs-engineering/SKILL.md +1 -1
- package/global-config/skills/performance-engineering/SKILL.md +1 -1
- package/global-config/skills/react-native-engineering/SKILL.md +1 -1
- package/global-config/skills/rest-api-design/SKILL.md +1 -1
- package/global-config/skills/ui-ux-engineering/SKILL.md +1 -1
- package/lib/adaptive-context-budget.mjs +97 -0
- package/lib/affected-tests.mjs +260 -0
- package/lib/benchmark-confidence.mjs +41 -2
- package/lib/browser-mcp-routing.mjs +166 -0
- package/lib/capability-fabric.mjs +336 -0
- package/lib/capability-registry.mjs +9 -0
- package/lib/context-engine-v11.mjs +65 -1
- package/lib/context-graph-rank.mjs +118 -0
- package/lib/context-manifest.mjs +97 -18
- package/lib/control-center.mjs +19 -1
- package/lib/dynamic-workflow.mjs +3 -1
- package/lib/evidence-store.mjs +82 -1
- package/lib/hierarchical-context.mjs +215 -0
- package/lib/memory-engine.mjs +465 -0
- package/lib/model-performance.mjs +33 -8
- package/lib/model-policy.mjs +3 -3
- package/lib/orchestrator-policy.mjs +5 -209
- package/lib/performance-fabric.mjs +229 -0
- package/lib/pi-rpc-pool.mjs +433 -0
- package/lib/process-hang-detector.mjs +83 -0
- package/lib/process-supervisor.mjs +193 -0
- package/lib/prompt-cache.mjs +2 -0
- package/lib/repo-graph.mjs +53 -2
- package/lib/runtime-config.mjs +31 -0
- package/lib/safety.mjs +132 -0
- package/lib/semantic-index.mjs +52 -3
- package/lib/skill-compiler.mjs +128 -0
- package/lib/skill-quality.mjs +48 -2
- package/lib/task-engine.mjs +66 -5
- package/lib/task-policy.mjs +235 -0
- package/lib/verification-broker.mjs +284 -0
- package/lib/verification-command.mjs +111 -0
- package/lib/windows-shim.mjs +35 -0
- package/lib/workspace-fingerprint.mjs +198 -0
- package/package.json +52 -42
- package/pi/extensions/ues-child-runtime.ts +238 -0
- package/pi/extensions/ues.ts +3200 -0
- package/pi/prompts/ues-audit.md +9 -0
- package/pi/prompts/ues-critique.md +9 -0
- package/pi/prompts/ues-debug.md +9 -0
- package/pi/prompts/ues-feature.md +9 -0
- package/pi/prompts/ues-fix.md +9 -0
- package/pi/prompts/ues-plan.md +9 -0
- package/pi/prompts/ues-research.md +9 -0
- package/pi/prompts/ues-resume.md +9 -0
- package/pi/prompts/ues-review.md +7 -0
- package/pi/prompts/ues-run.md +17 -0
- package/pi/prompts/ues-verify.md +9 -0
- package/scripts/check-release-consistency.mjs +119 -185
- package/scripts/check-runtime-exports.mjs +66 -0
- package/scripts/check-source-integrity.mjs +184 -0
- package/scripts/eval-pi.mjs +492 -0
- package/scripts/install.mjs +16 -0
- package/scripts/smoke-package-closure.mjs +110 -0
- package/scripts/smoke-packed-install.mjs +24 -11
- package/scripts/smoke-pi-extension.mjs +144 -0
- package/scripts/uninstall.mjs +44 -0
- package/CHANGELOG.md +0 -405
- package/docs/DETERMINISTIC-TOOLS.md +0 -105
- package/docs/ENGINEERING-DESIGN.md +0 -194
- package/docs/EVALS.md +0 -158
- package/docs/GITHUB-RULESET.md +0 -50
- package/docs/NPM-PUBLISH.md +0 -116
- package/docs/RESEARCH-SOURCES.md +0 -37
- package/docs/TRACE-SCHEMA.md +0 -122
- package/docs/V11-PERCEPTION-ADAPTIVE-EXECUTION.md +0 -75
- package/docs/V11-PERCEPTION-ADAPTIVE.md +0 -220
- package/docs/V12-WEAK-MODEL-INTELLIGENCE.md +0 -27
- package/docs/V13-PARALLEL-WEAK-MODEL-RUNTIME.md +0 -75
- package/docs/V7-INTELLIGENCE-RUNTIME.md +0 -166
- package/docs/V8-INTELLIGENCE-RELIABILITY.md +0 -206
- 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,
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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(
|
|
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(
|
|
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(
|
|
1026
|
+
policy = await writeModelPolicy(getUesConfigDir(), { enabled: action === "on" })
|
|
1007
1027
|
printJson(policy)
|
|
1008
|
-
console.log("[ocskill]
|
|
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(
|
|
1038
|
+
policy = await writeModelPolicy(getUesConfigDir(), {
|
|
1019
1039
|
enabled: true,
|
|
1020
1040
|
tiers: { [tier]: model },
|
|
1021
1041
|
})
|
|
1022
1042
|
printJson(policy)
|
|
1023
|
-
console.log("[ocskill]
|
|
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(
|
|
1053
|
+
policy = await writeModelPolicy(getUesConfigDir(), {
|
|
1034
1054
|
roleTiers: { [role]: tier },
|
|
1035
1055
|
})
|
|
1036
1056
|
printJson(policy)
|
|
1037
|
-
console.log("[ocskill]
|
|
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(
|
|
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(
|
|
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
|
|
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
|
+
}
|
package/docs/OPENCODE-COMPAT.md
CHANGED
|
@@ -1,122 +1,61 @@
|
|
|
1
|
-
# OpenCode compatibility
|
|
1
|
+
# Legacy OpenCode compatibility
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Deprecated compatibility surface. The supported runtime in this repository is **Pi Agent**.
|
|
4
4
|
|
|
5
|
-
|
|
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
|
-
|
|
7
|
+
## Why these files still exist
|
|
8
8
|
|
|
9
|
-
|
|
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
|
|
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.
|
|
23
10
|
|
|
24
|
-
|
|
11
|
+
Legacy-only surfaces include:
|
|
25
12
|
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
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
|
-
```
|
|
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.
|
|
42
17
|
|
|
43
|
-
|
|
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.
|
|
44
19
|
|
|
45
|
-
|
|
20
|
+
## Current Pi equivalents
|
|
46
21
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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` |
|
|
54
30
|
|
|
55
|
-
|
|
31
|
+
## Migration guidance
|
|
56
32
|
|
|
57
|
-
|
|
33
|
+
New installs should use Pi:
|
|
58
34
|
|
|
59
35
|
```cmd
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
ocskill router off
|
|
36
|
+
npm install -g @earendil-works/pi-coding-agent
|
|
37
|
+
pi install git:github.com/laivannha0202/opencode-agent-skill-
|
|
38
|
+
pi
|
|
64
39
|
```
|
|
65
40
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
## Model routing
|
|
41
|
+
Use the UES-native CLI alias for deterministic operations:
|
|
69
42
|
|
|
70
43
|
```cmd
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
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
|
|
75
47
|
```
|
|
76
48
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
## Upgrading OpenCode
|
|
49
|
+
`ocskill` remains an alias during the migration window so existing scripts do not break immediately.
|
|
80
50
|
|
|
81
|
-
|
|
51
|
+
For an existing OpenCode installation that still needs the deprecated compatibility resources, synchronization is now explicit rather than an npm lifecycle side effect:
|
|
82
52
|
|
|
83
53
|
```cmd
|
|
84
54
|
ocskill install
|
|
85
|
-
ocskill status
|
|
86
55
|
```
|
|
87
56
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
## Primary references
|
|
91
|
-
|
|
92
|
-
- https://opencode.ai/v2/docs/build/plugins
|
|
93
|
-
- https://opencode.ai/v2/docs/build/plugins/migrate-v1
|
|
94
|
-
- https://opencode.ai/v2/docs/permissions
|
|
95
|
-
- https://opencode.ai/v2/docs/plugins
|
|
96
|
-
- https://opencode.ai/v2/docs/skills
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
## V8 capability probing
|
|
100
|
-
|
|
101
|
-
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.
|
|
102
|
-
|
|
103
|
-
The managed V2 plugin probes for:
|
|
104
|
-
|
|
105
|
-
- session creation
|
|
106
|
-
- prompting
|
|
107
|
-
- waiting
|
|
108
|
-
- interruption
|
|
109
|
-
- context retrieval
|
|
110
|
-
- agent switching
|
|
111
|
-
- model switching
|
|
112
|
-
- session hooks
|
|
113
|
-
- permission hooks
|
|
114
|
-
|
|
115
|
-
`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.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
## 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.
|
|
119
58
|
|
|
120
|
-
|
|
59
|
+
## Removal rule
|
|
121
60
|
|
|
122
|
-
|
|
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.
|