@culvii/cli 0.0.7 → 0.0.9

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 (101) hide show
  1. package/COMMANDS.md +5 -5
  2. package/README.md +15 -6
  3. package/USAGE.md +11 -10
  4. package/dist/DeployView-D4UEXMDJ.js +2 -0
  5. package/dist/DevView-GPKSSOLA.js +2 -0
  6. package/dist/EnvView-3ZURMIZS.js +2 -0
  7. package/dist/{HelpView-YLCEPIFY.js → HelpView-PELQJJQQ.js} +1 -1
  8. package/dist/WhoamiView-TKSYSHQ2.js +2 -0
  9. package/dist/{WorkspaceView-RNFALIPM.js → WorkspaceView-ID7ZMBHV.js} +1 -1
  10. package/dist/{chunk-IRZMWFC3.js → chunk-KM7ZWOEG.js} +1 -1
  11. package/dist/index.js +31 -681
  12. package/dist/lib/evaluator.js +2 -2
  13. package/dist/login-3OMS75QL.js +39 -0
  14. package/dist/{logout-TDZA462P.js → logout-ZYTERDYA.js} +1 -1
  15. package/dist/skill-bundle-Z4FQO3CQ.js +2553 -0
  16. package/package.json +9 -5
  17. package/skills/culvii/.culvii-skill.json +90 -0
  18. package/skills/culvii/SKILL.md +104 -0
  19. package/skills/culvii/agents/openai.yaml +4 -0
  20. package/skills/culvii/examples/agent-workflow.culvii.ts +47 -0
  21. package/skills/culvii/examples/binary-document-workflow.culvii.ts +80 -0
  22. package/skills/culvii/examples/complete-workflow.culvii.ts +81 -0
  23. package/skills/culvii/examples/custom-output-surface.culvii.ts +69 -0
  24. package/skills/culvii/examples/custom-wait-surface.culvii.ts +90 -0
  25. package/skills/culvii/examples/human-in-the-loop-workflow.culvii.ts +125 -0
  26. package/skills/culvii/examples/integration-agent-workflow.culvii.ts +101 -0
  27. package/skills/culvii/examples/multi-agent-workflow-tools.culvii.ts +157 -0
  28. package/skills/culvii/examples/nested-agent-workflow.culvii.ts +108 -0
  29. package/skills/culvii/examples/output-surface.culvii.ts +45 -0
  30. package/skills/culvii/examples/wait-surface.culvii.ts +24 -0
  31. package/skills/culvii/references/agents.md +77 -0
  32. package/skills/culvii/references/authoring-files.md +21 -0
  33. package/skills/culvii/references/cli-guide.md +22 -0
  34. package/skills/culvii/references/cli-reference.md +217 -0
  35. package/skills/culvii/references/feedback-cycle.md +43 -0
  36. package/skills/culvii/references/integrations.md +13 -0
  37. package/skills/culvii/references/kit-api.md +35 -0
  38. package/skills/culvii/references/node-argocd.md +44 -0
  39. package/skills/culvii/references/node-clickup-doc.md +38 -0
  40. package/skills/culvii/references/node-clickup-ticket.md +47 -0
  41. package/skills/culvii/references/node-core-agent.md +27 -0
  42. package/skills/culvii/references/node-core-browser-automation.md +53 -0
  43. package/skills/culvii/references/node-core-code.md +28 -0
  44. package/skills/culvii/references/node-core-http.md +42 -0
  45. package/skills/culvii/references/node-core-if.md +26 -0
  46. package/skills/culvii/references/node-core-jwt.md +31 -0
  47. package/skills/culvii/references/node-core-loop-break.md +26 -0
  48. package/skills/culvii/references/node-core-loop-continue.md +26 -0
  49. package/skills/culvii/references/node-core-loop-output.md +24 -0
  50. package/skills/culvii/references/node-core-loop.md +25 -0
  51. package/skills/culvii/references/node-core-merge.md +23 -0
  52. package/skills/culvii/references/node-core-set.md +24 -0
  53. package/skills/culvii/references/node-core-switch.md +24 -0
  54. package/skills/culvii/references/node-cost-explorer.md +45 -0
  55. package/skills/culvii/references/node-cron-trigger.md +25 -0
  56. package/skills/culvii/references/node-elasticsearch.md +39 -0
  57. package/skills/culvii/references/node-github-poll-trigger.md +31 -0
  58. package/skills/culvii/references/node-github-webhook-trigger.md +27 -0
  59. package/skills/culvii/references/node-github.md +251 -0
  60. package/skills/culvii/references/node-gmail-trigger.md +44 -0
  61. package/skills/culvii/references/node-gmail.md +57 -0
  62. package/skills/culvii/references/node-google-calendar.md +51 -0
  63. package/skills/culvii/references/node-google-docs.md +46 -0
  64. package/skills/culvii/references/node-grafana-dashboard.md +38 -0
  65. package/skills/culvii/references/node-grafana-data-source.md +42 -0
  66. package/skills/culvii/references/node-grafana-query.md +34 -0
  67. package/skills/culvii/references/node-hibp-list-domains.md +27 -0
  68. package/skills/culvii/references/node-hibp-stealer-logs.md +30 -0
  69. package/skills/culvii/references/node-kubernetes.md +51 -0
  70. package/skills/culvii/references/node-manual-trigger.md +24 -0
  71. package/skills/culvii/references/node-microsoft-outlook-trigger.md +41 -0
  72. package/skills/culvii/references/node-microsoft-outlook.md +56 -0
  73. package/skills/culvii/references/node-microsoft-sharepoint.md +40 -0
  74. package/skills/culvii/references/node-onionsearch.md +27 -0
  75. package/skills/culvii/references/node-prometheus.md +40 -0
  76. package/skills/culvii/references/node-s3.md +40 -0
  77. package/skills/culvii/references/node-slack-events-trigger.md +37 -0
  78. package/skills/culvii/references/node-slack-interactions-trigger.md +28 -0
  79. package/skills/culvii/references/node-slack-trigger.md +40 -0
  80. package/skills/culvii/references/node-slack.md +162 -0
  81. package/skills/culvii/references/node-supabase.md +61 -0
  82. package/skills/culvii/references/node-twilio.md +39 -0
  83. package/skills/culvii/references/node-wait-timer.md +24 -0
  84. package/skills/culvii/references/node-webhook-trigger.md +24 -0
  85. package/skills/culvii/references/nodes-index.md +51 -0
  86. package/skills/culvii/references/runtime-values.md +36 -0
  87. package/skills/culvii/references/surface-authoring.md +38 -0
  88. package/skills/culvii/references/surface-display.md +390 -0
  89. package/skills/culvii/references/surface-feedback.md +38 -0
  90. package/skills/culvii/references/surface-input-actions.md +143 -0
  91. package/skills/culvii/references/surface-layout.md +97 -0
  92. package/skills/culvii/references/validation.md +18 -0
  93. package/skills/culvii/references/workflows.md +30 -0
  94. package/dist/DeployView-GEJNL26A.js +0 -2
  95. package/dist/DevView-SOPAMSZ4.js +0 -2
  96. package/dist/EnvView-MCZC2NBO.js +0 -2
  97. package/dist/WhoamiView-67HV2L5J.js +0 -2
  98. package/dist/chunk-MPKGJC7N.js +0 -2
  99. package/dist/login-G5QUR55L.js +0 -36
  100. /package/dist/{chunk-5NBKYMD7.js → chunk-56C3DFV2.js} +0 -0
  101. /package/dist/{chunk-JFIFRAAR.js → chunk-RS5GDTRN.js} +0 -0
@@ -0,0 +1,125 @@
1
+ import {
2
+ MultiAgentEngine,
3
+ Step,
4
+ Workflow,
5
+ createAgentModelConfigFromRef,
6
+ defineWorkflowTool,
7
+ } from '@culvii/kit';
8
+
9
+ const MODEL = createAgentModelConfigFromRef('openai/gpt-4.1', 'credential-id');
10
+
11
+ function createApprovalToolWorkflow() {
12
+ const trigger = new Step({ id: 'trigger', name: 'Manual Trigger', type: 'manualTrigger' });
13
+ const approval = new Step({
14
+ id: 'approval',
15
+ name: 'Approval',
16
+ type: 'core.set',
17
+ params: {
18
+ values: { stage: 'awaiting-review', amount: 1500 },
19
+ // A resume request continues from this node.
20
+ pauseAfterExecution: true,
21
+ },
22
+ });
23
+ trigger.connectTo(approval);
24
+ return new Workflow({
25
+ id: 'discount-approval-workflow',
26
+ name: 'Discount Approval Workflow',
27
+ steps: [trigger, approval],
28
+ });
29
+ }
30
+
31
+ function createAccountLookupWorkflow() {
32
+ const trigger = new Step({ id: 'trigger', name: 'Manual Trigger', type: 'manualTrigger' });
33
+ const account = new Step({
34
+ id: 'account',
35
+ name: 'Account',
36
+ type: 'core.set',
37
+ params: { values: { plan: 'Enterprise', seats: 250 } },
38
+ });
39
+ trigger.connectTo(account);
40
+ return new Workflow({
41
+ id: 'account-lookup-workflow',
42
+ name: 'Account Lookup Workflow',
43
+ steps: [trigger, account],
44
+ });
45
+ }
46
+
47
+ function createConciergeAgent() {
48
+ return new MultiAgentEngine({
49
+ id: 'discount-concierge',
50
+ name: 'Discount Concierge',
51
+ role: 'primary',
52
+ description: 'Looks up an account and requests approval before offering a discount.',
53
+ systemPrompt:
54
+ 'Call lookup_account first. If a discount is requested, call request_approval and wait for its human decision before answering.',
55
+ model: MODEL,
56
+ metadata: {
57
+ runtimeDetails: {
58
+ sandboxProfile: 'default',
59
+ },
60
+ },
61
+ permissions: { default: { '*': 'ask', read_file: 'approve', delete_file: 'deny' } },
62
+ tools: {
63
+ lookup_account: defineWorkflowTool({
64
+ name: 'lookup_account',
65
+ description: 'Looks up account context.',
66
+ workflowId: 'account-lookup-workflow',
67
+ inputSchema: { type: 'object', properties: { account: { type: 'string' } } },
68
+ }),
69
+ request_approval: defineWorkflowTool({
70
+ name: 'request_approval',
71
+ description: 'Pauses for a human approval decision.',
72
+ workflowId: 'discount-approval-workflow',
73
+ inputSchema: { type: 'object', properties: { request: { type: 'string' } } },
74
+ }),
75
+ },
76
+ secondaryAgents: [],
77
+ });
78
+ }
79
+
80
+ function createWorkflow() {
81
+ const trigger = new Step({ id: 'trigger', name: 'Manual Trigger', type: 'manualTrigger' });
82
+ const request = new Step({
83
+ id: 'request',
84
+ name: 'Request',
85
+ type: 'core.set',
86
+ params: { values: { customer: 'Acme Corp', request: 'Approve a renewal discount.' } },
87
+ });
88
+ const concierge = new Step({
89
+ id: 'concierge',
90
+ name: 'Concierge Agent',
91
+ type: 'core.agent',
92
+ params: {
93
+ agentReferenceKey: 'discount-concierge',
94
+ prompt: "Handle the request for {{ $('Request').json.customer }}.",
95
+ autoCloseSession: true,
96
+ },
97
+ });
98
+ const managerReview = new Step({
99
+ id: 'manager-review',
100
+ name: 'Manager Review',
101
+ type: 'core.set',
102
+ params: { values: { status: 'pending' }, pauseAfterExecution: true },
103
+ });
104
+ const persist = new Step({
105
+ id: 'persist',
106
+ name: 'Persist Decision',
107
+ type: 'core.set',
108
+ params: { values: { response: "={{ $('Concierge Agent').json.response }}" } },
109
+ });
110
+
111
+ trigger.connectTo(request);
112
+ request.connectTo(concierge);
113
+ concierge.connectTo(managerReview);
114
+ managerReview.connectTo(persist);
115
+ return new Workflow({
116
+ id: 'discount-request-workflow',
117
+ name: 'Discount Request Workflow',
118
+ steps: [trigger, request, concierge, managerReview, persist],
119
+ });
120
+ }
121
+
122
+ createApprovalToolWorkflow();
123
+ createAccountLookupWorkflow();
124
+ createConciergeAgent();
125
+ createWorkflow();
@@ -0,0 +1,101 @@
1
+ import { MultiAgentEngine, Step, Workflow, createAgentModelConfigFromRef } from '@culvii/kit';
2
+
3
+ // Resolve both credentials through the integration picker before running dev.
4
+ const MODEL = createAgentModelConfigFromRef(
5
+ 'google-vertex/gemini-3.1-pro-preview',
6
+ 'credential-id'
7
+ );
8
+ const GMAIL = { name: 'gmail', id: 'credential-id' };
9
+
10
+ const CUTOFF_CODE = `
11
+ export default async function main() {
12
+ return { cutoff: new Date(Date.now() - 5 * 60 * 1000).toISOString() };
13
+ }
14
+ `;
15
+
16
+ function createResearchAgent() {
17
+ return new MultiAgentEngine({
18
+ id: 'email-researcher',
19
+ name: 'Email Researcher',
20
+ role: 'primary',
21
+ description: 'Researches a recent email and prepares a reply.',
22
+ systemPrompt:
23
+ 'Read the supplied email subject and content, research its question with your approved web tools, and return only a concise reply body.',
24
+ model: MODEL,
25
+ metadata: {
26
+ runtimeDetails: {
27
+ sandboxProfile: 'default',
28
+ },
29
+ },
30
+ permissions: { default: { '*': 'deny', web_fetch: 'approve' } },
31
+ secondaryAgents: [],
32
+ });
33
+ }
34
+
35
+ function createWorkflow() {
36
+ const trigger = new Step({ id: 'trigger', name: 'Manual Trigger', type: 'manualTrigger' });
37
+ const cutoff = new Step({
38
+ id: 'cutoff',
39
+ name: 'Compute Cutoff',
40
+ type: 'core.code',
41
+ params: { code: CUTOFF_CODE, codeType: 'js' },
42
+ });
43
+ const readEmail = new Step({
44
+ id: 'read-email',
45
+ name: 'Read Recent Email',
46
+ type: 'gmail',
47
+ credentials: GMAIL,
48
+ params: {
49
+ resource: 'message',
50
+ operation: 'readAll',
51
+ output: 'simple',
52
+ limit: 10,
53
+ userFilters: {
54
+ filterBy: 'filters',
55
+ filters: {
56
+ readStatus: 'both',
57
+ sender: 'sender@example.com',
58
+ receivedAfter: "={{ $('Compute Cutoff').json.cutoff }}",
59
+ },
60
+ },
61
+ },
62
+ });
63
+ const research = new Step({
64
+ id: 'research',
65
+ name: 'Research Email',
66
+ type: 'core.agent',
67
+ params: {
68
+ agentReferenceKey: 'email-researcher',
69
+ prompt:
70
+ "Subject: {{ $('Read Recent Email').json.subject }}\nContent: {{ $('Read Recent Email').json.snippet }}\nPrepare the reply.",
71
+ autoCloseSession: true,
72
+ },
73
+ });
74
+ const sendReply = new Step({
75
+ id: 'send-reply',
76
+ name: 'Send Reply',
77
+ type: 'gmail',
78
+ credentials: GMAIL,
79
+ params: {
80
+ resource: 'message',
81
+ operation: 'send',
82
+ toRecipients: 'sender@example.com',
83
+ subject: "Re: {{ $('Read Recent Email').json.subject }}",
84
+ bodyContent: "={{ $('Research Email').json.response }}",
85
+ additionalFields: { bodyContentType: 'text' },
86
+ },
87
+ });
88
+
89
+ trigger.connectTo(cutoff);
90
+ cutoff.connectTo(readEmail);
91
+ readEmail.connectTo(research);
92
+ research.connectTo(sendReply);
93
+ return new Workflow({
94
+ id: 'integration-agent-workflow',
95
+ name: 'Integration Agent Workflow',
96
+ steps: [trigger, cutoff, readEmail, research, sendReply],
97
+ });
98
+ }
99
+
100
+ createResearchAgent();
101
+ createWorkflow();
@@ -0,0 +1,157 @@
1
+ import {
2
+ MultiAgentEngine,
3
+ Step,
4
+ Workflow,
5
+ createAgentModelConfigFromRef,
6
+ defineWorkflowTool,
7
+ } from '@culvii/kit';
8
+
9
+ const MODEL = createAgentModelConfigFromRef('openai/gpt-4.1', 'credential-id');
10
+
11
+ // Workflow tools target workflows, not agents. Keep these leaf workflows free
12
+ // of core.agent steps so the resource graph stays within the depth limit.
13
+ function createLeafWorkflow(id: string, name: string, values: Record<string, unknown>) {
14
+ const trigger = new Step({ id: 'trigger', name: 'Manual Trigger', type: 'manualTrigger' });
15
+ const result = new Step({
16
+ id: 'result',
17
+ name,
18
+ type: 'core.set',
19
+ params: { values },
20
+ });
21
+ trigger.connectTo(result);
22
+ return new Workflow({ id, name, steps: [trigger, result] });
23
+ }
24
+
25
+ const inventoryTool = defineWorkflowTool({
26
+ name: 'check_inventory',
27
+ description: 'Checks stock for a SKU.',
28
+ workflowId: 'inventory-workflow',
29
+ inputSchema: {
30
+ type: 'object',
31
+ properties: { sku: { type: 'string' } },
32
+ additionalProperties: false,
33
+ },
34
+ });
35
+
36
+ const shippingTool = defineWorkflowTool({
37
+ name: 'quote_shipping',
38
+ description: 'Returns shipping options for a destination.',
39
+ workflowId: 'shipping-workflow',
40
+ inputSchema: {
41
+ type: 'object',
42
+ properties: { destination: { type: 'string' } },
43
+ additionalProperties: false,
44
+ },
45
+ });
46
+
47
+ const complianceTool = defineWorkflowTool({
48
+ name: 'screen_compliance',
49
+ description: 'Screens an order destination for export restrictions.',
50
+ workflowId: 'compliance-workflow',
51
+ inputSchema: {
52
+ type: 'object',
53
+ properties: { destination: { type: 'string' } },
54
+ additionalProperties: false,
55
+ },
56
+ });
57
+
58
+ function createCoordinatorAgent() {
59
+ return new MultiAgentEngine({
60
+ id: 'fulfillment-coordinator',
61
+ name: 'Fulfillment Coordinator',
62
+ role: 'primary',
63
+ description: 'Coordinates inventory, shipping, compliance, and specialist review.',
64
+ systemPrompt:
65
+ 'For every line item, check inventory and quote shipping. Delegate compliance to the finance specialist and combine all returned facts into the final fulfillment plan.',
66
+ model: MODEL,
67
+ metadata: {
68
+ runtimeDetails: {
69
+ sandboxProfile: 'default',
70
+ },
71
+ },
72
+ permissions: {
73
+ default: {
74
+ '*': 'ask',
75
+ git: 'ask',
76
+ delete_file: 'deny',
77
+ },
78
+ },
79
+ tools: {
80
+ check_inventory: inventoryTool,
81
+ quote_shipping: shippingTool,
82
+ screen_compliance: complianceTool,
83
+ },
84
+ secondaryAgents: [
85
+ {
86
+ id: 'finance-specialist',
87
+ name: 'Finance Specialist',
88
+ role: 'secondary',
89
+ description: 'Screens the order and reports financial or regulatory risks.',
90
+ systemPrompt:
91
+ 'Review the supplied compliance result, then return its financial or regulatory risks.',
92
+ model: MODEL,
93
+ },
94
+ ],
95
+ });
96
+ }
97
+
98
+ function createWorkflow() {
99
+ const trigger = new Step({ id: 'trigger', name: 'Manual Trigger', type: 'manualTrigger' });
100
+ const order = new Step({
101
+ id: 'order',
102
+ name: 'Order',
103
+ type: 'core.set',
104
+ params: {
105
+ values: {
106
+ customer: 'Acme Corp',
107
+ destination: 'DE',
108
+ lineItems: [
109
+ { sku: 'WIDGET-001', quantity: 12 },
110
+ { sku: 'GADGET-114', quantity: 4 },
111
+ ],
112
+ },
113
+ },
114
+ });
115
+ const coordinator = new Step({
116
+ id: 'coordinator',
117
+ name: 'Coordinator Agent',
118
+ type: 'core.agent',
119
+ params: {
120
+ agentReferenceKey: 'fulfillment-coordinator',
121
+ prompt:
122
+ "Fulfill the order for {{ $('Order').json.customer }} shipping to {{ $('Order').json.destination }}. Process every line item and use your tools and finance specialist.",
123
+ autoCloseSession: true,
124
+ },
125
+ });
126
+ const persist = new Step({
127
+ id: 'persist',
128
+ name: 'Persist Plan',
129
+ type: 'core.set',
130
+ params: { values: { plan: "={{ $('Coordinator Agent').json.response }}" } },
131
+ });
132
+
133
+ trigger.connectTo(order);
134
+ order.connectTo(coordinator);
135
+ coordinator.connectTo(persist);
136
+ return new Workflow({
137
+ id: 'fulfillment-workflow',
138
+ name: 'Fulfillment Workflow',
139
+ steps: [trigger, order, coordinator, persist],
140
+ });
141
+ }
142
+
143
+ createLeafWorkflow('inventory-workflow', 'Inventory Result', {
144
+ available: 420,
145
+ warehouse: 'us-east-1',
146
+ });
147
+ createLeafWorkflow('shipping-workflow', 'Shipping Quote', {
148
+ carrier: 'GlobalEx',
149
+ service: 'ground',
150
+ etaDays: 4,
151
+ });
152
+ createLeafWorkflow('compliance-workflow', 'Compliance Result', {
153
+ restricted: false,
154
+ licenseRequired: false,
155
+ });
156
+ createCoordinatorAgent();
157
+ createWorkflow();
@@ -0,0 +1,108 @@
1
+ import {
2
+ MultiAgentEngine,
3
+ Step,
4
+ Workflow,
5
+ createAgentModelConfigFromRef,
6
+ defineWorkflowTool,
7
+ } from '@culvii/kit';
8
+
9
+ const MODEL = createAgentModelConfigFromRef('anthropic/claude-sonnet-4-5', 'credential-id');
10
+
11
+ // This is the agent -> workflow -> agent shape. The leaf agent has no workflow
12
+ // tools, which keeps the reference graph at the supported maximum depth.
13
+ function createLeafAgent() {
14
+ return new MultiAgentEngine({
15
+ id: 'evidence-reviewer',
16
+ name: 'Evidence Reviewer',
17
+ role: 'primary',
18
+ description: 'Reviews a brief and asks a second agent to check for gaps.',
19
+ systemPrompt: 'Review the brief, delegate a gap check, and return a recommendation.',
20
+ model: MODEL,
21
+ metadata: {
22
+ runtimeDetails: { sandboxProfile: 'default' },
23
+ },
24
+ permissions: { default: { '*': 'deny' } },
25
+ secondaryAgents: [
26
+ {
27
+ id: 'gap-checker',
28
+ name: 'Gap Checker',
29
+ role: 'secondary',
30
+ description: 'Checks a recommendation for missing evidence.',
31
+ systemPrompt: 'Check the recommendation for gaps and report them directly.',
32
+ model: MODEL,
33
+ },
34
+ ],
35
+ });
36
+ }
37
+
38
+ function createResearchWorkflow() {
39
+ const trigger = new Step({ id: 'trigger', name: 'Manual Trigger', type: 'manualTrigger' });
40
+ const brief = new Step({
41
+ id: 'brief',
42
+ name: 'Research Brief',
43
+ type: 'core.set',
44
+ params: { values: { topic: 'Expansion readiness', audience: 'Leadership' } },
45
+ });
46
+ const reviewer = new Step({
47
+ id: 'reviewer',
48
+ name: 'Evidence Reviewer',
49
+ type: 'core.agent',
50
+ params: {
51
+ agentReferenceKey: 'evidence-reviewer',
52
+ prompt:
53
+ "Review {{ $('Research Brief').json.topic }} for {{ $('Research Brief').json.audience }}.",
54
+ autoCloseSession: true,
55
+ },
56
+ });
57
+ trigger.connectTo(brief);
58
+ brief.connectTo(reviewer);
59
+ return new Workflow({
60
+ id: 'research-workflow',
61
+ name: 'Research Workflow',
62
+ steps: [trigger, brief, reviewer],
63
+ });
64
+ }
65
+
66
+ function createRootAgent() {
67
+ return new MultiAgentEngine({
68
+ id: 'strategy-agent',
69
+ name: 'Strategy Agent',
70
+ role: 'primary',
71
+ description: 'Delegates research to a workflow and a second opinion to a specialist.',
72
+ systemPrompt:
73
+ 'Call research_readiness first, ask the strategist for a second opinion, then combine both results.',
74
+ model: MODEL,
75
+ metadata: {
76
+ runtimeDetails: {
77
+ sandboxProfile: 'default',
78
+ },
79
+ },
80
+ permissions: { default: { '*': 'ask', read_file: 'approve', delete_file: 'deny' } },
81
+ tools: {
82
+ research_readiness: defineWorkflowTool({
83
+ name: 'research_readiness',
84
+ description: 'Runs the research workflow.',
85
+ workflowId: 'research-workflow',
86
+ inputSchema: {
87
+ type: 'object',
88
+ properties: { topic: { type: 'string' } },
89
+ additionalProperties: false,
90
+ },
91
+ }),
92
+ },
93
+ secondaryAgents: [
94
+ {
95
+ id: 'strategist',
96
+ name: 'Strategist',
97
+ role: 'secondary',
98
+ description: 'Provides a second opinion on the root agent’s research result.',
99
+ systemPrompt: 'Review the supplied research result and return a concise second opinion.',
100
+ model: MODEL,
101
+ },
102
+ ],
103
+ });
104
+ }
105
+
106
+ createLeafAgent();
107
+ createResearchWorkflow();
108
+ createRootAgent();
@@ -0,0 +1,45 @@
1
+ import { Step, Surface, Workflow } from '@culvii/kit';
2
+
3
+ function createOutputSurface() {
4
+ return new Surface({
5
+ id: 'result-surface',
6
+ name: 'Result Surface',
7
+ slot: 'output',
8
+ definition: {
9
+ schema: 'kit.ui/v1',
10
+ root: 'outer',
11
+ components: [
12
+ { id: 'outer', type: 'Stack', children: ['card'] },
13
+ { id: 'card', type: 'Card', props: { title: 'Execution result' }, children: ['inner'] },
14
+ { id: 'inner', type: 'Stack', children: ['status', 'execution'] },
15
+ {
16
+ id: 'status',
17
+ type: 'StatusPill',
18
+ props: { status: { path: '/$output/Prepare/main/0/0/status' } },
19
+ },
20
+ {
21
+ id: 'execution',
22
+ type: 'Text',
23
+ props: { text: { path: '/$exec/id', default: 'pending' } },
24
+ },
25
+ ],
26
+ },
27
+ });
28
+ }
29
+
30
+ function createWorkflow() {
31
+ const prepare = new Step({
32
+ id: 'prepare',
33
+ name: 'Prepare',
34
+ type: 'core.set',
35
+ params: { values: { status: 'ready' } },
36
+ ui: { output: createOutputSurface() },
37
+ });
38
+ return new Workflow({
39
+ id: 'output-surface-workflow',
40
+ name: 'Output Surface Workflow',
41
+ steps: [prepare],
42
+ });
43
+ }
44
+
45
+ createWorkflow();
@@ -0,0 +1,24 @@
1
+ import { Step, Surface, Workflow } from '@culvii/kit';
2
+
3
+ function createWaitSurface() {
4
+ return new Surface({
5
+ id: 'approval-surface', name: 'Approval Surface', slot: 'wait',
6
+ definition: { schema: 'kit.ui/v1', root: 'form', components: [
7
+ { id: 'form', type: 'Form', props: { title: 'Review result' }, children: ['comment', 'approve'] },
8
+ { id: 'comment', type: 'TextArea', props: { label: 'Comment', bind: '/$form/comment' } },
9
+ { id: 'approve', type: 'Button', props: { label: 'Continue', variant: 'primary' }, actions: {
10
+ click: { type: 'node.resume', payload: { comment: { path: '/$form/comment', default: '' } } },
11
+ } },
12
+ ], form: { fields: [{ name: 'comment', label: 'Comment', type: 'textarea' }] } },
13
+ });
14
+ }
15
+
16
+ function createWorkflow() {
17
+ const review = new Step({
18
+ id: 'review', name: 'Review', type: 'core.set', params: { values: { status: 'pending' } },
19
+ ui: { wait: createWaitSurface() },
20
+ });
21
+ return new Workflow({ id: 'approval-workflow', name: 'Approval Workflow', steps: [review] });
22
+ }
23
+
24
+ createWorkflow();
@@ -0,0 +1,77 @@
1
+ # Agents
2
+
3
+ Create a root agent with `new MultiAgentEngine(primaryConfig)`. A primary agent requires `id`, `name`, `role: 'primary'`, `systemPrompt`, `model`, and `secondaryAgents`. Include a useful `description`. A secondary agent is defined inline with `role: 'secondary'`; secondary agents cannot contain further secondary agents.
4
+
5
+ Create models with `createAgentModelConfigFromRef('<provider>/<model>', '<credential-id>', options?)`. Supported built-in providers are `anthropic`, `openai`, `gemini`, `vertexai`, and `google-vertex`. A credential ID is required; never use an API key as the ID.
6
+
7
+ ```ts
8
+ const MODEL = createAgentModelConfigFromRef('anthropic/claude-sonnet-4-5', 'credential-uuid');
9
+ const agent = new MultiAgentEngine({
10
+ id: 'support-agent',
11
+ name: 'Support Agent',
12
+ role: 'primary',
13
+ description: 'Resolves support requests with a research specialist.',
14
+ systemPrompt: 'Solve the request and delegate research when useful.',
15
+ model: MODEL,
16
+ secondaryAgents: [
17
+ {
18
+ id: 'researcher',
19
+ name: 'Researcher',
20
+ role: 'secondary',
21
+ description: 'Finds supporting evidence.',
22
+ systemPrompt: 'Return concise evidence.',
23
+ model: MODEL,
24
+ },
25
+ ],
26
+ });
27
+ ```
28
+
29
+ Context-window capacity is platform controlled, not agent authored. It defaults
30
+ to `512_000`; an operator may override an exact provider/model through
31
+ `AGENT_MODEL_CONTEXT_WINDOWS`. The platform includes the current user prompt
32
+ when deciding whether older session turns must be compacted.
33
+
34
+ Workflow-context helpers and delegation tools are available by default. Sandbox
35
+ tools, including `web_fetch` and `git`, follow top-level `permissions.default`.
36
+ Only tools with an explicit rule or `'*'` rule are available. Root `tools`
37
+ contains only configured workflow tools.
38
+
39
+ Workflow tools belong in root `tools` and are created with `defineWorkflowTool({ name, description, workflowId, triggerNodeName?, inputSchema? })`. Omit `tools` when there are no tools. `workflowId` references a local workflow resource ID, not a display name.
40
+
41
+ Choose the sandbox image when authoring the agent with
42
+ `metadata.runtimeDetails.sandboxProfile`. This is a platform-configured profile
43
+ name such as `node`, `go`, or `java`, not a Docker image reference. The platform
44
+ resolves it to an immutable digest and snapshots that choice when the session is
45
+ created:
46
+
47
+ ```ts
48
+ metadata: { runtimeDetails: { sandboxProfile: 'go' } },
49
+ ```
50
+
51
+ Ask the platform operator to publish and configure the profile before using it.
52
+ Agents without this setting use the `default` profile.
53
+
54
+ Sandbox tools use top-level platform-enforced permissions. Missing entries are
55
+ unavailable; exact names override `'*'`:
56
+
57
+ ```ts
58
+ metadata: { runtimeDetails: { sandboxProfile: 'go' } },
59
+ permissions: {
60
+ default: {
61
+ '*': 'ask',
62
+ read_file: 'approve',
63
+ delete_file: 'deny',
64
+ },
65
+ },
66
+ ```
67
+
68
+ `approve` runs automatically, `deny` removes the tool, and `ask` suspends the
69
+ agent until the user decides in the console. Governed sandbox and workflow tools
70
+ belong to the root agent so durable continuation has one exact model transcript;
71
+ secondary agents return analysis to that root. Workflow tools need no permission;
72
+ each invocation suspends durably until its child workflow finishes, including
73
+ any HITL wait. Workflow-context helpers remain always available.
74
+
75
+ Agent references flow in the other direction through a `core.agent` step's `params.agentReferenceKey`, which must exactly equal the `MultiAgentEngine` ID. Never use `agentId`.
76
+
77
+ Further reading: [Multi-Agent API](https://culvii.com/docs/sdk-reference/api-reference/multi-agent-api/) and [Authentication](https://culvii.com/docs/sdk-reference/guides/authentication/).
@@ -0,0 +1,21 @@
1
+ # Authoring files
2
+
3
+ Before writing code, inspect `package.json`, `culvii.yaml`, and every existing `*.culvii.ts` file. Preserve the project's module style and dependency versions.
4
+
5
+ Each evaluated `*.culvii.ts` file should import public APIs from `@culvii/kit`, construct resources inside named functions, and call those functions at the bottom. Do not export resources as a substitute for construction: dev discovery observes constructors through `DevRegistry`.
6
+
7
+ ```ts
8
+ import { MultiAgentEngine, Step, Surface, Workflow, createAgentModelConfigFromRef } from '@culvii/kit';
9
+
10
+ const MODEL = createAgentModelConfigFromRef('openai/gpt-4.1', 'CREDENTIAL_ID');
11
+
12
+ function createAgent() { return new MultiAgentEngine({ /* ... */ }); }
13
+ function createWorkflow() { return new Workflow({ /* ... */ }); }
14
+ function createSurface() { return new Surface({ /* ... */ }); }
15
+
16
+ createAgent();
17
+ createWorkflow();
18
+ createSurface();
19
+ ```
20
+
21
+ Use stable kebab-case resource IDs and unique step names. Credential IDs are references to credentials stored in Culvii; never place raw secrets in source.
@@ -0,0 +1,22 @@
1
+ # CLI development guide
2
+
3
+ Safe lifecycle:
4
+
5
+ 1. Inspect `package.json`, `culvii.yaml`, and existing `*.culvii.ts` files.
6
+ 2. Author resources using installed `@culvii/kit` types. For every new workflow, complete the pre-validation choices in [surface configuration and visual approval](surface-feedback.md), including attaching any custom candidate surfaces, before starting `culvii dev`.
7
+ 3. Run `culvii whoami --json` to check the stored login and active context.
8
+ 4. If the user is not authenticated, run `culvii login` as a tracked process. If command execution or opening the browser requires approval, request that approval and continue as soon as the user allows it. Keep the login process running while its local callback server opens the user's browser and waits for authentication. When login lists multiple tenants, present those exact tenants through the agent's native in-run question tool, then write the selected tenant number followed by Enter to the same login process. Never choose a tenant or end the run while login is awaiting input. The CLI uses its interactive selector in a real terminal and automatically falls back to a plain numbered prompt when raw terminal mode is unavailable. Ask the user to run login manually only after execution is denied or the environment actually fails to launch the browser, callback server, or writable input process. Prefer the same `culvii` executable that will run `culvii dev`; if it is not on PATH, resolve the project-local CLI without hard-coding a machine-specific absolute path.
9
+ 5. After a fresh login, keep the tenant selected during login and do not ask again. For an existing authenticated session whose tenant has not been confirmed for the task, run `culvii switch` to list contexts. If more than one is available, show those exact tenants through the native question tool and run `culvii switch <tenant-slug>` with the user's selection. Never choose a tenant for the user.
10
+ 6. Run `culvii whoami --json` again and verify that the authenticated identity and active tenant match the user's selection.
11
+ 7. Start `culvii dev` as a tracked long-running process and retain its exact process/session handle. If another dev session is already active, do not start or terminate anything; ask the user to close their existing session.
12
+ 8. Inspect the initial evaluation and sync output. If it reports evaluation, schema, surface, node, or cross-resource validation errors, fix the authored files and let the running watcher validate them again. Repeat until validation and draft sync succeed.
13
+ 9. For a requested workflow, complete the [workflow feedback cycle](feedback-cycle.md), including the Console [surface review](surface-feedback.md), while this dev session remains active.
14
+ 10. In a cleanup step that runs after success, failure, cancellation, or a blocker, send Ctrl-C/SIGINT to the exact `culvii dev` process the agent started and wait for it to exit. Confirm the CLI disconnected and discarded the draft session. If graceful shutdown fails, terminate only that exact process and report that cleanup could not be confirmed. Never use a broad process kill.
15
+ 11. Do not present the resources as complete while validation or feedback errors remain or while the dev process is still running.
16
+ 12. Never run `culvii deploy`. Deployment is a separate user-operated action outside this skill.
17
+
18
+ `culvii dev` watches `*.culvii.ts`, evaluates resources, validates their combined reference graph, and syncs drafts. Removed resources become orphans for the session. Ending the session cleans up draft resources. Do not assume a successful TypeScript build proves cross-resource references are valid.
19
+
20
+ Use [cli-reference.md](cli-reference.md) for exact commands and flags generated from the registered Commander tree.
21
+
22
+ Further reading: [`culvii dev`](https://culvii.com/docs/cli/dev/) and [`culvii deploy`](https://culvii.com/docs/cli/deploy/).