@aotter/mantle-ui 0.2.0-alpha.1
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/LICENSE +202 -0
- package/README.md +163 -0
- package/dist/admin/assets/developer-workspace-D6ZBl-hH.js +27 -0
- package/dist/admin/assets/developer-workspace-DLioOiRN.css +1 -0
- package/dist/admin/assets/html-editor-aFwAzRmq.js +129 -0
- package/dist/admin/assets/index-C0Ini5Qc.css +2 -0
- package/dist/admin/assets/index-DQemY7Xp.js +71 -0
- package/dist/admin/assets/markdown-editor-rSCtXCtH.js +29 -0
- package/dist/admin/assets/with-selector-BnwVHY9y.js +1 -0
- package/dist/admin/favicon.png +0 -0
- package/dist/admin/favicon.svg +20 -0
- package/dist/admin/index.html +18 -0
- package/dist/admin/preview.html +18 -0
- package/dist/admin/theme.js +64 -0
- package/dist/app/bridge.d.ts +75 -0
- package/dist/app/bridge.d.ts.map +1 -0
- package/dist/app/bridge.js +96 -0
- package/dist/app/bridge.js.map +1 -0
- package/dist/controller/index.d.ts +142 -0
- package/dist/controller/index.d.ts.map +1 -0
- package/dist/controller/index.js +279 -0
- package/dist/controller/index.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/kit/components/auth-card.d.ts +15 -0
- package/dist/kit/components/auth-card.d.ts.map +1 -0
- package/dist/kit/components/auth-card.js +12 -0
- package/dist/kit/components/auth-card.js.map +1 -0
- package/dist/kit/components/one-time-code-input.d.ts +4 -0
- package/dist/kit/components/one-time-code-input.d.ts.map +1 -0
- package/dist/kit/components/one-time-code-input.js +7 -0
- package/dist/kit/components/one-time-code-input.js.map +1 -0
- package/dist/kit/components/sign-in-flow.d.ts +94 -0
- package/dist/kit/components/sign-in-flow.d.ts.map +1 -0
- package/dist/kit/components/sign-in-flow.js +108 -0
- package/dist/kit/components/sign-in-flow.js.map +1 -0
- package/dist/kit/components/ui/alert-dialog.d.ts +19 -0
- package/dist/kit/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/kit/components/ui/alert-dialog.js +43 -0
- package/dist/kit/components/ui/alert-dialog.js.map +1 -0
- package/dist/kit/components/ui/avatar.d.ts +12 -0
- package/dist/kit/components/ui/avatar.d.ts.map +1 -0
- package/dist/kit/components/ui/avatar.js +24 -0
- package/dist/kit/components/ui/avatar.js.map +1 -0
- package/dist/kit/components/ui/badge.d.ts +10 -0
- package/dist/kit/components/ui/badge.d.ts.map +1 -0
- package/dist/kit/components/ui/badge.js +25 -0
- package/dist/kit/components/ui/badge.js.map +1 -0
- package/dist/kit/components/ui/breadcrumb.d.ts +13 -0
- package/dist/kit/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/kit/components/ui/breadcrumb.js +25 -0
- package/dist/kit/components/ui/breadcrumb.js.map +1 -0
- package/dist/kit/components/ui/button.d.ts +11 -0
- package/dist/kit/components/ui/button.d.ts.map +1 -0
- package/dist/kit/components/ui/button.js +36 -0
- package/dist/kit/components/ui/button.js.map +1 -0
- package/dist/kit/components/ui/calendar.d.ts +11 -0
- package/dist/kit/components/ui/calendar.d.ts.map +1 -0
- package/dist/kit/components/ui/calendar.js +77 -0
- package/dist/kit/components/ui/calendar.js.map +1 -0
- package/dist/kit/components/ui/card.d.ts +12 -0
- package/dist/kit/components/ui/card.d.ts.map +1 -0
- package/dist/kit/components/ui/card.js +25 -0
- package/dist/kit/components/ui/card.js.map +1 -0
- package/dist/kit/components/ui/checkbox.d.ts +5 -0
- package/dist/kit/components/ui/checkbox.d.ts.map +1 -0
- package/dist/kit/components/ui/checkbox.js +9 -0
- package/dist/kit/components/ui/checkbox.js.map +1 -0
- package/dist/kit/components/ui/collapsible.d.ts +6 -0
- package/dist/kit/components/ui/collapsible.d.ts.map +1 -0
- package/dist/kit/components/ui/collapsible.js +14 -0
- package/dist/kit/components/ui/collapsible.js.map +1 -0
- package/dist/kit/components/ui/dialog.d.ts +17 -0
- package/dist/kit/components/ui/dialog.d.ts.map +1 -0
- package/dist/kit/components/ui/dialog.js +37 -0
- package/dist/kit/components/ui/dialog.js.map +1 -0
- package/dist/kit/components/ui/dropdown-menu.d.ts +30 -0
- package/dist/kit/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/kit/components/ui/dropdown-menu.js +51 -0
- package/dist/kit/components/ui/dropdown-menu.js.map +1 -0
- package/dist/kit/components/ui/input-otp.d.ts +11 -0
- package/dist/kit/components/ui/input-otp.d.ts.map +1 -0
- package/dist/kit/components/ui/input-otp.js +17 -0
- package/dist/kit/components/ui/input-otp.js.map +1 -0
- package/dist/kit/components/ui/input.d.ts +4 -0
- package/dist/kit/components/ui/input.d.ts.map +1 -0
- package/dist/kit/components/ui/input.js +7 -0
- package/dist/kit/components/ui/input.js.map +1 -0
- package/dist/kit/components/ui/label.d.ts +5 -0
- package/dist/kit/components/ui/label.d.ts.map +1 -0
- package/dist/kit/components/ui/label.js +8 -0
- package/dist/kit/components/ui/label.js.map +1 -0
- package/dist/kit/components/ui/pagination.d.ts +19 -0
- package/dist/kit/components/ui/pagination.d.ts.map +1 -0
- package/dist/kit/components/ui/pagination.js +24 -0
- package/dist/kit/components/ui/pagination.js.map +1 -0
- package/dist/kit/components/ui/popover.d.ts +11 -0
- package/dist/kit/components/ui/popover.d.ts.map +1 -0
- package/dist/kit/components/ui/popover.js +26 -0
- package/dist/kit/components/ui/popover.js.map +1 -0
- package/dist/kit/components/ui/select.d.ts +16 -0
- package/dist/kit/components/ui/select.d.ts.map +1 -0
- package/dist/kit/components/ui/select.js +37 -0
- package/dist/kit/components/ui/select.js.map +1 -0
- package/dist/kit/components/ui/separator.d.ts +5 -0
- package/dist/kit/components/ui/separator.d.ts.map +1 -0
- package/dist/kit/components/ui/separator.js +8 -0
- package/dist/kit/components/ui/separator.js.map +1 -0
- package/dist/kit/components/ui/sheet.d.ts +16 -0
- package/dist/kit/components/ui/sheet.d.ts.map +1 -0
- package/dist/kit/components/ui/sheet.js +37 -0
- package/dist/kit/components/ui/sheet.js.map +1 -0
- package/dist/kit/components/ui/sidebar.d.ts +77 -0
- package/dist/kit/components/ui/sidebar.d.ts.map +1 -0
- package/dist/kit/components/ui/sidebar.js +207 -0
- package/dist/kit/components/ui/sidebar.js.map +1 -0
- package/dist/kit/components/ui/skeleton.d.ts +3 -0
- package/dist/kit/components/ui/skeleton.d.ts.map +1 -0
- package/dist/kit/components/ui/skeleton.js +7 -0
- package/dist/kit/components/ui/skeleton.js.map +1 -0
- package/dist/kit/components/ui/sonner.d.ts +4 -0
- package/dist/kit/components/ui/sonner.d.ts.map +1 -0
- package/dist/kit/components/ui/sonner.js +23 -0
- package/dist/kit/components/ui/sonner.js.map +1 -0
- package/dist/kit/components/ui/table.d.ts +11 -0
- package/dist/kit/components/ui/table.d.ts.map +1 -0
- package/dist/kit/components/ui/table.js +28 -0
- package/dist/kit/components/ui/table.js.map +1 -0
- package/dist/kit/components/ui/tabs.d.ts +12 -0
- package/dist/kit/components/ui/tabs.d.ts.map +1 -0
- package/dist/kit/components/ui/tabs.js +28 -0
- package/dist/kit/components/ui/tabs.js.map +1 -0
- package/dist/kit/components/ui/textarea.d.ts +4 -0
- package/dist/kit/components/ui/textarea.d.ts.map +1 -0
- package/dist/kit/components/ui/textarea.js +7 -0
- package/dist/kit/components/ui/textarea.js.map +1 -0
- package/dist/kit/components/ui/tooltip.d.ts +8 -0
- package/dist/kit/components/ui/tooltip.d.ts.map +1 -0
- package/dist/kit/components/ui/tooltip.js +18 -0
- package/dist/kit/components/ui/tooltip.js.map +1 -0
- package/dist/kit/hooks/use-mobile.d.ts +2 -0
- package/dist/kit/hooks/use-mobile.d.ts.map +1 -0
- package/dist/kit/hooks/use-mobile.js +16 -0
- package/dist/kit/hooks/use-mobile.js.map +1 -0
- package/dist/kit/index.d.ts +37 -0
- package/dist/kit/index.d.ts.map +1 -0
- package/dist/kit/index.js +37 -0
- package/dist/kit/index.js.map +1 -0
- package/dist/kit/kit.css +2 -0
- package/dist/kit/lib/utils.d.ts +3 -0
- package/dist/kit/lib/utils.d.ts.map +1 -0
- package/dist/kit/lib/utils.js +6 -0
- package/dist/kit/lib/utils.js.map +1 -0
- package/dist/kit/tokens.css +88 -0
- package/dist/mcp-app/index.d.ts +6 -0
- package/dist/mcp-app/index.js +6 -0
- package/dist/mcp-app/interaction.html +183 -0
- package/dist/react/components.d.ts +59 -0
- package/dist/react/components.d.ts.map +1 -0
- package/dist/react/components.js +102 -0
- package/dist/react/components.js.map +1 -0
- package/dist/react/fields.d.ts +62 -0
- package/dist/react/fields.d.ts.map +1 -0
- package/dist/react/fields.js +225 -0
- package/dist/react/fields.js.map +1 -0
- package/dist/react/labels.d.ts +33 -0
- package/dist/react/labels.d.ts.map +1 -0
- package/dist/react/labels.js +30 -0
- package/dist/react/labels.js.map +1 -0
- package/dist/react/schema-form.d.ts +34 -0
- package/dist/react/schema-form.d.ts.map +1 -0
- package/dist/react/schema-form.js +79 -0
- package/dist/react/schema-form.js.map +1 -0
- package/dist/react/use-interaction.d.ts +4 -0
- package/dist/react/use-interaction.d.ts.map +1 -0
- package/dist/react/use-interaction.js +6 -0
- package/dist/react/use-interaction.js.map +1 -0
- package/dist/react/values.d.ts +64 -0
- package/dist/react/values.d.ts.map +1 -0
- package/dist/react/values.js +123 -0
- package/dist/react/values.js.map +1 -0
- package/package.json +130 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { InteractionDiagnostic, InvokeOutcome } from "../controller/index.js";
|
|
2
|
+
import type { FormSchema } from "../react/schema-form.js";
|
|
3
|
+
import type { FieldSchema, LocalizedText } from "../react/values.js";
|
|
4
|
+
/** Result `_meta` key naming the tool, on results an App renders (`@aotter/mantle/mcp`'s `APP_TOOL_META_KEY`). */
|
|
5
|
+
export declare const APP_TOOL_META_KEY = "net.aotter.mantle/tool";
|
|
6
|
+
/** The element the host embeds the catalog in (`@aotter/mantle/mcp`'s `APP_CATALOG_ID`). */
|
|
7
|
+
export declare const APP_CATALOG_ID = "mantle-catalog";
|
|
8
|
+
/** A Procedure tool that acts on one row, as `@aotter/mantle/mcp`'s `appCatalog` describes it. */
|
|
9
|
+
export interface AppRowAction {
|
|
10
|
+
readonly capability: string;
|
|
11
|
+
readonly title?: LocalizedText;
|
|
12
|
+
readonly inputSchema: FormSchema;
|
|
13
|
+
readonly uiSchema?: Readonly<Record<string, unknown>>;
|
|
14
|
+
readonly bind: readonly {
|
|
15
|
+
readonly input: string;
|
|
16
|
+
readonly field: string;
|
|
17
|
+
}[];
|
|
18
|
+
readonly version?: string;
|
|
19
|
+
readonly mutates: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface AppCatalogView {
|
|
22
|
+
readonly title?: LocalizedText;
|
|
23
|
+
readonly columns: Readonly<Record<string, FieldSchema>>;
|
|
24
|
+
readonly list: {
|
|
25
|
+
readonly columns: readonly string[];
|
|
26
|
+
};
|
|
27
|
+
/** The `actions` a row of this View can open. */
|
|
28
|
+
readonly actions: readonly string[];
|
|
29
|
+
}
|
|
30
|
+
/** What the server embedded in the App's HTML: View tool name → its View, Procedure tool name → how it acts on a row. */
|
|
31
|
+
export interface AppCatalog {
|
|
32
|
+
readonly views: Readonly<Record<string, AppCatalogView>>;
|
|
33
|
+
readonly actions: Readonly<Record<string, AppRowAction>>;
|
|
34
|
+
}
|
|
35
|
+
/** A View the catalog does not describe: its rows as they come, nothing to open. */
|
|
36
|
+
export declare const BARE_VIEW: AppCatalogView;
|
|
37
|
+
/** The shape every MCP tool result shares, independent of an SDK. */
|
|
38
|
+
export interface ToolResult {
|
|
39
|
+
readonly content?: readonly {
|
|
40
|
+
readonly type: string;
|
|
41
|
+
readonly text?: string;
|
|
42
|
+
}[];
|
|
43
|
+
readonly structuredContent?: Readonly<Record<string, unknown>>;
|
|
44
|
+
readonly isError?: boolean;
|
|
45
|
+
readonly _meta?: Readonly<Record<string, unknown>>;
|
|
46
|
+
}
|
|
47
|
+
/** Calls one server tool; the App passes `app.callServerTool`. */
|
|
48
|
+
export type CallTool = (name: string, args: Record<string, unknown>, signal?: AbortSignal) => Promise<ToolResult>;
|
|
49
|
+
type Row = Readonly<Record<string, unknown>>;
|
|
50
|
+
/** The catalog the host embedded; none is an empty catalog. */
|
|
51
|
+
export declare function readCatalog(doc?: Pick<Document, "getElementById">): AppCatalog;
|
|
52
|
+
/** The tool a result came from: the server names it, else the host's tool info. */
|
|
53
|
+
export declare function toolOf(result: ToolResult, hostTool?: string): string | null;
|
|
54
|
+
/** A View result's rows; null for a failure or any other result. */
|
|
55
|
+
export declare function rowsOf(result: ToolResult): Row[] | null;
|
|
56
|
+
/** The diagnostics an `isError` result carries, from either content form. */
|
|
57
|
+
export declare function diagnosticsOf(result: ToolResult): InteractionDiagnostic[];
|
|
58
|
+
/**
|
|
59
|
+
* `structuredContent`, else the JSON text block, else the text itself. A
|
|
60
|
+
* tool with an output schema reports failures in the text block only.
|
|
61
|
+
*/
|
|
62
|
+
export declare function outputOf(result: ToolResult): unknown;
|
|
63
|
+
/**
|
|
64
|
+
* A tool answer as the controller reads it. `isError` results carry the
|
|
65
|
+
* runtime's `{ diagnostics }`; a thrown call (transport, host, protocol) is
|
|
66
|
+
* rethrown, so the controller treats the write as uncertain.
|
|
67
|
+
*/
|
|
68
|
+
export declare function invokeTool(call: CallTool, name: string, args: Record<string, unknown>, signal: AbortSignal): Promise<InvokeOutcome>;
|
|
69
|
+
/** Inputs the form does not render: row bindings, the version, idempotency keys. */
|
|
70
|
+
export declare function hiddenInputs(action: AppRowAction): string[];
|
|
71
|
+
export declare function idempotencyInputs(action: AppRowAction): string[];
|
|
72
|
+
/** The row actions a row can open: it carries an id, and its version when the action locks one. */
|
|
73
|
+
export declare function actionsFor(catalog: AppCatalog, view: AppCatalogView, row: Row): AppRowAction[];
|
|
74
|
+
export {};
|
|
75
|
+
//# sourceMappingURL=bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../src/app/bridge.ts"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AM,CAAC,MAAM,EAAE,UAAU,GAAG,GAAG,EAAE,GAAG,IAAI,CAIvD;AAED,6EAA6E;AAC7E,wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,qBAAqB,EAAE,CAMzE;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAKpD;AAED;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CASzI;AAED,oFAAoF;AACpF,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,EAAE,CAM3D;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,EAAE,CAIhE;AAED,mGAAmG;AACnG,wBAAgB,UAAU,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,EAAE,GAAG,GAAG,YAAY,EAAE,CAM9F"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/** Result `_meta` key naming the tool, on results an App renders (`@aotter/mantle/mcp`'s `APP_TOOL_META_KEY`). */
|
|
2
|
+
export const APP_TOOL_META_KEY = "net.aotter.mantle/tool";
|
|
3
|
+
/** The element the host embeds the catalog in (`@aotter/mantle/mcp`'s `APP_CATALOG_ID`). */
|
|
4
|
+
export const APP_CATALOG_ID = "mantle-catalog";
|
|
5
|
+
/** A View the catalog does not describe: its rows as they come, nothing to open. */
|
|
6
|
+
export const BARE_VIEW = { columns: {}, list: { columns: [] }, actions: [] };
|
|
7
|
+
/** The catalog the host embedded; none is an empty catalog. */
|
|
8
|
+
export function readCatalog(doc = document) {
|
|
9
|
+
try {
|
|
10
|
+
const parsed = JSON.parse(doc.getElementById(APP_CATALOG_ID)?.textContent ?? "");
|
|
11
|
+
if (isRecord(parsed) && isRecord(parsed["views"]) && isRecord(parsed["actions"]))
|
|
12
|
+
return parsed;
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
// no catalog: nothing to render with it
|
|
16
|
+
}
|
|
17
|
+
return { views: {}, actions: {} };
|
|
18
|
+
}
|
|
19
|
+
/** The tool a result came from: the server names it, else the host's tool info. */
|
|
20
|
+
export function toolOf(result, hostTool) {
|
|
21
|
+
const named = result._meta?.[APP_TOOL_META_KEY];
|
|
22
|
+
return typeof named === "string" ? named : hostTool ?? null;
|
|
23
|
+
}
|
|
24
|
+
/** A View result's rows; null for a failure or any other result. */
|
|
25
|
+
export function rowsOf(result) {
|
|
26
|
+
if (result.isError)
|
|
27
|
+
return null;
|
|
28
|
+
const output = outputOf(result);
|
|
29
|
+
return isRecord(output) && Array.isArray(output["rows"]) ? output["rows"].filter(isRecord) : null;
|
|
30
|
+
}
|
|
31
|
+
/** The diagnostics an `isError` result carries, from either content form. */
|
|
32
|
+
export function diagnosticsOf(result) {
|
|
33
|
+
const output = outputOf(result);
|
|
34
|
+
return isRecord(output) && Array.isArray(output["diagnostics"])
|
|
35
|
+
? output["diagnostics"].filter((item) => isRecord(item) && typeof item["code"] === "string" && typeof item["message"] === "string")
|
|
36
|
+
: [];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* `structuredContent`, else the JSON text block, else the text itself. A
|
|
40
|
+
* tool with an output schema reports failures in the text block only.
|
|
41
|
+
*/
|
|
42
|
+
export function outputOf(result) {
|
|
43
|
+
if (result.structuredContent !== undefined)
|
|
44
|
+
return result.structuredContent;
|
|
45
|
+
const text = result.content?.find((item) => item.type === "text")?.text;
|
|
46
|
+
if (text === undefined)
|
|
47
|
+
return undefined;
|
|
48
|
+
try {
|
|
49
|
+
return JSON.parse(text);
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return text;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A tool answer as the controller reads it. `isError` results carry the
|
|
57
|
+
* runtime's `{ diagnostics }`; a thrown call (transport, host, protocol) is
|
|
58
|
+
* rethrown, so the controller treats the write as uncertain.
|
|
59
|
+
*/
|
|
60
|
+
export async function invokeTool(call, name, args, signal) {
|
|
61
|
+
const result = await call(name, args, signal);
|
|
62
|
+
if (!result.isError)
|
|
63
|
+
return { ok: true, data: outputOf(result) };
|
|
64
|
+
const diagnostics = diagnosticsOf(result);
|
|
65
|
+
if (diagnostics.length === 0) {
|
|
66
|
+
const output = outputOf(result);
|
|
67
|
+
throw new Error(typeof output === "string" ? output : "The tool failed without a diagnostic.");
|
|
68
|
+
}
|
|
69
|
+
return { ok: false, diagnostics };
|
|
70
|
+
}
|
|
71
|
+
/** Inputs the form does not render: row bindings, the version, idempotency keys. */
|
|
72
|
+
export function hiddenInputs(action) {
|
|
73
|
+
return [
|
|
74
|
+
...action.bind.map(({ input }) => input),
|
|
75
|
+
...(action.version ? [action.version] : []),
|
|
76
|
+
...idempotencyInputs(action),
|
|
77
|
+
];
|
|
78
|
+
}
|
|
79
|
+
export function idempotencyInputs(action) {
|
|
80
|
+
return Object.entries(action.inputSchema.properties ?? {})
|
|
81
|
+
.filter(([, property]) => property["x-mcp-hint"] === "idempotency-key")
|
|
82
|
+
.map(([name]) => name);
|
|
83
|
+
}
|
|
84
|
+
/** The row actions a row can open: it carries an id, and its version when the action locks one. */
|
|
85
|
+
export function actionsFor(catalog, view, row) {
|
|
86
|
+
if (typeof row["id"] !== "string")
|
|
87
|
+
return [];
|
|
88
|
+
return view.actions.flatMap((name) => {
|
|
89
|
+
const action = Object.prototype.hasOwnProperty.call(catalog.actions, name) ? catalog.actions[name] : undefined;
|
|
90
|
+
return action && (!action.version || typeof row["version"] === "number") ? [action] : [];
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function isRecord(value) {
|
|
94
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
95
|
+
}
|
|
96
|
+
//# source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AC,EAAE,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,iBAAiB,CAAC;SACtE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED,mGAAmG;AACnG,MAAM,UAAU,UAAU,CAAC,OAAmB,EAAE,IAAoB,EAAE,GAAQ;IAC5E,IAAI,OAAO,GAAG,CAAC,IAAI,CAAC,KAAK,QAAQ;QAAE,OAAO,EAAE,CAAC;IAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACnC,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QAChH,OAAO,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,IAAI,OAAO,GAAG,CAAC,SAAS,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3F,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framework-free interaction logic (ADR-0029 D7): one operation opened from
|
|
3
|
+
* one row, reviewed by a person, submitted once. The host injects `read` and
|
|
4
|
+
* `invoke` — the Admin's staff MCP client, an MCP App's `callServerTool`, or
|
|
5
|
+
* an application's own HTTP client — and renders the snapshot however it
|
|
6
|
+
* likes. Nothing here touches a router, cookies, globals or a UI framework,
|
|
7
|
+
* and nothing is imported: the Mantle shapes below are structural, so a
|
|
8
|
+
* runtime `ViewRowAction` and `Diagnostic` fit them as they are.
|
|
9
|
+
*/
|
|
10
|
+
/** How a row feeds the operation: a runtime `ViewRowAction` fits. */
|
|
11
|
+
export interface InteractionBinding {
|
|
12
|
+
/** Operation inputs taken from the row: `input` ← row `field`. */
|
|
13
|
+
readonly bind: readonly {
|
|
14
|
+
readonly input: string;
|
|
15
|
+
readonly field: string;
|
|
16
|
+
}[];
|
|
17
|
+
/** Input that receives the reviewed entry's `version`, when the operation locks it. */
|
|
18
|
+
readonly version?: string;
|
|
19
|
+
}
|
|
20
|
+
/** The runtime Diagnostic fields the controller reads. */
|
|
21
|
+
export interface InteractionDiagnostic {
|
|
22
|
+
readonly code: string;
|
|
23
|
+
readonly message: string;
|
|
24
|
+
readonly path?: string;
|
|
25
|
+
readonly failure?: {
|
|
26
|
+
readonly outcome?: string;
|
|
27
|
+
readonly retry?: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/** An entry as a person reviews it; its `version` is what a submit locks. */
|
|
31
|
+
export interface EntrySnapshot {
|
|
32
|
+
readonly id: string;
|
|
33
|
+
readonly version: number;
|
|
34
|
+
readonly data: Readonly<Record<string, unknown>>;
|
|
35
|
+
}
|
|
36
|
+
/** The operation's answer. Business failures carry runtime diagnostics. */
|
|
37
|
+
export type InvokeOutcome = {
|
|
38
|
+
readonly ok: true;
|
|
39
|
+
readonly data: unknown;
|
|
40
|
+
} | {
|
|
41
|
+
readonly ok: false;
|
|
42
|
+
readonly diagnostics: readonly InteractionDiagnostic[];
|
|
43
|
+
};
|
|
44
|
+
export interface InteractionControllerOptions {
|
|
45
|
+
/** The row action being opened, as a View capability lists it. */
|
|
46
|
+
readonly interaction: InteractionBinding;
|
|
47
|
+
/** The row as the person saw it in the list. */
|
|
48
|
+
readonly row?: Readonly<Record<string, unknown>>;
|
|
49
|
+
/** A fresh read of the operation target (for example `read_entry`). */
|
|
50
|
+
readonly read?: (signal: AbortSignal) => Promise<EntrySnapshot>;
|
|
51
|
+
/** Invoke the operation once. A throw or abort means the outcome is unknown. */
|
|
52
|
+
readonly invoke: (input: Record<string, unknown>, signal: AbortSignal) => Promise<InvokeOutcome>;
|
|
53
|
+
/**
|
|
54
|
+
* Editable inputs to start from, for example the entry's current values.
|
|
55
|
+
* Fields the person has not touched follow the reviewed entry when a newer
|
|
56
|
+
* version is reviewed, so a prefill never reverts someone else's change.
|
|
57
|
+
*/
|
|
58
|
+
readonly initialInput?: Readonly<Record<string, unknown>>;
|
|
59
|
+
/** Inputs the host fills itself (idempotency keys): sent, never shown as changes. */
|
|
60
|
+
readonly automatic?: readonly string[];
|
|
61
|
+
}
|
|
62
|
+
export type InteractionPhase =
|
|
63
|
+
/** Not opened yet. */
|
|
64
|
+
"idle"
|
|
65
|
+
/** Reading the target to confirm what the person reviews. */
|
|
66
|
+
| "loading"
|
|
67
|
+
/** The target could not be read; nothing is confirmed to submit against. */
|
|
68
|
+
| "unreadable"
|
|
69
|
+
/** Ready to edit and submit. */
|
|
70
|
+
| "ready"
|
|
71
|
+
/** A read found a newer version than the one reviewed; `review()` adopts it. */
|
|
72
|
+
| "changedSinceList" | "submitting" | "succeeded"
|
|
73
|
+
/** The operation refused; `diagnostics` say why, and the input is kept. */
|
|
74
|
+
| "failed"
|
|
75
|
+
/** The reviewed version is no longer current; `reread()`, then review again. */
|
|
76
|
+
| "conflict"
|
|
77
|
+
/** The write may or may not have happened; `reread()` before anything else. */
|
|
78
|
+
| "uncertain" | "cancelled";
|
|
79
|
+
export interface InteractionState {
|
|
80
|
+
readonly phase: InteractionPhase;
|
|
81
|
+
/** A read is in flight (open, refresh or reread). */
|
|
82
|
+
readonly reading: boolean;
|
|
83
|
+
/** The host supplied `read`; without it an uncertain write needs `acknowledgeUncertain()`. */
|
|
84
|
+
readonly canRead: boolean;
|
|
85
|
+
/** Inputs taken from the row; not editable. */
|
|
86
|
+
readonly bound: Readonly<Record<string, unknown>>;
|
|
87
|
+
/** Editable inputs, kept across refreshes, conflicts and failures. */
|
|
88
|
+
readonly draft: Readonly<Record<string, unknown>>;
|
|
89
|
+
/** Draft fields the person changed. */
|
|
90
|
+
readonly touched: readonly string[];
|
|
91
|
+
/** The person changed the draft away from the reviewed entry, unsaved. */
|
|
92
|
+
readonly dirty: boolean;
|
|
93
|
+
/** The entry the person is reviewing. */
|
|
94
|
+
readonly reviewed: EntrySnapshot | null;
|
|
95
|
+
/** A newer read that has not been reviewed yet. */
|
|
96
|
+
readonly latest: EntrySnapshot | null;
|
|
97
|
+
/** Touched fields that someone else also changed between `reviewed` and `latest`. */
|
|
98
|
+
readonly contested: readonly string[];
|
|
99
|
+
/** Runtime diagnostics from the last refusal or uncertain outcome. */
|
|
100
|
+
readonly diagnostics: readonly InteractionDiagnostic[];
|
|
101
|
+
/** The last read or transport failure, as thrown. */
|
|
102
|
+
readonly error: unknown;
|
|
103
|
+
readonly result: unknown;
|
|
104
|
+
}
|
|
105
|
+
export interface FieldChange {
|
|
106
|
+
readonly field: string;
|
|
107
|
+
readonly before: unknown;
|
|
108
|
+
readonly after: unknown;
|
|
109
|
+
}
|
|
110
|
+
export interface InteractionController {
|
|
111
|
+
/** `useSyncExternalStore`-compatible subscription. */
|
|
112
|
+
subscribe(listener: () => void): () => void;
|
|
113
|
+
getSnapshot(): InteractionState;
|
|
114
|
+
/** Confirm the target: reads it when the operation locks a version. */
|
|
115
|
+
open(): Promise<void>;
|
|
116
|
+
/** Change one editable input. Bound inputs and the version are not editable. */
|
|
117
|
+
edit(field: string, value: unknown): void;
|
|
118
|
+
/** Background re-read. Never replaces the reviewed entry or the draft. */
|
|
119
|
+
refresh(): Promise<void>;
|
|
120
|
+
/** Adopt the newer read as the reviewed entry. */
|
|
121
|
+
review(): void;
|
|
122
|
+
/** After a conflict, an uncertain write or a failed read: read again. */
|
|
123
|
+
reread(): Promise<void>;
|
|
124
|
+
/**
|
|
125
|
+
* For a host with no `read`: the person has checked an uncertain write
|
|
126
|
+
* elsewhere and chooses to continue.
|
|
127
|
+
*/
|
|
128
|
+
acknowledgeUncertain(): void;
|
|
129
|
+
/** Submit once with the reviewed version. Never retried. */
|
|
130
|
+
submit(): Promise<void>;
|
|
131
|
+
/**
|
|
132
|
+
* Stop. An in-flight submit becomes `uncertain`, since it may have landed;
|
|
133
|
+
* its answer, even a success, is then ignored.
|
|
134
|
+
*/
|
|
135
|
+
cancel(): void;
|
|
136
|
+
/** Draft inputs that differ from the reviewed entry's fields. */
|
|
137
|
+
changes(): readonly FieldChange[];
|
|
138
|
+
/** Fields that differ between the reviewed entry and the newer read. */
|
|
139
|
+
latestChanges(): readonly FieldChange[];
|
|
140
|
+
}
|
|
141
|
+
export declare function createInteractionController(options: InteractionControllerOptions): InteractionController;
|
|
142
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/controller/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,qEAAqE;AACrE,MAAM,WAAW,kBAAkB;IACjC,kEAAkE;IAClE,QAAQ,CAAC,IAAI,EAAE,SAAS;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC7E,uFAAuF;IACvF,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,0DAA0D;AAC1D,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC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E,OAAO,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,qBAAqB;IACpC,sDAAsD;IACtD,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IAC5C,WAAW,IAAI,gBAAgB,CAAC;IAChC,uEAAuE;IACvE,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,gFAAgF;IAChF,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1C,0EAA0E;IAC1E,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,kDAAkD;IAClD,MAAM,IAAI,IAAI,CAAC;IACf,yEAAyE;IACzE,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB;;;OAGG;IACH,oBAAoB,IAAI,IAAI,CAAC;IAC7B,4DAA4D;IAC5D,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB;;;OAGG;IACH,MAAM,IAAI,IAAI,CAAC;IACf,iEAAiE;IACjE,OAAO,IAAI,SAAS,WAAW,EAAE,CAAC;IAClC,wEAAwE;IACxE,aAAa,IAAI,SAAS,WAAW,EAAE,CAAC;CACzC;AAkBD,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,4BAA4B,GAAG,qBAAqB,CA8MxG"}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framework-free interaction logic (ADR-0029 D7): one operation opened from
|
|
3
|
+
* one row, reviewed by a person, submitted once. The host injects `read` and
|
|
4
|
+
* `invoke` — the Admin's staff MCP client, an MCP App's `callServerTool`, or
|
|
5
|
+
* an application's own HTTP client — and renders the snapshot however it
|
|
6
|
+
* likes. Nothing here touches a router, cookies, globals or a UI framework,
|
|
7
|
+
* and nothing is imported: the Mantle shapes below are structural, so a
|
|
8
|
+
* runtime `ViewRowAction` and `Diagnostic` fit them as they are.
|
|
9
|
+
*/
|
|
10
|
+
/** Runtime codes and effect facts meaning a write may have landed (ADR-0023). */
|
|
11
|
+
const UNCERTAIN_CODES = new Set([
|
|
12
|
+
"OUTCOME_UNKNOWN",
|
|
13
|
+
"PARTIAL_FAILURE",
|
|
14
|
+
// The handler finished, writes included, but its output was rejected.
|
|
15
|
+
"OUTPUT_VALIDATION_FAILED",
|
|
16
|
+
// An unexpected failure can follow a write.
|
|
17
|
+
"INTERNAL_ERROR",
|
|
18
|
+
]);
|
|
19
|
+
const EDITABLE = new Set([
|
|
20
|
+
"idle", "loading", "unreadable", "ready", "changedSinceList", "failed", "conflict", "uncertain",
|
|
21
|
+
]);
|
|
22
|
+
const SUBMITTABLE = new Set(["ready", "failed"]);
|
|
23
|
+
const REREADABLE = new Set(["unreadable", "changedSinceList", "failed", "conflict", "uncertain"]);
|
|
24
|
+
const REFRESHABLE = new Set(["unreadable", "ready", "changedSinceList", "failed"]);
|
|
25
|
+
export function createInteractionController(options) {
|
|
26
|
+
const { interaction, row, read, invoke } = options;
|
|
27
|
+
const versionInput = interaction.version;
|
|
28
|
+
const locks = versionInput !== undefined;
|
|
29
|
+
for (const { input, field } of interaction.bind) {
|
|
30
|
+
if (!row || !(field in row))
|
|
31
|
+
throw new TypeError(`Input '${input}' is bound to row field '${field}', which the row does not carry.`);
|
|
32
|
+
}
|
|
33
|
+
const bound = Object.freeze(Object.fromEntries(interaction.bind.map(({ input, field }) => [input, row[field]])));
|
|
34
|
+
const listSnapshot = row && typeof row["id"] === "string" && typeof row["version"] === "number"
|
|
35
|
+
? Object.freeze({ id: row["id"], version: row["version"], data: Object.freeze({ ...row }) })
|
|
36
|
+
: null;
|
|
37
|
+
if (locks && !read && !listSnapshot) {
|
|
38
|
+
throw new TypeError("An operation that locks a version needs a `read` or a row carrying id and version.");
|
|
39
|
+
}
|
|
40
|
+
const targetId = listSnapshot?.id;
|
|
41
|
+
const fixed = new Set([...Object.keys(bound), ...(versionInput ? [versionInput] : [])]);
|
|
42
|
+
const seeded = Object.fromEntries(Object.entries(options.initialInput ?? {}).filter(([field]) => !fixed.has(field)));
|
|
43
|
+
const automatic = new Set(options.automatic ?? []);
|
|
44
|
+
const shown = (draft) => Object.fromEntries(Object.entries(draft).filter(([field]) => !automatic.has(field)));
|
|
45
|
+
let state = Object.freeze({
|
|
46
|
+
phase: "idle",
|
|
47
|
+
reading: false,
|
|
48
|
+
canRead: read !== undefined,
|
|
49
|
+
bound,
|
|
50
|
+
draft: Object.freeze(seeded),
|
|
51
|
+
touched: [],
|
|
52
|
+
dirty: false,
|
|
53
|
+
reviewed: listSnapshot,
|
|
54
|
+
latest: null,
|
|
55
|
+
contested: [],
|
|
56
|
+
diagnostics: [],
|
|
57
|
+
error: undefined,
|
|
58
|
+
result: undefined,
|
|
59
|
+
});
|
|
60
|
+
const listeners = new Set();
|
|
61
|
+
// Each read or submit owns one abort controller; a newer step or a cancel
|
|
62
|
+
// makes an older answer stale, and stale answers are dropped.
|
|
63
|
+
let current = null;
|
|
64
|
+
let step = 0;
|
|
65
|
+
const set = (patch) => {
|
|
66
|
+
const next = { ...state, ...patch };
|
|
67
|
+
state = Object.freeze({
|
|
68
|
+
...next,
|
|
69
|
+
dirty: next.touched.some((field) => !automatic.has(field)) && diff(shown(next.draft), next.reviewed?.data ?? {}).length > 0,
|
|
70
|
+
contested: contestedFields(next),
|
|
71
|
+
});
|
|
72
|
+
// A listener's failure is reported, never allowed to interrupt a
|
|
73
|
+
// transition or the other listeners.
|
|
74
|
+
for (const listener of [...listeners]) {
|
|
75
|
+
try {
|
|
76
|
+
listener();
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
queueMicrotask(() => { throw error; });
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
const begin = () => {
|
|
84
|
+
current?.abort();
|
|
85
|
+
current = new AbortController();
|
|
86
|
+
return { id: ++step, signal: current.signal };
|
|
87
|
+
};
|
|
88
|
+
const stale = (id) => id !== step || state.phase === "cancelled";
|
|
89
|
+
/** Read the target; a wrong entry is a failed read. Background reads
|
|
90
|
+
* only record their failure. */
|
|
91
|
+
const readInto = async (onFresh, onError) => {
|
|
92
|
+
if (!read)
|
|
93
|
+
return false;
|
|
94
|
+
const { id, signal } = begin();
|
|
95
|
+
set({ reading: true });
|
|
96
|
+
try {
|
|
97
|
+
const fresh = await read(signal);
|
|
98
|
+
if (stale(id))
|
|
99
|
+
return true;
|
|
100
|
+
if (targetId !== undefined && fresh.id !== targetId) {
|
|
101
|
+
set({ ...onError, reading: false, error: new Error(`Read returned entry '${fresh.id}', not '${targetId}'.`) });
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
set({ ...onFresh(freeze(fresh)), reading: false, error: undefined });
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
if (!stale(id))
|
|
108
|
+
set({ ...onError, reading: false, error: error ?? new Error("Read failed.") });
|
|
109
|
+
}
|
|
110
|
+
return true;
|
|
111
|
+
};
|
|
112
|
+
/** A fresh read either confirms the reviewed version or waits for a review. */
|
|
113
|
+
const confirm = (fresh) => {
|
|
114
|
+
if (state.latest && fresh.version < state.latest.version)
|
|
115
|
+
return {};
|
|
116
|
+
if (!state.reviewed || state.reviewed.version === fresh.version) {
|
|
117
|
+
return { phase: "ready", reviewed: fresh, latest: null };
|
|
118
|
+
}
|
|
119
|
+
return { phase: "changedSinceList", latest: fresh };
|
|
120
|
+
};
|
|
121
|
+
return {
|
|
122
|
+
subscribe(listener) {
|
|
123
|
+
listeners.add(listener);
|
|
124
|
+
return () => listeners.delete(listener);
|
|
125
|
+
},
|
|
126
|
+
getSnapshot: () => state,
|
|
127
|
+
async open() {
|
|
128
|
+
if (state.phase !== "idle")
|
|
129
|
+
return;
|
|
130
|
+
if (!locks || !read) {
|
|
131
|
+
set({ phase: "ready" });
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
set({ phase: "loading" });
|
|
135
|
+
await readInto(confirm, { phase: "unreadable" });
|
|
136
|
+
},
|
|
137
|
+
edit(field, value) {
|
|
138
|
+
if (!EDITABLE.has(state.phase))
|
|
139
|
+
return;
|
|
140
|
+
if (fixed.has(field))
|
|
141
|
+
throw new TypeError(`Input '${field}' comes from the reviewed row and cannot be edited.`);
|
|
142
|
+
set({
|
|
143
|
+
draft: Object.freeze({ ...state.draft, [field]: value }),
|
|
144
|
+
touched: state.touched.includes(field) ? state.touched : [...state.touched, field],
|
|
145
|
+
});
|
|
146
|
+
},
|
|
147
|
+
async refresh() {
|
|
148
|
+
if (!REFRESHABLE.has(state.phase))
|
|
149
|
+
return;
|
|
150
|
+
await readInto((fresh) => {
|
|
151
|
+
if (state.phase === "unreadable")
|
|
152
|
+
return confirm(fresh);
|
|
153
|
+
if (state.latest && fresh.version < state.latest.version)
|
|
154
|
+
return {};
|
|
155
|
+
if (!state.reviewed)
|
|
156
|
+
return { reviewed: fresh };
|
|
157
|
+
if (fresh.version === state.reviewed.version) {
|
|
158
|
+
return state.phase === "changedSinceList" ? { phase: "ready", latest: null } : { latest: null };
|
|
159
|
+
}
|
|
160
|
+
// Only a locked operation can be made stale by a newer version.
|
|
161
|
+
return locks ? { phase: "changedSinceList", latest: fresh } : { latest: fresh };
|
|
162
|
+
}, {});
|
|
163
|
+
},
|
|
164
|
+
review() {
|
|
165
|
+
if (state.phase !== "changedSinceList" || !state.latest)
|
|
166
|
+
return;
|
|
167
|
+
const latest = state.latest;
|
|
168
|
+
// Untouched prefilled fields follow the newer entry; the person's own
|
|
169
|
+
// edits stay, and `contested` has already shown where they collide.
|
|
170
|
+
const draft = Object.fromEntries(Object.entries(state.draft).map(([field, value]) => state.touched.includes(field) || !(field in latest.data) ? [field, value] : [field, latest.data[field]]));
|
|
171
|
+
set({ phase: "ready", reviewed: latest, latest: null, draft: Object.freeze(draft), diagnostics: [] });
|
|
172
|
+
},
|
|
173
|
+
async reread() {
|
|
174
|
+
if (!REREADABLE.has(state.phase))
|
|
175
|
+
return;
|
|
176
|
+
const from = state.phase;
|
|
177
|
+
await readInto((fresh) => {
|
|
178
|
+
const next = confirm(fresh);
|
|
179
|
+
// A refusal that did not come from a moved version stays visible.
|
|
180
|
+
return from === "conflict" && next.phase === "ready" ? { ...next, phase: "failed" } : next;
|
|
181
|
+
}, { phase: from === "uncertain" ? "uncertain" : "unreadable" });
|
|
182
|
+
},
|
|
183
|
+
acknowledgeUncertain() {
|
|
184
|
+
if (state.phase === "uncertain" && !read)
|
|
185
|
+
set({ phase: "ready", error: undefined, diagnostics: [] });
|
|
186
|
+
},
|
|
187
|
+
async submit() {
|
|
188
|
+
if (!SUBMITTABLE.has(state.phase) || state.reading)
|
|
189
|
+
return;
|
|
190
|
+
if (locks && !state.reviewed)
|
|
191
|
+
return;
|
|
192
|
+
const input = {
|
|
193
|
+
...state.draft,
|
|
194
|
+
...bound,
|
|
195
|
+
...(locks ? { [versionInput]: state.reviewed.version } : {}),
|
|
196
|
+
};
|
|
197
|
+
const { id, signal } = begin();
|
|
198
|
+
set({ phase: "submitting", diagnostics: [], error: undefined });
|
|
199
|
+
let outcome;
|
|
200
|
+
try {
|
|
201
|
+
outcome = await invoke(input, signal);
|
|
202
|
+
}
|
|
203
|
+
catch (error) {
|
|
204
|
+
// Timeouts and dropped connections may still have written.
|
|
205
|
+
if (id === step)
|
|
206
|
+
set({ phase: "uncertain", error });
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
if (stale(id))
|
|
210
|
+
return;
|
|
211
|
+
if (outcome.ok) {
|
|
212
|
+
set({ phase: "succeeded", result: outcome.data, touched: [] });
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
const { diagnostics } = outcome;
|
|
216
|
+
const phase = diagnostics.some(isUncertain) ? "uncertain"
|
|
217
|
+
// Only a version lock makes a conflict recoverable by review; any
|
|
218
|
+
// other CONFLICT (a unique key, a state rule) is a refusal to fix.
|
|
219
|
+
: locks && diagnostics.some((diagnostic) => diagnostic.code === "CONFLICT") ? "conflict"
|
|
220
|
+
: "failed";
|
|
221
|
+
set({ phase, diagnostics });
|
|
222
|
+
},
|
|
223
|
+
cancel() {
|
|
224
|
+
if (state.phase === "cancelled" || state.phase === "succeeded")
|
|
225
|
+
return;
|
|
226
|
+
const submitting = state.phase === "submitting";
|
|
227
|
+
current?.abort();
|
|
228
|
+
current = null;
|
|
229
|
+
step++;
|
|
230
|
+
set({ phase: submitting ? "uncertain" : "cancelled", reading: false });
|
|
231
|
+
},
|
|
232
|
+
changes: () => diff(shown(state.draft), state.reviewed?.data ?? {}),
|
|
233
|
+
latestChanges() {
|
|
234
|
+
if (!state.reviewed || !state.latest)
|
|
235
|
+
return [];
|
|
236
|
+
return comparable(state.reviewed, state.latest)
|
|
237
|
+
.filter((field) => !same(state.reviewed.data[field], state.latest.data[field]))
|
|
238
|
+
.map((field) => ({ field, before: state.reviewed.data[field], after: state.latest.data[field] }));
|
|
239
|
+
},
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
function isUncertain(diagnostic) {
|
|
243
|
+
return UNCERTAIN_CODES.has(diagnostic.code)
|
|
244
|
+
|| diagnostic.failure?.outcome === "unknown"
|
|
245
|
+
|| diagnostic.failure?.outcome === "partial";
|
|
246
|
+
}
|
|
247
|
+
function contestedFields(state) {
|
|
248
|
+
if (!state.reviewed || !state.latest)
|
|
249
|
+
return [];
|
|
250
|
+
const fields = new Set(comparable(state.reviewed, state.latest));
|
|
251
|
+
return state.touched.filter((field) => fields.has(field) && !same(state.reviewed.data[field], state.latest.data[field]));
|
|
252
|
+
}
|
|
253
|
+
/** Fields both snapshots carry. A list row is a projection, so a field it
|
|
254
|
+
* lacks is unknown, not changed. */
|
|
255
|
+
function comparable(reviewed, latest) {
|
|
256
|
+
return Object.keys(latest.data).filter((field) => field !== "version" && field in reviewed.data);
|
|
257
|
+
}
|
|
258
|
+
function diff(draft, before) {
|
|
259
|
+
return Object.entries(draft)
|
|
260
|
+
.filter(([field, value]) => !same(before[field], value))
|
|
261
|
+
.map(([field, after]) => ({ field, before: before[field], after }));
|
|
262
|
+
}
|
|
263
|
+
/** Structural equality for JSON-like values, independent of key order. */
|
|
264
|
+
function same(a, b) {
|
|
265
|
+
if (Object.is(a, b))
|
|
266
|
+
return true;
|
|
267
|
+
if (typeof a !== "object" || typeof b !== "object" || a === null || b === null)
|
|
268
|
+
return false;
|
|
269
|
+
if (Array.isArray(a) !== Array.isArray(b))
|
|
270
|
+
return false;
|
|
271
|
+
const keysA = Object.keys(a);
|
|
272
|
+
const keysB = Object.keys(b);
|
|
273
|
+
return keysA.length === keysB.length
|
|
274
|
+
&& keysA.every((key) => same(a[key], b[key]));
|
|
275
|
+
}
|
|
276
|
+
function freeze(entry) {
|
|
277
|
+
return Object.freeze({ id: entry.id, version: entry.version, data: Object.freeze({ ...entry.data }) });
|
|
278
|
+
}
|
|
279
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/controller/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAuIH,iFAAiF;AACjF,MAAM,eAAe,GAAwB,IAAI,GAAG,CAAC;IACnD,iBAAiB;IACjB,iBAAiB;IACjB,sEAAsE;IACtE,0BAA0B;IAC1B,4CAA4C;IAC5C,gBAAgB;CACjB,CAAC,CAAC;AACH,MAAM,QAAQ,GAAkC,IAAI,GAAG,CAAC;IACtD,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW;CAChG,CAAC,CAAC;AACH,MAAM,WAAW,GAAkC,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;AAChF,MAAM,UAAU,GAAkC,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,kBAAkB,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC;AACjI,MAAM,WAAW,GAAkC,IAAI,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IAAI,CAAC,CAAC,CAAC,CAAC;IAC7B,OAAO,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;WAC/B,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAE,CAA6B,CAAC,GAAG,CAAC,EAAG,CAA6B,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC5G,CAAC;AAED,SAAS,MAAM,CAAC,KAAoB;IAClC,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;AACzG,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { ChangeDiff, EntityPreview, OperationOutcome, OperationPanel, OperationStatus, type FieldLabelProps, } from "./react/components.js";
|
|
2
|
+
export { defaultInteractionLabels, type InteractionLabels } from "./react/labels.js";
|
|
3
|
+
export { SchemaForm, type FormSchema } from "./react/schema-form.js";
|
|
4
|
+
export { useInteraction } from "./react/use-interaction.js";
|
|
5
|
+
export * from "./controller/index.js";
|
|
6
|
+
export { NATIVE_TIMESTAMP, dateFromFieldValue, enumOptions, fieldLabel, formatMoneyMinor, formatTimestampMs, nativeTimestamp, moneyMinorHint, optionLabel, propertyDescription, propertyLabel, renderDataValue, resolveLocalizedText, timestampHint, withNativeSchema, type FieldSchema, type LocalizedText, } from "./react/values.js";
|
|
7
|
+
export { APP_CATALOG_ID, APP_TOOL_META_KEY, BARE_VIEW, actionsFor, diagnosticsOf, hiddenInputs, idempotencyInputs, invokeTool, outputOf, readCatalog, rowsOf, toolOf, type AppCatalog, type AppCatalogView, type AppRowAction, type CallTool, type ToolResult, } from "./app/bridge.js";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|