@xyne/workflow-sdk 3.2.47 → 3.2.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/host-agent-step.d.ts +2 -2
- package/dist/connectors/builtin/steps/classifier-agent.step.d.ts +2 -2
- package/dist/connectors/builtin/steps/parallel.step.d.ts +4 -4
- package/dist/connectors/builtin/steps/wait.step.d.ts +28 -0
- package/dist/connectors/builtin/steps/wait.step.d.ts.map +1 -1
- package/dist/connectors/builtin/steps/wait.step.js +26 -1
- package/dist/connectors/builtin/steps/wait.step.js.map +1 -1
- package/dist/conversational-flow/calls.d.ts +20 -0
- package/dist/conversational-flow/calls.d.ts.map +1 -0
- package/dist/conversational-flow/calls.js +59 -0
- package/dist/conversational-flow/calls.js.map +1 -0
- package/dist/conversational-flow/conditions.d.ts +24 -0
- package/dist/conversational-flow/conditions.d.ts.map +1 -0
- package/dist/conversational-flow/conditions.js +69 -0
- package/dist/conversational-flow/conditions.js.map +1 -0
- package/dist/conversational-flow/create.d.ts +23 -18
- package/dist/conversational-flow/create.d.ts.map +1 -1
- package/dist/conversational-flow/create.js +73 -96
- package/dist/conversational-flow/create.js.map +1 -1
- package/dist/conversational-flow/edit/build.d.ts +112 -0
- package/dist/conversational-flow/edit/build.d.ts.map +1 -0
- package/dist/conversational-flow/edit/build.js +249 -0
- package/dist/conversational-flow/edit/build.js.map +1 -0
- package/dist/conversational-flow/edit/calls.d.ts +61 -0
- package/dist/conversational-flow/edit/calls.d.ts.map +1 -0
- package/dist/conversational-flow/edit/calls.js +296 -0
- package/dist/conversational-flow/edit/calls.js.map +1 -0
- package/dist/conversational-flow/edit/cases.d.ts +29 -0
- package/dist/conversational-flow/edit/cases.d.ts.map +1 -0
- package/dist/conversational-flow/edit/cases.js +83 -0
- package/dist/conversational-flow/edit/cases.js.map +1 -0
- package/dist/conversational-flow/edit/endings.d.ts +16 -0
- package/dist/conversational-flow/edit/endings.d.ts.map +1 -0
- package/dist/conversational-flow/edit/endings.js +53 -0
- package/dist/conversational-flow/edit/endings.js.map +1 -0
- package/dist/conversational-flow/edit/followups.d.ts +28 -0
- package/dist/conversational-flow/edit/followups.d.ts.map +1 -0
- package/dist/conversational-flow/edit/followups.js +103 -0
- package/dist/conversational-flow/edit/followups.js.map +1 -0
- package/dist/conversational-flow/edit/inputs.d.ts +24 -0
- package/dist/conversational-flow/edit/inputs.d.ts.map +1 -0
- package/dist/conversational-flow/edit/inputs.js +53 -0
- package/dist/conversational-flow/edit/inputs.js.map +1 -0
- package/dist/conversational-flow/edit/kinds.d.ts +29 -0
- package/dist/conversational-flow/edit/kinds.d.ts.map +1 -0
- package/dist/conversational-flow/edit/kinds.js +142 -0
- package/dist/conversational-flow/edit/kinds.js.map +1 -0
- package/dist/conversational-flow/edit/options.d.ts +68 -0
- package/dist/conversational-flow/edit/options.d.ts.map +1 -0
- package/dist/conversational-flow/edit/options.js +209 -0
- package/dist/conversational-flow/edit/options.js.map +1 -0
- package/dist/conversational-flow/edit/picklist.d.ts +28 -0
- package/dist/conversational-flow/edit/picklist.d.ts.map +1 -0
- package/dist/conversational-flow/edit/picklist.js +58 -0
- package/dist/conversational-flow/edit/picklist.js.map +1 -0
- package/dist/conversational-flow/edit/prompts.d.ts +24 -0
- package/dist/conversational-flow/edit/prompts.d.ts.map +1 -0
- package/dist/conversational-flow/edit/prompts.js +180 -0
- package/dist/conversational-flow/edit/prompts.js.map +1 -0
- package/dist/conversational-flow/edit/routers.d.ts +65 -0
- package/dist/conversational-flow/edit/routers.d.ts.map +1 -0
- package/dist/conversational-flow/edit/routers.js +208 -0
- package/dist/conversational-flow/edit/routers.js.map +1 -0
- package/dist/conversational-flow/edit/screens.d.ts +44 -0
- package/dist/conversational-flow/edit/screens.d.ts.map +1 -0
- package/dist/conversational-flow/edit/screens.js +137 -0
- package/dist/conversational-flow/edit/screens.js.map +1 -0
- package/dist/conversational-flow/edit/versions.d.ts +43 -0
- package/dist/conversational-flow/edit/versions.d.ts.map +1 -0
- package/dist/conversational-flow/edit/versions.js +189 -0
- package/dist/conversational-flow/edit/versions.js.map +1 -0
- package/dist/conversational-flow/index.d.ts +33 -16
- package/dist/conversational-flow/index.d.ts.map +1 -1
- package/dist/conversational-flow/index.js +42 -9
- package/dist/conversational-flow/index.js.map +1 -1
- package/dist/conversational-flow/json.d.ts +15 -0
- package/dist/conversational-flow/json.d.ts.map +1 -0
- package/dist/conversational-flow/json.js +14 -0
- package/dist/conversational-flow/json.js.map +1 -0
- package/dist/conversational-flow/jumps.d.ts +22 -0
- package/dist/conversational-flow/jumps.d.ts.map +1 -0
- package/dist/conversational-flow/jumps.js +160 -0
- package/dist/conversational-flow/jumps.js.map +1 -0
- package/dist/conversational-flow/locate.d.ts +30 -0
- package/dist/conversational-flow/locate.d.ts.map +1 -0
- package/dist/conversational-flow/locate.js +73 -0
- package/dist/conversational-flow/locate.js.map +1 -0
- package/dist/conversational-flow/paths.d.ts +31 -0
- package/dist/conversational-flow/paths.d.ts.map +1 -0
- package/dist/conversational-flow/paths.js +50 -0
- package/dist/conversational-flow/paths.js.map +1 -0
- package/dist/conversational-flow/prompt.d.ts +48 -0
- package/dist/conversational-flow/prompt.d.ts.map +1 -0
- package/dist/conversational-flow/prompt.js +161 -0
- package/dist/conversational-flow/prompt.js.map +1 -0
- package/dist/conversational-flow/read.d.ts +9 -17
- package/dist/conversational-flow/read.d.ts.map +1 -1
- package/dist/conversational-flow/read.js +217 -384
- package/dist/conversational-flow/read.js.map +1 -1
- package/dist/conversational-flow/rounds.d.ts +29 -0
- package/dist/conversational-flow/rounds.d.ts.map +1 -0
- package/dist/conversational-flow/rounds.js +41 -0
- package/dist/conversational-flow/rounds.js.map +1 -0
- package/dist/conversational-flow/routers.d.ts +24 -80
- package/dist/conversational-flow/routers.d.ts.map +1 -1
- package/dist/conversational-flow/routers.js +76 -262
- package/dist/conversational-flow/routers.js.map +1 -1
- package/dist/conversational-flow/settle.d.ts +21 -15
- package/dist/conversational-flow/settle.d.ts.map +1 -1
- package/dist/conversational-flow/settle.js +240 -38
- package/dist/conversational-flow/settle.js.map +1 -1
- package/dist/conversational-flow/shape.d.ts +114 -0
- package/dist/conversational-flow/shape.d.ts.map +1 -0
- package/dist/conversational-flow/shape.js +209 -0
- package/dist/conversational-flow/shape.js.map +1 -0
- package/dist/conversational-flow/testing.d.ts +54 -0
- package/dist/conversational-flow/testing.d.ts.map +1 -0
- package/dist/conversational-flow/testing.js +119 -0
- package/dist/conversational-flow/testing.js.map +1 -0
- package/dist/conversational-flow/tree.d.ts +28 -17
- package/dist/conversational-flow/tree.d.ts.map +1 -1
- package/dist/conversational-flow/tree.js +60 -47
- package/dist/conversational-flow/tree.js.map +1 -1
- package/dist/conversational-flow/turn.d.ts +20 -22
- package/dist/conversational-flow/turn.d.ts.map +1 -1
- package/dist/conversational-flow/turn.js +69 -48
- package/dist/conversational-flow/turn.js.map +1 -1
- package/dist/conversational-flow/types.d.ts +154 -118
- package/dist/conversational-flow/types.d.ts.map +1 -1
- package/dist/conversational-flow/types.js +27 -51
- package/dist/conversational-flow/types.js.map +1 -1
- package/dist/conversational-flow/typing.d.ts +31 -0
- package/dist/conversational-flow/typing.d.ts.map +1 -0
- package/dist/conversational-flow/typing.js +53 -0
- package/dist/conversational-flow/typing.js.map +1 -0
- package/dist/engine/variable-resolver.d.ts +16 -0
- package/dist/engine/variable-resolver.d.ts.map +1 -1
- package/dist/engine/variable-resolver.js +45 -1
- package/dist/engine/variable-resolver.js.map +1 -1
- package/dist/types/pause-state.d.ts +9 -0
- package/dist/types/pause-state.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/conversational-flow/edit.d.ts +0 -101
- package/dist/conversational-flow/edit.d.ts.map +0 -1
- package/dist/conversational-flow/edit.js +0 -785
- package/dist/conversational-flow/edit.js.map +0 -1
- package/dist/conversational-flow/internals.d.ts +0 -51
- package/dist/conversational-flow/internals.d.ts.map +0 -1
- package/dist/conversational-flow/internals.js +0 -163
- package/dist/conversational-flow/internals.js.map +0 -1
- package/dist/conversational-flow/lookup-edit.d.ts +0 -96
- package/dist/conversational-flow/lookup-edit.d.ts.map +0 -1
- package/dist/conversational-flow/lookup-edit.js +0 -266
- package/dist/conversational-flow/lookup-edit.js.map +0 -1
- package/dist/conversational-flow/lookups.d.ts +0 -46
- package/dist/conversational-flow/lookups.d.ts.map +0 -1
- package/dist/conversational-flow/lookups.js +0 -145
- package/dist/conversational-flow/lookups.js.map +0 -1
- package/dist/conversational-flow/router-edit.d.ts +0 -53
- package/dist/conversational-flow/router-edit.d.ts.map +0 -1
- package/dist/conversational-flow/router-edit.js +0 -191
- package/dist/conversational-flow/router-edit.js.map +0 -1
|
@@ -1,108 +1,140 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { asArray, asRec, asSteps, str } from './json.js';
|
|
2
|
+
import { declaredFields, readCall } from './calls.js';
|
|
3
|
+
import { readPrompt, splitDestination } from './prompt.js';
|
|
4
|
+
import { caseKind, casesOf, isCall, isCycle, jumpsIn, partsOf, routeKeyOf, switchIn } from './shape.js';
|
|
5
|
+
import { AGENT_STEP_TYPE, CLASSIFIER_STEP_TYPE, END_MESSAGE_KEY, HANDOFF_SECTION, optionsOf, QUESTION_SEPARATOR, } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* What the conversation is started with: the manual trigger's own input schema,
|
|
8
|
+
* under `context` — which is where the Conversation API puts what the caller
|
|
9
|
+
* passed in. Undeclared, a flow simply promises nothing.
|
|
10
|
+
*/
|
|
11
|
+
function conversationInputs(config) {
|
|
12
|
+
const schema = asRec(asRec(asRec(config.trigger)['config'])['inputSchema']);
|
|
13
|
+
const context = asRec(asRec(schema['properties'])['context']);
|
|
14
|
+
return declaredFields(Object.keys(context).length > 0 ? context : {});
|
|
15
|
+
}
|
|
16
|
+
/** The way out an Ask AI agent answers with: `{{steps.<agent>.output.choice}}`. */
|
|
17
|
+
const AGENT_CHOICE = /^\{\{\s*steps\.[^.\s}]+\.output\.choice\s*\}\}$/;
|
|
6
18
|
export function readConversationalFlow(config) {
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
19
|
+
const top = asSteps(config.steps);
|
|
20
|
+
const root = top.find(isCycle);
|
|
21
|
+
if (!root)
|
|
22
|
+
return null;
|
|
23
|
+
const routeKey = routeKeyOf(root);
|
|
24
|
+
if (!routeKey)
|
|
25
|
+
return null;
|
|
26
|
+
const ctx = { routeKey, typeOf: indexTypes(top) };
|
|
27
|
+
const screens = [];
|
|
28
|
+
// Calls before the conversation's own cycle belong to its first screen, and
|
|
29
|
+
// so are in scope for every screen in the flow.
|
|
30
|
+
const opening = top.slice(0, top.indexOf(root)).filter(isCall);
|
|
31
|
+
readSection(root, opening.map((step) => readCall(step, 'conversation', undefined)), undefined, 0, [], ctx, screens);
|
|
32
|
+
if (!screens.some((s) => s.id === root.id))
|
|
33
|
+
return null;
|
|
34
|
+
markBackLinks(screens);
|
|
35
|
+
settleMenusAndMessages(screens);
|
|
36
|
+
return { rootScreen: root.id, routeKey, screens, inputs: conversationInputs(config) };
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* One frame: the cycle whose id is this section's screen. Its own screen is a
|
|
40
|
+
* case inside it, so what the section fetched — which sits outside the cycle —
|
|
41
|
+
* is in scope for that screen and everything beside it.
|
|
42
|
+
*/
|
|
43
|
+
function readSection(cycle, calls, parent, depth, frames, ctx, out) {
|
|
44
|
+
const routing = switchIn(cycle);
|
|
45
|
+
if (!routing)
|
|
46
|
+
return;
|
|
47
|
+
const inside = [...frames, cycle.id];
|
|
48
|
+
const children = [];
|
|
49
|
+
for (const entry of casesOf(routing)) {
|
|
50
|
+
const kind = caseKind(entry, ctx.routeKey);
|
|
51
|
+
if (!kind)
|
|
15
52
|
continue;
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
53
|
+
const { calls: own, rest } = partsOf(entry, ctx.routeKey);
|
|
54
|
+
if (kind.kind === 'section') {
|
|
55
|
+
const inner = rest.find(isCycle);
|
|
56
|
+
if (!inner)
|
|
57
|
+
continue;
|
|
58
|
+
readSection(inner, own.map((c) => readCall(c.step, 'section', c.onFail)), cycle.id, depth + 1, inside, ctx, out);
|
|
59
|
+
children.push(inner.id);
|
|
20
60
|
continue;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
fallback: finalise(branchDestination(asSteps(routerConfig['default']), ctx, [])),
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
/** The loop-input key every case switches on, or null if the cases disagree or aren't `eq`. */
|
|
40
|
-
function routeKeyOf(cases) {
|
|
41
|
-
if (cases.length === 0)
|
|
42
|
-
return null;
|
|
43
|
-
let key = null;
|
|
44
|
-
for (const c of cases) {
|
|
45
|
-
const cond = asRec(c['condition']);
|
|
46
|
-
const match = typeof cond['variable'] === 'string' ? LOOP_INPUT.exec(cond['variable']) : null;
|
|
47
|
-
if (!match || cond['operator'] !== 'eq' || cond['value'] === undefined)
|
|
48
|
-
return null;
|
|
49
|
-
if (key !== null && key !== match[1])
|
|
50
|
-
return null;
|
|
51
|
-
key = match[1];
|
|
61
|
+
}
|
|
62
|
+
// The section's own screen keeps the section's place; everything else in
|
|
63
|
+
// this switch sits one level in.
|
|
64
|
+
const isOwn = kind.screen === cycle.id;
|
|
65
|
+
out.push(readScreen(kind.screen, entry, rest, {
|
|
66
|
+
calls: [...(isOwn ? calls : []), ...own.map((c) => readCall(c.step, 'screen', c.onFail))],
|
|
67
|
+
parent: isOwn ? parent : cycle.id,
|
|
68
|
+
depth: isOwn ? depth : depth + 1,
|
|
69
|
+
frames: inside,
|
|
70
|
+
ctx,
|
|
71
|
+
}));
|
|
72
|
+
if (!isOwn)
|
|
73
|
+
children.push(kind.screen);
|
|
52
74
|
}
|
|
53
|
-
|
|
75
|
+
const own = out.find((s) => s.id === cycle.id);
|
|
76
|
+
if (own)
|
|
77
|
+
own.children = children;
|
|
54
78
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const id = String(asRec(entry['condition'])['value']);
|
|
58
|
-
const label = typeof entry['label'] === 'string' ? entry['label'].trim() : '';
|
|
59
|
-
const steps = asSteps(entry['steps']);
|
|
79
|
+
function readScreen(id, entry, rest, at) {
|
|
80
|
+
const label = str(entry['label']);
|
|
60
81
|
const screen = {
|
|
61
82
|
id,
|
|
62
|
-
title: label
|
|
83
|
+
title: label ?? humanise(id),
|
|
63
84
|
kind: 'custom',
|
|
64
|
-
|
|
85
|
+
parent: at.parent,
|
|
86
|
+
depth: at.depth,
|
|
87
|
+
children: [],
|
|
88
|
+
frames: at.frames,
|
|
89
|
+
calls: at.calls,
|
|
65
90
|
about: undefined,
|
|
66
91
|
prompts: [],
|
|
92
|
+
versions: [],
|
|
67
93
|
router: undefined,
|
|
68
94
|
askAi: undefined,
|
|
69
95
|
endValue: undefined,
|
|
70
96
|
endMessage: undefined,
|
|
71
|
-
parent: undefined,
|
|
72
|
-
depth: -1,
|
|
73
97
|
};
|
|
74
|
-
const [first] =
|
|
98
|
+
const [first] = rest;
|
|
75
99
|
if (!first)
|
|
76
100
|
return screen;
|
|
101
|
+
// A SWITCH before any question is the screen asking more than one way: one
|
|
102
|
+
// branch per condition, and `default` for when none of them hold. Follow-ups
|
|
103
|
+
// are a SWITCH too, but always *after* a WAIT, so position tells them apart.
|
|
104
|
+
if (first.type === 'SWITCH') {
|
|
105
|
+
const versions = versionsOf(first, at.ctx, screen);
|
|
106
|
+
if (versions) {
|
|
107
|
+
screen.kind = versions;
|
|
108
|
+
return screen;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
77
111
|
if (first.type === 'WAIT') {
|
|
78
|
-
readPrompt(
|
|
79
|
-
screen.about =
|
|
112
|
+
readPrompt(rest, at.ctx, screen.prompts);
|
|
113
|
+
screen.about = str(first.description);
|
|
80
114
|
if (isHandoff(first)) {
|
|
81
115
|
screen.kind = 'handoff';
|
|
82
116
|
return screen;
|
|
83
117
|
}
|
|
84
|
-
const askAi = readAskAi(
|
|
118
|
+
const askAi = readAskAi(rest, screen.prompts[0], at.ctx);
|
|
85
119
|
if (askAi) {
|
|
86
120
|
screen.kind = 'ask-ai';
|
|
87
121
|
screen.askAi = askAi;
|
|
88
122
|
return screen;
|
|
89
123
|
}
|
|
90
|
-
// Menu vs message needs the tree; settled once every screen is placed.
|
|
91
124
|
screen.kind = screen.prompts[0]?.pickSwitchId ? 'questions' : 'menu';
|
|
92
125
|
return screen;
|
|
93
126
|
}
|
|
94
|
-
if (
|
|
127
|
+
if (rest.length === 1 && first.type === 'FINISH') {
|
|
95
128
|
screen.kind = 'end';
|
|
96
|
-
// A Finish has no question to carry its "about", so its own step does —
|
|
97
|
-
// writing one is what lets
|
|
98
|
-
screen.about =
|
|
129
|
+
// A Finish has no question to carry its "about", so its own step does —
|
|
130
|
+
// and writing one is what lets the router end a conversation here.
|
|
131
|
+
screen.about = str(first.description);
|
|
99
132
|
const { [END_MESSAGE_KEY]: message, ...result } = asRec(asRec(first.config)['with']);
|
|
100
133
|
screen.endValue = result;
|
|
101
|
-
|
|
102
|
-
screen.endMessage = message;
|
|
134
|
+
screen.endMessage = str(message);
|
|
103
135
|
return screen;
|
|
104
136
|
}
|
|
105
|
-
const router = readRouter(
|
|
137
|
+
const router = readRouter(rest, at.ctx);
|
|
106
138
|
if (router) {
|
|
107
139
|
screen.kind = 'router';
|
|
108
140
|
screen.router = router;
|
|
@@ -110,353 +142,138 @@ function readScreen(entry, caseIndex, ctx) {
|
|
|
110
142
|
return screen;
|
|
111
143
|
}
|
|
112
144
|
/**
|
|
113
|
-
*
|
|
114
|
-
*
|
|
145
|
+
* Every way a screen asks, read in the order the switch tries them: each case's
|
|
146
|
+
* question carries the condition it is asked under, and `default`'s carries
|
|
147
|
+
* none. What the screen *is* comes from the version asked when nothing else
|
|
148
|
+
* holds, since that is the one it always has.
|
|
115
149
|
*/
|
|
116
|
-
function
|
|
117
|
-
const
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
picked = asSteps(gateConfig['if_false']);
|
|
150
|
+
function versionsOf(switchStep, ctx, screen) {
|
|
151
|
+
const config = asRec(switchStep.config);
|
|
152
|
+
const branches = [
|
|
153
|
+
...asArray(config['cases']).map(asRec).map((entry) => ({
|
|
154
|
+
when: asCondition(entry['condition']),
|
|
155
|
+
steps: asSteps(entry['steps']),
|
|
156
|
+
})),
|
|
157
|
+
{ when: undefined, steps: asSteps(config['default']) },
|
|
158
|
+
];
|
|
159
|
+
if (!branches.every((b) => b.steps[0]?.type === 'WAIT'))
|
|
160
|
+
return null;
|
|
161
|
+
let kind = 'custom';
|
|
162
|
+
for (const branch of branches) {
|
|
163
|
+
const from = screen.prompts.length;
|
|
164
|
+
readPrompt(branch.steps, ctx, screen.prompts);
|
|
165
|
+
const asked = screen.prompts[from];
|
|
166
|
+
if (!asked)
|
|
167
|
+
continue;
|
|
168
|
+
if (branch.when)
|
|
169
|
+
asked.when = branch.when;
|
|
170
|
+
screen.versions.push({ ...(branch.when ? { when: branch.when } : {}), promptId: asked.id });
|
|
171
|
+
// The version asked when nothing else holds is what the screen is.
|
|
172
|
+
if (!branch.when) {
|
|
173
|
+
screen.about = str(branch.steps[0]?.description) ?? screen.about;
|
|
174
|
+
kind = asked?.pickSwitchId ? 'questions' : 'menu';
|
|
175
|
+
}
|
|
143
176
|
}
|
|
144
|
-
|
|
145
|
-
const { byValue, switchId } = pickedDestinations(picked, wait.id, choiceField, ctx, out);
|
|
146
|
-
prompt.pickSwitchId = switchId;
|
|
147
|
-
prompt.options = options.map((o) => {
|
|
148
|
-
const value = String(o['value'] ?? '');
|
|
149
|
-
const resolved = byValue(value);
|
|
150
|
-
return {
|
|
151
|
-
label: String(o['label'] ?? value),
|
|
152
|
-
value,
|
|
153
|
-
to: resolved.kind === 'choice' ? { kind: 'screen', screen: value } : resolved,
|
|
154
|
-
back: false,
|
|
155
|
-
};
|
|
156
|
-
});
|
|
157
|
-
return prompt.id;
|
|
177
|
+
return kind;
|
|
158
178
|
}
|
|
159
179
|
/**
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
* (a follow-up question, a fixed jump) and sends the rest to its default.
|
|
180
|
+
* A router: a step that names the next screen, and a jump that carries its
|
|
181
|
+
* answer on. Its candidates are settled from the screens its switch can open.
|
|
163
182
|
*/
|
|
164
|
-
function
|
|
165
|
-
const
|
|
166
|
-
if (
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
if (!first)
|
|
189
|
-
return { kind: 'none' };
|
|
190
|
-
if (first.type === 'WAIT')
|
|
191
|
-
return { kind: 'prompt', prompt: readPrompt(steps, ctx, out) };
|
|
192
|
-
if (steps.length === 1)
|
|
193
|
-
return jumpDestination(first, ctx);
|
|
194
|
-
return { kind: 'none' };
|
|
195
|
-
}
|
|
196
|
-
function jumpDestination(step, ctx) {
|
|
197
|
-
if (!isAimedAtCycle(step, ctx))
|
|
198
|
-
return { kind: 'none' };
|
|
199
|
-
const carried = asRec(asRec(step.config)['with']);
|
|
200
|
-
if (step.type === 'FINISH')
|
|
201
|
-
return { kind: 'end', value: carried };
|
|
202
|
-
if (step.type !== 'GO_TO')
|
|
203
|
-
return { kind: 'none' };
|
|
204
|
-
const next = carried[ctx.routeKey];
|
|
205
|
-
if (typeof next !== 'string' || next === '')
|
|
206
|
-
return { kind: 'none' };
|
|
207
|
-
if (!next.includes('{{'))
|
|
208
|
-
return { kind: 'screen', screen: next };
|
|
209
|
-
const pick = WAIT_FIELD.exec(next);
|
|
210
|
-
if (pick && ctx.typeOf.get(pick[1]) === 'WAIT')
|
|
211
|
-
return { kind: 'choice', wait: pick[1], field: pick[2] };
|
|
212
|
-
const source = STEP_OUTPUT.exec(next);
|
|
213
|
-
if (source)
|
|
214
|
-
return { kind: 'dynamic', from: source[1], fromType: ctx.typeOf.get(source[1]) };
|
|
215
|
-
return { kind: 'none' };
|
|
216
|
-
}
|
|
217
|
-
/** A pick forwarded outside an option list has no single screen to name. */
|
|
218
|
-
function finalise(resolved) {
|
|
219
|
-
return resolved.kind === 'choice' ? { kind: 'none' } : resolved;
|
|
220
|
-
}
|
|
221
|
-
// ─── Routers ───
|
|
222
|
-
function readRouter(steps, ctx) {
|
|
223
|
-
/** The step's answer is carried on by a GO_TO in the same case. */
|
|
224
|
-
const forwards = (id) => steps.some((s) => {
|
|
225
|
-
const d = jumpDestination(s, ctx);
|
|
226
|
-
return d.kind === 'dynamic' && d.from === id;
|
|
227
|
-
});
|
|
228
|
-
// A classifier picks the screen: CLASSIFIER_AGENT, then a GO_TO carrying
|
|
229
|
-
// `{{steps.<it>.output.class}}`. Its classes are the screens it may choose.
|
|
230
|
-
const classifier = steps.find((s) => s.type === CLASSIFIER_STEP_TYPE);
|
|
231
|
-
if (classifier && forwards(classifier.id)) {
|
|
232
|
-
const config = asRec(classifier.config);
|
|
233
|
-
return {
|
|
234
|
-
mode: 'classifier',
|
|
235
|
-
stepId: classifier.id,
|
|
236
|
-
scope: typeof config['scope'] === 'string' ? config['scope'] : undefined,
|
|
237
|
-
agent: undefined,
|
|
238
|
-
model: typeof config['model'] === 'string' ? config['model'] : undefined,
|
|
239
|
-
credentialName: typeof config['credentialName'] === 'string' ? config['credentialName'] : undefined,
|
|
240
|
-
minConfidence: typeof config['minConfidence'] === 'number' ? config['minConfidence'] : undefined,
|
|
241
|
-
task: typeof config['instructions'] === 'string' ? config['instructions'] : undefined,
|
|
242
|
-
guidance: typeof classifier.description === 'string' && classifier.description.trim() ? classifier.description : undefined,
|
|
243
|
-
candidates: Object.keys(asRec(config['classes'])),
|
|
244
|
-
rules: [],
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
// An agent picks the screen: RUN_AGENT, then a GO_TO carrying its answer.
|
|
248
|
-
const agent = steps.find((s) => s.type === AGENT_STEP_TYPE);
|
|
249
|
-
if (agent) {
|
|
250
|
-
if (forwards(agent.id)) {
|
|
251
|
-
const config = asRec(agent.config);
|
|
252
|
-
return {
|
|
253
|
-
mode: 'agent',
|
|
254
|
-
stepId: agent.id,
|
|
255
|
-
scope: typeof config['scope'] === 'string' ? config['scope'] : undefined,
|
|
256
|
-
agent: typeof config['agentSlug'] === 'string' ? config['agentSlug'] : undefined,
|
|
257
|
-
model: undefined,
|
|
258
|
-
credentialName: undefined,
|
|
259
|
-
minConfidence: undefined,
|
|
260
|
-
task: typeof config['task'] === 'string' ? config['task'] : undefined,
|
|
261
|
-
guidance: typeof agent.description === 'string' && agent.description.trim() ? agent.description : undefined,
|
|
262
|
-
candidates: enumOf(asRec(config['outputSchema']), ctx.routeKey),
|
|
263
|
-
rules: [],
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
// Keywords pick the screen: a SWITCH whose every case ends in a fixed jump.
|
|
268
|
-
const [only] = steps;
|
|
269
|
-
if (only?.type === 'SWITCH' && steps.length === 1) {
|
|
270
|
-
const cases = asArray(asRec(only.config)['cases']).map(asRec);
|
|
271
|
-
const rules = [];
|
|
272
|
-
for (const c of cases) {
|
|
273
|
-
const branch = asSteps(c['steps']);
|
|
274
|
-
const dest = branch.length === 1 ? jumpDestination(branch[0], ctx) : { kind: 'none' };
|
|
275
|
-
if (dest.kind !== 'screen')
|
|
276
|
-
return undefined;
|
|
277
|
-
rules.push({ words: literalValues(c['condition']), screen: dest.screen });
|
|
278
|
-
}
|
|
279
|
-
if (rules.length > 0) {
|
|
280
|
-
return {
|
|
281
|
-
mode: 'keywords',
|
|
282
|
-
stepId: only.id,
|
|
283
|
-
scope: undefined,
|
|
284
|
-
agent: undefined,
|
|
285
|
-
model: undefined,
|
|
286
|
-
credentialName: undefined,
|
|
287
|
-
minConfidence: undefined,
|
|
288
|
-
task: undefined,
|
|
289
|
-
guidance: undefined,
|
|
290
|
-
candidates: [...new Set(rules.map((r) => r.screen))],
|
|
291
|
-
rules,
|
|
292
|
-
};
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
return undefined;
|
|
183
|
+
function readRouter(rest, ctx) {
|
|
184
|
+
const deciding = rest.find((s) => s.type === CLASSIFIER_STEP_TYPE || s.type === AGENT_STEP_TYPE);
|
|
185
|
+
if (!deciding)
|
|
186
|
+
return undefined;
|
|
187
|
+
const carried = splitDestination(rest, ctx);
|
|
188
|
+
if (carried?.kind !== 'dynamic' || carried.from !== deciding.id)
|
|
189
|
+
return undefined;
|
|
190
|
+
const config = asRec(deciding.config);
|
|
191
|
+
// A classifier's choices are its classes; an agent's are the ids its answer
|
|
192
|
+
// is allowed to name.
|
|
193
|
+
const classes = deciding.type === CLASSIFIER_STEP_TYPE
|
|
194
|
+
? Object.keys(asRec(config['classes']))
|
|
195
|
+
: enumOf(asRec(config['outputSchema']), ctx.routeKey);
|
|
196
|
+
return {
|
|
197
|
+
mode: deciding.type === CLASSIFIER_STEP_TYPE ? 'classifier' : 'agent',
|
|
198
|
+
stepId: deciding.id,
|
|
199
|
+
agent: str(config['agentSlug']),
|
|
200
|
+
model: str(config['model']),
|
|
201
|
+
credentialName: str(config['credentialName']),
|
|
202
|
+
minConfidence: typeof config['minConfidence'] === 'number' ? config['minConfidence'] : undefined,
|
|
203
|
+
task: str(config['instructions']) ?? str(config['task']),
|
|
204
|
+
guidance: str(deciding.description),
|
|
205
|
+
candidates: classes,
|
|
206
|
+
};
|
|
296
207
|
}
|
|
297
208
|
/**
|
|
298
|
-
* An agent that answers until they leave
|
|
299
|
-
*
|
|
300
|
-
*
|
|
301
|
-
* continues the conversation, a way out ends it — and a GO_TO then carries the
|
|
302
|
-
* chosen way out (`{{steps.<agent>.output.choice}}`). The ways out are the
|
|
303
|
-
* WAIT's options — offered again after every answer.
|
|
209
|
+
* An agent that answers until they leave: the screen asks first, a typed
|
|
210
|
+
* question goes to an agent that waits for a reply after each answer, and a
|
|
211
|
+
* jump then carries the way out the agent was told to name.
|
|
304
212
|
*/
|
|
305
|
-
function readAskAi(
|
|
306
|
-
const gate =
|
|
213
|
+
function readAskAi(rest, prompt, ctx) {
|
|
214
|
+
const gate = rest[1];
|
|
307
215
|
if (!prompt || gate?.type !== 'CONDITIONAL')
|
|
308
216
|
return undefined;
|
|
309
217
|
const typed = asSteps(asRec(gate.config)['if_true']);
|
|
310
218
|
const agent = typed[0];
|
|
311
219
|
if (agent?.type !== AGENT_STEP_TYPE || asRec(agent.config)['waitForReply'] !== true)
|
|
312
220
|
return undefined;
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
221
|
+
// What it answers with leaves the screen — as one jump, or as the chain of
|
|
222
|
+
// them a deep screen needs; either way they all carry the same answer.
|
|
223
|
+
const leaving = splitDestination(typed.slice(1), ctx);
|
|
224
|
+
if (leaving?.kind !== 'dynamic' || leaving.from !== agent.id)
|
|
225
|
+
return undefined;
|
|
226
|
+
if (!AGENT_CHOICE.test(agentChoice(typed.slice(1), ctx.routeKey)))
|
|
316
227
|
return undefined;
|
|
317
228
|
const config = asRec(agent.config);
|
|
318
|
-
const task =
|
|
229
|
+
const task = str(config['task']) ?? '';
|
|
230
|
+
const at = task.lastIndexOf(QUESTION_SEPARATOR);
|
|
319
231
|
return {
|
|
320
232
|
stepId: agent.id,
|
|
321
|
-
agent:
|
|
322
|
-
task:
|
|
233
|
+
agent: str(config['agentSlug']),
|
|
234
|
+
task: at === -1 ? task : task.slice(0, at),
|
|
323
235
|
intro: prompt.text,
|
|
324
236
|
exits: prompt.options,
|
|
325
237
|
};
|
|
326
238
|
}
|
|
327
|
-
/**
|
|
328
|
-
export const HANDOFF_SECTION = 'handoff';
|
|
329
|
-
/**
|
|
330
|
-
* A hand off: a WAIT that shows the `handoff` section. The person who takes the
|
|
331
|
-
* conversation answers it — with a Finish to close it, or a screen to send it
|
|
332
|
-
* back to — and a GO_TO carries that on.
|
|
333
|
-
*
|
|
334
|
-
* The section doubles as the marker. `display` is for showing data, but it is
|
|
335
|
-
* the one thing that tells a hand off from a plain screen: everything else is
|
|
336
|
-
* the same WAIT, options and GO_TO. A WAIT field of its own for this, or the
|
|
337
|
-
* `webhook` mode, would make it structural instead.
|
|
338
|
-
*/
|
|
239
|
+
/** A hand off is a WAIT that shows the `handoff` section — its one marker. */
|
|
339
240
|
function isHandoff(wait) {
|
|
340
|
-
return asArray(asRec(wait.config)['display']).some((
|
|
341
|
-
}
|
|
342
|
-
const REVIEW_CHOICE = /^\{\{\s*steps\.[^.\s}]+\.output\.choice\s*\}\}$/;
|
|
343
|
-
/** An Ask AI task is the author's instructions, then the question the person typed. */
|
|
344
|
-
export const QUESTION_SEPARATOR = '\n\nTheir question: ';
|
|
345
|
-
function instructionsOf(task) {
|
|
346
|
-
const at = task.lastIndexOf(QUESTION_SEPARATOR);
|
|
347
|
-
return at === -1 ? task : task.slice(0, at);
|
|
348
|
-
}
|
|
349
|
-
/** The allowed values the agent may answer with for `key`, from its output schema. */
|
|
350
|
-
function enumOf(schema, key) {
|
|
351
|
-
const property = asRec(asRec(schema['properties'])[key]);
|
|
352
|
-
return asArray(property['enum']).filter((v) => typeof v === 'string');
|
|
353
|
-
}
|
|
354
|
-
// ─── Tree ───
|
|
355
|
-
/**
|
|
356
|
-
* Parent = the screen that first links to this one, walking options outward
|
|
357
|
-
* from the root. Routers, ends and hand offs sit outside the menu tree: every
|
|
358
|
-
* screen can reach them, so "first to link" would be meaningless.
|
|
359
|
-
*
|
|
360
|
-
* That is a statement about the menu, not about the picture: the map draws an
|
|
361
|
-
* ending that exactly one screen leads to beside that screen (see the layout's
|
|
362
|
-
* `leadsTo`), because that is where the author put it. Keeping it out of the
|
|
363
|
-
* tree keeps the meaning stable — an ending does not change what it is when a
|
|
364
|
-
* second screen starts offering it.
|
|
365
|
-
*/
|
|
366
|
-
function placeInTree(screens, rootScreen) {
|
|
367
|
-
const byId = new Map(screens.map((s) => [s.id, s]));
|
|
368
|
-
const inTree = (s) => !!s && s.kind !== 'router' && s.kind !== 'end' && s.kind !== 'handoff';
|
|
369
|
-
const root = byId.get(rootScreen);
|
|
370
|
-
if (!inTree(root))
|
|
371
|
-
return;
|
|
372
|
-
root.depth = 0;
|
|
373
|
-
const queue = [root];
|
|
374
|
-
while (queue.length > 0) {
|
|
375
|
-
const current = queue.shift();
|
|
376
|
-
for (const option of optionsOf(current)) {
|
|
377
|
-
if (option.to.kind !== 'screen')
|
|
378
|
-
continue;
|
|
379
|
-
const next = byId.get(option.to.screen);
|
|
380
|
-
if (!inTree(next) || next.depth !== -1)
|
|
381
|
-
continue;
|
|
382
|
-
next.parent = current.id;
|
|
383
|
-
next.depth = current.depth + 1;
|
|
384
|
-
queue.push(next);
|
|
385
|
-
}
|
|
386
|
-
}
|
|
241
|
+
return asArray(asRec(wait.config)['display']).map(asRec).some((section) => section['id'] === HANDOFF_SECTION);
|
|
387
242
|
}
|
|
243
|
+
// ─── Settling what the walk cannot know alone ───
|
|
244
|
+
/** An option leads "back" when it opens one of the screen's own ancestors. */
|
|
388
245
|
function markBackLinks(screens) {
|
|
389
|
-
const
|
|
390
|
-
const isAncestor = (candidate, of) => {
|
|
391
|
-
for (let at = parentOf.get(of); at !== undefined; at = parentOf.get(at)) {
|
|
392
|
-
if (at === candidate)
|
|
393
|
-
return true;
|
|
394
|
-
}
|
|
395
|
-
return false;
|
|
396
|
-
};
|
|
246
|
+
const parent = new Map(screens.map((s) => [s.id, s.parent]));
|
|
397
247
|
for (const screen of screens) {
|
|
248
|
+
const ancestors = new Set();
|
|
249
|
+
for (let at = parent.get(screen.id); at !== undefined; at = parent.get(at))
|
|
250
|
+
ancestors.add(at);
|
|
398
251
|
for (const option of optionsOf(screen)) {
|
|
399
|
-
|
|
252
|
+
if (option.to.kind === 'screen' && ancestors.has(option.to.screen))
|
|
253
|
+
option.back = true;
|
|
400
254
|
}
|
|
401
255
|
}
|
|
402
256
|
}
|
|
403
|
-
/**
|
|
404
|
-
* Menu and message are the same nodes; the difference is what the author is
|
|
405
|
-
* doing with them. A screen with screens beneath it is a menu. Without any, a
|
|
406
|
-
* screen that offers to finish ("That's all" → an end) is a message — and one
|
|
407
|
-
* that doesn't is a menu still waiting for its first screen.
|
|
408
|
-
*/
|
|
257
|
+
/** A screen with screens inside it is a menu; one without says something. */
|
|
409
258
|
function settleMenusAndMessages(screens) {
|
|
410
|
-
const ends = new Set(screens.filter((s) => s.kind === 'end').map((s) => s.id));
|
|
411
259
|
for (const screen of screens) {
|
|
412
|
-
if (screen.kind
|
|
413
|
-
|
|
414
|
-
const hasChildren = screens.some((s) => s.parent === screen.id);
|
|
415
|
-
const offersToFinish = optionsOf(screen).some((o) => o.to.kind === 'screen' && ends.has(o.to.screen));
|
|
416
|
-
screen.kind = !hasChildren && offersToFinish ? 'message' : 'menu';
|
|
260
|
+
if (screen.kind === 'menu' && screen.children.length === 0)
|
|
261
|
+
screen.kind = 'message';
|
|
417
262
|
}
|
|
418
263
|
}
|
|
419
|
-
// ───
|
|
420
|
-
function
|
|
421
|
-
return (step.type === 'GO_TO' || step.type === 'FINISH') && asRec(step.config)['target'] === ctx.cycleId;
|
|
422
|
-
}
|
|
423
|
-
function refersTo(variable, waitId, field) {
|
|
424
|
-
if (typeof variable !== 'string' || !field)
|
|
425
|
-
return false;
|
|
426
|
-
const match = WAIT_FIELD.exec(variable);
|
|
427
|
-
return !!match && match[1] === waitId && match[2] === field;
|
|
428
|
-
}
|
|
429
|
-
/** Whether any leaf of a condition tree reads this WAIT's field. */
|
|
430
|
-
function testsField(condition, waitId, field) {
|
|
431
|
-
const c = asRec(condition);
|
|
432
|
-
if (refersTo(c['variable'], waitId, field))
|
|
433
|
-
return true;
|
|
434
|
-
for (const key of ['all', 'any']) {
|
|
435
|
-
if (asArray(c[key]).some((child) => testsField(child, waitId, field)))
|
|
436
|
-
return true;
|
|
437
|
-
}
|
|
438
|
-
return c['not'] !== undefined && testsField(c['not'], waitId, field);
|
|
439
|
-
}
|
|
440
|
-
/** The literal values a condition tree compares against — a keyword rule's words. */
|
|
441
|
-
function literalValues(condition) {
|
|
442
|
-
const c = asRec(condition);
|
|
443
|
-
const own = typeof c['value'] === 'string' ? [c['value']] : [];
|
|
444
|
-
return [...own, ...asArray(c['all']).flatMap(literalValues), ...asArray(c['any']).flatMap(literalValues)];
|
|
445
|
-
}
|
|
446
|
-
function indexStepTypes(steps, into = new Map()) {
|
|
264
|
+
// ─── Plumbing ───
|
|
265
|
+
function indexTypes(steps, into = new Map()) {
|
|
447
266
|
for (const step of steps) {
|
|
448
267
|
into.set(step.id, step.type);
|
|
449
|
-
const
|
|
450
|
-
for (const value of Object.values(config)) {
|
|
268
|
+
for (const value of Object.values(asRec(step.config))) {
|
|
451
269
|
if (Array.isArray(value)) {
|
|
452
|
-
|
|
270
|
+
indexTypes(asSteps(value), into);
|
|
453
271
|
for (const entry of value)
|
|
454
|
-
|
|
272
|
+
indexTypes(asSteps(asRec(entry)['steps']), into);
|
|
455
273
|
}
|
|
456
274
|
else if (value && typeof value === 'object') {
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
indexStepTypes(asSteps(branch), into);
|
|
275
|
+
for (const branch of Object.values(asRec(value)))
|
|
276
|
+
indexTypes(asSteps(branch), into);
|
|
460
277
|
}
|
|
461
278
|
}
|
|
462
279
|
}
|
|
@@ -464,15 +281,31 @@ function indexStepTypes(steps, into = new Map()) {
|
|
|
464
281
|
}
|
|
465
282
|
function humanise(id) {
|
|
466
283
|
const words = id.replace(/[_-]+/g, ' ').trim();
|
|
467
|
-
return words ? words
|
|
284
|
+
return words ? words.charAt(0).toUpperCase() + words.slice(1) : id;
|
|
468
285
|
}
|
|
469
|
-
|
|
470
|
-
|
|
286
|
+
/** The ids an answer may name, from the shape the agent was told to reply in. */
|
|
287
|
+
function enumOf(schema, key) {
|
|
288
|
+
return asArray(asRec(asRec(schema['properties'])[key])['enum']).filter((v) => typeof v === 'string');
|
|
471
289
|
}
|
|
472
|
-
|
|
473
|
-
|
|
290
|
+
/** What a branch's jumps carry as the next screen — they all carry the same. */
|
|
291
|
+
function agentChoice(steps, routeKey) {
|
|
292
|
+
const jump = jumpsIn(steps)[0];
|
|
293
|
+
const carried = jump ? asRec(asRec(jump.config)['with'])[routeKey] : undefined;
|
|
294
|
+
return typeof carried === 'string' ? carried : '';
|
|
474
295
|
}
|
|
475
|
-
|
|
476
|
-
|
|
296
|
+
/** A case's test, when it is one the layer can show: a leaf, or a group of them. */
|
|
297
|
+
function asCondition(value) {
|
|
298
|
+
const rec = asRec(value);
|
|
299
|
+
for (const join of ['all', 'any']) {
|
|
300
|
+
if (!Array.isArray(rec[join]))
|
|
301
|
+
continue;
|
|
302
|
+
const parts = asArray(rec[join]).map(asCondition).filter((c) => c !== undefined);
|
|
303
|
+
return parts.length > 0 ? { [join]: parts } : undefined;
|
|
304
|
+
}
|
|
305
|
+
const variable = str(rec['variable']);
|
|
306
|
+
const operator = str(rec['operator']);
|
|
307
|
+
return variable && operator
|
|
308
|
+
? { variable, operator, ...('value' in rec ? { value: rec['value'] } : {}) }
|
|
309
|
+
: undefined;
|
|
477
310
|
}
|
|
478
311
|
//# sourceMappingURL=read.js.map
|