@marketrix.ai/widget 4.0.136 → 4.0.137
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/src/sdk/contracts/activityLogMetadata.d.ts +3 -10
- package/dist/src/sdk/contracts/activityLogVocabulary.d.ts +3 -11
- package/dist/src/sdk/contracts/common.d.ts +6 -27
- package/dist/src/sdk/contracts/entities.d.ts +10 -7
- package/dist/src/sdk/contracts/widget.d.ts +8 -2
- package/package.json +1 -1
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `
|
|
3
|
-
* one write-time gate `models/columnSchemas.ts` registers against the column. Moved out of that file
|
|
4
|
-
* so `contracts/entities.ts` can import it to type `ActivityLogEntitySchema.metadata` precisely
|
|
5
|
-
* (a union of every branch) instead of the open `.passthrough()` it carried before — deriving from a
|
|
6
|
-
* registry that lived inside `models/columnSchemas.ts`, which itself imports from `entities.ts`,
|
|
7
|
-
* would have cycled.
|
|
2
|
+
* The strict shape of an activity log row's `metadata` column, one schema per activity type.
|
|
8
3
|
*
|
|
9
|
-
* `
|
|
10
|
-
*
|
|
11
|
-
* leaf, so this registry (and everything importing it through `entities.ts`) never pulls in
|
|
12
|
-
* `contracts/slack.ts`'s `@orpc/contract` import.
|
|
4
|
+
* `ActivityMetadataByType` maps each `ActivityLogType` to its metadata shape; `contracts/entities.ts`
|
|
5
|
+
* and `models/columnSchemas.ts` both read it, which is why it lives in its own file rather than either.
|
|
13
6
|
*/
|
|
14
7
|
import { z } from 'zod';
|
|
15
8
|
export declare const ActivityMetadataByType: {
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* and `contracts/slack.ts`'s command-log entity status — one home per `tests/unit/contractEnumHomes.test.ts`).
|
|
6
|
-
* Split out of `contracts/entities.ts` into this dependency-free leaf — no `@orpc/contract` import —
|
|
7
|
-
* so `contracts/activityLogMetadata.ts`'s per-type registry can import them without cycling back
|
|
8
|
-
* through `entities.ts`, which needs the registry to type `ActivityLogEntitySchema.metadata`
|
|
9
|
-
* precisely instead of `.passthrough()`, and so an audience that never touches oRPC contract routes
|
|
10
|
-
* (the internal/monitor mirror) doesn't pull `@orpc/contract` in through the metadata registry.
|
|
11
|
-
* `entities.ts` re-exports the first three (unchanged); `SlackCommandLogStatusSchema` is new here and
|
|
12
|
-
* has no `entities.ts` re-export since nothing imported it from there before.
|
|
2
|
+
* Closed vocabularies used across activity log rows: application and widget types, every activity
|
|
3
|
+
* `type` value, and Slack command log status. Kept dependency-free so other contract files can use
|
|
4
|
+
* them without pulling in unrelated imports.
|
|
13
5
|
*/
|
|
14
6
|
import { z } from 'zod';
|
|
15
7
|
export declare const ApplicationTypeSchema: z.ZodEnum<{
|
|
@@ -1,31 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* keys by the same discriminant separately. Typed off the map's own value type rather than a bare
|
|
9
|
-
* `z.ZodType`, whose inferred output is `unknown` and would erase every variant's real shape from the
|
|
10
|
-
* union.
|
|
11
|
-
* - `ToolCallRecordSchema.params`/`.result` stay `z.record(z.string(), z.unknown())` ON PURPOSE —
|
|
12
|
-
* `models/columnSchemas.ts`'s header lists a tool call's own arguments and result as one of the few
|
|
13
|
-
* open boundaries kept opaque deliberately, since a tool's shape varies per tool name with no closed
|
|
14
|
-
* vocabulary this file (or the widget/app readers of `simulation_step.tool_calls`) can type against.
|
|
15
|
-
* - `SessionStateSchema` is `simulation.session_state` (Browserbase cookies + localStorage snapshot).
|
|
16
|
-
* Lives here rather than `models/columnSchemas.ts`, which imports FROM
|
|
17
|
-
* `contracts/foundationEntities.ts` — a leaf-shaped schema this file already is one, so
|
|
18
|
-
* `contracts/foundationEntities.ts` can type `SimulationEntitySchema`'s own `session_state` field
|
|
19
|
-
* with it without cycling back through `columnSchemas.ts`. Its `cookies` field is the other
|
|
20
|
-
* deliberately-open boundary from that same registry header: a browser cookie as the browser itself
|
|
21
|
-
* reports it, no closed shape to narrow to.
|
|
22
|
-
* - `GraphNodeSummarySchema` is the whole-graph tier — `applicationGraphGet`/`simulationGraphGet` load
|
|
23
|
-
* nodes with `readGraph`, which always resolves sections to `[]` for speed; a node's real sections
|
|
24
|
-
* are a lazy drill-in fetched one at a time by `graphNodeSectionsGet` (its own
|
|
25
|
-
* `GraphSectionSchema`-shaped output), so this tier never carries them. `sequence_ids` is DROPPED
|
|
26
|
-
* (not just unselected) — the stored `graph.graph_nodes` column stays for the agent's own write-side
|
|
27
|
-
* dedupe, but no app/widget graph or heatmap component ever read the wire field, and this file's
|
|
28
|
-
* widget-closure membership means dropping it republishes the widget.
|
|
2
|
+
* Wire primitives shared across every domain: id/pagination shapes, tool call and browser session
|
|
3
|
+
* state, and the application knowledge graph.
|
|
4
|
+
*
|
|
5
|
+
* Exports helpers like `paginatedListOf`/`unionOfRecord`, the id and pagination input schemas, and the
|
|
6
|
+
* graph and session-state entity schemas. This file mirrors whole into the widget SDK, so any shape
|
|
7
|
+
* added here reaches the widget even if nothing else changes.
|
|
29
8
|
*/
|
|
30
9
|
import { z } from 'zod';
|
|
31
10
|
export declare const EntityStatusSchema: z.ZodEnum<{
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entity schemas for users, workspaces, applications, widgets and activity log rows — the shapes most
|
|
3
|
+
* other contracts build on.
|
|
4
|
+
*
|
|
5
|
+
* Exports the full entity schema and a narrower read/summary variant for each, plus the activity log's
|
|
6
|
+
* per-type metadata union. `ApplicationEntitySchema`'s `skill_distillation_status`/`_error` track the
|
|
7
|
+
* last skill-distillation attempt for that application, since a distilled skill is written directly with
|
|
8
|
+
* no separate draft row. `ApplicationReadSchema` never returns `password`; `WidgetPublicSchema` never
|
|
9
|
+
* returns the widget's own auth credentials, since an unauthenticated visitor's browser is the caller.
|
|
10
|
+
*/
|
|
1
11
|
import { z } from 'zod';
|
|
2
12
|
import { type ActivityLogType, ActivityLogTypeSchema, type ApplicationType, ApplicationTypeSchema, type WidgetType, WidgetTypeSchema } from './activityLogVocabulary';
|
|
3
13
|
export { ActivityLogTypeSchema, ApplicationTypeSchema, WidgetTypeSchema };
|
|
@@ -9,7 +19,6 @@ export declare const WorkspacePackageSchema: z.ZodEnum<{
|
|
|
9
19
|
enterprise: "enterprise";
|
|
10
20
|
}>;
|
|
11
21
|
export type PlanTier = z.infer<typeof WorkspacePackageSchema>;
|
|
12
|
-
/** The plan a Billing Cycle was opened on. `legacy_unknown` is pre-ledger history, which no plan sells. */
|
|
13
22
|
export declare const PlanSnapshotSchema: z.ZodEnum<{
|
|
14
23
|
free: "free";
|
|
15
24
|
startup: "startup";
|
|
@@ -36,11 +45,6 @@ export declare const InstructionTypeSchema: z.ZodEnum<{
|
|
|
36
45
|
do: "do";
|
|
37
46
|
}>;
|
|
38
47
|
export type InstructionType = z.infer<typeof InstructionTypeSchema>;
|
|
39
|
-
/**
|
|
40
|
-
* The workspace role vocabulary — `admin` administers, `member` does not. One spelling everywhere:
|
|
41
|
-
* DB enum, this contract, the dashboard, and the WorkOS role slug. Declared here (not `workspace.ts`)
|
|
42
|
-
* because `UserEntitySchema` needs it and `workspace.ts` already imports from this file.
|
|
43
|
-
*/
|
|
44
48
|
export declare const WorkspaceMemberRoleSchema: z.ZodEnum<{
|
|
45
49
|
admin: "admin";
|
|
46
50
|
member: "member";
|
|
@@ -164,7 +168,6 @@ export declare const ApplicationEntitySchema: z.ZodObject<{
|
|
|
164
168
|
skill_distillation_error: z.ZodNullable<z.ZodString>;
|
|
165
169
|
}, z.core.$strip>;
|
|
166
170
|
export type ApplicationData = z.infer<typeof ApplicationEntitySchema>;
|
|
167
|
-
/** Used for all API responses; password is write-only and never returned to clients. */
|
|
168
171
|
export declare const ApplicationReadSchema: z.ZodObject<{
|
|
169
172
|
id: z.ZodNumber;
|
|
170
173
|
created_at: z.ZodCoercedDate<unknown>;
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The support widget: its settings, its public boot lookup, and the SSE event/command vocabulary that
|
|
3
|
+
* drives a live chat session.
|
|
4
|
+
*
|
|
5
|
+
* Exports the widget entity and create/update schemas, `WidgetEventSchema`/`WidgetCommandSchema`, and
|
|
6
|
+
* every widget CRUD and streaming procedure. `widgetPublicSearch` is the widget's own credentialed boot
|
|
7
|
+
* call and never returns the credentials that authenticated it.
|
|
8
|
+
*/
|
|
1
9
|
import { z } from 'zod';
|
|
2
10
|
export declare const WidgetCreateSchema: z.ZodObject<{
|
|
3
11
|
status: z.ZodOptional<z.ZodEnum<{
|
|
@@ -101,7 +109,6 @@ export declare const WidgetUpdateSchema: z.ZodObject<{
|
|
|
101
109
|
}, z.core.$strip>>;
|
|
102
110
|
}, z.core.$strip>;
|
|
103
111
|
export type WidgetUpdateData = z.infer<typeof WidgetUpdateSchema>;
|
|
104
|
-
/** Server → Widget events. */
|
|
105
112
|
export declare const WidgetEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
106
113
|
type: z.ZodLiteral<"registered">;
|
|
107
114
|
chat_id: z.ZodString;
|
|
@@ -141,7 +148,6 @@ export declare const WidgetEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
141
148
|
explanation: z.ZodOptional<z.ZodString>;
|
|
142
149
|
}, z.core.$strip>], "type">;
|
|
143
150
|
export type WidgetEvent = z.infer<typeof WidgetEventSchema>;
|
|
144
|
-
/** Widget → Server commands. */
|
|
145
151
|
export declare const WidgetCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
146
152
|
type: z.ZodLiteral<"chat/tell">;
|
|
147
153
|
request_id: z.ZodString;
|