@mgiles/perk 3.0.0 → 3.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/extension/adapters/planAdapterPlannotator.ts +12 -9
- package/extension/doors/address.ts +11 -0
- package/extension/doors/commitCompact.ts +98 -10
- package/extension/doors/draftReviewWaveTools.ts +43 -15
- package/extension/doors/dreamWaveTools.ts +489 -0
- package/extension/doors/land.ts +6 -0
- package/extension/doors/learn.ts +16 -3
- package/extension/doors/lifecycleGates.ts +36 -1
- package/extension/doors/objectiveReviewBrowser.ts +36 -13
- package/extension/doors/objectiveStack.ts +424 -24
- package/extension/doors/planReviewBrowser.ts +30 -8
- package/extension/doors/plannotatorHandoff.ts +80 -8
- package/extension/doors/prReview.ts +158 -50
- package/extension/doors/prReviewBrowser.ts +75 -27
- package/extension/doors/prReviewDynamic.ts +33 -13
- package/extension/doors/ready.ts +209 -17
- package/extension/doors/reviewWaveTools.ts +61 -17
- package/extension/doors/stackReviewBrowser.ts +573 -0
- package/extension/doors/submit.ts +36 -10
- package/extension/doors/submitPrReview.ts +116 -19
- package/extension/factories/objectiveDraft.ts +95 -27
- package/extension/factories/objectiveDreamReport.ts +347 -0
- package/extension/factories/objectivePlan.ts +12 -6
- package/extension/factories/objectiveSave.ts +77 -1
- package/extension/factories/planReview.ts +173 -10
- package/extension/index.ts +88 -16
- package/extension/substrate/agentScratch.ts +171 -0
- package/extension/substrate/bindingDelivery.ts +9 -11
- package/extension/substrate/cache.ts +92 -2
- package/extension/substrate/command.ts +9 -6
- package/extension/substrate/config.ts +10 -3
- package/extension/substrate/git.ts +85 -2
- package/extension/substrate/paths.ts +2 -7
- package/extension/substrate/resolverLease.ts +363 -0
- package/extension/substrate/result.ts +3 -2
- package/extension/substrate/sessionData.ts +6 -4
- package/extension/substrate/sessionPointers.ts +3 -4
- package/extension/substrate/toolGating.ts +25 -0
- package/extension/substrate/workflowState.ts +57 -5
- package/extension/surfaces/report.ts +38 -12
- package/extension/surfaces/surfaces.ts +129 -7
- package/extension/vendor/btw/btw.ts +38 -6
- package/extension/waves/adversarialReviewWave.ts +34 -3
- package/extension/waves/draftReviewWave.ts +17 -1
- package/extension/waves/dreamReducerWave.ts +700 -0
- package/extension/waves/dreamReport.ts +1494 -0
- package/extension/waves/dreamWave.ts +927 -0
- package/extension/waves/harvestWave.ts +1 -1
- package/extension/waves/ponytail.ts +104 -0
- package/extension/waves/prReviewDynamicWave.ts +115 -34
- package/extension/waves/prReviewWave.ts +122 -17
- package/extension/waves/reportWave.ts +103 -7
- package/extension/worker/readOnlySession.ts +2 -3
- package/package.json +6 -3
- package/prompts/_fixtures/live.yaml +112 -0
- package/prompts/commit-and-compact-continuation.md +13 -0
- package/prompts/contexts/adapters/plannotator-objective.md +7 -1
- package/prompts/contexts/adapters/plannotator-plan.md +7 -1
- package/prompts/contexts/adapters/tombell-plan.md +4 -0
- package/prompts/contexts/plan-authoring.md +6 -5
- package/prompts/stages/conflict-resolution-continuation.md +6 -0
- package/prompts/stages/conflict-resolution.md +2 -2
- package/prompts/stages/learn-dream.md +10 -0
- package/prompts/stages/objective-author/adopt.md +1 -1
- package/prompts/stages/objective-author/file.md +1 -1
- package/prompts/stages/objective-author/seed.md +1 -1
- package/prompts/stages/objective-reconcile-ready.md +7 -0
- package/prompts/stages/objective-review-browser.md +1 -1
- package/prompts/stages/objective-sync.md +1 -1
- package/prompts/stages/plan-review-browser.md +1 -1
- package/prompts/stages/pr-review-browser/active.md +1 -1
- package/prompts/stages/pr-review-browser/foreign.md +1 -1
- package/prompts/stages/pr-review-dynamic.md +5 -5
- package/prompts/stages/pr-review-terminal/active.md +1 -1
- package/prompts/stages/pr-review-terminal/foreign.md +1 -1
- package/prompts/stages/pr-review-terminal/local.md +1 -1
- package/prompts/stages/pr-review.md +5 -5
- package/prompts/stages/stack-review/cold.md +1 -0
- package/prompts/stages/stack-review-browser/stack.md +23 -0
- package/shared/README.md +0 -3
- package/shared/bindings.yaml +6 -0
- package/shared/contracts.md +3784 -1851
- package/shared/registry.yaml +28 -13
- package/shared/schemas/inputs/review-post-batch.schema.json +14 -1
- package/shared/schemas/outputs/objective-doctor.schema.json +39 -1
- package/shared/schemas/outputs/objective-stack-status.schema.json +172 -1
- package/shared/schemas/outputs/pr-land.schema.json +3 -3
- package/shared/schemas/outputs/pr-ready.schema.json +110 -2
- package/shared/contracts-history.md +0 -605
|
@@ -324,22 +324,29 @@ export async function routeObjectiveReviewDecision(
|
|
|
324
324
|
}
|
|
325
325
|
|
|
326
326
|
/**
|
|
327
|
-
* The
|
|
328
|
-
* BOTH companion surfaces the moment the port is picked (the URL is deterministic
|
|
329
|
-
* header note), observe readiness and the human decision in background tasks, and
|
|
330
|
-
*
|
|
331
|
-
*
|
|
332
|
-
*
|
|
333
|
-
*
|
|
334
|
-
*
|
|
327
|
+
* The guidance-returning open core: start the plan-review browser on the RENDERED objective
|
|
328
|
+
* draft, prime BOTH companion surfaces the moment the port is picked (the URL is deterministic
|
|
329
|
+
* — see the header note), observe readiness and the human decision in background tasks, and
|
|
330
|
+
* RETURN the composed guidance string (template + the `command:objective-review-browser`
|
|
331
|
+
* binding suffix) — the caller decides how to deliver it (the door wrapper injects it via
|
|
332
|
+
* `sendUserMessage`; `plan_review`'s wave arm returns it as a non-terminating tool result,
|
|
333
|
+
* contracts.md §8.23). Returns `null` on the synchronous port-pick failure arm — loudly
|
|
334
|
+
* reported here, then CALLER-handled: the door wrapper simply injects nothing (the report
|
|
335
|
+
* already spoke), while `plan_review`'s wave arm — the one fallback caller — falls open to the
|
|
336
|
+
* plain blocking review. While plannotator sets up, its in-process `console.error`
|
|
337
|
+
* chatter re-routes through the TUI-safe report() seam (the debounce restores once setup goes
|
|
338
|
+
* quiet, with the `finally` as a backstop). `deps` is the injectable browser-open seam (tests
|
|
339
|
+
* drive a fake port picker/probe/clock). `rendered` is the reviewed markdown; `artifactRaw` is
|
|
340
|
+
* the raw structured `objective-draft.json` bytes captured at open — the stale guard's
|
|
341
|
+
* baseline.
|
|
335
342
|
*/
|
|
336
|
-
export async function
|
|
343
|
+
export async function openObjectiveReviewSurface(
|
|
337
344
|
pi: ExtensionAPI,
|
|
338
345
|
ctx: ExtensionContext,
|
|
339
346
|
gating: ToolGating,
|
|
340
347
|
opts: { rendered: string; artifactRaw: string; custom?: string },
|
|
341
348
|
deps: StartBrowserDeps = {},
|
|
342
|
-
): Promise<
|
|
349
|
+
): Promise<string | null> {
|
|
343
350
|
let started: StartedSurface<ReviewOutcome>;
|
|
344
351
|
try {
|
|
345
352
|
// The plan-review bridge sends arbitrary string bytes as `planContent` — the rendered
|
|
@@ -358,7 +365,7 @@ export async function openObjectiveReviewAndGuide(
|
|
|
358
365
|
`could not pick a free local port for the plannotator plan-review server: ${detail}`,
|
|
359
366
|
{ alsoLog: true },
|
|
360
367
|
);
|
|
361
|
-
return;
|
|
368
|
+
return null;
|
|
362
369
|
}
|
|
363
370
|
|
|
364
371
|
// Prime BOTH companion surfaces the moment the port is picked: push_annotations serves this
|
|
@@ -421,13 +428,29 @@ export async function openObjectiveReviewAndGuide(
|
|
|
421
428
|
? `working objective draft → plannotator browser review + draft reviewers (custom lane: ${opts.custom}) → APPROVE auto-saves / DENY returns feedback`
|
|
422
429
|
: "working objective draft → plannotator browser review + draft reviewers → APPROVE auto-saves / DENY returns feedback",
|
|
423
430
|
);
|
|
424
|
-
|
|
431
|
+
return (
|
|
425
432
|
objectiveReviewBrowserGuidance({
|
|
426
433
|
...(opts.custom !== undefined ? { custom: opts.custom } : {}),
|
|
427
|
-
}) + bindingSuffix(ctx.cwd, `command:${SCOPE}`)
|
|
434
|
+
}) + bindingSuffix(ctx.cwd, `command:${SCOPE}`)
|
|
428
435
|
);
|
|
429
436
|
}
|
|
430
437
|
|
|
438
|
+
/**
|
|
439
|
+
* The door-facing open: the thin `sendUserMessage` wrapper over `openObjectiveReviewSurface` —
|
|
440
|
+
* the command handler's delivery is the guidance injection; a `null` core return (port-pick
|
|
441
|
+
* failure, already loudly reported) injects nothing.
|
|
442
|
+
*/
|
|
443
|
+
export async function openObjectiveReviewAndGuide(
|
|
444
|
+
pi: ExtensionAPI,
|
|
445
|
+
ctx: ExtensionContext,
|
|
446
|
+
gating: ToolGating,
|
|
447
|
+
opts: { rendered: string; artifactRaw: string; custom?: string },
|
|
448
|
+
deps: StartBrowserDeps = {},
|
|
449
|
+
): Promise<void> {
|
|
450
|
+
const guidance = await openObjectiveReviewSurface(pi, ctx, gating, opts, deps);
|
|
451
|
+
if (guidance !== null) pi.sendUserMessage(guidance);
|
|
452
|
+
}
|
|
453
|
+
|
|
431
454
|
// ------------------------------------------------------------------------ registration
|
|
432
455
|
|
|
433
456
|
/** Register the warm `/objective-review-browser` command (no tools — the companions are global). */
|