@40rty/ams-sdk 0.5.1 → 0.5.3
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 +639 -479
- package/dist/types/ecommerce/src/attribute-buckets.d.ts +2 -2
- package/dist/types/ecommerce/src/base-attributes.d.ts +3 -3
- package/dist/types/ecommerce/src/commerce-schemas.d.ts +1 -1
- package/dist/types/sdk/src/analytics/index.d.ts +1 -1
- package/dist/types/sdk/src/analytics/outbox.d.ts +2 -0
- package/dist/types/sdk/src/analytics/scope-context.d.ts +6 -0
- package/dist/types/sdk/src/analytics/scope.d.ts +7 -0
- package/dist/types/sdk/src/host/host-modules.d.ts +238 -36
- package/dist/types/sdk/src/session/turn-attributed-session.d.ts +4 -0
- package/dist/types/sdk/src/verticals/commerce/commerce-shapes.d.ts +3 -0
- package/dist/types/sdk/src/widgets/presence/core-presence/fact-shape.d.ts +1 -1
- package/dist/types/sdk/src/widgets/presence/core-presence/standing-signal-store.d.ts +1 -1
- package/dist/types/spacestation/src/analytics/envelope.d.ts +24 -0
- package/dist/types/spacestation/src/catalog/catalog-schemas.d.ts +1 -1
- package/dist/types/spacestation/src/catalog/element-filled.d.ts +2 -2
- package/dist/types/spacestation/src/catalog/wire/package-release.d.ts +10 -0
- package/dist/types/spacestation/src/commerce/cart-add-signal.d.ts +10 -0
- package/dist/types/spacestation/src/contracts/retrieval/ecommerce/option-values.d.ts +1 -1
- package/dist/types/spacestation/src/index.d.ts +2 -0
- package/dist/types/spacestation/src/layout/layout.d.ts +3 -3
- package/dist/types/spacestation/src/space/agent-directive.d.ts +239 -0
- package/dist/types/spacestation/src/space/session-queue.d.ts +24 -24
- package/dist/types/spacestation/src/space/space-config.d.ts +1 -1
- package/dist/types/spacestation/src/space/trace.d.ts +12 -12
- package/dist/types/spacestation/src/space/workspace-catalog.d.ts +4 -4
- package/dist/types/spacestation/src/trace/trace-diagnostics.d.ts +8 -0
- package/dist/types/spacestation/src/trace/trace-envelopes.d.ts +1 -1
- package/dist/types/spacestation/src/trace/trace-events.d.ts +1 -1
- package/package.json +1 -1
|
@@ -29,7 +29,7 @@ export interface SpaceConfig {
|
|
|
29
29
|
vertical?: string;
|
|
30
30
|
/** The catalog: a flat, ordered list of component sources (first = base, e.g.
|
|
31
31
|
* '@fourty/ui'); later sources override earlier. A self-contained brand
|
|
32
|
-
* (e.g. ['@
|
|
32
|
+
* (e.g. ['@acme/spacefront']) may omit the base. Empty = no catalog. */
|
|
33
33
|
componentSources?: string[];
|
|
34
34
|
/** Recipe slug to use for this space. Falls back to 'default' if omitted. */
|
|
35
35
|
recipeSlug?: string;
|
|
@@ -52,7 +52,9 @@ export declare const TraceRecordSchema: z.ZodObject<{
|
|
|
52
52
|
createdAt: z.ZodString;
|
|
53
53
|
}, "strip", z.ZodTypeAny, {
|
|
54
54
|
sessionId: string;
|
|
55
|
+
turnId: string | null;
|
|
55
56
|
id: string;
|
|
57
|
+
createdAt: string;
|
|
56
58
|
spaceId: string | null;
|
|
57
59
|
visitorEmail: string | null;
|
|
58
60
|
userPrompt: string;
|
|
@@ -69,13 +71,13 @@ export declare const TraceRecordSchema: z.ZodObject<{
|
|
|
69
71
|
latencyFirstText: number | null;
|
|
70
72
|
latencyFirstPatch: number | null;
|
|
71
73
|
latencyTotal: number | null;
|
|
72
|
-
turnId: string | null;
|
|
73
|
-
createdAt: string;
|
|
74
74
|
layout?: unknown;
|
|
75
75
|
trackerState?: unknown;
|
|
76
76
|
}, {
|
|
77
77
|
sessionId: string;
|
|
78
|
+
turnId: string | null;
|
|
78
79
|
id: string;
|
|
80
|
+
createdAt: string;
|
|
79
81
|
spaceId: string | null;
|
|
80
82
|
visitorEmail: string | null;
|
|
81
83
|
userPrompt: string;
|
|
@@ -92,8 +94,6 @@ export declare const TraceRecordSchema: z.ZodObject<{
|
|
|
92
94
|
latencyFirstText: number | null;
|
|
93
95
|
latencyFirstPatch: number | null;
|
|
94
96
|
latencyTotal: number | null;
|
|
95
|
-
turnId: string | null;
|
|
96
|
-
createdAt: string;
|
|
97
97
|
layout?: unknown;
|
|
98
98
|
trackerState?: unknown;
|
|
99
99
|
}>;
|
|
@@ -144,6 +144,7 @@ export declare const CreateTraceInputSchema: z.ZodObject<{
|
|
|
144
144
|
turnId: z.ZodNullable<z.ZodString>;
|
|
145
145
|
}, "strip", z.ZodTypeAny, {
|
|
146
146
|
sessionId: string;
|
|
147
|
+
turnId: string | null;
|
|
147
148
|
spaceId: string | null;
|
|
148
149
|
visitorEmail: string | null;
|
|
149
150
|
userPrompt: string;
|
|
@@ -160,11 +161,11 @@ export declare const CreateTraceInputSchema: z.ZodObject<{
|
|
|
160
161
|
latencyFirstText: number | null;
|
|
161
162
|
latencyFirstPatch: number | null;
|
|
162
163
|
latencyTotal: number | null;
|
|
163
|
-
turnId: string | null;
|
|
164
164
|
layout?: unknown;
|
|
165
165
|
trackerState?: unknown;
|
|
166
166
|
}, {
|
|
167
167
|
sessionId: string;
|
|
168
|
+
turnId: string | null;
|
|
168
169
|
spaceId: string | null;
|
|
169
170
|
visitorEmail: string | null;
|
|
170
171
|
userPrompt: string;
|
|
@@ -181,7 +182,6 @@ export declare const CreateTraceInputSchema: z.ZodObject<{
|
|
|
181
182
|
latencyFirstText: number | null;
|
|
182
183
|
latencyFirstPatch: number | null;
|
|
183
184
|
latencyTotal: number | null;
|
|
184
|
-
turnId: string | null;
|
|
185
185
|
layout?: unknown;
|
|
186
186
|
trackerState?: unknown;
|
|
187
187
|
}>;
|
|
@@ -244,6 +244,7 @@ export declare const SessionTurnSchema: z.ZodObject<{
|
|
|
244
244
|
diagnostics: z.ZodNullable<z.ZodArray<z.ZodUnknown, "many">>;
|
|
245
245
|
}, "strip", z.ZodTypeAny, {
|
|
246
246
|
id: string;
|
|
247
|
+
createdAt: string;
|
|
247
248
|
userPrompt: string;
|
|
248
249
|
responseText: string | null;
|
|
249
250
|
phaseTimings: Record<string, number> | null;
|
|
@@ -254,10 +255,10 @@ export declare const SessionTurnSchema: z.ZodObject<{
|
|
|
254
255
|
toolCalls: unknown[] | null;
|
|
255
256
|
diagnostics: unknown[] | null;
|
|
256
257
|
latencyTotal: number | null;
|
|
257
|
-
createdAt: string;
|
|
258
258
|
layout?: unknown;
|
|
259
259
|
}, {
|
|
260
260
|
id: string;
|
|
261
|
+
createdAt: string;
|
|
261
262
|
userPrompt: string;
|
|
262
263
|
responseText: string | null;
|
|
263
264
|
phaseTimings: Record<string, number> | null;
|
|
@@ -268,7 +269,6 @@ export declare const SessionTurnSchema: z.ZodObject<{
|
|
|
268
269
|
toolCalls: unknown[] | null;
|
|
269
270
|
diagnostics: unknown[] | null;
|
|
270
271
|
latencyTotal: number | null;
|
|
271
|
-
createdAt: string;
|
|
272
272
|
layout?: unknown;
|
|
273
273
|
}>;
|
|
274
274
|
export type SessionTurn = z.infer<typeof SessionTurnSchema>;
|
|
@@ -305,6 +305,7 @@ export declare const SessionReplaySchema: z.ZodObject<{
|
|
|
305
305
|
diagnostics: z.ZodNullable<z.ZodArray<z.ZodUnknown, "many">>;
|
|
306
306
|
}, "strip", z.ZodTypeAny, {
|
|
307
307
|
id: string;
|
|
308
|
+
createdAt: string;
|
|
308
309
|
userPrompt: string;
|
|
309
310
|
responseText: string | null;
|
|
310
311
|
phaseTimings: Record<string, number> | null;
|
|
@@ -315,10 +316,10 @@ export declare const SessionReplaySchema: z.ZodObject<{
|
|
|
315
316
|
toolCalls: unknown[] | null;
|
|
316
317
|
diagnostics: unknown[] | null;
|
|
317
318
|
latencyTotal: number | null;
|
|
318
|
-
createdAt: string;
|
|
319
319
|
layout?: unknown;
|
|
320
320
|
}, {
|
|
321
321
|
id: string;
|
|
322
|
+
createdAt: string;
|
|
322
323
|
userPrompt: string;
|
|
323
324
|
responseText: string | null;
|
|
324
325
|
phaseTimings: Record<string, number> | null;
|
|
@@ -329,7 +330,6 @@ export declare const SessionReplaySchema: z.ZodObject<{
|
|
|
329
330
|
toolCalls: unknown[] | null;
|
|
330
331
|
diagnostics: unknown[] | null;
|
|
331
332
|
latencyTotal: number | null;
|
|
332
|
-
createdAt: string;
|
|
333
333
|
layout?: unknown;
|
|
334
334
|
}>, "many">;
|
|
335
335
|
/**
|
|
@@ -346,6 +346,7 @@ export declare const SessionReplaySchema: z.ZodObject<{
|
|
|
346
346
|
}, "strip", z.ZodTypeAny, {
|
|
347
347
|
turns: {
|
|
348
348
|
id: string;
|
|
349
|
+
createdAt: string;
|
|
349
350
|
userPrompt: string;
|
|
350
351
|
responseText: string | null;
|
|
351
352
|
phaseTimings: Record<string, number> | null;
|
|
@@ -356,13 +357,13 @@ export declare const SessionReplaySchema: z.ZodObject<{
|
|
|
356
357
|
toolCalls: unknown[] | null;
|
|
357
358
|
diagnostics: unknown[] | null;
|
|
358
359
|
latencyTotal: number | null;
|
|
359
|
-
createdAt: string;
|
|
360
360
|
layout?: unknown;
|
|
361
361
|
}[];
|
|
362
362
|
sessionLayout: Record<string, unknown> | null;
|
|
363
363
|
}, {
|
|
364
364
|
turns: {
|
|
365
365
|
id: string;
|
|
366
|
+
createdAt: string;
|
|
366
367
|
userPrompt: string;
|
|
367
368
|
responseText: string | null;
|
|
368
369
|
phaseTimings: Record<string, number> | null;
|
|
@@ -373,7 +374,6 @@ export declare const SessionReplaySchema: z.ZodObject<{
|
|
|
373
374
|
toolCalls: unknown[] | null;
|
|
374
375
|
diagnostics: unknown[] | null;
|
|
375
376
|
latencyTotal: number | null;
|
|
376
|
-
createdAt: string;
|
|
377
377
|
layout?: unknown;
|
|
378
378
|
}[];
|
|
379
379
|
sessionLayout: Record<string, unknown> | null;
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
* Workspace-bundled catalog identities.
|
|
3
3
|
*
|
|
4
4
|
* A brand increasingly OWNS its own composition identity — exported from the
|
|
5
|
-
* brand package itself (e.g. `@
|
|
5
|
+
* brand package itself (e.g. `@acme/spacefront/brand` exports a
|
|
6
6
|
* `BrandDefinition`), consumed by the API composition root + the admin client.
|
|
7
7
|
* spacestation stays brand-agnostic: it declares the shared SHAPE
|
|
8
8
|
* (`BrandDefinition`) but names no brand that owns its own definition.
|
|
9
9
|
*
|
|
10
10
|
* The records below are the NOT-YET-MIGRATED set — only the base pack
|
|
11
|
-
* (`@fourty/ui`) still centralizes its ids here. Every workspace brand
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* (`@fourty/ui`) still centralizes its ids here. Every workspace brand
|
|
12
|
+
* migrated to a package-owned `BrandDefinition` (e.g.
|
|
13
|
+
* `@acme/spacefront/brand`), so none are
|
|
14
14
|
* listed here. New brands should follow them, not these records.
|
|
15
15
|
*
|
|
16
16
|
* (Per-tenant / DB-published brands register dynamically and are NOT listed
|
|
@@ -72,6 +72,14 @@ export type TraceDiagnostic = {
|
|
|
72
72
|
kind: 'signal_patch_malformed';
|
|
73
73
|
stage: 'layout_generation';
|
|
74
74
|
reason: string;
|
|
75
|
+
}
|
|
76
|
+
/** A `{`-line the model wrote that failed JSON.parse. `repaired` = completed
|
|
77
|
+
* with its missing closers and kept; otherwise the parser drops it. */
|
|
78
|
+
| {
|
|
79
|
+
kind: 'patch_line_malformed';
|
|
80
|
+
stage: 'layout_generation';
|
|
81
|
+
repaired: boolean;
|
|
82
|
+
sample: string;
|
|
75
83
|
} | {
|
|
76
84
|
kind: 'follow_up_absent';
|
|
77
85
|
stage: 'layout_generation';
|
|
@@ -89,7 +89,7 @@ export interface AssemblyInputComponent {
|
|
|
89
89
|
/** True for layout primitives (page/stack/grid/section). */
|
|
90
90
|
alwaysInclude?: boolean;
|
|
91
91
|
/** Source package id that contributed this component — e.g. '@fourty/ui'
|
|
92
|
-
* (baseline) or '@
|
|
92
|
+
* (baseline) or '@acme/spacefront' (brand). Lets the inspector group the
|
|
93
93
|
* catalog by package. Observability only. */
|
|
94
94
|
source?: string;
|
|
95
95
|
/** Render provenance: the package id whose React component actually renders
|
|
@@ -273,7 +273,7 @@ export type TraceEvent = {
|
|
|
273
273
|
* the roll-up, and the AI SDK's `result.usage` is documented as "the
|
|
274
274
|
* token usage of the LAST step" — so the terminal call was counted
|
|
275
275
|
* twice here and a third time off the `done` event. Measured on
|
|
276
|
-
*
|
|
276
|
+
* prod 2026-09-03: a 95,887-token turn (48,169 + 47,718)
|
|
277
277
|
* persisted as 221,689, and `cache_read_tokens` — read only off the
|
|
278
278
|
* roll-up — showed 18% cache coverage where the real figure was 86%.
|
|
279
279
|
* Roll-up spans must therefore report `result.totalUsage`, not
|