@hugpy/video-intelligence-ui 0.3.2 → 0.3.3
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/LICENSE +0 -0
- package/README.md +9 -0
- package/dist/assets/hugpy-mark-BXktFcOQ.png +0 -0
- package/dist/assets/index-DuT1AMLn.css +1 -0
- package/dist/assets/index-_13ZiBDP.js +4191 -0
- package/dist/index.html +71 -0
- package/entry.tsx +0 -0
- package/index.html +4 -4
- package/package.json +42 -4
- package/src/assets/hugpy-mark.png +0 -0
- package/src/config.ts +0 -0
- package/src/demo/DemoBanner.tsx +0 -0
- package/src/demo/demo.css +0 -0
- package/src/demo/demoFetch.ts +0 -0
- package/src/demo/fixtures.ts +0 -0
- package/src/demo/identityFixture.ts +0 -0
- package/src/demo/index.ts +0 -0
- package/src/demo/mediaBase.ts +0 -0
- package/src/demo/mode.ts +0 -0
- package/src/demo/promptAssist.ts +0 -0
- package/src/demo/sampleData.ts +0 -0
- package/src/demo/sampleSets.ts +0 -0
- package/src/demo/seed.ts +0 -0
- package/src/nav/BrandMark.css +0 -0
- package/src/nav/BrandMark.tsx +0 -0
- package/src/nav/Navbar.css +0 -0
- package/src/nav/Navbar.tsx +6 -1
- package/src/regions/SpatialRegionEditor.tsx +0 -0
- package/src/regions/TemporalRegionEditor.tsx +0 -0
- package/src/regions/types.ts +0 -0
- package/src/session.ts +0 -0
- package/src/share.ts +0 -0
- package/src/stations/ActivePanel.tsx +0 -0
- package/src/stations/ActiveProcessesStation.tsx +0 -0
- package/src/stations/AddFileBar.tsx +0 -0
- package/src/stations/AudioCropStation.tsx +0 -0
- package/src/stations/ComfyPanel.tsx +0 -0
- package/src/stations/ComfyStation.tsx +0 -0
- package/src/stations/CondensedKnobStrip.tsx +0 -0
- package/src/stations/ConsolePanel.tsx +0 -0
- package/src/stations/FrameExtractStation.tsx +0 -0
- package/src/stations/GenIdentityBar.tsx +0 -0
- package/src/stations/GenerateStation.tsx +2 -1
- package/src/stations/GoalComposer.tsx +0 -0
- package/src/stations/ImageCropStation.tsx +0 -0
- package/src/stations/KnobInfo.tsx +0 -0
- package/src/stations/PlaceholderStation.tsx +0 -0
- package/src/stations/ScriptFirstStation.tsx +4 -0
- package/src/stations/SectionTabs.tsx +0 -0
- package/src/stations/SharePanel.tsx +0 -0
- package/src/stations/SidebarRegistry.tsx +0 -0
- package/src/stations/StationShell.tsx +0 -0
- package/src/stations/StudioClipsStation.tsx +0 -0
- package/src/stations/TemplateStepsPanel.tsx +190 -0
- package/src/stations/ToksPanel.tsx +0 -0
- package/src/stations/WorkbenchDrawer.tsx +0 -0
- package/src/stations/WorkbenchSidebar.tsx +0 -0
- package/src/stations/WorkbenchStation.tsx +0 -0
- package/src/stations/comfyEmbed.ts +0 -0
- package/src/stations/drawerShell.tsx +0 -0
- package/src/stations/ops/AudioCropCore.tsx +0 -0
- package/src/stations/ops/CharacterGroupsPanel.tsx +0 -0
- package/src/stations/ops/FrameExtractCore.tsx +0 -0
- package/src/stations/ops/ImageCropCore.tsx +0 -0
- package/src/stations/ops/VideoCropCore.tsx +0 -0
- package/src/stations/ops/useVideoCropJobs.ts +0 -0
- package/src/stations/oracle/DagPanel.tsx +0 -0
- package/src/stations/oracle/OracleStation.tsx +2 -0
- package/src/stations/oracle/PerformanceComposer.tsx +119 -0
- package/src/stations/oracle/SpatialTab.tsx +0 -0
- package/src/stations/oracle/StewardPanel.tsx +0 -0
- package/src/stations/oracle/oracle.css +33 -0
- package/src/stations/oracle/oracleShared.tsx +0 -0
- package/src/stations/oracle/oracleTypes.ts +0 -0
- package/src/stations/oracle/useOracle.ts +0 -0
- package/src/stations/pollCaps.ts +0 -0
- package/src/stations/registry.ts +0 -0
- package/src/stations/scriptFirst.css +23 -0
- package/src/stations/studio/AngleRingEditor.tsx +0 -0
- package/src/stations/studio/IdentitiesStation.tsx +21 -2
- package/src/stations/studio/IdentityCreatePanel.tsx +0 -0
- package/src/stations/studio/IdentityProfileControls.tsx +0 -0
- package/src/stations/studio/StudioActiveProcesses.tsx +0 -0
- package/src/stations/studio/StudioAssistLogPanel.tsx +0 -0
- package/src/stations/studio/StudioGenerateMode.tsx +0 -0
- package/src/stations/studio/StudioGenerateTab.tsx +20 -2
- package/src/stations/studio/StudioItemCard.tsx +0 -0
- package/src/stations/studio/StudioLibraryTab.tsx +0 -0
- package/src/stations/studio/StudioMovieComposer.tsx +0 -0
- package/src/stations/studio/StudioMovieSessions.tsx +12 -19
- package/src/stations/studio/StudioPlane.tsx +25 -4
- package/src/stations/studio/StudioSplicedRow.tsx +0 -0
- package/src/stations/studio/StudioViewer.tsx +0 -0
- package/src/stations/studio/TurntableViewer.tsx +0 -0
- package/src/stations/studio/coordinationBadge.tsx +0 -0
- package/src/stations/studio/identityUpload.ts +0 -0
- package/src/stations/studio/movieTimeline.ts +0 -0
- package/src/stations/studio/promptCard.tsx +0 -0
- package/src/stations/studio/studioItem.ts +0 -0
- package/src/stations/studio/studioShared.tsx +0 -0
- package/src/stations/studio/useIdentityCreateJob.ts +0 -0
- package/src/stations/studio/useIdentityProfiles.ts +0 -0
- package/src/stations/studio/useReconstruction.ts +0 -0
- package/src/stations/types.ts +0 -0
- package/src/stations/useAudioCropJobs.ts +0 -0
- package/src/stations/useAudioExtractJob.ts +0 -0
- package/src/stations/useCropJobs.ts +0 -0
- package/src/stations/useFrameJobs.ts +0 -0
- package/src/stations/useGenerateJob.ts +0 -0
- package/src/stations/useGenerateMovieJob.ts +0 -0
- package/src/stations/useGenerateRowJobs.ts +0 -0
- package/src/stations/useGenerateSceneJob.ts +0 -0
- package/src/stations/useGenerateSceneRowJobs.ts +0 -0
- package/src/stations/useScriptFirstRun.ts +0 -0
- package/src/style/app.css +49 -0
- package/src/transport/client.ts +0 -0
- package/src/transport/telemetry.ts +0 -0
- package/src/video/DropReceptacle.tsx +0 -0
- package/src/video/LengthRow.tsx +0 -0
- package/src/video/LibraryGroups.tsx +0 -0
- package/src/video/PromptAssistButtons.tsx +6 -4
- package/src/video/UnnamedWarn.tsx +0 -0
- package/src/video/composerBridge.ts +0 -0
- package/src/video/contract.ts +0 -0
- package/src/video/coordinationReport.ts +0 -0
- package/src/video/jobClock.ts +0 -0
- package/src/video/jobTracker.ts +0 -0
- package/src/video/mediaLibrary.ts +0 -0
- package/src/video/renderCompat.ts +0 -0
- package/src/video/sessionForm.ts +0 -0
- package/src/video/spreadAssist.ts +0 -0
- package/src/video/studioBridge.ts +0 -0
- package/src/video/useMediaJobs.ts +0 -0
- package/src/video/useModels.ts +0 -0
- package/src/video/useMoviePresets.ts +0 -0
- package/src/video/useMovieSessions.ts +0 -0
- package/src/video/useOperatorHistory.ts +0 -0
- package/src/video/usePresets.ts +0 -0
- package/src/video/useProjects.ts +0 -0
- package/src/video/usePromptAssist.ts +65 -23
- package/src/video/useRenderPresets.ts +0 -0
- package/src/video/useStudioAssistLog.ts +0 -0
- package/src/video/useStudioPresets.ts +0 -0
- package/src/video/useToks.ts +0 -0
- package/src/video/useWorkerCalls.ts +0 -0
- package/tsconfig.json +0 -0
- package/vite.config.ts +0 -0
- package/src/stations/studio/StudioMovieComposer.tsx.bak-declutter-20260813 +0 -3031
package/src/video/jobTracker.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/video/sessionForm.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/video/useModels.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/video/usePresets.ts
CHANGED
|
File without changes
|
package/src/video/useProjects.ts
CHANGED
|
File without changes
|
|
@@ -55,6 +55,9 @@ export interface AssistModel {
|
|
|
55
55
|
model: string;
|
|
56
56
|
/** Seated on a worker right now (answers in ~1s) vs present but cold (first call loads it). */
|
|
57
57
|
serving: boolean;
|
|
58
|
+
/** Canonical residency (STATE-MODEL.md #4): serving|loaded = ready; hot = on a
|
|
59
|
+
* worker drive (pays a t_load); cold = central only (pays a download + load). */
|
|
60
|
+
state?: "serving" | "loaded" | "hot" | "cold";
|
|
58
61
|
framework?: string | null;
|
|
59
62
|
/** True for the fleet default — used when the user has never chosen. */
|
|
60
63
|
default?: boolean;
|
|
@@ -154,6 +157,60 @@ function readAssistPrompt(value: unknown): string | null {
|
|
|
154
157
|
return null;
|
|
155
158
|
}
|
|
156
159
|
|
|
160
|
+
// Ticket flow (2026-08-28): a cold model load measured 6m12s on the live
|
|
161
|
+
// fleet, and a held browser connection dies long before that (ClientGone) —
|
|
162
|
+
// killing the load, which restarts on the next click, forever. POST with
|
|
163
|
+
// {async:true} returns {ticket} immediately and the generation keeps running
|
|
164
|
+
// server-side; we poll the ticket until the prompt lands. No connection has
|
|
165
|
+
// to survive the load. An old server without the ticket route answers the
|
|
166
|
+
// POST with the direct result, which passes through unchanged.
|
|
167
|
+
const TICKET_POLL_MS = 3_000;
|
|
168
|
+
const TICKET_CEILING_MS = 12 * 60_000;
|
|
169
|
+
|
|
170
|
+
async function assistCall(
|
|
171
|
+
body: Record<string, unknown>,
|
|
172
|
+
specKey: string | undefined,
|
|
173
|
+
operation: string,
|
|
174
|
+
): Promise<ReturnType<typeof request<unknown>>> {
|
|
175
|
+
const res = await request<unknown>(hugpyConfig.promptAssistUrl, {
|
|
176
|
+
method: "POST",
|
|
177
|
+
headers: { "Content-Type": "application/json" },
|
|
178
|
+
body: JSON.stringify({ ...body, async: true }),
|
|
179
|
+
timeoutMs: 30_000,
|
|
180
|
+
meta: { specKey, operation },
|
|
181
|
+
});
|
|
182
|
+
if (!res.ok) return res;
|
|
183
|
+
const value = okValue(res) as { ticket?: string; pending?: boolean } | null;
|
|
184
|
+
const ticket = value?.ticket;
|
|
185
|
+
if (!ticket) return res; // direct (non-ticket) result — serve as-is
|
|
186
|
+
const deadline = Date.now() + TICKET_CEILING_MS;
|
|
187
|
+
for (;;) {
|
|
188
|
+
await new Promise((r) => setTimeout(r, TICKET_POLL_MS));
|
|
189
|
+
const poll = await request<unknown>(
|
|
190
|
+
`${hugpyConfig.promptAssistUrl}/ticket/${encodeURIComponent(ticket)}`,
|
|
191
|
+
{
|
|
192
|
+
method: "GET",
|
|
193
|
+
timeoutMs: 15_000,
|
|
194
|
+
meta: { specKey, operation: `${operation}.poll` },
|
|
195
|
+
},
|
|
196
|
+
);
|
|
197
|
+
if (!poll.ok) return poll;
|
|
198
|
+
const row = okValue(poll) as { pending?: boolean } | null;
|
|
199
|
+
if (!row?.pending) return poll;
|
|
200
|
+
if (Date.now() >= deadline) {
|
|
201
|
+
return {
|
|
202
|
+
ok: false,
|
|
203
|
+
error: {
|
|
204
|
+
kind: "timeout",
|
|
205
|
+
message:
|
|
206
|
+
"the assistant is still working after 12 minutes — the model may be stuck loading; try again",
|
|
207
|
+
requestId: `assist-ticket-${ticket.slice(0, 8)}`,
|
|
208
|
+
},
|
|
209
|
+
} as Awaited<ReturnType<typeof request<unknown>>>;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
157
214
|
export function usePromptAssist({ kind, specKey }: UsePromptAssistOptions): PromptAssistApi {
|
|
158
215
|
// One in-flight call at a time: `assistBusy` holds the ACTIVE mode or null when idle —
|
|
159
216
|
// it both blocks concurrent calls and drives which button shows its loading label.
|
|
@@ -246,13 +303,10 @@ export function usePromptAssist({ kind, specKey }: UsePromptAssistOptions): Prom
|
|
|
246
303
|
context: { kind, ...(extra?.context ?? {}) },
|
|
247
304
|
};
|
|
248
305
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
timeoutMs: 90_000, // a few seconds typically; generous for an on-demand worker
|
|
254
|
-
meta: { specKey, operation: `prompt.assist.${mode}` },
|
|
255
|
-
});
|
|
306
|
+
// Ticket flow — see assistCall: the POST returns immediately and we poll,
|
|
307
|
+
// so a cold model load (measured 6m12s) can finish without the browser
|
|
308
|
+
// holding a connection through it.
|
|
309
|
+
const res = await assistCall(body, specKey, `prompt.assist.${mode}`);
|
|
256
310
|
if (!res.ok) {
|
|
257
311
|
setAssistError(describeAppError(errorOf(res)));
|
|
258
312
|
setAssistBusy(null);
|
|
@@ -292,13 +346,7 @@ export function usePromptAssist({ kind, specKey }: UsePromptAssistOptions): Prom
|
|
|
292
346
|
const negModel = opts.extra?.model ?? assistModel;
|
|
293
347
|
if (negModel) body.model = negModel;
|
|
294
348
|
|
|
295
|
-
const res = await
|
|
296
|
-
method: "POST",
|
|
297
|
-
headers: { "Content-Type": "application/json" },
|
|
298
|
-
body: JSON.stringify(body),
|
|
299
|
-
timeoutMs: 90_000,
|
|
300
|
-
meta: { specKey, operation: "prompt.assist.negative" },
|
|
301
|
-
});
|
|
349
|
+
const res = await assistCall(body, specKey, "prompt.assist.negative");
|
|
302
350
|
if (!res.ok) {
|
|
303
351
|
setAssistError(describeAppError(errorOf(res)));
|
|
304
352
|
setAssistBusy(null);
|
|
@@ -328,15 +376,9 @@ export function usePromptAssist({ kind, specKey }: UsePromptAssistOptions): Prom
|
|
|
328
376
|
setAssistError(null);
|
|
329
377
|
setAssistBusy("spread");
|
|
330
378
|
const payload = { ...body, ...(assistModel ? { model: assistModel } : {}) };
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
body: JSON.stringify(payload),
|
|
335
|
-
// A spread writes N paragraphs in one generation, so it is the longest assist
|
|
336
|
-
// call there is — and on a cold generator it pays a model load first.
|
|
337
|
-
timeoutMs: 180_000,
|
|
338
|
-
meta: { specKey, operation: "prompt.assist.spread" },
|
|
339
|
-
});
|
|
379
|
+
// A spread writes N paragraphs in one generation, the longest assist call
|
|
380
|
+
// there is — the ticket flow means a cold generator's load can't kill it.
|
|
381
|
+
const res = await assistCall(payload, specKey, "prompt.assist.spread");
|
|
340
382
|
if (!res.ok) {
|
|
341
383
|
setAssistError(describeAppError(errorOf(res)));
|
|
342
384
|
setAssistBusy(null);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/video/useToks.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/tsconfig.json
CHANGED
|
File without changes
|
package/vite.config.ts
CHANGED
|
File without changes
|