@statelyai/sdk 0.39.1 → 0.40.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.
@@ -2127,6 +2127,355 @@ interface ZodReadonly<T extends SomeType = $ZodType> extends _ZodType<$ZodReadon
2127
2127
  }
2128
2128
  declare const ZodReadonly: $constructor<ZodReadonly>;
2129
2129
  //#endregion
2130
+ //#region ../../node_modules/.pnpm/xstate@6.0.0-alpha.65/node_modules/xstate/dist/declarations/src/base.types.d.ts
2131
+ declare global {
2132
+ interface SymbolConstructor {
2133
+ readonly observable: symbol;
2134
+ }
2135
+ }
2136
+ /**
2137
+ * The full definition of an event, with a string `type`.
2138
+ *
2139
+ * @public
2140
+ */
2141
+ //#endregion
2142
+ //#region ../../node_modules/.pnpm/@types+json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts
2143
+ // ==================================================================================================
2144
+ // JSON Schema Draft 07
2145
+ // ==================================================================================================
2146
+ // https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
2147
+ // --------------------------------------------------------------------------------------------------
2148
+ /**
2149
+ * Primitive type
2150
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
2151
+ */
2152
+ type JSONSchema7TypeName = "string" //
2153
+ | "number" | "integer" | "boolean" | "object" | "array" | "null";
2154
+ /**
2155
+ * Primitive type
2156
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
2157
+ */
2158
+ type JSONSchema7Type = string //
2159
+ | number | boolean | JSONSchema7Object | JSONSchema7Array | null;
2160
+ // Workaround for infinite type recursion
2161
+ interface JSONSchema7Object {
2162
+ [key: string]: JSONSchema7Type;
2163
+ }
2164
+ // Workaround for infinite type recursion
2165
+ // https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
2166
+ interface JSONSchema7Array extends Array<JSONSchema7Type> {}
2167
+ /**
2168
+ * Meta schema
2169
+ *
2170
+ * Recommended values:
2171
+ * - 'http://json-schema.org/schema#'
2172
+ * - 'http://json-schema.org/hyper-schema#'
2173
+ * - 'http://json-schema.org/draft-07/schema#'
2174
+ * - 'http://json-schema.org/draft-07/hyper-schema#'
2175
+ *
2176
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
2177
+ */
2178
+ type JSONSchema7Version = string;
2179
+ /**
2180
+ * JSON Schema v7
2181
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
2182
+ */
2183
+ type JSONSchema7Definition = JSONSchema7 | boolean;
2184
+ interface JSONSchema7 {
2185
+ $id?: string | undefined;
2186
+ $ref?: string | undefined;
2187
+ $schema?: JSONSchema7Version | undefined;
2188
+ $comment?: string | undefined;
2189
+ /**
2190
+ * @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-8.2.4
2191
+ * @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#appendix-A
2192
+ */
2193
+ $defs?: {
2194
+ [key: string]: JSONSchema7Definition;
2195
+ } | undefined;
2196
+ /**
2197
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1
2198
+ */
2199
+ type?: JSONSchema7TypeName | JSONSchema7TypeName[] | undefined;
2200
+ enum?: JSONSchema7Type[] | undefined;
2201
+ const?: JSONSchema7Type | undefined;
2202
+ /**
2203
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.2
2204
+ */
2205
+ multipleOf?: number | undefined;
2206
+ maximum?: number | undefined;
2207
+ exclusiveMaximum?: number | undefined;
2208
+ minimum?: number | undefined;
2209
+ exclusiveMinimum?: number | undefined;
2210
+ /**
2211
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.3
2212
+ */
2213
+ maxLength?: number | undefined;
2214
+ minLength?: number | undefined;
2215
+ pattern?: string | undefined;
2216
+ /**
2217
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.4
2218
+ */
2219
+ items?: JSONSchema7Definition | JSONSchema7Definition[] | undefined;
2220
+ additionalItems?: JSONSchema7Definition | undefined;
2221
+ maxItems?: number | undefined;
2222
+ minItems?: number | undefined;
2223
+ uniqueItems?: boolean | undefined;
2224
+ contains?: JSONSchema7Definition | undefined;
2225
+ /**
2226
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.5
2227
+ */
2228
+ maxProperties?: number | undefined;
2229
+ minProperties?: number | undefined;
2230
+ required?: string[] | undefined;
2231
+ properties?: {
2232
+ [key: string]: JSONSchema7Definition;
2233
+ } | undefined;
2234
+ patternProperties?: {
2235
+ [key: string]: JSONSchema7Definition;
2236
+ } | undefined;
2237
+ additionalProperties?: JSONSchema7Definition | undefined;
2238
+ dependencies?: {
2239
+ [key: string]: JSONSchema7Definition | string[];
2240
+ } | undefined;
2241
+ propertyNames?: JSONSchema7Definition | undefined;
2242
+ /**
2243
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.6
2244
+ */
2245
+ if?: JSONSchema7Definition | undefined;
2246
+ then?: JSONSchema7Definition | undefined;
2247
+ else?: JSONSchema7Definition | undefined;
2248
+ /**
2249
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.7
2250
+ */
2251
+ allOf?: JSONSchema7Definition[] | undefined;
2252
+ anyOf?: JSONSchema7Definition[] | undefined;
2253
+ oneOf?: JSONSchema7Definition[] | undefined;
2254
+ not?: JSONSchema7Definition | undefined;
2255
+ /**
2256
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7
2257
+ */
2258
+ format?: string | undefined;
2259
+ /**
2260
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-8
2261
+ */
2262
+ contentMediaType?: string | undefined;
2263
+ contentEncoding?: string | undefined;
2264
+ /**
2265
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-9
2266
+ */
2267
+ definitions?: {
2268
+ [key: string]: JSONSchema7Definition;
2269
+ } | undefined;
2270
+ /**
2271
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-10
2272
+ */
2273
+ title?: string | undefined;
2274
+ description?: string | undefined;
2275
+ default?: JSONSchema7Type | undefined;
2276
+ readOnly?: boolean | undefined;
2277
+ writeOnly?: boolean | undefined;
2278
+ examples?: JSONSchema7Type | undefined;
2279
+ }
2280
+ //#endregion
2281
+ //#region ../graph-tools/dist/xstateSource-BI_Ntd87.d.mts
2282
+ //#endregion
2283
+ //#region src/profiles/profileRefs.d.ts
2284
+ type ProfileName = `@${string}/${string}`;
2285
+ type ProfileSpecifier = `${ProfileName}@${string}`;
2286
+ type ResolvedProfileRef = ProfileSpecifier;
2287
+ /**
2288
+ * Serialized inline expression directive.
2289
+ *
2290
+ * Code generation treats this object as JavaScript/TypeScript source, not as a
2291
+ * machine config object. It is used for fields such as invoke `input` and
2292
+ * `output` where XState accepts mapper expressions.
2293
+ */
2294
+ interface CodeExpression {
2295
+ '@type': 'code';
2296
+ lang: 'js' | 'ts';
2297
+ expr: string;
2298
+ imports?: CodeImport[];
2299
+ }
2300
+ interface CodeImport {
2301
+ package: string;
2302
+ import: string;
2303
+ /** Local binding name when it differs from the imported name. */
2304
+ local?: string;
2305
+ importKind?: 'named' | 'default' | 'namespace';
2306
+ version?: string;
2307
+ }
2308
+ /**
2309
+ * A scalar `context`/`input`/`output` literal, kept verbatim from the source
2310
+ * instead of being wrapped as a code expression.
2311
+ */
2312
+ //#endregion
2313
+ //#region src/profiles/types.d.ts
2314
+ /**
2315
+ * The profile boundary only relies on XGraph's stable structural fields. This
2316
+ * keeps profile packages independent from a particular editor's richer graph
2317
+ * types while still allowing them to own semantic projection.
2318
+ */
2319
+ type ProfileGraph = {
2320
+ data: Record<string, unknown> & {
2321
+ profile?: ProfileSpecifier;
2322
+ schemas?: Record<string, unknown> | null;
2323
+ importMetadata?: (Record<string, unknown> & {
2324
+ warnings?: string[];
2325
+ }) | null;
2326
+ };
2327
+ nodes: Array<{
2328
+ id: string;
2329
+ parentId: string | null;
2330
+ initialNodeId?: string;
2331
+ data: Record<string, unknown> & {
2332
+ key?: string;
2333
+ kind?: string;
2334
+ type?: string | null;
2335
+ initialId?: string | null;
2336
+ meta?: Record<string, unknown> | null;
2337
+ };
2338
+ }>;
2339
+ edges: Array<{
2340
+ id: string;
2341
+ sourceId: string;
2342
+ targetId: string | null;
2343
+ data: Record<string, unknown> & {
2344
+ kind?: string;
2345
+ eventType?: string;
2346
+ transitionType?: string;
2347
+ guard?: {
2348
+ type?: string;
2349
+ } | null;
2350
+ meta?: Record<string, unknown> | null;
2351
+ };
2352
+ }>;
2353
+ [key: string]: unknown;
2354
+ };
2355
+ type ProfileCompatibilityIssue = {
2356
+ level: 'info' | 'warning' | 'error';
2357
+ message: string; /** Canonical data paths that remain stored but must not be authored here. */
2358
+ readOnlyPaths?: string[];
2359
+ nodeIds?: string[];
2360
+ edgeIds?: string[];
2361
+ };
2362
+ /** Additive data written only inside the target profile namespace. */
2363
+ type ProfileDataSet = {
2364
+ graph?: Record<string, unknown>;
2365
+ nodes?: Record<string, Record<string, unknown>>;
2366
+ edges?: Record<string, Record<string, unknown>>;
2367
+ };
2368
+ type ProfileProjectionResult = {
2369
+ data?: ProfileDataSet;
2370
+ warnings?: string[];
2371
+ };
2372
+ type ProfileProjectionContext = {
2373
+ sourceProfile: ResolvedProfileRef;
2374
+ targetProfile: ResolvedProfileRef;
2375
+ };
2376
+ type ProfileProjection = {
2377
+ /** Canonical paths this profile cannot author. `*` matches one path segment. */readOnlyPaths?: readonly string[]; /** Derive additive target-namespaced data without rewriting canonical data. */
2378
+ adapt?: (graph: Readonly<ProfileGraph>, context: ProfileProjectionContext) => ProfileProjectionResult; /** Report retained canonical fields this target cannot safely author. */
2379
+ analyzeCompatibility?: (graph: ProfileGraph) => ProfileCompatibilityIssue[];
2380
+ };
2381
+ type ProfileMigration = {
2382
+ /** Exact earlier profile version in the same lineage. */from: ResolvedProfileRef; /** Adapt source-namespaced data into target-namespaced data. */
2383
+ migrate: (data: Readonly<ProfileDataSet>, context: ProfileProjectionContext) => ProfileProjectionResult;
2384
+ };
2385
+ type FormatId = string;
2386
+ type ProfileCodeLocation = {
2387
+ graph: Readonly<ProfileGraph>;
2388
+ path: readonly (string | number)[];
2389
+ parent: unknown;
2390
+ ancestors: readonly unknown[];
2391
+ };
2392
+ type ProfileCodeTarget = {
2393
+ kind: 'entity';
2394
+ id: string;
2395
+ label: string;
2396
+ } | {
2397
+ kind: 'source';
2398
+ id: string;
2399
+ label: string;
2400
+ sourceType: string;
2401
+ };
2402
+ type ProfileCodeBlock = {
2403
+ name: string;
2404
+ matches: (location: ProfileCodeLocation) => boolean;
2405
+ isValid: (code: string) => boolean;
2406
+ exportInvalid: (invalidCode: string) => string; /** Editor destination used to surface and navigate code diagnostics. */
2407
+ getTarget?: (location: ProfileCodeLocation) => ProfileCodeTarget | undefined; /** Object used by source generation to locate this block in a full document. */
2408
+ getSourceValue?: (location: ProfileCodeLocation) => object | undefined;
2409
+ };
2410
+ type ProfileFormatManifest = {
2411
+ format: FormatId;
2412
+ import?: boolean;
2413
+ export?: boolean;
2414
+ sourcePreserving?: boolean;
2415
+ warning?: string;
2416
+ };
2417
+ type ProfileEntityType = {
2418
+ kind: string;
2419
+ label: string;
2420
+ description?: string;
2421
+ authorable?: boolean;
2422
+ terminal?: boolean;
2423
+ canContain?: boolean; /** Logical, unnamespaced profile data stored canonically under the profile namespace. */
2424
+ dataSchema?: JSONSchema7;
2425
+ children?: {
2426
+ types: readonly string[];
2427
+ min?: number;
2428
+ max?: number;
2429
+ };
2430
+ };
2431
+ type ProfileValidationDefinition = {
2432
+ name: string;
2433
+ description: string;
2434
+ };
2435
+ type ProfileAuthoringManifest = {
2436
+ terminology: {
2437
+ node: string;
2438
+ edge: string;
2439
+ graph: string;
2440
+ };
2441
+ nodeTypes: readonly ProfileEntityType[];
2442
+ edgeTypes: readonly ProfileEntityType[];
2443
+ attachments?: Partial<Record<'actions' | 'guards' | 'invokes' | 'tags', boolean>>;
2444
+ supportsInitialNode?: boolean;
2445
+ supportsTargetlessEdges?: boolean;
2446
+ supportsReenterEdges?: boolean;
2447
+ };
2448
+ type ProfileManifest = {
2449
+ profile: ResolvedProfileRef;
2450
+ name: string;
2451
+ description?: string; /** Namespace for canonical profile data, for example `@mastra`. */
2452
+ namespace?: `@${string}`;
2453
+ extends?: ProfileSpecifier; /** Stable semantic family. Migrations may only run within this lineage. */
2454
+ lineage?: string;
2455
+ projection?: ProfileProjection;
2456
+ migrations?: readonly ProfileMigration[]; /** Whether the built-in editor profile picker should offer this profile. */
2457
+ selectable?: boolean;
2458
+ formats: ProfileFormatManifest[];
2459
+ defaultFormat?: FormatId;
2460
+ graph?: {
2461
+ dataSchema?: JSONSchema7;
2462
+ }; /** Profile-owned editor vocabulary. The canvas itself only assumes a graph. */
2463
+ authoring?: ProfileAuthoringManifest; /** Profile-owned authored code locations and syntax-safe export fallbacks. */
2464
+ code?: {
2465
+ blocks: readonly ProfileCodeBlock[];
2466
+ };
2467
+ operations?: Partial<Record<'simulate' | 'validate' | 'export', boolean>>;
2468
+ restrictFormatsToListed?: boolean;
2469
+ features?: Record<string, boolean | Record<string, unknown>>;
2470
+ implementations?: Partial<Record<'actions' | 'guards' | 'actors' | 'delays', {
2471
+ mode: 'allowlist' | 'any';
2472
+ items: Record<string, Record<string, unknown>>;
2473
+ }>>;
2474
+ rules?: Array<Record<string, unknown>>;
2475
+ validation?: ProfileValidationDefinition[];
2476
+ editorDefaults?: Record<string, unknown>;
2477
+ };
2478
+ //#endregion
2130
2479
  //#region ../graph-tools/dist/patchSchema.d.mts
2131
2480
  declare const canvasColorSchema: ZodEnum<{
2132
2481
  green: "green";
@@ -2394,517 +2743,161 @@ declare const graphPatchSchema: ZodDiscriminatedUnion<[ZodObject<{
2394
2743
  edgeId: ZodString;
2395
2744
  group: ZodLiteral<"transition">;
2396
2745
  }, $strip>]>;
2397
- actionId: ZodString;
2398
- data: ZodObject<{
2399
- type: ZodOptional<ZodString>;
2400
- params: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
2401
- }, $strip>;
2402
- }, $strip>, ZodObject<{
2403
- op: ZodLiteral<"deleteAction">;
2404
- description: ZodOptional<ZodString>;
2405
- location: ZodUnion<readonly [ZodObject<{
2406
- nodeId: ZodString;
2407
- group: ZodEnum<{
2408
- entry: "entry";
2409
- exit: "exit";
2410
- }>;
2411
- }, $strip>, ZodObject<{
2412
- edgeId: ZodString;
2413
- group: ZodLiteral<"transition">;
2414
- }, $strip>]>;
2415
- actionId: ZodString;
2416
- }, $strip>, ZodObject<{
2417
- op: ZodLiteral<"createInvoke">;
2418
- description: ZodOptional<ZodString>;
2419
- nodeId: ZodString;
2420
- invoke: ZodObject<{
2421
- id: ZodOptional<ZodString>;
2422
- invocationId: ZodOptional<ZodString>;
2423
- src: ZodString;
2424
- srcExpression: ZodOptional<ZodUnknown>;
2425
- code: ZodOptional<ZodString>;
2426
- registryKey: ZodOptional<ZodString>;
2427
- timeout: ZodOptional<ZodUnknown>;
2428
- input: ZodOptional<ZodUnknown>;
2429
- output: ZodOptional<ZodUnknown>;
2430
- }, $strip>;
2431
- }, $strip>, ZodObject<{
2432
- op: ZodLiteral<"updateInvoke">;
2433
- description: ZodOptional<ZodString>;
2434
- nodeId: ZodString;
2435
- invokeId: ZodString;
2436
- data: ZodObject<{
2437
- invocationId: ZodOptional<ZodNullable<ZodString>>;
2438
- src: ZodOptional<ZodString>;
2439
- srcExpression: ZodOptional<ZodUnknown>;
2440
- code: ZodOptional<ZodNullable<ZodString>>;
2441
- registryKey: ZodOptional<ZodNullable<ZodString>>;
2442
- timeout: ZodOptional<ZodUnknown>;
2443
- input: ZodOptional<ZodUnknown>;
2444
- output: ZodOptional<ZodUnknown>;
2445
- }, $strip>;
2446
- }, $strip>, ZodObject<{
2447
- op: ZodLiteral<"deleteInvoke">;
2448
- description: ZodOptional<ZodString>;
2449
- nodeId: ZodString;
2450
- invokeId: ZodString;
2451
- }, $strip>, ZodObject<{
2452
- op: ZodLiteral<"createImplementation">;
2453
- description: ZodOptional<ZodString>;
2454
- sourceType: ZodEnum<{
2455
- action: "action";
2456
- guard: "guard";
2457
- actor: "actor";
2458
- delay: "delay";
2459
- }>;
2460
- implementation: ZodObject<{
2461
- id: ZodString;
2462
- name: ZodOptional<ZodString>;
2463
- code: ZodOptional<ZodString>;
2464
- }, $strip>;
2465
- }, $strip>, ZodObject<{
2466
- op: ZodLiteral<"updateImplementation">;
2467
- description: ZodOptional<ZodString>;
2468
- sourceType: ZodEnum<{
2469
- action: "action";
2470
- guard: "guard";
2471
- actor: "actor";
2472
- delay: "delay";
2473
- }>;
2474
- implementationId: ZodString;
2475
- data: ZodObject<{
2476
- name: ZodOptional<ZodString>;
2477
- code: ZodOptional<ZodNullable<ZodString>>;
2478
- }, $strip>;
2479
- }, $strip>, ZodObject<{
2480
- op: ZodLiteral<"deleteImplementation">;
2481
- description: ZodOptional<ZodString>;
2482
- sourceType: ZodEnum<{
2483
- action: "action";
2484
- guard: "guard";
2485
- actor: "actor";
2486
- delay: "delay";
2487
- }>;
2488
- implementationId: ZodString;
2489
- }, $strip>, ZodObject<{
2490
- op: ZodLiteral<"setGuard">;
2491
- description: ZodOptional<ZodString>;
2492
- edgeId: ZodString;
2493
- guard: ZodObject<{
2494
- type: ZodString;
2495
- code: ZodOptional<ZodString>;
2496
- params: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
2497
- }, $strip>;
2498
- }, $strip>, ZodObject<{
2499
- op: ZodLiteral<"deleteGuard">;
2500
- description: ZodOptional<ZodString>;
2501
- edgeId: ZodString;
2502
- }, $strip>, ZodObject<{
2503
- op: ZodLiteral<"createTag">;
2504
- description: ZodOptional<ZodString>;
2505
- nodeId: ZodString;
2506
- tag: ZodObject<{
2507
- name: ZodString;
2508
- }, $strip>;
2509
- }, $strip>, ZodObject<{
2510
- op: ZodLiteral<"deleteTag">;
2511
- description: ZodOptional<ZodString>;
2512
- nodeId: ZodString;
2513
- tagName: ZodString;
2514
- }, $strip>, ZodObject<{
2515
- op: ZodLiteral<"createAnnotation">;
2516
- description: ZodOptional<ZodString>;
2517
- id: ZodOptional<ZodString>;
2518
- parentId: ZodNullable<ZodString>;
2519
- content: ZodString;
2520
- x: ZodOptional<ZodNumber>;
2521
- y: ZodOptional<ZodNumber>;
2522
- }, $strip>, ZodObject<{
2523
- op: ZodLiteral<"updateAnnotation">;
2524
- description: ZodOptional<ZodString>;
2525
- annotationId: ZodString;
2526
- data: ZodObject<{
2527
- content: ZodOptional<ZodString>;
2528
- }, $strip>;
2529
- }, $strip>, ZodObject<{
2530
- op: ZodLiteral<"deleteAnnotation">;
2531
- description: ZodOptional<ZodString>;
2532
- annotationId: ZodString;
2533
- }, $strip>, ZodObject<{
2534
- op: ZodLiteral<"setProfile">;
2535
- description: ZodOptional<ZodString>;
2536
- profile: ZodString;
2746
+ actionId: ZodString;
2747
+ data: ZodObject<{
2748
+ type: ZodOptional<ZodString>;
2749
+ params: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
2750
+ }, $strip>;
2537
2751
  }, $strip>, ZodObject<{
2538
- op: ZodLiteral<"setContext">;
2752
+ op: ZodLiteral<"deleteAction">;
2539
2753
  description: ZodOptional<ZodString>;
2540
- context: ZodNullable<ZodRecord<ZodString, ZodUnknown>>;
2754
+ location: ZodUnion<readonly [ZodObject<{
2755
+ nodeId: ZodString;
2756
+ group: ZodEnum<{
2757
+ entry: "entry";
2758
+ exit: "exit";
2759
+ }>;
2760
+ }, $strip>, ZodObject<{
2761
+ edgeId: ZodString;
2762
+ group: ZodLiteral<"transition">;
2763
+ }, $strip>]>;
2764
+ actionId: ZodString;
2541
2765
  }, $strip>, ZodObject<{
2542
- op: ZodLiteral<"updateSchemas">;
2766
+ op: ZodLiteral<"createInvoke">;
2543
2767
  description: ZodOptional<ZodString>;
2544
- schemas: ZodObject<{
2545
- context: ZodOptional<ZodNullable<ZodRecord<ZodString, ZodUnknown>>>;
2546
- events: ZodOptional<ZodNullable<ZodRecord<ZodString, ZodUnknown>>>;
2547
- input: ZodOptional<ZodNullable<ZodUnknown>>;
2548
- output: ZodOptional<ZodNullable<ZodUnknown>>;
2768
+ nodeId: ZodString;
2769
+ invoke: ZodObject<{
2770
+ id: ZodOptional<ZodString>;
2771
+ invocationId: ZodOptional<ZodString>;
2772
+ src: ZodString;
2773
+ srcExpression: ZodOptional<ZodUnknown>;
2774
+ code: ZodOptional<ZodString>;
2775
+ registryKey: ZodOptional<ZodString>;
2776
+ timeout: ZodOptional<ZodUnknown>;
2777
+ input: ZodOptional<ZodUnknown>;
2778
+ output: ZodOptional<ZodUnknown>;
2549
2779
  }, $strip>;
2550
- }, $strip>], "op">;
2551
- type GraphPatch = output<typeof graphPatchSchema>;
2552
- /** AI-only schema: semantic ops + shared ops (no generic graph ops) */
2553
- //#endregion
2554
- //#region ../../node_modules/.pnpm/xstate@5.32.1/node_modules/xstate/dist/declarations/src/index.d.ts
2555
- declare global {
2556
- interface SymbolConstructor {
2557
- readonly observable: symbol;
2558
- }
2559
- }
2560
- //#endregion
2561
- //#region ../../node_modules/.pnpm/xstate@6.0.0-alpha.65/node_modules/xstate/dist/declarations/src/base.types.d.ts
2562
- declare global {
2563
- interface SymbolConstructor {
2564
- readonly observable: symbol;
2565
- }
2566
- }
2567
- /**
2568
- * The full definition of an event, with a string `type`.
2569
- *
2570
- * @public
2571
- */
2572
- //#endregion
2573
- //#region ../../node_modules/.pnpm/@types+json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts
2574
- // ==================================================================================================
2575
- // JSON Schema Draft 07
2576
- // ==================================================================================================
2577
- // https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
2578
- // --------------------------------------------------------------------------------------------------
2579
- /**
2580
- * Primitive type
2581
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
2582
- */
2583
- type JSONSchema7TypeName = "string" //
2584
- | "number" | "integer" | "boolean" | "object" | "array" | "null";
2585
- /**
2586
- * Primitive type
2587
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
2588
- */
2589
- type JSONSchema7Type = string //
2590
- | number | boolean | JSONSchema7Object | JSONSchema7Array | null;
2591
- // Workaround for infinite type recursion
2592
- interface JSONSchema7Object {
2593
- [key: string]: JSONSchema7Type;
2594
- }
2595
- // Workaround for infinite type recursion
2596
- // https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
2597
- interface JSONSchema7Array extends Array<JSONSchema7Type> {}
2598
- /**
2599
- * Meta schema
2600
- *
2601
- * Recommended values:
2602
- * - 'http://json-schema.org/schema#'
2603
- * - 'http://json-schema.org/hyper-schema#'
2604
- * - 'http://json-schema.org/draft-07/schema#'
2605
- * - 'http://json-schema.org/draft-07/hyper-schema#'
2606
- *
2607
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
2608
- */
2609
- type JSONSchema7Version = string;
2610
- /**
2611
- * JSON Schema v7
2612
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
2613
- */
2614
- type JSONSchema7Definition = JSONSchema7 | boolean;
2615
- interface JSONSchema7 {
2616
- $id?: string | undefined;
2617
- $ref?: string | undefined;
2618
- $schema?: JSONSchema7Version | undefined;
2619
- $comment?: string | undefined;
2620
- /**
2621
- * @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-8.2.4
2622
- * @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#appendix-A
2623
- */
2624
- $defs?: {
2625
- [key: string]: JSONSchema7Definition;
2626
- } | undefined;
2627
- /**
2628
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1
2629
- */
2630
- type?: JSONSchema7TypeName | JSONSchema7TypeName[] | undefined;
2631
- enum?: JSONSchema7Type[] | undefined;
2632
- const?: JSONSchema7Type | undefined;
2633
- /**
2634
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.2
2635
- */
2636
- multipleOf?: number | undefined;
2637
- maximum?: number | undefined;
2638
- exclusiveMaximum?: number | undefined;
2639
- minimum?: number | undefined;
2640
- exclusiveMinimum?: number | undefined;
2641
- /**
2642
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.3
2643
- */
2644
- maxLength?: number | undefined;
2645
- minLength?: number | undefined;
2646
- pattern?: string | undefined;
2647
- /**
2648
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.4
2649
- */
2650
- items?: JSONSchema7Definition | JSONSchema7Definition[] | undefined;
2651
- additionalItems?: JSONSchema7Definition | undefined;
2652
- maxItems?: number | undefined;
2653
- minItems?: number | undefined;
2654
- uniqueItems?: boolean | undefined;
2655
- contains?: JSONSchema7Definition | undefined;
2656
- /**
2657
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.5
2658
- */
2659
- maxProperties?: number | undefined;
2660
- minProperties?: number | undefined;
2661
- required?: string[] | undefined;
2662
- properties?: {
2663
- [key: string]: JSONSchema7Definition;
2664
- } | undefined;
2665
- patternProperties?: {
2666
- [key: string]: JSONSchema7Definition;
2667
- } | undefined;
2668
- additionalProperties?: JSONSchema7Definition | undefined;
2669
- dependencies?: {
2670
- [key: string]: JSONSchema7Definition | string[];
2671
- } | undefined;
2672
- propertyNames?: JSONSchema7Definition | undefined;
2673
- /**
2674
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.6
2675
- */
2676
- if?: JSONSchema7Definition | undefined;
2677
- then?: JSONSchema7Definition | undefined;
2678
- else?: JSONSchema7Definition | undefined;
2679
- /**
2680
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.7
2681
- */
2682
- allOf?: JSONSchema7Definition[] | undefined;
2683
- anyOf?: JSONSchema7Definition[] | undefined;
2684
- oneOf?: JSONSchema7Definition[] | undefined;
2685
- not?: JSONSchema7Definition | undefined;
2686
- /**
2687
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7
2688
- */
2689
- format?: string | undefined;
2690
- /**
2691
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-8
2692
- */
2693
- contentMediaType?: string | undefined;
2694
- contentEncoding?: string | undefined;
2695
- /**
2696
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-9
2697
- */
2698
- definitions?: {
2699
- [key: string]: JSONSchema7Definition;
2700
- } | undefined;
2701
- /**
2702
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-10
2703
- */
2704
- title?: string | undefined;
2705
- description?: string | undefined;
2706
- default?: JSONSchema7Type | undefined;
2707
- readOnly?: boolean | undefined;
2708
- writeOnly?: boolean | undefined;
2709
- examples?: JSONSchema7Type | undefined;
2710
- }
2711
- //#endregion
2712
- //#region ../graph-tools/dist/index.d.mts
2713
- //#endregion
2714
- //#region src/profiles/profileRefs.d.ts
2715
- type ProfileName = `@${string}/${string}`;
2716
- type ProfileSpecifier = `${ProfileName}@${string}`;
2717
- type ResolvedProfileRef = ProfileSpecifier;
2718
- /**
2719
- * Serialized inline expression directive.
2720
- *
2721
- * Code generation treats this object as JavaScript/TypeScript source, not as a
2722
- * machine config object. It is used for fields such as invoke `input` and
2723
- * `output` where XState accepts mapper expressions.
2724
- */
2725
- interface CodeExpression {
2726
- '@type': 'code';
2727
- lang: 'js' | 'ts';
2728
- expr: string;
2729
- imports?: CodeImport[];
2730
- }
2731
- interface CodeImport {
2732
- package: string;
2733
- import: string;
2734
- /** Local binding name when it differs from the imported name. */
2735
- local?: string;
2736
- importKind?: 'named' | 'default' | 'namespace';
2737
- version?: string;
2738
- }
2739
- /**
2740
- * A scalar `context`/`input`/`output` literal, kept verbatim from the source
2741
- * instead of being wrapped as a code expression.
2742
- */
2743
- //#endregion
2744
- //#region src/profiles/types.d.ts
2745
- /**
2746
- * The profile boundary only relies on XGraph's stable structural fields. This
2747
- * keeps profile packages independent from a particular editor's richer graph
2748
- * types while still allowing them to own semantic projection.
2749
- */
2750
- type ProfileGraph = {
2751
- data: Record<string, unknown> & {
2752
- profile?: ProfileSpecifier;
2753
- schemas?: Record<string, unknown> | null;
2754
- importMetadata?: (Record<string, unknown> & {
2755
- warnings?: string[];
2756
- }) | null;
2757
- };
2758
- nodes: Array<{
2759
- id: string;
2760
- parentId: string | null;
2761
- initialNodeId?: string;
2762
- data: Record<string, unknown> & {
2763
- key?: string;
2764
- kind?: string;
2765
- type?: string | null;
2766
- initialId?: string | null;
2767
- meta?: Record<string, unknown> | null;
2768
- };
2780
+ }, $strip>, ZodObject<{
2781
+ op: ZodLiteral<"updateInvoke">;
2782
+ description: ZodOptional<ZodString>;
2783
+ nodeId: ZodString;
2784
+ invokeId: ZodString;
2785
+ data: ZodObject<{
2786
+ invocationId: ZodOptional<ZodNullable<ZodString>>;
2787
+ src: ZodOptional<ZodString>;
2788
+ srcExpression: ZodOptional<ZodUnknown>;
2789
+ code: ZodOptional<ZodNullable<ZodString>>;
2790
+ registryKey: ZodOptional<ZodNullable<ZodString>>;
2791
+ timeout: ZodOptional<ZodUnknown>;
2792
+ input: ZodOptional<ZodUnknown>;
2793
+ output: ZodOptional<ZodUnknown>;
2794
+ }, $strip>;
2795
+ }, $strip>, ZodObject<{
2796
+ op: ZodLiteral<"deleteInvoke">;
2797
+ description: ZodOptional<ZodString>;
2798
+ nodeId: ZodString;
2799
+ invokeId: ZodString;
2800
+ }, $strip>, ZodObject<{
2801
+ op: ZodLiteral<"createImplementation">;
2802
+ description: ZodOptional<ZodString>;
2803
+ sourceType: ZodEnum<{
2804
+ action: "action";
2805
+ guard: "guard";
2806
+ actor: "actor";
2807
+ delay: "delay";
2769
2808
  }>;
2770
- edges: Array<{
2771
- id: string;
2772
- sourceId: string;
2773
- targetId: string | null;
2774
- data: Record<string, unknown> & {
2775
- kind?: string;
2776
- eventType?: string;
2777
- transitionType?: string;
2778
- guard?: {
2779
- type?: string;
2780
- } | null;
2781
- meta?: Record<string, unknown> | null;
2782
- };
2809
+ implementation: ZodObject<{
2810
+ id: ZodString;
2811
+ name: ZodOptional<ZodString>;
2812
+ code: ZodOptional<ZodString>;
2813
+ }, $strip>;
2814
+ }, $strip>, ZodObject<{
2815
+ op: ZodLiteral<"updateImplementation">;
2816
+ description: ZodOptional<ZodString>;
2817
+ sourceType: ZodEnum<{
2818
+ action: "action";
2819
+ guard: "guard";
2820
+ actor: "actor";
2821
+ delay: "delay";
2783
2822
  }>;
2784
- [key: string]: unknown;
2785
- };
2786
- type ProfileCompatibilityIssue = {
2787
- level: 'info' | 'warning' | 'error';
2788
- message: string; /** Canonical data paths that remain stored but must not be authored here. */
2789
- readOnlyPaths?: string[];
2790
- nodeIds?: string[];
2791
- edgeIds?: string[];
2792
- };
2793
- /** Additive data written only inside the target profile namespace. */
2794
- type ProfileDataSet = {
2795
- graph?: Record<string, unknown>;
2796
- nodes?: Record<string, Record<string, unknown>>;
2797
- edges?: Record<string, Record<string, unknown>>;
2798
- };
2799
- type ProfileProjectionResult = {
2800
- data?: ProfileDataSet;
2801
- warnings?: string[];
2802
- };
2803
- type ProfileProjectionContext = {
2804
- sourceProfile: ResolvedProfileRef;
2805
- targetProfile: ResolvedProfileRef;
2806
- };
2807
- type ProfileProjection = {
2808
- /** Canonical paths this profile cannot author. `*` matches one path segment. */readOnlyPaths?: readonly string[]; /** Derive additive target-namespaced data without rewriting canonical data. */
2809
- adapt?: (graph: Readonly<ProfileGraph>, context: ProfileProjectionContext) => ProfileProjectionResult; /** Report retained canonical fields this target cannot safely author. */
2810
- analyzeCompatibility?: (graph: ProfileGraph) => ProfileCompatibilityIssue[];
2811
- };
2812
- type ProfileMigration = {
2813
- /** Exact earlier profile version in the same lineage. */from: ResolvedProfileRef; /** Adapt source-namespaced data into target-namespaced data. */
2814
- migrate: (data: Readonly<ProfileDataSet>, context: ProfileProjectionContext) => ProfileProjectionResult;
2815
- };
2816
- type FormatId = string;
2817
- type ProfileCodeLocation = {
2818
- graph: Readonly<ProfileGraph>;
2819
- path: readonly (string | number)[];
2820
- parent: unknown;
2821
- ancestors: readonly unknown[];
2822
- };
2823
- type ProfileCodeTarget = {
2824
- kind: 'entity';
2825
- id: string;
2826
- label: string;
2827
- } | {
2828
- kind: 'source';
2829
- id: string;
2830
- label: string;
2831
- sourceType: string;
2832
- };
2833
- type ProfileCodeBlock = {
2834
- name: string;
2835
- matches: (location: ProfileCodeLocation) => boolean;
2836
- isValid: (code: string) => boolean;
2837
- exportInvalid: (invalidCode: string) => string; /** Editor destination used to surface and navigate code diagnostics. */
2838
- getTarget?: (location: ProfileCodeLocation) => ProfileCodeTarget | undefined; /** Object used by source generation to locate this block in a full document. */
2839
- getSourceValue?: (location: ProfileCodeLocation) => object | undefined;
2840
- };
2841
- type ProfileFormatManifest = {
2842
- format: FormatId;
2843
- import?: boolean;
2844
- export?: boolean;
2845
- sourcePreserving?: boolean;
2846
- warning?: string;
2847
- };
2848
- type ProfileEntityType = {
2849
- kind: string;
2850
- label: string;
2851
- description?: string;
2852
- authorable?: boolean;
2853
- terminal?: boolean;
2854
- canContain?: boolean; /** Logical, unnamespaced profile data stored canonically under the profile namespace. */
2855
- dataSchema?: JSONSchema7;
2856
- children?: {
2857
- types: readonly string[];
2858
- min?: number;
2859
- max?: number;
2860
- };
2861
- };
2862
- type ProfileValidationDefinition = {
2863
- name: string;
2864
- description: string;
2865
- };
2866
- type ProfileAuthoringManifest = {
2867
- terminology: {
2868
- node: string;
2869
- edge: string;
2870
- graph: string;
2871
- };
2872
- nodeTypes: readonly ProfileEntityType[];
2873
- edgeTypes: readonly ProfileEntityType[];
2874
- attachments?: Partial<Record<'actions' | 'guards' | 'invokes' | 'tags', boolean>>;
2875
- supportsInitialNode?: boolean;
2876
- supportsTargetlessEdges?: boolean;
2877
- supportsReenterEdges?: boolean;
2878
- };
2879
- type ProfileManifest = {
2880
- profile: ResolvedProfileRef;
2881
- name: string;
2882
- description?: string; /** Namespace for canonical profile data, for example `@mastra`. */
2883
- namespace?: `@${string}`;
2884
- extends?: ProfileSpecifier; /** Stable semantic family. Migrations may only run within this lineage. */
2885
- lineage?: string;
2886
- projection?: ProfileProjection;
2887
- migrations?: readonly ProfileMigration[]; /** Whether the built-in editor profile picker should offer this profile. */
2888
- selectable?: boolean;
2889
- formats: ProfileFormatManifest[];
2890
- defaultFormat?: FormatId;
2891
- graph?: {
2892
- dataSchema?: JSONSchema7;
2893
- }; /** Profile-owned editor vocabulary. The canvas itself only assumes a graph. */
2894
- authoring?: ProfileAuthoringManifest; /** Profile-owned authored code locations and syntax-safe export fallbacks. */
2895
- code?: {
2896
- blocks: readonly ProfileCodeBlock[];
2897
- };
2898
- operations?: Partial<Record<'simulate' | 'validate' | 'export', boolean>>;
2899
- restrictFormatsToListed?: boolean;
2900
- features?: Record<string, boolean | Record<string, unknown>>;
2901
- implementations?: Partial<Record<'actions' | 'guards' | 'actors' | 'delays', {
2902
- mode: 'allowlist' | 'any';
2903
- items: Record<string, Record<string, unknown>>;
2904
- }>>;
2905
- rules?: Array<Record<string, unknown>>;
2906
- validation?: ProfileValidationDefinition[];
2907
- editorDefaults?: Record<string, unknown>;
2908
- };
2823
+ implementationId: ZodString;
2824
+ data: ZodObject<{
2825
+ name: ZodOptional<ZodString>;
2826
+ code: ZodOptional<ZodNullable<ZodString>>;
2827
+ }, $strip>;
2828
+ }, $strip>, ZodObject<{
2829
+ op: ZodLiteral<"deleteImplementation">;
2830
+ description: ZodOptional<ZodString>;
2831
+ sourceType: ZodEnum<{
2832
+ action: "action";
2833
+ guard: "guard";
2834
+ actor: "actor";
2835
+ delay: "delay";
2836
+ }>;
2837
+ implementationId: ZodString;
2838
+ }, $strip>, ZodObject<{
2839
+ op: ZodLiteral<"setGuard">;
2840
+ description: ZodOptional<ZodString>;
2841
+ edgeId: ZodString;
2842
+ guard: ZodObject<{
2843
+ type: ZodString;
2844
+ code: ZodOptional<ZodString>;
2845
+ params: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
2846
+ }, $strip>;
2847
+ }, $strip>, ZodObject<{
2848
+ op: ZodLiteral<"deleteGuard">;
2849
+ description: ZodOptional<ZodString>;
2850
+ edgeId: ZodString;
2851
+ }, $strip>, ZodObject<{
2852
+ op: ZodLiteral<"createTag">;
2853
+ description: ZodOptional<ZodString>;
2854
+ nodeId: ZodString;
2855
+ tag: ZodObject<{
2856
+ name: ZodString;
2857
+ }, $strip>;
2858
+ }, $strip>, ZodObject<{
2859
+ op: ZodLiteral<"deleteTag">;
2860
+ description: ZodOptional<ZodString>;
2861
+ nodeId: ZodString;
2862
+ tagName: ZodString;
2863
+ }, $strip>, ZodObject<{
2864
+ op: ZodLiteral<"createAnnotation">;
2865
+ description: ZodOptional<ZodString>;
2866
+ id: ZodOptional<ZodString>;
2867
+ parentId: ZodNullable<ZodString>;
2868
+ content: ZodString;
2869
+ x: ZodOptional<ZodNumber>;
2870
+ y: ZodOptional<ZodNumber>;
2871
+ }, $strip>, ZodObject<{
2872
+ op: ZodLiteral<"updateAnnotation">;
2873
+ description: ZodOptional<ZodString>;
2874
+ annotationId: ZodString;
2875
+ data: ZodObject<{
2876
+ content: ZodOptional<ZodString>;
2877
+ }, $strip>;
2878
+ }, $strip>, ZodObject<{
2879
+ op: ZodLiteral<"deleteAnnotation">;
2880
+ description: ZodOptional<ZodString>;
2881
+ annotationId: ZodString;
2882
+ }, $strip>, ZodObject<{
2883
+ op: ZodLiteral<"setProfile">;
2884
+ description: ZodOptional<ZodString>;
2885
+ profile: ZodString;
2886
+ }, $strip>, ZodObject<{
2887
+ op: ZodLiteral<"setContext">;
2888
+ description: ZodOptional<ZodString>;
2889
+ context: ZodNullable<ZodRecord<ZodString, ZodUnknown>>;
2890
+ }, $strip>, ZodObject<{
2891
+ op: ZodLiteral<"updateSchemas">;
2892
+ description: ZodOptional<ZodString>;
2893
+ schemas: ZodObject<{
2894
+ context: ZodOptional<ZodNullable<ZodRecord<ZodString, ZodUnknown>>>;
2895
+ events: ZodOptional<ZodNullable<ZodRecord<ZodString, ZodUnknown>>>;
2896
+ input: ZodOptional<ZodNullable<ZodUnknown>>;
2897
+ output: ZodOptional<ZodNullable<ZodUnknown>>;
2898
+ }, $strip>;
2899
+ }, $strip>], "op">;
2900
+ type GraphPatch = output<typeof graphPatchSchema>;
2901
+ /** AI-only schema: semantic ops + shared ops (no generic graph ops) */
2909
2902
  //#endregion
2910
- export { $strip as S, ZodString as _, EditorStateType as a, output as b, ZodArray as c, ZodLiteral as d, ZodNullable as f, ZodRecord as g, ZodOptional as h, CanvasColor as i, ZodBoolean as l, ZodObject as m, ProfileManifest as n, GraphPatch as o, ZodNumber as p, ActionLocation as r, ImplementationSourceType as s, CodeExpression as t, ZodEnum as u, ZodUnion as v, $loose as x, ZodUnknown as y };
2903
+ export { $strip as S, ZodString as _, ImplementationSourceType as a, output as b, ZodArray as c, ZodLiteral as d, ZodNullable as f, ZodRecord as g, ZodOptional as h, GraphPatch as i, ZodBoolean as l, ZodObject as m, CanvasColor as n, CodeExpression as o, ZodNumber as p, EditorStateType as r, ProfileManifest as s, ActionLocation as t, ZodEnum as u, ZodUnion as v, $loose as x, ZodUnknown as y };