@40rty/ams-sdk 0.5.4 → 0.5.6
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/dist/index.js +608 -517
- package/dist/types/ecommerce/src/commerce-schemas.d.ts +17 -17
- package/dist/types/sdk/src/catalog/define.d.ts +0 -20
- package/dist/types/sdk/src/catalog/registration/types.d.ts +4 -3
- package/dist/types/sdk/src/host/host-modules.d.ts +49 -17
- package/dist/types/sdk/src/session/index.d.ts +1 -0
- package/dist/types/sdk/src/session/turn-attributed-session.d.ts +5 -0
- package/dist/types/sdk/src/shell/conversation/index.d.ts +1 -0
- package/dist/types/sdk/src/verticals/commerce/commerce-context.d.ts +6 -2
- package/dist/types/sdk/src/verticals/commerce/commerce-shapes.d.ts +16 -0
- package/dist/types/sdk/src/verticals/commerce/index.d.ts +2 -2
- package/dist/types/spacestation/src/commerce/cart-add-signal.d.ts +2 -1
- package/dist/types/spacestation/src/commerce/page-kinds.d.ts +7 -0
- package/dist/types/spacestation/src/contracts/tools/definitions.d.ts +9 -0
- package/dist/types/spacestation/src/host/host-page.d.ts +62 -0
- package/dist/types/spacestation/src/index.d.ts +2 -1
- package/dist/types/spacestation/src/layout/page.d.ts +11 -1
- package/dist/types/spacestation/src/signal/agent-signals.d.ts +5 -0
- package/dist/types/spacestation/src/space/connector.d.ts +16 -1
- package/dist/types/spacestation/src/space/space.d.ts +7 -0
- package/dist/types/spacestation/src/trace/trace-diagnostics.d.ts +13 -0
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ export { type ElementChange, type LayoutDiff, diffLayouts, } from './layout/layo
|
|
|
3
3
|
export { type Patch, PatchSchema, } from './layout/patch';
|
|
4
4
|
export { RESERVED_IDS, RESERVED_ID_SET, type ReservedId, isReservedId, } from './layout/reserved-ids';
|
|
5
5
|
export { type ReducePatchResult, reducePatch, } from './layout/reduce-patch';
|
|
6
|
-
export { type Page, type PageKindRegistry, registerPageKindSchema, registeredPageKinds, PageSchema, NavigatePayloadSchema, type NavigatePayload, type ViewportFocus, ViewportFocusSchema, type View, ViewSchema, type PageRouter, } from './layout/page';
|
|
6
|
+
export { type Page, type PageKindRegistry, registerPageKindSchema, registeredPageKinds, PageSchema, NavigatePayloadSchema, type NavigatePayload, type ViewportFocus, ViewportFocusSchema, type View, ViewSchema, type PageRouter, pageIdentityKey, } from './layout/page';
|
|
7
7
|
import './commerce/page-kinds';
|
|
8
8
|
export { type CartSnapshot, type CartSnapshotLine, CartSnapshotSchema, CartSnapshotLineSchema, type WishlistSnapshot, WishlistSnapshotSchema, } from './commerce/cart-state';
|
|
9
9
|
export { PRODUCT_SELECT_OPTION_SIGNAL, SELECTION_ORIGIN_VISITOR, VARIANT_SELECTED_OBSERVATION, type SelectionOrigin, } from './commerce/selection-signal';
|
|
@@ -33,6 +33,7 @@ export { applySinglePatch } from './layout/apply-patch';
|
|
|
33
33
|
export { derivePropsDoc } from './catalog/derive-props-doc';
|
|
34
34
|
export { WireSchemaSchema, WireCatalogSchema, WireCatalogEntrySchema, schemaToWire, schemaFromWire, catalogToWire, catalogFromWire, UnsupportedSchemaError, PackageReleaseSchema, draftSourceId, isDraftSource, releasePreviewSourceId, parseReleasePreview, SDK_VERSION_PATTERN, SdkVersionSchema, OLDEST_SUPPORTED_SDK, SDK_SHIMS, compareSdkVersions, sdkShimsFor, sdkWindowProblem, type SdkShim, PackageBundleRefSchema, type PackageBundleRef, BRAND_MARK_TYPES, BRAND_MARK_SLOTS, BRAND_MARK_MAX_BYTES, BrandMarkSchema, BrandMarkImageSchema, SpaceBrandMarkSchema, type BrandMark, type BrandMarkFile, type BrandMarkUpload, type BrandMarkStored, type BrandMarkSlot, type BrandMarkType, type BrandMarkImage, type SpaceBrandMark, type PackageRelease, type WireSchema, type WireCatalog, type WireCatalogEntry, } from './catalog/wire';
|
|
35
35
|
export { LateBoundValueSchema, DirectiveValueSchema, ProjectionDirectiveSchema, ProjectionPreferencesSchema, ProjectionSetPayloadSchema, PROJECTION_SET_SIGNAL, isLateBound, isActiveDirective, projectCollection, type LateBoundValue, type DirectiveValue, type ProjectionDirective, type ProjectionPreferences, type ProjectionSetPayload, type ProjectionAccessors, } from './projection/projection';
|
|
36
|
+
export { VIEW_HOST_SIGNAL, HostPayloadSchema, type HostPayload, hostPlace, pagePlace, hostFillsPage, HostClearedSchema, HOST_CLEARED, type HostCleared, PAGELESS_HOST_PLACE, } from './host/host-page';
|
|
36
37
|
export { VIEW_FOCUS_ELEMENT_SIGNAL, FocusElementPayloadSchema, type FocusElementPayload, } from './focus/focus';
|
|
37
38
|
export { VIEW_EXTEND_SIGNAL, VIEW_EXHAUSTED_SIGNAL, ViewExtendPayloadSchema, CONTINUATION_ENABLED, type ViewExtendPayload, } from './view/continuation';
|
|
38
39
|
export type { Hydrator, HydratorMap, HydrationContext } from './hydration/hydration';
|
|
@@ -74,7 +74,16 @@ export type Page = {
|
|
|
74
74
|
kind: K;
|
|
75
75
|
} & PageKindRegistry[K];
|
|
76
76
|
}[keyof PageKindRegistry];
|
|
77
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Register a page kind. `identityOmit` names the kind's VOLATILE props — two
|
|
79
|
+
* navigations to the same page may carry different values for them (a morph
|
|
80
|
+
* flag, the click-context product list, the turn that opened it) — so
|
|
81
|
+
* `pageIdentityKey` leaves them out. The kind declares them where it is
|
|
82
|
+
* declared; the universal identity rule names none of any vertical's.
|
|
83
|
+
*/
|
|
84
|
+
export declare function registerPageKindSchema(kind: string, schema: z.ZodTypeAny, options?: {
|
|
85
|
+
identityOmit?: readonly string[];
|
|
86
|
+
}): void;
|
|
78
87
|
/** Kinds currently parseable — diagnostics for a failed navigate. */
|
|
79
88
|
export declare function registeredPageKinds(): string[];
|
|
80
89
|
/**
|
|
@@ -233,6 +242,7 @@ export declare const ViewSchema: z.ZodObject<{
|
|
|
233
242
|
};
|
|
234
243
|
shell: Record<string, unknown>;
|
|
235
244
|
}>;
|
|
245
|
+
export declare function pageIdentityKey(page: Page): string;
|
|
236
246
|
/**
|
|
237
247
|
* PageRouter — pure function from Page → View. Brand-provided. Each
|
|
238
248
|
* brand registers a router that knows how to fetch / build the layout
|
|
@@ -247,6 +247,11 @@ export interface ActionDefinition {
|
|
|
247
247
|
* e.g. `text.delta`). Tells the SDK to debounce/batch and tells the LLM
|
|
248
248
|
* the cadence is allowed. */
|
|
249
249
|
streaming?: boolean;
|
|
250
|
+
/** The tool this action belongs beside. When set, the action is offered
|
|
251
|
+
* only while that tool is enabled for the space — one switch turns on a
|
|
252
|
+
* capability and the verb that acts on it (`customer.signin` follows
|
|
253
|
+
* `get_customer_account`). Absent → offered to every space. */
|
|
254
|
+
requiresTool?: string;
|
|
250
255
|
/**
|
|
251
256
|
* How this action's real-world effect is CONFIRMED. An action tool only
|
|
252
257
|
* dispatches a client signal — the effect (a cart write, a wishlist
|
|
@@ -23,7 +23,9 @@ export interface ConnectorFieldDescriptor {
|
|
|
23
23
|
/** Where the value comes from, in the connector's own vocabulary. */
|
|
24
24
|
hint: string;
|
|
25
25
|
placeholder: string;
|
|
26
|
-
/** A credential: rendered masked, never echoed back once stored.
|
|
26
|
+
/** A credential: rendered masked, never echoed back once stored. A secret
|
|
27
|
+
* config field must be named in `browserConfig` (publishable — designed to
|
|
28
|
+
* ship in client code) or `vaultedConfig` (server-only). */
|
|
27
29
|
secret: boolean;
|
|
28
30
|
}
|
|
29
31
|
/**
|
|
@@ -58,4 +60,17 @@ export interface ConnectorDescriptor {
|
|
|
58
60
|
/** Whether the connector can check typed values against the live service
|
|
59
61
|
* before they are saved. */
|
|
60
62
|
testable: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* The `config` keys a BROWSER may receive. The public space routes serialize
|
|
65
|
+
* the data source's config to anonymous visitors, and only these keys cross
|
|
66
|
+
* that boundary — an undeclared key is withheld, so a new credential is
|
|
67
|
+
* secret by default.
|
|
68
|
+
*/
|
|
69
|
+
browserConfig: readonly string[];
|
|
70
|
+
/**
|
|
71
|
+
* The `config` keys that are server-only credentials. Each is held in
|
|
72
|
+
* Supabase Vault (`connector_secrets`), keyed by space, platform and key.
|
|
73
|
+
* Never also in `browserConfig`.
|
|
74
|
+
*/
|
|
75
|
+
vaultedConfig: readonly string[];
|
|
61
76
|
}
|
|
@@ -116,4 +116,11 @@ export interface UpdateSpaceInput {
|
|
|
116
116
|
platform?: string;
|
|
117
117
|
platformConfig?: Record<string, unknown>;
|
|
118
118
|
locked?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* The organization that owns the space — the canonical `spaces.organization_id`
|
|
121
|
+
* column, which ownership, the org's space list and `poweredBy` all read. A
|
|
122
|
+
* caller moving a space sets it here AND mirrors it into
|
|
123
|
+
* `platformConfig.organizationId`, as the insert does. `null` unclaims it.
|
|
124
|
+
*/
|
|
125
|
+
organizationId?: string | null;
|
|
119
126
|
}
|
|
@@ -202,6 +202,19 @@ export type TraceDiagnostic = {
|
|
|
202
202
|
kind: 'unreachable_pruned';
|
|
203
203
|
stage: 'layout_generation';
|
|
204
204
|
element: string;
|
|
205
|
+
}
|
|
206
|
+
/** The canvas is a slot with a section limit (a host page's `maxSections`,
|
|
207
|
+
* `HostPayloadSchema`) and this turn wrote more top-level sections than it
|
|
208
|
+
* holds: the section cap kept this turn's sections first, the canvas's
|
|
209
|
+
* prior ones after, up to the limit, and dropped the rest before the wire.
|
|
210
|
+
* A soft model fault — the prompt states the limit — fixed pre-wire, so
|
|
211
|
+
* the visitor never saw the overrun. */
|
|
212
|
+
| {
|
|
213
|
+
kind: 'section_limit_trimmed';
|
|
214
|
+
stage: 'layout_generation';
|
|
215
|
+
rootKey: string;
|
|
216
|
+
maxSections: number;
|
|
217
|
+
dropped: string[];
|
|
205
218
|
} | {
|
|
206
219
|
kind: 'render_sanitized';
|
|
207
220
|
stage: 'layout_generation';
|