@parallelworks/ui 0.18.0 → 0.19.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.
Files changed (161) hide show
  1. package/README.md +86 -6
  2. package/dist/ai/adapter/memoryStore.d.ts +8 -0
  3. package/dist/ai/adapter/mock/index.d.ts +2 -0
  4. package/dist/ai/adapter/mock/index.js +81 -0
  5. package/dist/ai/adapter/mock/mockAdapter.d.ts +4 -0
  6. package/dist/ai/adapter/openai/createOpenAIStream.d.ts +9 -0
  7. package/dist/ai/adapter/openai/errors.d.ts +3 -0
  8. package/dist/ai/adapter/openai/index.d.ts +6 -0
  9. package/dist/ai/adapter/openai/index.js +334 -0
  10. package/dist/ai/adapter/openai/openaiAdapter.d.ts +9 -0
  11. package/dist/ai/adapter/openai/responses.d.ts +4 -0
  12. package/dist/ai/adapter/openai/sse.d.ts +24 -0
  13. package/dist/ai/adapter/openai/wire.d.ts +40 -0
  14. package/dist/ai/adapter/types.d.ts +131 -0
  15. package/dist/ai/agent/classifier.d.ts +2 -0
  16. package/dist/ai/agent/diff.d.ts +35 -0
  17. package/dist/ai/agent/diffHighlight.d.ts +6 -0
  18. package/dist/ai/agent/index.d.ts +6 -0
  19. package/dist/ai/agent/permissions.d.ts +11 -0
  20. package/dist/ai/agent/toolfmt.d.ts +18 -0
  21. package/dist/ai/agent/transcript.d.ts +38 -0
  22. package/dist/ai/ai.css +325 -0
  23. package/dist/ai/components/AllocationSelector.d.ts +4 -0
  24. package/dist/ai/components/AttachmentManager.d.ts +1 -0
  25. package/dist/ai/components/AttachmentUpload.d.ts +24 -0
  26. package/dist/ai/components/BlockedGroupBanner.d.ts +1 -0
  27. package/dist/ai/components/BranchNavigator.d.ts +8 -0
  28. package/dist/ai/components/ChatEmptyState.d.ts +3 -0
  29. package/dist/ai/components/ChatInput.d.ts +45 -0
  30. package/dist/ai/components/ChatLayout.d.ts +5 -0
  31. package/dist/ai/components/ChatMessage.d.ts +24 -0
  32. package/dist/ai/components/ChatMessageList.d.ts +35 -0
  33. package/dist/ai/components/ChatSidebar.d.ts +5 -0
  34. package/dist/ai/components/ChatThread.d.ts +3 -0
  35. package/dist/ai/components/ComposerChrome.d.ts +18 -0
  36. package/dist/ai/components/ComposerFrame.d.ts +16 -0
  37. package/dist/ai/components/DragOverlay.d.ts +5 -0
  38. package/dist/ai/components/ModelSelector.d.ts +6 -0
  39. package/dist/ai/components/ShareDialog.d.ts +11 -0
  40. package/dist/ai/components/SlashMenu.d.ts +28 -0
  41. package/dist/ai/components/agent/ActivityLine.d.ts +21 -0
  42. package/dist/ai/components/agent/AgentMessageParts.d.ts +54 -0
  43. package/dist/ai/components/agent/PermissionPicker.d.ts +11 -0
  44. package/dist/ai/components/attachmentKeys.d.ts +4 -0
  45. package/dist/ai/core/ChatProvider.d.ts +66 -0
  46. package/dist/ai/core/KeyboardShortcutsProvider.d.ts +5 -0
  47. package/dist/ai/core/chatReducer.d.ts +114 -0
  48. package/dist/ai/core/config.d.ts +47 -0
  49. package/dist/ai/core/events.d.ts +1 -0
  50. package/dist/ai/core/exportConversation.d.ts +4 -0
  51. package/dist/ai/core/greeting.d.ts +3 -0
  52. package/dist/ai/core/parts.d.ts +11 -0
  53. package/dist/ai/core/useDragDrop.d.ts +14 -0
  54. package/dist/ai/core/useKeyboardShortcuts.d.ts +12 -0
  55. package/dist/ai/core/useSSEStream.d.ts +34 -0
  56. package/dist/ai/index.d.ts +40 -0
  57. package/dist/ai/index.js +6645 -0
  58. package/dist/ai/strings.d.ts +167 -0
  59. package/dist/ai/types.d.ts +236 -0
  60. package/dist/ai/ui/Avatar.d.ts +8 -0
  61. package/dist/ai/ui/Dropdown.d.ts +31 -0
  62. package/dist/ai/ui/Markdown.d.ts +8 -0
  63. package/dist/ai/ui/Notice.d.ts +21 -0
  64. package/dist/ai/ui/buttons.d.ts +1 -0
  65. package/dist/ai/ui/codeBreaks.d.ts +16 -0
  66. package/dist/ai/ui/prose.d.ts +1 -0
  67. package/dist/ai/ui/sidebar.d.ts +81 -0
  68. package/dist/ai/utils.d.ts +4 -0
  69. package/dist/assets/{editor.worker-CuBRIwi-.js → editor.worker-BmHUIVG4.js} +194 -163
  70. package/dist/assets/{json.worker-8ytS02vz.js → json.worker-D8bJ92nw.js} +384 -338
  71. package/dist/assets/{yaml.worker-DJC-VUcv.js → yaml.worker-C4gyGAko.js} +15657 -13823
  72. package/dist/chunks/{CodePreviewEditor-4lx3kE-w.js → CodePreviewEditor-YqQBz1YL.js} +1 -1
  73. package/dist/chunks/ConfirmModal-aOR4O1QE.js +79 -0
  74. package/dist/chunks/{FieldWrapper-Bef01EWO.js → FieldWrapper-Cszwg-4B.js} +3 -7
  75. package/dist/chunks/{CreateModal-BY6DLmur.js → Markdown-CM-FenNE.js} +19 -91
  76. package/dist/chunks/Monaco-DJ8MW-Dq.js +110 -0
  77. package/dist/chunks/{PageHeader-l49p1nM9.js → PageHeader-0kG_iypP.js} +67 -65
  78. package/dist/chunks/{Provider-Ghua9PkN.js → Provider-CDYurraE.js} +54 -20
  79. package/dist/chunks/{SwitchToggle-CHPP8uZQ.js → SwitchToggle-DShNdcao.js} +135 -132
  80. package/dist/chunks/{Table-4OHjdKdO.js → Table-DU2MW8xz.js} +5 -3
  81. package/dist/chunks/{Tooltip-Crxo_eU_.js → Tooltip-K5HJr4_p.js} +31 -4
  82. package/dist/chunks/duration-BOv8Phl8.js +17 -0
  83. package/dist/chunks/{editor-9_uVtUyy.js → editor-Dk1rbV75.js} +32 -18
  84. package/dist/chunks/focus-D_iZJTW1.js +7 -0
  85. package/dist/chunks/{list-qrojZZNv.js → list-CJm875m7.js} +377 -370
  86. package/dist/chunks/logviewer-BTKuQWzw.js +828 -0
  87. package/dist/chunks/memoryStore-CC91S5LP.js +152 -0
  88. package/dist/chunks/types-Yy0NrerF.js +11 -0
  89. package/dist/components/Avatar.d.ts +1 -1
  90. package/dist/components/Breadcrumbs.d.ts +1 -1
  91. package/dist/components/Dropdown.d.ts +1 -1
  92. package/dist/components/EmptyState.d.ts +1 -1
  93. package/dist/components/Indicator.d.ts +2 -2
  94. package/dist/components/Input.d.ts +1 -1
  95. package/dist/components/LetterBadge.d.ts +1 -1
  96. package/dist/components/MarkdownImpl.d.ts +1 -1
  97. package/dist/components/Provider.d.ts +16 -65
  98. package/dist/components/SettingRow.d.ts +1 -1
  99. package/dist/components/SettingsGroup.d.ts +1 -1
  100. package/dist/components/focus.d.ts +2 -0
  101. package/dist/components/keys.d.ts +12 -0
  102. package/dist/duration.d.ts +3 -0
  103. package/dist/editor/Monaco.d.ts +1 -20
  104. package/dist/editor/index.d.ts +2 -1
  105. package/dist/editor/index.js +2 -2
  106. package/dist/editor/yaml.d.ts +5 -0
  107. package/dist/engine.d.ts +98 -0
  108. package/dist/file-explorer/FileExplorer.d.ts +11 -2
  109. package/dist/file-explorer/FileExplorerContext.d.ts +1 -1
  110. package/dist/file-explorer/FilePreview/CodePreviewEditor.d.ts +1 -1
  111. package/dist/file-explorer/FilePreview/previewType.d.ts +1 -1
  112. package/dist/file-explorer/FileRow.d.ts +1 -1
  113. package/dist/file-explorer/helpers.d.ts +4 -4
  114. package/dist/file-explorer/index.d.ts +3 -3
  115. package/dist/file-explorer/index.js +613 -647
  116. package/dist/file-explorer/lib/types.d.ts +6 -1
  117. package/dist/file-explorer/lib/utils.d.ts +1 -3
  118. package/dist/file-explorer/useNearEnd.d.ts +1 -1
  119. package/dist/form/FieldWrapper.d.ts +2 -2
  120. package/dist/form/Fields/ResourceOptionIcon.d.ts +1 -1
  121. package/dist/form/Form.d.ts +4 -21
  122. package/dist/form/index.d.ts +11 -12
  123. package/dist/form/index.js +1488 -1611
  124. package/dist/form/lib.d.ts +6 -1
  125. package/dist/form/types/fieldComponentTypes.d.ts +3 -2
  126. package/dist/form/types/fieldTypes.d.ts +6 -20
  127. package/dist/form/useParsedOpts.d.ts +1 -1
  128. package/dist/form/utils/{slurmDuration.d.ts → duration.d.ts} +2 -2
  129. package/dist/{workflow → graph}/MatrixGroup.d.ts +2 -2
  130. package/dist/{workflow → graph}/index.d.ts +1 -1
  131. package/dist/{workflow → graph}/index.js +215 -180
  132. package/dist/{workflow → graph}/types.d.ts +3 -3
  133. package/dist/icons.d.ts +20 -21
  134. package/dist/index.d.ts +38 -40
  135. package/dist/index.js +347 -346
  136. package/dist/list/ListTable.d.ts +1 -1
  137. package/dist/list/ListViewControls.d.ts +2 -2
  138. package/dist/list/index.d.ts +9 -9
  139. package/dist/list/index.js +2 -2
  140. package/dist/logviewer/LogViewer.d.ts +1 -1
  141. package/dist/logviewer/index.d.ts +1 -0
  142. package/dist/logviewer/index.js +2 -742
  143. package/dist/logviewer/segments.d.ts +9 -0
  144. package/dist/styles/fonts.css +4 -4
  145. package/dist/styles/theme.css +6 -4
  146. package/dist/styles.css +1 -1
  147. package/dist/theme/index.js +2 -2
  148. package/package.json +38 -14
  149. package/LICENSE +0 -202
  150. package/dist/chunks/Monaco-C1POOdVv.js +0 -1046
  151. package/dist/editor/usesGitlab.d.ts +0 -97
  152. package/dist/form/Fields/BucketReadOnlyField.d.ts +0 -7
  153. package/dist/form/types/workflow-schema.d.ts +0 -1145
  154. package/dist/form/utils/pwResolver.d.ts +0 -18
  155. package/dist/chunks/{MarkdownImpl-Bq4QhrtA.js → MarkdownImpl-CyeTVvSt.js} +1 -1
  156. /package/dist/{workflow → graph}/AnnotationBanner.d.ts +0 -0
  157. /package/dist/{workflow → graph}/Collapse.d.ts +0 -0
  158. /package/dist/{workflow → graph}/DependencyGraph.d.ts +0 -0
  159. /package/dist/{workflow → graph}/JobSummary.d.ts +0 -0
  160. /package/dist/{workflow → graph}/Reveal.d.ts +0 -0
  161. /package/dist/{workflow → graph}/TreeView.d.ts +0 -0
@@ -0,0 +1,152 @@
1
+ import { t as ChatAdapterError } from "./types-Yy0NrerF.js";
2
+ //#region src/ai/adapter/memoryStore.ts
3
+ function newId() {
4
+ return crypto.randomUUID();
5
+ }
6
+ function createMemoryConversationStore(options) {
7
+ const storageKey = options?.storageKey;
8
+ let conversations = [];
9
+ if (storageKey) try {
10
+ const raw = globalThis.localStorage?.getItem(storageKey);
11
+ if (raw) conversations = JSON.parse(raw);
12
+ } catch {
13
+ conversations = [];
14
+ }
15
+ const persist = () => {
16
+ if (storageKey) try {
17
+ globalThis.localStorage?.setItem(storageKey, JSON.stringify(conversations));
18
+ } catch {}
19
+ };
20
+ const find = (id) => {
21
+ const conversation = conversations.find((c) => c.id === id);
22
+ if (!conversation) throw new ChatAdapterError("Conversation not found", { status: 404 });
23
+ return conversation;
24
+ };
25
+ const toSummary = (c) => ({
26
+ id: c.id,
27
+ ...c.title !== null ? { title: c.title } : {},
28
+ messageCount: c.messages.length,
29
+ createdAt: c.createdAt,
30
+ updatedAt: c.updatedAt,
31
+ isOwner: true,
32
+ canCollaborate: true
33
+ });
34
+ const recordUser = (req) => {
35
+ const conversation = conversations.find((c) => c.id === req.conversationId);
36
+ if (!conversation) return;
37
+ const last = req.messages[req.messages.length - 1];
38
+ const userContent = typeof last?.content === "string" ? last.content : "";
39
+ conversation.messages.push({
40
+ id: req.userMessageId,
41
+ role: "user",
42
+ content: userContent,
43
+ parentId: req.parentMessageId ?? null,
44
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
45
+ });
46
+ conversation.activeBranchId = req.userMessageId;
47
+ conversation.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
48
+ persist();
49
+ };
50
+ const recordAssistant = (req, assistant) => {
51
+ const conversation = conversations.find((c) => c.id === req.conversationId);
52
+ if (!conversation) return;
53
+ conversation.messages.push({
54
+ ...assistant,
55
+ role: "assistant"
56
+ });
57
+ conversation.activeBranchId = assistant.id;
58
+ conversation.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
59
+ persist();
60
+ };
61
+ return {
62
+ conversations: {
63
+ async list() {
64
+ return [...conversations].sort((a, b) => b.createdAt.localeCompare(a.createdAt)).map(toSummary);
65
+ },
66
+ async get(id) {
67
+ const c = find(id);
68
+ return {
69
+ id: c.id,
70
+ title: c.title,
71
+ messages: [...c.messages],
72
+ activeBranchId: c.activeBranchId,
73
+ createdAt: c.createdAt,
74
+ updatedAt: c.updatedAt,
75
+ isOwner: true,
76
+ canCollaborate: true
77
+ };
78
+ },
79
+ async create(title) {
80
+ const now = (/* @__PURE__ */ new Date()).toISOString();
81
+ const conversation = {
82
+ id: newId(),
83
+ title: title ?? null,
84
+ createdAt: now,
85
+ updatedAt: now,
86
+ activeBranchId: null,
87
+ messages: []
88
+ };
89
+ conversations.push(conversation);
90
+ persist();
91
+ return toSummary(conversation);
92
+ },
93
+ async rename(id, title) {
94
+ find(id).title = title;
95
+ persist();
96
+ },
97
+ async remove(id) {
98
+ conversations = conversations.filter((c) => c.id !== id);
99
+ persist();
100
+ }
101
+ },
102
+ recordingStream(inner) {
103
+ return async (req, handlers, signal) => {
104
+ let partialContent = "";
105
+ let partialReasoning = "";
106
+ const wrappedHandlers = {
107
+ ...handlers,
108
+ onContent: (chunk) => {
109
+ partialContent += chunk;
110
+ handlers.onContent(chunk);
111
+ },
112
+ onReasoning: (chunk) => {
113
+ partialReasoning += chunk;
114
+ handlers.onReasoning?.(chunk);
115
+ }
116
+ };
117
+ recordUser(req);
118
+ try {
119
+ const result = await inner(req, wrappedHandlers, signal);
120
+ const assistantId = result.messageId || newId();
121
+ recordAssistant(req, {
122
+ id: assistantId,
123
+ content: result.content || null,
124
+ parentId: req.userMessageId,
125
+ model: result.model ?? req.model,
126
+ ...result.reasoning ? { reasoning: result.reasoning } : {},
127
+ ...result.responsesOutput.length ? { responsesOutput: result.responsesOutput } : {},
128
+ ...result.toolCalls.length ? { toolCalls: result.toolCalls } : {},
129
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
130
+ });
131
+ return {
132
+ ...result,
133
+ messageId: assistantId
134
+ };
135
+ } catch (error) {
136
+ if (error instanceof DOMException && error.name === "AbortError" && (partialContent || partialReasoning)) recordAssistant(req, {
137
+ id: newId(),
138
+ content: partialContent || null,
139
+ parentId: req.userMessageId,
140
+ model: req.model,
141
+ ...partialReasoning ? { reasoning: partialReasoning } : {},
142
+ stopped: true,
143
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
144
+ });
145
+ throw error;
146
+ }
147
+ };
148
+ }
149
+ };
150
+ }
151
+ //#endregion
152
+ export { createMemoryConversationStore as t };
@@ -0,0 +1,11 @@
1
+ //#region src/ai/adapter/types.ts
2
+ var ChatAdapterError = class extends Error {
3
+ status;
4
+ constructor(message, options) {
5
+ super(message, options?.cause === void 0 ? {} : { cause: options.cause });
6
+ this.name = "ChatAdapterError";
7
+ this.status = options?.status;
8
+ }
9
+ };
10
+ //#endregion
11
+ export { ChatAdapterError as t };
@@ -10,4 +10,4 @@ export interface AvatarProps {
10
10
  }
11
11
  /** Up to two initials: the first and last word of a name split on spaces and dots. */
12
12
  export declare function avatarInitials(name: string | undefined): string;
13
- export declare function Avatar({ src, name, size, status, className, }: AvatarProps): import("react").JSX.Element;
13
+ export declare function Avatar({ src, name, size, status, className }: AvatarProps): import("react").JSX.Element;
@@ -20,7 +20,7 @@ interface BreadcrumbContextType {
20
20
  claimedPath: React.MutableRefObject<string | null>;
21
21
  }
22
22
  export declare const useBreadcrumb: () => BreadcrumbContextType;
23
- export declare function BreadcrumbProvider({ children, }: {
23
+ export declare function BreadcrumbProvider({ children }: {
24
24
  children: React.ReactNode;
25
25
  }): React.JSX.Element;
26
26
  export declare function useSetBreadcrumbs(getBreadcrumbs: (() => IBreadcrumbItem[]) | IBreadcrumbItem[]): void;
@@ -1,5 +1,5 @@
1
1
  import { type SetStateAction } from 'react';
2
- import { type IOptions, type ICategory } from './dropdownUtils.js';
2
+ import { type ICategory, type IOptions } from './dropdownUtils.js';
3
3
  export interface IProps {
4
4
  options: (ICategory | IOptions | string)[];
5
5
  onActiveChange?: (option: unknown) => void;
@@ -7,5 +7,5 @@ interface EmptyStateProps {
7
7
  className?: string;
8
8
  }>;
9
9
  }
10
- export default function EmptyState({ title, description, action, icon: Icon, }: EmptyStateProps): React.JSX.Element;
10
+ export default function EmptyState({ title, description, action, icon: Icon }: EmptyStateProps): React.JSX.Element;
11
11
  export {};
@@ -1,4 +1,4 @@
1
- import type { TStatus } from '@parallelworks/workflow-parser';
1
+ import type { RunStatus } from '../engine.js';
2
2
  export declare function Indicator({ status }: {
3
- status: TStatus;
3
+ status: RunStatus;
4
4
  }): import("react").JSX.Element;
@@ -1,4 +1,4 @@
1
- import type { InputHTMLAttributes, TextareaHTMLAttributes, ReactNode } from 'react';
1
+ import type { InputHTMLAttributes, ReactNode, TextareaHTMLAttributes } from 'react';
2
2
  interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
3
3
  label?: ReactNode;
4
4
  error?: string | undefined;
@@ -1,6 +1,6 @@
1
1
  /** A compact letter badge ("AI", "PUB", "SSH") used as a type mark in place of
2
2
  * an icon. Size the box and text via className (e.g. "h-5 w-5 text-[8px]"). */
3
- export declare function LetterBadge({ text, className, }: {
3
+ export declare function LetterBadge({ text, className }: {
4
4
  text: string;
5
5
  className?: string;
6
6
  }): import("react").JSX.Element;
@@ -1,2 +1,2 @@
1
1
  import type { MarkdownProps } from './Markdown.js';
2
- export default function Markdown({ children, isStreaming, controls, }: MarkdownProps): import("react").JSX.Element;
2
+ export default function Markdown({ children, isStreaming, controls }: MarkdownProps): import("react").JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import type { Dispatch, ReactNode, SetStateAction } from 'react';
2
- import type { RunLink } from '../workflow/types.js';
2
+ import type { WorkflowEngine } from '../engine.js';
3
+ import type { RunLink } from '../graph/types.js';
3
4
  export type UIToastId = string | number;
4
5
  export interface UIToastOptions {
5
6
  toastId?: UIToastId;
@@ -244,6 +245,7 @@ export interface UIStrings {
244
245
  collapse: string;
245
246
  upload: string;
246
247
  download: string;
248
+ downloadFromBrowser: string;
247
249
  access: string;
248
250
  manageAccess: string;
249
251
  delete: string;
@@ -318,10 +320,6 @@ export interface UIStrings {
318
320
  invalidDuration: string;
319
321
  durationOutOfRange: (min: string, max: string) => string;
320
322
  durationBelowMin: (min: string) => string;
321
- readOnly: string;
322
- readWrite: string;
323
- readOnlyDescription: string;
324
- readOnlyForced: string;
325
323
  };
326
324
  time: {
327
325
  now: string;
@@ -373,18 +371,11 @@ export interface UIStrings {
373
371
  }
374
372
  export interface UINavigation {
375
373
  goTo: (to: string) => void;
376
- toWorkflow: (name: string) => void;
377
- toMarketItem: (name: string) => void;
374
+ /** Opens the source of a step that runs another workflow, named by its `uses`;
375
+ * `sourceUrl` is a page the server resolved for it, when there is one. */
376
+ openStepSource: (uses: string, sourceUrl?: string) => void;
378
377
  openExternal: (href: string) => void;
379
378
  }
380
- export type WorkflowJsonRef = {
381
- kind: 'marketplace';
382
- slug: string;
383
- version: string;
384
- } | {
385
- kind: 'workflow';
386
- name: string;
387
- };
388
379
  export interface RunFileResult {
389
380
  data: string | undefined;
390
381
  isLoading: boolean;
@@ -400,11 +391,6 @@ export interface UIData {
400
391
  useRunFile: (slug: string, path: string | null, options?: {
401
392
  refreshInterval?: number;
402
393
  }) => RunFileResult;
403
- /**
404
- * Resolves a workflow reference to its parsed JSON definition, for the YAML
405
- * editor's input completion. Absent, that completion silently no-ops.
406
- */
407
- resolveWorkflowJson?: (ref: WorkflowJsonRef) => Promise<unknown>;
408
394
  /**
409
395
  * Provisions browser-access CORS rules on a storage. Absent, the storage
410
396
  * explorer hides its "add CORS rules" affordance.
@@ -418,48 +404,6 @@ export interface UIData {
418
404
  error?: string;
419
405
  }>;
420
406
  usePersistedState: PersistedStateHook;
421
- /**
422
- * Repository completions for `uses:`, bound by the host because the credential
423
- * lives on the platform. Absent, those completions no-op.
424
- */
425
- repoSuggestions?: {
426
- refs: (repo: string) => Promise<RepoRef[]>;
427
- files: (repo: string, ref: string, path: string) => Promise<RepoEntry[]>;
428
- file: (repo: string, ref: string, path: string) => Promise<string>;
429
- repos: (owner: string) => Promise<RepoSummary[]>;
430
- gitlabProjects: (search: string, host?: string) => Promise<GitlabProject[]>;
431
- owners: (provider: 'github' | 'gitlab', search: string, host?: string) => Promise<RepoOwner[]>;
432
- };
433
- }
434
- /** One branch, tag or commit a `uses:` reference can name. */
435
- export interface RepoRef {
436
- name: string;
437
- kind: string;
438
- detail: string;
439
- }
440
- /** One repository in an owner listing. */
441
- export interface RepoSummary {
442
- name: string;
443
- description: string;
444
- private: boolean;
445
- }
446
- /** One account, organization or group a repository can live under. */
447
- export interface RepoOwner {
448
- name: string;
449
- kind: string;
450
- host?: string | undefined;
451
- }
452
- /** One GitLab project, with the server a $host must name to reach it. */
453
- export interface GitlabProject {
454
- path: string;
455
- host: string;
456
- description: string;
457
- private: boolean;
458
- }
459
- /** One entry in a repository directory listing. */
460
- export interface RepoEntry {
461
- path: string;
462
- type: 'blob' | 'tree';
463
407
  }
464
408
  import type { FieldComponent } from '../form/fieldRegistry.js';
465
409
  import type { PageHeaderCrumb } from './PageHeader.js';
@@ -530,25 +474,31 @@ export interface UISlots {
530
474
  * trail — the host's app-nav toggle. Absent hides it. */
531
475
  navToggle?: () => ReactNode;
532
476
  }
477
+ /** An engine, or a loader so the host can keep the engine out of its first-load bundle. */
478
+ export type WorkflowEngineSource = WorkflowEngine | (() => Promise<WorkflowEngine>);
533
479
  export interface UIProviderValue {
534
480
  notify: UINotify;
535
481
  strings: UIStrings;
536
482
  navigation: UINavigation;
537
483
  data: UIData;
538
484
  slots: UISlots;
485
+ engine?: WorkflowEngineSource | undefined;
539
486
  }
540
487
  export declare function useNotify(): UINotify;
541
488
  export declare function useStrings(): UIStrings;
542
489
  export declare function useNavigation(): UINavigation;
543
490
  export declare function useSlots(): UISlots;
544
- export declare function useWorkflowJsonResolver(): ((ref: WorkflowJsonRef) => Promise<unknown>) | undefined;
491
+ /** The engine when one is provided and `enabled`; suspends while a loader resolves. */
492
+ export declare function useOptionalWorkflowEngine(enabled?: boolean): WorkflowEngine | undefined;
493
+ export declare function useWorkflowEngine(): WorkflowEngine;
494
+ /** Resolves the engine without suspending, for async callers such as editor completions. */
495
+ export declare function useWorkflowEngineLoader(): () => Promise<WorkflowEngine | undefined>;
545
496
  export declare function useProvisionCorsRules(): UIData['provisionCorsRules'];
546
- export declare function useRepoSuggestions(): UIData['repoSuggestions'];
547
497
  export declare function useRunFile(slug: string, path: string | null, options?: {
548
498
  refreshInterval?: number;
549
499
  }): RunFileResult;
550
500
  export declare function usePersistedState<T>(key: string, defaultValue: T): [T, Dispatch<SetStateAction<T>>];
551
- export declare function UIProvider({ notify, strings, navigation, data, slots, children, }: {
501
+ export declare function UIProvider({ notify, strings, navigation, data, slots, engine, children, }: {
552
502
  notify?: Partial<UINotify>;
553
503
  strings?: {
554
504
  [G in keyof UIStrings]?: UIStrings[G] extends object ? Partial<UIStrings[G]> : UIStrings[G];
@@ -556,5 +506,6 @@ export declare function UIProvider({ notify, strings, navigation, data, slots, c
556
506
  navigation?: Partial<UINavigation>;
557
507
  data?: Partial<UIData>;
558
508
  slots?: UISlots;
509
+ engine?: WorkflowEngineSource;
559
510
  children: React.ReactNode;
560
511
  }): import("react").JSX.Element;
@@ -12,7 +12,7 @@ export declare function SettingRow({ label, htmlFor, helpText, children, isFirst
12
12
  * double toggle. */
13
13
  onClick?: () => void;
14
14
  }): import("react").JSX.Element;
15
- export declare function SettingSection({ title, isFirst, }: {
15
+ export declare function SettingSection({ title, isFirst }: {
16
16
  title: string;
17
17
  isFirst?: boolean;
18
18
  }): import("react").JSX.Element;
@@ -4,5 +4,5 @@ interface SettingsGroupProps {
4
4
  children: React.ReactNode;
5
5
  className?: string;
6
6
  }
7
- export default function SettingsGroup({ title, children, className, }: SettingsGroupProps): React.JSX.Element;
7
+ export default function SettingsGroup({ title, children, className }: SettingsGroupProps): React.JSX.Element;
8
8
  export {};
@@ -0,0 +1,2 @@
1
+ /** A ref that focuses a field once, when it mounts; stable so re-renders never move focus back. */
2
+ export declare function focusOnMount(element: HTMLElement | null): void;
@@ -0,0 +1,12 @@
1
+ /** Pairs each item with a React key from its content, suffixing repeats so keys stay unique. */
2
+ export declare function keyedByContent<T>(items: readonly T[], toKey: (item: T) => string): {
3
+ key: string;
4
+ item: T;
5
+ }[];
6
+ /** Keys for a list whose position is its identity, such as placeholder rows or a fixed grid. */
7
+ export declare function positionKeys(count: number, prefix?: string): string[];
8
+ /** Pairs each item of a list that never reorders with a key from its position. */
9
+ export declare function withPositionKeys<T>(items: readonly T[], prefix?: string): {
10
+ key: string;
11
+ item: T;
12
+ }[];
@@ -0,0 +1,3 @@
1
+ import { type DateTime, Duration } from 'luxon';
2
+ export declare function durationToAbsHumanDuration(d: Duration): string;
3
+ export declare function toAbsHumanDuration(start: DateTime, end: DateTime): string;
@@ -1,20 +1,4 @@
1
1
  import * as monaco from 'monaco-editor';
2
- export interface EditorMarketplaceItem {
3
- readonly slug?: string;
4
- readonly name?: string | null;
5
- readonly description?: string | null;
6
- readonly type?: string | null;
7
- readonly subtype?: string | null;
8
- readonly versions?: readonly string[] | null;
9
- }
10
- export interface EditorWorkflowItem {
11
- readonly name?: string;
12
- readonly displayName?: string | null;
13
- readonly description?: string | null;
14
- readonly type?: string | null;
15
- }
16
- type MarketplaceItem = EditorMarketplaceItem;
17
- type WorkflowItem = EditorWorkflowItem;
18
2
  export type ISchemaError = monaco.editor.IMarker;
19
3
  export interface IEditorProps extends monaco.editor.IStandaloneEditorConstructionOptions {
20
4
  className?: string;
@@ -24,8 +8,5 @@ export interface IEditorProps extends monaco.editor.IStandaloneEditorConstructio
24
8
  width?: string | number;
25
9
  height?: string | number;
26
10
  path?: 'file:///workflow.yaml' | string;
27
- marketplaceItems?: MarketplaceItem[];
28
- workflows?: WorkflowItem[];
29
11
  }
30
- export default function MonacoEditor({ className, disabled, onChange, onValidate, width, height, path, marketplaceItems, workflows, ...options }: IEditorProps): import("react").JSX.Element;
31
- export {};
12
+ export default function MonacoEditor({ className, disabled, onChange, onValidate, width, height, path, ...options }: IEditorProps): import("react").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  export { default as Editor } from './Editor.js';
2
2
  export { default as EditorField, type IEditorField } from './EditorField.js';
3
3
  export { default as FormCodePanel } from './FormCodePanel.js';
4
- export type { EditorMarketplaceItem, EditorWorkflowItem, IEditorProps, ISchemaError, } from './Monaco.js';
4
+ export type { IEditorProps, ISchemaError } from './Monaco.js';
5
5
  export { defineEditorThemes, getThemeName } from './themes.js';
6
6
  export { setupMonacoWorkers } from './workers.js';
7
+ export { configureEditorYaml } from './yaml.js';
@@ -1,2 +1,2 @@
1
- import { a as EditorField, i as FormCodePanel, n as defineEditorThemes, o as Editor, r as getThemeName, t as setupMonacoWorkers } from "../chunks/editor-9_uVtUyy.js";
2
- export { Editor, EditorField, FormCodePanel, defineEditorThemes, getThemeName, setupMonacoWorkers };
1
+ import { a as getThemeName, c as Editor, i as defineEditorThemes, o as FormCodePanel, r as setupMonacoWorkers, s as EditorField, t as configureEditorYaml } from "../chunks/editor-Dk1rbV75.js";
2
+ export { Editor, EditorField, FormCodePanel, configureEditorYaml, defineEditorThemes, getThemeName, setupMonacoWorkers };
@@ -0,0 +1,5 @@
1
+ import type { SchemasSettings } from 'monaco-yaml';
2
+ /** Adds JSON schemas that validate and complete YAML models whose URI matches. */
3
+ export declare function configureEditorYaml(added: SchemasSettings[]): void;
4
+ /** Lets the loaded editor pick up schemas added before or after it loads. */
5
+ export declare function onYamlSchemas(listener: (schemas: SchemasSettings[]) => void): void;
@@ -0,0 +1,98 @@
1
+ export type RunStatus = 'started' | 'running' | 'completed' | 'error' | 'failed' | 'canceled' | 'skipped' | 'faulted' | 'canceling' | 'skipped-failed' | '' | undefined;
2
+ export interface MatrixGroup {
3
+ originaljob: string;
4
+ members: string[];
5
+ }
6
+ export interface LogSegment {
7
+ content: string;
8
+ className: string;
9
+ highlighted?: boolean;
10
+ }
11
+ export interface LogCommand {
12
+ type: 'error' | 'warning' | 'notice' | 'debug' | 'group' | 'endgroup';
13
+ message: string;
14
+ params?: Record<string, string>;
15
+ }
16
+ export interface ProcessedLogLine {
17
+ index: number;
18
+ segments: LogSegment[];
19
+ command?: LogCommand;
20
+ groupDepth: number;
21
+ groupId?: number;
22
+ }
23
+ export interface WorkflowVariable {
24
+ key?: string;
25
+ value?: string | null;
26
+ secret?: boolean;
27
+ }
28
+ export type WorkflowVariables = Record<string, WorkflowVariable>;
29
+ export interface EvaluateOptions<T> {
30
+ inputs: unknown;
31
+ obj: T;
32
+ path?: string[];
33
+ schema?: unknown;
34
+ orgVars?: WorkflowVariables | undefined;
35
+ userVars?: Record<string, string>;
36
+ remoteVars?: Record<string, string | undefined> | undefined;
37
+ secretKeys?: string[];
38
+ appInfo?: Record<string, unknown>;
39
+ sessionInfo?: Record<string, string>;
40
+ index?: number | undefined;
41
+ }
42
+ export interface ExpansionKeys {
43
+ subworkflowKeys: string[];
44
+ jobKeys: string[];
45
+ matrixKeys: string[];
46
+ }
47
+ export interface EngineJob {
48
+ status?: RunStatus;
49
+ needs?: string[];
50
+ if?: boolean | string;
51
+ steps?: unknown[];
52
+ _matrix?: {
53
+ originaljob?: string;
54
+ index?: number;
55
+ };
56
+ _matrixGroup?: MatrixGroup;
57
+ }
58
+ export interface EngineStep {
59
+ name?: string | undefined;
60
+ run?: string;
61
+ uses?: string;
62
+ subworkflow?: unknown;
63
+ }
64
+ /** The workflow semantics the form, graph, editor and log viewer defer to. */
65
+ export interface WorkflowEngine {
66
+ /** Starts loading the expression runtime; safe to call repeatedly. */
67
+ init(): void;
68
+ isReady(): boolean;
69
+ /** Calls back when readiness changes; returns an unsubscribe function. */
70
+ onReady(listener: (ready: boolean) => void): () => void;
71
+ /** Resolves every `${{ }}` expression in `obj`. */
72
+ evaluate<T>(options: EvaluateOptions<T>): T;
73
+ /** Turns a workflow's input definitions into the form's field tree. */
74
+ convertInputs(inputs: Record<string, unknown>): Record<string, unknown>;
75
+ inputDependencies(obj: unknown): {
76
+ inputDeps: Set<string>;
77
+ hasExpressions: boolean;
78
+ };
79
+ jobDependencies(jobName: string, jobs: Record<string, {
80
+ needs?: string[];
81
+ }>, memo?: Record<string, Set<string>>): Set<string>;
82
+ matrixGroups(jobs: Record<string, EngineJob> | undefined): Record<string, MatrixGroup>;
83
+ /** Rewrites `visibleJobs` in place so each matrix group lays out as one node. */
84
+ collapseMatrixGroups(groups: Record<string, MatrixGroup>, visibleJobs: Record<string, EngineJob>): void;
85
+ expansionKeys(jobs: Record<string, EngineJob> | undefined, pathPrefix?: string): ExpansionKeys;
86
+ matrixStatus(statuses: RunStatus[]): {
87
+ aggStatus: RunStatus;
88
+ statusLabel: string;
89
+ };
90
+ stepLabel(step: EngineStep, index?: number): string;
91
+ stepLogPath(subworkflowPrefix: string, jobName: string, stepIndex: number | string): string;
92
+ isRunActive(status: string | null | undefined): boolean;
93
+ processLogLines(lines: {
94
+ index: number;
95
+ segments: LogSegment[];
96
+ }[], rawLines: string[]): ProcessedLogLine[];
97
+ toYaml(value: unknown): string;
98
+ }
@@ -1,5 +1,5 @@
1
1
  import type { IFileExplorerClient, IFileExplorerProvider } from './lib/fileExplorer.js';
2
- import type { TreeNode, TStorage } from './lib/types.js';
2
+ import type { ExplorerObject, TreeNode, TStorage } from './lib/types.js';
3
3
  interface IFileExplorerProps {
4
4
  storages: TStorage[];
5
5
  /** Resolves the storage's injected provider pair; the host owns caching. */
@@ -33,6 +33,15 @@ interface IFileExplorerProps {
33
33
  initialExpandedPaths?: readonly string[];
34
34
  /** Fires whenever the expanded folders change, for the host to persist. */
35
35
  onExpandedPathsChange?: (paths: string[]) => void;
36
+ /** URIs that name an object, shown on its details and offered under Copy;
37
+ * the first is what Copy URI copies. None hides them. */
38
+ objectUris?: ((storage: TStorage, key: string) => string[]) | undefined;
39
+ /** A shell command that downloads files, offered beside the browser
40
+ * download. An empty command hides it for that selection. */
41
+ downloadCommand?: {
42
+ label: string;
43
+ build: (objects: ExplorerObject[]) => string;
44
+ } | undefined;
36
45
  }
37
- export default function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHierarchy, groups, groupsLoading, selectedPath, onPathChange, getProviderAndClient, treeOnly, initialExpandedPaths, onExpandedPathsChange, }: IFileExplorerProps): import("react").JSX.Element;
46
+ export default function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHierarchy, groups, groupsLoading, selectedPath, onPathChange, getProviderAndClient, treeOnly, initialExpandedPaths, onExpandedPathsChange, objectUris, downloadCommand, }: IFileExplorerProps): import("react").JSX.Element;
38
47
  export {};
@@ -1,5 +1,5 @@
1
- import type { TreeNode, UploadFileProgress, UploadNode, UploadSession } from './lib/types.js';
2
1
  import type { IFileExplorerClient, IFileExplorerProvider } from './lib/fileExplorer.js';
2
+ import type { TreeNode, UploadFileProgress, UploadNode, UploadSession } from './lib/types.js';
3
3
  interface IFileExplorerContextValue {
4
4
  uploadSessionMap: Map<string, UploadSession>;
5
5
  uploadQueue: string[];
@@ -2,5 +2,5 @@ interface CodePreviewEditorProps {
2
2
  value: string;
3
3
  language: string;
4
4
  }
5
- export default function CodePreviewEditor({ value, language, }: CodePreviewEditorProps): import("react").JSX.Element;
5
+ export default function CodePreviewEditor({ value, language }: CodePreviewEditorProps): import("react").JSX.Element;
6
6
  export {};
@@ -1,5 +1,5 @@
1
- import { getFileExtension } from '../lib/utils.js';
2
1
  import type { TreeNode } from '../lib/types.js';
2
+ import { getFileExtension } from '../lib/utils.js';
3
3
  export { getFileExtension };
4
4
  export type PreviewKind = 'image' | 'video' | 'audio' | 'pdf' | 'code' | 'csv' | 'notebook' | 'archive' | 'unsupported';
5
5
  /** Short-lived so the link doesn't linger; an hour covers a viewing session. */
@@ -1,5 +1,5 @@
1
- import { type OpenMenu, type RowMenuItem } from '../list/index.js';
2
1
  import type { ReactNode } from 'react';
2
+ import { type OpenMenu, type RowMenuItem } from '../list/index.js';
3
3
  import type { TreeNode } from './lib/types.js';
4
4
  export declare const ROW_HEIGHT_SHORT = 45;
5
5
  export declare const ROW_HEIGHT_TALL = 52.25;
@@ -1,5 +1,5 @@
1
- import type { TreeNode, TStorage, UploadNode } from './lib/types.js';
2
1
  import { type JSX } from 'react';
2
+ import type { TreeNode, TStorage, UploadNode } from './lib/types.js';
3
3
  declare const SIDEBAR_WIDTH_STORAGE_KEY = "fileExplorerSidebarWidth";
4
4
  declare const SIDEBAR_WIDTH_DEFAULT = 300;
5
5
  type StorageIconUrlResolver = (args: {
@@ -9,7 +9,7 @@ declare function getNodeIcon(node: TreeNode, storageIconUrl?: StorageIconUrlReso
9
9
  declare function renderUploadNodes(uploadNodes: UploadNode[]): JSX.Element[];
10
10
  declare function NoFileSelectedPreview(): JSX.Element;
11
11
  /** Shown instead of a skeleton that has nothing left to wait for. */
12
- declare function NotFoundPreview({ path, onRetry, }: {
12
+ declare function NotFoundPreview({ path, onRetry }: {
13
13
  path: string;
14
14
  onRetry: () => void;
15
15
  }): JSX.Element;
@@ -36,10 +36,10 @@ interface IDragDropZoneProps {
36
36
  children: React.ReactNode;
37
37
  className?: string;
38
38
  }
39
- declare function DragDropZone({ onDropFiles, children, className, }: IDragDropZoneProps): JSX.Element;
39
+ declare function DragDropZone({ onDropFiles, children, className }: IDragDropZoneProps): JSX.Element;
40
40
  interface IShareFileButtonProps {
41
41
  node: TreeNode;
42
42
  onShare: (node: TreeNode) => Promise<void>;
43
43
  }
44
44
  declare function ShareFileButton({ node, onShare }: IShareFileButtonProps): JSX.Element;
45
- export { CorsIssuePreview, DragDropZone, getNodeIcon, NoFileSelectedPreview, NoDataAvailablePreview, NotFoundPreview, renderUploadNodes, ShareFileButton, SIDEBAR_WIDTH_DEFAULT, SIDEBAR_WIDTH_STORAGE_KEY, SkeletonPreview, };
45
+ export { CorsIssuePreview, DragDropZone, getNodeIcon, NoDataAvailablePreview, NoFileSelectedPreview, NotFoundPreview, renderUploadNodes, ShareFileButton, SIDEBAR_WIDTH_DEFAULT, SIDEBAR_WIDTH_STORAGE_KEY, SkeletonPreview, };