@unoverse-platform/studio 0.1.90 → 0.1.91
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/local/plugin.ts +20 -12
- package/package.json +13 -3
- package/vendor/base/src/agent-mcp/discovery.ts +203 -0
- package/vendor/base/src/agent-mcp/handoff.ts +56 -0
- package/vendor/base/src/agent-mcp/index.ts +44 -0
- package/vendor/base/src/agent-mcp/invoke.ts +140 -0
- package/vendor/base/src/agent-mcp/lean.ts +111 -0
- package/vendor/base/src/agent-mcp/memoryContext.ts +104 -0
- package/vendor/base/src/agent-mcp/memoryIngest.ts +88 -0
- package/vendor/base/src/agent-mcp/rowComponents.ts +172 -0
- package/vendor/base/src/agent-mcp/tools.ts +134 -0
- package/vendor/base/src/agent-mcp/types.ts +130 -0
- package/vendor/base/src/auth/auth.ts +278 -0
- package/vendor/base/src/auth/authConfig.ts +73 -0
- package/vendor/base/src/boot.ts +245 -0
- package/vendor/base/src/definitions/definitions.ts +18 -0
- package/vendor/base/src/definitions/dsPackage.ts +45 -0
- package/vendor/base/src/definitions/fsCache.ts +128 -0
- package/vendor/base/src/definitions/index.ts +19 -0
- package/vendor/base/src/definitions/inputs.ts +30 -0
- package/vendor/base/src/definitions/load/compile/component.ts +80 -0
- package/vendor/base/src/definitions/load/compile/index.ts +12 -0
- package/vendor/base/src/definitions/load/compile/sections.ts +132 -0
- package/vendor/base/src/definitions/load/compile/template.ts +153 -0
- package/vendor/base/src/definitions/load/expand/includes.ts +27 -0
- package/vendor/base/src/definitions/load/expand/index.ts +17 -0
- package/vendor/base/src/definitions/load/expand/inherit.ts +169 -0
- package/vendor/base/src/definitions/load/expand/referenced.ts +164 -0
- package/vendor/base/src/definitions/load/expand/refs.ts +106 -0
- package/vendor/base/src/definitions/load/expand/walk.ts +91 -0
- package/vendor/base/src/definitions/load/load.ts +487 -0
- package/vendor/base/src/definitions/model.ts +238 -0
- package/vendor/base/src/definitions/registry/catalog.ts +643 -0
- package/vendor/base/src/definitions/registry/homes.ts +252 -0
- package/vendor/base/src/definitions/theme.ts +383 -0
- package/vendor/base/src/executor.ts +284 -0
- package/vendor/base/src/http/uwsFetchAdapter.ts +260 -0
- package/vendor/base/src/items/baseVersion.ts +96 -0
- package/vendor/base/src/items/collect.ts +199 -0
- package/vendor/base/src/items/fingerprint.ts +34 -0
- package/vendor/base/src/items/publish.ts +198 -0
- package/vendor/base/src/lint/context.mjs +56 -0
- package/vendor/base/src/lint/design/defs.mjs +46 -0
- package/vendor/base/src/lint/design/file.mjs +737 -0
- package/vendor/base/src/lint/design/index.d.mts +30 -0
- package/vendor/base/src/lint/design/index.mjs +996 -0
- package/vendor/base/src/lint/design/tokens.mjs +128 -0
- package/vendor/base/src/lint/design/vocabulary.mjs +181 -0
- package/vendor/base/src/lint/design/walk.mjs +444 -0
- package/vendor/base/src/lint/index.mjs +28 -0
- package/vendor/base/src/lint/nodes/blocks.mjs +63 -0
- package/vendor/base/src/lint/nodes/index.mjs +64 -0
- package/vendor/base/src/lint/nodes/load.mjs +126 -0
- package/vendor/base/src/lint/nodes/node.mjs +764 -0
- package/vendor/base/src/lint/nodes/package.mjs +112 -0
- package/vendor/base/src/lint/nodes/schema.mjs +75 -0
- package/vendor/base/src/logger.ts +33 -0
- package/vendor/base/src/manifests/compose.ts +539 -0
- package/vendor/base/src/manifests/executor/callback.ts +107 -0
- package/vendor/base/src/manifests/executor/context.ts +107 -0
- package/vendor/base/src/manifests/executor/index.ts +47 -0
- package/vendor/base/src/manifests/executor/lookup.ts +21 -0
- package/vendor/base/src/manifests/executor/memory.ts +62 -0
- package/vendor/base/src/manifests/executor/promise.ts +71 -0
- package/vendor/base/src/manifests/executor/refire.ts +34 -0
- package/vendor/base/src/manifests/executor/send.ts +65 -0
- package/vendor/base/src/manifests/executor/session.ts +46 -0
- package/vendor/base/src/manifests/executor/toolBridge.ts +266 -0
- package/vendor/base/src/manifests/index.ts +280 -0
- package/vendor/base/src/manifests/integrity.ts +93 -0
- package/vendor/base/src/manifests/rows.ts +33 -0
- package/vendor/base/src/manifests/runtime/auth/aws.ts +240 -0
- package/vendor/base/src/manifests/runtime/auth/oauth.ts +76 -0
- package/vendor/base/src/manifests/runtime/authorize.ts +159 -0
- package/vendor/base/src/manifests/runtime/channels/final.ts +171 -0
- package/vendor/base/src/manifests/runtime/channels/service.ts +125 -0
- package/vendor/base/src/manifests/runtime/channels/workflow.ts +310 -0
- package/vendor/base/src/manifests/runtime/context.ts +150 -0
- package/vendor/base/src/manifests/runtime/docstore/handlers.ts +547 -0
- package/vendor/base/src/manifests/runtime/docstore/index.ts +135 -0
- package/vendor/base/src/manifests/runtime/docstore/sectionizer.ts +184 -0
- package/vendor/base/src/manifests/runtime/docstore/store.ts +172 -0
- package/vendor/base/src/manifests/runtime/docstore/types.ts +60 -0
- package/vendor/base/src/manifests/runtime/duplex/audioLane.ts +165 -0
- package/vendor/base/src/manifests/runtime/duplex/session.ts +511 -0
- package/vendor/base/src/manifests/runtime/events.ts +223 -0
- package/vendor/base/src/manifests/runtime/helpers.ts +53 -0
- package/vendor/base/src/manifests/runtime/http/allowedHosts.ts +118 -0
- package/vendor/base/src/manifests/runtime/http/request.ts +637 -0
- package/vendor/base/src/manifests/runtime/http/response.ts +162 -0
- package/vendor/base/src/manifests/runtime/index.ts +57 -0
- package/vendor/base/src/manifests/runtime/loops/chunk.ts +98 -0
- package/vendor/base/src/manifests/runtime/loops/loop.ts +191 -0
- package/vendor/base/src/manifests/runtime/loops/paginate.ts +143 -0
- package/vendor/base/src/manifests/runtime/loops/poll.ts +169 -0
- package/vendor/base/src/manifests/runtime/narrate.ts +53 -0
- package/vendor/base/src/manifests/runtime/state.ts +171 -0
- package/vendor/base/src/manifests/runtime/templating.ts +110 -0
- package/vendor/base/src/manifests/runtime/tools/regionSkills.ts +125 -0
- package/vendor/base/src/manifests/runtime/tools/toolloop.ts +542 -0
- package/vendor/base/src/manifests/runtime/usage.ts +87 -0
- package/vendor/base/src/manifests/source.ts +187 -0
- package/vendor/base/src/manifests/watch.ts +67 -0
- package/vendor/base/src/markdown/document.ts +141 -0
- package/vendor/base/src/paths.ts +180 -0
- package/vendor/base/src/platform/audioManager.ts +100 -0
- package/vendor/base/src/platform/clientTransport.ts +65 -0
- package/vendor/base/src/platform/executionContext.ts +154 -0
- package/vendor/base/src/platform/index.ts +10 -0
- package/vendor/base/src/platform/pluginAPI.ts +146 -0
- package/vendor/base/src/platform/redis.ts +54 -0
- package/vendor/base/src/platform/serviceCalls.ts +222 -0
- package/vendor/base/src/pluginBase.ts +248 -0
- package/vendor/base/src/plugins/README.md +57 -0
- package/vendor/base/src/plugins/discovery.ts +87 -0
- package/vendor/base/src/plugins/index.ts +16 -0
- package/vendor/base/src/plugins/loader.ts +179 -0
- package/vendor/base/src/plugins/redis.ts +36 -0
- package/vendor/base/src/plugins/state.ts +53 -0
- package/vendor/base/src/registry.ts +95 -0
- package/vendor/base/src/security/permissions.ts +93 -0
- package/vendor/base/src/security/rules.ts +73 -0
- package/vendor/base/src/template/SafeExpression.ts +556 -0
- package/vendor/base/src/template/StringTemplateResolver.ts +75 -0
- package/vendor/base/src/template/index.ts +22 -0
- package/vendor/base/src/types.ts +50 -0
- package/vendor/base/src/workflow/GetMemoryService.ts +158 -0
- package/vendor/base/src/workflow/PlatformMemoryCore.ts +438 -0
- package/vendor/base/src/workflow/routing.ts +122 -0
- package/vendor/sdk/lib/core/store.ts +26 -6
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Signal routing over a frozen route table — the runtime half of the workflow contract.
|
|
3
|
+
*
|
|
4
|
+
* The types here are the WIRE CONTRACT for a compiled workflow: the engine's compiler
|
|
5
|
+
* (RouteTableBuilder, engine-side — it needs the node metadata registry and must never
|
|
6
|
+
* enter this package) produces a RouteTable; anything that runs one consumes these shapes.
|
|
7
|
+
* The compiler's own declarations stay structurally identical — the runtime round-trip
|
|
8
|
+
* tests hold the two in parity.
|
|
9
|
+
*
|
|
10
|
+
* SignalRoutingEngine is pure routing logic: given a completed node's output and the
|
|
11
|
+
* route table, which downstream signals fire. No signal management, no execution.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { createLogger } from "../logger.js";
|
|
15
|
+
|
|
16
|
+
/** One compiled edge: source → target with its signal type and connector handles. */
|
|
17
|
+
export interface RouteEntry {
|
|
18
|
+
targetNodeId: string;
|
|
19
|
+
signalType: string; // "EXECUTE" | "SPAWN" | "RESET" etc.
|
|
20
|
+
targetHandle?: string; // Which input connector this edge connects to
|
|
21
|
+
sourceHandle?: string; // Which output connector this edge comes from
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** The frozen routing derived from a workflow's nodes + edges. */
|
|
25
|
+
export interface RouteTable {
|
|
26
|
+
routing: Map<string, RouteEntry[]>; // Source → [RouteEntries with signal types]
|
|
27
|
+
dependencies: Map<string, string[]>; // Target → [Source Node IDs] (for execution order)
|
|
28
|
+
connectorDependencies?: Map<string, Map<string, string[]>>; // Target → Connector → [Source Node IDs]
|
|
29
|
+
triggerNodes: string[]; // Nodes that start execution
|
|
30
|
+
nodeTriggerMap?: Map<string, string>; // nodeId → upstream InputTrigger ID (Focus Mode routing)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** A signal the router decided to send. */
|
|
34
|
+
export interface SignalRoute {
|
|
35
|
+
targetNodeId: string;
|
|
36
|
+
signal: string;
|
|
37
|
+
sourceNodeId: string;
|
|
38
|
+
targetHandle?: string; // Which input connector this signal targets
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const logger = createLogger("SignalRoutingEngine");
|
|
42
|
+
|
|
43
|
+
export class SignalRoutingEngine {
|
|
44
|
+
/**
|
|
45
|
+
* Get signals to send when a node completes execution - ROUTE TABLE VERSION
|
|
46
|
+
* Ultra-fast O(1) lookup using pre-computed route table
|
|
47
|
+
* Now with multi-output support - filters based on active output connectors
|
|
48
|
+
*/
|
|
49
|
+
static getSignalsForCompletedNode(nodeId: string, nodeOutput: any, routeTable: RouteTable): SignalRoute[] {
|
|
50
|
+
const signals: SignalRoute[] = [];
|
|
51
|
+
|
|
52
|
+
if (!routeTable?.routing) {
|
|
53
|
+
logger.warn(`No route table provided for node completion`, { nodeId });
|
|
54
|
+
return signals;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const routeEntries = routeTable.routing.get(nodeId) || [];
|
|
58
|
+
|
|
59
|
+
for (const routeEntry of routeEntries) {
|
|
60
|
+
// For nodes using __outputs pattern, check if the specific output exists
|
|
61
|
+
if (nodeOutput?.__outputs) {
|
|
62
|
+
// If there's a sourceHandle, check if that specific output exists
|
|
63
|
+
if (routeEntry.sourceHandle) {
|
|
64
|
+
const hasOutput =
|
|
65
|
+
routeEntry.sourceHandle in nodeOutput.__outputs &&
|
|
66
|
+
nodeOutput.__outputs[routeEntry.sourceHandle] !== undefined;
|
|
67
|
+
|
|
68
|
+
if (!hasOutput) {
|
|
69
|
+
// Debug level - this is normal for streaming nodes that emit partial outputs
|
|
70
|
+
logger.debug(`No signal - output connector has no data`, {
|
|
71
|
+
from: nodeId,
|
|
72
|
+
to: routeEntry.targetNodeId,
|
|
73
|
+
sourceHandle: routeEntry.sourceHandle,
|
|
74
|
+
});
|
|
75
|
+
continue; // Skip this route
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
// If no sourceHandle specified, node should have a default output
|
|
79
|
+
}
|
|
80
|
+
// For legacy multi-output nodes (IfElse, etc), check if the specific output exists
|
|
81
|
+
else if (routeEntry.sourceHandle && nodeOutput && typeof nodeOutput === "object") {
|
|
82
|
+
const hasOutput = routeEntry.sourceHandle in nodeOutput;
|
|
83
|
+
|
|
84
|
+
if (!hasOutput) {
|
|
85
|
+
logger.debug(`No signal - output connector has no data`, {
|
|
86
|
+
from: nodeId,
|
|
87
|
+
to: routeEntry.targetNodeId,
|
|
88
|
+
sourceHandle: routeEntry.sourceHandle,
|
|
89
|
+
});
|
|
90
|
+
continue; // Skip this route
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
// For flat output nodes or nodes with data, always send signal
|
|
94
|
+
|
|
95
|
+
signals.push({
|
|
96
|
+
targetNodeId: routeEntry.targetNodeId,
|
|
97
|
+
signal: routeEntry.signalType, // Use pre-computed signal type!
|
|
98
|
+
sourceNodeId: nodeId,
|
|
99
|
+
targetHandle: routeEntry.targetHandle, // Include target connector
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
if (routeEntry.signalType === "SPAWN") {
|
|
103
|
+
logger.debug(`Routing SPAWN signal`, {
|
|
104
|
+
from: nodeId,
|
|
105
|
+
to: routeEntry.targetNodeId,
|
|
106
|
+
targetHandle: routeEntry.targetHandle,
|
|
107
|
+
sourceHandle: routeEntry.sourceHandle,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
logger.debug(`Using route table to add active signal`, {
|
|
112
|
+
from: nodeId,
|
|
113
|
+
to: routeEntry.targetNodeId,
|
|
114
|
+
signal: routeEntry.signalType,
|
|
115
|
+
targetHandle: routeEntry.targetHandle,
|
|
116
|
+
sourceHandle: routeEntry.sourceHandle,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return signals;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
@@ -215,12 +215,20 @@ export class ComponentStore {
|
|
|
215
215
|
* lower states update silently underneath).
|
|
216
216
|
*/
|
|
217
217
|
/**
|
|
218
|
-
* RULE 5's EMPTY DELIVERY (STATE_MODEL §5 rule 5
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
218
|
+
* RULE 5's EMPTY DELIVERY (STATE_MODEL §5 rule 5; the director is the sender since
|
|
219
|
+
* 2026-08-30 — confirmed-empty and spent-or-kept both arrive as COMPONENTS_CLEAR):
|
|
220
|
+
* every earlier-turn component sitting in a public state retires. Same durable
|
|
221
|
+
* (`lifetime: "conversation"`) opt-out, same same-turn exemption as `supersede`.
|
|
222
|
+
* Rule 7 stands — this rides the answer's delivery, never the guest's typing.
|
|
223
|
+
*
|
|
224
|
+
* A CLEAR NEVER STAMPS A STATE NOBODY DREW (STATE_MODEL §5 rule 5, 2026-09-03).
|
|
225
|
+
* `inline` is the retirement of a CHAT-lifetime card. A v2 slice whose public menu
|
|
226
|
+
* has no `inline` cannot wear it — worn anyway, the renderer fell back to the
|
|
227
|
+
* default drawing and the chat flow painted retired GRID cards into the
|
|
228
|
+
* conversation (observed live: BPP course cards). Such a slice retires to its
|
|
229
|
+
* DECLARED base, written WITHOUT a touch: its delivery was just spent
|
|
230
|
+
* (`spendDelivery` runs first), and a touch would re-admit it to the delivery it
|
|
231
|
+
* is leaving — the mount would hold the very cards the clear retired.
|
|
224
232
|
*/
|
|
225
233
|
supersedeAll(arrivingChatId?: string): void {
|
|
226
234
|
let changed = false;
|
|
@@ -229,6 +237,18 @@ export class ComponentStore {
|
|
|
229
237
|
if (slice.lifetime === "conversation") continue;
|
|
230
238
|
const v = (slice.state ?? slice.view ?? slice.defaultState) as unknown;
|
|
231
239
|
if (typeof v !== "string" || !v || v === "inline") continue;
|
|
240
|
+
const menu = Array.isArray(slice.publicStates) ? (slice.publicStates as unknown[]) : undefined;
|
|
241
|
+
if (menu && !menu.includes("inline")) {
|
|
242
|
+
const base = typeof slice.initialView === "string" ? slice.initialView : undefined;
|
|
243
|
+
if (base && v !== base) {
|
|
244
|
+
const next: Record<string, unknown> = { ...slice };
|
|
245
|
+
next[this.faceKey(next)] = base;
|
|
246
|
+
if ("defaultState" in next) next.defaultState = base;
|
|
247
|
+
this.data.set(key, next);
|
|
248
|
+
changed = true;
|
|
249
|
+
}
|
|
250
|
+
continue;
|
|
251
|
+
}
|
|
232
252
|
const next: Record<string, unknown> = { ...slice };
|
|
233
253
|
next[this.faceKey(next)] = "inline";
|
|
234
254
|
if ("defaultState" in next) next.defaultState = "inline";
|