@absolutejs/mcp 0.18.0 → 0.20.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.
@@ -0,0 +1,33 @@
1
+ import type { McpToolRegistry } from "./types";
2
+ export type ActionReview = {
3
+ actionId: string;
4
+ revision: string;
5
+ title: string;
6
+ expiresAt: string;
7
+ recipients: string[];
8
+ subject: string;
9
+ body: string;
10
+ consequence: string;
11
+ };
12
+ export type ActionConfirmation = {
13
+ actionId: string;
14
+ expectedRevision: string;
15
+ };
16
+ export type ActionJob = {
17
+ actionId: string;
18
+ status: "awaiting_approval" | "queued" | "running" | "succeeded" | "failed" | "unknown" | "denied" | "expired";
19
+ title: string;
20
+ summary: string;
21
+ };
22
+ export declare const projectActionReview: (value: unknown) => ActionReview;
23
+ export declare const projectActionJob: (value: unknown) => ActionJob;
24
+ /** Bind readers and confirmation to the authenticated owner. confirm must compare
25
+ * the exact reviewed revision and expiry under a database lock, authorize the
26
+ * immutable payload, and commit its decision plus durable outbox atomically.
27
+ * Every draft writer must refuse edits after that claim. Never send inline.
28
+ * Job reads/resume only reattach to saved work, including ambiguous outcomes. */
29
+ export declare const createActionWorkflowTools: (adapter: {
30
+ review: (actionId: string) => Promise<ActionReview>;
31
+ job: (actionId: string) => Promise<ActionJob>;
32
+ confirm?: (request: ActionConfirmation) => Promise<ActionJob>;
33
+ }) => McpToolRegistry;
@@ -0,0 +1 @@
1
+ export declare const actionWorkflowScript: string;
@@ -35,3 +35,5 @@ export declare const appResourceContent: (resource: McpAppResource, uri: string)
35
35
  export { createBillingApps } from "./billingApps";
36
36
  export { createWorkflowApps } from "./workflowApps";
37
37
  export { createWorkflowTools, projectSetupStatus, projectWorkPreview, type McpSetupStatus, type McpWorkPreview, type McpWorkPreviewRequest, } from "./workflowTools";
38
+ export { createSetupSelectionTools, projectSetupSelection, type SetupSelection, type SetupConfirmation, type SetupOption, } from "./setupSelection";
39
+ export { createActionWorkflowTools, projectActionReview, projectActionJob, type ActionReview, type ActionConfirmation, type ActionJob } from "./actionWorkflow";
@@ -51,3 +51,5 @@ export { MCP_APP_MIME, clientSupportsMcpApps, withMcpApp, type McpAppResource, t
51
51
  export { createBillingApps } from "./billingApps";
52
52
  export { createWorkflowApps } from "./workflowApps";
53
53
  export { createWorkflowTools, projectSetupStatus, projectWorkPreview, type McpSetupStatus, type McpWorkPreview, type McpWorkPreviewRequest, } from "./workflowTools";
54
+ export { createSetupSelectionTools, projectSetupSelection, type SetupSelection, type SetupConfirmation, type SetupOption, } from "./setupSelection";
55
+ export { createActionWorkflowTools, projectActionReview, projectActionJob, type ActionReview, type ActionConfirmation, type ActionJob } from "./actionWorkflow";
@@ -0,0 +1,23 @@
1
+ import type { McpToolRegistry } from "./types";
2
+ export type SetupOption = {
3
+ id: string;
4
+ label: string;
5
+ };
6
+ export type SetupSelection = {
7
+ revision: string;
8
+ selectedId: string | null;
9
+ options: SetupOption[];
10
+ };
11
+ export type SetupConfirmation = {
12
+ expectedRevision: string;
13
+ selectedId: string | null;
14
+ };
15
+ export declare const projectSetupSelection: (value: unknown) => SetupSelection;
16
+ /** Bind to the authenticated owner. confirm MUST atomically compare the revision,
17
+ * validate option ownership, change selection and advance the revision. All
18
+ * writers must advance it, including A→B→A. Retries with an old revision fail
19
+ * without effects. Recover by reading; never auto-retry against a new revision. */
20
+ export declare const createSetupSelectionTools: (adapter: {
21
+ read: () => Promise<SetupSelection>;
22
+ confirm: (request: SetupConfirmation) => Promise<SetupSelection>;
23
+ }) => McpToolRegistry;
@@ -0,0 +1 @@
1
+ export declare const setupSelectionScript: string;
@@ -172,3 +172,28 @@ aggregate evidence. The separate rich-view startup issue is unchanged.
172
172
  The [individual Copilot external-checkout review](reviews/vscode-individual-external-checkout.md)
173
173
  records the exact eligible deployment scope and activation conditions; the
174
174
  synthetic fixture is not a real merchant/OAuth acceptance test.
175
+
176
+ ### September 12 Claude workflow and selection observation
177
+
178
+ Native Windows Chrome/Claude rendered MCP 0.18.0 setup and preview views from a
179
+ verified onSpark staging connector. One explicit refresh per view produced one
180
+ additional read each; conversation reload remounted both without extra calls.
181
+ MCP 0.19.0's business selector subsequently rendered after one successful
182
+ `get_setup_options` call. Reload left its audit at one read and no mutations.
183
+ These were desktop/light-theme checks on an existing account. Local visible
184
+ bridge fixtures separately covered 390px/light/dark layout and synthetic
185
+ Review/Cancel (zero calls), Confirm (one call/one fixture write), and no replay.
186
+ Native confirmation against a real business was not tested.
187
+
188
+ After a server release, Claude retained its previous tool list. The connector's
189
+ **More options → Refresh tools list** exposed the new tools without reconnecting.
190
+ Chat discovery still chose the separate production connector until production
191
+ was temporarily disabled in that test chat's **Connectors** submenu. Then the
192
+ explicit staging-only read resolved and rendered. Restore prior toggles after a
193
+ test. The stopped discovery attempts made no server calls. This is qualified
194
+ operational evidence, not a proven general indexing defect: verify the native
195
+ tool list and enabled connector scope before concluding that a deployed tool is
196
+ missing, and do not stack authorization requests to troubleshoot discovery.
197
+
198
+ Rendering evidence does not expand host commerce eligibility or authorize paid
199
+ work, checkout, outbound actions, or real account mutations.
package/docs/mcp-apps.md CHANGED
@@ -82,3 +82,48 @@ operation and budget. Errors clear stale eligibility and point back to the assis
82
82
  Known affected VS Code builds retain the shared text fallback. The visible-browser
83
83
  fixture is `bun test/fixtures/workflowServer.ts` (loopback port 4418); it uses zero
84
84
  credits and no gateway or database.
85
+
86
+ ### Reviewed setup selection
87
+
88
+ `createSetupSelectionTools({ read, confirm })` exposes `get_setup_options` and
89
+ `confirm_setup_selection`; `createWorkflowApps()` supplies the selection view.
90
+ The adapter returns `{ revision, selectedId, options: [{ id, label }] }`, with
91
+ `null` selecting all businesses. It must bind the authenticated account itself.
92
+ `confirm({ expectedRevision, selectedId })` must atomically compare the reviewed
93
+ revision, validate ownership, change selection, and advance the revision. Every
94
+ other selection writer must advance it too, including A → B → A. The package
95
+ validates and projects values but cannot provide database atomicity for adapters.
96
+
97
+ The view makes no call on mount. Review and Cancel are local; Confirm sends the
98
+ exact reviewed revision and selection once. Errors discard review state and
99
+ require a fresh read. Text-only hosts receive the same options/revision and must
100
+ obtain explicit approval before invoking the write tool. This is a reversible
101
+ setup action with no billing or outbound effects; it does not authorize paid
102
+ work. At most 200 options are supported; IDs/revisions are bounded at 128
103
+ characters and labels at 512. No account selector or credentials enter the view.
104
+
105
+ ### Durable action status and reviewed outbound approval
106
+
107
+ `createActionWorkflowTools({ review, job, confirm? })` provides
108
+ `get_action_review`, `get_action_job`, `resume_action_job`, and (only with a
109
+ confirmation adapter) `confirm_action_review`. `createWorkflowApps()` supplies
110
+ the shared action view. The review contains the full recipients, subject, body,
111
+ consequences, exact revision, and expiry. The view separates local review/cancel
112
+ from explicit **Approve and queue**, marks that tool as an external destructive
113
+ write, and never calls tools on mount. Host theme changes are applied explicitly.
114
+
115
+ Bind identity in the adapter. Under a database lock, compare the reviewed
116
+ revision and expiry, authorize the immutable payload, and commit the decision
117
+ and durable outbox together. All draft writers must refuse edits after claim.
118
+ Use a stable effect identity and retain ambiguous outcomes for reconciliation;
119
+ never make provider calls inside this confirmation tool. Returned job identity
120
+ must match the requested action. Error responses require a saved-status read,
121
+ not an automatic approval retry or a newly invented action ID.
122
+
123
+ `resume_action_job` resumes **tracking**, by reading the existing durable job.
124
+ It does not restart work, grant a new lease, retry, resend, or reconcile an
125
+ unknown outcome. The worker owns safe retries. Project only user-facing status
126
+ and summaries; do not expose raw provider errors, credentials or queue internals.
127
+ The text-only path carries the same review and status; host support does not
128
+ expand authorization or commerce eligibility. Review bodies are bounded at
129
+ 100,000 characters, subjects at 2,000, and recipient lists at 100.
package/package.json CHANGED
@@ -90,5 +90,5 @@
90
90
  "canary:checkout": "bun canary/checkout.ts"
91
91
  },
92
92
  "types": "./dist/src/index.d.ts",
93
- "version": "0.18.0"
93
+ "version": "0.20.0"
94
94
  }