foldkit 0.156.0 → 0.157.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.
- package/README.md +3 -3
- package/dist/asyncData/asyncData.d.ts +7 -7
- package/dist/asyncData/asyncData.d.ts.map +1 -1
- package/dist/asyncData/asyncData.js +12 -12
- package/dist/calendar/calendarDate.d.ts +15 -15
- package/dist/calendar/calendarDate.d.ts.map +1 -1
- package/dist/calendar/calendarDate.js +14 -14
- package/dist/calendar/comparison.d.ts +2 -2
- package/dist/calendar/comparison.d.ts.map +1 -1
- package/dist/calendar/comparison.js +5 -5
- package/dist/calendar/info.d.ts +2 -2
- package/dist/calendar/info.d.ts.map +1 -1
- package/dist/calendar/info.js +2 -2
- package/dist/calendar/locale.d.ts +7 -7
- package/dist/calendar/locale.d.ts.map +1 -1
- package/dist/calendar/locale.js +23 -23
- package/dist/canvas/shape.d.ts +89 -89
- package/dist/canvas/shape.d.ts.map +1 -1
- package/dist/canvas/shape.js +65 -53
- package/dist/command/index.d.ts +3 -3
- package/dist/customElement/index.d.ts +2 -2
- package/dist/customElement/index.js +2 -2
- package/dist/devTools/protocol.d.ts +278 -278
- package/dist/devTools/protocol.d.ts.map +1 -1
- package/dist/devTools/protocol.js +98 -92
- package/dist/devTools/schemaSummarize.d.ts.map +1 -1
- package/dist/devTools/schemaSummarize.js +24 -24
- package/dist/devTools/serialize.d.ts +1 -1
- package/dist/devTools/serialize.d.ts.map +1 -1
- package/dist/devTools/serialize.js +10 -10
- package/dist/devTools/store.d.ts.map +1 -1
- package/dist/devTools/store.js +52 -28
- package/dist/devTools/submodelPath.d.ts.map +1 -1
- package/dist/devTools/submodelPath.js +3 -3
- package/dist/devTools/summarize.d.ts +6 -6
- package/dist/devTools/summarize.d.ts.map +1 -1
- package/dist/devTools/summarize.js +13 -13
- package/dist/devTools/webSocketBridge.d.ts +3 -3
- package/dist/devTools/webSocketBridge.d.ts.map +1 -1
- package/dist/devTools/webSocketBridge.js +8 -8
- package/dist/dom/dom.d.ts +2 -0
- package/dist/dom/dom.d.ts.map +1 -1
- package/dist/dom/dom.js +47 -13
- package/dist/experimental/machine/machine.d.ts +29 -6
- package/dist/experimental/machine/machine.d.ts.map +1 -1
- package/dist/experimental/machine/machine.js +9 -8
- package/dist/experimental/server/entry.js +2 -2
- package/dist/experimental/server/serialize.js +2 -2
- package/dist/experimental/server/server.js +4 -4
- package/dist/fieldValidation/fieldValidation.d.ts +12 -12
- package/dist/fieldValidation/fieldValidation.d.ts.map +1 -1
- package/dist/fieldValidation/fieldValidation.js +9 -9
- package/dist/fieldValidation/rule.d.ts +2 -2
- package/dist/fieldValidation/rule.d.ts.map +1 -1
- package/dist/fieldValidation/rule.js +6 -6
- package/dist/file/file.d.ts +3 -3
- package/dist/file/file.d.ts.map +1 -1
- package/dist/file/file.js +3 -3
- package/dist/html/boundary.d.ts +93 -36
- package/dist/html/boundary.d.ts.map +1 -1
- package/dist/html/boundary.js +242 -75
- package/dist/html/childAttribute.d.ts +6 -4
- package/dist/html/childAttribute.d.ts.map +1 -1
- package/dist/html/childAttribute.js +7 -1
- package/dist/html/index.d.ts +31 -16
- package/dist/html/index.d.ts.map +1 -1
- package/dist/html/index.js +97 -40
- package/dist/html/lazy.d.ts +6 -6
- package/dist/html/lazy.d.ts.map +1 -1
- package/dist/html/lazy.js +37 -15
- package/dist/html/public.d.ts +1 -1
- package/dist/html/public.d.ts.map +1 -1
- package/dist/html/runtimeSingleton.d.ts +27 -6
- package/dist/html/runtimeSingleton.d.ts.map +1 -1
- package/dist/html/runtimeSingleton.js +46 -29
- package/dist/html/submodel.d.ts.map +1 -1
- package/dist/html/submodel.js +28 -39
- package/dist/http/http.d.ts +1 -1
- package/dist/http/http.js +1 -1
- package/dist/managedResource/managedResource.d.ts +5 -5
- package/dist/managedResource/managedResource.js +3 -3
- package/dist/mount/index.d.ts +92 -39
- package/dist/mount/index.d.ts.map +1 -1
- package/dist/mount/index.js +28 -8
- package/dist/mount/public.d.ts +1 -1
- package/dist/mount/public.d.ts.map +1 -1
- package/dist/mount/public.js +1 -1
- package/dist/navigation/urlRequest.d.ts +9 -9
- package/dist/navigation/urlRequest.d.ts.map +1 -1
- package/dist/navigation/urlRequest.js +2 -2
- package/dist/onUnmountModule.d.ts +19 -0
- package/dist/onUnmountModule.d.ts.map +1 -0
- package/dist/onUnmountModule.js +80 -0
- package/dist/port/port.d.ts +5 -5
- package/dist/port/port.js +5 -5
- package/dist/route/parser.d.ts +2 -2
- package/dist/route/parser.js +2 -2
- package/dist/runtime/hmrProtocol.d.ts +10 -10
- package/dist/runtime/hmrProtocol.d.ts.map +1 -1
- package/dist/runtime/hmrProtocol.js +10 -10
- package/dist/runtime/runtime.d.ts +4 -4
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +168 -51
- package/dist/schema/index.d.ts +41 -29
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +9 -9
- package/dist/snabbdom/init.d.ts +1 -1
- package/dist/snabbdom/init.d.ts.map +1 -1
- package/dist/snabbdom/init.js +5 -1
- package/dist/snabbdom/vnode.d.ts +1 -0
- package/dist/snabbdom/vnode.d.ts.map +1 -1
- package/dist/snabbdom/vnode.js +1 -0
- package/dist/subscription/animationFrame.d.ts +3 -3
- package/dist/subscription/animationFrame.d.ts.map +1 -1
- package/dist/subscription/animationFrame.js +2 -2
- package/dist/subscription/fromEvent.d.ts +2 -2
- package/dist/subscription/fromEvent.js +2 -2
- package/dist/subscription/subscription.d.ts +3 -3
- package/dist/subscription/subscription.js +1 -1
- package/dist/test/apps/bubbling.d.ts +6 -6
- package/dist/test/apps/bubbling.d.ts.map +1 -1
- package/dist/test/apps/bubbling.js +6 -6
- package/dist/test/apps/colorPicker.d.ts +7 -7
- package/dist/test/apps/colorPicker.d.ts.map +1 -1
- package/dist/test/apps/colorPicker.js +5 -5
- package/dist/test/apps/contextMenu.d.ts +5 -5
- package/dist/test/apps/contextMenu.d.ts.map +1 -1
- package/dist/test/apps/contextMenu.js +4 -4
- package/dist/test/apps/counter.d.ts +8 -8
- package/dist/test/apps/counter.d.ts.map +1 -1
- package/dist/test/apps/counter.js +8 -8
- package/dist/test/apps/crashOnRender.d.ts +18 -18
- package/dist/test/apps/crashOnRender.d.ts.map +1 -1
- package/dist/test/apps/crashOnRender.js +11 -11
- package/dist/test/apps/drafts.d.ts +9 -9
- package/dist/test/apps/drafts.d.ts.map +1 -1
- package/dist/test/apps/drafts.js +6 -6
- package/dist/test/apps/feedSocket.d.ts +6 -6
- package/dist/test/apps/feedSocket.d.ts.map +1 -1
- package/dist/test/apps/feedSocket.js +8 -8
- package/dist/test/apps/fileUpload.d.ts +2 -2
- package/dist/test/apps/fileUpload.d.ts.map +1 -1
- package/dist/test/apps/fileUpload.js +2 -2
- package/dist/test/apps/focusBoundary.d.ts +3 -3
- package/dist/test/apps/focusBoundary.d.ts.map +1 -1
- package/dist/test/apps/focusBoundary.js +3 -3
- package/dist/test/apps/formChild.d.ts +11 -11
- package/dist/test/apps/formChild.d.ts.map +1 -1
- package/dist/test/apps/formChild.js +13 -12
- package/dist/test/apps/interactions.d.ts +8 -8
- package/dist/test/apps/interactions.d.ts.map +1 -1
- package/dist/test/apps/interactions.js +8 -8
- package/dist/test/apps/keypress.d.ts +6 -6
- package/dist/test/apps/keypress.d.ts.map +1 -1
- package/dist/test/apps/keypress.js +6 -6
- package/dist/test/apps/login.d.ts +11 -11
- package/dist/test/apps/login.d.ts.map +1 -1
- package/dist/test/apps/login.js +15 -15
- package/dist/test/apps/logoutButton.d.ts +3 -3
- package/dist/test/apps/logoutButton.d.ts.map +1 -1
- package/dist/test/apps/logoutButton.js +2 -2
- package/dist/test/apps/mountPanel.d.ts +9 -9
- package/dist/test/apps/mountPanel.d.ts.map +1 -1
- package/dist/test/apps/mountPanel.js +9 -9
- package/dist/test/apps/multiRole.d.ts +3 -3
- package/dist/test/apps/multiRole.d.ts.map +1 -1
- package/dist/test/apps/multiRole.js +2 -2
- package/dist/test/apps/pointer.d.ts +7 -7
- package/dist/test/apps/pointer.d.ts.map +1 -1
- package/dist/test/apps/pointer.js +7 -7
- package/dist/test/apps/resumeUpload.d.ts +8 -8
- package/dist/test/apps/resumeUpload.d.ts.map +1 -1
- package/dist/test/apps/resumeUpload.js +7 -7
- package/dist/test/apps/scorePanel.d.ts +3 -3
- package/dist/test/apps/scorePanel.d.ts.map +1 -1
- package/dist/test/apps/scorePanel.js +2 -2
- package/dist/test/apps/selectiveKeys.d.ts +3 -3
- package/dist/test/apps/selectiveKeys.d.ts.map +1 -1
- package/dist/test/apps/selectiveKeys.js +3 -3
- package/dist/test/apps/uploads.d.ts +18 -18
- package/dist/test/apps/uploads.d.ts.map +1 -1
- package/dist/test/apps/uploads.js +13 -13
- package/dist/test/matchers.d.ts.map +1 -1
- package/dist/test/matchers.js +4 -4
- package/dist/test/query.d.ts.map +1 -1
- package/dist/test/query.js +28 -28
- package/dist/test/scene.d.ts +37 -8
- package/dist/test/scene.d.ts.map +1 -1
- package/dist/test/scene.js +58 -15
- package/dist/test/story.d.ts +35 -8
- package/dist/test/story.d.ts.map +1 -1
- package/dist/test/story.js +44 -22
- package/dist/update/update.d.ts +17 -20
- package/dist/update/update.d.ts.map +1 -1
- package/dist/url/index.d.ts +8 -8
- package/dist/url/index.d.ts.map +1 -1
- package/dist/url/index.js +19 -19
- package/dist/vdom.d.ts +3 -2
- package/dist/vdom.d.ts.map +1 -1
- package/dist/vdom.js +16 -6
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/devTools/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/devTools/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAA;AAMvC,0NAA0N;AAC1N,eAAO,MAAM,iBAAiB;;;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F,QAAQ;;;;;YAkDtB,MAAM;;;EA8BvB,CAAA;AACF,uEAAuE;AACvE,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAC,IAAI,CAAA;AAErD,0FAA0F;AAC1F,eAAO,MAAM,UAAU;;;;YA1BH,OAAO;;;;;;;YACJ,YAAY;;;EA4BjC,CAAA;AACF,uDAAuD;AACvD,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAA"}
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { Effect, Schema
|
|
1
|
+
import { Effect, Schema } from 'effect';
|
|
2
2
|
import { defineTaggedUnion } from '../schema/index.js';
|
|
3
3
|
// SHARED
|
|
4
4
|
/** A serialized Command produced during a Message dispatch (or `init`). `args` is `Some` when the Command's definition declared an args record, and carries the runtime values used to construct the Command instance. */
|
|
5
|
-
export const SerializedCommand =
|
|
6
|
-
name:
|
|
7
|
-
args:
|
|
5
|
+
export const SerializedCommand = Schema.Struct({
|
|
6
|
+
name: Schema.String,
|
|
7
|
+
args: Schema.OptionFromNullOr(Schema.Record(Schema.String, Schema.Unknown)),
|
|
8
8
|
});
|
|
9
9
|
/** A serialized Mount lifecycle event (start or end). `args` is `Some` when the Mount's definition declared an args record, and carries the runtime values used to construct the MountAction instance. */
|
|
10
|
-
export const SerializedMount =
|
|
11
|
-
name:
|
|
12
|
-
args:
|
|
10
|
+
export const SerializedMount = Schema.Struct({
|
|
11
|
+
name: Schema.String,
|
|
12
|
+
args: Schema.OptionFromNullOr(Schema.Record(Schema.String, Schema.Unknown)),
|
|
13
13
|
});
|
|
14
14
|
/** A serialized history entry as it appears on the wire. `submodelPath` lists `Got<Child>Message` wrapper tags from outer to inner when the entry came up through a Submodel chain; `maybeLeafTag` is `Some` with the innermost child Message tag when one exists. `mountStarts` lists Mounts that fired during the render after this Message; `mountEnds` lists Mounts whose elements were unmounted during that render. The Messages dispatched by mount Effects appear as their own entries elsewhere in history. */
|
|
15
|
-
export const SerializedEntry =
|
|
16
|
-
index:
|
|
17
|
-
tag:
|
|
18
|
-
message:
|
|
19
|
-
commands:
|
|
20
|
-
mountStarts:
|
|
21
|
-
mountEnds:
|
|
22
|
-
timestamp:
|
|
23
|
-
isModelChanged:
|
|
24
|
-
changedPaths:
|
|
25
|
-
affectedPaths:
|
|
26
|
-
submodelPath:
|
|
27
|
-
maybeLeafTag:
|
|
15
|
+
export const SerializedEntry = Schema.Struct({
|
|
16
|
+
index: Schema.Number,
|
|
17
|
+
tag: Schema.String,
|
|
18
|
+
message: Schema.Unknown,
|
|
19
|
+
commands: Schema.Array(SerializedCommand),
|
|
20
|
+
mountStarts: Schema.Array(SerializedMount),
|
|
21
|
+
mountEnds: Schema.Array(SerializedMount),
|
|
22
|
+
timestamp: Schema.Number,
|
|
23
|
+
isModelChanged: Schema.Boolean,
|
|
24
|
+
changedPaths: Schema.Array(Schema.String),
|
|
25
|
+
affectedPaths: Schema.Array(Schema.String),
|
|
26
|
+
submodelPath: Schema.Array(Schema.String),
|
|
27
|
+
maybeLeafTag: Schema.OptionFromNullOr(Schema.String),
|
|
28
28
|
});
|
|
29
29
|
/** Metadata about a single keyframe. The index identifies the point in history where the runtime can replay back to. */
|
|
30
|
-
export const KeyframeInfo =
|
|
31
|
-
index:
|
|
30
|
+
export const KeyframeInfo = Schema.Struct({
|
|
31
|
+
index: Schema.Number,
|
|
32
32
|
});
|
|
33
33
|
/** Metadata about a connected browser runtime. */
|
|
34
|
-
export const RuntimeInfo =
|
|
35
|
-
connectionId:
|
|
36
|
-
url:
|
|
37
|
-
title:
|
|
34
|
+
export const RuntimeInfo = Schema.Struct({
|
|
35
|
+
connectionId: Schema.String,
|
|
36
|
+
url: Schema.String,
|
|
37
|
+
title: Schema.String,
|
|
38
38
|
});
|
|
39
39
|
// REQUEST
|
|
40
40
|
/** The largest batch `RequestDispatchMessages` accepts. Matches the DevTools store's default history size, so a batch cannot evict its own earliest entries before the caller reads them back. The runtime rejects a larger batch with `ResponseError`, and MCP clients reject it earlier still, at their own input boundary. */
|
|
@@ -44,138 +44,144 @@ export const MAX_DISPATCH_BATCH_SIZE = 100;
|
|
|
44
44
|
* runtime. */
|
|
45
45
|
export const Request = defineTaggedUnion({
|
|
46
46
|
RequestGetModel: {
|
|
47
|
-
maybePath:
|
|
48
|
-
expand:
|
|
47
|
+
maybePath: Schema.OptionFromNullOr(Schema.String),
|
|
48
|
+
expand: Schema.Boolean,
|
|
49
49
|
},
|
|
50
50
|
RequestGetModelAt: {
|
|
51
|
-
index:
|
|
52
|
-
maybePath:
|
|
53
|
-
expand:
|
|
51
|
+
index: Schema.Number,
|
|
52
|
+
maybePath: Schema.OptionFromNullOr(Schema.String),
|
|
53
|
+
expand: Schema.Boolean,
|
|
54
54
|
},
|
|
55
55
|
RequestListMessages: {
|
|
56
|
-
limit:
|
|
57
|
-
maybeSinceIndex:
|
|
58
|
-
maybeChangedPathsMatch:
|
|
59
|
-
fromEnd:
|
|
56
|
+
limit: Schema.Number,
|
|
57
|
+
maybeSinceIndex: Schema.OptionFromNullOr(Schema.Number),
|
|
58
|
+
maybeChangedPathsMatch: Schema.OptionFromNullOr(Schema.Array(Schema.String)).pipe(Schema.withDecodingDefault(Effect.succeed(null))),
|
|
59
|
+
fromEnd: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),
|
|
60
60
|
},
|
|
61
61
|
RequestCountMessagesByTag: {
|
|
62
|
-
maybeSinceIndex:
|
|
63
|
-
maybeChangedPathsMatch:
|
|
62
|
+
maybeSinceIndex: Schema.OptionFromNullOr(Schema.Number),
|
|
63
|
+
maybeChangedPathsMatch: Schema.OptionFromNullOr(Schema.Array(Schema.String)),
|
|
64
64
|
},
|
|
65
65
|
RequestDiffModels: {
|
|
66
|
-
fromIndex:
|
|
67
|
-
toIndex:
|
|
68
|
-
maybeChangedPathsMatch:
|
|
66
|
+
fromIndex: Schema.Number,
|
|
67
|
+
toIndex: Schema.Number,
|
|
68
|
+
maybeChangedPathsMatch: Schema.OptionFromNullOr(Schema.Array(Schema.String)),
|
|
69
69
|
},
|
|
70
|
-
RequestGetMessage: { index:
|
|
70
|
+
RequestGetMessage: { index: Schema.Number },
|
|
71
71
|
RequestListKeyframes: {},
|
|
72
|
-
RequestReplayToKeyframe: { keyframeIndex:
|
|
72
|
+
RequestReplayToKeyframe: { keyframeIndex: Schema.Number },
|
|
73
73
|
RequestResume: {},
|
|
74
|
-
RequestDispatchMessage: { message:
|
|
75
|
-
RequestDispatchMessages: { messages:
|
|
74
|
+
RequestDispatchMessage: { message: Schema.Unknown },
|
|
75
|
+
RequestDispatchMessages: { messages: Schema.Array(Schema.Unknown) },
|
|
76
76
|
RequestListRuntimes: {},
|
|
77
77
|
RequestGetInit: {},
|
|
78
78
|
RequestGetRuntimeState: {},
|
|
79
|
-
RequestGetMessageSchema: {
|
|
79
|
+
RequestGetMessageSchema: {
|
|
80
|
+
maybeVariantTag: Schema.OptionFromNullOr(Schema.String),
|
|
81
|
+
},
|
|
80
82
|
});
|
|
81
83
|
// RESPONSE
|
|
82
84
|
/** One row of a Message-tag histogram. */
|
|
83
|
-
export const MessageTagCount =
|
|
84
|
-
tag:
|
|
85
|
-
count:
|
|
85
|
+
export const MessageTagCount = Schema.Struct({
|
|
86
|
+
tag: Schema.String,
|
|
87
|
+
count: Schema.Number,
|
|
86
88
|
});
|
|
87
89
|
/** The value on one side of a Model diff. `DiffValue.Present` carries the
|
|
88
90
|
* value. `DiffValue.Absent` means the path does not exist on that side, which
|
|
89
91
|
* keeps a missing path distinct from a path whose value is `null`. */
|
|
90
92
|
export const DiffValue = defineTaggedUnion({
|
|
91
93
|
Absent: {},
|
|
92
|
-
Present: { value:
|
|
94
|
+
Present: { value: Schema.Unknown },
|
|
93
95
|
});
|
|
94
96
|
/** One changed path in a Model diff. `before` is the value at `fromIndex`, `after` the value at `toIndex`. */
|
|
95
|
-
export const ModelDiffChange =
|
|
96
|
-
path:
|
|
97
|
+
export const ModelDiffChange = Schema.Struct({
|
|
98
|
+
path: Schema.String,
|
|
97
99
|
before: DiffValue,
|
|
98
100
|
after: DiffValue,
|
|
99
101
|
});
|
|
100
102
|
/** One variant entry in a `MessageSchemaIndex`. `payloadFields` lists the variant's payload property names (excluding `_tag`); `unionFields` lists the subset of those properties whose schemas are themselves `_tag`-discriminated unions. A Submodel-wrapper variant always shows up with `unionFields: ['message']`, but the same flag also catches plain tagged-union value types like `UrlRequest = Internal | External`. Either way, the agent will need to pick a variant when filling these fields. */
|
|
101
|
-
export const MessageSchemaIndexEntry =
|
|
102
|
-
tag:
|
|
103
|
-
payloadFields:
|
|
104
|
-
unionFields:
|
|
103
|
+
export const MessageSchemaIndexEntry = Schema.Struct({
|
|
104
|
+
tag: Schema.String,
|
|
105
|
+
payloadFields: Schema.Array(Schema.String),
|
|
106
|
+
unionFields: Schema.Array(Schema.String),
|
|
105
107
|
});
|
|
106
108
|
/** A flat directory of every top-level Message variant the runtime accepts, designed to fit in an agent context regardless of Message-union size. Use the tag names to make a follow-up `RequestGetMessageSchema` with `maybeVariantTag` set to fetch the full JSON Schema for one variant. */
|
|
107
|
-
export const MessageSchemaIndex =
|
|
108
|
-
variants:
|
|
109
|
+
export const MessageSchemaIndex = Schema.Struct({
|
|
110
|
+
variants: Schema.Array(MessageSchemaIndexEntry),
|
|
109
111
|
});
|
|
110
112
|
/** The result of requesting the app's Message Schema. It is either a compact
|
|
111
113
|
* index of Message variants or the JSON Schema document for one variant. */
|
|
112
114
|
export const MessageSchemaResult = defineTaggedUnion({
|
|
113
115
|
MessageSchemaIndexResult: { index: MessageSchemaIndex },
|
|
114
|
-
MessageSchemaDocumentResult: { document:
|
|
116
|
+
MessageSchemaDocumentResult: { document: Schema.Unknown },
|
|
115
117
|
});
|
|
116
118
|
/** A response replying to a Request. */
|
|
117
119
|
export const Response = defineTaggedUnion({
|
|
118
|
-
ResponseModel: {
|
|
120
|
+
ResponseModel: {
|
|
121
|
+
value: Schema.Unknown,
|
|
122
|
+
atPath: Schema.String,
|
|
123
|
+
summarized: Schema.Boolean,
|
|
124
|
+
},
|
|
119
125
|
ResponseMessages: {
|
|
120
|
-
entries:
|
|
121
|
-
maybeNextIndex:
|
|
126
|
+
entries: Schema.Array(SerializedEntry),
|
|
127
|
+
maybeNextIndex: Schema.OptionFromNullOr(Schema.Number),
|
|
122
128
|
},
|
|
123
129
|
ResponseMessage: { entry: SerializedEntry },
|
|
124
130
|
ResponseMessageCounts: {
|
|
125
|
-
counts:
|
|
126
|
-
totalCount:
|
|
127
|
-
scannedFromIndex:
|
|
128
|
-
scannedToIndex:
|
|
131
|
+
counts: Schema.Array(MessageTagCount),
|
|
132
|
+
totalCount: Schema.Number,
|
|
133
|
+
scannedFromIndex: Schema.Number,
|
|
134
|
+
scannedToIndex: Schema.Number,
|
|
129
135
|
},
|
|
130
136
|
ResponseModelDiff: {
|
|
131
|
-
fromIndex:
|
|
132
|
-
toIndex:
|
|
133
|
-
changes:
|
|
137
|
+
fromIndex: Schema.Number,
|
|
138
|
+
toIndex: Schema.Number,
|
|
139
|
+
changes: Schema.Array(ModelDiffChange),
|
|
134
140
|
},
|
|
135
|
-
ResponseKeyframes: { keyframes:
|
|
136
|
-
ResponseReplayed: { model:
|
|
141
|
+
ResponseKeyframes: { keyframes: Schema.Array(KeyframeInfo) },
|
|
142
|
+
ResponseReplayed: { model: Schema.Unknown },
|
|
137
143
|
ResponseResumed: {},
|
|
138
|
-
ResponseDispatched: { acceptedAtIndex:
|
|
139
|
-
ResponseDispatchedBatch: { acceptedAtIndices:
|
|
140
|
-
ResponseRuntimes: { runtimes:
|
|
144
|
+
ResponseDispatched: { acceptedAtIndex: Schema.Number },
|
|
145
|
+
ResponseDispatchedBatch: { acceptedAtIndices: Schema.Array(Schema.Number) },
|
|
146
|
+
ResponseRuntimes: { runtimes: Schema.Array(RuntimeInfo) },
|
|
141
147
|
ResponseInit: {
|
|
142
|
-
maybeModel:
|
|
143
|
-
commands:
|
|
144
|
-
mountStarts:
|
|
148
|
+
maybeModel: Schema.OptionFromNullOr(Schema.Unknown),
|
|
149
|
+
commands: Schema.Array(SerializedCommand),
|
|
150
|
+
mountStarts: Schema.Array(SerializedMount),
|
|
145
151
|
},
|
|
146
152
|
ResponseRuntimeState: {
|
|
147
|
-
currentIndex:
|
|
148
|
-
startIndex:
|
|
149
|
-
totalEntries:
|
|
150
|
-
isPaused:
|
|
151
|
-
maybePausedAtIndex:
|
|
152
|
-
hasInitModel:
|
|
153
|
+
currentIndex: Schema.Number,
|
|
154
|
+
startIndex: Schema.Number,
|
|
155
|
+
totalEntries: Schema.Number,
|
|
156
|
+
isPaused: Schema.Boolean,
|
|
157
|
+
maybePausedAtIndex: Schema.OptionFromNullOr(Schema.Number),
|
|
158
|
+
hasInitModel: Schema.Boolean,
|
|
153
159
|
},
|
|
154
160
|
ResponseMessageSchema: {
|
|
155
|
-
maybeResult:
|
|
161
|
+
maybeResult: Schema.OptionFromNullOr(MessageSchemaResult),
|
|
156
162
|
},
|
|
157
|
-
ResponseError: { reason:
|
|
163
|
+
ResponseError: { reason: Schema.String },
|
|
158
164
|
});
|
|
159
165
|
// EVENT
|
|
160
166
|
/** A runtime lifecycle event used by the Vite plugin to track which browser tabs are connected. Not forwarded to MCP clients. */
|
|
161
167
|
export const Event = defineTaggedUnion({
|
|
162
168
|
EventConnected: { runtime: RuntimeInfo },
|
|
163
|
-
EventDisconnected: { connectionId:
|
|
169
|
+
EventDisconnected: { connectionId: Schema.String },
|
|
164
170
|
});
|
|
165
171
|
// FRAME
|
|
166
172
|
/** A wire frame carrying a Request from the MCP server. The id is opaque, used only by the MCP server to correlate the matching Response. The maybeConnectionId routes the request to a specific runtime when present. */
|
|
167
|
-
export const RequestFrame =
|
|
168
|
-
id:
|
|
169
|
-
maybeConnectionId:
|
|
173
|
+
export const RequestFrame = Schema.Struct({
|
|
174
|
+
id: Schema.String,
|
|
175
|
+
maybeConnectionId: Schema.OptionFromNullOr(Schema.String),
|
|
170
176
|
request: Request,
|
|
171
177
|
});
|
|
172
178
|
/** A wire frame carrying a Response, correlated to a Request by id. */
|
|
173
|
-
export const ResponseFrame =
|
|
174
|
-
id:
|
|
179
|
+
export const ResponseFrame = Schema.Struct({
|
|
180
|
+
id: Schema.String,
|
|
175
181
|
response: Response,
|
|
176
182
|
});
|
|
177
183
|
/** A wire frame carrying a runtime lifecycle event from the bridge to the Vite plugin. */
|
|
178
|
-
export const EventFrame =
|
|
179
|
-
maybeConnectionId:
|
|
184
|
+
export const EventFrame = Schema.Struct({
|
|
185
|
+
maybeConnectionId: Schema.OptionFromNullOr(Schema.String),
|
|
180
186
|
event: Event,
|
|
181
187
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemaSummarize.d.ts","sourceRoot":"","sources":["../../src/devTools/schemaSummarize.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"schemaSummarize.d.ts","sourceRoot":"","sources":["../../src/devTools/schemaSummarize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAyC,MAAM,QAAQ,CAAA;AAE7E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAA;AAgH5D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,0BAA0B,aAC3B,OAAO,KAChB,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,uBAAuB,CAAC,CACG,CAAA;AA0H1D;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,gBAAiB,MAAM,KAAG,aAAa,CAAC,MAAM,CAKxE,CAAA;AA8BH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,aACxB,OAAO,cACL,aAAa,CAAC,MAAM,CAAC,KAChC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,CAGnC,CAAA;AAEH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,aACpB,OAAO,YACP,aAAa,CAAC,MAAM,CAAC,KAC9B,MAAM,CAAC,MAAM,CAAC;IACf,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IAC7B,cAAc,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IACrC,SAAS,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;CACjC,CAuBA,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,eAAe,aAChB,OAAO,eACJ,MAAM,KAClB,MAAM,CAAC,MAAM,CAAC,OAAO,CAiBvB,CAAA"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Array
|
|
1
|
+
import { Array, Option, Predicate, Record, String, flow, pipe } from 'effect';
|
|
2
2
|
const PATH_SEPARATOR = '.';
|
|
3
|
-
const isRecord = (value) => Predicate.isObject(value) && !
|
|
4
|
-
const isReadonlyArray = (value) =>
|
|
5
|
-
const isStringArray = (values) =>
|
|
3
|
+
const isRecord = (value) => Predicate.isObject(value) && !Array.isArray(value);
|
|
4
|
+
const isReadonlyArray = (value) => Array.isArray(value);
|
|
5
|
+
const isStringArray = (values) => Array.every(values, Predicate.isString);
|
|
6
6
|
const stringEnumOf = (schema) => {
|
|
7
7
|
if (!isRecord(schema)) {
|
|
8
8
|
return Option.none();
|
|
9
9
|
}
|
|
10
10
|
const candidate = schema['enum'];
|
|
11
|
-
if (!
|
|
11
|
+
if (!Array.isArray(candidate)) {
|
|
12
12
|
return Option.none();
|
|
13
13
|
}
|
|
14
14
|
return Option.liftPredicate(candidate, isStringArray);
|
|
@@ -21,7 +21,7 @@ const variantTagOf = (schema) => {
|
|
|
21
21
|
if (!isRecord(properties)) {
|
|
22
22
|
return Option.none();
|
|
23
23
|
}
|
|
24
|
-
return stringEnumOf(properties['_tag']).pipe(Option.flatMap(tags => tags.length === 1 ?
|
|
24
|
+
return stringEnumOf(properties['_tag']).pipe(Option.flatMap(tags => tags.length === 1 ? Array.head(tags) : Option.none()));
|
|
25
25
|
};
|
|
26
26
|
const anyOfOf = (schema) => {
|
|
27
27
|
if (!isRecord(schema)) {
|
|
@@ -29,7 +29,7 @@ const anyOfOf = (schema) => {
|
|
|
29
29
|
}
|
|
30
30
|
return Option.liftPredicate(schema['anyOf'], isReadonlyArray);
|
|
31
31
|
};
|
|
32
|
-
const isDiscriminatedUnion = (schema) => Option.exists(anyOfOf(schema), Predicate.and(
|
|
32
|
+
const isDiscriminatedUnion = (schema) => Option.exists(anyOfOf(schema), Predicate.and(Array.isReadonlyArrayNonEmpty, Array.every(flow(variantTagOf, Option.isSome))));
|
|
33
33
|
const payloadFieldsOf = (variant) => {
|
|
34
34
|
if (!isRecord(variant)) {
|
|
35
35
|
return [];
|
|
@@ -38,7 +38,7 @@ const payloadFieldsOf = (variant) => {
|
|
|
38
38
|
if (!isRecord(properties)) {
|
|
39
39
|
return [];
|
|
40
40
|
}
|
|
41
|
-
return pipe(Record.keys(properties),
|
|
41
|
+
return pipe(Record.keys(properties), Array.filter(name => name !== '_tag'));
|
|
42
42
|
};
|
|
43
43
|
const unionFieldsOf = (variant) => {
|
|
44
44
|
if (!isRecord(variant)) {
|
|
@@ -48,7 +48,7 @@ const unionFieldsOf = (variant) => {
|
|
|
48
48
|
if (!isRecord(properties)) {
|
|
49
49
|
return [];
|
|
50
50
|
}
|
|
51
|
-
return pipe(Record.toEntries(properties),
|
|
51
|
+
return pipe(Record.toEntries(properties), Array.filter(([name, schema]) => name !== '_tag' && isDiscriminatedUnion(schema)), Array.map(([name]) => name));
|
|
52
52
|
};
|
|
53
53
|
const entryOf = (variant) => variantTagOf(variant).pipe(Option.map(tag => ({
|
|
54
54
|
tag,
|
|
@@ -61,7 +61,7 @@ const topLevelVariantsOf = (document) => {
|
|
|
61
61
|
}
|
|
62
62
|
return anyOfOf(document['schema']);
|
|
63
63
|
};
|
|
64
|
-
const indexEntriesOf = (members) => pipe(members,
|
|
64
|
+
const indexEntriesOf = (members) => pipe(members, Array.map(entryOf), Array.getSomes);
|
|
65
65
|
/**
|
|
66
66
|
* Build a flat directory of every top-level Message variant from a JSON Schema
|
|
67
67
|
* document produced by `Schema.toJsonSchemaDocument`. The directory is small
|
|
@@ -76,8 +76,8 @@ const indexEntriesOf = (members) => pipe(members, Array_.map(entryOf), Array_.ge
|
|
|
76
76
|
*/
|
|
77
77
|
export const indexMessageSchemaDocument = (document) => Option.map(topLevelVariantsOf(document), indexEntriesOf);
|
|
78
78
|
const collapseUnionsInValue = (value) => {
|
|
79
|
-
if (
|
|
80
|
-
return
|
|
79
|
+
if (Array.isArray(value)) {
|
|
80
|
+
return Array.map(value, collapseUnionsInValue);
|
|
81
81
|
}
|
|
82
82
|
if (!isRecord(value)) {
|
|
83
83
|
return value;
|
|
@@ -104,7 +104,7 @@ const collapseUnionsInVariantPayload = (variant) => {
|
|
|
104
104
|
const collapsed = Record.map(properties, (schema, name) => name === '_tag' ? schema : collapseUnionsInValue(schema));
|
|
105
105
|
return { ...variant, properties: collapsed };
|
|
106
106
|
};
|
|
107
|
-
const findVariantByTag = (members, tag) =>
|
|
107
|
+
const findVariantByTag = (members, tag) => Array.findFirst(members, variant => Option.exists(variantTagOf(variant), candidate => candidate === tag));
|
|
108
108
|
/**
|
|
109
109
|
* Idiomatic Foldkit Messages carry at most one tagged-union payload field per
|
|
110
110
|
* variant: either a `Got<Child>Message { message }` Submodel wrapper or a
|
|
@@ -123,12 +123,12 @@ const singleUnionFieldOf = (variant) => {
|
|
|
123
123
|
if (!isRecord(properties)) {
|
|
124
124
|
return Option.none();
|
|
125
125
|
}
|
|
126
|
-
const unionEntries = pipe(Record.toEntries(properties),
|
|
126
|
+
const unionEntries = pipe(Record.toEntries(properties), Array.filter(([name, schema]) => name !== '_tag' && isDiscriminatedUnion(schema)));
|
|
127
127
|
if (unionEntries.length !== 1) {
|
|
128
128
|
return Option.none();
|
|
129
129
|
}
|
|
130
130
|
return Option.gen(function* () {
|
|
131
|
-
const [name, schema] = yield*
|
|
131
|
+
const [name, schema] = yield* Array.head(unionEntries);
|
|
132
132
|
const members = yield* anyOfOf(schema);
|
|
133
133
|
return { name, members };
|
|
134
134
|
});
|
|
@@ -153,10 +153,10 @@ const stepIntoVariant = (variant, rest) => Option.gen(function* () {
|
|
|
153
153
|
return replaceUnionField(variant, field.name, narrowedChild);
|
|
154
154
|
});
|
|
155
155
|
const narrowAtPath = (members, segments) => Option.gen(function* () {
|
|
156
|
-
const tag = yield*
|
|
156
|
+
const tag = yield* Array.head(segments);
|
|
157
157
|
const variant = yield* findVariantByTag(members, tag);
|
|
158
|
-
const rest =
|
|
159
|
-
if (
|
|
158
|
+
const rest = Array.drop(segments, 1);
|
|
159
|
+
if (Array.isReadonlyArrayEmpty(rest)) {
|
|
160
160
|
return collapseUnionsInVariantPayload(variant);
|
|
161
161
|
}
|
|
162
162
|
return yield* stepIntoVariant(variant, rest);
|
|
@@ -166,13 +166,13 @@ const narrowAtPath = (members, segments) => Option.gen(function* () {
|
|
|
166
166
|
* dropped so callers can pass user-supplied strings without first trimming
|
|
167
167
|
* leading/trailing dots.
|
|
168
168
|
*/
|
|
169
|
-
export const splitVariantPath = (variantPath) => pipe(variantPath,
|
|
169
|
+
export const splitVariantPath = (variantPath) => pipe(variantPath, String.split(PATH_SEPARATOR), Array.filter(String.isNonEmpty));
|
|
170
170
|
const stepToNextUnionMembers = (members, segment) => Option.gen(function* () {
|
|
171
171
|
const variant = yield* findVariantByTag(members, segment);
|
|
172
172
|
const field = yield* singleUnionFieldOf(variant);
|
|
173
173
|
return field.members;
|
|
174
174
|
});
|
|
175
|
-
const variantsAtPathPrefix = (document, segments) => Option.flatMap(topLevelVariantsOf(document), topMembers =>
|
|
175
|
+
const variantsAtPathPrefix = (document, segments) => Option.flatMap(topLevelVariantsOf(document), topMembers => Array.reduce(segments, Option.some(topMembers), (currentMembers, segment) => Option.flatMap(currentMembers, members => stepToNextUnionMembers(members, segment))));
|
|
176
176
|
/**
|
|
177
177
|
* Enumerate the variant tags available as the next segment of a variant path.
|
|
178
178
|
* Given a partial path that resolves to a tagged-union field, returns the tags
|
|
@@ -184,7 +184,7 @@ const variantsAtPathPrefix = (document, segments) => Option.flatMap(topLevelVari
|
|
|
184
184
|
* segment names no top-level variant, or an intermediate variant lacks a
|
|
185
185
|
* tagged-union payload field).
|
|
186
186
|
*/
|
|
187
|
-
export const variantTagsAtPathPrefix = (document, pathPrefix) => Option.map(variantsAtPathPrefix(document, pathPrefix), members =>
|
|
187
|
+
export const variantTagsAtPathPrefix = (document, pathPrefix) => Option.map(variantsAtPathPrefix(document, pathPrefix), members => Array.map(indexEntriesOf(members), entry => entry.tag));
|
|
188
188
|
/**
|
|
189
189
|
* Diagnose where a variant-path walk would fail. Walks back from one segment
|
|
190
190
|
* before the supplied path length, returning the deepest prefix whose
|
|
@@ -201,12 +201,12 @@ export const diagnoseVariantPath = (document, segments) => {
|
|
|
201
201
|
if (length < 0) {
|
|
202
202
|
return Option.none();
|
|
203
203
|
}
|
|
204
|
-
const prefix =
|
|
204
|
+
const prefix = Array.take(segments, length);
|
|
205
205
|
return Option.match(variantTagsAtPathPrefix(document, prefix), {
|
|
206
206
|
onNone: () => tryLength(length - 1),
|
|
207
207
|
onSome: available => Option.some({
|
|
208
208
|
prefix,
|
|
209
|
-
failingSegment:
|
|
209
|
+
failingSegment: Array.get(segments, length),
|
|
210
210
|
available,
|
|
211
211
|
}),
|
|
212
212
|
});
|
|
@@ -249,7 +249,7 @@ export const narrowToVariant = (document, variantPath) => {
|
|
|
249
249
|
return Option.none();
|
|
250
250
|
}
|
|
251
251
|
const segments = splitVariantPath(variantPath);
|
|
252
|
-
if (
|
|
252
|
+
if (Array.isReadonlyArrayEmpty(segments)) {
|
|
253
253
|
return Option.none();
|
|
254
254
|
}
|
|
255
255
|
return Option.gen(function* () {
|
|
@@ -9,7 +9,7 @@ import type { CommandRecord, HistoryEntry, MountRecord } from './store.js';
|
|
|
9
9
|
* because File extends Blob.
|
|
10
10
|
*
|
|
11
11
|
* Memoized by reference. The transform allocates fresh wrappers via
|
|
12
|
-
* `
|
|
12
|
+
* `Array.map` / `Record.map` even when the input contains no DOM classes
|
|
13
13
|
* (because `map` always allocates), which would otherwise produce a fresh
|
|
14
14
|
* tree of references on every call. Without memoization, the inspector
|
|
15
15
|
* tree's row-level `lazyTreeNode` cache would miss on every row of every
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../src/devTools/serialize.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../src/devTools/serialize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EACf,eAAe,EAChB,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAwB1E;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,kBAAkB,UAAW,OAAO,KAAG,OAUnD,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,YACrB,aAAa,KACrB,iBAGD,CAAA;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,UAAW,WAAW,KAAG,eAGrD,CAAA;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,UACrB,YAAY,SACZ,MAAM,KACZ,eAoBF,CAAA"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Array
|
|
1
|
+
import { Array, Function, Match, Option, Predicate, Record } from 'effect';
|
|
2
2
|
import { extractSubmodelInfo } from './submodelPath.js';
|
|
3
3
|
const inspectableCache = new WeakMap();
|
|
4
|
-
const computeInspectableValue = (value) =>
|
|
4
|
+
const computeInspectableValue = (value) => Match.value(value).pipe(Match.when(Match.instanceOf(File), file => ({
|
|
5
5
|
name: file.name,
|
|
6
6
|
size: file.size,
|
|
7
7
|
type: file.type,
|
|
8
8
|
lastModified: file.lastModified,
|
|
9
|
-
})),
|
|
9
|
+
})), Match.when(Match.instanceOf(Blob), blob => ({
|
|
10
10
|
size: blob.size,
|
|
11
11
|
type: blob.type,
|
|
12
|
-
})),
|
|
12
|
+
})), Match.when(Match.instanceOf(Date), date => date.toISOString()), Match.when(Match.instanceOf(URL), ({ href }) => href), Match.when(globalThis.Array.isArray, Array.map(toInspectableValue)), Match.when(Predicate.isObject, Record.map(toInspectableValue)), Match.orElse(Function.identity));
|
|
13
13
|
/**
|
|
14
14
|
* Convert DOM-class instances (File, Blob, Date, URL) to plain-object
|
|
15
15
|
* representations so the tree renderer's key-enumeration walk can see their
|
|
@@ -19,7 +19,7 @@ const computeInspectableValue = (value) => M.value(value).pipe(M.when(M.instance
|
|
|
19
19
|
* because File extends Blob.
|
|
20
20
|
*
|
|
21
21
|
* Memoized by reference. The transform allocates fresh wrappers via
|
|
22
|
-
* `
|
|
22
|
+
* `Array.map` / `Record.map` even when the input contains no DOM classes
|
|
23
23
|
* (because `map` always allocates), which would otherwise produce a fresh
|
|
24
24
|
* tree of references on every call. Without memoization, the inspector
|
|
25
25
|
* tree's row-level `lazyTreeNode` cache would miss on every row of every
|
|
@@ -69,13 +69,13 @@ export const toSerializedEntry = (entry, index) => {
|
|
|
69
69
|
index,
|
|
70
70
|
tag: entry.tag,
|
|
71
71
|
message: toInspectableValue(entry.message),
|
|
72
|
-
commands:
|
|
73
|
-
mountStarts:
|
|
74
|
-
mountEnds:
|
|
72
|
+
commands: Array.map(entry.commands, toSerializedCommand),
|
|
73
|
+
mountStarts: Array.map(entry.mountStarts, toSerializedMount),
|
|
74
|
+
mountEnds: Array.map(entry.mountEnds, toSerializedMount),
|
|
75
75
|
timestamp: entry.timestamp,
|
|
76
76
|
isModelChanged: entry.isModelChanged,
|
|
77
|
-
changedPaths:
|
|
78
|
-
affectedPaths:
|
|
77
|
+
changedPaths: Array.fromIterable(entry.diff.changedPaths),
|
|
78
|
+
affectedPaths: Array.fromIterable(entry.diff.affectedPaths),
|
|
79
79
|
submodelPath,
|
|
80
80
|
maybeLeafTag,
|
|
81
81
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"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