@omnidim-ai/mcp-server 0.13.1 → 0.15.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.
- package/build/doctor.js +1 -1
- package/build/doctor.js.map +1 -1
- package/build/index.d.ts +2 -2
- package/build/index.js +448 -29
- package/build/index.js.map +1 -1
- package/build/procedures.d.ts +9 -0
- package/build/procedures.js +234 -1
- package/build/procedures.js.map +1 -1
- package/build/setup.js +1 -1
- package/build/setup.js.map +1 -1
- package/build/tool-annotations.js +31 -1
- package/build/tool-annotations.js.map +1 -1
- package/build/workflow-canvas.d.ts +20 -0
- package/build/workflow-canvas.js +320 -0
- package/build/workflow-canvas.js.map +1 -0
- package/package.json +5 -5
- package/src/doctor.ts +1 -1
- package/src/index.ts +448 -29
- package/src/procedures.ts +236 -1
- package/src/setup.ts +1 -1
- package/src/tool-annotations.ts +31 -1
- package/src/workflow-canvas.ts +320 -0
package/src/procedures.ts
CHANGED
|
@@ -13,6 +13,8 @@ import {
|
|
|
13
13
|
ReadResourceRequestSchema,
|
|
14
14
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
15
15
|
|
|
16
|
+
import { WORKFLOW_CANVAS_HTML, WORKFLOW_CANVAS_URI } from "./workflow-canvas.js";
|
|
17
|
+
|
|
16
18
|
interface PromptArg { name: string; description: string; required?: boolean; }
|
|
17
19
|
interface PromptDef {
|
|
18
20
|
name: string;
|
|
@@ -386,6 +388,193 @@ the account.
|
|
|
386
388
|
- **The name is stable across a rename**, so it is safe for a user to store.
|
|
387
389
|
`;
|
|
388
390
|
|
|
391
|
+
const WORKFLOWS_GUIDE = `# Building workflows
|
|
392
|
+
|
|
393
|
+
A workflow is a graph: one trigger node, then action and flow nodes joined by
|
|
394
|
+
edges. It runs on OmniDimension's servers each time its trigger fires.
|
|
395
|
+
|
|
396
|
+
## The tools, in the order you use them
|
|
397
|
+
|
|
398
|
+
1. \`listWorkflowNodeTypes\` (with \`q\`, e.g. "whatsapp") to find node types.
|
|
399
|
+
2. \`getWorkflowNodeType\` (\`detail: minimal\`) for the fields one type needs.
|
|
400
|
+
Ask for \`detail: full\` only when you need the examples.
|
|
401
|
+
3. \`listWorkflowFieldOptions\` for any field of type \`ref\` (a number, an
|
|
402
|
+
integration, a template, an agent). Never guess an id. If it returns
|
|
403
|
+
\`no_options\`, ask the user for the value.
|
|
404
|
+
4. \`createWorkflow\` with a \`name\`. It starts with one node, \`trigger\`. You may
|
|
405
|
+
pass a complete first \`graph\` instead, in the same shape \`getWorkflow\`
|
|
406
|
+
returns under \`draft\` (node \`config\`, edges with \`from\`, \`to\`, \`handle\`).
|
|
407
|
+
5. \`editWorkflow\` with the \`revision\` from the last read and a list of \`ops\`.
|
|
408
|
+
6. \`validateWorkflow\`, then fix what it reports with another \`editWorkflow\`.
|
|
409
|
+
7. \`testWorkflow\` only after the user agrees (see "Test runs are real").
|
|
410
|
+
8. \`publishWorkflow\`. That makes the draft live and real events run it. You do not need \`activateWorkflow\` after it.
|
|
411
|
+
|
|
412
|
+
\`getWorkflow\` with \`view: structure\` shows nodes and edges without config.
|
|
413
|
+
Use it to orient in a large workflow. Use \`view: full\` before you edit config.
|
|
414
|
+
|
|
415
|
+
## Lifecycle
|
|
416
|
+
|
|
417
|
+
- You always edit the **draft**. A published workflow is never changed in place.
|
|
418
|
+
- \`publishWorkflow\` copies the draft to the live version and leaves a fresh draft
|
|
419
|
+
for the next round of edits. It refuses while \`validateWorkflow\` has errors.
|
|
420
|
+
- \`deactivateWorkflow\` pauses the live version. \`activateWorkflow\` resumes it. Use them only to
|
|
421
|
+
pause and resume, not to go live.
|
|
422
|
+
- Every edit needs the current \`revision\`. On \`409 revision_conflict\`, someone
|
|
423
|
+
(often the user in the dashboard) saved first. Call \`getWorkflow\` and retry.
|
|
424
|
+
|
|
425
|
+
## Do not break a workflow that is already running
|
|
426
|
+
|
|
427
|
+
Most harm comes from changing a workflow the user did not ask you to touch.
|
|
428
|
+
|
|
429
|
+
- Default to creating a NEW workflow. Edit an existing one only when the user names it.
|
|
430
|
+
- Call \`getWorkflow\` first and read what it does before any edit. Keep its \`revision\`.
|
|
431
|
+
- Your edits land on the draft and change nothing live until you publish.
|
|
432
|
+
- \`publishWorkflow\` overwrites the live version that real events run. \`deactivateWorkflow\` pauses automation the user depends on. \`deleteWorkflow\` stops it for good. Before any of these on an existing workflow, tell the user exactly what will change and get a yes.
|
|
433
|
+
- Never publish, activate, deactivate, delete or test a workflow as a side effect of another task.
|
|
434
|
+
|
|
435
|
+
## Entry: the trigger
|
|
436
|
+
|
|
437
|
+
Every workflow has exactly one trigger node. Its output is the event payload,
|
|
438
|
+
which later nodes read as \`{{ context.<trigger id>.<field> }}\`.
|
|
439
|
+
|
|
440
|
+
| Trigger type | Fires when | How it is attached |
|
|
441
|
+
|---|---|---|
|
|
442
|
+
| \`trigger\` | After a call (post-call), or on a POST to the webhook URL | Post-call: the agent's post-call actions point at this workflow. Webhook: \`update_node\` the trigger with \`config: { webhook_enabled: true }\`, then \`getWorkflow\` returns \`webhook_url\` |
|
|
443
|
+
| \`whatsapp_inbound\` | A WhatsApp message arrives | Its \`phone_number_id\` |
|
|
444
|
+
| \`twilio_sms_inbound\` | An SMS arrives | Its Twilio integration |
|
|
445
|
+
| \`email_event_trigger\` | A sent email is opened, clicked, replied to, or bounces | The source workflow or campaign |
|
|
446
|
+
| \`omnidim_crm_trigger\`, \`leadsquared_trigger\`, \`shopify_trigger\`, \`instantly_event_trigger\` | An event in that system | Its integration |
|
|
447
|
+
|
|
448
|
+
\`getWorkflowNodeType\` shows each trigger's \`output_example\`. The post-call
|
|
449
|
+
trigger carries \`customer_number\`, \`call_status\`, \`summary\`, \`sentiment\`,
|
|
450
|
+
\`extracted_variables\` and the transcript.
|
|
451
|
+
|
|
452
|
+
## Connecting nodes
|
|
453
|
+
|
|
454
|
+
An edge runs from one node's **output** to the next node. Plain nodes have one
|
|
455
|
+
output, \`default\`. Branching nodes have named outputs, and you must say which.
|
|
456
|
+
\`getWorkflowNodeType\` lists each type's outputs; this table is a summary:
|
|
457
|
+
|
|
458
|
+
| Node | Outputs |
|
|
459
|
+
|---|---|
|
|
460
|
+
| \`conditional\` | \`True\`, \`False\` |
|
|
461
|
+
| \`switch_condition\` | each case \`id\`, plus \`else\` |
|
|
462
|
+
| \`time_condition\` | \`Yes\`, \`No\` |
|
|
463
|
+
| \`photo_analyzer\` | \`pass\`, \`fail\` |
|
|
464
|
+
| \`voice_ai\` | \`Completed\`, \`Not Completed\` |
|
|
465
|
+
| \`zoho_bigin\` | \`Created\`, \`Found\`, \`Ambiguous\`, \`Failed\`, \`Success\` |
|
|
466
|
+
|
|
467
|
+
- One output can feed several nodes. They all run.
|
|
468
|
+
- \`add_node\` with \`after\` and \`handle\` places and connects a node in one step.
|
|
469
|
+
- To rewire, send \`disconnect\` and \`connect\` in the same batch.
|
|
470
|
+
- Every node except notes must be reachable from the trigger.
|
|
471
|
+
|
|
472
|
+
## Exit
|
|
473
|
+
|
|
474
|
+
There is no end node. A branch ends at a node with no outgoing edge, and the
|
|
475
|
+
run finishes when every branch has ended. \`wait\`, \`wait_for_time\`, \`voice_ai\`
|
|
476
|
+
and \`send_email\` pause the run and resume it later. \`sub_workflow\` starts
|
|
477
|
+
another workflow and continues at once. The target must be published and active, or the run fails
|
|
478
|
+
with "Target workflow has no published version".
|
|
479
|
+
|
|
480
|
+
## Passing data
|
|
481
|
+
|
|
482
|
+
\`{{ context.<node id>.<field> }}\` reads an earlier node's output. The engine
|
|
483
|
+
also provides \`{{ context.webhook }}\` (the trigger payload) and
|
|
484
|
+
\`{{ context.execution_link }}\`. Only nodes that run earlier have output. A
|
|
485
|
+
reference to a later node renders empty, and \`validateWorkflow\` warns about it.
|
|
486
|
+
|
|
487
|
+
Node ids appear in these references, so pick readable ones: \`check_interest\`,
|
|
488
|
+
\`wa_followup\`, \`notify_sales\`. Use lowercase letters, digits and underscores.
|
|
489
|
+
These names are taken: \`webhook\`, \`execution_id\`, \`execution_link\`, \`get\`,
|
|
490
|
+
\`items\`, \`keys\`, \`values\`.
|
|
491
|
+
|
|
492
|
+
Id fields (a number, template, integration, agent) always hold a literal id.
|
|
493
|
+
A \`{{ }}\` template there is refused, because it could resolve to a record in
|
|
494
|
+
another workspace.
|
|
495
|
+
|
|
496
|
+
## Moving things around
|
|
497
|
+
|
|
498
|
+
- \`move_node\` sets \`{x, y}\` on the dashboard canvas.
|
|
499
|
+
- \`add_node\` without a \`position\` lands to the right of its parent, below any
|
|
500
|
+
siblings, so the canvas stays readable for the user.
|
|
501
|
+
|
|
502
|
+
## Notes
|
|
503
|
+
|
|
504
|
+
A \`notes\` node holds \`note_text\` for people reading the canvas. It is never
|
|
505
|
+
connected and never runs. Add one that says what the workflow is for, so the
|
|
506
|
+
next person to open it in the dashboard understands it.
|
|
507
|
+
|
|
508
|
+
## Ops
|
|
509
|
+
|
|
510
|
+
| Op | Fields |
|
|
511
|
+
|---|---|
|
|
512
|
+
| \`add_node\` | \`id\`, \`type\`, \`config?\`, \`label?\`, \`position?\`, \`after?\`, \`handle?\` |
|
|
513
|
+
| \`update_node\` | \`id\`, \`config\` (merged; \`null\` removes a key), \`label?\` |
|
|
514
|
+
| \`move_node\` | \`id\`, \`position {x, y}\` |
|
|
515
|
+
| \`delete_node\` | \`id\` (its edges go too) |
|
|
516
|
+
| \`connect\` | \`from\`, \`to\`, \`handle?\` (default \`default\`) |
|
|
517
|
+
| \`disconnect\` | \`from\`, \`to\`, \`handle?\` |
|
|
518
|
+
|
|
519
|
+
A batch applies completely or not at all. A failing op returns
|
|
520
|
+
\`422 invalid_op\` with its \`op_index\`.
|
|
521
|
+
|
|
522
|
+
## Credentials
|
|
523
|
+
|
|
524
|
+
Never put secrets in config when an integration exists. Pick integrations,
|
|
525
|
+
numbers and templates from \`listWorkflowFieldOptions\`. Secret fields (a Slack
|
|
526
|
+
webhook URL, API headers) read back as \`********\`. Send \`********\` back
|
|
527
|
+
unchanged and the stored value is kept. If the user has no matching
|
|
528
|
+
integration, tell them to connect one in the dashboard first.
|
|
529
|
+
|
|
530
|
+
## Test runs are real
|
|
531
|
+
|
|
532
|
+
\`testWorkflow\` runs the draft once with your \`payload\` as the trigger data.
|
|
533
|
+
**Every node runs for real**: WhatsApp messages, SMS, emails and calls go out,
|
|
534
|
+
and CRM records change. Before you call it, tell the user what will happen and
|
|
535
|
+
get a yes. Use their own phone number or email in the payload.
|
|
536
|
+
|
|
537
|
+
\`testWorkflow\` is async. It returns 202 with an \`execution_id\`. Poll \`getWorkflowExecution\`
|
|
538
|
+
until \`state\` is \`completed\`, \`failed\` or \`cancelled\`, then read each node's status, output and error.
|
|
539
|
+
|
|
540
|
+
## Errors you will see
|
|
541
|
+
|
|
542
|
+
| Error | Meaning | What to do |
|
|
543
|
+
|---|---|---|
|
|
544
|
+
| \`422 validation_failed\` with \`not_found\` | An id is not in this workspace | Pick from \`listWorkflowFieldOptions\` |
|
|
545
|
+
| \`422 validation_failed\` on publish | Missing fields, an unconnected node, a bad handle | Fix each one, then publish again |
|
|
546
|
+
| \`422 invalid_op\` | An op is malformed | Fix the op at \`op_index\` |
|
|
547
|
+
| \`409 revision_conflict\` | The draft changed since you read it | \`getWorkflow\`, then retry |
|
|
548
|
+
| \`409 no_draft\` | The workflow has no draft to edit, test or publish | \`getWorkflow\`, then make an edit to start a new draft |
|
|
549
|
+
| \`400 no_options\` | The field holds an id from another system | Ask the user for the value |
|
|
550
|
+
| \`422\` with \`templated_ref\` | An id field holds a \`{{ }}\` template | Put a literal id from \`listWorkflowFieldOptions\` |
|
|
551
|
+
|
|
552
|
+
## Worked example
|
|
553
|
+
|
|
554
|
+
"After a call, if the lead is interested, send our follow-up WhatsApp template
|
|
555
|
+
and tell #sales in Slack."
|
|
556
|
+
|
|
557
|
+
1. \`createWorkflow { name: "Interested lead follow-up" }\` gives you \`trigger\`
|
|
558
|
+
and a \`revision\`.
|
|
559
|
+
2. \`listWorkflowFieldOptions\` for \`whatsapp.phone_number_id\`, then for
|
|
560
|
+
\`whatsapp.template_id\` with \`depends\` set to that number. Confirm both with
|
|
561
|
+
the user.
|
|
562
|
+
3. One \`editWorkflow\` batch:
|
|
563
|
+
- \`add_node { id: "check_interest", type: "conditional", after: "trigger",
|
|
564
|
+
config: { conditions: [{ variable: "{{ context.trigger.extracted_variables.interested }}",
|
|
565
|
+
operator: "==", value: "yes" }] } }\`
|
|
566
|
+
- \`add_node { id: "wa_followup", type: "whatsapp", after: "check_interest",
|
|
567
|
+
handle: "True", config: { phone_number_id: <id>, message_type: "template",
|
|
568
|
+
template_id: <id>, to_number: "{{ context.trigger.customer_number }}" } }\`
|
|
569
|
+
- \`add_node { id: "notify_sales", type: "slack", after: "wa_followup",
|
|
570
|
+
config: { slack_webhook_url: "<from the user>",
|
|
571
|
+
message: "Follow-up sent to {{ context.trigger.customer_number }}" } }\`
|
|
572
|
+
- \`add_node { id: "about", type: "notes", config: { note_text: "Follows up
|
|
573
|
+
interested leads after a call." } }\`
|
|
574
|
+
4. \`validateWorkflow\`, fix anything reported, then \`publishWorkflow\`.
|
|
575
|
+
5. Tell the user to point the agent's post-call action at this workflow.
|
|
576
|
+
`;
|
|
577
|
+
|
|
389
578
|
const RESOURCES: ResourceDef[] = [
|
|
390
579
|
{
|
|
391
580
|
uri: "omnidim://guide/routing",
|
|
@@ -436,9 +625,52 @@ const RESOURCES: ResourceDef[] = [
|
|
|
436
625
|
mimeType: "text/markdown",
|
|
437
626
|
text: VERSIONING_GUIDE,
|
|
438
627
|
},
|
|
628
|
+
{
|
|
629
|
+
uri: "omnidim://guide/workflows",
|
|
630
|
+
name: "Building workflows",
|
|
631
|
+
description: "How to build a workflow end to end: the tool order, lifecycle, triggers (entry), outputs and edges, exit, passing data, moving nodes, notes, ops, credentials, real test runs, errors, and a worked example.",
|
|
632
|
+
mimeType: "text/markdown",
|
|
633
|
+
text: WORKFLOWS_GUIDE,
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
uri: WORKFLOW_CANVAS_URI,
|
|
637
|
+
name: "Workflow canvas",
|
|
638
|
+
description: "Interactive view of a workflow draft, shown by clients that support MCP Apps.",
|
|
639
|
+
mimeType: "text/html;profile=mcp-app",
|
|
640
|
+
text: WORKFLOW_CANVAS_HTML,
|
|
641
|
+
},
|
|
439
642
|
];
|
|
440
643
|
|
|
441
644
|
const PROMPTS: PromptDef[] = [
|
|
645
|
+
{
|
|
646
|
+
name: "build_workflow",
|
|
647
|
+
description: "Build an automation workflow from a plain-language goal: pick the trigger and nodes, wire them, validate, test with the user's consent, then publish.",
|
|
648
|
+
arguments: [
|
|
649
|
+
{ name: "goal", description: "What should happen and when, in plain language (e.g. 'after a call, WhatsApp interested leads our follow-up template').", required: true },
|
|
650
|
+
],
|
|
651
|
+
build: (a) => {
|
|
652
|
+
const goal = a.goal || "(describe what should happen, and when)";
|
|
653
|
+
return `Build an OmniDimension workflow for this goal:
|
|
654
|
+
|
|
655
|
+
"${goal}"
|
|
656
|
+
|
|
657
|
+
Read the \`omnidim://guide/workflows\` resource first. It explains triggers, outputs, ops and errors.
|
|
658
|
+
|
|
659
|
+
1. Pick the trigger, then find each node type with \`listWorkflowNodeTypes\` and read its fields with
|
|
660
|
+
\`getWorkflowNodeType\`.
|
|
661
|
+
2. For every field that takes an id (a number, template, integration or agent), list real choices with
|
|
662
|
+
\`listWorkflowFieldOptions\` and confirm them with the user. Never guess an id.
|
|
663
|
+
3. \`createWorkflow\`, then build it with \`editWorkflow\` batches. Use readable node ids, wire branches with
|
|
664
|
+
\`after\` and \`handle\`, and add a notes node that says what the workflow is for.
|
|
665
|
+
4. \`validateWorkflow\` and fix every error.
|
|
666
|
+
5. A test run happens for real: messages, calls and CRM writes go out. Only call \`testWorkflow\` after the
|
|
667
|
+
user says yes, with their own phone number or email in the payload. Then poll \`getWorkflowExecution\` until \`state\` is \`completed\`, \`failed\` or \`cancelled\`.
|
|
668
|
+
6. Show the user the finished flow, then \`publishWorkflow\` when they approve.
|
|
669
|
+
7. Prefer creating a new workflow. Never publish, activate, deactivate, delete or test an existing workflow
|
|
670
|
+
without the user's explicit yes, after reading it first.
|
|
671
|
+
`;
|
|
672
|
+
},
|
|
673
|
+
},
|
|
442
674
|
{
|
|
443
675
|
name: "provision_agent",
|
|
444
676
|
description: "Create a working voice agent end to end: configure it, give it a number, and verify it can place a call and speak.",
|
|
@@ -631,6 +863,9 @@ export function getResourceText(uri: string): string | null {
|
|
|
631
863
|
}
|
|
632
864
|
export const PROMPT_NAMES = PROMPTS.map((p) => p.name);
|
|
633
865
|
export const RESOURCE_URIS = RESOURCES.map((r) => r.uri);
|
|
866
|
+
export function listResources(): Omit<ResourceDef, "text">[] {
|
|
867
|
+
return RESOURCES.map(({ uri, name, description, mimeType }) => ({ uri, name, description, mimeType }));
|
|
868
|
+
}
|
|
634
869
|
|
|
635
870
|
export function registerProcedures(server: Server): void {
|
|
636
871
|
server.setRequestHandler(ListPromptsRequestSchema, async () => ({
|
|
@@ -646,7 +881,7 @@ export function registerProcedures(server: Server): void {
|
|
|
646
881
|
};
|
|
647
882
|
});
|
|
648
883
|
server.setRequestHandler(ListResourcesRequestSchema, async () => ({
|
|
649
|
-
resources:
|
|
884
|
+
resources: listResources(),
|
|
650
885
|
}));
|
|
651
886
|
server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
|
652
887
|
const r = RESOURCES.find((x) => x.uri === request.params.uri);
|
package/src/setup.ts
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
type SetupKeyOutcome,
|
|
17
17
|
} from "./telemetry.js";
|
|
18
18
|
|
|
19
|
-
const PROD_API = "https://
|
|
19
|
+
const PROD_API = "https://omnidim.io/api/v1";
|
|
20
20
|
|
|
21
21
|
const dim = (s: string): string => `\x1b[2m${s}\x1b[0m`;
|
|
22
22
|
const italicDim = (s: string): string => `\x1b[2;3m${s}\x1b[0m`;
|
package/src/tool-annotations.ts
CHANGED
|
@@ -57,10 +57,37 @@ const TOOL_TITLES: Record<string, string> = {
|
|
|
57
57
|
searchPhoneNumbers: "Search available phone numbers",
|
|
58
58
|
purchasePhoneNumber: "Buy phone number",
|
|
59
59
|
releasePhoneNumber: "Release phone number",
|
|
60
|
+
getAccountBalance: "Get account balance",
|
|
61
|
+
listClonedVoices: "List cloned voices",
|
|
62
|
+
createClonedVoice: "Clone a voice",
|
|
63
|
+
getClonedVoice: "Get cloned voice",
|
|
64
|
+
updateClonedVoice: "Update cloned voice",
|
|
65
|
+
deleteClonedVoice: "Delete cloned voice",
|
|
66
|
+
getClonedVoiceSample: "Get cloned voice sample",
|
|
67
|
+
regenerateClonedVoiceSample: "Regenerate cloned voice sample",
|
|
68
|
+
listWorkflowNodeTypes: "List workflow node types",
|
|
69
|
+
getWorkflowNodeType: "Get workflow node type",
|
|
70
|
+
listWorkflowFieldOptions: "List choices for a workflow field",
|
|
71
|
+
listWorkflows: "List workflows",
|
|
72
|
+
createWorkflow: "Create workflow",
|
|
73
|
+
getWorkflow: "Get workflow",
|
|
74
|
+
editWorkflow: "Edit workflow draft",
|
|
75
|
+
deleteWorkflow: "Delete workflow",
|
|
76
|
+
validateWorkflow: "Validate workflow",
|
|
77
|
+
publishWorkflow: "Publish workflow",
|
|
78
|
+
activateWorkflow: "Turn workflow on",
|
|
79
|
+
deactivateWorkflow: "Turn workflow off",
|
|
80
|
+
testWorkflow: "Test workflow (runs for real)",
|
|
81
|
+
getWorkflowExecution: "Get workflow run",
|
|
82
|
+
listPostCallActions: "List post-call actions",
|
|
83
|
+
addPostCallAction: "Add a post-call action",
|
|
84
|
+
deletePostCallAction: "Delete a post-call action",
|
|
85
|
+
updatePostCallAction: "Update a post-call action",
|
|
86
|
+
listIntegrations: "List integrations",
|
|
60
87
|
};
|
|
61
88
|
|
|
62
89
|
// POST tools that only validate or preview, with no state change.
|
|
63
|
-
const READ_ONLY_TOOLS = new Set(["canUploadFile"]);
|
|
90
|
+
const READ_ONLY_TOOLS = new Set(["canUploadFile", "validateWorkflow"]);
|
|
64
91
|
|
|
65
92
|
// Irreversible removals, overwrites of live config, plus tools that place
|
|
66
93
|
// real outbound calls.
|
|
@@ -70,10 +97,13 @@ const DESTRUCTIVE_TOOLS = new Set([
|
|
|
70
97
|
"cancelBulkCall", "dispatchCall", "createBulkCall", "addBulkCallContact",
|
|
71
98
|
"addBulkCallContacts", "startBulkCall", "retryBulkCall",
|
|
72
99
|
"purchasePhoneNumber", "releasePhoneNumber",
|
|
100
|
+
"deleteClonedVoice", "deleteWorkflow", "publishWorkflow", "activateWorkflow",
|
|
101
|
+
"deactivateWorkflow", "testWorkflow", "deletePostCallAction",
|
|
73
102
|
]);
|
|
74
103
|
|
|
75
104
|
// Tools that reach the external phone network (a carrier, not just our API).
|
|
76
105
|
const OPEN_WORLD_TOOLS = new Set([
|
|
106
|
+
"testWorkflow",
|
|
77
107
|
"dispatchCall", "createBulkCall", "addBulkCallContact",
|
|
78
108
|
"addBulkCallContacts", "startBulkCall", "retryBulkCall",
|
|
79
109
|
"purchasePhoneNumber", "releasePhoneNumber",
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
// MCP Apps view (ui:// resource) that draws a workflow draft inside the chat.
|
|
2
|
+
// The page holds no API key: every read and edit goes back through this
|
|
3
|
+
// server's own tools via the host, so it runs on the user's existing login.
|
|
4
|
+
|
|
5
|
+
export const WORKFLOW_CANVAS_URI = "ui://omnidim/workflow-canvas";
|
|
6
|
+
|
|
7
|
+
const CANVAS_TOOLS = new Set(["getWorkflow", "createWorkflow", "editWorkflow"]);
|
|
8
|
+
|
|
9
|
+
export function toolMeta(name: string): { ui: { resourceUri: string } } | undefined {
|
|
10
|
+
return CANVAS_TOOLS.has(name) ? { ui: { resourceUri: WORKFLOW_CANVAS_URI } } : undefined;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface ToolResult { isError?: boolean; content?: Array<{ type: string; text?: string }>; }
|
|
14
|
+
|
|
15
|
+
// Embedded into the page with toString(), so it must not reference anything outside itself.
|
|
16
|
+
export function readWorkflow(result: ToolResult): { workflow: any; workflowId: number | null; error: string | null } {
|
|
17
|
+
const text = (result.content || []).filter((c) => c.type === "text").map((c) => c.text || "").join("\n");
|
|
18
|
+
if (result.isError) return { workflow: null, workflowId: null, error: text };
|
|
19
|
+
const body = text.startsWith("API Response") ? text.slice(text.indexOf("\n") + 1) : text;
|
|
20
|
+
let data: any;
|
|
21
|
+
try { data = JSON.parse(body); } catch { return { workflow: null, workflowId: null, error: text }; }
|
|
22
|
+
const wf = data && (data.workflow || data);
|
|
23
|
+
const id = wf && (wf.id ?? wf.workflow_id);
|
|
24
|
+
const workflowId = typeof id === "number" ? id : null;
|
|
25
|
+
return { workflow: wf && wf.draft ? wf : null, workflowId, error: null };
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const WORKFLOW_CANVAS_HTML = `<!doctype html>
|
|
29
|
+
<html lang="en">
|
|
30
|
+
<head>
|
|
31
|
+
<meta charset="utf-8">
|
|
32
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
33
|
+
<title>Workflow canvas</title>
|
|
34
|
+
<style>
|
|
35
|
+
:root {
|
|
36
|
+
--bg: #f7f6f2; --panel: #ffffff; --ink: #1d1c19; --muted: #6b675e; --line: #d9d5ca;
|
|
37
|
+
--edge: #9a9486; --grid: #e8e4da; --sel: #2f5bd3; --err: #b3261e;
|
|
38
|
+
--trigger: #2e7d4f; --logic: #b26a00; --voice: #6a3fb5; --msg: #0f7b74; --mail: #2f5bd3; --other: #5f5b52;
|
|
39
|
+
color-scheme: light;
|
|
40
|
+
}
|
|
41
|
+
:root[data-theme="dark"] {
|
|
42
|
+
--bg: #17161a; --panel: #211f25; --ink: #ecebe6; --muted: #a29e94; --line: #3a3741;
|
|
43
|
+
--edge: #7d7888; --grid: #24222a; --sel: #8aa8ff; --err: #ff8a80;
|
|
44
|
+
--trigger: #6fcf97; --logic: #f2b84b; --voice: #b49cf0; --msg: #5fd3c7; --mail: #8aa8ff; --other: #b0aba1;
|
|
45
|
+
color-scheme: dark;
|
|
46
|
+
}
|
|
47
|
+
* { box-sizing: border-box; }
|
|
48
|
+
body { margin: 0; font: 13px/1.4 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
|
|
49
|
+
header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
|
|
50
|
+
header h1 { font-size: 14px; margin: 0; font-weight: 600; flex: 1 1 200px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
51
|
+
.pill { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
|
|
52
|
+
button { font: inherit; font-size: 12px; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
|
|
53
|
+
button:hover { border-color: var(--edge); }
|
|
54
|
+
button:focus-visible { outline: 2px solid var(--sel); outline-offset: 1px; }
|
|
55
|
+
#stage { overflow: auto; background-color: var(--bg); background-image: radial-gradient(var(--grid) 1px, transparent 1px); background-size: 16px 16px; }
|
|
56
|
+
:root[data-mode="fullscreen"] #stage { max-height: none; height: calc(100vh - 160px); }
|
|
57
|
+
svg { display: block; touch-action: none; }
|
|
58
|
+
.node rect.card { fill: var(--panel); stroke: var(--line); stroke-width: 1; }
|
|
59
|
+
.node.selected rect.card { stroke: var(--sel); stroke-width: 2; }
|
|
60
|
+
.node { cursor: grab; }
|
|
61
|
+
.node.dragging { cursor: grabbing; opacity: .85; }
|
|
62
|
+
.node .label { font-size: 13px; font-weight: 600; fill: var(--ink); }
|
|
63
|
+
.node .type { font-size: 11px; fill: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
|
|
64
|
+
.edge { fill: none; stroke: var(--edge); stroke-width: 1.5; }
|
|
65
|
+
.handle-label { font-size: 11px; fill: var(--muted); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; }
|
|
66
|
+
#detail { padding: 10px 12px; border-top: 1px solid var(--line); min-height: 44px; }
|
|
67
|
+
#detail .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
|
|
68
|
+
#detail pre { margin: 8px 0 0; padding: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; max-height: 180px; overflow: auto; font-size: 11px; }
|
|
69
|
+
.muted { color: var(--muted); }
|
|
70
|
+
#status { font-size: 12px; color: var(--muted); }
|
|
71
|
+
#status.error { color: var(--err); }
|
|
72
|
+
</style>
|
|
73
|
+
</head>
|
|
74
|
+
<body>
|
|
75
|
+
<header>
|
|
76
|
+
<h1 id="title">Loading workflow</h1>
|
|
77
|
+
<span class="pill" id="state" hidden></span>
|
|
78
|
+
<button id="refresh" type="button">Refresh</button>
|
|
79
|
+
<button id="full" type="button">Full screen</button>
|
|
80
|
+
<button id="open" type="button">Open in dashboard</button>
|
|
81
|
+
</header>
|
|
82
|
+
<div id="stage"><svg id="canvas" role="img" aria-label="Workflow graph"></svg></div>
|
|
83
|
+
<div id="detail">
|
|
84
|
+
<div id="status">Waiting for the workflow.</div>
|
|
85
|
+
<div id="node" hidden>
|
|
86
|
+
<div class="row"><strong id="n-label"></strong><span class="pill" id="n-type"></span><span class="muted" id="n-id"></span>
|
|
87
|
+
<button id="ask" type="button">Ask Claude about this node</button></div>
|
|
88
|
+
<pre id="n-config"></pre>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
<script>
|
|
92
|
+
const readWorkflow = ${readWorkflow.toString()};
|
|
93
|
+
const NODE_W = 210, NODE_H = 58, PAD = 40, MIN_SCALE = 0.45;
|
|
94
|
+
const SVG_NS = "http://www.w3.org/2000/svg";
|
|
95
|
+
const $ = (id) => document.getElementById(id);
|
|
96
|
+
const state = { wf: null, id: null, selected: null, busy: false };
|
|
97
|
+
|
|
98
|
+
// JSON-RPC over postMessage to the host (MCP Apps protocol 2026-01-26).
|
|
99
|
+
let nextId = 1;
|
|
100
|
+
const pending = new Map();
|
|
101
|
+
function send(msg) { window.parent.postMessage(Object.assign({ jsonrpc: "2.0" }, msg), "*"); }
|
|
102
|
+
function request(method, params) {
|
|
103
|
+
const id = nextId++;
|
|
104
|
+
send({ id, method, params });
|
|
105
|
+
return new Promise((resolve, reject) => pending.set(id, { resolve, reject }));
|
|
106
|
+
}
|
|
107
|
+
function notify(method, params) { send({ method, params }); }
|
|
108
|
+
|
|
109
|
+
window.addEventListener("message", (event) => {
|
|
110
|
+
if (event.source !== window.parent) return;
|
|
111
|
+
const msg = event.data;
|
|
112
|
+
if (!msg || msg.jsonrpc !== "2.0") return;
|
|
113
|
+
if (msg.id !== undefined && pending.has(msg.id) && !msg.method) {
|
|
114
|
+
const p = pending.get(msg.id); pending.delete(msg.id);
|
|
115
|
+
msg.error ? p.reject(new Error(msg.error.message || "Request failed")) : p.resolve(msg.result);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if (msg.method === "ui/notifications/tool-input") {
|
|
119
|
+
const id = msg.params && msg.params.arguments && msg.params.arguments.workflow_id;
|
|
120
|
+
if (typeof id === "number") state.id = id;
|
|
121
|
+
} else if (msg.method === "ui/notifications/tool-result") {
|
|
122
|
+
applyResult(msg.params);
|
|
123
|
+
} else if (msg.method === "ui/notifications/host-context-changed") {
|
|
124
|
+
applyContext(msg.params);
|
|
125
|
+
} else if (msg.method === "ui/resource-teardown" && msg.id !== undefined) {
|
|
126
|
+
send({ id: msg.id, result: {} });
|
|
127
|
+
} else if (msg.id !== undefined && msg.method) {
|
|
128
|
+
send({ id: msg.id, error: { code: -32601, message: "Method not found" } });
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
function applyContext(ctx) {
|
|
133
|
+
if (!ctx) return;
|
|
134
|
+
if (ctx.theme) document.documentElement.dataset.theme = ctx.theme;
|
|
135
|
+
if (ctx.displayMode) document.documentElement.dataset.mode = ctx.displayMode;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function setStatus(text, isError) {
|
|
139
|
+
$("status").textContent = text;
|
|
140
|
+
$("status").className = isError ? "error" : "";
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
async function callTool(name, args) {
|
|
144
|
+
return request("tools/call", { name, arguments: args });
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
async function refresh() {
|
|
148
|
+
if (state.id == null || state.busy) return;
|
|
149
|
+
state.busy = true; setStatus("Loading the latest draft.");
|
|
150
|
+
try { applyResult(await callTool("getWorkflow", { workflow_id: state.id })); }
|
|
151
|
+
catch (e) { setStatus("Could not load the workflow: " + e.message, true); }
|
|
152
|
+
finally { state.busy = false; }
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function applyResult(result) {
|
|
156
|
+
const r = readWorkflow(result || {});
|
|
157
|
+
if (r.error) { setStatus(r.error, true); return; }
|
|
158
|
+
if (r.workflowId != null) state.id = r.workflowId;
|
|
159
|
+
if (!r.workflow) { refresh(); return; }
|
|
160
|
+
state.wf = r.workflow;
|
|
161
|
+
render();
|
|
162
|
+
setStatus("Drag a node to move it. Select a node to see its settings.");
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function accent(type) {
|
|
166
|
+
if (type === "trigger" || type.endsWith("_trigger")) return "var(--trigger)";
|
|
167
|
+
if (type.endsWith("_condition") || type === "switch" || type === "delay" || type === "code") return "var(--logic)";
|
|
168
|
+
if (type.startsWith("voice")) return "var(--voice)";
|
|
169
|
+
if (type.includes("whatsapp") || type.includes("sms")) return "var(--msg)";
|
|
170
|
+
if (type.includes("email")) return "var(--mail)";
|
|
171
|
+
return "var(--other)";
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function el(tag, attrs, text) {
|
|
175
|
+
const e = document.createElementNS(SVG_NS, tag);
|
|
176
|
+
for (const k in attrs) e.setAttribute(k, attrs[k]);
|
|
177
|
+
if (text != null) e.textContent = text;
|
|
178
|
+
return e;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function clip(s, n) { return s.length > n ? s.slice(0, n - 1) + "\\u2026" : s; }
|
|
182
|
+
|
|
183
|
+
function render() {
|
|
184
|
+
const wf = state.wf, draft = wf.draft, svg = $("canvas");
|
|
185
|
+
$("title").textContent = wf.name || "Workflow " + wf.id;
|
|
186
|
+
$("state").hidden = false;
|
|
187
|
+
$("state").textContent = (wf.status || "draft") + " \\u00b7 " + draft.nodes.length + " nodes";
|
|
188
|
+
const pos = {};
|
|
189
|
+
draft.nodes.forEach((n, i) => { pos[n.id] = n.position || { x: i * 260, y: 0 }; });
|
|
190
|
+
const xs = Object.values(pos).map((p) => p.x), ys = Object.values(pos).map((p) => p.y);
|
|
191
|
+
const minX = Math.min(...xs, 0) - PAD, minY = Math.min(...ys, 0) - PAD;
|
|
192
|
+
const w = Math.max(...xs, 0) + NODE_W + PAD - minX, h = Math.max(...ys, 0) + NODE_H + PAD - minY;
|
|
193
|
+
const avail = $("stage").clientWidth || 600;
|
|
194
|
+
const scale = Math.max(MIN_SCALE, Math.min(1, avail / w));
|
|
195
|
+
svg.setAttribute("viewBox", minX + " " + minY + " " + w + " " + h);
|
|
196
|
+
svg.setAttribute("width", Math.round(w * scale));
|
|
197
|
+
svg.setAttribute("height", Math.round(h * scale));
|
|
198
|
+
svg.replaceChildren();
|
|
199
|
+
|
|
200
|
+
const edges = el("g", {});
|
|
201
|
+
for (const e of draft.edges) {
|
|
202
|
+
const a = pos[e.from], b = pos[e.to];
|
|
203
|
+
if (!a || !b) continue;
|
|
204
|
+
const x1 = a.x + NODE_W, y1 = a.y + NODE_H / 2, x2 = b.x, y2 = b.y + NODE_H / 2, dx = Math.max(40, (x2 - x1) / 2);
|
|
205
|
+
edges.append(el("path", { class: "edge", d: "M" + x1 + "," + y1 + " C" + (x1 + dx) + "," + y1 + " " + (x2 - dx) + "," + y2 + " " + x2 + "," + y2, "marker-end": "url(#arrow)" }));
|
|
206
|
+
if (e.handle && e.handle !== "default") {
|
|
207
|
+
edges.append(el("text", { class: "handle-label", x: x2 - 8, y: y2 - 8, "text-anchor": "end" }, e.handle));
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
const defs = el("defs", {});
|
|
211
|
+
const marker = el("marker", { id: "arrow", viewBox: "0 0 10 10", refX: "9", refY: "5", markerWidth: "7", markerHeight: "7", orient: "auto-start-reverse" });
|
|
212
|
+
marker.append(el("path", { d: "M0,0 L10,5 L0,10 z", fill: "var(--edge)" }));
|
|
213
|
+
defs.append(marker);
|
|
214
|
+
svg.append(defs, edges);
|
|
215
|
+
|
|
216
|
+
for (const n of draft.nodes) {
|
|
217
|
+
const p = pos[n.id];
|
|
218
|
+
const g = el("g", { class: "node" + (state.selected === n.id ? " selected" : ""), transform: "translate(" + p.x + "," + p.y + ")", tabindex: "0", role: "button", "aria-label": (n.label || n.id) + ", " + n.type });
|
|
219
|
+
g.append(el("rect", { class: "card", width: NODE_W, height: NODE_H, rx: 8 }));
|
|
220
|
+
g.append(el("rect", { width: 4, height: NODE_H - 16, x: 0, y: 8, rx: 2, fill: accent(n.type) }));
|
|
221
|
+
g.append(el("text", { class: "label", x: 14, y: 24 }, clip(n.label || n.id, 26)));
|
|
222
|
+
g.append(el("text", { class: "type", x: 14, y: 43 }, clip(n.type, 30)));
|
|
223
|
+
g.addEventListener("pointerdown", (ev) => startDrag(ev, n, g, p));
|
|
224
|
+
g.addEventListener("keydown", (ev) => { if (ev.key === "Enter" || ev.key === " ") { ev.preventDefault(); select(n.id); } });
|
|
225
|
+
svg.append(g);
|
|
226
|
+
}
|
|
227
|
+
if (state.selected) showNode(draft.nodes.find((n) => n.id === state.selected));
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
function toSvg(ev) {
|
|
231
|
+
const svg = $("canvas"), pt = svg.createSVGPoint();
|
|
232
|
+
pt.x = ev.clientX; pt.y = ev.clientY;
|
|
233
|
+
return pt.matrixTransform(svg.getScreenCTM().inverse());
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function startDrag(ev, node, g, p) {
|
|
237
|
+
if (state.busy) return;
|
|
238
|
+
const start = toSvg(ev), origin = { x: p.x, y: p.y };
|
|
239
|
+
let moved = false;
|
|
240
|
+
g.setPointerCapture(ev.pointerId);
|
|
241
|
+
const move = (e) => {
|
|
242
|
+
const cur = toSvg(e), dx = cur.x - start.x, dy = cur.y - start.y;
|
|
243
|
+
if (!moved && Math.hypot(dx, dy) < 4) return;
|
|
244
|
+
moved = true; g.classList.add("dragging");
|
|
245
|
+
p.x = Math.round(origin.x + dx); p.y = Math.round(origin.y + dy);
|
|
246
|
+
g.setAttribute("transform", "translate(" + p.x + "," + p.y + ")");
|
|
247
|
+
};
|
|
248
|
+
const up = () => {
|
|
249
|
+
g.removeEventListener("pointermove", move);
|
|
250
|
+
g.removeEventListener("pointerup", up);
|
|
251
|
+
g.classList.remove("dragging");
|
|
252
|
+
if (!moved) { select(node.id); return; }
|
|
253
|
+
saveMove(node, { x: p.x, y: p.y }, origin);
|
|
254
|
+
};
|
|
255
|
+
g.addEventListener("pointermove", move);
|
|
256
|
+
g.addEventListener("pointerup", up);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
async function saveMove(node, position, origin) {
|
|
260
|
+
state.busy = true; setStatus("Saving the new position.");
|
|
261
|
+
try {
|
|
262
|
+
const res = await callTool("editWorkflow", { workflow_id: state.id, requestBody: { revision: state.wf.draft.revision, ops: [{ op: "move_node", id: node.id, position }] } });
|
|
263
|
+
const r = readWorkflow(res || {});
|
|
264
|
+
if (r.error) throw new Error(r.error);
|
|
265
|
+
node.position = position;
|
|
266
|
+
notify("ui/update-model-context", { content: [{ type: "text", text: "The user moved node \\"" + node.id + "\\" on workflow " + state.id + " in the canvas. Call getWorkflow for the new revision before your next edit." }] });
|
|
267
|
+
} catch (e) {
|
|
268
|
+
node.position = origin;
|
|
269
|
+
setStatus("Not saved: " + e.message, true);
|
|
270
|
+
state.busy = false; render(); return;
|
|
271
|
+
}
|
|
272
|
+
state.busy = false;
|
|
273
|
+
await refresh();
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
function select(id) {
|
|
277
|
+
state.selected = id;
|
|
278
|
+
render();
|
|
279
|
+
const n = state.wf.draft.nodes.find((x) => x.id === id);
|
|
280
|
+
notify("ui/update-model-context", { content: [{ type: "text", text: "In the workflow canvas the user selected node \\"" + id + "\\" (" + n.type + ") on workflow " + state.id + "." }] });
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
function showNode(n) {
|
|
284
|
+
if (!n) { $("node").hidden = true; return; }
|
|
285
|
+
$("node").hidden = false;
|
|
286
|
+
$("n-label").textContent = n.label || n.id;
|
|
287
|
+
$("n-type").textContent = n.type;
|
|
288
|
+
$("n-id").textContent = "id " + n.id;
|
|
289
|
+
$("n-config").textContent = n.config ? JSON.stringify(n.config, null, 2) : "Settings are not loaded in this view.";
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
$("refresh").addEventListener("click", refresh);
|
|
293
|
+
$("full").addEventListener("click", async () => {
|
|
294
|
+
const mode = document.documentElement.dataset.mode === "fullscreen" ? "inline" : "fullscreen";
|
|
295
|
+
try { const r = await request("ui/request-display-mode", { mode }); applyContext({ displayMode: r && r.mode }); render(); }
|
|
296
|
+
catch (e) { setStatus("This app cannot change size: " + e.message, true); }
|
|
297
|
+
});
|
|
298
|
+
$("open").addEventListener("click", () => {
|
|
299
|
+
if (state.id != null) request("ui/open-link", { url: "https://omnidim.io/workflow/" + state.id }).catch(() => {});
|
|
300
|
+
});
|
|
301
|
+
$("ask").addEventListener("click", () => {
|
|
302
|
+
const n = state.wf && state.wf.draft.nodes.find((x) => x.id === state.selected);
|
|
303
|
+
if (!n) return;
|
|
304
|
+
request("ui/message", { role: "user", content: [{ type: "text", text: "In workflow " + state.id + ", explain the \\"" + (n.label || n.id) + "\\" node (id " + n.id + ", " + n.type + ") and check its settings for problems." }] }).catch((e) => setStatus(e.message, true));
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
new ResizeObserver(() => notify("ui/notifications/size-changed", { width: document.documentElement.scrollWidth, height: document.documentElement.scrollHeight })).observe(document.body);
|
|
308
|
+
|
|
309
|
+
request("ui/initialize", {
|
|
310
|
+
protocolVersion: "2026-01-26",
|
|
311
|
+
appInfo: { name: "omnidim-workflow-canvas", version: "0.1.0" },
|
|
312
|
+
appCapabilities: { availableDisplayModes: ["inline", "fullscreen"] },
|
|
313
|
+
}).then((r) => {
|
|
314
|
+
applyContext(r && r.hostContext);
|
|
315
|
+
notify("ui/notifications/initialized", {});
|
|
316
|
+
}).catch((e) => setStatus("The host did not accept the view: " + e.message, true));
|
|
317
|
+
</script>
|
|
318
|
+
</body>
|
|
319
|
+
</html>
|
|
320
|
+
`;
|