@collective-intelligence/external-apps-server-sdk-payload 0.0.0-placeholder.0 → 0.13.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/AGENTS.md +49 -0
- package/README.md +122 -0
- package/dist/ci-generate/declarations/ci-generate/generate.d.ts +10 -0
- package/dist/ci-generate/declarations/entrypoints/ci-generate.d.ts +6 -0
- package/dist/ci-generate/declarations/knowledge/body.d.ts +32 -0
- package/dist/ci-generate/declarations/knowledge/files.d.ts +42 -0
- package/dist/ci-generate/declarations/knowledge/manifest.d.ts +19 -0
- package/dist/ci-generate/declarations/package/builder.d.ts +63 -0
- package/dist/ci-generate/declarations/package/contract.d.ts +16 -0
- package/dist/ci-generate/declarations/package/stamped-fields.d.ts +7 -0
- package/dist/ci-generate/declarations/plugin/editor-field.d.ts +20 -0
- package/dist/ci-generate/declarations/plugin/integration-user.d.ts +11 -0
- package/dist/ci-generate/declarations/plugin/parts.d.ts +81 -0
- package/dist/ci-generate.d.ts +1 -0
- package/dist/ci-generate.js +2 -0
- package/dist/index/declarations/ci-generate/generate.d.ts +10 -0
- package/dist/index/declarations/entrypoints/index.d.ts +6 -0
- package/dist/index/declarations/knowledge/body.d.ts +32 -0
- package/dist/index/declarations/knowledge/files.d.ts +42 -0
- package/dist/index/declarations/knowledge/identity.d.ts +27 -0
- package/dist/index/declarations/knowledge/manifest.d.ts +19 -0
- package/dist/index/declarations/knowledge/push-job.d.ts +8 -0
- package/dist/index/declarations/knowledge/source.d.ts +24 -0
- package/dist/index/declarations/operations/conflict.d.ts +22 -0
- package/dist/index/declarations/operations/markdown.d.ts +25 -0
- package/dist/index/declarations/operations/operations.d.ts +30 -0
- package/dist/index/declarations/operations/write-back.d.ts +8 -0
- package/dist/index/declarations/package/builder.d.ts +63 -0
- package/dist/index/declarations/package/contract.d.ts +16 -0
- package/dist/index/declarations/package/stamped-fields.d.ts +7 -0
- package/dist/index/declarations/plugin/editor-field.d.ts +20 -0
- package/dist/index/declarations/plugin/grant-store.d.ts +21 -0
- package/dist/index/declarations/plugin/integration-user.d.ts +11 -0
- package/dist/index/declarations/plugin/parts.d.ts +81 -0
- package/dist/index/declarations/plugin/plugin.d.ts +10 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7 -0
- package/dist/package.d.ts +134 -0
- package/dist/package.js +24 -0
- package/docs/guide/ai/index.md +379 -0
- package/docs/guide/ai/studio.md +245 -0
- package/docs/guide/data/connectors.md +267 -0
- package/docs/guide/data/datasets.md +145 -0
- package/docs/guide/data/documents.md +235 -0
- package/docs/guide/data/index.md +62 -0
- package/docs/guide/data/knowledge.md +214 -0
- package/docs/guide/develop/extensions.md +299 -0
- package/docs/guide/develop/external-apps.md +289 -0
- package/docs/guide/develop/infrastructure.md +135 -0
- package/docs/guide/develop/sdks.md +252 -0
- package/docs/guide/index.md +83 -0
- package/docs/guide/platform/access.md +311 -0
- package/docs/guide/platform/architecture.md +166 -0
- package/docs/guide/platform/built-ins.md +225 -0
- package/docs/guide/platform/entrypoints.md +320 -0
- package/docs/guide/scenarios/index.md +130 -0
- package/docs/guide/template/index.md +295 -0
- package/docs/guide/template/state-machines.md +294 -0
- package/docs/payload-connector.md +890 -0
- package/docs/payload-page-editor-skill.md +284 -0
- package/package.json +76 -8
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
# Built-in catalog
|
|
2
|
+
|
|
3
|
+
Every tool, workflow node, trigger, connector, schema, channel and MCP operation that CI ships, and which ones are already installed in an Organization.
|
|
4
|
+
|
|
5
|
+
Before you declare a tool, a workflow node, a connector or a schema in a demo package, check this page. CI may already ship it. Everything on this page is a package that ships with each CI version and uses an FQN under `builtin.` (schema templates use `core.`). Its manifest and declarations follow the same contracts as your own package, as [Extensions](../develop/extensions.md) describes. Your package refers to a built-in item by its FQN and lists its package as a dependency. Do not copy a built-in item into your package.
|
|
6
|
+
|
|
7
|
+
## Install policies
|
|
8
|
+
|
|
9
|
+
A package that ships with CI is not always installed in an Organization. Each built-in package has one of three install policies:
|
|
10
|
+
|
|
11
|
+
| Policy | What happens | Packages |
|
|
12
|
+
| --------- | ---------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
13
|
+
| Mandatory | Installed in every Organization. An admin cannot uninstall it. | Core Workflows, Core Knowledge, Core Information, Core Activities |
|
|
14
|
+
| Standard | Installed when an admin creates an Organization with "Install packages" on, which is the default. An admin can uninstall it later. | Core Datasets, Core Documents, Core External Apps, Core Messaging, Core Notifications, Core OCR, Core Speech, Core Studio, Core Utilities, SQL databases |
|
|
15
|
+
| Optional | An admin installs it in each Organization that needs it. | Every integration in [Integrations](#integrations), Core Authoring, Core Reporting |
|
|
16
|
+
|
|
17
|
+
When CI is upgraded, it installs the new version of each mandatory package and of each optional package that an Organization already has. An upgrade never installs an optional package that the Organization did not have.
|
|
18
|
+
|
|
19
|
+
> **Warning:** When your manifest lists an integration such as `builtin.integrations.hubspot`
|
|
20
|
+
> in `dependencies` and the Organization does not have it, the deploy of your
|
|
21
|
+
> package installs it too. The integration still has no connection, so its tools
|
|
22
|
+
> and connectors fail until an admin creates one. When the Organization already
|
|
23
|
+
> has another release of the integration or of SQL databases, the deploy stops
|
|
24
|
+
> with a manual prerequisite. An admin then updates that package first.
|
|
25
|
+
|
|
26
|
+
When a package is installed, each of its tools gets the defaults that its declaration sets. With `autoInstantiate`, CI creates the tool in the Organization. With `autoActivate`, CI also turns it on. A tool that is created but not turned on appears in the Dashboard, and an admin turns it on. A tool without `usageScopes` can be used in chat, in Skills and in automation.
|
|
27
|
+
|
|
28
|
+
## Workflow triggers
|
|
29
|
+
|
|
30
|
+
Core Workflows ships these triggers, with FQNs under `builtin.core.workflows.nodes.triggers.`:
|
|
31
|
+
|
|
32
|
+
| Trigger | Starts a run when |
|
|
33
|
+
| -------------------- | -------------------------------------------------------------------- |
|
|
34
|
+
| On-demand | A person or an app starts it |
|
|
35
|
+
| Schedule | A cron rule fires in the time zone that you set |
|
|
36
|
+
| Webhook | An authenticated `POST` arrives at its path; it can answer with JSON |
|
|
37
|
+
| Entity Created | A Knowledge record of the watched schema is created |
|
|
38
|
+
| Entity Updated | A Knowledge record changes; you can watch only some top-level fields |
|
|
39
|
+
| Entity Deleted | A Knowledge record is deleted |
|
|
40
|
+
| External application | An external application starts it through the server SDK |
|
|
41
|
+
| MCP Operation | An MCP client calls `invoke_operation` on it |
|
|
42
|
+
|
|
43
|
+
Integrations add message and file triggers. Slack, Telegram and WhatsApp add "message received". Twilio adds SMS received and WhatsApp message received. Microsoft 365 adds email received, Teams message received and Drive file created. Notion adds page created, page updated and page deleted. [Entrypoints](entrypoints.md) explains as which identity each trigger runs.
|
|
44
|
+
|
|
45
|
+
## Workflow nodes
|
|
46
|
+
|
|
47
|
+
Core Workflows ships these action nodes, with FQNs under `builtin.core.workflows.nodes.actions.`:
|
|
48
|
+
|
|
49
|
+
| Collection | Nodes |
|
|
50
|
+
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
51
|
+
| Control flow | If, Switch, Merge, Loop (each item or in batches; 100 iterations by default), Wait (a duration, a time, a callback or an event), Invoke Workflow, Stop & Error |
|
|
52
|
+
| AI | Prompt (a model step that returns text or JSON), Skill (runs one Skill) |
|
|
53
|
+
| Data | Set Variable, Adapter (filter, sort and reshape), Code Block, HTTP Request, Persist Artifact, Stored File Link, File Content, File URL |
|
|
54
|
+
| Human review | Approval |
|
|
55
|
+
| Workflow boundaries | Input, Output |
|
|
56
|
+
|
|
57
|
+
Some limits apply to these nodes. HTTP Request times out after 1 to 60 seconds (10 by default) and can read header values from Organization secrets. File Content reads up to 5 MiB. A File URL link lasts up to 7 days. Wait, Approval and Invoke Workflow pause the run durably and continue it later.
|
|
58
|
+
|
|
59
|
+
The standard packages add nodes for their own areas:
|
|
60
|
+
|
|
61
|
+
| Package | Nodes |
|
|
62
|
+
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
63
|
+
| Core Knowledge | Create Knowledge Entity, Update Knowledge Entity, List Knowledge Entities, Save File to Knowledge (an HTTPS file up to 10 MiB), Add Account Knowledge Entity |
|
|
64
|
+
| Core Documents | Collection nodes (create, list, get, update, delete, restore), search nodes (Search Documents, Search Within Document, Expand Passage, Read Document Range), and sync nodes for connected collections |
|
|
65
|
+
| Core Datasets | Describe Dataset, Query Dataset Records, Query Dataset Aggregate, Query Dataset Time Series |
|
|
66
|
+
| Core Messaging | Send Email |
|
|
67
|
+
| Core Notifications | Send Notification |
|
|
68
|
+
| Core OCR | Extract Document |
|
|
69
|
+
| Core Speech | Transcribe Audio, Synthesize Speech |
|
|
70
|
+
| Core Utilities | Web Search, Generate Image |
|
|
71
|
+
| Core External Apps | Gateway Operation |
|
|
72
|
+
|
|
73
|
+
Each tool of an integration is also a workflow action node with the same name, so a workflow can call HubSpot or Gmail without a Skill.
|
|
74
|
+
|
|
75
|
+
### Code Block runtimes
|
|
76
|
+
|
|
77
|
+
A Code Block runs Python or JavaScript in one of two runtimes:
|
|
78
|
+
|
|
79
|
+
| Runtime | Language |
|
|
80
|
+
| ----------------------- | ---------- |
|
|
81
|
+
| Python 3.12 | Python |
|
|
82
|
+
| JavaScript (Node.js 24) | JavaScript |
|
|
83
|
+
|
|
84
|
+
In isolated mode, each run starts a new container with no network, a read-only file system, 128 MB of memory and half a CPU. A run can take 5 seconds and write 16 KiB of output. Use a Code Block for small, deterministic data changes. Use HTTP Request for network calls.
|
|
85
|
+
|
|
86
|
+
### Field types
|
|
87
|
+
|
|
88
|
+
Node settings use field types from two collections. Your own nodes can use them too.
|
|
89
|
+
|
|
90
|
+
- Standard fields: Text, Text list, Number, Integer, Money, Boolean, Select, Multi-select, Email, URL, UUID, JSON, Date, Time, Date and time, Date range, Cron, HTTP method, Code snippet, Condition builder.
|
|
91
|
+
- Platform fields: Connection, Entity schema, Entity instance, Model, Skill, Workflow, User, Users, File, Application Selector, Code Block Docker runtime.
|
|
92
|
+
|
|
93
|
+
## Tools
|
|
94
|
+
|
|
95
|
+
These tools ship in the mandatory and standard packages. They are grouped in tool collections. "Ready" means that the tool is created and turned on when its package is installed.
|
|
96
|
+
|
|
97
|
+
| Tool collection | Tools | Ready |
|
|
98
|
+
| ----------------------- | --------------------------------------------------------------------------------------- | ----------------------------------------------------- |
|
|
99
|
+
| Knowledge | Knowledge Catalog, Knowledge Query, Knowledge Document Read, Knowledge Mutate | Yes, except Knowledge Mutate, which an admin turns on |
|
|
100
|
+
| Information | Advanced Information Retrieval, Expand Passage, Read Source Range | Yes |
|
|
101
|
+
| Documents | Documents Query | Yes |
|
|
102
|
+
| Datasets | Query Dataset (records, aggregates and time series; no SQL) | Yes |
|
|
103
|
+
| Web | Web Search (Tavily by default, or Exa), Website Scraper | An admin turns them on |
|
|
104
|
+
| Code Execution | Script Runner (short Python or Node.js calculations in a locked-down scratchpad) | An admin turns it on |
|
|
105
|
+
| Images | Generate Image | An admin turns it on |
|
|
106
|
+
| Messaging | Send Email | An admin turns it on |
|
|
107
|
+
| Notifications | Send Notification | Yes |
|
|
108
|
+
| OCR | Extract Document (PDF, PNG, JPEG or WebP to Markdown, or to JSON that matches a schema) | An admin turns it on |
|
|
109
|
+
| Speech | Transcribe Audio, Synthesize Speech | An admin turns them on |
|
|
110
|
+
| External App Run Events | Publish Run Event | Yes |
|
|
111
|
+
|
|
112
|
+
Two optional packages add more tools after an admin installs them. Core Reporting adds Build Report, Run Report, Create Report Definition, Update Report Definition, Archive Report Definition, List Report Definitions, List Report Runs and Read Report Run. Core Authoring adds the tools of the Authoring Assistant.
|
|
113
|
+
|
|
114
|
+
[AI](../ai/index.md) explains how to bind a tool to a Skill or an agent, and [Knowledge](../data/knowledge.md) explains which Knowledge tool to choose.
|
|
115
|
+
|
|
116
|
+
### Authoring Assistant
|
|
117
|
+
|
|
118
|
+
Core Authoring ships one agent, the Authoring Assistant. From a conversation, it lists the catalog of tools, Skills, nodes and connections that the person may use, creates private drafts of agents, Skills and workflows, edits them, runs pre-publish review and Sandbox Runs, reads run traces, imports a `SKILL.md` folder and turns a plain-language schedule into a Schedule trigger. It never publishes, turns on, shares or approves anything. A person does those steps.
|
|
119
|
+
|
|
120
|
+
## Data
|
|
121
|
+
|
|
122
|
+
[Data resources](../data/index.md) explains Knowledge, Datasets and Documents. This section lists the parts of them that CI ships.
|
|
123
|
+
|
|
124
|
+
### Knowledge connectors
|
|
125
|
+
|
|
126
|
+
| Connector | Package | What it syncs |
|
|
127
|
+
| ----------------- | ------------------ | -------------------------------------------------------------------------------------------------------------------- |
|
|
128
|
+
| Structured File | Core Knowledge | CSV, XLSX and JSON rows into your schemas, from an upload, an FTP server, Google Drive or Microsoft 365. Import only |
|
|
129
|
+
| Knowledge gateway | Core External Apps | Records in both directions with an external application's server |
|
|
130
|
+
| PostgreSQL | SQL databases | Selected tables into Knowledge. Import only |
|
|
131
|
+
| MySQL | SQL databases | Selected tables into Knowledge. Import only |
|
|
132
|
+
| HubSpot API | HubSpot | Contacts, companies and deals into the CRM schemas. A read-only mirror |
|
|
133
|
+
| monday.com API | monday.com | Workspaces, boards, groups, items and updates into the project management schemas. A read-only mirror |
|
|
134
|
+
| Notion API | Notion | The Notion databases that you choose, into any schema. Import only |
|
|
135
|
+
|
|
136
|
+
No connector imports on its own schedule. After an admin creates a connector instance, they start an import or set an import schedule. During setup, HubSpot and monday.com suggest a delta import every 15 minutes and a full import each night, and Notion suggests a delta import every 5 minutes. [Connectors](../data/connectors.md) explains bindings, sync modes and mapping.
|
|
137
|
+
|
|
138
|
+
### Knowledge schemas
|
|
139
|
+
|
|
140
|
+
CI ships schema templates in domains, with FQNs under `core.schemas.<domain>.`. Your custom schemas can point a relation field at them, so a demo does not need its own Company or Person schema.
|
|
141
|
+
|
|
142
|
+
| Domain | Schemas | When they appear |
|
|
143
|
+
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
|
|
144
|
+
| Strategy | Organization context, strategic dimension, business goal, strategic initiative, metric, constraint, assumption, decision principle, stakeholder, context note | When an Organization is onboarded |
|
|
145
|
+
| Directory | Organization, organizational unit, group, person | When an Organization is onboarded |
|
|
146
|
+
| Assets | Asset | When an Organization is onboarded |
|
|
147
|
+
| CRM | Contact, company, deal, lead, pipeline, stage, activity, task, note | When you choose "Create from template" while mapping a connector |
|
|
148
|
+
| HR | Worker, department, job opening, job opening template, candidate, application, interview, contract, time off, performance review | When you choose "Create from template" while mapping a connector |
|
|
149
|
+
| Project management | Workspace, project, group, task, update | When you choose "Create from template" while mapping a connector |
|
|
150
|
+
|
|
151
|
+
A template creates a schema only once. A later CI version never changes a schema that already exists, so the edits that an admin makes stay.
|
|
152
|
+
|
|
153
|
+
### Documents and Datasets
|
|
154
|
+
|
|
155
|
+
[Documents](../data/documents.md) lists the two Documents connectors, Google Drive Documents and Microsoft 365 Documents. [Datasets](../data/datasets.md) lists the Dataset providers: managed PostgreSQL storage in CI, and external Databricks, Microsoft Fabric and Remote Gateway sources. A managed import reads CSV, JSON, JSON Lines, Parquet and Excel (the first worksheet).
|
|
156
|
+
|
|
157
|
+
### Connection types
|
|
158
|
+
|
|
159
|
+
A connection holds the address and credential of one external system. CI ships these connection types:
|
|
160
|
+
|
|
161
|
+
- Core Knowledge: FTP server.
|
|
162
|
+
- SQL databases: PostgreSQL database, MySQL database.
|
|
163
|
+
- Core External Apps: External app gateway.
|
|
164
|
+
- Core Messaging: Resend, SendGrid, Amazon SES and Azure Communication Services, for email.
|
|
165
|
+
- Each integration: the connection that its row in [Integrations](#integrations) names.
|
|
166
|
+
|
|
167
|
+
## Integrations
|
|
168
|
+
|
|
169
|
+
All integrations are optional. The admin needs the credential in the last column before they install one.
|
|
170
|
+
|
|
171
|
+
| Integration | What it adds | Credential |
|
|
172
|
+
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
|
|
173
|
+
| Apollo | 64 tools in three families: prospecting and enrichment, accounts, contacts, tasks and lists, and sequences and outreach email | API key |
|
|
174
|
+
| Lusha | 13 tools that search, enrich and prospect contacts and companies | API key |
|
|
175
|
+
| HubSpot | 17 CRM tools for objects, lists, associations, owners, pipelines and properties; the HubSpot API Knowledge connector | Private app access token |
|
|
176
|
+
| monday.com | The monday.com API Knowledge connector. No tools | API token |
|
|
177
|
+
| Notion | 8 tools that read, search, create, update and delete pages and databases; page triggers; the Notion API Knowledge connector | Internal integration token |
|
|
178
|
+
| Google Workspace | 23 tools for Gmail, Calendar and Drive; the Google Drive Documents connector; sending email from a mailbox; Google sign-in | Service account with domain-wide delegation |
|
|
179
|
+
| Microsoft 365 | 24 tools for Outlook mail, Calendar, OneDrive and Teams; mail, Teams and Drive triggers; the Microsoft 365 Documents connector; sending email from a mailbox; Microsoft Entra sign-in | Entra application (client secret, certificate or federated), and a Teams bot for Teams messages |
|
|
180
|
+
| Slack | Send Slack message, and a message trigger | Bot token and signing secret |
|
|
181
|
+
| Telegram | Send Telegram message, and a message trigger | Bot token |
|
|
182
|
+
| WhatsApp | Send WhatsApp message, and a message trigger | Meta Cloud API access token, app secret and business account ID |
|
|
183
|
+
| Twilio | Send SMS and Send WhatsApp message, with matching triggers | Account SID and Auth Token |
|
|
184
|
+
| Databricks | A read-only Dataset provider for Unity Catalog through one SQL Warehouse | Service principal; personal access tokens are refused |
|
|
185
|
+
| Microsoft Fabric | A read-only Dataset provider for Warehouses and Lakehouse SQL endpoints | Entra service principal; personal access tokens are refused |
|
|
186
|
+
|
|
187
|
+
In Apollo, Lusha and HubSpot, tools that only read can be used in chat, in Skills and in automation, and tools that write can be used only in Skills and in automation. Apollo enrichment and Lusha search tools count as writes because each call spends credits on the provider's account. The message tools of Slack, Telegram, WhatsApp, Twilio and Teams can be used only in Skills and in automation. The other Google Workspace, Microsoft 365 and Notion tools can be used everywhere, so an Organization that offers them in chat lets a model send mail or edit pages from a conversation. WhatsApp sends only a template message to a person who has not written in the last 24 hours.
|
|
188
|
+
|
|
189
|
+
## Email and notifications
|
|
190
|
+
|
|
191
|
+
Send Email and Send Notification deliver through what an admin configures:
|
|
192
|
+
|
|
193
|
+
- Email providers: Resend, SendGrid, Amazon SES and Azure Communication Services. Google Workspace and Microsoft 365 add sending from a mailbox.
|
|
194
|
+
- Notification channels: Studio Internal, which CI creates in every Organization, Email, Slack webhook, Microsoft Teams webhook, Discord webhook and Telegram bot.
|
|
195
|
+
|
|
196
|
+
## MCP
|
|
197
|
+
|
|
198
|
+
CI is an MCP server named `collective-intelligence-mcp`, at `/mcp` and at `/mcp/o/<organizationId>`. It offers these tools:
|
|
199
|
+
|
|
200
|
+
| Tool | What it does |
|
|
201
|
+
| ------------------ | ------------------------------------------------------ |
|
|
202
|
+
| `list_memberships` | Lists the Organizations that the caller belongs to |
|
|
203
|
+
| `list_skills` | Lists the Skills that the caller can run |
|
|
204
|
+
| `run_skill` | Starts a Skill run in the background |
|
|
205
|
+
| `get_skill_run` | Reads the status and result of a Skill run |
|
|
206
|
+
| `list_operations` | Lists the workflows that have an MCP Operation trigger |
|
|
207
|
+
| `invoke_operation` | Starts one of those workflows and returns a handle |
|
|
208
|
+
| `get_operation` | Reads the status and result of an operation |
|
|
209
|
+
| `cancel_operation` | Cancels a running operation |
|
|
210
|
+
| `explain_access` | Explains why a principal can or cannot do something |
|
|
211
|
+
|
|
212
|
+
The Dashboard has ready client settings for Claude (OAuth) and Codex (bearer token). Two MCP Profiles ship. Admin full-access is for administrators and has no rate limits. User-context is for other users and allows 5 operations at a time, 60 starts a minute and 10,000 starts a month. CI does not connect to other MCP servers, and no integration adds one. [Entrypoints](entrypoints.md) explains MCP sign-in and tokens.
|
|
213
|
+
|
|
214
|
+
## Studio and models
|
|
215
|
+
|
|
216
|
+
Core Studio ships the Default Studio app. Its AI section has Activity Center, Chat, Approvals, Notifications, Agents and Skills, and its Productivity section has Documents. [Studio](../ai/studio.md) lists the built-in views that your own Studio app can use.
|
|
217
|
+
|
|
218
|
+
CI ships a catalog of models from several providers. Each Organization chooses a model preset, and the preset sets one model for each tier (complex, balanced, fast and super fast) and for embeddings, OCR, speech-to-text and text-to-speech. A package asks for a tier, not a model. The Prompt node uses the balanced tier. [AI](../ai/index.md) explains how a Skill chooses its model.
|
|
219
|
+
|
|
220
|
+
## Next steps
|
|
221
|
+
|
|
222
|
+
- [Extensions](../develop/extensions.md)
|
|
223
|
+
- [AI primitives](../ai/index.md)
|
|
224
|
+
- [Connectors](../data/connectors.md)
|
|
225
|
+
- [Choosing primitives](../scenarios/index.md)
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
# Entrypoints
|
|
2
|
+
|
|
3
|
+
The ways people, apps and agents enter CI at runtime, and the package subpaths that your code imports.
|
|
4
|
+
|
|
5
|
+
In this guide, "entrypoint" has two meanings. Runtime entrypoints are the ways people, apps and agents enter CI: the Dashboard, Studio, the CLI, the HTTP API, MCP, workflow triggers and Realtime. Code entrypoints are the package subpaths that your code imports, both from the CI SDKs and from the template's own packages.
|
|
6
|
+
|
|
7
|
+
## Runtime entrypoints
|
|
8
|
+
|
|
9
|
+
```mermaid
|
|
10
|
+
flowchart LR
|
|
11
|
+
admin["Organization or Tenant admin"] --> dashboard["Dashboard"]
|
|
12
|
+
user["Organization member"] --> studio["Studio"]
|
|
13
|
+
dev["Developer or pipeline"] --> cli["ci CLI"]
|
|
14
|
+
script["Script with an API key"] --> http["HTTP API"]
|
|
15
|
+
browser["Your browser code"] --> bff["Your BFF"]
|
|
16
|
+
bff --> appapi["Application API"]
|
|
17
|
+
ai["AI client"] --> mcp["MCP endpoint"]
|
|
18
|
+
system["External system"] --> trigger["Workflow trigger"]
|
|
19
|
+
clock["Schedule"] --> trigger
|
|
20
|
+
subgraph ci["CI"]
|
|
21
|
+
dashboard
|
|
22
|
+
studio
|
|
23
|
+
http
|
|
24
|
+
appapi
|
|
25
|
+
mcp
|
|
26
|
+
trigger
|
|
27
|
+
realtime["Realtime events"]
|
|
28
|
+
end
|
|
29
|
+
cli --> http
|
|
30
|
+
realtime -->|"ids of changed records"| browser
|
|
31
|
+
http -->|"signed calls"| gateway["Your Gateway"]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
| Entrypoint | Who uses it | Authenticates with | Typical use |
|
|
35
|
+
| --------------------- | ------------------------------------------------------------- | ------------------------------------------------------------------ | ----------------------------------------------------------------------------- |
|
|
36
|
+
| Dashboard | Organization admins, Tenant admins and Organization operators | Organization sign-in, including SSO | Install the package, add users to Groups, manage access, rotate an app secret |
|
|
37
|
+
| Studio | Organization members who hold Studio access | Password, one-time code or the Organization's SSO | Chat with agents, open a Studio app, use a widget |
|
|
38
|
+
| CLI (`ci`) | Developers and pipelines | CLI Session from `ci login`, or `CI_MANAGEMENT_TOKEN` | Build and deploy the package, create API keys |
|
|
39
|
+
| HTTP API | Scripts and unattended runs | API key of a service principal, limited by Max Privileges | Script demo setup, run agent conversations without a person |
|
|
40
|
+
| External applications | Your web app's server | Client secret for sign-in, user access tokens, a Server Credential | The template's CRM pages and lead conversion |
|
|
41
|
+
| MCP | AI clients and assistants | Session token or API key, CI OAuth token, or MCP Profile token | Let an assistant run Skills and workflows |
|
|
42
|
+
| Workflow triggers | Other systems, the clock, apps, record changes | Depends on the trigger | Start a workflow from a webhook or on a schedule |
|
|
43
|
+
| Realtime | Your browser, through your BFF | Single-use ticket that your server requests | Refresh lists when a record changes |
|
|
44
|
+
|
|
45
|
+
The [credentials](#credentials) section lists every credential, who holds it and how long it lasts.
|
|
46
|
+
|
|
47
|
+
### Dashboard and Studio
|
|
48
|
+
|
|
49
|
+
Each surface has one entry capability: `dashboard` for the Dashboard, `studio` for Studio and `mcp` for MCP. A person who does not hold a surface's entry capability cannot open that surface, whatever else they hold. Every Organization stores six built-in, read-only Access Profiles, and the Dashboard shows them as roles:
|
|
50
|
+
|
|
51
|
+
| Built-in profile | Dashboard | Studio and MCP | Data |
|
|
52
|
+
| --------------------- | ---------------------------------------------------------- | -------------- | ------------------------------------------------------ |
|
|
53
|
+
| Organization admin | Every page; changes everything | Yes | Reads and writes where the core default policy applies |
|
|
54
|
+
| Organization operator | Every page except onboarding and transfer; changes nothing | Yes | Reads Knowledge where the core default policy applies |
|
|
55
|
+
| Studio user | No entry | Yes | Only what a policy or another profile opens |
|
|
56
|
+
| Knowledge reader | No entry by itself | No by itself | Reads Knowledge where no package policy applies |
|
|
57
|
+
| Tenant admin | Every page, plus the tenant area | Yes | Reads and writes every schema |
|
|
58
|
+
| Tenant operator | Every page and the tenant area; changes nothing | No | Reads every schema |
|
|
59
|
+
|
|
60
|
+
A view-only role depends on the surface. In the Dashboard it is the Organization operator, who reads every page and changes nothing. In Studio it is the Studio user, who chats with agents and uses Studio apps but cannot open the Dashboard. Knowledge reader is an add-on: give it next to another profile when that person must read Knowledge records.
|
|
61
|
+
|
|
62
|
+
An Organization admin manages one Organization and can grant every profile except the two tenant profiles. A Tenant admin holds the tenant profile in every Organization. Only a Tenant admin opens the tenant area (Organizations, users, AI models, maintenance, monitoring and tenant settings), creates Organizations, grants the tenant profiles and acts in any Organization. A Tenant operator reads the same pages and changes nothing.
|
|
63
|
+
|
|
64
|
+
Entering Studio opens no data by itself. A Studio user reads no Knowledge record and no Document until a package policy, the Knowledge reader profile or a custom profile opens it. An Organization operator already reads Knowledge records through the core administration policy, on every schema where a package has not replaced that policy, and reads no Document until a policy opens it. [Access](access.md) explains policies and grants, and [Studio](../ai/studio.md) covers what members do there.
|
|
65
|
+
|
|
66
|
+
The Dashboard shows each section only to a person who holds its administration capability at read. An Organization admin sees the Organization admin area with accounts, Groups, Access Profiles, capabilities, Max Privileges, access explanations, packages and a Developers area; separate areas hold AI (agents, Skills, tools, workflows, approvals), Apps (Studio, external applications, MCP), datasets and Documents. The Developers area has tabs for the CLI, connections, service principals and variables; only a Tenant admin can change a variable, and its CLI tab shows the exact `ci login` command for the Organization.
|
|
67
|
+
|
|
68
|
+
Organization members work in Studio. They chat with agents, open Studio apps, fill agent forms and read Documents. Building a Studio app is Dashboard work for an Organization admin. A package can also ship a whole Studio app, which CI creates and publishes on install; the template's Sales desk is one. A Studio widget never holds CI credentials. It calls CI through the Studio API client from `@collective-intelligence/extensions-sdk-frontend-react/studio-api`, which Studio binds to its own signed-in transport, so each request runs with the current user's permissions.
|
|
69
|
+
|
|
70
|
+
### CLI
|
|
71
|
+
|
|
72
|
+
The `ci` CLI runs on Bun and calls the backend only through its generated OpenAPI operations. Install it globally and sign in against the API URL of your tenant:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npm install -g @collective-intelligence/cli
|
|
76
|
+
ci login <api-url> --organization <organization-id>
|
|
77
|
+
ci whoami
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
`ci login` asks you to approve the device in the Dashboard and stores a 30-day CLI Session in your user profile. `ci upgrade` updates a global install. For a pipeline, `ci login <api-url> --pipeline-token --name <name> --expires <date|never>` issues a Pipeline Token instead: store it as `CI_MANAGEMENT_TOKEN` and pass `--organization`.
|
|
81
|
+
|
|
82
|
+
The Backend declares the oldest `ci` version it supports. Before a command that calls the Backend, a released `ci` reads this minimum from the discovery document. If `ci` is older, the command stops with `CliVersionUnsupportedError` and tells you to run `ci upgrade`.
|
|
83
|
+
|
|
84
|
+
> **Note:** `ci login` needs the API URL. It reads the tenant's discovery document at
|
|
85
|
+
> `/.well-known/ci-configuration` and rejects a Dashboard URL as "not a CI API
|
|
86
|
+
> URL".
|
|
87
|
+
|
|
88
|
+
The CLI takes credentials from a flag first, then from the environment (`CI_BACKEND_URL`, `CI_MANAGEMENT_TOKEN`), then from the stored profile. Developers at a terminal use `ci login`, and pipelines set `CI_MANAGEMENT_TOKEN`. Publishing reads `CI_PUBLISHER_TOKEN` from the environment only.
|
|
89
|
+
|
|
90
|
+
For a package, you use `ci package build`, `validate`, `publish`, `promote` and `install`, or the single `ci deploy` command, which publishes only when the release is absent, promotes only when needed, and then installs or updates. `ci package dev` runs a development session that serves your package modules from your machine to real Dashboard and Studio hosts. `ci package codegen` generates TypeScript types from the package schemas, and `ci doctor` checks discovery, signing keys, Organization access and redirect URIs.
|
|
91
|
+
|
|
92
|
+
When a command fails, the CLI prints one block: what failed, the Cause, the fix steps with the exact commands to run, whether a retry can help, and a reference with the Operation ID and Diagnostic ID. `ci diagnostics show <diagnostic-id>` reads the full failure when you may read it. [Extensions](../develop/extensions.md#when-a-deploy-fails) explains each line and who can read the full failure.
|
|
93
|
+
|
|
94
|
+
### HTTP API and API keys
|
|
95
|
+
|
|
96
|
+
The backend publishes its OpenAPI document at `/openapi.json`. Its wire schemas are the authority, and the SDKs and the CLI are generated from them. An external app meets these public route families:
|
|
97
|
+
|
|
98
|
+
- `/application/v1/*`, the Application API for external applications
|
|
99
|
+
- `/oauth/*`, the authorization server for app sign-in
|
|
100
|
+
- `/.well-known/ci-configuration`, the tenant discovery document
|
|
101
|
+
- `/mcp`, the MCP endpoint
|
|
102
|
+
- `/openapi.json`, the API description
|
|
103
|
+
|
|
104
|
+
Other route families serve the Dashboard and Studio. A generated operation is not safe for a client just because it exists in the OpenAPI document.
|
|
105
|
+
|
|
106
|
+
An unexpected server error answers HTTP 500 with the body `{"_tag":"InternalServerError"}` and the Diagnostic ID in the `x-diagnostic-id` header, which browsers can read. Log that ID in your app. `ci diagnostics show <diagnostic-id>` reads the full failure. For a request in an Organization, a reader needs `organization:self_manage` in that Organization or `tenant:manage`; for any other request, only `tenant:manage`.
|
|
107
|
+
|
|
108
|
+
An API key belongs to a service principal and acts with that principal's grants. API keys have no scopes. A key never acts beyond its Max Privileges template, and creating, rotating or revoking a key needs a person's session with manage access to API keys, which no API key has. You manage keys in the Dashboard under Developers > Service principals, or with the CLI:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
ci api-keys upsert --principal <principal-fqn> --name pipeline \
|
|
112
|
+
--max-privileges <template-fqn> --env-file .env.pipeline
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
A service principal key can run Studio agent conversations without a person. It can list apps, open and read conversations, send agent turns, and cancel or close a conversation. Approvals, memory, preferences and answers to questions stay with people.
|
|
116
|
+
|
|
117
|
+
> **Warning:** A service principal run asks no questions and has no Studio memory. When a
|
|
118
|
+
> tool binding has an approval gate, the unattended run approves by default and
|
|
119
|
+
> records the approval without an actor. Plan scripted demos around that
|
|
120
|
+
> behavior.
|
|
121
|
+
|
|
122
|
+
### External applications
|
|
123
|
+
|
|
124
|
+
An external application signs users in with the OAuth authorization code flow and S256 PKCE, through `/oauth/authorize` and `/oauth/token`. The Dashboard shows the sign-in and consent page with the Organization's branding and login methods, including SSO. CI publishes OAuth 2.0 authorization server metadata and is not an OpenID Connect provider.
|
|
125
|
+
|
|
126
|
+
A public client runs only in the browser and has a client id without a secret. A confidential client is a backend that keeps a client secret. Access tokens last 300 seconds, and only a confidential app can renew one without a browser redirect or exchange a member session for a token. The template's app is confidential.
|
|
127
|
+
|
|
128
|
+
A confidential app uses two different secrets. The client secret signs users in, renews their tokens and exchanges member sessions. A Server Credential authorizes the server's own calls to CI in service mode, with the grants that an admin gave the app's server. CI refuses the client secret on a server call, so keep the two secrets in separate env files:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
ci apps credentials upsert <app-fqn-or-id> --name server --env-file .env.server
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
The template's package declares its app, so `ci apps enroll` refuses it. Read its values with `ci apps env <application-id-or-fqn> --env-file apps/web/.env.local`, then issue the client secret with `ci apps rotate-secret <application-id>`. CI shows each secret only once.
|
|
135
|
+
|
|
136
|
+
In the template, the browser calls only same-origin `/api/*` routes. The BFF behind them, built with `createExternalApplicationBffNextHandlers` from the server SDK, signs users in with a sealed cookie, forwards Resource calls per entity contract, requests Realtime tickets and forwards capabilities. Only `NEXT_PUBLIC_APPLICATION_ID` is visible to the browser.
|
|
137
|
+
|
|
138
|
+
An app can start only a workflow whose active External application trigger names that app. The template's `POST /api/leads/{id}/convert` route uses `createFixedWorkflowRoute`, which starts exactly one workflow that the server configures (`acme.app.workflows.convert-lead`) with the idempotency key `convert-lead:{leadId}`. The route rejects a workflow name or key in browser input.
|
|
139
|
+
|
|
140
|
+
Every tool call in a run uses the current grants of the identity that the run acts as. A call with a user's delegated token acts as that user. The convert-lead route sends the signed-in user's delegated token, so the run acts as that user. When an app starts a workflow in service mode or with `runAsApplication`, no person starts it, so the run acts as the workflow's run-as service principal. [AI primitives](../ai/index.md) lists every case.
|
|
141
|
+
|
|
142
|
+
### MCP
|
|
143
|
+
|
|
144
|
+
The backend serves MCP at `/mcp` and at `/mcp/o/<organizationId>`. Every MCP request needs a valid Bearer token, including `initialize` and `tools/list`. CI accepts three kinds of token:
|
|
145
|
+
|
|
146
|
+
1. A CI session token or an API key. The call acts as that person or that service principal.
|
|
147
|
+
2. An OAuth access token that the AI client gets from CI's authorization server after a person approves it. Without a valid token, CI answers `401` with a pointer to its protected-resource metadata, so the client can start that sign-in. The token acts as the person who approved it.
|
|
148
|
+
3. An MCP Profile token that an Organization admin issues on one MCP Profile. It is a machine credential that never acts as a person, and it reaches only what its profile allows.
|
|
149
|
+
|
|
150
|
+
The server exposes these tools: `list_memberships`, `list_skills`, `run_skill`, `get_skill_run`, `list_operations`, `invoke_operation`, `get_operation`, `cancel_operation` and `explain_access`. `run_skill` runs in the background, so a client polls `get_skill_run` for the result.
|
|
151
|
+
|
|
152
|
+
A workflow becomes visible to MCP clients through an MCP operation trigger. The caller gets an opaque handle and reads the result with `get_operation`. An MCP Profile, managed in the Dashboard under Apps > MCP, defines what an MCP principal can see and do, and it denies everything by default. The built-in Studio user profile grants Studio and MCP use.
|
|
153
|
+
|
|
154
|
+
### Workflow triggers
|
|
155
|
+
|
|
156
|
+
A trigger is the entrypoint of a workflow. The core workflows package ships these triggers:
|
|
157
|
+
|
|
158
|
+
| Trigger | Starts a run when |
|
|
159
|
+
| -------------------- | -------------------------------------- |
|
|
160
|
+
| On demand | A user starts the workflow explicitly |
|
|
161
|
+
| Schedule | A cron expression fires |
|
|
162
|
+
| Webhook | Another system sends an HTTP `POST` |
|
|
163
|
+
| External application | A bound external application starts it |
|
|
164
|
+
| MCP operation | An MCP client invokes it |
|
|
165
|
+
| Entity created | A Knowledge record is created |
|
|
166
|
+
| Entity updated | A Knowledge record changes |
|
|
167
|
+
| Entity deleted | A Knowledge record is deleted |
|
|
168
|
+
|
|
169
|
+
Integration packages add message and file triggers for Slack, Microsoft 365 email, Teams and Drive, Telegram, WhatsApp, Twilio SMS and WhatsApp, and Notion.
|
|
170
|
+
|
|
171
|
+
A run that a person starts on demand acts as that person, unless the workflow's `runIdentity` is `service_principal`; then a production run acts as the workflow's run-as service principal, and only an editor test run keeps the person. A schedule, a webhook, a record event or an MCP operation starts a run with no person, so the run acts as the workflow's run-as service principal, and such a workflow must name one. An approval reviewer never becomes the run's identity, and child workflows and delegated agents keep the identity of the root run.
|
|
172
|
+
|
|
173
|
+
A webhook trigger accepts `POST` and returns JSON. The caller waits for the workflow's response until a deadline and then receives `202` with the run id. CI binds event triggers when it publishes the workflow, and it refuses to publish an enabled trigger with an invalid activation declaration. In the template, the convert-lead workflow is declared in the package, and its trigger names the app's FQN, which install resolves to the app id.
|
|
174
|
+
|
|
175
|
+
### Realtime
|
|
176
|
+
|
|
177
|
+
Realtime tells open pages that records changed. Your server requests a single-use ticket from `POST /application/v1/realtime/tickets`, and the browser opens an event stream at `GET /application/v1/realtime/events` with that ticket. Events carry ids only, so the page reloads the records through its own data routes. A subscription names a schema and an optional field-equals filter:
|
|
178
|
+
|
|
179
|
+
```ts
|
|
180
|
+
const realtime = createRealtimeClient({
|
|
181
|
+
ticketUrl: "/api/realtime/ticket",
|
|
182
|
+
document,
|
|
183
|
+
window,
|
|
184
|
+
onReset: () => queryClient.invalidateQueries(),
|
|
185
|
+
onAccessChanged: () => session.refresh()
|
|
186
|
+
})
|
|
187
|
+
realtime.subscribe(
|
|
188
|
+
{ schema: "crm.lead", filter: { field: "ownerId", eq: userId } },
|
|
189
|
+
(changes) => invalidateLeads(changes.map((change) => change.id))
|
|
190
|
+
)
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
On a reset, the client drops its local view and refetches every query that a subscription feeds.
|
|
194
|
+
|
|
195
|
+
### When CI calls you
|
|
196
|
+
|
|
197
|
+
A Gateway reverses the direction. You register a Gateway connection with an HTTPS endpoint and a setup credential, and CI uses that credential only for discovery and enrollment. After enrollment CI signs each call to your server with an ES256 token that lives 60 seconds by default and 300 seconds at most, and your server accepts each token only once. Your server holds no CI secret for these calls; it trusts the CI issuer that you configure. Your operations then become CI tools for chat, Skills and workflows. [External apps](../develop/external-apps.md) covers the setup.
|
|
198
|
+
|
|
199
|
+
### Credentials
|
|
200
|
+
|
|
201
|
+
Each credential is a separate authority. The tables group them by who holds them.
|
|
202
|
+
|
|
203
|
+
#### Held by people
|
|
204
|
+
|
|
205
|
+
| Credential | Type | Lifetime or rotation | Used for |
|
|
206
|
+
| ----------- | ------------------------------------ | ------------------------------------ | ---------------------------------------------------------------------------- |
|
|
207
|
+
| CI session | Opaque session token | 30 days by default; ends at sign-out | Dashboard and Studio work; also accepted by MCP and as `CI_MANAGEMENT_TOKEN` |
|
|
208
|
+
| CLI Session | The same session, made by `ci login` | 30 days; `ci logout` ends it | Interactive `ci` commands, stored in your user profile with mode `0600` |
|
|
209
|
+
|
|
210
|
+
The Connect Studio link that the Dashboard shows only tells the Studio desktop app which CI and Organization to use. The person then signs in with a password, a one-time code or SSO.
|
|
211
|
+
|
|
212
|
+
#### Held by pipelines and scripts
|
|
213
|
+
|
|
214
|
+
| Credential | Type | Lifetime or rotation | Used for |
|
|
215
|
+
| ------------------------------------------- | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
|
|
216
|
+
| Pipeline Token | Opaque secret with the prefix `cpt_`; a session of a technical account | The end chosen when it is issued, or never; the account or a Tenant Admin revokes it | Unattended `ci` commands and calls as that account, such as `ci deploy` |
|
|
217
|
+
| API key | Opaque secret with the prefix `dpk_` | No expiry at creation; a rotation keeps the old secret 24 hours; a revocation ends both | Calls with a service principal's grants, cut to a Max Privileges template |
|
|
218
|
+
| `CI_MANAGEMENT_TOKEN` | Environment variable with a Pipeline Token, an API key or a session token | That of the token it holds | Unattended `ci` commands; an API key fixes the Organization |
|
|
219
|
+
| Publisher credential (`CI_PUBLISHER_TOKEN`) | Opaque secret for one exact package name | Optional expiry; a revocation stops it at once | Publish and promote for that package only |
|
|
220
|
+
|
|
221
|
+
#### Held by your external app
|
|
222
|
+
|
|
223
|
+
| Credential | Type | Lifetime or rotation | Used for |
|
|
224
|
+
| ------------------ | ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
|
|
225
|
+
| Client id | Public OAuth identifier | Fixed for the app | Sign-in; safe in the browser |
|
|
226
|
+
| Client secret | Opaque secret, confidential apps only | Until rotated; a rotation replaces it at once | Sign-in, token renewal and member-session exchange |
|
|
227
|
+
| Server Credential | Opaque secret with the prefix `dsc_` | A rotation keeps the old secret 24 hours; a revocation ends both | The server's own calls to CI in service mode |
|
|
228
|
+
| User access token | ES256 token, kept on the server | 300 seconds | Application API calls as the signed-in user |
|
|
229
|
+
| Renewal credential | Opaque secret; a public app gets a new one at each renewal | 14 days after the last renewal, never past the user's CI session | New access tokens without a browser redirect |
|
|
230
|
+
| Session cookie | Cookie sealed with `SESSION_SECRETS` | Set once at sign-in: until the end of the user's CI session, or `sessionTtlSeconds` (300 seconds to 30 days) when that is earlier | The browser's same-origin `/api/*` calls to your BFF |
|
|
231
|
+
|
|
232
|
+
The browser holds only the sealed cookie and the application id. The access token and the renewal credential stay on the server.
|
|
233
|
+
|
|
234
|
+
#### Held by AI clients
|
|
235
|
+
|
|
236
|
+
| Credential | Type | Lifetime or rotation | Used for |
|
|
237
|
+
| ----------------- | ----------------------------------- | ----------------------------------------- | ----------------------------------------------- |
|
|
238
|
+
| MCP OAuth token | Access token from CI's OAuth server | 30 days by default; no renewal credential | MCP calls as the person who approved the client |
|
|
239
|
+
| MCP Profile token | Opaque machine token | Until an Organization admin revokes it | MCP calls limited to one MCP Profile |
|
|
240
|
+
|
|
241
|
+
#### Between CI and outside systems
|
|
242
|
+
|
|
243
|
+
| Credential | Type | Lifetime or rotation | Used for |
|
|
244
|
+
| ------------------------ | ------------------------------------------- | ------------------------------------------- | ------------------------------------------------ |
|
|
245
|
+
| Gateway caller token | ES256 token that CI signs | 60 seconds by default, 300 at most; one use | CI calls to your Gateway |
|
|
246
|
+
| Gateway setup credential | Secret that you choose | You rotate it; CI reads it at each setup | Gateway discovery and enrollment only |
|
|
247
|
+
| Connection credentials | Fields of a connection template, kept in CI | As long as the outside system accepts them | Connectors and tools that call an outside system |
|
|
248
|
+
|
|
249
|
+
A connection keeps every field that its template marks secret as a secret. A package supplies such a value through a `secret` package variable, which deploys only as a link to an Organization variable, never inline. Your external app never sees connection credentials, and CI never sends a management or publisher token to a Gateway.
|
|
250
|
+
|
|
251
|
+
## Code entrypoints
|
|
252
|
+
|
|
253
|
+
Code in the template imports CI packages and its own workspaces by package name and exported entry, for example `@packages/features-lead-client`, and never by relative path. A CI SDK splits its code by subpath. A template domain splits its code by part: one package for each runtime.
|
|
254
|
+
|
|
255
|
+
### SDK subpaths
|
|
256
|
+
|
|
257
|
+
The SDKs split by where the code runs. [SDKs](../develop/sdks.md) has the full map; these are the subpaths you meet most.
|
|
258
|
+
|
|
259
|
+
| Package | Runs | Holds | Main subpaths |
|
|
260
|
+
| ----------------------------------------------------------- | ------------------ | ------------------------------------------------------------------------ | ---------------------------------------------------------- |
|
|
261
|
+
| `@collective-intelligence/extensions-sdk` | Inside CI | Declarations such as `declarePackage`, `declareAgent`, `declareWorkflow` | `.`, `./effect` |
|
|
262
|
+
| `@collective-intelligence/extensions-sdk-backend` | Inside CI | Contracts for backend tools and connectors | `.`, `./effect` |
|
|
263
|
+
| `@collective-intelligence/extensions-sdk-frontend` | Inside CI | Framework-neutral frontend catalog | `.`, `./effect` |
|
|
264
|
+
| `@collective-intelligence/extensions-sdk-frontend-react` | Inside CI | React bindings for Studio and Dashboard contributions | `./studio`, `./dashboard`, `./studio-api`, `./effect` |
|
|
265
|
+
| `@collective-intelligence/external-apps-server-sdk` | Your server | Server client, BFF, authentication, Gateway | `.`, `./auth/federated`, `./effect`, `./next`, `./gateway` |
|
|
266
|
+
| `@collective-intelligence/external-apps-server-sdk-payload` | Your Payload Site | Payload Plugin, Payload Package Helpers, `payload ci-generate` | `.`, `./package`, `./ci-generate` |
|
|
267
|
+
| `@collective-intelligence/external-apps-server-sdk-strapi` | Your Strapi 5 site | Strapi 5 adapter that serves documents through a Gateway | `.` |
|
|
268
|
+
| `@collective-intelligence/external-apps-client-sdk` | Your browser | React-free client and Realtime | `.`, `./resources`, `./effect` |
|
|
269
|
+
| `@collective-intelligence/external-apps-client-sdk-react` | Your browser | React hooks, including the entity hooks in `./resources` | `.`, `./resources`, `./effect` |
|
|
270
|
+
|
|
271
|
+
Every SDK puts its Promise API at the root and its Effect services, Layers, errors and Schemas at `/effect`; the two CMS SDKs, the Payload SDK and the Strapi SDK, have no `/effect`. `effect` is a required peer of every SDK (the Strapi SDK gets it through the server SDK), so install it next to the SDK and keep one `effect` version in the app. Optional peers such as Next.js, Express, Drizzle, Better Auth and the AI SDK sit behind their own subpaths, so importing the server SDK root never loads them. In the template, `/next` is imported only inside `apps/web/src/server`, because `/next` loads Next.js and `/effect` does not.
|
|
272
|
+
|
|
273
|
+
### Template domain parts
|
|
274
|
+
|
|
275
|
+
Each template domain has up to four parts. A part is one package with one runtime:
|
|
276
|
+
|
|
277
|
+
| Part | Holds | Imported by |
|
|
278
|
+
| -------- | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- |
|
|
279
|
+
| `model` | Effect Schema models, resource contracts, pure rules, the domain `HttpApi` under `/api/app`, and the CI names other parts need | the domain's other parts, other domains, the apps |
|
|
280
|
+
| `server` | The route Layer of the domain `HttpApi` and its services | `apps/web/src/server` only |
|
|
281
|
+
| `client` | Typed client, query options, XState machines, entity bindings, Realtime hooks, simulated sources, wired React views | the app |
|
|
282
|
+
| `ci` | CI declarations, written as factories over Identity Domain handles | `apps/extensions` |
|
|
283
|
+
|
|
284
|
+
In one domain, `server`, `client` and `ci` import their own `model` and never each other. Across domains, a part imports only the other domain's `model` part. `turbo boundaries` enforces these rules with the `tier:*`, `runtime:*` and `part:*` tags of each package.
|
|
285
|
+
|
|
286
|
+
A domain has only the parts it needs. `features/lead` has all four, while `features/lead-qualification` has only `model` and `ci`. Its `ci` part holds the lead qualifier agent, its Skill, its tool and its Studio widget, and its `model` part holds their FQNs. The `ci` part is where solution code becomes code that CI installs.
|
|
287
|
+
|
|
288
|
+
### Template routes and widgets
|
|
289
|
+
|
|
290
|
+
The web app has three route files, and each only re-exports handlers from `server/` and the domain parts:
|
|
291
|
+
|
|
292
|
+
| Route file | Serves |
|
|
293
|
+
| ------------------------------------- | ------------------------------------------------------ |
|
|
294
|
+
| `app/api/app/[[...path]]/route.ts` | The app's own API, composed from the domain `HttpApi`s |
|
|
295
|
+
| `app/api/[...path]/route.ts` | The CI BFF: sign-in, Resources, Realtime ticket |
|
|
296
|
+
| `app/api/leads/[id]/convert/route.ts` | The fixed convert-lead workflow |
|
|
297
|
+
|
|
298
|
+
Inside CI, a Studio or Dashboard widget enters through a hosted contribution. You write `declareFrontendCatalogContribution({ fqn, host: "studio", load: () => import("./studio") })` and pass it to `declarePackage({ hostedContributions })`. The `load` function stays out of the serialized package manifest, and the loaded module exports `loadFrontendCatalog` for the host.
|
|
299
|
+
|
|
300
|
+
## Pick an entrypoint
|
|
301
|
+
|
|
302
|
+
| I want to | Use |
|
|
303
|
+
| ------------------------------------ | ---------------------------------------------------------- |
|
|
304
|
+
| Let users chat with an agent | Studio |
|
|
305
|
+
| Let users work in my web app | The Application API through my BFF |
|
|
306
|
+
| Start a workflow from my app | A fixed workflow route and an External application trigger |
|
|
307
|
+
| Start a workflow from another system | A webhook trigger |
|
|
308
|
+
| Run a workflow every night | A schedule trigger |
|
|
309
|
+
| Let an AI assistant call CI | MCP |
|
|
310
|
+
| Script a demo setup | The CLI with a service principal API key |
|
|
311
|
+
| Let CI call my system | A Gateway |
|
|
312
|
+
|
|
313
|
+
## Related pages
|
|
314
|
+
|
|
315
|
+
- [Platform architecture](architecture.md): Tenants, Organizations, surfaces and the package lifecycle.
|
|
316
|
+
- [Studio](../ai/studio.md): What Organization members do in Studio.
|
|
317
|
+
- [Access](access.md): Access Profiles, Access Grants and Max Privileges.
|
|
318
|
+
- [SDKs](../develop/sdks.md): Every CI package and its subpaths.
|
|
319
|
+
- [External apps](../develop/external-apps.md): The BFF, sign-in and the Gateway.
|
|
320
|
+
- [Template](../template/index.md): The packages and routes of the template.
|