opencode-dev-framework 1.9.5 → 1.10.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/README.md +137 -33
- package/bin/df +94 -4
- package/cordis.patch.yml +17 -0
- package/dist/adapters/dsh/extract.d.ts +47 -0
- package/dist/adapters/dsh/extract.js +62 -0
- package/dist/adapters/dsh/index.d.ts +332 -0
- package/dist/adapters/dsh/index.js +1643 -0
- package/dist/adapters/opencode/index.d.ts +30 -0
- package/dist/{index.js → adapters/opencode/index.js} +120 -235
- package/dist/{block-store.d.ts → core/block-store.d.ts} +10 -3
- package/dist/{commands.js → core/commands.js} +4 -2
- package/dist/{config.d.ts → core/config.d.ts} +16 -4
- package/dist/{config.js → core/config.js} +102 -10
- package/dist/{format-status.d.ts → core/format-status.d.ts} +13 -2
- package/dist/{format-status.js → core/format-status.js} +30 -7
- package/dist/{gate.d.ts → core/gate.d.ts} +9 -1
- package/dist/{gate.js → core/gate.js} +14 -2
- package/dist/{goal.d.ts → core/goal.d.ts} +4 -3
- package/dist/{goal.js → core/goal.js} +4 -3
- package/dist/{harness.d.ts → core/harness.d.ts} +10 -5
- package/dist/{harness.js → core/harness.js} +119 -32
- package/dist/{init.d.ts → core/init.d.ts} +18 -1
- package/dist/{init.js → core/init.js} +33 -8
- package/dist/core/install-dsh.d.ts +67 -0
- package/dist/core/install-dsh.js +235 -0
- package/dist/{installer.d.ts → core/installer.d.ts} +32 -2
- package/dist/{installer.js → core/installer.js} +129 -12
- package/dist/{lint.d.ts → core/lint.d.ts} +43 -2
- package/dist/{lint.js → core/lint.js} +89 -2
- package/dist/core/paths.d.ts +35 -0
- package/dist/core/paths.js +41 -0
- package/dist/{protect.d.ts → core/protect.d.ts} +18 -4
- package/dist/{protect.js → core/protect.js} +85 -34
- package/dist/{registry.d.ts → core/registry.d.ts} +9 -1
- package/dist/{review.js → core/review.js} +14 -6
- package/dist/{rules.d.ts → core/rules.d.ts} +3 -2
- package/dist/{rules.js → core/rules.js} +21 -5
- package/dist/core/run-hooks.d.ts +138 -0
- package/dist/core/run-hooks.js +196 -0
- package/dist/{runtime-status.d.ts → core/runtime-status.d.ts} +5 -4
- package/dist/{runtime-status.js → core/runtime-status.js} +29 -17
- package/dist/{types.d.ts → core/types.d.ts} +17 -0
- package/dist/{update.d.ts → core/update.d.ts} +12 -4
- package/dist/{update.js → core/update.js} +28 -12
- package/dist/{weakening.js → core/weakening.js} +2 -1
- package/package.json +16 -6
- package/rules/40-delegation.md +13 -2
- package/templates/.opencode/agents/style-enforcer.md +1 -1
- package/templates/.opencode/agents/test-grounder.md +1 -1
- package/templates/.opencode/skills/ground-in-tests/SKILL.md +1 -1
- package/templates/.opencode/skills/project-config/SKILL.md +2 -2
- package/tui.tsx +6 -6
- package/dist/index.d.ts +0 -101
- /package/dist/{block-store.js → core/block-store.js} +0 -0
- /package/dist/{command-utils.d.ts → core/command-utils.d.ts} +0 -0
- /package/dist/{command-utils.js → core/command-utils.js} +0 -0
- /package/dist/{commands.d.ts → core/commands.d.ts} +0 -0
- /package/dist/{detect.d.ts → core/detect.d.ts} +0 -0
- /package/dist/{detect.js → core/detect.js} +0 -0
- /package/dist/{host.d.ts → core/host.d.ts} +0 -0
- /package/dist/{host.js → core/host.js} +0 -0
- /package/dist/{logger.d.ts → core/logger.d.ts} +0 -0
- /package/dist/{logger.js → core/logger.js} +0 -0
- /package/dist/{registry.js → core/registry.js} +0 -0
- /package/dist/{review.d.ts → core/review.d.ts} +0 -0
- /package/dist/{roster.d.ts → core/roster.d.ts} +0 -0
- /package/dist/{roster.js → core/roster.js} +0 -0
- /package/dist/{types.js → core/types.js} +0 -0
- /package/dist/{weakening.d.ts → core/weakening.d.ts} +0 -0
- /package/templates/{.opencode/opencode-dev-framework → .dev-framework}/rules/.gitkeep +0 -0
package/dist/index.d.ts
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* opencode-dev-framework V2 plugin entry point.
|
|
3
|
-
*
|
|
4
|
-
* V2 framework (opencode v2): Plugin.define({ id, setup(ctx) })
|
|
5
|
-
* - ctx.session.hook("context"/"generate"/"compaction"/"title", ...) -> constitution injection
|
|
6
|
-
* - ctx.permission.hook("evaluate", ...) -> native permission layer (Phase 25;
|
|
7
|
-
* observe-only spike in 25.1, enforcing mapper from 25.2)
|
|
8
|
-
* - ctx.tool.hook("execute.before", ...) -> guardrails (backstop from Phase 25)
|
|
9
|
-
* - ctx.tool.hook("execute.after", ...) -> per-edit lint + change tracking
|
|
10
|
-
* (`filesystem.changed` stays as a fallback this release; see Phase 24)
|
|
11
|
-
* - ctx.event.subscribe() -> file tracking + gate enforcement via re-prompt
|
|
12
|
-
* - ctx.tool.transform(...) -> custom tools
|
|
13
|
-
* - ctx.command.transform(...) -> server-side `/df-goal` verified-goal
|
|
14
|
-
* wrapper (thin adapter delegating to native `/goal`; see src/goal.ts)
|
|
15
|
-
* - ctx.command.transform(...) -> server-side `/df-init` project setup
|
|
16
|
-
* (deterministic scaffold in code, handoff back via session.prompt;
|
|
17
|
-
* see src/init.ts)
|
|
18
|
-
* - ctx.command.transform(...) -> server-side `/df-update` template drift
|
|
19
|
-
* check (detection only, handoff back via session.prompt; see src/update.ts)
|
|
20
|
-
*
|
|
21
|
-
* Gate enforcement: no synchronous pre-stop veto. On `experimental.idle`
|
|
22
|
-
* (same execution) we run the gate and if it fails inside budget we admit
|
|
23
|
-
* `ctx.session.synthetic({ sessionID, text: stoppingMessage })` — the
|
|
24
|
-
* continuation runs before the session goes idle (see
|
|
25
|
-
* docs/plans/12-idle-hook-cutover.md). The `event.subscribe` idle net
|
|
26
|
-
* stays as a deduped fallback for the boundaries the hook skips.
|
|
27
|
-
*/
|
|
28
|
-
import { Plugin } from "@opencode/plugin";
|
|
29
|
-
import { type BlockStore, type StuckSnapshotStore } from "./block-store.js";
|
|
30
|
-
import { type ChangedFileTracker } from "./gate.js";
|
|
31
|
-
import { type PassCache } from "./harness.js";
|
|
32
|
-
import { type RunCommand } from "./host.js";
|
|
33
|
-
import { type LintLimiter } from "./lint.js";
|
|
34
|
-
import { type LogFn } from "./logger.js";
|
|
35
|
-
import type { ResolvedConfig } from "./types.js";
|
|
36
|
-
import { type EnforceableSnapshot } from "./weakening.js";
|
|
37
|
-
export interface HookState {
|
|
38
|
-
directory: string;
|
|
39
|
-
config: ResolvedConfig;
|
|
40
|
-
/**
|
|
41
|
-
* Session-start enforceable snapshot (plan 17 §2). Compared against the
|
|
42
|
-
* live config at every gate evaluation so mid-session duty reductions
|
|
43
|
-
* surface in the verdict. Never re-baselined — including across
|
|
44
|
-
* `set_profile` — so a profile downgrade reads as the weakening it is.
|
|
45
|
-
*/
|
|
46
|
-
initialEnforceable: EnforceableSnapshot;
|
|
47
|
-
log: LogFn;
|
|
48
|
-
run: RunCommand;
|
|
49
|
-
tracker: ChangedFileTracker;
|
|
50
|
-
constitution: string | null;
|
|
51
|
-
blockCounts: Map<string, number>;
|
|
52
|
-
/**
|
|
53
|
-
* Persistent block-count store over `ctx.storage`, write-through into
|
|
54
|
-
* `blockCounts` (which stays the live L1 cache for status rendering).
|
|
55
|
-
* Survives plugin reload / session_move / server restart.
|
|
56
|
-
* Note: this `HookState` is intentionally forked from `registry.ts`
|
|
57
|
-
* `HookState` (module state is per-location here, not registry-keyed);
|
|
58
|
-
* `format-status.ts` reads the `blockCounts` Map projection, which the
|
|
59
|
-
* store keeps live on every get/increment/clear.
|
|
60
|
-
*/
|
|
61
|
-
blocks: BlockStore;
|
|
62
|
-
/**
|
|
63
|
-
* Last-blocked-evaluation snapshots for no-progress early stand-down
|
|
64
|
-
* (docs/plans/14-stuck-detection.md). Same storage-backed, best-effort pattern as `blocks`;
|
|
65
|
-
* memory-only here (no status projection needed).
|
|
66
|
-
*/
|
|
67
|
-
stuckSnapshots: StuckSnapshotStore;
|
|
68
|
-
precommitAvailable?: boolean;
|
|
69
|
-
configMtime?: number;
|
|
70
|
-
/**
|
|
71
|
-
* Shared FIFO limiter bounding concurrent linter subprocesses across
|
|
72
|
-
* per-edit lints and gate lint steps.
|
|
73
|
-
*/
|
|
74
|
-
lintLimiter: LintLimiter;
|
|
75
|
-
/** Fingerprint of the last clean gate pass; skips redundant suites. */
|
|
76
|
-
passCache: PassCache;
|
|
77
|
-
/**
|
|
78
|
-
* `Date.now()` of the last config-mtime check. Hook fires are far more
|
|
79
|
-
* frequent than config edits, so mtime stats are throttled to a 1s window.
|
|
80
|
-
*/
|
|
81
|
-
lastConfigCheck: number;
|
|
82
|
-
/**
|
|
83
|
-
* Which lever completed a gate evaluation most recently in this process:
|
|
84
|
-
* `"idle"` once the `experimental.idle` hook has (same-execution
|
|
85
|
-
* continuation active), `"fallback"` when only the `event.subscribe`
|
|
86
|
-
* idle re-prompt net has. Absent until either fires. Memory-only: a
|
|
87
|
-
* reload re-derives it on the next idle boundary. `/df-status` renders
|
|
88
|
-
* the active level.
|
|
89
|
-
*/
|
|
90
|
-
continuationLevel?: "idle" | "fallback";
|
|
91
|
-
/**
|
|
92
|
-
* Dedup map for the idle-first cutover: sessionID → `Date.now()` at the
|
|
93
|
-
* last COMPLETED hook evaluation (pass, blocked-admitted, and standdown
|
|
94
|
-
* all stamp; throw/early-return do not). The `event.subscribe` idle net
|
|
95
|
-
* skips when the stamp is fresh so one boundary never runs the gate
|
|
96
|
-
* twice. Memory-only; worst case on reload is one extra suite run.
|
|
97
|
-
*/
|
|
98
|
-
lastIdleHandled: Map<string, number>;
|
|
99
|
-
}
|
|
100
|
-
declare const plugin: Plugin.Plugin;
|
|
101
|
-
export default plugin;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|