@buffcore/cli 0.8.41 → 0.8.43
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/CHANGELOG.md +36 -0
- package/dist/commands/agents-file.d.ts +5 -0
- package/dist/commands/agents-file.js +30 -7
- package/dist/commands/change.d.ts +4 -0
- package/dist/commands/change.js +12 -5
- package/dist/commands/create-block.d.ts +2 -1
- package/dist/commands/create-block.js +7 -5
- package/dist/commands/create.d.ts +3 -2
- package/dist/commands/create.en.js +1 -1
- package/dist/commands/create.es.js +1 -1
- package/dist/commands/create.js +8 -6
- package/dist/commands/design/check.d.ts +2 -0
- package/dist/commands/design/check.js +6 -0
- package/dist/commands/design/journey-roles.d.ts +6 -0
- package/dist/commands/design/journey-roles.js +60 -0
- package/dist/commands/design/references.d.ts +12 -0
- package/dist/commands/design/references.js +44 -0
- package/dist/commands/design/tells-text.js +2 -2
- package/dist/commands/design/tells.d.ts +3 -1
- package/dist/commands/design/tells.en.d.ts +2 -0
- package/dist/commands/design/tells.en.js +2 -0
- package/dist/commands/design/tells.es.js +2 -0
- package/dist/commands/design/tells.js +10 -7
- package/dist/commands/dev.js +3 -0
- package/dist/commands/extension/places-approval.d.ts +1 -1
- package/dist/commands/port-claims.d.ts +23 -0
- package/dist/commands/port-claims.js +95 -0
- package/dist/commands/prototype/browser.d.ts +9 -4
- package/dist/commands/prototype/browser.js +26 -18
- package/dist/commands/prototype/comp-record.d.ts +27 -0
- package/dist/commands/prototype/comp-record.js +85 -0
- package/dist/commands/prototype/comp-words.d.ts +12 -0
- package/dist/commands/prototype/comp-words.js +24 -0
- package/dist/commands/prototype/comp.d.ts +26 -0
- package/dist/commands/prototype/comp.js +71 -0
- package/dist/commands/prototype/export-base.d.ts +27 -0
- package/dist/commands/prototype/export-base.js +80 -0
- package/dist/commands/prototype/export.d.ts +3 -2
- package/dist/commands/prototype/export.js +13 -6
- package/dist/commands/prototype/index.js +1 -0
- package/dist/commands/prototype/media-ready.d.ts +8 -0
- package/dist/commands/prototype/media-ready.js +36 -0
- package/dist/commands/prototype/messages.en.d.ts +6 -0
- package/dist/commands/prototype/messages.en.js +6 -0
- package/dist/commands/prototype/messages.js +6 -0
- package/dist/commands/prototype/milestone-versions.d.ts +1 -1
- package/dist/commands/prototype/record-look-child.js +4 -1
- package/dist/commands/prototype/scene.d.ts +3 -1
- package/dist/commands/prototype/scene.js +22 -6
- package/dist/commands/prototype/snapshot-command.js +1 -1
- package/dist/commands/prototype/snapshot-inputs.js +35 -7
- package/dist/commands/prototype/snapshot-setup.d.ts +12 -1
- package/dist/commands/prototype/snapshot-setup.js +31 -6
- package/dist/commands/prototype/snapshot.d.ts +2 -0
- package/dist/commands/prototype/snapshot.js +2 -1
- package/dist/commands/prototype/versions.d.ts +3 -3
- package/dist/commands/ui/agents-route.d.ts +2 -0
- package/dist/commands/ui/agents-route.js +8 -5
- package/dist/commands/ui/approval-authority.d.ts +1 -1
- package/dist/commands/ui/approve.js +7 -1
- package/dist/commands/ui/chat/allow-folder.js +23 -77
- package/dist/commands/ui/chat/claude-permissions.d.ts +21 -0
- package/dist/commands/ui/chat/claude-permissions.js +69 -0
- package/dist/commands/ui/chat/codex-idle.d.ts +2 -0
- package/dist/commands/ui/chat/codex-overrides.js +2 -1
- package/dist/commands/ui/chat/codex-permissions.d.ts +12 -0
- package/dist/commands/ui/chat/codex-permissions.js +97 -0
- package/dist/commands/ui/chat/command-parts.d.ts +33 -0
- package/dist/commands/ui/chat/command-parts.js +219 -0
- package/dist/commands/ui/chat/command-wrappers.d.ts +21 -0
- package/dist/commands/ui/chat/command-wrappers.js +100 -0
- package/dist/commands/ui/chat/design-deletes.d.ts +1 -0
- package/dist/commands/ui/chat/design-deletes.js +39 -0
- package/dist/commands/ui/chat/fresh-critique.d.ts +28 -0
- package/dist/commands/ui/chat/fresh-critique.js +121 -0
- package/dist/commands/ui/chat/fresh-launch.d.ts +31 -0
- package/dist/commands/ui/chat/fresh-launch.js +122 -0
- package/dist/commands/ui/chat/fresh-prompts.d.ts +17 -0
- package/dist/commands/ui/chat/fresh-prompts.js +76 -0
- package/dist/commands/ui/chat/fresh-report.d.ts +8 -0
- package/dist/commands/ui/chat/fresh-report.js +36 -0
- package/dist/commands/ui/chat/fresh-routes.d.ts +3 -0
- package/dist/commands/ui/chat/fresh-routes.js +64 -0
- package/dist/commands/ui/chat/fresh-settings.d.ts +12 -0
- package/dist/commands/ui/chat/fresh-settings.js +66 -0
- package/dist/commands/ui/chat/fresh-store.d.ts +17 -0
- package/dist/commands/ui/chat/fresh-store.js +67 -0
- package/dist/commands/ui/chat/fresh.d.ts +31 -0
- package/dist/commands/ui/chat/fresh.en.d.ts +7 -0
- package/dist/commands/ui/chat/fresh.en.js +7 -0
- package/dist/commands/ui/chat/fresh.es.d.ts +7 -0
- package/dist/commands/ui/chat/fresh.es.js +7 -0
- package/dist/commands/ui/chat/fresh.js +112 -0
- package/dist/commands/ui/chat/launch-input.d.ts +4 -2
- package/dist/commands/ui/chat/launch-input.js +16 -3
- package/dist/commands/ui/chat/limit-mentions.d.ts +5 -0
- package/dist/commands/ui/chat/limit-mentions.js +94 -0
- package/dist/commands/ui/chat/limit-patterns.d.ts +15 -0
- package/dist/commands/ui/chat/limit-patterns.js +182 -0
- package/dist/commands/ui/chat/limits-hook.d.ts +1 -0
- package/dist/commands/ui/chat/limits-hook.js +30 -0
- package/dist/commands/ui/chat/limits.d.ts +44 -0
- package/dist/commands/ui/chat/limits.en.d.ts +20 -0
- package/dist/commands/ui/chat/limits.en.js +20 -0
- package/dist/commands/ui/chat/limits.es.d.ts +2 -0
- package/dist/commands/ui/chat/limits.es.js +19 -0
- package/dist/commands/ui/chat/limits.js +236 -0
- package/dist/commands/ui/chat/local-settings.d.ts +17 -0
- package/dist/commands/ui/chat/local-settings.js +73 -0
- package/dist/commands/ui/chat/opencode-config.d.ts +22 -0
- package/dist/commands/ui/chat/opencode-config.js +83 -0
- package/dist/commands/ui/chat/parse-claude.js +25 -5
- package/dist/commands/ui/chat/permission-ask.d.ts +44 -0
- package/dist/commands/ui/chat/permission-ask.js +145 -0
- package/dist/commands/ui/chat/permission-channel.d.ts +18 -0
- package/dist/commands/ui/chat/permission-channel.js +67 -0
- package/dist/commands/ui/chat/permission-route.d.ts +10 -0
- package/dist/commands/ui/chat/permission-route.js +47 -0
- package/dist/commands/ui/chat/permission-tool.d.ts +1 -0
- package/dist/commands/ui/chat/permission-tool.js +86 -0
- package/dist/commands/ui/chat/permissions.d.ts +11 -12
- package/dist/commands/ui/chat/permissions.js +20 -102
- package/dist/commands/ui/chat/planning-limits.d.ts +12 -0
- package/dist/commands/ui/chat/planning-limits.js +46 -0
- package/dist/commands/ui/chat/process.js +4 -1
- package/dist/commands/ui/chat/prompt.d.ts +8 -1
- package/dist/commands/ui/chat/prompt.en.d.ts +4 -0
- package/dist/commands/ui/chat/prompt.en.js +4 -0
- package/dist/commands/ui/chat/prompt.es.d.ts +4 -0
- package/dist/commands/ui/chat/prompt.es.js +4 -0
- package/dist/commands/ui/chat/prompt.js +18 -50
- package/dist/commands/ui/chat/publish-limits.d.ts +4 -0
- package/dist/commands/ui/chat/publish-limits.js +97 -0
- package/dist/commands/ui/chat/recorded-turn.js +6 -0
- package/dist/commands/ui/chat/routes.js +2 -0
- package/dist/commands/ui/chat/secret-folders.d.ts +16 -0
- package/dist/commands/ui/chat/secret-folders.js +35 -0
- package/dist/commands/ui/chat/stdin-shells.d.ts +8 -0
- package/dist/commands/ui/chat/stdin-shells.js +102 -0
- package/dist/commands/ui/chat/step-rules.d.ts +13 -0
- package/dist/commands/ui/chat/step-rules.js +47 -0
- package/dist/commands/ui/chat/store.js +11 -2
- package/dist/commands/ui/chat/stream.en.d.ts +6 -0
- package/dist/commands/ui/chat/stream.en.js +6 -0
- package/dist/commands/ui/chat/stream.es.d.ts +6 -0
- package/dist/commands/ui/chat/stream.es.js +6 -0
- package/dist/commands/ui/chat/stream.js +8 -2
- package/dist/commands/ui/chat/turn-guard.d.ts +27 -0
- package/dist/commands/ui/chat/turn-guard.js +86 -0
- package/dist/commands/ui/chat/turn-input.d.ts +3 -2
- package/dist/commands/ui/chat/turn-input.js +3 -1
- package/dist/commands/ui/chat/turn-scenes.d.ts +19 -0
- package/dist/commands/ui/chat/turn-scenes.js +44 -0
- package/dist/commands/ui/chat/turn-state.d.ts +11 -0
- package/dist/commands/ui/chat/turn.js +9 -3
- package/dist/commands/ui/comp-approval.d.ts +6 -0
- package/dist/commands/ui/comp-approval.js +42 -0
- package/dist/commands/ui/host.js +3 -0
- package/dist/commands/ui/index.js +18 -6
- package/dist/commands/ui/level-route.js +8 -3
- package/dist/commands/ui/loop-approve.d.ts +4 -4
- package/dist/commands/ui/page.d.ts +19 -1
- package/dist/commands/ui/page.js +9 -6
- package/dist/commands/ui/places-change.d.ts +1 -1
- package/dist/commands/ui/plan-structure.d.ts +12 -2
- package/dist/commands/ui/plan-structure.en.d.ts +4 -0
- package/dist/commands/ui/plan-structure.en.js +4 -0
- package/dist/commands/ui/plan-structure.es.d.ts +4 -0
- package/dist/commands/ui/plan-structure.es.js +4 -0
- package/dist/commands/ui/plan-structure.js +48 -14
- package/dist/commands/ui/prototype-comp-route.d.ts +7 -0
- package/dist/commands/ui/prototype-comp-route.js +109 -0
- package/dist/commands/ui/prototype-main.d.ts +3 -1
- package/dist/commands/ui/prototype-scenes-child.js +6 -1
- package/dist/commands/ui/prototype-scenes-read.d.ts +1 -0
- package/dist/commands/ui/prototype-scenes-route.js +7 -1
- package/dist/commands/ui/prototype-snapshot-session.d.ts +1 -1
- package/dist/commands/ui/prototype-snapshot-session.js +3 -0
- package/dist/commands/ui/prototype-snapshot.d.ts +1 -1
- package/dist/commands/ui/routes.d.ts +6 -3
- package/dist/commands/ui/routes.js +3 -3
- package/dist/commands/ui/save-commit.js +6 -2
- package/dist/commands/ui/save-publish.js +3 -0
- package/dist/commands/ui/server-options.js +2 -0
- package/dist/commands/ui/server.d.ts +12 -22
- package/dist/commands/ui/server.js +10 -48
- package/dist/commands/ui/snapshot-runners.d.ts +22 -0
- package/dist/commands/ui/snapshot-runners.js +45 -0
- package/dist/commands/ui/structure-surface.d.ts +6 -0
- package/dist/commands/ui/structure-surface.js +94 -0
- package/dist/commands/ui/studio-routes.d.ts +1 -0
- package/dist/commands/ui/studio-routes.js +5 -0
- package/dist/commands/ui/studio-state.d.ts +9 -4
- package/dist/commands/ui/studio-state.js +1 -0
- package/dist/commands/ui/studio-versions.d.ts +3 -3
- package/dist/commands/ui/studio.en.d.ts +13 -0
- package/dist/commands/ui/studio.en.js +13 -0
- package/dist/commands/ui/studio.es.d.ts +13 -0
- package/dist/commands/ui/studio.es.js +13 -0
- package/dist/commands/ui/theme-option.d.ts +8 -0
- package/dist/commands/ui/theme-option.js +40 -0
- package/dist/commands/ui/theme-values.d.ts +5 -0
- package/dist/commands/ui/theme-values.js +113 -0
- package/dist/ui/page.js +94 -94
- package/docs/PROCESS.md +5 -0
- package/docs/PROTOTYPE.md +24 -1
- package/docs/WORKBENCH.md +76 -22
- package/package.json +11 -11
- package/skills/ape-critique/SKILL.md +16 -6
- package/skills/ape-design-system/SKILL.md +4 -3
- package/skills/ape-plan-change/SKILL.md +7 -3
- package/skills/ape-prototype/SKILL.md +12 -1
- package/templates/example/apps/app/src/i18n/en.ts +2 -0
- package/templates/example/apps/app/src/i18n/es.json +2 -0
- package/templates/product/apps/admin/src/fonts.ts +2 -1
- package/templates/product/apps/app/src/fonts.ts +5 -1
- package/templates/product/apps/app/src/i18n/en.ts +2 -0
- package/templates/product/apps/app/src/i18n/es.json +2 -0
- package/templates/product/prototype/journeys.ts +3 -0
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { workbenchApi } from '@buffcore/contracts/workbench';
|
|
2
2
|
import { prototypeSceneReader } from './prototype-scenes-read.js';
|
|
3
|
+
/** The route answers scene identities only: a scene's view name stays inside the studio. */
|
|
4
|
+
function identities(reply) {
|
|
5
|
+
return reply.ok
|
|
6
|
+
? { ok: true, scenes: reply.scenes.map(({ key, title, surface }) => ({ key, title, surface })) }
|
|
7
|
+
: reply;
|
|
8
|
+
}
|
|
3
9
|
/** Loading project code needs snapshot authority before the reader can run. */
|
|
4
10
|
export function prototypeScenesRoute(root) {
|
|
5
11
|
const read = prototypeSceneReader(root);
|
|
@@ -9,6 +15,6 @@ export function prototypeScenesRoute(root) {
|
|
|
9
15
|
readable: true,
|
|
10
16
|
right: 'build',
|
|
11
17
|
origin: true,
|
|
12
|
-
handle: async () => ({ status: 200, body: await read() }),
|
|
18
|
+
handle: async () => ({ status: 200, body: identities(await read()) }),
|
|
13
19
|
};
|
|
14
20
|
}
|
|
@@ -8,7 +8,7 @@ import type { SnapshotProgress } from './snapshot-progress.ts';
|
|
|
8
8
|
export { SNAPSHOT_TIMEOUT_MS };
|
|
9
9
|
export declare const SNAPSHOT_OUTPUT_BYTES: number;
|
|
10
10
|
type Status = 'idle' | 'serversNeeded' | 'running' | 'stopped' | 'failed' | 'passed';
|
|
11
|
-
type Options = Pick<UiServerOptions, 'runner' | 'stack' | 'snapshotLimits'>;
|
|
11
|
+
type Options = Pick<UiServerOptions, 'runner' | 'stack' | 'snapshotLimits' | 'onFullSnapshot'>;
|
|
12
12
|
/** Main keeps the runner id `snapshot`; a change in its own checkout runs on `snapshot:<change>`. */
|
|
13
13
|
export declare const runnerId: (change: string, linked: boolean) => "snapshot" | `snapshot:${string}`;
|
|
14
14
|
export declare const sameSource: (a: Pick<PrototypeSource, 'change' | 'checkout' | 'commit'> | undefined, b: PrototypeSource) => boolean;
|
|
@@ -163,6 +163,9 @@ export class SnapshotSessions {
|
|
|
163
163
|
...(proof ? { proof } : {}),
|
|
164
164
|
result,
|
|
165
165
|
});
|
|
166
|
+
// Only a full run that passed starts the critique, as a fresh turn of its own.
|
|
167
|
+
if (proof)
|
|
168
|
+
this.options.onFullSnapshot?.(source, run.files?.[0]);
|
|
166
169
|
}
|
|
167
170
|
start(source, linked, scenes) {
|
|
168
171
|
const controller = new AbortController();
|
|
@@ -3,6 +3,6 @@ import type { UiRoute } from './routes.ts';
|
|
|
3
3
|
import type { UiServerOptions } from './server.ts';
|
|
4
4
|
export { SNAPSHOT_OUTPUT_BYTES, SNAPSHOT_TIMEOUT_MS } from './prototype-snapshot-session.ts';
|
|
5
5
|
/** A person-operated snapshot route; execution belongs to the captured session. */
|
|
6
|
-
export declare function prototypeSnapshotRoute(options: Pick<UiServerOptions, 'runner' | 'stack' | 'snapshotLimits'>, shutdown?: AbortSignal): UiRoute & {
|
|
6
|
+
export declare function prototypeSnapshotRoute(options: Pick<UiServerOptions, 'runner' | 'stack' | 'snapshotLimits' | 'onFullSnapshot'>, shutdown?: AbortSignal): UiRoute & {
|
|
7
7
|
record: (change: string) => ReviewProof;
|
|
8
8
|
};
|
|
@@ -27,13 +27,16 @@ export interface UiRequest extends MergeConfiguration, SaveConfiguration, Outsid
|
|
|
27
27
|
/** The JSON body, at most `limit` characters (10,000 by default); `{}` when empty. */
|
|
28
28
|
body: (limit?: number) => Promise<unknown>;
|
|
29
29
|
}
|
|
30
|
+
/** The image types an answer's bytes may be sent as. */
|
|
31
|
+
export type ImageType = 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif' | 'image/avif';
|
|
30
32
|
export interface UiAnswer {
|
|
31
33
|
status: number;
|
|
32
|
-
/** JSON; a Buffer is sent as
|
|
34
|
+
/** JSON; a Buffer is sent as an image, PNG unless `type` names another. */
|
|
33
35
|
body: unknown;
|
|
36
|
+
type?: ImageType;
|
|
34
37
|
}
|
|
35
|
-
/**
|
|
36
|
-
export declare function sendPng(res: ServerResponse, status: number, png: Buffer): void;
|
|
38
|
+
/** An image answer (PNG by default): never cached or sniffed. */
|
|
39
|
+
export declare function sendPng(res: ServerResponse, status: number, png: Buffer, type?: ImageType): void;
|
|
37
40
|
export interface UiRoute {
|
|
38
41
|
method: 'GET' | 'POST';
|
|
39
42
|
path: `/api/${string}`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
export function sendPng(res, status, png) {
|
|
1
|
+
/** An image answer (PNG by default): never cached or sniffed. */
|
|
2
|
+
export function sendPng(res, status, png, type = 'image/png') {
|
|
3
3
|
res.writeHead(status, {
|
|
4
|
-
'content-type':
|
|
4
|
+
'content-type': type,
|
|
5
5
|
'content-length': png.length,
|
|
6
6
|
'cache-control': 'no-store',
|
|
7
7
|
'x-content-type-options': 'nosniff',
|
|
@@ -30,10 +30,14 @@ async function workingChanged(git, index, files) {
|
|
|
30
30
|
const changed = new Set(diff.split('\0'));
|
|
31
31
|
return files.some((file) => changed.has(file));
|
|
32
32
|
}
|
|
33
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Read the exact saved tree, never a working file that can change after the snapshot. Never ask
|
|
35
|
+
* counts as part of the level: a generic save may change neither.
|
|
36
|
+
*/
|
|
34
37
|
async function levelAt(git, ref, path) {
|
|
35
38
|
try {
|
|
36
|
-
|
|
39
|
+
const file = parseCommittedAgents(await git(['show', `${ref}:./${path}`]));
|
|
40
|
+
return file.neverAsk ? `${file.level}+neverAsk` : file.level;
|
|
37
41
|
}
|
|
38
42
|
catch (error) {
|
|
39
43
|
if (error.code === 'ETIMEDOUT')
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { readFile, writeFile } from 'node:fs/promises';
|
|
2
2
|
import { dirname, join } from 'node:path';
|
|
3
3
|
import { MAIN_REF } from '../main-ref.js';
|
|
4
|
+
import { COMP_FILE, COMP_SUBJECT } from '../prototype/comp-record.js';
|
|
4
5
|
import { changedByChecks, held, onHead, refFailure, unknown } from './save-failure.js';
|
|
5
6
|
import { editedHooks } from './save-hooks.js';
|
|
6
7
|
import { t } from './save-messages.js';
|
|
@@ -17,6 +18,8 @@ const stepNames = {
|
|
|
17
18
|
export function stepMessage(step, count, approval) {
|
|
18
19
|
if (step === 'places-approval')
|
|
19
20
|
return 'plan: approve the places';
|
|
21
|
+
if (step === 'prototype-approval' && approval?.file === COMP_FILE)
|
|
22
|
+
return COMP_SUBJECT;
|
|
20
23
|
if (step === 'prototype-approval' && approval) {
|
|
21
24
|
const change = /^prototype\/versions\/(C-\d{3,})\.json$/.exec(approval.file)?.[1];
|
|
22
25
|
try {
|
|
@@ -3,6 +3,7 @@ import { saveHostT, saveTimeout } from './host-save.js';
|
|
|
3
3
|
import { mergeT, mergeTimeout } from './merge-authority.js';
|
|
4
4
|
import { checkedOutside } from './outside.js';
|
|
5
5
|
import { checkedHostParts } from './page.js';
|
|
6
|
+
import { checkedTheme } from './theme-option.js';
|
|
6
7
|
/** Validate host-owned registration before the server starts listening. */
|
|
7
8
|
export function checkedUiOptions(input) {
|
|
8
9
|
if (input.approval && !input.signIn)
|
|
@@ -21,5 +22,6 @@ export function checkedUiOptions(input) {
|
|
|
21
22
|
contained: input.contained === true,
|
|
22
23
|
hostParts: checkedHostParts(input.hostParts, signedIn),
|
|
23
24
|
outside: checkedOutside(input.outside, signedIn),
|
|
25
|
+
theme: checkedTheme(input.theme),
|
|
24
26
|
};
|
|
25
27
|
}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { type Server } from 'node:http';
|
|
2
|
-
import type {
|
|
3
|
-
import { type HostPartSources } from '@buffcore/contracts/workbench';
|
|
2
|
+
import type { PlannedChange } from '@buffcore/admin-shell/workbench';
|
|
4
3
|
import type { HostApproval } from './approval-authority.ts';
|
|
5
4
|
import type { TurnMigrations } from './chat/migration-turn.ts';
|
|
6
5
|
import { type LocalCode } from './code.ts';
|
|
7
|
-
import {
|
|
6
|
+
import type { CommandSpec } from './commands.ts';
|
|
8
7
|
import { type HostLevel, type SignIn } from './host.ts';
|
|
9
8
|
import type { SaveConfiguration } from './host-save.ts';
|
|
10
9
|
import type { HostMerge } from './merge-authority.ts';
|
|
11
10
|
import type { OutsideConfiguration } from './outside.ts';
|
|
11
|
+
import { type HostPageOptions } from './page.ts';
|
|
12
12
|
import { type UiRoute } from './routes.ts';
|
|
13
13
|
import type { Runner } from './runner.ts';
|
|
14
|
-
import { type DiagnosticRun } from './snapshot-diagnostics.ts';
|
|
15
14
|
import type { Stack } from './stack.ts';
|
|
16
15
|
export type { Machine, Right, Viewer } from '@buffcore/contracts/workbench';
|
|
17
16
|
export type { ApprovalArtifact, HostApproval, HostApprovalAnswer } from './approval-authority.ts';
|
|
17
|
+
export { FreshLooks } from './chat/fresh.ts';
|
|
18
|
+
export { freshRoutes } from './chat/fresh-routes.ts';
|
|
18
19
|
export { chatRoutes } from './chat/routes.ts';
|
|
19
20
|
export { ChatEngine, type ChatEngineOptions } from './chat/turn.ts';
|
|
20
21
|
export type { HostLevel, SignIn, UiIdentity } from './host.ts';
|
|
@@ -28,6 +29,7 @@ export { type AgentTurn, Runner, type Start } from './runner.ts';
|
|
|
28
29
|
export { coreRoutes, stateAccess } from './server-core.ts';
|
|
29
30
|
export { listenLocal } from './server-request.ts';
|
|
30
31
|
export type { DiagnosticRun, StoredRuns } from './snapshot-diagnostics.ts';
|
|
32
|
+
export { recordPrototypeRun, runPrototypeSnapshot } from './snapshot-runners.ts';
|
|
31
33
|
export { diagnosticsView, runView, visibleRuns } from './snapshot-view.ts';
|
|
32
34
|
export { Stack } from './stack.ts';
|
|
33
35
|
export { studioRoutes } from './studio-routes.ts';
|
|
@@ -39,9 +41,14 @@ export interface Plan {
|
|
|
39
41
|
/** The product has `prototype/home.tsx`. */
|
|
40
42
|
prototypeHome: boolean;
|
|
41
43
|
}
|
|
42
|
-
export interface UiServerOptions extends SaveConfiguration, OutsideConfiguration {
|
|
44
|
+
export interface UiServerOptions extends SaveConfiguration, OutsideConfiguration, HostPageOptions {
|
|
43
45
|
turnMigrations?: TurnMigrations;
|
|
44
46
|
snapshotLimits?: CommandSpec['limits'];
|
|
47
|
+
/** A full studio snapshot passed: the studio starts the critique as a fresh turn. */
|
|
48
|
+
onFullSnapshot?: (source: {
|
|
49
|
+
change: string;
|
|
50
|
+
checkout: string;
|
|
51
|
+
}, report?: string) => void;
|
|
45
52
|
/** Required for local use; ignored when the host supplies signIn. */
|
|
46
53
|
token?: string;
|
|
47
54
|
/** Local recovery only; ignored completely in hosted mode. */
|
|
@@ -51,8 +58,6 @@ export interface UiServerOptions extends SaveConfiguration, OutsideConfiguration
|
|
|
51
58
|
approval?: HostApproval;
|
|
52
59
|
merge?: HostMerge;
|
|
53
60
|
mergeTimeoutMs?: number;
|
|
54
|
-
/** Trusted modules served by the host, at five existing places. Requires signIn. */
|
|
55
|
-
hostParts?: HostPartSources;
|
|
56
61
|
/** Host-owned isolation boundary; never inferred from product inputs. */
|
|
57
62
|
contained?: boolean;
|
|
58
63
|
product: string;
|
|
@@ -65,20 +70,5 @@ export interface UiServerOptions extends SaveConfiguration, OutsideConfiguration
|
|
|
65
70
|
/** More of the API: each part of the workbench adds its routes (routes.ts). */
|
|
66
71
|
routes?: readonly UiRoute[];
|
|
67
72
|
}
|
|
68
|
-
type DiagnosticId = 'snapshot' | 'post-merge' | `snapshot:${string}` | `post-merge:${string}` | `snapshot-check:${string}` | `compare:${string}`;
|
|
69
|
-
export declare function recordPrototypeRun<T extends string>(root: string, id: T, run?: T extends DiagnosticId ? DiagnosticRun : CommandRun | DiagnosticRun): void;
|
|
70
|
-
/** Autopilot starts its own fresh run on the same runner as the person's Snapshot command. */
|
|
71
|
-
export declare function runPrototypeSnapshot(root: string, signal?: AbortSignal, id?: string, options?: {
|
|
72
|
-
cwd: string;
|
|
73
|
-
scenes?: readonly string[];
|
|
74
|
-
commit?: string;
|
|
75
|
-
command?: string;
|
|
76
|
-
json?: boolean;
|
|
77
|
-
limits?: CommandSpec['limits'];
|
|
78
|
-
snapshotRunId?: string;
|
|
79
|
-
/** Keep only the problems the result lists, not the progress lines the tool printed. */
|
|
80
|
-
listedOnly?: boolean;
|
|
81
|
-
onSnapshotProgress?: CommandSpec['onSnapshotProgress'];
|
|
82
|
-
}): Promise<DiagnosticRun | undefined>;
|
|
83
73
|
/** The server, not yet listening. Local callers use listenLocal; a host owns its listener. */
|
|
84
74
|
export declare function createUiServer(input: UiServerOptions): Server;
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
// The workbench's page and JSON API: local Host/token guards, or the host's sign-in per request.
|
|
2
|
-
import { existsSync, realpathSync } from 'node:fs';
|
|
3
2
|
import { createServer } from 'node:http';
|
|
4
|
-
import { resolve } from 'node:path';
|
|
5
3
|
import { workbenchApi } from '@buffcore/contracts/workbench';
|
|
6
4
|
import { migrationRoute } from '../migrate-create-protocol.js';
|
|
7
5
|
import { MilestoneVersionsPending } from '../prototype/milestone-key.js';
|
|
8
|
-
import { snapshotsDir } from '../prototype/report.js';
|
|
9
|
-
import { cleanSnapshotChild } from '../prototype/snapshot-storage.js';
|
|
10
6
|
import { scrubLaunchIds } from './chat/launch-ids.js';
|
|
11
7
|
import { exchangeCode } from './code.js';
|
|
12
|
-
import { commandFor } from './commands.js';
|
|
13
8
|
import { studioFont } from './fonts.js';
|
|
14
9
|
import { allowedHost, allowedToken } from './guard.js';
|
|
15
10
|
import { denied, hostT, localIdentity, requestRefusal, routeRight, signedIn, } from './host.js';
|
|
@@ -19,8 +14,10 @@ import { matchRoute, sendPng } from './routes.js';
|
|
|
19
14
|
import { coreRoutes } from './server-core.js';
|
|
20
15
|
import { checkedUiOptions } from './server-options.js';
|
|
21
16
|
import { localListener, migrationSignal, requestContext } from './server-request.js';
|
|
22
|
-
import {
|
|
17
|
+
import { runnerKey, snapshotRunners } from './snapshot-runners.js';
|
|
23
18
|
import { studioT } from './studio-messages.js';
|
|
19
|
+
export { FreshLooks } from './chat/fresh.js';
|
|
20
|
+
export { freshRoutes } from './chat/fresh-routes.js';
|
|
24
21
|
export { chatRoutes } from './chat/routes.js';
|
|
25
22
|
export { ChatEngine } from './chat/turn.js';
|
|
26
23
|
export { pageScript } from './page.js';
|
|
@@ -28,6 +25,7 @@ export { readProductPlan } from './product-plan.js';
|
|
|
28
25
|
export { Runner } from './runner.js';
|
|
29
26
|
export { coreRoutes, stateAccess } from './server-core.js';
|
|
30
27
|
export { listenLocal } from './server-request.js';
|
|
28
|
+
export { recordPrototypeRun, runPrototypeSnapshot } from './snapshot-runners.js';
|
|
31
29
|
export { diagnosticsView, runView, visibleRuns } from './snapshot-view.js';
|
|
32
30
|
export { Stack } from './stack.js';
|
|
33
31
|
export { studioRoutes } from './studio-routes.js';
|
|
@@ -37,44 +35,6 @@ const LOCAL_PAGE_HEADERS = {
|
|
|
37
35
|
'x-frame-options': 'DENY',
|
|
38
36
|
'referrer-policy': 'no-referrer',
|
|
39
37
|
};
|
|
40
|
-
const snapshotRunners = new Map();
|
|
41
|
-
const runnerKey = (root) => (existsSync(root) ? realpathSync.native(root) : resolve(root));
|
|
42
|
-
export function recordPrototypeRun(root, id, run) {
|
|
43
|
-
snapshotRunners.get(runnerKey(root))?.record(id, run);
|
|
44
|
-
}
|
|
45
|
-
/** Autopilot starts its own fresh run on the same runner as the person's Snapshot command. */
|
|
46
|
-
export function runPrototypeSnapshot(root, signal, id = 'snapshot', options) {
|
|
47
|
-
const runner = snapshotRunners.get(runnerKey(root));
|
|
48
|
-
const spec = options?.command
|
|
49
|
-
? { program: 'shell', args: [options.command], json: options.json ?? false }
|
|
50
|
-
: commandFor('snapshot', { seeds: [], changes: [], scenes: options?.scenes });
|
|
51
|
-
if (!runner || !spec)
|
|
52
|
-
return Promise.resolve(undefined);
|
|
53
|
-
const child = options
|
|
54
|
-
? {
|
|
55
|
-
...spec,
|
|
56
|
-
cwd: options.cwd,
|
|
57
|
-
validationCommit: options.commit,
|
|
58
|
-
limits: options.limits,
|
|
59
|
-
onSnapshotProgress: options.onSnapshotProgress,
|
|
60
|
-
...(options.snapshotRunId ? { snapshotRunId: options.snapshotRunId } : {}),
|
|
61
|
-
}
|
|
62
|
-
: spec;
|
|
63
|
-
return new Promise((resolve) => {
|
|
64
|
-
const finish = async () => {
|
|
65
|
-
const run = runner.all()[id];
|
|
66
|
-
if (options?.snapshotRunId) {
|
|
67
|
-
// Leftover folders are tidied here, not judged: a child that published its whole snapshot
|
|
68
|
-
// passed, and a folder that cannot be removed now is removed by the next recovery.
|
|
69
|
-
await cleanSnapshotChild(snapshotsDir(options.cwd), options.snapshotRunId).catch(() => { });
|
|
70
|
-
}
|
|
71
|
-
resolve(run ? captureRecordedRun(options?.cwd ?? root, run) : undefined);
|
|
72
|
-
};
|
|
73
|
-
const started = runner.run(id, child, finish, signal);
|
|
74
|
-
if (!started)
|
|
75
|
-
resolve(undefined);
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
38
|
function send(res, status, body, type = 'application/json', extra = {}) {
|
|
79
39
|
res.writeHead(status, {
|
|
80
40
|
'content-type': `${type}; charset=utf-8`,
|
|
@@ -84,7 +44,9 @@ function send(res, status, body, type = 'application/json', extra = {}) {
|
|
|
84
44
|
});
|
|
85
45
|
res.end(scrubLaunchIds(body));
|
|
86
46
|
}
|
|
87
|
-
const json = (res, status, body) => Buffer.isBuffer(body)
|
|
47
|
+
const json = (res, status, body, type) => Buffer.isBuffer(body)
|
|
48
|
+
? sendPng(res, status, body, type)
|
|
49
|
+
: send(res, status, JSON.stringify(body));
|
|
88
50
|
/** The server, not yet listening. Local callers use listenLocal; a host owns its listener. */
|
|
89
51
|
export function createUiServer(input) {
|
|
90
52
|
const options = checkedUiOptions(input);
|
|
@@ -127,7 +89,7 @@ async function handleRequest(options, routes, req, res, port, script, shutdown)
|
|
|
127
89
|
const { pathname: path, search } = new URL(req.url ?? '/', 'http://workbench');
|
|
128
90
|
if (!options.signIn && path === migrationRoute && options.turnMigrations) {
|
|
129
91
|
const answer = await options.turnMigrations.request(req, migrationSignal(res, shutdown));
|
|
130
|
-
return json(res, answer.status, answer.body);
|
|
92
|
+
return json(res, answer.status, answer.body, answer.type);
|
|
131
93
|
}
|
|
132
94
|
if (req.method === 'GET' && path === '/') {
|
|
133
95
|
const headers = options.signIn ? {} : LOCAL_PAGE_HEADERS;
|
|
@@ -136,7 +98,7 @@ async function handleRequest(options, routes, req, res, port, script, shutdown)
|
|
|
136
98
|
...headers,
|
|
137
99
|
location: `${localStudioOrigin(port)}/${search}`,
|
|
138
100
|
});
|
|
139
|
-
return send(res, 200, pageHtml(options.product, options.hostParts, !options.signIn), 'text/html', headers);
|
|
101
|
+
return send(res, 200, pageHtml(options.product, options.hostParts, !options.signIn, options.theme), 'text/html', headers);
|
|
140
102
|
}
|
|
141
103
|
if (req.method === 'GET' && path === '/page.js')
|
|
142
104
|
return send(res, 200, await script(), 'text/javascript');
|
|
@@ -169,5 +131,5 @@ async function handleApi(options, routes, req, res, path, shutdown) {
|
|
|
169
131
|
const refusal = requestRefusal(found.route, request) ??
|
|
170
132
|
denied(identity.viewer, await routeRight(found.route, request));
|
|
171
133
|
const answer = refusal ?? (await found.route.handle(request));
|
|
172
|
-
return json(res, answer.status, answer.body);
|
|
134
|
+
return json(res, answer.status, answer.body, answer.type);
|
|
173
135
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CommandRun } from '@buffcore/admin-shell/workbench';
|
|
2
|
+
import { type CommandSpec } from './commands.ts';
|
|
3
|
+
import type { Runner } from './runner.ts';
|
|
4
|
+
import { type DiagnosticRun } from './snapshot-diagnostics.ts';
|
|
5
|
+
export declare const snapshotRunners: Map<string, Runner>;
|
|
6
|
+
export declare const runnerKey: (root: string) => string;
|
|
7
|
+
type DiagnosticId = 'snapshot' | 'post-merge' | `snapshot:${string}` | `post-merge:${string}` | `snapshot-check:${string}` | `compare:${string}`;
|
|
8
|
+
export declare function recordPrototypeRun<T extends string>(root: string, id: T, run?: T extends DiagnosticId ? DiagnosticRun : CommandRun | DiagnosticRun): void;
|
|
9
|
+
/** Autopilot starts its own fresh run on the same runner as the person's Snapshot command. */
|
|
10
|
+
export declare function runPrototypeSnapshot(root: string, signal?: AbortSignal, id?: string, options?: {
|
|
11
|
+
cwd: string;
|
|
12
|
+
scenes?: readonly string[];
|
|
13
|
+
commit?: string;
|
|
14
|
+
command?: string;
|
|
15
|
+
json?: boolean;
|
|
16
|
+
limits?: CommandSpec['limits'];
|
|
17
|
+
snapshotRunId?: string;
|
|
18
|
+
/** Keep only the problems the result lists, not the progress lines the tool printed. */
|
|
19
|
+
listedOnly?: boolean;
|
|
20
|
+
onSnapshotProgress?: CommandSpec['onSnapshotProgress'];
|
|
21
|
+
}): Promise<DiagnosticRun | undefined>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// The prototype snapshot runners the studio's servers register, one per product folder.
|
|
2
|
+
import { existsSync, realpathSync } from 'node:fs';
|
|
3
|
+
import { resolve } from 'node:path';
|
|
4
|
+
import { snapshotsDir } from '../prototype/report.js';
|
|
5
|
+
import { cleanSnapshotChild } from '../prototype/snapshot-storage.js';
|
|
6
|
+
import { commandFor } from './commands.js';
|
|
7
|
+
import { captureRecordedRun } from './snapshot-diagnostics.js';
|
|
8
|
+
export const snapshotRunners = new Map();
|
|
9
|
+
export const runnerKey = (root) => existsSync(root) ? realpathSync.native(root) : resolve(root);
|
|
10
|
+
export function recordPrototypeRun(root, id, run) {
|
|
11
|
+
snapshotRunners.get(runnerKey(root))?.record(id, run);
|
|
12
|
+
}
|
|
13
|
+
/** Autopilot starts its own fresh run on the same runner as the person's Snapshot command. */
|
|
14
|
+
export function runPrototypeSnapshot(root, signal, id = 'snapshot', options) {
|
|
15
|
+
const runner = snapshotRunners.get(runnerKey(root));
|
|
16
|
+
const spec = options?.command
|
|
17
|
+
? { program: 'shell', args: [options.command], json: options.json ?? false }
|
|
18
|
+
: commandFor('snapshot', { seeds: [], changes: [], scenes: options?.scenes });
|
|
19
|
+
if (!runner || !spec)
|
|
20
|
+
return Promise.resolve(undefined);
|
|
21
|
+
const child = options
|
|
22
|
+
? {
|
|
23
|
+
...spec,
|
|
24
|
+
cwd: options.cwd,
|
|
25
|
+
validationCommit: options.commit,
|
|
26
|
+
limits: options.limits,
|
|
27
|
+
onSnapshotProgress: options.onSnapshotProgress,
|
|
28
|
+
...(options.snapshotRunId ? { snapshotRunId: options.snapshotRunId } : {}),
|
|
29
|
+
}
|
|
30
|
+
: spec;
|
|
31
|
+
return new Promise((resolve) => {
|
|
32
|
+
const finish = async () => {
|
|
33
|
+
const run = runner.all()[id];
|
|
34
|
+
if (options?.snapshotRunId) {
|
|
35
|
+
// Leftover folders are tidied here, not judged: a child that published its whole snapshot
|
|
36
|
+
// passed, and a folder that cannot be removed now is removed by the next recovery.
|
|
37
|
+
await cleanSnapshotChild(snapshotsDir(options.cwd), options.snapshotRunId).catch(() => { });
|
|
38
|
+
}
|
|
39
|
+
resolve(run ? captureRecordedRun(options?.cwd ?? root, run) : undefined);
|
|
40
|
+
};
|
|
41
|
+
const started = runner.run(id, child, finish, signal);
|
|
42
|
+
if (!started)
|
|
43
|
+
resolve(undefined);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type FirstSurface } from '@buffcore/contracts/workbench';
|
|
2
|
+
import type { UiRoute } from './routes.ts';
|
|
3
|
+
/** The structure's text with its surface line set: replaced where it is, else after the title. */
|
|
4
|
+
export declare function withSurface(source: string, surface: FirstSurface): string;
|
|
5
|
+
/** A person with the build right answers; Structure's Save commits the file as it does the rest. */
|
|
6
|
+
export declare function structureSurfaceRoute(root: string): UiRoute;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// "Which surface comes first?": the person's answer, kept in `plan/structure.md`'s header line
|
|
2
|
+
// (`Surface: desktop` or `Surface: phone`), written to the working copy; Structure's Save commits it.
|
|
3
|
+
import { randomUUID } from 'node:crypto';
|
|
4
|
+
import { existsSync } from 'node:fs';
|
|
5
|
+
import { readFile, rename, rm, writeFile } from 'node:fs/promises';
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
import { structureSurfaceBodySchema, workbenchApi, } from '@buffcore/contracts/workbench';
|
|
8
|
+
import { createI18n } from '@buffcore/i18n';
|
|
9
|
+
import { SURFACE_FIELD } from '../prototype/comp.js';
|
|
10
|
+
import { VersionRefusal } from '../prototype/versions.js';
|
|
11
|
+
import { personForTurn } from './chat/person.js';
|
|
12
|
+
import { hostT } from './host.js';
|
|
13
|
+
import { en } from './plan-structure.en.js';
|
|
14
|
+
import { es } from './plan-structure.es.js';
|
|
15
|
+
import { parseStructure } from './plan-structure.js';
|
|
16
|
+
import { savePathReason } from './save-paths.js';
|
|
17
|
+
import { withStudioSave } from './save-route.js';
|
|
18
|
+
const FILE = 'plan/structure.md';
|
|
19
|
+
const messages = createI18n({ catalogs: [{ en, es }] });
|
|
20
|
+
const surfaceT = (key) => messages.t(/^es(?:[-_.]|$)/i.test(process.env.LC_ALL || process.env.LANG || '') ? 'es' : 'en', key);
|
|
21
|
+
/** The structure's text with its surface line set: replaced where it is, else after the title. */
|
|
22
|
+
export function withSurface(source, surface) {
|
|
23
|
+
// A byte-order mark stays the file's first character.
|
|
24
|
+
const bom = source.startsWith('') ? '' : '';
|
|
25
|
+
const text = source.slice(bom.length);
|
|
26
|
+
const eol = text.includes('\r\n') ? '\r\n' : '\n';
|
|
27
|
+
const lines = text.split(/\r\n|\n/);
|
|
28
|
+
const line = `Surface: ${surface}`;
|
|
29
|
+
const table = lines.findIndex((entry) => entry.startsWith('|'));
|
|
30
|
+
const head = lines.slice(0, table === -1 ? lines.length : table);
|
|
31
|
+
const at = head.findIndex((entry) => SURFACE_FIELD.test(entry));
|
|
32
|
+
if (at !== -1)
|
|
33
|
+
lines[at] = line;
|
|
34
|
+
else {
|
|
35
|
+
const title = head.findIndex((entry) => entry.startsWith('# '));
|
|
36
|
+
if (title === -1)
|
|
37
|
+
lines.splice(0, 0, line, '');
|
|
38
|
+
else
|
|
39
|
+
lines.splice(title + 1, 0, '', line);
|
|
40
|
+
}
|
|
41
|
+
return bom + lines.join(eol);
|
|
42
|
+
}
|
|
43
|
+
async function writeSurface(root, surface) {
|
|
44
|
+
const file = join(root, FILE);
|
|
45
|
+
if (!existsSync(file))
|
|
46
|
+
return surfaceT('structure.surfaceMissing');
|
|
47
|
+
const reason = savePathReason(root, [FILE]);
|
|
48
|
+
if (reason)
|
|
49
|
+
return reason;
|
|
50
|
+
const next = withSurface(await readFile(file, 'utf8'), surface);
|
|
51
|
+
try {
|
|
52
|
+
parseStructure(next);
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
return error instanceof Error ? error.message : surfaceT('structure.surfaceFailed');
|
|
56
|
+
}
|
|
57
|
+
const temp = `${file}.${randomUUID()}.tmp`;
|
|
58
|
+
try {
|
|
59
|
+
await writeFile(temp, next, { flag: 'wx' });
|
|
60
|
+
await rename(temp, file);
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
await rm(temp, { force: true });
|
|
64
|
+
return surfaceT('structure.surfaceFailed');
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/** A person with the build right answers; Structure's Save commits the file as it does the rest. */
|
|
68
|
+
export function structureSurfaceRoute(root) {
|
|
69
|
+
return {
|
|
70
|
+
method: 'POST',
|
|
71
|
+
path: workbenchApi.structureSurface,
|
|
72
|
+
right: 'build',
|
|
73
|
+
handle: async (request) => {
|
|
74
|
+
if (!personForTurn(request))
|
|
75
|
+
return { status: 403, body: { error: hostT('ui.host.private') } };
|
|
76
|
+
const body = structureSurfaceBodySchema.safeParse(await request.body());
|
|
77
|
+
if (!body.success)
|
|
78
|
+
return { status: 400, body: { error: surfaceT('structure.surfaceFailed') } };
|
|
79
|
+
try {
|
|
80
|
+
const answer = await withStudioSave(root, () => writeSurface(root, body.data.surface));
|
|
81
|
+
if (typeof answer === 'object')
|
|
82
|
+
return { status: 409, body: { error: answer.detail } };
|
|
83
|
+
if (answer)
|
|
84
|
+
return { status: 409, body: { error: answer } };
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
if (error instanceof VersionRefusal)
|
|
88
|
+
return { status: 409, body: { error: error.message } };
|
|
89
|
+
return { status: 500, body: { error: surfaceT('structure.surfaceFailed') } };
|
|
90
|
+
}
|
|
91
|
+
return { status: 202, body: { surface: body.data.surface } };
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
}
|
|
@@ -12,9 +12,11 @@ import { mergeRoutes } from './merge-route.js';
|
|
|
12
12
|
import { mergeStudio } from './merge-state.js';
|
|
13
13
|
import { outsideState } from './outside.js';
|
|
14
14
|
import { outsideRoute } from './outside-route.js';
|
|
15
|
+
import { prototypeCompRoutes } from './prototype-comp-route.js';
|
|
15
16
|
import { planPrototypeOnMain } from './prototype-main.js';
|
|
16
17
|
import { prototypeScenesRoute } from './prototype-scenes-route.js';
|
|
17
18
|
import { saveRoute } from './save-route.js';
|
|
19
|
+
import { structureSurfaceRoute } from './structure-surface.js';
|
|
18
20
|
import { Latest } from './studio-facts.js';
|
|
19
21
|
export const studioAccess = {
|
|
20
22
|
viewer: true,
|
|
@@ -36,6 +38,7 @@ export const studioAccess = {
|
|
|
36
38
|
appIcon: 'read:runs',
|
|
37
39
|
committedLevel: 'read:agents',
|
|
38
40
|
effectiveLevel: 'read:agents',
|
|
41
|
+
neverAsk: 'read:agents',
|
|
39
42
|
level: true,
|
|
40
43
|
levelCommit: 'read:agents',
|
|
41
44
|
stale: 'read:runs',
|
|
@@ -82,6 +85,8 @@ cached = false) {
|
|
|
82
85
|
agentsRoute(root),
|
|
83
86
|
agentCheckRoute(root),
|
|
84
87
|
prototypeScenesRoute(root),
|
|
88
|
+
...prototypeCompRoutes(root),
|
|
89
|
+
structureSurfaceRoute(root),
|
|
85
90
|
outsideRoute,
|
|
86
91
|
{
|
|
87
92
|
method: 'GET',
|
|
@@ -34,6 +34,8 @@ export declare function studioState(root: string, options: Pick<UiServerOptions,
|
|
|
34
34
|
model?: Partial<Record<"coding" | "design" | "fixes" | "planning" | "tests" | "validation", string>> | undefined;
|
|
35
35
|
effort?: Partial<Record<"coding" | "design" | "fixes" | "planning" | "tests" | "validation", "auto" | "high" | "low" | "max" | "medium" | "xhigh">> | undefined;
|
|
36
36
|
level: "auto" | "guide" | "lead" | "review";
|
|
37
|
+
neverAsk?: boolean | undefined;
|
|
38
|
+
review?: boolean | undefined;
|
|
37
39
|
} | null;
|
|
38
40
|
found: {
|
|
39
41
|
id: "antigravity" | "claude" | "codex" | "cursor" | "grok" | "muse" | "opencode";
|
|
@@ -88,7 +90,7 @@ export declare function studioState(root: string, options: Pick<UiServerOptions,
|
|
|
88
90
|
approved?: {
|
|
89
91
|
version: number;
|
|
90
92
|
approval: {
|
|
91
|
-
kind: "brand" | "money" | "places" | "plan" | "prototype" | "release";
|
|
93
|
+
kind: "brand" | "comp" | "money" | "places" | "plan" | "prototype" | "release";
|
|
92
94
|
signatures: {
|
|
93
95
|
by: string;
|
|
94
96
|
at: string;
|
|
@@ -113,7 +115,7 @@ export declare function studioState(root: string, options: Pick<UiServerOptions,
|
|
|
113
115
|
pending?: {
|
|
114
116
|
version: number;
|
|
115
117
|
approval: {
|
|
116
|
-
kind: "brand" | "money" | "places" | "plan" | "prototype" | "release";
|
|
118
|
+
kind: "brand" | "comp" | "money" | "places" | "plan" | "prototype" | "release";
|
|
117
119
|
signatures: {
|
|
118
120
|
by: string;
|
|
119
121
|
at: string;
|
|
@@ -138,7 +140,7 @@ export declare function studioState(root: string, options: Pick<UiServerOptions,
|
|
|
138
140
|
superseded?: {
|
|
139
141
|
version: number;
|
|
140
142
|
approval: {
|
|
141
|
-
kind: "brand" | "money" | "places" | "plan" | "prototype" | "release";
|
|
143
|
+
kind: "brand" | "comp" | "money" | "places" | "plan" | "prototype" | "release";
|
|
142
144
|
signatures: {
|
|
143
145
|
by: string;
|
|
144
146
|
at: string;
|
|
@@ -231,14 +233,16 @@ export declare function studioState(root: string, options: Pick<UiServerOptions,
|
|
|
231
233
|
who: string;
|
|
232
234
|
place: string;
|
|
233
235
|
main: boolean;
|
|
236
|
+
planned?: string | undefined;
|
|
234
237
|
}[];
|
|
235
238
|
notes: string[];
|
|
239
|
+
surface?: "desktop" | "phone" | undefined;
|
|
236
240
|
problem?: string | undefined;
|
|
237
241
|
} | null | undefined;
|
|
238
242
|
themeDirection?: string | undefined;
|
|
239
243
|
themeVoice?: string | undefined;
|
|
240
244
|
brand: {
|
|
241
|
-
kind: "brand" | "money" | "places" | "plan" | "prototype" | "release";
|
|
245
|
+
kind: "brand" | "comp" | "money" | "places" | "plan" | "prototype" | "release";
|
|
242
246
|
signatures: {
|
|
243
247
|
by: string;
|
|
244
248
|
at: string;
|
|
@@ -340,6 +344,7 @@ export declare function studioState(root: string, options: Pick<UiServerOptions,
|
|
|
340
344
|
} | undefined;
|
|
341
345
|
committedLevel?: "auto" | "guide" | "lead" | "review" | undefined;
|
|
342
346
|
effectiveLevel?: "auto" | "guide" | "lead" | "review" | undefined;
|
|
347
|
+
neverAsk?: boolean | undefined;
|
|
343
348
|
level?: {
|
|
344
349
|
source: "host";
|
|
345
350
|
where: string;
|
|
@@ -153,6 +153,7 @@ export function studioState(root, options, detect = findAgents, held = () => fal
|
|
|
153
153
|
? {
|
|
154
154
|
committedLevel: levels.committed,
|
|
155
155
|
effectiveLevel: levels.effective,
|
|
156
|
+
...(levels.neverAsk ? { neverAsk: true } : {}),
|
|
156
157
|
...(levels.commit ? { levelCommit: levels.commit } : {}),
|
|
157
158
|
}
|
|
158
159
|
: {}),
|
|
@@ -14,7 +14,7 @@ export declare function authorityVersion(root: string, change: string): {
|
|
|
14
14
|
approved?: {
|
|
15
15
|
version: number;
|
|
16
16
|
approval: {
|
|
17
|
-
kind: "brand" | "money" | "places" | "plan" | "prototype" | "release";
|
|
17
|
+
kind: "brand" | "comp" | "money" | "places" | "plan" | "prototype" | "release";
|
|
18
18
|
signatures: {
|
|
19
19
|
by: string;
|
|
20
20
|
at: string;
|
|
@@ -39,7 +39,7 @@ export declare function authorityVersion(root: string, change: string): {
|
|
|
39
39
|
pending?: {
|
|
40
40
|
version: number;
|
|
41
41
|
approval: {
|
|
42
|
-
kind: "brand" | "money" | "places" | "plan" | "prototype" | "release";
|
|
42
|
+
kind: "brand" | "comp" | "money" | "places" | "plan" | "prototype" | "release";
|
|
43
43
|
signatures: {
|
|
44
44
|
by: string;
|
|
45
45
|
at: string;
|
|
@@ -64,7 +64,7 @@ export declare function authorityVersion(root: string, change: string): {
|
|
|
64
64
|
superseded?: {
|
|
65
65
|
version: number;
|
|
66
66
|
approval: {
|
|
67
|
-
kind: "brand" | "money" | "places" | "plan" | "prototype" | "release";
|
|
67
|
+
kind: "brand" | "comp" | "money" | "places" | "plan" | "prototype" | "release";
|
|
68
68
|
signatures: {
|
|
69
69
|
by: string;
|
|
70
70
|
at: string;
|