@widgetic/workflows 0.2.11 → 0.2.12

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 (52) hide show
  1. package/dist/api/workflowsApi.d.ts +9 -1
  2. package/dist/api/workflowsApi.js +2 -1
  3. package/dist/assistant/assistantEvents.d.ts +42 -0
  4. package/dist/assistant/assistantEvents.js +61 -0
  5. package/dist/assistant/assistantRemoteChange.d.ts +4 -0
  6. package/dist/assistant/assistantRemoteChange.js +8 -0
  7. package/dist/assistant/assistantSaveMode.d.ts +5 -0
  8. package/dist/assistant/assistantSaveMode.js +8 -0
  9. package/dist/assistant/assistantStream.d.ts +8 -0
  10. package/dist/assistant/assistantStream.js +140 -0
  11. package/dist/assistant/assistantTranscript.d.ts +11 -0
  12. package/dist/assistant/assistantTranscript.js +18 -0
  13. package/dist/assistant/types.d.ts +81 -0
  14. package/dist/assistant/types.js +1 -0
  15. package/dist/assistant/workflowPlanViewModel.d.ts +48 -0
  16. package/dist/assistant/workflowPlanViewModel.js +17 -0
  17. package/dist/components/Workflows.svelte +3 -1
  18. package/dist/components/WorkflowsWorkspace.svelte +4 -0
  19. package/dist/components/WorkflowsWorkspace.svelte.d.ts +1 -0
  20. package/dist/components/assistant/WorkflowAssistantPanel.svelte +384 -0
  21. package/dist/components/assistant/WorkflowAssistantPanel.svelte.d.ts +8 -0
  22. package/dist/components/canvas/WorkflowCanvas.svelte +16 -6
  23. package/dist/components/canvas/WorkflowCanvas.svelte.d.ts +2 -2
  24. package/dist/components/editor/EditorCanvasArea.svelte +57 -2
  25. package/dist/components/editor/EditorCanvasArea.svelte.d.ts +8 -1
  26. package/dist/components/editor/EditorTabs.svelte +1 -2
  27. package/dist/components/editor/EditorTopBar.svelte +23 -1
  28. package/dist/components/editor/EditorTopBar.svelte.d.ts +3 -0
  29. package/dist/components/editor/WorkflowEditor.svelte +31 -3
  30. package/dist/components/editor/WorkflowEditor.svelte.d.ts +5 -0
  31. package/dist/components/editor/WorkflowNameControl.svelte +10 -0
  32. package/dist/components/list/WorkflowList.svelte +25 -1
  33. package/dist/components/list/WorkflowList.svelte.d.ts +2 -0
  34. package/dist/components/list/WorkflowRow.svelte +2 -0
  35. package/dist/components/panel/ConditionForm.svelte +7 -7
  36. package/dist/components/ui/Menu.svelte +31 -7
  37. package/dist/components/ui/Menu.svelte.d.ts +4 -0
  38. package/dist/drafts/draftJournal.d.ts +59 -0
  39. package/dist/drafts/draftJournal.js +261 -0
  40. package/dist/drafts/workflowDraft.d.ts +72 -0
  41. package/dist/drafts/workflowDraft.js +151 -0
  42. package/dist/drafts/workflowListViewState.d.ts +30 -0
  43. package/dist/drafts/workflowListViewState.js +92 -0
  44. package/dist/editor/editorState.svelte.d.ts +68 -2
  45. package/dist/editor/editorState.svelte.js +273 -0
  46. package/dist/editor/listState.svelte.d.ts +51 -2
  47. package/dist/editor/listState.svelte.js +210 -1
  48. package/dist/i18n/language.d.ts +3 -3
  49. package/dist/i18n/messages.d.ts +32 -0
  50. package/dist/i18n/messages.js +34 -1
  51. package/dist/types/index.d.ts +4 -0
  52. package/package.json +8 -1
@@ -509,5 +509,38 @@ export const WORKFLOWS_MESSAGES = {
509
509
  'workflows.issue.testBadField': 'A test of {block} reads a value its trigger does not carry.',
510
510
  'workflows.issue.testBadOperator': 'A test of {block} uses a comparison that does not fit its value.',
511
511
  'workflows.issue.testMissingValue': 'A test of {block} needs a value to compare with.',
512
- 'workflows.issue.fieldUnknown': 'A test of {block} reads {field}, which the composition no longer has.'
512
+ 'workflows.issue.fieldUnknown': 'A test of {block} reads {field}, which the composition no longer has.',
513
+ // ===== Workflows assistant (editor side panel) =====
514
+ 'workflows.assistant.title': 'Assistant',
515
+ 'workflows.assistant.newChat': 'New chat',
516
+ 'workflows.assistant.open': 'Open',
517
+ 'workflows.assistant.collapse': 'Collapse',
518
+ 'workflows.assistant.welcome': 'I can plan a workflow with you. Tell me what you want to build.',
519
+ 'workflows.assistant.emptyCanvas': 'Describe what you want to build, or ask for ideas.',
520
+ 'workflows.assistant.openAssistant': 'Open assistant',
521
+ 'workflows.assistant.toolbarButton': 'Assistant',
522
+ 'workflows.assistant.planNote': 'If this canvas is empty, we fill this workflow. If it already has blocks, we create a new workflow and leave this one as-is.',
523
+ 'workflows.assistant.chipIdeas': 'Give me ideas',
524
+ 'workflows.assistant.chipLeads': 'Capture leads',
525
+ 'workflows.assistant.submit': 'Submit',
526
+ 'workflows.assistant.estimate': 'About {number} credits',
527
+ 'workflows.assistant.createWorkflow': 'Create workflow',
528
+ 'workflows.assistant.notNow': 'Not now',
529
+ 'workflows.assistant.ready': 'Your workflow is ready.',
530
+ 'workflows.assistant.createdNew': 'I created a new workflow so your current one stays untouched.',
531
+ 'workflows.assistant.openInEditor': 'Open in editor',
532
+ 'workflows.assistant.attachFiles': 'Attach files',
533
+ 'workflows.assistant.libraryHint': 'Attached files are saved to your file library.',
534
+ 'workflows.assistant.composerPlaceholder': 'Describe the workflow you want',
535
+ 'workflows.assistant.send': 'Send',
536
+ 'workflows.assistant.answerSent': 'My answer',
537
+ 'workflows.assistant.stepWaiting': 'Waiting',
538
+ 'workflows.assistant.stepCreating': 'Creating',
539
+ 'workflows.assistant.stepDone': 'Done',
540
+ 'workflows.assistant.stepFailed': 'Failed',
541
+ 'workflows.assistant.retry': 'Retry',
542
+ 'workflows.assistant.retryMessage': 'Some steps did not finish. Please plan this again and reuse what was already built.',
543
+ 'workflows.assistant.buildNote': 'New widgets take a few minutes to build. Keep this panel open until the workflow is ready.',
544
+ 'workflows.assistant.errorRateLimited': 'That was a lot of messages at once. Try again in a minute.',
545
+ 'workflows.assistant.errorNotAvailable': 'The assistant is not available right now.'
513
546
  };
@@ -1,5 +1,7 @@
1
1
  import type { TextDirection } from '@widgetic/design-system/i18n';
2
2
  import type { AccessTokenFunction } from '../api/types.js';
3
+ import type { WorkflowAssistantConfig } from '../assistant/types.js';
4
+ export type { WorkflowAssistantConfig } from '../assistant/types.js';
3
5
  /** Why `onError` was called. */
4
6
  export type WorkflowsErrorCode =
5
7
  /** A part of the screen threw while it was being drawn. The screen shows "Try again" in its place. */
@@ -75,6 +77,8 @@ export interface WorkflowsProps {
75
77
  class?: string;
76
78
  /** Called when something goes wrong, once for each failure. See {@link WorkflowsError}. */
77
79
  onError?: (error: WorkflowsError) => void;
80
+ /** Optional workflows assistant endpoints and upload wiring; omitted disables the panel. */
81
+ assistant?: WorkflowAssistantConfig | null;
78
82
  /** For tests and previews: the `fetch` the screen asks the API with. The page's own `fetch` when left out. */
79
83
  fetchImplementation?: typeof fetch;
80
84
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widgetic/workflows",
3
- "version": "0.2.11",
3
+ "version": "0.2.12",
4
4
  "description": "Workflows for Widgetic: chain compositions together with filters that decide which composition an embed shows. One Svelte package that the Widgetic site, partners and Shopify all load.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -55,9 +55,15 @@
55
55
  "kaykay": "0.3.0"
56
56
  },
57
57
  "peerDependencies": {
58
+ "@widgetic/chat": ">=0.1.36",
58
59
  "@widgetic/design-system": ">=0.5.23",
59
60
  "svelte": "^5.25.6"
60
61
  },
62
+ "peerDependenciesMeta": {
63
+ "@widgetic/chat": {
64
+ "optional": true
65
+ }
66
+ },
61
67
  "devDependencies": {
62
68
  "@eslint/js": "^9.0.0",
63
69
  "@sveltejs/adapter-auto": "^3.0.0",
@@ -66,6 +72,7 @@
66
72
  "@sveltejs/vite-plugin-svelte": "^5.0.3",
67
73
  "@tailwindcss/postcss": "^4.1.4",
68
74
  "@types/node": "^26.4.1",
75
+ "@widgetic/chat": "^0.1.36",
69
76
  "@widgetic/design-system": "^0.5.23",
70
77
  "@widgetic/dev-tools": "^0.3.7",
71
78
  "eslint": "^9.0.0",