kibi-opencode 0.11.0 → 0.12.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 +9 -0
- package/dist/file-filter.js +6 -0
- package/dist/plugin.js +14 -1
- package/dist/prompt.js +6 -3
- package/dist/scheduler.js +2 -0
- package/dist/startup-notifier.js +4 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -294,6 +294,15 @@ The plugin provides proactive guidance when agents perform file operations:
|
|
|
294
294
|
|
|
295
295
|
- **File-delete safety guidance**: When an agent attempts to delete a file, the plugin injects a safety check reminding the agent to verify if the file implements any Kibi requirements before removal.
|
|
296
296
|
|
|
297
|
+
### Repository Ignore Support
|
|
298
|
+
|
|
299
|
+
The OpenCode plugin respects the repository ignore policy used by Kibi's discovery pipeline. In practice this means:
|
|
300
|
+
|
|
301
|
+
- The plugin's background sync and file-event handling skip paths matched by repository `.gitignore` files, nested `.gitignore` files, and `.git/info/exclude`.
|
|
302
|
+
- The plugin also treats a curated set of tool/runtime directories as never-relevant for KB sync (for example: `.sisyphus`, `.opencode`, `.kb`, `.git`, `node_modules`, `vendor`, `third_party`).
|
|
303
|
+
|
|
304
|
+
When a file event occurs for an ignored path, the plugin skips processing and will not surface candidate guidance for that file. This avoids noisy briefings and prevents build/editor artifacts from triggering KB sync work.
|
|
305
|
+
|
|
297
306
|
- **E2e reminder evidence**: File-operation reminders use exact Kibi graph evidence first (`covered_by` links to `[e2e]`-tagged entities or `/e2e/`-sourced entities) and narrow path heuristics second. Package-level e2e tests do not trigger "authoritative evidence" flags at the file level.
|
|
298
307
|
|
|
299
308
|
- **Session suppression**: To minimize prompt noise, this guidance is suppressed after the first occurrence per path per session.
|
package/dist/file-filter.js
CHANGED
|
@@ -2,6 +2,7 @@ import { existsSync, readFileSync } from "node:fs";
|
|
|
2
2
|
// implements REQ-opencode-kibi-plugin-v1
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import * as path from "node:path";
|
|
5
|
+
import { createRepoIgnorePolicy } from "kibi-cli/ignore-policy";
|
|
5
6
|
const _require = createRequire(import.meta.url);
|
|
6
7
|
// Lightweight fallback matcher if picomatch isn't installed.
|
|
7
8
|
let picomatch;
|
|
@@ -135,6 +136,11 @@ export function shouldHandleFile(filePath, cwd = process.cwd()) {
|
|
|
135
136
|
const rel = path.isAbsolute(filePath)
|
|
136
137
|
? path.relative(cwd, filePath).split(path.sep).join("/")
|
|
137
138
|
: filePath.split(path.sep).join("/");
|
|
139
|
+
// Check shared ignore policy (root .gitignore, nested .gitignore, .git/info/exclude,
|
|
140
|
+
// and hard denylist such as .sisyphus) before other pattern checks.
|
|
141
|
+
const policy = createRepoIgnorePolicy(cwd);
|
|
142
|
+
if (policy.isIgnored(rel))
|
|
143
|
+
return false;
|
|
138
144
|
const paths = loadKbSyncPaths(cwd);
|
|
139
145
|
// Build include patterns from kibi paths
|
|
140
146
|
const includeCandidates = [
|
package/dist/plugin.js
CHANGED
|
@@ -43,6 +43,17 @@ function resolveIdleBriefDeliveryDelayMs(worktree) {
|
|
|
43
43
|
return 0;
|
|
44
44
|
return Math.min(60_000, Math.trunc(configValue));
|
|
45
45
|
}
|
|
46
|
+
function readKibiOpencodePackageVersion() {
|
|
47
|
+
try {
|
|
48
|
+
const packageJson = JSON.parse(fs.readFileSync(new URL("../package.json", import.meta.url), "utf-8"));
|
|
49
|
+
return typeof packageJson.version === "string"
|
|
50
|
+
? packageJson.version
|
|
51
|
+
: undefined;
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
46
57
|
const startupNotifyGlobals = globalThis;
|
|
47
58
|
/**
|
|
48
59
|
* Lint requirement documents for embedded scenarios/tests and oversized content.
|
|
@@ -961,7 +972,7 @@ const kibiOpencodePlugin = async (input) => {
|
|
|
961
972
|
overlay_cause: runtimeOverlay.primaryCause ?? null,
|
|
962
973
|
});
|
|
963
974
|
// Emit completion-reminder log only when prompt-visible reminder text is present
|
|
964
|
-
const REMINDER_TEXT = "
|
|
975
|
+
const REMINDER_TEXT = "Kibi impact evidence is required before completion/commit: run `kb_check` before completing this task.";
|
|
965
976
|
if (cfg.guidance.smartEnforcement.completionReminder &&
|
|
966
977
|
!maintenanceDegraded &&
|
|
967
978
|
guidance.includes(REMINDER_TEXT)) {
|
|
@@ -1057,9 +1068,11 @@ const kibiOpencodePlugin = async (input) => {
|
|
|
1057
1068
|
setTimeout(callback, delayMs);
|
|
1058
1069
|
});
|
|
1059
1070
|
scheduleStartupNotify(() => {
|
|
1071
|
+
const version = readKibiOpencodePackageVersion();
|
|
1060
1072
|
notifyStartup(makeStartupClient(client), {
|
|
1061
1073
|
suppressToast: cfg.ux.toastStartup === false,
|
|
1062
1074
|
directory: input.directory,
|
|
1075
|
+
...(version ? { version } : {}),
|
|
1063
1076
|
});
|
|
1064
1077
|
}, 2000);
|
|
1065
1078
|
}
|
package/dist/prompt.js
CHANGED
|
@@ -131,13 +131,15 @@ Requirement edits need policy alignment. Run kb_check with required-fields and n
|
|
|
131
131
|
|
|
132
132
|
Production code: use \`implements\` (symbol→req) for requirement ownership. Test code: use \`executable_for\` (symbol→test).
|
|
133
133
|
- \`covered_by\` is coverage evidence only
|
|
134
|
-
- Prefer scenario-first: req→scenario→test when scenarios exist
|
|
134
|
+
- Prefer scenario-first: req→scenario→test when scenarios exist
|
|
135
|
+
- Kibi impact evidence is required before completion/commit`,
|
|
135
136
|
traceability_candidate: `📝 **Code changes detected**
|
|
136
137
|
|
|
137
138
|
Production code: use \`implements\` (symbol→req) for requirement ownership. Test code: use \`executable_for\` (symbol→test).
|
|
138
139
|
- \`covered_by\` is coverage evidence only
|
|
139
140
|
- Prefer scenario-first: req→scenario→test when scenarios exist
|
|
140
|
-
- Route durable knowledge comments to KB entities, not inline comments
|
|
141
|
+
- Route durable knowledge comments to KB entities, not inline comments
|
|
142
|
+
- documentation/symbols.yaml refresh is required when extraction output changes; do not revert as scope creep`,
|
|
141
143
|
manual_kb_edit: `⚠️ **WARNING: Direct .kb/ edits bypass validation**
|
|
142
144
|
|
|
143
145
|
The Kibi knowledge base is managed through public MCP tools. Direct manual edits to .kb/** can cause inconsistencies.
|
|
@@ -426,7 +428,7 @@ The Kibi workspace is in a maintenance-degraded state. Guidance remains advisory
|
|
|
426
428
|
REMINDER_RISK_CLASSES.includes(riskClass) &&
|
|
427
429
|
posture !== "root_uninitialized" &&
|
|
428
430
|
posture !== "root_partial") {
|
|
429
|
-
finalBlock = `${finalBlock}\n-
|
|
431
|
+
finalBlock = `${finalBlock}\n- Kibi impact evidence is required before completion/commit: run \`kb_check\` before completing this task.`;
|
|
430
432
|
}
|
|
431
433
|
// Return: sentinel + one targeted block (or just sentinel if no block)
|
|
432
434
|
return finalBlock
|
|
@@ -502,6 +504,7 @@ Dogfood note for this repo: OpenCode here uses local built \`kibi-mcp\` and \`ki
|
|
|
502
504
|
4. **Document intent**: If you are about to explain code, STOP. Route that explanation to kb_upsert instead of inline comments.
|
|
503
505
|
5. **Link during work**: When creating KB entities, include relationship rows: specified_by (req→scenario), implements (symbol→req for ownership), covered_by (symbol→test for coverage), executable_for (test code→test).
|
|
504
506
|
6. **Validate**: Run kb_check after KB mutations to catch violations early.
|
|
507
|
+
7. **Before completion/commit**: Kibi impact evidence is required before completion/commit. If extraction output changes, refresh documentation/symbols.yaml and do not revert that update as scope creep.
|
|
505
508
|
|
|
506
509
|
**Public Kibi tools only:** kb_autopilot_generate, kb_search, kb_query, kb_status, kb_find_gaps, kb_coverage, kb_graph, kb_upsert, kb_delete, kb_check.\n\nDo not invoke Kibi CLI commands directly from the agent.\n\n${buildInitKibiBootstrapReference(capability)}`;
|
|
507
510
|
}
|
package/dist/scheduler.js
CHANGED
|
@@ -235,6 +235,8 @@ function truncateSyncOutput(value) {
|
|
|
235
235
|
}
|
|
236
236
|
return value;
|
|
237
237
|
}
|
|
238
|
+
// Background sync runner: uses default sync (no --refresh-symbol-coordinates)
|
|
239
|
+
// to avoid writing committed coordinate artifacts during automatic background execution.
|
|
238
240
|
async function runKibiSync(worktree) {
|
|
239
241
|
return new Promise((resolve) => {
|
|
240
242
|
try {
|
package/dist/startup-notifier.js
CHANGED
|
@@ -2,10 +2,13 @@ import { sendToast, } from "./toast.js";
|
|
|
2
2
|
// implements REQ-opencode-kibi-plugin-v1
|
|
3
3
|
export function notifyStartup(client, cfg) {
|
|
4
4
|
const message = "kibi-opencode started";
|
|
5
|
+
const displayMessage = cfg.version
|
|
6
|
+
? `${message} (v${cfg.version})`
|
|
7
|
+
: message;
|
|
5
8
|
const toastPayload = {
|
|
6
9
|
variant: "success",
|
|
7
10
|
title: "Kibi OpenCode",
|
|
8
|
-
message,
|
|
11
|
+
message: displayMessage,
|
|
9
12
|
duration: 4000,
|
|
10
13
|
};
|
|
11
14
|
if (!cfg.suppressToast) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kibi-opencode",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"description": "Kibi OpenCode plugin - thin adapter to integrate Kibi with OpenCode sessions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@opencode-ai/plugin": "^1.4.7",
|
|
63
63
|
"@opentui/core": "^0.1.99",
|
|
64
64
|
"@opentui/solid": "^0.1.99",
|
|
65
|
-
"kibi-cli": "^0.
|
|
65
|
+
"kibi-cli": "^0.10.1"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@types/node": "latest",
|