@joplo-app/core 0.1.3 → 0.2.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/dist/catalog.d.ts +1 -1
- package/dist/catalog.js +112 -105
- package/dist/compile.d.ts +2 -0
- package/dist/compile.js +109 -50
- package/dist/guide.d.ts +7 -7
- package/dist/guide.js +347 -296
- package/dist/load.js +5 -5
- package/dist/player.d.ts +39 -1
- package/dist/player.js +104 -19
- package/dist/schema.d.ts +181 -2
- package/dist/schema.js +25 -6
- package/dist/validate.js +34 -34
- package/package.json +2 -2
package/dist/guide.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { COMPONENT_TYPES, GATED_CONTAINERS, INTERACTIVE_TYPES, JOPLO_PROPS, VALUE_TYPES } from "./catalog.js";
|
|
2
2
|
import { JoploError } from "./result.js";
|
|
3
3
|
export const SKILL_TOPICS = [
|
|
4
|
-
{ name: 'authoring', description: '
|
|
5
|
-
{ name: 'demo', description: '
|
|
6
|
-
{ name: 'components', description: '
|
|
7
|
-
{ name: 'cases', description: '
|
|
8
|
-
{ name: 'check', description: '
|
|
9
|
-
{ name: 'selection', description: '
|
|
10
|
-
{ name: 'publish', description: 'pick
|
|
4
|
+
{ name: 'authoring', description: 'Directory conventions; page / layout / option / flow syntax' },
|
|
5
|
+
{ name: 'demo', description: 'Layers, shots, traces, and captions for clear demos' },
|
|
6
|
+
{ name: 'components', description: 'Component catalog and props for this version' },
|
|
7
|
+
{ name: 'cases', description: 'Case dimensions: ask the user before starting' },
|
|
8
|
+
{ name: 'check', description: 'Read diagnostics and fix the indicated file and line' },
|
|
9
|
+
{ name: 'selection', description: 'Edit only the element selected by the user in the board' },
|
|
10
|
+
{ name: 'publish', description: 'pick, build, and static site deployment' },
|
|
11
11
|
];
|
|
12
12
|
const related = {
|
|
13
13
|
authoring: ['demo', 'components', 'cases', 'check', 'selection', 'publish'],
|
|
@@ -21,9 +21,9 @@ const related = {
|
|
|
21
21
|
/** CLI 传入其 package.json 版本;行数来自同一次生成的主题正文。 */
|
|
22
22
|
export function skillIndex(version, docs) {
|
|
23
23
|
return [
|
|
24
|
-
`Joplo ${version} · Agent
|
|
25
|
-
...SKILL_TOPICS.map(t => ` ${t.name.padEnd(11)} ${t.description} ${skillTopic(t.name, docs).trimEnd().split('\n').length}
|
|
26
|
-
'
|
|
24
|
+
`Joplo ${version} · Agent usage (read on demand)`,
|
|
25
|
+
...SKILL_TOPICS.map(t => ` ${t.name.padEnd(11)} ${t.description} ${skillTopic(t.name, docs).trimEnd().split('\n').length} lines`),
|
|
26
|
+
'Usage: npx joplo skill <topic> Install for agents: npx joplo skill install',
|
|
27
27
|
'',
|
|
28
28
|
].join('\n');
|
|
29
29
|
}
|
|
@@ -34,141 +34,173 @@ export function nearestSkillTopic(input) {
|
|
|
34
34
|
/** docs 是组件目录提供的可选一行提示,不在这里维护另一份组件或属性清单。 */
|
|
35
35
|
export function skillTopic(topic, docs) {
|
|
36
36
|
if (!SKILL_TOPICS.some(t => t.name === topic))
|
|
37
|
-
throw new JoploError('USAGE',
|
|
37
|
+
throw new JoploError('USAGE', `Unknown topic "${topic}". Did you mean ${nearestSkillTopic(String(topic))}?\nRun npx joplo skill to list all topics.`);
|
|
38
38
|
const name = topic;
|
|
39
39
|
const body = name === 'components' ? componentTopic(docs ?? undefined) : CONTENT[name];
|
|
40
|
-
return `${body.trimEnd()}\n\
|
|
40
|
+
return `${body.trimEnd()}\n\nRelated topics: ${related[name].join(', ')}\n`;
|
|
41
41
|
}
|
|
42
42
|
/** 兼容旧入口:与 joplo skill authoring 输出完全相同。 */
|
|
43
43
|
export function guide() { return skillTopic('authoring'); }
|
|
44
44
|
function componentTopic(docs = {}) {
|
|
45
45
|
const names = COMPONENT_TYPES.filter(name => !name.startsWith('#'));
|
|
46
|
-
const listed = (set) => names.filter(name => set.has(name)).join('
|
|
46
|
+
const listed = (set) => names.filter(name => set.has(name)).join(', ');
|
|
47
47
|
return [
|
|
48
|
-
'# Joplo
|
|
48
|
+
'# Joplo components: components',
|
|
49
49
|
'',
|
|
50
|
-
'
|
|
51
|
-
'
|
|
50
|
+
'Import components from @joplo-app/kit/ui. Names below come from the current compiler catalog; do not invent components.',
|
|
51
|
+
'Prop hints follow names when available; otherwise only names are listed. Write HTML tags directly in JSX; do not import them from ui.',
|
|
52
52
|
'',
|
|
53
|
-
'##
|
|
54
|
-
...names.map(name => `- ${name}${Object.hasOwn(docs, name) && docs[name]?.trim() ?
|
|
53
|
+
'## Component catalog',
|
|
54
|
+
...names.map(name => `- ${name}${Object.hasOwn(docs, name) && docs[name]?.trim() ? `: ${docs[name].replace(/\s+/g, ' ').trim()}` : ''}`),
|
|
55
55
|
'',
|
|
56
|
-
'##
|
|
57
|
-
`-
|
|
58
|
-
`-
|
|
59
|
-
`-
|
|
56
|
+
'## Behavior groups (from the catalog)',
|
|
57
|
+
`- Interactive; require id and declared behavior: ${listed(INTERACTIVE_TYPES)}.`,
|
|
58
|
+
`- Accept input; type/select/toggle write to inputs: ${listed(VALUE_TYPES)}.`,
|
|
59
|
+
`- Containers whose expanded state controls child visibility: ${listed(GATED_CONTAINERS)}.`,
|
|
60
60
|
'',
|
|
61
|
-
`Joplo
|
|
62
|
-
'when
|
|
63
|
-
'
|
|
64
|
-
'
|
|
61
|
+
`Joplo props: ${JOPLO_PROPS.join(', ')}; disabled is the component disable prop.`,
|
|
62
|
+
'when controls visibility; disabledReason explains disabling; unmodeled marks behavior not modeled by this prototype; note is an authoring note.',
|
|
63
|
+
'Interactive elements need a flow step, disabled=true with a reason, or explicit unmodeled.',
|
|
64
|
+
'See authoring for bindings, conditions, and steps; check for component error fixes.',
|
|
65
65
|
].join('\n');
|
|
66
66
|
}
|
|
67
67
|
const CONTENT = {
|
|
68
|
-
authoring: `# Joplo
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
##
|
|
74
|
-
- joplo.config.ts
|
|
75
|
-
- layouts/app.tsx
|
|
76
|
-
- routes/page.tsx →
|
|
77
|
-
- features/<f>/feature.ts
|
|
78
|
-
- features/<f>/options/<o>.tsx
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
- tsconfig
|
|
82
|
-
|
|
83
|
-
##
|
|
84
|
-
- config({ name, description?, theme?:
|
|
85
|
-
- layout(tree)
|
|
86
|
-
- page({ title, layout?: string|false, viewport?: 'desktop'|'mobile' }, tree)
|
|
87
|
-
- feature({ name, goal, cases, roles?, constraints?, rules?, questions?, pick? })
|
|
88
|
-
- option({ name, idea, on?, routes?, state?, rules?, questions?, coverage?, scenarios })
|
|
89
|
-
- on: { '/members': { actions: <Button id="invite"
|
|
90
|
-
- routes: { '/members/new': page({ title: '
|
|
91
|
-
- state: { ui: { ready: false }, data: {}, inputs: {} }
|
|
92
|
-
- scenarios: { happy: flow('
|
|
93
|
-
- flow
|
|
94
|
-
-
|
|
95
|
-
|
|
96
|
-
## flow
|
|
97
|
-
- .click(id, ...args)
|
|
98
|
-
- .toggle(id, boolean, ...args)
|
|
99
|
-
- args
|
|
100
|
-
-
|
|
101
|
-
-
|
|
102
|
-
-
|
|
103
|
-
-
|
|
104
|
-
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
-
|
|
109
|
-
- not(
|
|
110
|
-
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
-
|
|
115
|
-
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
- status
|
|
121
|
-
-
|
|
122
|
-
-
|
|
123
|
-
-
|
|
124
|
-
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
-
|
|
137
|
-
-
|
|
138
|
-
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
-
|
|
144
|
-
- shot
|
|
145
|
-
-
|
|
146
|
-
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
-
|
|
152
|
-
-
|
|
153
|
-
- trace
|
|
154
|
-
- trace
|
|
155
|
-
- trace
|
|
156
|
-
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
-
|
|
162
|
-
-
|
|
163
|
-
-
|
|
164
|
-
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
-
|
|
170
|
-
-
|
|
171
|
-
|
|
68
|
+
authoring: `# Joplo authoring: authoring
|
|
69
|
+
|
|
70
|
+
Describe designs in TS/TSX. Source files are authoritative; Git manages versions. The board and published site consume compiled IR.
|
|
71
|
+
Read only the topics needed, usually one or two at a time. See components for components, cases for questions before starting, and demo for organizing and presenting demos.
|
|
72
|
+
|
|
73
|
+
## Directory conventions
|
|
74
|
+
- joplo.config.ts: export default config({ name, layout: 'app', home: '/' }).
|
|
75
|
+
- layouts/app.tsx: export default layout(<AppShell header={{ height: 56 }} navbar={{ width: 240, breakpoint: 'sm' }}><AppShell.Navbar>…</AppShell.Navbar><AppShell.Main><Outlet/></AppShell.Main><Slot name="overlay"/></AppShell>).
|
|
76
|
+
- routes/page.tsx → /; routes/members/page.tsx → /members. Static routes only; no [id].
|
|
77
|
+
- features/<f>/feature.ts: feature goal, cases, shared rules, open questions, pick.
|
|
78
|
+
- features/<f>/options/<o>.tsx: one option, route additions, initial state, and scenarios.
|
|
79
|
+
- Organize reusable data or modules freely inside a feature directory; import them from the files above.
|
|
80
|
+
- Import data APIs from @joplo-app/kit and components from @joplo-app/kit/ui.
|
|
81
|
+
- tsconfig uses jsx: 'react-jsxdev', jsxImportSource: '@joplo-app/kit', allowImportingTsExtensions: true.
|
|
82
|
+
|
|
83
|
+
## Data APIs
|
|
84
|
+
- config({ name, description?, theme?: theme name (9 built-ins or themes/<name>.css; see demo), layout?, home? }).
|
|
85
|
+
- layout(tree); Outlet places the current page; <Slot name="actions"/> declares a slot for additions.
|
|
86
|
+
- page({ title, layout?: string|false, viewport?: 'desktop'|'mobile' }, tree). See demo for devices and stages.
|
|
87
|
+
- feature({ name, goal, cases, roles?, constraints?, rules?, questions?, pick? }).
|
|
88
|
+
- option({ name, idea, on?, routes?, state?, rules?, questions?, coverage?, scenarios }).
|
|
89
|
+
- on: { '/members': { actions: <Button id="invite">Invite</Button> } }: add elements to a slot on an existing route.
|
|
90
|
+
- routes: { '/members/new': page({ title: 'New member' }, <Stack>…</Stack>) }: add a route for this option.
|
|
91
|
+
- state: { ui: { ready: false }, data: {}, inputs: {} }: initial option state.
|
|
92
|
+
- scenarios: { happy: flow('Success', { cases: ['happy'], start: '/members' }).click('invite', done('Completed')) }.
|
|
93
|
+
- flow options also accept state, description, expected, mock, outcome to override initial state or describe mock results.
|
|
94
|
+
- See cases for case and coverage declarations; publish for pick and publishing.
|
|
95
|
+
|
|
96
|
+
## flow: Put behavior in steps
|
|
97
|
+
- .click(id, ...args); .type(id, value, ...args); .select(id, value, ...args).
|
|
98
|
+
- .toggle(id, boolean, ...args); .back(...args); .system('Mock event', ...args).
|
|
99
|
+
- .press('⌘K', ...args) / .press('Enter'): a targetless user keyboard step. The default caption describes pressing ⌘K; effects work like ordinary steps.
|
|
100
|
+
- String args are optional captions; other args are effects. All methods are chainable.
|
|
101
|
+
- set($.ui.ready, true): replace state; push($.data.rows, row): append an array item.
|
|
102
|
+
- toast('Message') / toast.success/error/info('Message'): a message for the current step.
|
|
103
|
+
- go('/members'): change route within the current option; back returns to the previous route.
|
|
104
|
+
- done('Result', 'success'|'failure'|'cancelled'): end the scenario; default is success.
|
|
105
|
+
- uses('rule_key', ...): link rules from this option or feature.
|
|
106
|
+
|
|
107
|
+
## Bindings and conditions
|
|
108
|
+
- $.ui.x / $.data.x / $.inputs.x bind whole values; arbitrary expressions are not evaluated.
|
|
109
|
+
- when={$.ui.ready}; disabled={not($.ui.isAdmin)}.
|
|
110
|
+
- not(x), eq(x, value), neq(x, value), empty(x), notEmpty(x), oneOf(x, values), and(...xs), or(...xs).
|
|
111
|
+
- Overlays: <Modal id="dlg" opened={$.ui.open} title="…">; Drawer works the same way. Only opened controls visibility.
|
|
112
|
+
|
|
113
|
+
## Layout and responsiveness (Mantine names and props; no className)
|
|
114
|
+
- Use Stack / Group / SimpleGrid / Grid props: <Group justify="space-between">, <SimpleGrid cols={{ base: 1, md: 3 }}>.
|
|
115
|
+
- Use responsive objects { base, xs, sm, md, lg, xl }, or visibleFrom="sm" / hiddenFrom="sm". AppShell collapses navigation below navbar.breakpoint.
|
|
116
|
+
- Set input labels directly: <TextInput id="email" label="Email"/>. Auto captions use them.
|
|
117
|
+
- Stage height follows the window. Do not use fixed pixel heights for full-height layouts, which clip bottom inputs and buttons in short windows. See Full-height layout in demo.
|
|
118
|
+
|
|
119
|
+
## Rules and boundaries
|
|
120
|
+
- rule('Constraint', { origin?, status?, cases?: ['happy'], elements?: ['invite'] }).
|
|
121
|
+
- origin: user/project_material/ai_assumption/code_observed/feedback; default ai_assumption.
|
|
122
|
+
- status: \`pending\`/\`confirmed\`/\`conflict\`/\`out_of_scope\`; default \`pending\`.
|
|
123
|
+
- Never mark an AI assumption \`confirmed\`. Record origin/status truthfully after user confirmation.
|
|
124
|
+
- question('Open question', { severity?: 'blocker'|'major'|'minor', refs?: ['happy'] }).
|
|
125
|
+
- Do not write onClick or other function props. Reusable author components expand during collection; flow drives interaction.
|
|
126
|
+
- Author modules execute locally during loading/checking/building. Run only trusted projects.
|
|
127
|
+
|
|
128
|
+
After editing, run npx joplo check. View the board; use npx joplo selection to read the location selected by the user.
|
|
129
|
+
See check for diagnostic fixes and selection for editing only the selected location.`,
|
|
130
|
+
demo: `# Joplo demos: demo
|
|
131
|
+
|
|
132
|
+
Tell one thing per step: separate viewpoints with independent layers, zoom into details with shots, and describe what happened with short captions.
|
|
133
|
+
See authoring for directories, state, and flow syntax. Import layer, shot, trace, explain from @joplo-app/kit.
|
|
134
|
+
|
|
135
|
+
## Layers are independent pages
|
|
136
|
+
- Declare layers in an option: layers: { client: layer('Client view', <ClientView/>), backend: layer('Backend flow', <Diagram>…</Diagram>) }.
|
|
137
|
+
- layer(title, <tree/>) owns a JSX tree, renders independently, and fills the stage; it is not a crop of one large page.
|
|
138
|
+
- Layers share ui / data / inputs. Switching layers does not change the step. Declaring layers makes the demo show these independent pages.
|
|
139
|
+
- No automatic overview layer. Declare overview: layer('Overview', <Overview/>) when needed.
|
|
140
|
+
- Put long notes in a separate explanation layer, such as why: layer('Design rationale', <Why/>), then switch to it with a shot.
|
|
141
|
+
|
|
142
|
+
## Shots and the director
|
|
143
|
+
- Write shot(...ids) in a step. Targets can be components, cards, buttons, or Diagram nodes, groups, and edges.
|
|
144
|
+
- Each id resolves in the layer containing it. The same id can affect multiple layers; the first shot determines the director layer.
|
|
145
|
+
- Example: .click('app_send', shot('msg_user'), shot('app', 'biz')) follows the client view first, then sets a backend shot.
|
|
146
|
+
- shot() restores the whole director layer. Without a shot, keep the previous one; a plain click can follow the layer containing the button.
|
|
147
|
+
- During playback, the director switches layers, zooms, and highlights. Switching layers manually pauses following; resume Follow director or replay only one layer.
|
|
148
|
+
- Viewers can zoom with wheel/pinch, drag to pan, and fit the stage to see the whole view. The next director shot takes over again.
|
|
149
|
+
|
|
150
|
+
## Diagram and traces
|
|
151
|
+
- Declare structure inside <Diagram> with <Diagram.Group label>, <Diagram.Node id label kind/>, <Diagram.Edge id from to label async/>.
|
|
152
|
+
- Diagram.Edge from/to must be node ids within the same Diagram. Layout is automatic; existing elements stay in place as segments appear.
|
|
153
|
+
- Use trace('a','b','c') for the a→b→c trace. Do not manually write node/edge state props or use set() to simulate calls; use trace().
|
|
154
|
+
- Elements visited this step are active; earlier ones become ok. trace.fail('a','b') marks failure; a later successful trace can recover.
|
|
155
|
+
- trace.skip('a','b') marks elements not called this time as dim. They need not be connected; it does not move the shot.
|
|
156
|
+
- trace accepts node or edge ids. Each segment needs a matching edge; reverse traversal is allowed. For multiple edges in the same direction, use the edge id.
|
|
157
|
+
- trace also supplies shot targets and can merge with shot in the same step. Focusing two or more nodes in one Diagram automatically creates a compact subgraph.
|
|
158
|
+
- Reveal segments with when={$.ui.show_billing}; set($.ui.show_billing, true) in a step only controls visibility, not trace call state.
|
|
159
|
+
|
|
160
|
+
## Captions and fitting one screen
|
|
161
|
+
- Keep captions within about 24 units and explain('Additional note') within about 48. CJK characters count as 1 each; all others count as 0.5; whitespace is ignored. check warns when exceeded.
|
|
162
|
+
- Captions and explain notes appear below the stage, never over it. Tell one thing per step; move long content to an explanation layer.
|
|
163
|
+
- Autoplay waits according to text length, at least 3 seconds, and waits for shot and edge animations. Speeds: 0.5× / 1× / 1.5×.
|
|
164
|
+
- Do not make viewers scroll through a long page. Fit one screen and zoom into details with shots.
|
|
165
|
+
- Each page has one device, desktop by default. page({ viewport: 'mobile' }, tree) uses a Phone frame at a fixed width of 390.
|
|
166
|
+
- For a mobile layer, use layer('Mobile', <MobileView/>, { viewport: 'mobile' }). Make a separate page or demo when mobile is needed (D44).
|
|
167
|
+
|
|
168
|
+
## Full-height layout: Follow stage height
|
|
169
|
+
- Layers and desktop pages fill the stage, whose size follows the board window. Fixed pixel heights (h={690}) push bottom content outside short windows.
|
|
170
|
+
- To fill a column vertically, set h="100%" on its container. Give growing content (chat history, lists, artifacts) style={{ flex: 1, minHeight: 0 }} and place fixed content below it:
|
|
171
|
+
<Grid h="100%"><Grid.Col span={6}><Stack h="100%"><ScrollArea style={{ flex: 1, minHeight: 0 }}>Messages</ScrollArea>
|
|
172
|
+
<Group><PromptInput id="prompt"/><Button id="send">Send</Button></Group></Stack></Grid.Col></Grid>
|
|
173
|
+
- The same applies to placeholders and artifacts: use h="100%" on Placeholder; Artifact fills its container by default.
|
|
174
|
+
- Use fixed pixels only for elements with a fixed height (avatars, icons, Diagram canvas height).
|
|
175
|
+
|
|
176
|
+
## Transition cards, roles, and Agent output (D56)
|
|
177
|
+
- .card('Title', { sub?, points?, role? }, ...effects): one large sentence filling the stage, as a step. Use for openings, endings, time jumps, and role switches.
|
|
178
|
+
- Open with why this matters; end with points listing what was confirmed. For time jumps, use .card('3 days later', set($.data.invite, 'expired')).
|
|
179
|
+
- Roles: declare roles: { ajie: role('Ajie', { desc: 'Invited friend' }) } in the feature; use layer('Ajie mobile', <AjieView/>, { role: 'ajie' }) for the layer.
|
|
180
|
+
- A layer with a role shows a name badge at the bottom left and an avatar in its tab. After .card('Now Ajie', { role: 'ajie' }), the director switches to Ajie's layer.
|
|
181
|
+
- Show one person at a time. For side-by-side views, draw two sections in the same layer.
|
|
182
|
+
- stream($.ui.reply, '…'): writes state like set. During playback, bound text appears character by character; jumping to the step shows the full text immediately.
|
|
183
|
+
- Agent UI: <Thinking title={$.ui.thought} active={$.ui.thinking} duration="6 seconds">Process</Thinking> shows thinking;
|
|
184
|
+
<Artifact title="itinerary.md" kind="doc" status={$.ui.planStatus}>Content</Artifact> is a side artifact; reference it in the conversation with <Artifact.Ref id="…"/>.
|
|
185
|
+
|
|
186
|
+
## Forks, marks, email, data, and keys (D56 P1)
|
|
187
|
+
- fork(label, scenarioKey): switch to another scenario in the same option from the right of this step's caption, skipping the common prefix with identical actions and business effects. Autoplay stays on the main flow.
|
|
188
|
+
Example: .click('can_go', fork('What if Ajie cannot go?', 'cant_go')). Empty labels are omitted; targets are still validated.
|
|
189
|
+
- mark(id, { kind?, note? }): circle (default) / underline / box / arrow; hand-drawn marks appear only in this step. Hidden targets, targets in other layers, and targets outside the stage are not drawn.
|
|
190
|
+
Example: .system('Itinerary ready', mark('share', { kind: 'arrow', note: 'Share after generation' })).
|
|
191
|
+
- Email: a simple external email card. The card is not interactive; buttons in its body use ordinary steps.
|
|
192
|
+
Example: <Email from="Camping assistant" to="Ajie" subject="Itinerary updated" time="Friday 20:05">Body</Email>.
|
|
193
|
+
- DataCard / StateFlow: place in a separate layer and switch to it with shot. Only these two components show this step's changes and before/after values. StateFlow marks earlier states completed according to states order.
|
|
194
|
+
Example: layer('Itinerary data', <Stack><StateFlow value={$.data.trip.status} states={['draft','shared']} labels={{ draft: 'Draft', shared: 'Shared' }}/><DataCard title="Itinerary" value={$.data.trip} fields={[{ key: 'status', label: 'Status' }]}/></Stack>).
|
|
195
|
+
- Keyboard history: type reuses character-by-character preview during playback; press shows keycaps. Static views show only the latest input/keypress; other steps clear it. Empty keys are hidden.
|
|
196
|
+
Example: .type('prompt', 'Plan a weekend camping trip').press('Enter', set($.ui.asked, true)). Chords such as '⌘K' split into two keycaps automatically.
|
|
197
|
+
|
|
198
|
+
## Write a theme
|
|
199
|
+
- A theme is a CSS file at themes/<name>.css in the project root. Set theme: '<name>' in joplo.config.ts as the default. A custom theme overrides a built-in with the same name.
|
|
200
|
+
- Built-ins: sketch (Hand-drawn, default), clean, blueprint, nord, dracula, solarized-light, terminal, kraft, contrast. Preview them in the board Appearance popover.
|
|
201
|
+
- Variables alone work and are scoped to the stage, leaving the board unaffected: --jp-font, --jp-font-mono, --jp-font-size, --jp-ink, --jp-bg, --jp-surface, --jp-subtle, --jp-muted, --jp-faint, --jp-line, --jp-line-strong, --jp-border, --jp-accent (highlight), --jp-select, --jp-info (Diagram active), --jp-ok, --jp-warn, --jp-danger, --jp-annot (annotations; defaults to danger), --jp-radius, --jp-shadow, --jp-stroke (rough hand-drawn / clean thin lines).
|
|
202
|
+
- Ordinary selectors (.jbox, h1, etc.) also work within the stage. In dark themes, check contrast of --jp-info / --jp-ok / --jp-danger / --jp-accent against the background.
|
|
203
|
+
- Example themes/brand.css:
|
|
172
204
|
:root {
|
|
173
205
|
--jp-font: "Inter", system-ui, sans-serif;
|
|
174
206
|
--jp-ink: #14213d;
|
|
@@ -180,181 +212,200 @@ const CONTENT = {
|
|
|
180
212
|
--jp-stroke: clean;
|
|
181
213
|
}
|
|
182
214
|
|
|
183
|
-
##
|
|
184
|
-
|
|
185
|
-
|
|
215
|
+
## Full example: examples/agent-arch
|
|
216
|
+
See layersFor/Diagram in shared/arch.tsx and flow in features/agent/options/a-hybrid.tsx.
|
|
217
|
+
This excerpt shows the main plan steps, omitting business rule links. start in the same file already handles user input and sending:
|
|
186
218
|
\`\`\`tsx
|
|
187
219
|
const plan = (f: ReturnType<typeof start>) =>
|
|
188
220
|
f
|
|
189
|
-
.system('Billing
|
|
190
|
-
.system('
|
|
191
|
-
.system('
|
|
192
|
-
.system('
|
|
221
|
+
.system('Billing quota precheck', 'Check quota before calling the model', trace('biz', 'billing'), shot('blk_billing'))
|
|
222
|
+
.system('Fetch tool definitions', 'Fetch definitions for the client version', trace('biz', 'registry'), shot('blk_tools'), explain('Definitions and implementations are separate'))
|
|
223
|
+
.system('Hand task to brain', 'Send task and tool definitions to brain', trace('biz', 'brain'), shot('blk_brain'))
|
|
224
|
+
.system('Brain reasoning', 'Brain calls Bedrock to plan the next step', trace('brain', 'llm'));
|
|
193
225
|
\`\`\`
|
|
194
|
-
|
|
195
|
-
cases: `# Joplo
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
##
|
|
201
|
-
- \`main\`
|
|
202
|
-
- \`input\`
|
|
203
|
-
- \`permission\`
|
|
204
|
-
- \`lifecycle\`
|
|
205
|
-
- \`async\`
|
|
206
|
-
- \`interrupt\`
|
|
207
|
-
- \`conflict\`
|
|
208
|
-
- \`consistency\`
|
|
209
|
-
|
|
210
|
-
##
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
###
|
|
214
|
-
- no_permission · permission ·
|
|
215
|
-
- invalid_input · input ·
|
|
216
|
-
- revoked · lifecycle ·
|
|
217
|
-
- expired · lifecycle ·
|
|
218
|
-
- already_exists · conflict ·
|
|
219
|
-
- duplicate_submit · conflict ·
|
|
220
|
-
- request_failed · async ·
|
|
221
|
-
|
|
222
|
-
### Agent / AI
|
|
223
|
-
- quota · permission ·
|
|
224
|
-
- dangerous_tool · permission ·
|
|
225
|
-
- hand_offline · async ·
|
|
226
|
-
- local_data · main ·
|
|
227
|
-
- tool_version · consistency ·
|
|
228
|
-
- usage_retry · async ·
|
|
229
|
-
- model_failed · async ·
|
|
230
|
-
|
|
231
|
-
### CLI /
|
|
232
|
-
- first_run · main ·
|
|
233
|
-
- env_old · input ·
|
|
234
|
-
- version_skew · consistency ·
|
|
235
|
-
- optional_dep · async ·
|
|
236
|
-
- dir_not_empty · conflict ·
|
|
237
|
-
- typo · input ·
|
|
238
|
-
- user_modified · conflict ·
|
|
239
|
-
- offline · async ·
|
|
240
|
-
|
|
241
|
-
###
|
|
242
|
-
- first_open · main ·
|
|
243
|
-
- single_instance · conflict ·
|
|
244
|
-
- stale_resource · lifecycle ·
|
|
245
|
-
- one_broken · consistency ·
|
|
246
|
-
- public_view · consistency ·
|
|
247
|
-
- recent · main ·
|
|
248
|
-
|
|
249
|
-
##
|
|
250
|
-
- feature.cases: { happy: '
|
|
251
|
-
- dimension
|
|
252
|
-
-
|
|
253
|
-
-
|
|
254
|
-
-
|
|
255
|
-
|
|
256
|
-
##
|
|
257
|
-
|
|
258
|
-
-
|
|
259
|
-
-
|
|
260
|
-
-
|
|
261
|
-
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
-
|
|
275
|
-
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
-
|
|
280
|
-
-
|
|
281
|
-
-
|
|
282
|
-
-
|
|
283
|
-
-
|
|
284
|
-
-
|
|
285
|
-
-
|
|
286
|
-
-
|
|
287
|
-
-
|
|
288
|
-
-
|
|
289
|
-
-
|
|
290
|
-
-
|
|
291
|
-
-
|
|
292
|
-
-
|
|
293
|
-
-
|
|
294
|
-
-
|
|
295
|
-
-
|
|
296
|
-
-
|
|
297
|
-
-
|
|
298
|
-
-
|
|
299
|
-
-
|
|
300
|
-
-
|
|
301
|
-
-
|
|
302
|
-
-
|
|
303
|
-
-
|
|
304
|
-
-
|
|
305
|
-
-
|
|
306
|
-
-
|
|
307
|
-
-
|
|
308
|
-
-
|
|
309
|
-
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
-
|
|
323
|
-
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
226
|
+
The example also covers insufficient quota, dangerous tool confirmation, client disconnection, and billing retries. Choose scenarios for the requirements; include more than the main flow.`,
|
|
227
|
+
cases: `# Joplo case checklist: cases
|
|
228
|
+
|
|
229
|
+
Before starting, read user requirements and project material. Use these dimensions to find gaps; ask only key questions that change the design.
|
|
230
|
+
Record unanswered items as question or rules with status \`pending\`. Do not confirm AI assumptions on the user's behalf.
|
|
231
|
+
|
|
232
|
+
## Eight dimensions: Pick one or two relevant questions each
|
|
233
|
+
- \`main\` Main flow: Who needs to achieve what? What should the user see afterward?
|
|
234
|
+
- \`input\` Input: What happens when empty, invalid, or at a limit? Can input be preserved and corrected in place?
|
|
235
|
+
- \`permission\` Permission: Who can view and act? Without permission, hide the entry or disable it with a reason?
|
|
236
|
+
- \`lifecycle\` Lifecycle: What happens after expiry, revocation, or deletion? Is recovery allowed?
|
|
237
|
+
- \`async\` Async: What appears during waiting, timeout, and failure? Does retry preserve input?
|
|
238
|
+
- \`interrupt\` Interruption: What is preserved when closing a modal, going back, or leaving? Confirm unsaved changes?
|
|
239
|
+
- \`conflict\` Conflict: What happens with repeated clicks or concurrent edits? How are duplicate submissions prevented?
|
|
240
|
+
- \`consistency\` Consistency: When one route changes, when do others update? How are partial results kept understandable?
|
|
241
|
+
|
|
242
|
+
## Presets by product type
|
|
243
|
+
Pick relevant cases to ask the user before starting. Do not include every preset; these are question seeds, not \`confirmed\` product rules.
|
|
244
|
+
|
|
245
|
+
### Forms / CRUD / permission (source: examples/invite)
|
|
246
|
+
- no_permission · permission · How should non-admin actions be blocked and explained?
|
|
247
|
+
- invalid_input · input · How should empty or invalid input be explained inline?
|
|
248
|
+
- revoked · lifecycle · How should reopening after revocation work?
|
|
249
|
+
- expired · lifecycle · How should access after expiry be presented?
|
|
250
|
+
- already_exists · conflict · How should an existing object be reported?
|
|
251
|
+
- duplicate_submit · conflict · How should repeated submit clicks avoid duplicate creation?
|
|
252
|
+
- request_failed · async · How should input be preserved and retry allowed after failure?
|
|
253
|
+
|
|
254
|
+
### Agent / AI products (source: examples/agent-arch)
|
|
255
|
+
- quota · permission · How should insufficient quota be blocked before calling the model?
|
|
256
|
+
- dangerous_tool · permission · How should the user confirm a dangerous tool before execution?
|
|
257
|
+
- hand_offline · async · How should failure be reported when the tool execution client disconnects or times out?
|
|
258
|
+
- local_data · main · How should data on the user's machine be accessed?
|
|
259
|
+
- tool_version · consistency · How should upgraded definitions work with an older tool implementation?
|
|
260
|
+
- usage_retry · async · How should failed billing event delivery retry with idempotency?
|
|
261
|
+
- model_failed · async · How should model failure or timeout be explained and recovered from?
|
|
262
|
+
|
|
263
|
+
### CLI / developer tools (source: examples/joplo-dist)
|
|
264
|
+
- first_run · main · How should a new user succeed within three commands?
|
|
265
|
+
- env_old · input · How should an outdated runtime be explained and fixed?
|
|
266
|
+
- version_skew · consistency · How should global and project version mismatches prompt alignment?
|
|
267
|
+
- optional_dep · async · How should missing optional dependencies affect only related commands?
|
|
268
|
+
- dir_not_empty · conflict · How should existing files in the target directory be protected from overwriting?
|
|
269
|
+
- typo · input · How should a command or argument typo suggest the closest match?
|
|
270
|
+
- user_modified · conflict · How should user edits be protected from overwriting?
|
|
271
|
+
- offline · async · How should offline limitations and recovery be explained?
|
|
272
|
+
|
|
273
|
+
### Local tools / multiple projects (source: examples/joplo-board)
|
|
274
|
+
- first_open · main · How should a first visit with no data offer a starting point?
|
|
275
|
+
- single_instance · conflict · How should an existing instance be reused instead of starting another?
|
|
276
|
+
- stale_resource · lifecycle · How should records for missing directories or resources be cleaned up?
|
|
277
|
+
- one_broken · consistency · How should other projects keep working when one fails?
|
|
278
|
+
- public_view · consistency · How should the public view hide private paths, gaps, and errors?
|
|
279
|
+
- recent · main · How should the home page switch among previously opened projects?
|
|
280
|
+
|
|
281
|
+
## Turn answers into cases and scenarios
|
|
282
|
+
- feature.cases: { happy: 'Complete successfully', denied: { title: 'No permission', dimension: 'permission', priority: 'high', expected: 'Explain why' } }.
|
|
283
|
+
- dimension uses the keys above; priority is high/medium/low; expected describes the expected result.
|
|
284
|
+
- Each option uses flow(..., { cases: ['happy'] }) to reference the shared cases for comparison.
|
|
285
|
+
- A case with a scenario is automatically \`expressed\`; one with neither a scenario nor a declaration is \`missing\`.
|
|
286
|
+
- After adding a case, run check: reconsider it in every option.
|
|
287
|
+
|
|
288
|
+
## Declare coverage without a scenario
|
|
289
|
+
Coverage status values: \`expressed\`, \`undecided\`, \`missing\`, \`not_applicable\`, \`excluded\`.
|
|
290
|
+
- option.coverage: { case_key: undecided('Why this is undecided') }.
|
|
291
|
+
- missing('What is missing'): leave the gap explicit; do not pretend it is \`expressed\`.
|
|
292
|
+
- notApplicable('Why not applicable') / excluded('Why excluded'): require a nonempty reason.
|
|
293
|
+
- Explicit declarations override inference. Use scenarios for cases that need a demo.
|
|
294
|
+
- Do not invent business rules for full coverage. Keep asking about undecided behavior.
|
|
295
|
+
|
|
296
|
+
See authoring for flow and rule syntax; check for locating coverage diagnostics.
|
|
297
|
+
No mobile example yet; create a separate demo when mobile is needed (D44).`,
|
|
298
|
+
check: `# Joplo diagnostics: check
|
|
299
|
+
|
|
300
|
+
Run npx joplo check [dir]. Use --option feature.option to narrow structure checks and replay; --format json gives machine output.
|
|
301
|
+
The whole project still compiles. Option filtering does not hide project compilation errors. Source files load locally.
|
|
302
|
+
|
|
303
|
+
## Read the output
|
|
304
|
+
\`file:line:column severity CODE message\`
|
|
305
|
+
Example: features/invite/options/a.tsx:12:5 warning UNBOUND_INTERACTIVE Interactive element has no demo step.
|
|
306
|
+
- File and line/column identify the edit location. Read nearby source and fix only that location; do not rewrite the page.
|
|
307
|
+
- error exits 1; usage errors exit 2; warning/info only exits 0.
|
|
308
|
+
- The last line totals error, warning, info. Run check again after fixing.
|
|
309
|
+
|
|
310
|
+
## Common codes → fixes
|
|
311
|
+
- UNKNOWN_COMPONENT: Choose a supported name from components; do not invent components.
|
|
312
|
+
- MISSING_ID / DUPLICATE_ID: Give interactive elements stable ids unique within the stage; update step references.
|
|
313
|
+
- FUNCTION_PROP: Replace onClick and other callbacks with flow steps and state effects.
|
|
314
|
+
- UNKNOWN_CASE / UNKNOWN_RULE / INVALID_REFERENCE: Check case, rule, and reference keys and their owning option.
|
|
315
|
+
- UNKNOWN_SLOT / UNKNOWN_ROUTE / UNKNOWN_LAYOUT: Check routes, layouts, and Slot declarations; add elements only to existing locations.
|
|
316
|
+
- UNKNOWN_PICK: pick must be an option filename under this feature's options/.
|
|
317
|
+
- NOT_PICKED: The feature has no picked option and will not publish. Compare options, then set feature.pick to the chosen filename.
|
|
318
|
+
- ROUTE_EXISTS: An option route duplicates an existing route. Use on to add elements, or choose a new route.
|
|
319
|
+
- BAD_ROUTE: The route does not start with /. Use an absolute static product route.
|
|
320
|
+
- DUPLICATE_ELEMENT: Duplicate element ids within a stage. Change only conflicting ids and update references.
|
|
321
|
+
- CAPTION_TOO_LONG: Shorten the caption to about 24 units: CJK characters count as 1 each, all others as 0.5; whitespace is ignored. One thing per step; move long content to an explanation layer. See demo.
|
|
322
|
+
- EXPLAIN_TOO_LONG: Shorten the explain note to about 48 units, using the same CJK 1 / other 0.5 calculation. Put detailed rationale in a separate explanation layer. See demo.
|
|
323
|
+
- ROLE_UNKNOWN: A layer or card role is not in feature.roles. Declare roles as { key: role('Name') }; see demo.
|
|
324
|
+
- FORK_UNKNOWN: fork must target another scenario key in the same option; it cannot reference itself.
|
|
325
|
+
- MARK_UNKNOWN: The mark target is absent from this step's route stage and all layers. Check the element id; currently hidden targets are valid references.
|
|
326
|
+
- SHOT_UNKNOWN: The shot target is absent from this step's stage and all layers. Check its id and layer; see demo.
|
|
327
|
+
- LAYER_UNKNOWN: Invalid layer key or missing content. Use letters/digits/underscores/hyphens, do not start with @, and provide nonempty JSX.
|
|
328
|
+
- TRACE_UNKNOWN: Empty trace, unknown id, multiple Diagrams, or disconnected path. Use connected node/edge ids in one Diagram.
|
|
329
|
+
- TRACE_AMBIGUOUS: Multiple candidate edges between nodes. Use the specific edge id in trace.
|
|
330
|
+
- THEME_UNKNOWN: config({ theme }) names neither a built-in nor themes/<name>.css. Use a built-in or add that CSS file; see Write a theme in demo.
|
|
331
|
+
- UNKNOWN_DIAGRAM_NODE: Diagram.Edge from/to does not reference a node in this Diagram. Correct the endpoint ids.
|
|
332
|
+
- ELEMENT_PROP: A component prop contains JSX. Use strings for icons, such as leftSection="+", and children for content.
|
|
333
|
+
- ASSUMPTION_CONFIRMED: Keep AI assumptions \`pending\`. After user confirmation, record the actual origin; do not change only status.
|
|
334
|
+
- UNBOUND_INTERACTIVE: Add a scenario step, explicitly disable with a reason, or mark unmodeled.
|
|
335
|
+
- DISABLED_WITHOUT_REASON: Add disabledReason explaining why the element cannot be used.
|
|
336
|
+
- CASE_NOT_COVERED: Add a scenario or declare coverage truthfully. Ask about missing behavior first.
|
|
337
|
+
- EXPRESSED_WITHOUT_SCENARIO / COVERAGE_WITHOUT_REASON: Add a scenario or a reason for \`not_applicable\`/\`excluded\`.
|
|
338
|
+
- RULE_ELEMENT_NOT_FOUND: Check rule.elements against element ids in the related option stages.
|
|
339
|
+
- PENDING_AI_ASSUMPTION: Ask the user to confirm; keep \`pending\` until then.
|
|
340
|
+
- EMPTY_SCENARIO: Decide whether actions are needed. Zero steps are valid for showing initial states such as permissions.
|
|
341
|
+
- MISSING_TARGET / MISSING_SCENE: Check step targets, the start route, and the stage after go.
|
|
342
|
+
- TARGET_HIDDEN / TARGET_DISABLED: Check initial state and preceding set effects so the action is executable at that step.
|
|
343
|
+
- NOT_INTERACTIVE / NOT_A_FIELD: Choose the right component or action; input actions require value components.
|
|
344
|
+
- ALREADY_COMPLETED / NOTHING_TO_GO_BACK: Fix steps after done, or add route navigation before back.
|
|
345
|
+
- LOAD_FAILED / WRONG_EXPORT / INVALID_SCHEMA: Follow the message to fix imports, default exports, or field structure.
|
|
346
|
+
|
|
347
|
+
When the user points to a stage element, read selection first for its exact location.`,
|
|
348
|
+
selection: `# Joplo selection: selection
|
|
349
|
+
|
|
350
|
+
When the user points to a board element or step to request an edit, run npx joplo selection [dir].
|
|
351
|
+
It reads .joplo/selection.json directly without recompiling, avoiding a whole-page search.
|
|
352
|
+
|
|
353
|
+
## Read the result and edit locally
|
|
354
|
+
- Output includes at (project-relative file:line:column), a label, and numbered source with three lines before and after.
|
|
355
|
+
- Open the file at that location (Open in editor in the board). Edit only what the user pointed to; use the label to confirm the target.
|
|
356
|
+
- If line content changed, verify the current location. If the file or line is gone, select again in the board.
|
|
357
|
+
- A missing file or null content prints "Nothing selected" and exits 0. Ask the user to hold ⌥ (Alt) and click the element in the board.
|
|
358
|
+
- Do not guess a location for an object without at. Select a specific element or step in the board.
|
|
359
|
+
- With --format json, data.selection preserves Selection and data.lines provides number/text.
|
|
360
|
+
|
|
361
|
+
## Full workflow
|
|
362
|
+
Edit → npx joplo check → npx joplo dev to view the board (a running board just adds the project) → user ⌥+clicks → npx joplo selection → edit only that location.
|
|
363
|
+
Run check again afterward. Preserve other options, pages, and existing user decisions.
|
|
364
|
+
.joplo/ is local runtime state, not the design authority. Do not commit it to Git.`,
|
|
365
|
+
publish: `# Joplo publishing: publish
|
|
366
|
+
|
|
367
|
+
Compare cases and options in the board, then decide which option to publish for each feature.
|
|
332
368
|
|
|
333
369
|
## pick
|
|
334
|
-
-
|
|
335
|
-
-
|
|
336
|
-
-
|
|
370
|
+
- Set pick: 'a' in features/<f>/feature.ts to select options/a.tsx. It is not a qualified ID with a feature prefix.
|
|
371
|
+
- Publish only the picked option for each feature. Features without pick are omitted.
|
|
372
|
+
- Pages and layouts compose the whole product; picked options add elements to routes or add routes.
|
|
337
373
|
|
|
338
374
|
## build
|
|
339
|
-
-
|
|
340
|
-
-
|
|
341
|
-
-
|
|
342
|
-
-
|
|
343
|
-
-
|
|
344
|
-
-
|
|
345
|
-
|
|
346
|
-
##
|
|
347
|
-
-
|
|
348
|
-
-
|
|
349
|
-
-
|
|
350
|
-
-
|
|
351
|
-
-
|
|
352
|
-
|
|
353
|
-
##
|
|
354
|
-
|
|
375
|
+
- Run npx joplo check in the author project, then npx joplo build.
|
|
376
|
+
- Default output: dist/. Set --out-dir <dir> to change it.
|
|
377
|
+
- Nonempty output directories are rejected. After confirming the old output can be discarded, pass --overwrite to clear and rebuild.
|
|
378
|
+
- The published site contains only feature names, goals, scenario demos, step captions, and the overall layout.
|
|
379
|
+
- Rule origins, AI assumptions, gaps, open questions, and source locations stay on the local authoring side.
|
|
380
|
+
- This is a static, read-only demo with no real business data or backend.
|
|
381
|
+
|
|
382
|
+
## Demos on the published site
|
|
383
|
+
- The published site uses the same layout as the local board, with authoring details such as rules, gaps, and source locations removed.
|
|
384
|
+
- Layer switching, Follow director, replaying one layer, shot focus, and captions all work on the published site. See demo for syntax.
|
|
385
|
+
- Fullscreen works on the published site: F enters/toggles, Space plays/pauses, ←/→ steps back/forward, Esc exits.
|
|
386
|
+
- Fullscreen keeps only the stage and captions. Playback controls float below and hide automatically.
|
|
387
|
+
- Both local and published views can export images. Video export is local only and requires local Playwright/Chromium.
|
|
388
|
+
|
|
389
|
+
## Deploy
|
|
390
|
+
Use your own Wrangler environment and account in the project directory:
|
|
391
|
+
|
|
355
392
|
\`npx wrangler deploy --assets dist\`
|
|
356
|
-
|
|
357
|
-
|
|
393
|
+
Provide the site name and compatibility date through Wrangler project configuration. Handle access control in deployment.
|
|
394
|
+
Deploy only dist output, not author source files. MCP, comments, and collaboration are planned separately.
|
|
395
|
+
|
|
396
|
+
## Cloud sharing
|
|
397
|
+
- Run npx joplo login and verify the code in your browser before authorizing. Use --no-browser to open the URL manually over SSH or without a local browser.
|
|
398
|
+
- Agents publish with npx joplo share --format json. It checks, builds, and uploads only the published output.
|
|
399
|
+
- AUTH_REQUIRED exits 3: ask the user to run npx joplo login in their own terminal, then retry share. Agents must not authorize on their behalf.
|
|
400
|
+
- On AUTH_REQUIRED, ask the user to sign in. Do not run \`joplo logout\` on the user's behalf.
|
|
401
|
+
- AUTH_EXPIRED also exits 3: ask the user to sign in again. Read error.code / message / details for other failures.
|
|
402
|
+
- Free links expire after 1 hour; read data.expiresAt for the exact time. Pro permanent links have expiresAt: null.
|
|
403
|
+
- Pro share updates the same-server link in .joplo/cloud.json; --new creates another link and --title sets its title.
|
|
404
|
+
- npx joplo whoami --format json shows the account, plan, and limits; npx joplo logout signs out.
|
|
405
|
+
- maxUploadBytes limits only newly uploaded cloud blobs. The CLI prechecks maxTotalBytes and maxFiles. TOO_LARGE details.kind distinguishes upload / total / files.
|
|
406
|
+
- Credentials are stored only in JOPLO_HOME/credentials.json (default ~/.joplo). Never copy them into a project, print them, or commit them.
|
|
407
|
+
- Cloud commands accept --server <url>, overriding JOPLO_CLOUD_URL; the default is https://app.joplo.app.
|
|
408
|
+
- Local check / build / dev remain free and do not connect to the cloud.`,
|
|
358
409
|
};
|
|
359
410
|
function distance(a, b) {
|
|
360
411
|
let row = Array.from({ length: b.length + 1 }, (_, i) => i);
|