@vivix-labs/studio-workbench 0.0.0-stage → 1.0.0-beta.10

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.
Files changed (123) hide show
  1. package/dist/Inter-LICENSE.txt +93 -0
  2. package/dist/UI-LICENSE.txt +21 -0
  3. package/dist/assets/35a50-G5EJUNOC.svg +6 -0
  4. package/dist/assets/369ca-BISNKZ3M.svg +6 -0
  5. package/dist/assets/441bc-BCMNQ72W.svg +6 -0
  6. package/dist/assets/483f0-T6ZAGTDG.svg +6 -0
  7. package/dist/assets/6911b-ESLYKSC6.svg +6 -0
  8. package/dist/assets/Inter-LICENSE.txt +93 -0
  9. package/dist/assets/UI-system-LICENSE.txt +21 -0
  10. package/dist/assets/add-JY533O73.svg +5 -0
  11. package/dist/assets/area-P2WOMBT5.svg +9 -0
  12. package/dist/assets/b70bb-BTTOKPOH.svg +6 -0
  13. package/dist/assets/b9919-3S3O6YOT.svg +6 -0
  14. package/dist/assets/calendar-JI6USFRJ.svg +1 -0
  15. package/dist/assets/check-JSRRIXN5.svg +5 -0
  16. package/dist/assets/check-on-content-FQUVG3IZ.svg +5 -0
  17. package/dist/assets/chevron-down-K7YKS2EY.svg +5 -0
  18. package/dist/assets/chevron-left-JQCLK2WZ.svg +3 -0
  19. package/dist/assets/chevron-right-TNE35DBJ.svg +3 -0
  20. package/dist/assets/chevron-up-VBHYAJVB.svg +5 -0
  21. package/dist/assets/clear-XNEZJKFC.svg +5 -0
  22. package/dist/assets/close-GO5F7YFS.svg +10 -0
  23. package/dist/assets/copy-document-EF4PHM7F.svg +10 -0
  24. package/dist/assets/create-custom-view-WUWJL7YC.svg +5 -0
  25. package/dist/assets/crop-5JXWHIPN.svg +6 -0
  26. package/dist/assets/dashboard-overview-Y32BCZQC.svg +8 -0
  27. package/dist/assets/dashboard-views-GOG66UAH.svg +7 -0
  28. package/dist/assets/dccd4-CZJXWICW.svg +6 -0
  29. package/dist/assets/dd163-3S3O6YOT.svg +6 -0
  30. package/dist/assets/delete-4Y3OUMEL.svg +8 -0
  31. package/dist/assets/detail-E52XPONK.svg +4 -0
  32. package/dist/assets/download-VTKCEAZG.svg +6 -0
  33. package/dist/assets/draw-FOFX5TOM.svg +6 -0
  34. package/dist/assets/e8aed-CZJXWICW.svg +6 -0
  35. package/dist/assets/ea990-CZJXWICW.svg +6 -0
  36. package/dist/assets/edit-JUVJDD5A.svg +6 -0
  37. package/dist/assets/expand-IAV75AFA.svg +6 -0
  38. package/dist/assets/export-W2OBXZDQ.svg +6 -0
  39. package/dist/assets/favorite-6GMNHJCN.svg +5 -0
  40. package/dist/assets/filter-JSDZZVGN.svg +5 -0
  41. package/dist/assets/fullscreen-L2JCXIN2.svg +6 -0
  42. package/dist/assets/fullscreen-large-MPLIWDMI.svg +6 -0
  43. package/dist/assets/grid-TLG5JYWB.svg +8 -0
  44. package/dist/assets/hero-base-5KRPU5WN.png +0 -0
  45. package/dist/assets/hero-blossom-YNVLGEJJ.webp +0 -0
  46. package/dist/assets/hero-blossom-sequence-TZ74A6VV.webp +0 -0
  47. package/dist/assets/hero-breeze-sequence-CEWDK3QZ.webp +0 -0
  48. package/dist/assets/hero-landscape-H35LYO4H.png +0 -0
  49. package/dist/assets/hero-placeholder-strip-WAPZ6XF4.svg +28 -0
  50. package/dist/assets/hero-pointer-OOZJGR5D.svg +17 -0
  51. package/dist/assets/hero-shot-CNLBX3OX.png +0 -0
  52. package/dist/assets/import-AFBUV2VV.svg +4 -0
  53. package/dist/assets/inria-serif-latin-400-italic-ZCFRMMVP.woff2 +0 -0
  54. package/dist/assets/inria-serif-latin-700-italic-UNRIXGAH.woff2 +0 -0
  55. package/dist/assets/inter-latin-400-normal-55WT6UWF.woff2 +0 -0
  56. package/dist/assets/inter-latin-500-normal-W62DVTXI.woff2 +0 -0
  57. package/dist/assets/inter-latin-600-normal-R6Y2SZCR.woff2 +0 -0
  58. package/dist/assets/inter-latin-700-normal-SU5XVJMF.woff2 +0 -0
  59. package/dist/assets/inter-latin-900-normal-FKACR3DR.woff2 +0 -0
  60. package/dist/assets/list-5VUAOZUH.svg +9 -0
  61. package/dist/assets/local-user-MIBWBA6X.png +0 -0
  62. package/dist/assets/magic-OMME7FOV.svg +9 -0
  63. package/dist/assets/more-AEJ5MHWV.svg +5 -0
  64. package/dist/assets/mute-SXOSCR2U.svg +6 -0
  65. package/dist/assets/mute-large-LSZZ44HF.svg +6 -0
  66. package/dist/assets/nav-assets-35EAQZQX.svg +7 -0
  67. package/dist/assets/nav-home-BMDOUQGN.svg +5 -0
  68. package/dist/assets/nav-projects-N5UV3GAG.svg +6 -0
  69. package/dist/assets/nav-queue-2I5E65F4.svg +8 -0
  70. package/dist/assets/pause-2E4UY4FW.svg +6 -0
  71. package/dist/assets/pause-large-XEUBL4KC.svg +6 -0
  72. package/dist/assets/placeholder-audio-EJEBE7OB.svg +11 -0
  73. package/dist/assets/placeholder-image-NOVXFVRL.svg +10 -0
  74. package/dist/assets/placeholder-script-LR2GKWKS.svg +7 -0
  75. package/dist/assets/placeholder-video-ZFOYHYCR.svg +7 -0
  76. package/dist/assets/play-WIIT3XQK.svg +5 -0
  77. package/dist/assets/play-cover-WQLOHHPZ.svg +5 -0
  78. package/dist/assets/playback-play-YRMIX5W4.svg +5 -0
  79. package/dist/assets/playback-play-large-TM3QUJGG.svg +5 -0
  80. package/dist/assets/refresh-WQ3CTB57.svg +3 -0
  81. package/dist/assets/reset-JESMTEMV.svg +6 -0
  82. package/dist/assets/search-JUOSGQRM.svg +6 -0
  83. package/dist/assets/select-VU7WR7B4.svg +7 -0
  84. package/dist/assets/select-items-GJZIVO37.svg +6 -0
  85. package/dist/assets/social-preview-F36PFR67.svg +91 -0
  86. package/dist/assets/sound-file-YYY6VNYN.svg +3 -0
  87. package/dist/assets/template-1-NR5GMMN5.png +0 -0
  88. package/dist/assets/template-2-YUHY6VN5.png +0 -0
  89. package/dist/assets/template-3-JHX6FHCZ.png +0 -0
  90. package/dist/assets/template-4-TAVSM3BI.png +0 -0
  91. package/dist/assets/template-5-ESABL4EM.png +0 -0
  92. package/dist/assets/template-6-4FAHO5N4.png +0 -0
  93. package/dist/assets/template-7-2KRMROJ6.png +0 -0
  94. package/dist/assets/trim-LQMHHN2M.svg +9 -0
  95. package/dist/assets/upload-U5RZT5QI.svg +5 -0
  96. package/dist/assets/volume-2TYGJL6F.svg +6 -0
  97. package/dist/assets/volume-large-QNULSJ2I.svg +6 -0
  98. package/dist/assets/welcome-add-HS6LIH63.svg +5 -0
  99. package/dist/assets/welcome-close-NOBXBZOT.svg +5 -0
  100. package/dist/assets/welcome-product-ad-YRPDJRAH.png +0 -0
  101. package/dist/assets/welcome-short-drama-YDTZHBGK.png +0 -0
  102. package/dist/client.bundle.js +6989 -0
  103. package/dist/client.css +5229 -0
  104. package/dist/client.d.ts +15 -0
  105. package/dist/client.js +3 -0
  106. package/dist/server.d.ts +10 -0
  107. package/dist/server.js +664 -0
  108. package/dist/shared.d.ts +82 -0
  109. package/dist/shared.js +79 -0
  110. package/home-media/product-ad.mp4 +0 -0
  111. package/home-media/short-drama.mp4 +0 -0
  112. package/home-media/tree-shadow-blossom.mp4 +0 -0
  113. package/home-media/tree-shadow-breeze.mp4 +0 -0
  114. package/licenses/Inria-Serif-OFL.txt +93 -0
  115. package/package.json +78 -4
  116. package/presets/table.json +67 -0
  117. package/presets/user-base.json +130 -0
  118. package/skills/SKILL.md +110 -0
  119. package/skills/references/assets-and-views.md +30 -0
  120. package/skills/references/sql-custom-views.md +10 -0
  121. package/skills/scripts/initialize-home.mjs +281 -0
  122. package/studio-plugin.json +31 -0
  123. package/README.md +0 -3
@@ -0,0 +1,30 @@
1
+ # Project assets and installed views
2
+
3
+ Use the installed `vivix-studio` executable and its public `--help` commands. When several installations are present, verify `--version` before working.
4
+
5
+ The workspace and project catalog use the installed dev CLI's configuration root. Read `project --help`, `plugin --help` and `preset --help` for the public commands; there is no second workspace runtime or automatic migration of old candidate data. Keep credentials in the Host.
6
+
7
+ 1. Discover instances and operations with `plugin list --scope user --json` and `plugin describe <instance> --scope user --json`.
8
+ 2. Create or register projects through the CLI project commands. Apply the independently distributed `user-base` and `table` presets to their own scopes; explicitly grant required access. Browser pages use the Host catalog and embedded real project workbenches.
9
+ 3. Use `--project <projectId>` for project operations. Browser file upload streams to the configured data instance's `stage` HTTP route, then passes its opaque staging ID to `assets.import`, `assets.importVersion`, `library.import` or `library.importVersion` through ordinary operations. Do not pass arbitrary Host file paths as staging IDs.
10
+ 4. Create text through `assets.createText`; content edits use `assets.saveText` with a fixed parentVersionId. Names and tags use `assets.update` or `library.update`, `expectedRevision` and a stable request key. Tags are `data.tags` arrays, never filenames or metadata. List `tag` is an exact member match.
11
+ 5. Discover the actual model catalog through api capabilities.list/get. Do not invent roles or parameters, silently drop unsupported input, change models or treat a video as an image. Fixed references must be readable VersionRefs in the target project; copy library materials first.
12
+ 6. `generation.submit` explicitly declares `confirm: 'none'` with paid effects and requires the paired API 0.2.2 Host. Image, video, and audio generation submits without local browser approval, including separate shots, changed parameters, and new requests after known failures. Keep estimates, cost records, and the original input and key for each request. Other paid and destructive operations retain their required approvals. Unknown submissions may be charged: use tasks.queryOriginal to recover them. tasks.retryDownload saves original results and never regenerates. A new generation uses a new request key and retryOfTaskId; an unknown original also requires acknowledgeUnknown after reconciliation.
13
+ 7. `files.resolveLocation` returns the absolute path of a specific version and a local preview URL. Existing tools can process a copy; import the result through ordinary business operations. Preserve immutable files and identify externally processed results as imported content.
14
+ 8. For concurrent edits, use the revision you actually read. A conflict retains the input; inspect the current revision and ask which changes should survive. Do not transparently retry against a newer revision.
15
+ 9. Structured records are the source of truth. Use the installed public business operations for scoped reads and writes. When the installed coordinator exposes `global.query` and the workbench exposes `views.*`, read [SQL Custom Views](sql-custom-views.md). Their absence means this package does not supply that workflow; do not add a second runtime or open the live database to bypass the public binding.
16
+ 10. Workspace backups use storage.backup, never a raw copy of an active SQLite file. Restore validates a separate set and requires a stopped-host maintenance switch. Keep the current set until validation succeeds. No credentials belong in backups.
17
+
18
+ `library.usage` accepts materialId, optional versionId, limit (1–200, default50)
19
+ and offset (default0). Its response is `{items,nextOffset}`; continue until
20
+ nextOffset is null. Usage rows identify the material version and target project,
21
+ asset and version. Usage count is distinct active target assets, not relation rows.
22
+ Use each actual scope's describe output to discover configured instance IDs;
23
+ custom projects need not use the default studio/api IDs or enable the library.
24
+
25
+ For image.edit only, when the raw model is image, explicitly sets
26
+ requires_explicit_source_roles=false and has source_roles=[], the installed
27
+ workbench derives a local implicit-image descriptor (one required fixed image,
28
+ no weight). This is a local mapping, not a Provider-declared role; upload sends
29
+ the real image as source_assets without a remote role. image.generate needs no
30
+ reference. Explicit roles keep their declared validation.
@@ -0,0 +1,10 @@
1
+ # SQL Custom Views — capability-dependent reference
2
+
3
+ Use this reference only when the installed `plugin describe` output exposes the named SQL, view, favorite and export operations. The ecommerce baseline may not supply them; this document does not install those implementations.
4
+
5
+ 9. Use the coordinator's `global.query` operation for the full `studio_projects`, `studio_assets`, `studio_asset_versions` and `studio_tasks` SQL sources. Queries are read-only and scoped by the data binding; keep filters and ordering in SQL before pagination. Do not open or attach the live database from a browser or bypass the public binding. Project assets keep their original identity; no library copy is required.
6
+ 10. Discover the workbench's `views.list` and `views.save` operations. Persist SQL, scalar params, column configuration and identity mapping in user data. A column `path` is the exact projected result name, including aliases and dots. `format: categories` applies only to the multivalue metadata projection selected by the Agent; do not hardcode a business classification key or mark every string array as a category. Purpose may be hidden. Aggregate projections without business identity are display-only. Use the saved view's revision for edits.
7
+ 11. Favorites are independent persisted records pinned to the selected VersionRef. The default asset projection shows the latest saved version. Query `studio_asset_versions WHERE favorite = 1` to retain older favorited versions after a new version is saved. Download uses the selected fixed references through `exports.prepare` and the Plugin's native POST attachment stream; never buffer the full archive into a browser Blob.
8
+ 12. Import only text, image, video and audio through a real project's existing import operation. Generic files are rejected. Global Asset aggregates project assets and does not create unowned personal assets. Generation Queue displays persisted task names; recovery operations remain available to agents but are hidden from the redesigned UI.
9
+
10
+ For mounting user-scope components in Studio Home (`config.dashboard` and `config.savedViews`), follow [SKILL.md](../SKILL.md#set-up-studio-home). Custom UI plugins register components with `component` (receiving `CardProps` from `@vivix-labs/studio-workbench/shared`, see `dist/shared.d.ts`) and can pass `CardProps.projects` (or `await client.projects.list()`) as `catalog` when calling `global.query` once `ready` is `true` (paginating via `nextOffset`).
@@ -0,0 +1,281 @@
1
+ import { execFile, spawn } from 'node:child_process';
2
+ import { mkdir, readFile, rename, rm, writeFile } from 'node:fs/promises';
3
+ import { homedir } from 'node:os';
4
+ import { basename, dirname, join, resolve } from 'node:path';
5
+ import { parseArgs, promisify } from 'node:util';
6
+
7
+ const exec = promisify(execFile);
8
+ const { values } = parseArgs({
9
+ options: {
10
+ help: { type: 'boolean' },
11
+ 'no-open': { type: 'boolean' },
12
+ sample: { type: 'string' },
13
+ },
14
+ });
15
+ if (values.help) {
16
+ console.log(
17
+ 'Usage: node initialize-home.mjs [--no-open] [--sample out-of-steps|cobalt-headphones]\nUse VIVIX_STUDIO_CLI to select a CLI executable or built JS entry.',
18
+ );
19
+ process.exit(0);
20
+ }
21
+ const executable = process.env.VIVIX_STUDIO_CLI || 'vivix-studio';
22
+ const js = /\.[cm]?js$/.test(executable);
23
+ const command = js ? process.execPath : executable;
24
+ const prefix = js ? [resolve(executable)] : [];
25
+ const root = process.env.XDG_CONFIG_HOME
26
+ ? join(process.env.XDG_CONFIG_HOME, 'vivix-studio')
27
+ : join(homedir(), '.vivix-studio');
28
+ const userPackage = JSON.parse(
29
+ await readFile(new URL('../../package.json', import.meta.url), 'utf8'),
30
+ );
31
+ const userPreset = `${userPackage.name}@${userPackage.version}:user-base`;
32
+ const samples = {
33
+ 'out-of-steps': { package: '@vivix-labs/short-drama-workbench', presetId: 'short-drama' },
34
+ 'cobalt-headphones': { package: '@vivix-labs/ads-workbench', presetId: 'ads' },
35
+ };
36
+ const sample = values.sample;
37
+ if (sample !== undefined && !Object.hasOwn(samples, sample)) throw Error('Unknown sample.');
38
+ const access =
39
+ 'project.content.read,project.content.write,official.request,events.publish,events.subscribe';
40
+ const homeState = join(root, 'home-initialization.json');
41
+ const lock = homeState + '.lock';
42
+ const read = async (path) => JSON.parse(await readFile(path, 'utf8'));
43
+ const state = { projects: {} };
44
+ const save = async () => {
45
+ await writeFile(homeState + '.tmp', JSON.stringify(state, null, 2) + '\n', { mode: 0o600 });
46
+ await rename(homeState + '.tmp', homeState);
47
+ };
48
+
49
+ async function cli(...arguments_) {
50
+ let stdout;
51
+ try {
52
+ ({ stdout } = await exec(command, [...prefix, ...arguments_, '--json'], {
53
+ maxBuffer: 8 * 1024 * 1024,
54
+ }));
55
+ } catch (error) {
56
+ if (!error.stdout) throw error;
57
+ stdout = error.stdout;
58
+ }
59
+ const result = JSON.parse(stdout);
60
+ if (!result.ok) throw Error(result.error?.message ?? 'Studio CLI command failed.');
61
+ return result.data;
62
+ }
63
+ let child;
64
+ let stopped = false;
65
+ function interrupt(signal) {
66
+ stopped = true;
67
+ child?.kill(signal);
68
+ }
69
+ function runSeed(path, project) {
70
+ return new Promise((done, reject) => {
71
+ child = spawn(process.execPath, [path, '--project', project, '--apply'], {
72
+ stdio: ['ignore', 'ignore', 'pipe'],
73
+ });
74
+ let failure = '';
75
+ child.stderr.setEncoding('utf8').on('data', (chunk) => {
76
+ failure = (failure + chunk).slice(-4096);
77
+ });
78
+ child.on('error', reject);
79
+ child.on('close', (code) => {
80
+ child = undefined;
81
+ if (code === 0) done();
82
+ else
83
+ reject(Error(failure.trim() || 'Example import stopped. Rerun initialization to resume.'));
84
+ });
85
+ });
86
+ }
87
+ function assertRunning() {
88
+ if (stopped) throw Error('Initialization stopped. Rerun it to resume.');
89
+ }
90
+
91
+ async function warmDramaWorkbenches() {
92
+ const { stdout } = await exec(command, [...prefix, 'preset', '--help']);
93
+ if (!stdout.includes('warm-client')) return;
94
+ const name = samples['out-of-steps'].package;
95
+ const version = userPackage.vivixStudio.runtimePlugins[name];
96
+ for (const id of ['out-of-steps', 'short-drama'])
97
+ await cli('preset', 'warm-client', `${name}@${version}:${id}`);
98
+ }
99
+
100
+ async function configureDramaChat(projectId) {
101
+ // Trial setup can enable chat before the on-demand drama project exists.
102
+ const user = await cli('plugin', 'list', '--scope', 'user');
103
+ const chat = user.instances.find(
104
+ (item) =>
105
+ item.id === 'chat-components' &&
106
+ item.package === '@vivix-labs/chat-components' &&
107
+ item.state === 'ready',
108
+ );
109
+ if (!chat) return;
110
+ const project = await cli('plugin', 'list', '--project', projectId);
111
+ if (project.instances.some((item) => item.id === chat.id)) return;
112
+ const config = join(lock, 'chat-components.json');
113
+ await writeFile(
114
+ config,
115
+ JSON.stringify({
116
+ targets: { character: { instanceId: 'authoring', operationId: 'characters.receiveCard' } },
117
+ }),
118
+ { mode: 0o600 },
119
+ );
120
+ await cli(
121
+ 'plugin',
122
+ 'enable',
123
+ chat.package,
124
+ '--version',
125
+ chat.version,
126
+ '--project',
127
+ projectId,
128
+ '--instance',
129
+ chat.id,
130
+ '--config',
131
+ config,
132
+ '--trust',
133
+ );
134
+ }
135
+
136
+ await mkdir(dirname(homeState), { recursive: true, mode: 0o700 });
137
+ try {
138
+ await mkdir(lock, { mode: 0o700 });
139
+ } catch (error) {
140
+ if (error.code === 'EEXIST')
141
+ throw Error(
142
+ `Home initialization is locked. If no initializer is running, remove ${lock} and rerun.`,
143
+ );
144
+ throw error;
145
+ }
146
+ const sigint = () => interrupt('SIGINT');
147
+ const sigterm = () => interrupt('SIGTERM');
148
+ process.on('SIGINT', sigint);
149
+ process.on('SIGTERM', sigterm);
150
+ try {
151
+ try {
152
+ Object.assign(state, await read(homeState));
153
+ } catch (error) {
154
+ if (error.code !== 'ENOENT') throw error;
155
+ }
156
+ if (!state.workspace) {
157
+ const user = await cli('plugin', 'list', '--scope', 'user');
158
+ if (user.instances.length) {
159
+ const installed = user.instances.find((item) => item.id === 'workbench');
160
+ if (installed?.package !== userPackage.name || installed.version !== userPackage.version)
161
+ throw Error(
162
+ 'This profile already has a different user workbench. Use a fresh profile for first setup.',
163
+ );
164
+ } else {
165
+ await cli(
166
+ 'preset',
167
+ 'apply',
168
+ userPreset,
169
+ '--scope',
170
+ 'user',
171
+ '--trust',
172
+ '--allow-access',
173
+ access,
174
+ );
175
+ }
176
+ state.workspace = true;
177
+ await save();
178
+ }
179
+ if (sample) {
180
+ assertRunning();
181
+ const directory = join(root, 'projects', 'studio-home-examples', sample);
182
+ const { projects } = await cli('project', 'list');
183
+ let receipt = state.projects[sample];
184
+ if (!receipt && sample === 'out-of-steps') {
185
+ // Match the browser creation receipt, so CLI and Welcome share the prepared project.
186
+ const requestId = '66067767-ff7a-4c73-9cd2-debde07b6ea2';
187
+ for (const project of projects) {
188
+ if (!project.available || basename(project.root) !== `project-${requestId}`) continue;
189
+ const created = await read(join(project.root, '.vivix/workbench-create.json')).catch(
190
+ (error) => {
191
+ if (error.code !== 'ENOENT') throw error;
192
+ return undefined;
193
+ },
194
+ );
195
+ if (created?.requestId !== requestId || !created.preset.endsWith(':out-of-steps')) continue;
196
+ await read(join(project.root, '.vivix/out-of-steps.initialized.json'));
197
+ receipt = state.projects[sample] = {
198
+ directory: project.root,
199
+ preset: created.preset,
200
+ projectId: project.id,
201
+ complete: true,
202
+ };
203
+ await save();
204
+ }
205
+ }
206
+ if (!receipt?.complete) {
207
+ const spec = samples[sample];
208
+ const samplePreset = `${spec.package}@${userPackage.vivixStudio.runtimePlugins[spec.package]}:${spec.presetId}`;
209
+ const { presets } = await cli('preset', 'list');
210
+ const preparedPreset = samplePreset.replace(/:short-drama$/, ':out-of-steps');
211
+ const hasPrepared =
212
+ sample === 'out-of-steps' &&
213
+ presets.some(
214
+ (item) => `${item.package}@${item.version}:${item.presetId}` === preparedPreset,
215
+ );
216
+ const preset = receipt?.preset ?? (hasPrepared ? preparedPreset : samplePreset);
217
+ const installed = presets.find(
218
+ (item) => `${item.package}@${item.version}:${item.presetId}` === samplePreset,
219
+ );
220
+ if (!installed) throw Error('Install the matching workbench plugin to load this sample.');
221
+ if (!receipt) {
222
+ if (projects.some((item) => item.root === directory))
223
+ throw Error('The example directory is already registered: ' + directory);
224
+ receipt = state.projects[sample] = { directory, preset };
225
+ await save();
226
+ }
227
+ if (!receipt.projectId) {
228
+ const registered = projects.find(
229
+ (item) => item.root === receipt.directory && item.available,
230
+ );
231
+ const project =
232
+ registered ??
233
+ (await cli(
234
+ 'project',
235
+ 'init',
236
+ sample,
237
+ '--directory',
238
+ receipt.directory,
239
+ '--preset',
240
+ receipt.preset,
241
+ '--trust',
242
+ '--allow-access',
243
+ access,
244
+ ));
245
+ receipt.projectId = project.id;
246
+ await save();
247
+ }
248
+ assertRunning();
249
+ if (receipt.preset.endsWith(':out-of-steps')) {
250
+ await read(join(receipt.directory, '.vivix/out-of-steps.initialized.json'));
251
+ } else {
252
+ await runSeed(
253
+ join(installed.packageRoot, 'samples', sample, 'scripts/initialize.mjs'),
254
+ receipt.projectId,
255
+ );
256
+ if (sample === 'out-of-steps') await configureDramaChat(receipt.projectId);
257
+ }
258
+ receipt.complete = true;
259
+ await save();
260
+ }
261
+ const project = (await cli('project', 'list')).projects.find(
262
+ (item) => item.id === receipt.projectId && item.available,
263
+ );
264
+ if (!project) throw Error('The sample project is unavailable: ' + receipt.projectId);
265
+ console.log(JSON.stringify({ ok: true, project }));
266
+ } else if (values['no-open']) {
267
+ await warmDramaWorkbenches();
268
+ const { workbenchUrl } = await cli('project', 'open', '--scope', 'user', '--no-open');
269
+ console.log(JSON.stringify({ ok: true, projects: state.projects, workbenchUrl }));
270
+ } else {
271
+ await warmDramaWorkbenches();
272
+ await exec(command, [...prefix, 'project', 'open', '--scope', 'user']);
273
+ }
274
+ } catch (error) {
275
+ console.error(error.message);
276
+ process.exitCode = 1;
277
+ } finally {
278
+ process.off('SIGINT', sigint);
279
+ process.off('SIGTERM', sigterm);
280
+ await rm(lock, { recursive: true, force: true });
281
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "manifestVersion": "0.2",
3
+ "id": "studio-workbench",
4
+ "requirements": {
5
+ "studioPluginApi": "^0.2.2"
6
+ },
7
+ "requestedAccess": ["events.subscribe"],
8
+ "resources": {
9
+ "skills": ["skills/SKILL.md"],
10
+ "presets": ["presets/user-base.json", "presets/table.json"]
11
+ },
12
+ "projectNavigation": {
13
+ "table-workbench": {
14
+ "overview": "assets",
15
+ "tabs": [
16
+ {
17
+ "id": "create",
18
+ "label": "Generate"
19
+ },
20
+ {
21
+ "id": "tasks",
22
+ "label": "Generation Queue"
23
+ },
24
+ {
25
+ "id": "settings",
26
+ "label": "Project settings"
27
+ }
28
+ ]
29
+ }
30
+ }
31
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.