@brainervirus/workit-core 1.1.1 → 1.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainervirus/workit-core",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "private": false,
5
5
  "description": "Workit shared core — task, policy, evidence, review, decision, worker, and writer state for agentic coding workflows",
6
6
  "keywords": [
@@ -225,6 +225,23 @@ export const externalActionDescriptor = (operation: string, payload: unknown): s
225
225
  : {}),
226
226
  });
227
227
 
228
+ /**
229
+ * Plan reservations never execute a git commit. A git.commit whose resolved
230
+ * payload carries a plan_steps array records the listed chain once and lets
231
+ * each listed single commit execute later under that authorization. Adapters
232
+ * must return plan success without running the commit effect, both for prior
233
+ * approvals and standing auto-approval; otherwise the reservation fails as a
234
+ * single commit requiring a message. Returns the listed count, else null.
235
+ */
236
+ export const planReservationLength = (
237
+ operation: string,
238
+ descriptorPayload: unknown,
239
+ ): number | null => {
240
+ if (operation !== "git.commit") return null;
241
+ const payload = (descriptorPayload ?? {}) as { plan_steps?: unknown };
242
+ return Array.isArray(payload.plan_steps) ? payload.plan_steps.length : null;
243
+ };
244
+
228
245
  /** Compact host-facing help for the fixed optional-action surface. */
229
246
  export const externalActionHelp =
230
247
  "Fixed actions: git.branch_setup {action?,sdd_dir?,target_branch(required unless reapply_stash; the working branch to create or switch to),stash?}; git.commit {message}; git.push {branch?}; hosting.pull_request {title,body?,draft?,target_branch?,babysit?}; hosting.merge {target_branch?,source_branch?}; youtrack.update {issueId,markdown,minutes?}; youtrack.time {issueId,minutes,text?,dateMs?}; youtrack.meeting {issueId,minutes,text}; changelog.apply {entries?,path?,normalize_only?}; context.read {kind,range?,issueId?,issueUrl?,issueRef?,mode?,specPath?,planPath?}. context.read is read-only and needs no approval; all other operations require native approval (CLI uses a TTY; caller-unattested MCP cannot mutate).";
@@ -7,7 +7,10 @@
7
7
  export const SUPPORT_MATRIX = {
8
8
  bun: "1.4.1",
9
9
  node: { minimum: "24", current: "24.20.0" },
10
- opencode: { minimum: "1.15.0", current: "1.18.30" },
10
+ // The object-form dual entry (server() + setup()) only loads from
11
+ // 1.18.29+; the supported floor is 1.18.30 so no host can pass doctor while
12
+ // being unable to load the entry shape.
13
+ opencode: { minimum: "1.18.30", current: "1.18.30" },
11
14
  // Codex is a qualification host, not a runtime dependency: the CLI version
12
15
  // below is the one live qualification evidence covers. The doctor warns when
13
16
  // an installed CLI drifts ahead so a fresh install never silently outruns
package/src/core.ts CHANGED
@@ -125,6 +125,7 @@ export {
125
125
  externalActionRef,
126
126
  externalActionDescriptor,
127
127
  externalActionHelp,
128
+ planReservationLength,
128
129
  externalActionRequest,
129
130
  matchesNativeExternalAction,
130
131
  nativeExternalActionObservation,