foundry-design-web-adapter 0.2.0-beta.10 → 0.2.0-beta.11

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 CHANGED
@@ -6,7 +6,7 @@ Foundry is a local-first precision design workbench for Codex, Cursor, and Claud
6
6
 
7
7
  Foundry is distributed through npm, so testers do not need GitHub access.
8
8
 
9
- > **Current public beta:** `0.2.0-beta.10`. Both npm `latest` and `beta` point to the same tested release. Use the unqualified command below for normal installation.
9
+ > **Current public beta:** `0.2.0-beta.11`. Both npm `latest` and `beta` point to the same tested release. Use the unqualified command below for normal installation.
10
10
 
11
11
  Full documentation is available at [withfoundry.ai](https://withfoundry.ai).
12
12
 
@@ -48,7 +48,7 @@ Then restart the coding agent, reopen the same project folder, and ask:
48
48
  Start Foundry for this project and keep listening for Apply with agent requests.
49
49
  ```
50
50
 
51
- You do not need to run a second terminal command when the agent starts Foundry for you. Apply requests remain queued safely when the agent is offline. Run `npx foundry-design doctor --repair` if the connection or generated integration needs repair.
51
+ You do not need to run a second terminal command when the agent starts Foundry for you. Apply requests remain queued safely when the agent is offline. After an active agent claims a batch, the MCP bridge keeps that handoff alive while the agent inspects source and begins the edit. If the agent process exits, Foundry releases the abandoned claim back to the queue instead of losing it. Run `npx foundry-design doctor --repair` if the connection or generated integration needs repair.
52
52
 
53
53
  Update an existing installation with:
54
54
 
@@ -72,7 +72,7 @@ If an npm mirror or existing `npx` cache reports an old tag, bypass it with a te
72
72
 
73
73
  ```bash
74
74
  FOUNDRY_NPX_CACHE="$(mktemp -d)"
75
- npx --yes --prefer-online --registry=https://registry.npmjs.org --cache "$FOUNDRY_NPX_CACHE" --package=foundry-design@0.2.0-beta.10 foundry-design
75
+ npx --yes --prefer-online --registry=https://registry.npmjs.org --cache "$FOUNDRY_NPX_CACHE" --package=foundry-design@0.2.0-beta.11 foundry-design
76
76
  ```
77
77
 
78
78
  The beta supports Node.js 20 or newer. Read the [local-first safety model](https://withfoundry.ai/#safety) before using it with sensitive work.
@@ -104,7 +104,7 @@ Foundry remains local-first. Installing the plugin does not create an account, e
104
104
  - Persistent, coalescing change ledger with JSON and consolidated prompt export
105
105
  - Center-workspace review with editable approved batches, grouped targets, and unresolved-target blocking
106
106
  - Persistent Apply with agent runs across Codex, Cursor, and Claude Code through MCP
107
- - Leased agent handoffs that safely return abandoned or interrupted claims to the queue
107
+ - Automatically renewed agent handoffs that remain claimed during source inspection and safely return abandoned work to the queue
108
108
  - Live source, rebuild, validation, retry, and rendered-verification progress
109
109
  - Rendered verification that resumes after refresh and does not depend on Review remaining open
110
110
  - Local MCP bridge for agent access
package/dist/adapter.js CHANGED
@@ -3327,6 +3327,8 @@ function installFoundryInspector(options = {}) {
3327
3327
  const reviewCount = shadow.querySelector(".review-count");
3328
3328
  const applyButton = shadow.querySelector(".review-actions .apply");
3329
3329
  const reviewCancel = shadow.querySelector(".review-cancel");
3330
+ let cancelConfirmationRunId;
3331
+ let cancelConfirmationUntil = 0;
3330
3332
  function applyInterfaceTheme(preference, persist = true) {
3331
3333
  interfaceThemePreference = preference;
3332
3334
  const resolved = resolvedInterfaceTheme();
@@ -5387,7 +5389,7 @@ function installFoundryInspector(options = {}) {
5387
5389
  const attention = ["needs_attention", "failed"].includes(run.state);
5388
5390
  const passed = run.state === "passed";
5389
5391
  const active = ["queued", "claimed", "applying", "rebuilding", "verifying"].includes(run.state);
5390
- const latestMessage = run.state === "queued" ? run.requeueCount > 0 ? "The previous agent did not begin source work, so Foundry safely returned this batch to the queue." : "The reviewed changes are queued and ready for an active coding agent." : run.state === "claimed" ? activeAgentPresence.connected ? "The agent received this batch. Waiting for source work to begin." : "The agent disconnected before source work began. Foundry will return this batch to the queue shortly." : run.messages.at(-1)?.message ?? run.error ?? "Apply run created.";
5392
+ const latestMessage = run.state === "queued" ? run.requeueCount > 0 ? "The previous agent did not begin source work, so Foundry safely returned this batch to the queue." : "The reviewed changes are queued and ready for an active coding agent." : run.state === "claimed" ? activeAgentPresence.connected ? "The agent received this batch. Foundry is keeping the handoff active while source work begins." : "The agent disconnected before source work began. Foundry will return this batch to the queue shortly." : run.messages.at(-1)?.message ?? run.error ?? "Apply run created.";
5391
5393
  latestApplyState = run.state;
5392
5394
  if (run.state === "passed") completeOnboardingStep("apply");
5393
5395
  captureVerifiedRun(run);
@@ -5410,8 +5412,9 @@ function installFoundryInspector(options = {}) {
5410
5412
  applyButton.textContent = passed ? "Verified" : active ? runStateLabels[run.state] ?? run.state : "Run complete";
5411
5413
  applyButton.disabled = true;
5412
5414
  }
5415
+ const confirmingCancel = active && cancelConfirmationRunId === run.id && Date.now() < cancelConfirmationUntil;
5413
5416
  reviewCancel.dataset.action = active ? "cancel" : "back";
5414
- reviewCancel.textContent = active ? "Cancel" : "Back";
5417
+ reviewCancel.textContent = active ? confirmingCancel ? "Confirm stop" : "Stop apply" : "Back";
5415
5418
  maybeVerifyRun(run);
5416
5419
  }
5417
5420
  function renderReviewPayload(payload) {
@@ -5570,6 +5573,22 @@ function installFoundryInspector(options = {}) {
5570
5573
  async function cancelRun() {
5571
5574
  const run = activeReviewPayload?.applyRuns?.at(-1);
5572
5575
  if (!run) return;
5576
+ const now = Date.now();
5577
+ if (cancelConfirmationRunId !== run.id || now >= cancelConfirmationUntil) {
5578
+ cancelConfirmationRunId = run.id;
5579
+ cancelConfirmationUntil = now + 5e3;
5580
+ reviewCancel.textContent = "Confirm stop";
5581
+ showToast("Press Confirm stop within 5 seconds to cancel this source run.");
5582
+ window.setTimeout(() => {
5583
+ if (cancelConfirmationRunId !== run.id || Date.now() < cancelConfirmationUntil) return;
5584
+ cancelConfirmationRunId = void 0;
5585
+ cancelConfirmationUntil = 0;
5586
+ if (activeReviewPayload) renderReviewPayload(activeReviewPayload);
5587
+ }, 5100);
5588
+ return;
5589
+ }
5590
+ cancelConfirmationRunId = void 0;
5591
+ cancelConfirmationUntil = 0;
5573
5592
  try {
5574
5593
  renderReviewPayload(
5575
5594
  await sessionRequest(`/apply-runs/${encodeURIComponent(run.id)}/cancel`, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgHA,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,0BAA0B;IACzC,OAAO,IAAI,IAAI,CAAC;IAChB,cAAc,IAAI,IAAI,CAAC;IACvB,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IACnC,OAAO,IAAI,IAAI,CAAC;CACjB;AA4lCD,wBAAgB,uBAAuB,CACrC,OAAO,GAAE,uBAA4B,GACpC,0BAA0B,CAuiP5B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgHA,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,0BAA0B;IACzC,OAAO,IAAI,IAAI,CAAC;IAChB,cAAc,IAAI,IAAI,CAAC;IACvB,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IACnC,OAAO,IAAI,IAAI,CAAC;CACjB;AA4lCD,wBAAgB,uBAAuB,CACrC,OAAO,GAAE,uBAA4B,GACpC,0BAA0B,CA2jP5B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foundry-design-web-adapter",
3
- "version": "0.2.0-beta.10",
3
+ "version": "0.2.0-beta.11",
4
4
  "description": "Development-only browser inspector for Foundry",
5
5
  "type": "module",
6
6
  "main": "dist/adapter.js",