@wpro-eng/opencode-config 1.5.0 → 1.6.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.
- package/agent/gandalf.md +8 -1
- package/agent/samwise.md +1 -1
- package/dist/index.js +72 -15
- package/package.json +1 -1
package/agent/gandalf.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
model:
|
|
2
|
+
model: github-copilot/claude-opus-4.6
|
|
3
3
|
description: Primary orchestration agent for planning, delegation, and delivery
|
|
4
4
|
temperature: 0.1
|
|
5
5
|
mode: primary
|
|
@@ -8,6 +8,7 @@ mode: primary
|
|
|
8
8
|
You are Gandalf, the orchestrator.
|
|
9
9
|
|
|
10
10
|
Operating principles:
|
|
11
|
+
|
|
11
12
|
1. Classify intent first: research, implementation, investigation, evaluation, fix, or open-ended.
|
|
12
13
|
2. Keep a visible plan and explicit task list for multi-step work.
|
|
13
14
|
3. Default to delegation for complex tasks, execute directly for trivial tasks.
|
|
@@ -15,6 +16,7 @@ Operating principles:
|
|
|
15
16
|
5. Deliver verifiable outcomes with concrete evidence, not claims.
|
|
16
17
|
|
|
17
18
|
Orchestration workflow:
|
|
19
|
+
|
|
18
20
|
1. Intent gate and ambiguity check.
|
|
19
21
|
2. Codebase assessment when scope is open-ended.
|
|
20
22
|
3. Exploration and research in parallel.
|
|
@@ -22,6 +24,7 @@ Orchestration workflow:
|
|
|
22
24
|
5. Verification and completion checks.
|
|
23
25
|
|
|
24
26
|
Delegation routing:
|
|
27
|
+
|
|
25
28
|
- `legolas` for internal codebase discovery.
|
|
26
29
|
- `radagast` for external docs and OSS references.
|
|
27
30
|
- `treebeard` for pre-planning analysis and plan review.
|
|
@@ -30,22 +33,26 @@ Delegation routing:
|
|
|
30
33
|
- `galadriel` for image/PDF/diagram interpretation.
|
|
31
34
|
|
|
32
35
|
Delegation prompt quality:
|
|
36
|
+
|
|
33
37
|
- Include task, expected outcome, required tools, must-do, must-not-do, and context.
|
|
34
38
|
- Keep delegated tasks atomic and verifiable.
|
|
35
39
|
- Verify delegated results independently before acceptance.
|
|
36
40
|
|
|
37
41
|
Task and progress discipline:
|
|
42
|
+
|
|
38
43
|
- Break multi-step work into explicit dependencies.
|
|
39
44
|
- Keep one active critical path visible.
|
|
40
45
|
- Emit concise milestone updates with concrete details.
|
|
41
46
|
- Track completions continuously, do not batch status changes.
|
|
42
47
|
|
|
43
48
|
Runtime controls:
|
|
49
|
+
|
|
44
50
|
- Use `/continue` for sustained orchestration loops.
|
|
45
51
|
- Use `/stop` to halt loop and queued orchestration work.
|
|
46
52
|
- Run `/diagnostics` when runtime health, delegation, or task tracking appears unhealthy.
|
|
47
53
|
|
|
48
54
|
Constraints:
|
|
55
|
+
|
|
49
56
|
- Avoid speculative over-engineering.
|
|
50
57
|
- Prefer small focused changes.
|
|
51
58
|
- Challenge risky user assumptions concisely, then proceed with safest practical path.
|
package/agent/samwise.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -8983,7 +8983,7 @@ async function copyWithRsync(source, target) {
|
|
|
8983
8983
|
} else if (stat.isDirectory()) {}
|
|
8984
8984
|
}
|
|
8985
8985
|
fs2.mkdirSync(path2.dirname(target), { recursive: true });
|
|
8986
|
-
const result = await $`rsync -a --delete ${source}/ ${target}/`.quiet();
|
|
8986
|
+
const result = await $`rsync -a --delete --checksum ${source}/ ${target}/`.quiet();
|
|
8987
8987
|
if (result.exitCode !== 0) {
|
|
8988
8988
|
throw new Error(`rsync failed: ${result.stderr.toString()}`);
|
|
8989
8989
|
}
|
|
@@ -9093,9 +9093,8 @@ async function createSkillInstall(skill, repoShortName, installMethod = "link")
|
|
|
9093
9093
|
if (installMethod === "copy") {
|
|
9094
9094
|
if (fs3.existsSync(targetPath)) {
|
|
9095
9095
|
const stats = fs3.lstatSync(targetPath);
|
|
9096
|
-
if (stats.
|
|
9097
|
-
|
|
9098
|
-
return result;
|
|
9096
|
+
if (stats.isSymbolicLink() || stats.isFile()) {
|
|
9097
|
+
fs3.unlinkSync(targetPath);
|
|
9099
9098
|
}
|
|
9100
9099
|
}
|
|
9101
9100
|
await syncDirectory(skill.path, targetPath);
|
|
@@ -9949,6 +9948,31 @@ function removeFromBunLock(cacheDir) {
|
|
|
9949
9948
|
}
|
|
9950
9949
|
return false;
|
|
9951
9950
|
}
|
|
9951
|
+
function updatePackageJsonVersion(cacheDir, newVersion) {
|
|
9952
|
+
const packageJsonPath = path8.join(cacheDir, "package.json");
|
|
9953
|
+
try {
|
|
9954
|
+
if (!fs8.existsSync(packageJsonPath)) {
|
|
9955
|
+
logDebug("No package.json in cache dir, nothing to update");
|
|
9956
|
+
return false;
|
|
9957
|
+
}
|
|
9958
|
+
const content = fs8.readFileSync(packageJsonPath, "utf-8");
|
|
9959
|
+
const pkg = JSON.parse(content);
|
|
9960
|
+
const deps = pkg.dependencies;
|
|
9961
|
+
if (!deps?.[PACKAGE_NAME]) {
|
|
9962
|
+
logDebug(`${PACKAGE_NAME} not found in package.json dependencies`);
|
|
9963
|
+
return false;
|
|
9964
|
+
}
|
|
9965
|
+
deps[PACKAGE_NAME] = newVersion;
|
|
9966
|
+
fs8.writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2) + `
|
|
9967
|
+
`);
|
|
9968
|
+
logDebug(`Updated ${PACKAGE_NAME} to ${newVersion} in ${packageJsonPath}`);
|
|
9969
|
+
return true;
|
|
9970
|
+
} catch (err) {
|
|
9971
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
9972
|
+
logError(`Failed to update package.json version: ${message}`);
|
|
9973
|
+
return false;
|
|
9974
|
+
}
|
|
9975
|
+
}
|
|
9952
9976
|
function invalidatePackage() {
|
|
9953
9977
|
const cacheDir = getOpenCodeCacheDir();
|
|
9954
9978
|
const configDir = getOpenCodeConfigDir();
|
|
@@ -10028,10 +10052,12 @@ async function checkAndUpdate() {
|
|
|
10028
10052
|
};
|
|
10029
10053
|
}
|
|
10030
10054
|
log(`Update available: ${cachedVersion ?? "unknown"} \u2192 ${latestVersion}`);
|
|
10055
|
+
const cacheDir = getOpenCodeCacheDir();
|
|
10056
|
+
updatePackageJsonVersion(cacheDir, latestVersion);
|
|
10031
10057
|
invalidatePackage();
|
|
10032
10058
|
const installSuccess = await runBunInstall();
|
|
10033
10059
|
if (installSuccess) {
|
|
10034
|
-
log(`Updated to ${latestVersion}
|
|
10060
|
+
log(`Updated to ${latestVersion}`);
|
|
10035
10061
|
return {
|
|
10036
10062
|
updateAvailable: true,
|
|
10037
10063
|
previousVersion: cachedVersion,
|
|
@@ -10377,6 +10403,20 @@ var WpromoteConfigPlugin = async (ctx) => {
|
|
|
10377
10403
|
if (gitignoreResult.modified) {
|
|
10378
10404
|
log(`Added _plugins/ to .gitignore at ${gitignoreResult.gitRoot}`);
|
|
10379
10405
|
}
|
|
10406
|
+
let updateApplied = false;
|
|
10407
|
+
let updateFrom = null;
|
|
10408
|
+
let updateTo = null;
|
|
10409
|
+
try {
|
|
10410
|
+
const updateResult = await checkAndUpdate();
|
|
10411
|
+
if (updateResult.installed) {
|
|
10412
|
+
updateApplied = true;
|
|
10413
|
+
updateFrom = updateResult.previousVersion;
|
|
10414
|
+
updateTo = updateResult.latestVersion;
|
|
10415
|
+
log(`Plugin updated: ${updateFrom ?? "unknown"} \u2192 ${updateTo}`);
|
|
10416
|
+
}
|
|
10417
|
+
} catch (err) {
|
|
10418
|
+
logError(`Auto-update check failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
10419
|
+
}
|
|
10380
10420
|
const {
|
|
10381
10421
|
totalSkills,
|
|
10382
10422
|
skippedConflicts,
|
|
@@ -10411,6 +10451,33 @@ var WpromoteConfigPlugin = async (ctx) => {
|
|
|
10411
10451
|
}
|
|
10412
10452
|
}
|
|
10413
10453
|
log(message);
|
|
10454
|
+
const pluginVersion = getPluginVersion();
|
|
10455
|
+
const showToasts = async () => {
|
|
10456
|
+
try {
|
|
10457
|
+
if (updateApplied && updateTo) {
|
|
10458
|
+
await ctx.client.tui.showToast({
|
|
10459
|
+
body: {
|
|
10460
|
+
title: "wpromote-config updated",
|
|
10461
|
+
message: `${updateFrom ?? "unknown"} \u2192 ${updateTo}`,
|
|
10462
|
+
variant: "success",
|
|
10463
|
+
duration: 5000
|
|
10464
|
+
}
|
|
10465
|
+
});
|
|
10466
|
+
} else {
|
|
10467
|
+
await ctx.client.tui.showToast({
|
|
10468
|
+
body: {
|
|
10469
|
+
title: "wpromote-config",
|
|
10470
|
+
message: `v${pluginVersion ?? "unknown"}`,
|
|
10471
|
+
variant: "info",
|
|
10472
|
+
duration: 3000
|
|
10473
|
+
}
|
|
10474
|
+
});
|
|
10475
|
+
}
|
|
10476
|
+
} catch {
|
|
10477
|
+
logDebug("Could not show startup toast (TUI may not be ready)");
|
|
10478
|
+
}
|
|
10479
|
+
};
|
|
10480
|
+
showToasts();
|
|
10414
10481
|
return {
|
|
10415
10482
|
config: async (config) => {
|
|
10416
10483
|
if (config.plugin !== undefined && !Array.isArray(config.plugin)) {
|
|
@@ -10526,16 +10593,6 @@ var WpromoteConfigPlugin = async (ctx) => {
|
|
|
10526
10593
|
}
|
|
10527
10594
|
}
|
|
10528
10595
|
}
|
|
10529
|
-
},
|
|
10530
|
-
event: async ({ event }) => {
|
|
10531
|
-
if (event.type !== "session.created")
|
|
10532
|
-
return;
|
|
10533
|
-
const props = event.properties;
|
|
10534
|
-
if (props?.info?.parentID)
|
|
10535
|
-
return;
|
|
10536
|
-
checkAndUpdate().catch((err) => {
|
|
10537
|
-
logError(`Auto-update check failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
10538
|
-
});
|
|
10539
10596
|
}
|
|
10540
10597
|
};
|
|
10541
10598
|
};
|