@collective-intelligence/ai 0.0.0-stage → 0.8.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 +52 -0
- package/README.md +462 -2
- package/dist/api/access-check.d.ts +18 -0
- package/dist/api/answer-sources.d.ts +48 -0
- package/dist/api/attachments-api.d.ts +187 -0
- package/dist/api/catalog-api.d.ts +408 -0
- package/dist/api/chat-api.d.ts +2401 -0
- package/dist/api/chat-surface-api.d.ts +4186 -0
- package/dist/api/compaction.d.ts +52 -0
- package/dist/api/conversations.d.ts +107 -0
- package/dist/api/errors.d.ts +117 -0
- package/dist/api/feedback-api.d.ts +185 -0
- package/dist/api/files.d.ts +22 -0
- package/dist/api/ids.d.ts +33 -0
- package/dist/api/index.d.ts +21 -0
- package/dist/api/intents-api.d.ts +65 -0
- package/dist/api/place-context.d.ts +34 -0
- package/dist/api/projects-api.d.ts +718 -0
- package/dist/api/speech-api.d.ts +345 -0
- package/dist/api/transcript.d.ts +260 -0
- package/dist/api/turns.d.ts +196 -0
- package/dist/api.d.ts +21 -0
- package/dist/api.js +1 -0
- package/dist/domain/access.d.ts +29 -0
- package/dist/domain/context-trail.d.ts +65 -0
- package/dist/domain/data-parts.d.ts +247 -0
- package/dist/domain/errors.d.ts +28 -0
- package/dist/domain/index.d.ts +14 -0
- package/dist/domain/intents.d.ts +101 -0
- package/dist/domain/message.d.ts +173 -0
- package/dist/domain/place.d.ts +17 -0
- package/dist/domain/runtime-value.d.ts +16 -0
- package/dist/domain-50vzrrp9.js +2 -0
- package/dist/domain-5fpd4fte.js +1 -0
- package/dist/domain-9wzbv87n.js +2 -0
- package/dist/domain-g97xs965.js +2 -0
- package/dist/domain-hk3yw2m7.js +1 -0
- package/dist/domain-qyts6dgz.js +0 -0
- package/dist/domain-s07s1ry1.js +2 -0
- package/dist/domain.d.ts +14 -0
- package/dist/domain.js +1 -0
- package/dist/headless/access/access-store.d.ts +28 -0
- package/dist/headless/access/visibility.d.ts +24 -0
- package/dist/headless/blocked-state.d.ts +21 -0
- package/dist/headless/chat-registry.d.ts +63 -0
- package/dist/headless/chat-session-provider.d.ts +109 -0
- package/dist/headless/chat-surface.d.ts +4210 -0
- package/dist/headless/host-ports.d.ts +146 -0
- package/dist/headless/index.d.ts +33 -0
- package/dist/headless/intents/card-ends.d.ts +22 -0
- package/dist/headless/intents/intent-call.d.ts +28 -0
- package/dist/headless/intents/intents-provider.d.ts +108 -0
- package/dist/headless/intents/page-registry.d.ts +129 -0
- package/dist/headless/intents/use-intent-dispatch.d.ts +60 -0
- package/dist/headless/intents/use-intents.d.ts +11 -0
- package/dist/headless/intents/use-returned-intent-handle.d.ts +11 -0
- package/dist/headless/launch/chat-launch.d.ts +42 -0
- package/dist/headless/launch/launch-target.d.ts +25 -0
- package/dist/headless/launch/submit.d.ts +29 -0
- package/dist/headless/run-state.d.ts +16 -0
- package/dist/headless/sent-files.d.ts +20 -0
- package/dist/headless/server-started-turn-follow.proof.d.ts +26 -0
- package/dist/headless/session-machine.d.ts +745 -0
- package/dist/headless/trail/buffer.d.ts +48 -0
- package/dist/headless/trail/json-ld.d.ts +10 -0
- package/dist/headless/trail/switches.d.ts +10 -0
- package/dist/headless/trail/trail-provider.d.ts +53 -0
- package/dist/headless/transcript-messages.d.ts +26 -0
- package/dist/headless.d.ts +33 -0
- package/dist/headless.js +2 -0
- package/dist/transport/chat-client.d.ts +25 -0
- package/dist/transport/chat-transport.d.ts +57 -0
- package/dist/transport/index.d.ts +6 -0
- package/dist/transport/simulated-chat-transport.d.ts +39 -0
- package/dist/transport.d.ts +6 -0
- package/dist/transport.js +1 -0
- package/dist/views/assistant-sidebar/assistant-sidebar.d.ts +15 -0
- package/dist/views/assistant-sidebar/layout.d.ts +47 -0
- package/dist/views/assistant-sidebar/toggle.d.ts +14 -0
- package/dist/views/assistant-sidebar/use-shortcut.d.ts +11 -0
- package/dist/views/blocked/chat-blocked-state.d.ts +15 -0
- package/dist/views/chat-operations.d.ts +46 -0
- package/dist/views/chat-root.d.ts +14 -0
- package/dist/views/chat.d.ts +51 -0
- package/dist/views/composer/capability-picker.d.ts +77 -0
- package/dist/views/composer/capability-pickers.d.ts +24 -0
- package/dist/views/composer/chat-composer.d.ts +15 -0
- package/dist/views/composer/composer-picks.d.ts +31 -0
- package/dist/views/composer/composer-trail.d.ts +21 -0
- package/dist/views/composer/draft-attachments.d.ts +36 -0
- package/dist/views/composer/queued-messages.d.ts +9 -0
- package/dist/views/composer/send-menu.d.ts +11 -0
- package/dist/views/composer/slash-suggestions.d.ts +37 -0
- package/dist/views/composer/trail-chips.d.ts +15 -0
- package/dist/views/composer/voice-input/microphone.d.ts +14 -0
- package/dist/views/composer/voice-input/remote-transcription.d.ts +12 -0
- package/dist/views/composer/voice-input/use-voice-input.d.ts +30 -0
- package/dist/views/composer/voice-input/voice-input.d.ts +15 -0
- package/dist/views/dock/chat-dock.d.ts +57 -0
- package/dist/views/dock/dock-session.d.ts +22 -0
- package/dist/views/header/chat-header.d.ts +10 -0
- package/dist/views/header/compaction-controls.d.ts +17 -0
- package/dist/views/header/memory-switch.d.ts +16 -0
- package/dist/views/index.d.ts +58 -0
- package/dist/views/intents/form-fields.d.ts +38 -0
- package/dist/views/intents/intent-card.d.ts +61 -0
- package/dist/views/intents/intent-form.d.ts +23 -0
- package/dist/views/intents/intent-notices.d.ts +39 -0
- package/dist/views/intents/intent-trigger.d.ts +46 -0
- package/dist/views/intents/labels.d.ts +23 -0
- package/dist/views/labels/en.d.ts +3 -0
- package/dist/views/labels/index.d.ts +13 -0
- package/dist/views/labels/it.d.ts +3 -0
- package/dist/views/labels/types.d.ts +7 -0
- package/dist/views/launch/chat-launch-button.d.ts +21 -0
- package/dist/views/parts/answer-feedback.d.ts +26 -0
- package/dist/views/parts/evidence-part.d.ts +8 -0
- package/dist/views/parts/file-part.d.ts +8 -0
- package/dist/views/parts/image-generation-part.d.ts +9 -0
- package/dist/views/parts/image-generation.d.ts +84 -0
- package/dist/views/parts/intent-card-part.d.ts +8 -0
- package/dist/views/parts/memory-evidence-part.d.ts +7 -0
- package/dist/views/parts/message-parts.d.ts +21 -0
- package/dist/views/parts/question-part.d.ts +8 -0
- package/dist/views/parts/read-aloud.d.ts +23 -0
- package/dist/views/parts/reasoning-part.d.ts +8 -0
- package/dist/views/parts/steering-message-part.d.ts +7 -0
- package/dist/views/parts/text-part.d.ts +4 -0
- package/dist/views/parts/tool-part.d.ts +11 -0
- package/dist/views/parts/types.d.ts +103 -0
- package/dist/views/parts/use-read-aloud.d.ts +13 -0
- package/dist/views/run-trace/message-run.d.ts +17 -0
- package/dist/views/run-trace/run-stream.d.ts +128 -0
- package/dist/views/run-trace/run-trace-parts.d.ts +26 -0
- package/dist/views/run-trace/run-trace.d.ts +31 -0
- package/dist/views/sidebar/conversation-dialogs.d.ts +38 -0
- package/dist/views/sidebar/conversation-row.d.ts +23 -0
- package/dist/views/sidebar/conversation-sidebar.d.ts +10 -0
- package/dist/views/sidebar/date-groups.d.ts +12 -0
- package/dist/views/sidebar/history-filter.d.ts +57 -0
- package/dist/views/sidebar/projects/project-dialogs.d.ts +40 -0
- package/dist/views/sidebar/projects/project-files.d.ts +16 -0
- package/dist/views/sidebar/projects/project-groups.d.ts +19 -0
- package/dist/views/sidebar/projects/project-view.d.ts +21 -0
- package/dist/views/sidebar/projects/projects-section.d.ts +21 -0
- package/dist/views/sidebar/projects/use-chat-projects.d.ts +32 -0
- package/dist/views/slots.d.ts +148 -0
- package/dist/views/transcript/chat-transcript.d.ts +13 -0
- package/dist/views/transcript/sent-trail.d.ts +13 -0
- package/dist/views/transcript/use-image-reload.d.ts +16 -0
- package/dist/views.d.ts +58 -0
- package/dist/views.js +3 -0
- package/docs/guide/ai/index.md +377 -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 +279 -0
- package/docs/guide/develop/infrastructure.md +135 -0
- package/docs/guide/develop/sdks.md +233 -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 +318 -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/package.json +123 -4
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# Choosing primitives
|
|
2
|
+
|
|
3
|
+
Questions, criteria and scenario patterns for picking the CI primitives a demo needs.
|
|
4
|
+
|
|
5
|
+
A customer scenario reaches the demo team as a story, such as a sales desk that qualifies leads or a back office that reads uploaded documents. This page gives the criteria that turn such a story into CI primitives. The [template](../template/index.md) is one finished answer, a small sales CRM with Lead and Opportunity schemas in Knowledge, an external application for the web app, a convert-lead workflow, a lead qualifier agent and a Sales desk Studio app.
|
|
6
|
+
|
|
7
|
+
Some screens need no primitive at all. The template's public intake form posts to an API inside the web app, and that API keeps requests in memory until you replace its store with a database layer.
|
|
8
|
+
|
|
9
|
+
## Decision path
|
|
10
|
+
|
|
11
|
+
A scenario raises three separate questions: where its data lives, what kind of work it needs, and who uses its screens. Answer each one with its own chart and combine the results.
|
|
12
|
+
|
|
13
|
+
### Where the data lives
|
|
14
|
+
|
|
15
|
+
The first question is who keeps the authoritative copy of the data. [Data resources](../data/index.md) compares Knowledge, datasets and Documents in more depth.
|
|
16
|
+
|
|
17
|
+
```mermaid
|
|
18
|
+
flowchart TD
|
|
19
|
+
D{Who keeps the authoritative copy?}
|
|
20
|
+
D -->|CI| M{What shape is the data?}
|
|
21
|
+
M -->|Records that people and agents edit| K[Knowledge schema]
|
|
22
|
+
M -->|Rows to read and aggregate| MD[Managed dataset]
|
|
23
|
+
M -->|Files that people browse and agents search| DOC[Documents]
|
|
24
|
+
D -->|An outside system| X{How does CI reach it?}
|
|
25
|
+
X -->|Live queries on a warehouse| XD[External dataset]
|
|
26
|
+
X -->|Records and actions in the customer app| GW[Gateway]
|
|
27
|
+
X -->|A copy in CI kept in sync| CON[Knowledge connector]
|
|
28
|
+
D -->|Only the app| APP[App-owned storage]
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
A Knowledge connector turns the outside records into connected records in Knowledge. When agents need only a few fields of an app database, put a projection of those fields into a Knowledge schema and keep personal data in the app.
|
|
32
|
+
|
|
33
|
+
### What kind of work it needs
|
|
34
|
+
|
|
35
|
+
```mermaid
|
|
36
|
+
flowchart TD
|
|
37
|
+
W{What kind of work is it?}
|
|
38
|
+
W -->|A rule with one right answer| T[Tool]
|
|
39
|
+
W -->|Fixed steps in a fixed order| WF[Workflow]
|
|
40
|
+
W -->|A path that depends on what it finds| AG[Agent with a Skill]
|
|
41
|
+
W -->|Logic that an existing backend already runs| RT[Gateway with a remote tool collection]
|
|
42
|
+
WF --> A{Must a person approve a side effect?}
|
|
43
|
+
AG --> A
|
|
44
|
+
A -->|Inside the workflow| AN[Workflow approval node]
|
|
45
|
+
A -->|In chat or a Skill form| TA[Tool binding with approval]
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
A file that feeds one extraction step goes to a workflow as its input. [Workflow, agent or tool](index.md#workflow-agent-or-tool) and [Approvals depend on the caller](index.md#approvals-depend-on-the-caller) below explain the hard cases.
|
|
49
|
+
|
|
50
|
+
### Who uses the screens
|
|
51
|
+
|
|
52
|
+
```mermaid
|
|
53
|
+
flowchart TD
|
|
54
|
+
U{Who uses the screen?}
|
|
55
|
+
U -->|Customers or members outside CI| EA[External app with a BFF]
|
|
56
|
+
U -->|Staff in Studio| S{Do the built-in views show it?}
|
|
57
|
+
S -->|Yes| BV[Studio app with built-in views]
|
|
58
|
+
S -->|No| CW[Studio app with a custom widget]
|
|
59
|
+
U -->|Nobody yet, a first visual pitch| MOCK[Mock screens with simulated saves]
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The sales CRM answers the data chart with Knowledge schemas and the work chart with a workflow, an agent and a tool. It answers the screen chart twice: customers use the external app, and staff use a Studio app that places a built-in list view and a custom widget on one page.
|
|
63
|
+
|
|
64
|
+
## Criteria
|
|
65
|
+
|
|
66
|
+
| Signal in the scenario | Primitive | Why | Watch out for |
|
|
67
|
+
| ----------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------- |
|
|
68
|
+
| People in the app or Studio, agents and workflows all read and edit the records | [Knowledge schema](../data/knowledge.md) | One typed record per real thing, with relations, search and data policies that every surface shares | Measurements, events and other high-volume rows belong in a dataset, so do not create one record per row |
|
|
69
|
+
| Rows that people read and aggregate, such as a CSV or Excel export with trends | [Managed dataset](../data/datasets.md) | CI stores the typed rows and answers records, aggregate and time-series queries | A dataset declared with no data policy grants access to nobody, and deploy does not import the file |
|
|
70
|
+
| A warehouse such as Microsoft Fabric or Databricks holds the data, and it must stay there | [External dataset](../data/datasets.md) | CI queries the source live and keeps no copy | Queries take no SQL, and a provider outage fails the query with no fallback |
|
|
71
|
+
| The customer's own app and database keep the records | [Gateway](../develop/external-apps.md) | CI reaches the resources, dataset queries and operations that the customer server declares | The Gateway exposes only what its definition lists and never creates CI schemas |
|
|
72
|
+
| The app database is the authority, but agents need some of its fields | [Knowledge schema](../data/knowledge.md) with a projection | Only the needed, non-personal fields leave the app | Decide field by field what may leave; personal data stays in the app database |
|
|
73
|
+
| Files that people browse and agents search | [Documents](../data/documents.md) in a Document Collection | Collections hold folders, versions and permissions per path, and a connected collection stays in sync with a drive | A [Documents connector](../data/connectors.md) sync creates no Knowledge records, and new files become searchable only after indexing |
|
|
74
|
+
| A file that feeds one extraction step and nothing else | Stored file passed to a [workflow](../ai/index.md) | The workflow takes the file as `storageFileId` and returns extracted values | Use Documents instead when people must find the file later |
|
|
75
|
+
| A SaaS tool or SQL database that the demo imports from on a schedule | [Knowledge connector](../data/connectors.md) | A connector instance maps source fields to Knowledge schemas and runs full or delta imports | Installing the instance imports nothing until a schedule or a manual trigger runs, and SQL delta imports need a watermark column |
|
|
76
|
+
| A fixed sequence such as extract, check, create and notify | [Workflow](../ai/index.md) | A graph of steps with triggers, approvals and typed output, where a prompt node covers one bounded AI step | Every triggered workflow needs a service principal as its run-as identity |
|
|
77
|
+
| Open-ended work such as answering questions, finding matches or qualifying | [Agent with a Skill](../ai/index.md) | The agent picks its path from what it finds and returns typed output inside stated boundaries | A Skill can use only tools that its agent also allows, so the agent lists the Skill's tools again |
|
|
78
|
+
| A rule that must give the same answer every time | [Tool](../ai/index.md) | Code computes the result, and the agent explains it | An agent can call the tool only when its `usageScopes` include `"automation"` |
|
|
79
|
+
| A side effect that a person must approve | [Tool binding with approval](../ai/index.md), or a workflow approval node | `approval: "always"` or a named rule pauses the call until someone decides | A named rule must exist in the Organization before install, and an unattended agent run approves by default |
|
|
80
|
+
| Customers or members use the UI outside CI | [External application](../develop/external-apps.md) | The web app keeps its own UI and reaches CI through its BFF with a sealed-cookie session | The app takes no OAuth scopes; its app gate and Max Privileges limit what users can do |
|
|
81
|
+
| Staff work inside Studio | [Studio app](../develop/extensions.md) | Built-in views show schema records without code, and custom widgets cover what they cannot show | A Declared Studio App is read-only in the Studio builder and changes only with a new package release |
|
|
82
|
+
| Agents must call logic that an existing backend already implements | [Gateway with a remote tool collection](../develop/external-apps.md) | The logic stays in the customer service and reaches agents as tools | CI signs a short-lived token for every Gateway call, and browser cookies never authorize one |
|
|
83
|
+
| Some people may see or do things that others may not | [Access Profiles and Access Grants](../platform/access.md) | Capabilities and Knowledge data policies decide actions and visible records, and grants give them to Groups | Knowledge data policies do not cover datasets, which list their principals in their own policy |
|
|
84
|
+
| Logs, counters or sessions that only the app needs | App-owned storage behind the app API | No CI user or agent reads this data | A staff page that shows it needs its own credential in the app |
|
|
85
|
+
|
|
86
|
+
## Workflow, agent or tool
|
|
87
|
+
|
|
88
|
+
A workflow prompt node and an agent both call a model, which makes this the choice newcomers most often get wrong. A prompt node fits a step with fixed input and output shapes at a fixed place in a sequence, while an agent fits work whose path depends on what it finds. A rule that must give the same answer every time belongs in a tool that the agent or Skill calls. The template's lead score tool adds named points ("Work email" 40, "Email domain matches the company" 30, "Qualified by sales" 30), and the lead qualifier agent submits that score with a one-sentence rationale. In the demos built so far, document extraction, enrichment and approvals ran as workflows, and question answering, matching and qualification ran as agents.
|
|
89
|
+
|
|
90
|
+
An agent that must not change data says so in `behavioralBoundaries`. The lead qualifier declares "Never change a Lead or create an Opportunity". When an agent should help with a change, let it propose the change and let the person apply it with a button in the app.
|
|
91
|
+
|
|
92
|
+
A workflow's trigger follows from who or what starts the work. A `schedule` trigger runs it on a clock, `entity-created` and `entity-updated` react to Knowledge changes, `external-application` lets the web app start it, and `on-demand` lets staff start it from Studio. A run acts as the identity that started it: by default a person who starts it runs it as themselves, a workflow in `service_principal` run identity mode runs as its run-as service principal, and a start with no person, such as a schedule or a record event, needs that mode. The template's convert-lead workflow uses the `external-application` trigger, runs as the signed-in user when the web app starts it with the user's token, and names `convert-lead-runner` as its run-as service principal. See [AI](../ai/index.md) for the full comparison of tools, Skills, agents and workflows.
|
|
93
|
+
|
|
94
|
+
## Approvals depend on the caller
|
|
95
|
+
|
|
96
|
+
In chat or a Skill form, a tool binding with `approval: "always"` or a named rule pauses the call until a person decides. A workflow pauses at an explicit approval node, and the approver decides from Studio notifications.
|
|
97
|
+
|
|
98
|
+
> **Warning:** An unattended agent run has no person to ask. When one of its tool bindings
|
|
99
|
+
> requires approval, CI approves the call by default and records that decision.
|
|
100
|
+
> If the demo must show a person approving, use chat, a Skill form or a workflow
|
|
101
|
+
> approval node.
|
|
102
|
+
|
|
103
|
+
## Scenario patterns
|
|
104
|
+
|
|
105
|
+
| Pattern | Primitives | Why |
|
|
106
|
+
| ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
107
|
+
| Sales CRM: staff qualify and convert leads that arrive through a public site | Lead and Opportunity [Knowledge schemas](../data/knowledge.md), an [external application](../develop/external-apps.md) with a BFF, the convert-lead [workflow](../ai/index.md), a lead qualifier agent with a Skill and a scoring tool, a Sales desk [Studio app](../develop/extensions.md) | People edit leads in the web app, staff read them in Studio, and the agent reads the same records. This is the [template](../template/index.md). |
|
|
108
|
+
| Data kept in the customer's database: the customer will not move its records | An external application and a [Gateway](../develop/external-apps.md) that exposes entity CRUD, a read-only dataset query and one business operation | CI reaches the records in place, so nothing is copied into Knowledge |
|
|
109
|
+
| Existing backend logic for agents: a service already implements the business rule | A Gateway with a remote tool collection | One service answers its own API, a CI operation binding and an agent tool, so its code never moves into a package |
|
|
110
|
+
| Document intake: people upload a document and expect structured data back | A stored file, a workflow started with `storageFileId`, an approval node, a Studio upload form | Extraction is a fixed sequence, so a workflow runs it. A website upload and a Studio upload form start the same workflow with the same input, and the app server settles the result. |
|
|
111
|
+
| Member portal: members sign in on a public site, and staff run the back office in Studio | Knowledge schemas with data policies, [Access Profiles](../platform/access.md), an external application, Studio apps, agents for member questions and matching, workflows for enrichment, scheduled jobs and approvals, app-owned storage for activity logs | Records that members and staff both edit live in Knowledge, where a data policy can hide a flagged record from everyone. An `entity-updated` workflow asks the app to re-read changed records, and activity logs stay in the app database. |
|
|
112
|
+
| Collaborative tracker: several people edit plans, actions and comments at the same time | Knowledge schemas with relations, Realtime and optimistic writes in the external application | An edit in one window appears in the others without a reload ([state machines](../template/state-machines.md) shows how), and the first demo needs no AI primitive |
|
|
113
|
+
| App database as the authority: the app owns the records, but staff want AI advice | A Knowledge schema that holds a projection of non-personal fields, an advisory agent | Contacts and other personal data never leave the app, and staff decide what to do with the agent's advice |
|
|
114
|
+
| Pure mock demo: a first visual pitch before any integration | No CI primitive; a state machine with simulated saves in Effect | The screens can be shown before CI work starts, and CI primitives come later |
|
|
115
|
+
|
|
116
|
+
Connectors, datasets declared in a package and Document Collections appear in the criteria above because the platform supports them, but no shipped demo pattern uses them yet.
|
|
117
|
+
|
|
118
|
+
Demos built from the template started with Knowledge schemas, access and an external application, and they added agents and workflows only where the scenario asked for them; one demo shipped with no CI primitive at all.
|
|
119
|
+
|
|
120
|
+
## Related pages
|
|
121
|
+
|
|
122
|
+
- [Knowledge](../data/knowledge.md)
|
|
123
|
+
- [Datasets](../data/datasets.md)
|
|
124
|
+
- [Documents](../data/documents.md)
|
|
125
|
+
- [Connectors](../data/connectors.md)
|
|
126
|
+
- [AI](../ai/index.md)
|
|
127
|
+
- [External apps](../develop/external-apps.md)
|
|
128
|
+
- [Extensions](../develop/extensions.md)
|
|
129
|
+
- [Access](../platform/access.md)
|
|
130
|
+
- [The template](../template/index.md)
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
# The solution template
|
|
2
|
+
|
|
3
|
+
What you get from next-effect-app, where each piece of code goes, and how to take a new demo from local dev to an installed package.
|
|
4
|
+
|
|
5
|
+
`next-effect-app` is the starting point for every demo. It is a bun and Turborepo monorepo with one Next.js 16 App Router web app (`apps/web`) and one Extension Package declaration (`apps/extensions`). You start a demo by generating a new repository from the [template repository](https://github.com/collective-intelligence-solutions/next-effect-app) with **Use this template** on GitHub. The template repository is private, so your GitHub account needs access to it. Its example features are patterns to copy: a demo keeps their shape and replaces their content with the customer's domain.
|
|
6
|
+
|
|
7
|
+
## What you get
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
apps/
|
|
11
|
+
web/ # @acme/web Next app: routes, composition, Data Sources, app API and BFF instances
|
|
12
|
+
extensions/ # @acme/extensions Extension Package declaration (composes the ci parts)
|
|
13
|
+
packages/
|
|
14
|
+
products/acme/identity/{model,ci} # Identity Domain: package identity and VERSION, access, groups, external application, Sales desk
|
|
15
|
+
features/lead/{model,server,client,ci} # Lead contract and CI names, Lead API and Read Port, Realtime and views, CI schema
|
|
16
|
+
features/opportunity/{model,client,ci} # Opportunity contract and CI names, views, CI schema
|
|
17
|
+
features/intake/{model,server,client} # lead intake: schemas and API, store, XState flow and views
|
|
18
|
+
features/lead-conversion/{client,ci} # convert-lead browser flow and Workflow
|
|
19
|
+
features/lead-qualification/{model,ci} # lead qualifier agent, Skill, tool, Studio widget, and their FQNs
|
|
20
|
+
modules/identity-{api,server,client} # principal and Authentication contract, CI runtime, login providers
|
|
21
|
+
modules/app-api, app-api-server # typed domain API client, QueryClient, simulated network; ApiPrefetch
|
|
22
|
+
ui/design-system/ # shadcn/ui primitives, AI Elements, theme, workspace-kit
|
|
23
|
+
tooling/config/ # shared TypeScript base config and the Layout Guard
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Intake is a form with an XState flow and an app API that keeps its data in an in-memory store. Lead conversion is a Fixed workflow started by a single-action task. Lead qualification is an agent with a Skill, a tool and a Studio widget. The repository has no docs wiki, no infra folder and no generated client code, because the browser derives each typed client from its domain `HttpApi` at runtime. It also ships an agent harness: an `AGENTS.md` per scope, and `.agents/` with skills, rules and lint scripts.
|
|
27
|
+
|
|
28
|
+
## Domains, parts and the import rules
|
|
29
|
+
|
|
30
|
+
The template groups its code by domain. One domain is one folder, and each runtime of the domain is its own package, a part. The folder directly below `packages/` is the kind:
|
|
31
|
+
|
|
32
|
+
| Kind | Holds |
|
|
33
|
+
| ------------------------------------ | ---------------------------------------------------------- |
|
|
34
|
+
| `features/<domain>/<part>` | a domain that names no product, such as `lead` or `intake` |
|
|
35
|
+
| `products/<product>/<domain>/<part>` | a domain of one product; it may name its product |
|
|
36
|
+
| `ui/<name>` | the design system and page blocks, with no product terms |
|
|
37
|
+
| `modules/<name>` | business-agnostic machinery with one runtime |
|
|
38
|
+
| `tooling/<name>` | TypeScript, lint, build and test configuration |
|
|
39
|
+
|
|
40
|
+
A domain has only the parts it needs, and each part has exactly one runtime:
|
|
41
|
+
|
|
42
|
+
| Part | Runtime | Holds |
|
|
43
|
+
| -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
|
44
|
+
| `model` | neutral | Effect Schema models, resource contracts, pure rules, the domain `HttpApi` under `/api/app`, and the CI names other parts need |
|
|
45
|
+
| `server` | server | the route Layer of the domain `HttpApi` and its services; only `apps/web/src/server` imports it |
|
|
46
|
+
| `client` | client | typed client, query options, XState machines, entity bindings, Realtime topics and hooks, simulated sources, wired React views |
|
|
47
|
+
| `ci` | ci | CI declarations (extensions SDK) as factories over Identity Domain handles |
|
|
48
|
+
|
|
49
|
+
A package name is `@packages/` plus its path below `packages/`, with `-` in place of `/`. For example, `packages/features/lead/client` is `@packages/features-lead-client`. The apps keep their own names. Every internal dependency uses `workspace:*`. A part exports `.`, and a `client` part adds `./headless` only when a consumer needs state without components.
|
|
50
|
+
|
|
51
|
+
```mermaid
|
|
52
|
+
flowchart TD
|
|
53
|
+
web["apps/web"]
|
|
54
|
+
ext["apps/extensions"]
|
|
55
|
+
subgraph identity["products/acme/identity"]
|
|
56
|
+
im["model"]
|
|
57
|
+
ic["ci"]
|
|
58
|
+
end
|
|
59
|
+
subgraph lead["features/lead"]
|
|
60
|
+
lm["model"]
|
|
61
|
+
ls["server"]
|
|
62
|
+
lc["client"]
|
|
63
|
+
lci["ci"]
|
|
64
|
+
end
|
|
65
|
+
subgraph conv["features/lead-conversion"]
|
|
66
|
+
cc["client"]
|
|
67
|
+
cci["ci"]
|
|
68
|
+
end
|
|
69
|
+
modules["modules, ui, tooling"]
|
|
70
|
+
web -->|"composes server and client parts"| ls
|
|
71
|
+
web --> lc
|
|
72
|
+
web --> cc
|
|
73
|
+
ext -->|"lists each ci part in deploy order"| lci
|
|
74
|
+
ext --> cci
|
|
75
|
+
ext --> ic
|
|
76
|
+
ic -->|"grants by the names in model parts"| lm
|
|
77
|
+
ls --> lm
|
|
78
|
+
lc --> lm
|
|
79
|
+
lci --> lm
|
|
80
|
+
cc -->|"another domain's model only"| lm
|
|
81
|
+
lc --> modules
|
|
82
|
+
lc -.-|"never imports"| cc
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
- In one domain, `server`, `client` and `ci` import their own `model`. They never import each other.
|
|
86
|
+
- Across domains, a part imports only the other domain's `model` part. The `server`, `client` and `ci` parts of different domains meet only in an app: `apps/web` composes the views, and `apps/extensions` composes the `ci` parts.
|
|
87
|
+
- `features`, `ui` and `modules` never import `products`. A product never imports another product.
|
|
88
|
+
- `ui` imports only `ui` and `tooling`. `modules` imports only `modules` and `tooling`.
|
|
89
|
+
|
|
90
|
+
The rules are real configuration. Each workspace `turbo.json` has the Boundary Tags of its place: one `tier:*` tag, one `runtime:*` tag (apps have none), and one `part:*` tag for a part. The root `turbo.json` holds one rule for each tag, and `bunx turbo boundaries` fails the build on a wrong import:
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
"tier:features": { "dependencies": { "allow": ["tier:features", "tier:ui", "tier:modules", "tier:tooling"] } },
|
|
94
|
+
"runtime:client": { "dependencies": { "deny": ["runtime:server", "runtime:ci"] } },
|
|
95
|
+
"part:client": { "dependencies": { "deny": ["part:server", "part:client", "part:ci"] } }
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
The full table is `BOUNDARY_TAGS` from `@collective-intelligence/lint/layout`. The `part:*` rules deny every `server`, `client` and `ci` part, so a part reaches only `model` parts. An app has no `part:*` tag, so the parts of different domains meet there.
|
|
99
|
+
|
|
100
|
+
Workspaces import each other by package name and exported entry, such as `@packages/features-lead-client`, and never by relative path.
|
|
101
|
+
|
|
102
|
+
The template has these domains:
|
|
103
|
+
|
|
104
|
+
| Domain | Parts |
|
|
105
|
+
| ----------------------------- | --------------------------------- |
|
|
106
|
+
| `features/lead` | `model`, `server`, `client`, `ci` |
|
|
107
|
+
| `features/opportunity` | `model`, `client`, `ci` |
|
|
108
|
+
| `features/intake` | `model`, `server`, `client` |
|
|
109
|
+
| `features/lead-conversion` | `client`, `ci` |
|
|
110
|
+
| `features/lead-qualification` | `model`, `ci` |
|
|
111
|
+
| `products/acme/identity` | `model`, `ci` |
|
|
112
|
+
|
|
113
|
+
`features/lead-qualification` adds an agent, a Skill, a tool and a Studio widget, and all of that is CI-side behavior. Its `model` holds only the FQNs, and its `ci` part holds the declarations. That shows that you can ship an AI capability without writing any web code.
|
|
114
|
+
|
|
115
|
+
## Domains take their audience as a parameter
|
|
116
|
+
|
|
117
|
+
`products/acme/identity` is the Identity Domain of the product `acme`. Its `model` part holds the package identity and `VERSION`. Its `ci` part holds the groups, the application, the Access Profiles, their grants and the Max Privileges. A `features` domain never imports a product, so a `ci` part that offers something to a group of users takes that `audience`, and the application handle, as parameters. Each domain declares its own capabilities and Knowledge Data Policies in its `ci` part. The profiles grant them by the FQN constants of `@packages/features-lead-model` and `@packages/features-opportunity-model`. `apps/extensions/src/index.ts` passes the Identity Domain handles in and lists every component in deploy order, where each component follows the components it references:
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
export default declarePackage({
|
|
121
|
+
components: [
|
|
122
|
+
crmDomain,
|
|
123
|
+
...leadComponents({ domain: crmDomain, version: VERSION }),
|
|
124
|
+
...opportunityComponents({ domain: crmDomain, version: VERSION }),
|
|
125
|
+
...identityComponents,
|
|
126
|
+
...convertLeadComponents({
|
|
127
|
+
application: acmeApplication,
|
|
128
|
+
version: VERSION
|
|
129
|
+
}),
|
|
130
|
+
...leadQualificationComponents({
|
|
131
|
+
application: acmeApplication,
|
|
132
|
+
audience: salesMembers,
|
|
133
|
+
version: VERSION
|
|
134
|
+
}),
|
|
135
|
+
salesDeskApp
|
|
136
|
+
],
|
|
137
|
+
hostedContributions: [/* the Lead score card Studio widget */],
|
|
138
|
+
manifest: packageManifest
|
|
139
|
+
})
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
`identityComponents` holds the Sales Group, the application, the profiles, their grants and the Max Privileges. The Studio contribution is the one declaration in `apps/extensions`: `ci package build` resolves its relative `load` import against that file.
|
|
143
|
+
|
|
144
|
+
[Extensions](../develop/extensions.md) describes each kind of declaration, and [Access](../platform/access.md) explains the Access Profiles and Access Grants in that list.
|
|
145
|
+
|
|
146
|
+
## The web app layers
|
|
147
|
+
|
|
148
|
+
Domain code lives in the domain parts. The web app keeps only routes, Composition, the sign-in gate, Data Sources and server instances, arranged in a fixed set of layers where each layer imports only the layers below it:
|
|
149
|
+
|
|
150
|
+
| Layer in `apps/web/src` | Holds |
|
|
151
|
+
| ----------------------- | ------------------------------------------------------------------------------------------------------------------ |
|
|
152
|
+
| `app/` | route files only; each re-exports a Composition export, and `app/api/**` forwards to `server/<domain>/server` |
|
|
153
|
+
| `composition/` | `providers/` (global providers, Realtime providers) and `routing/` (access, shells, pages) |
|
|
154
|
+
| `features/` | app-local capabilities: their Data Sources (`remote/server.ts`) and `page-link/` |
|
|
155
|
+
| `entities/` | app-local entity machinery that several features need (the CI session), Data Sources of domain parts, `page-link/` |
|
|
156
|
+
| `server/` | beside the layers: one folder per domain, where `server.ts` (`server-only`) holds the process instance |
|
|
157
|
+
|
|
158
|
+
Only Composition imports a Data Source, and only Data Sources and `app/api/**` import a `server/<domain>/server.ts`. Peers still meet without importing each other: the CRM page template passes `ConvertLead` into the `selectionActions` slot of `LeadWorkspace` and `LeadAttachment` into its `editorActions` slot. Each page's owner gives its `{ label, path }` in `page-link/`, and shells and links read it, so no route path is written twice.
|
|
159
|
+
|
|
160
|
+
One Next app serves two server surfaces:
|
|
161
|
+
|
|
162
|
+
| Path | Handler | What it is |
|
|
163
|
+
| ------------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------ |
|
|
164
|
+
| `/api/app/*` | `server/app-api/server` | the app API: the domains' Effect `HttpApi`s merged , OpenAPI at `/api/app/openapi.json`, Scalar docs at `/api/app/docs` |
|
|
165
|
+
| `/api/*` | `server/ci/server` | the CI SDK BFF: sign-in with a sealed cookie, Lead and Opportunity resource proxy, Realtime ticket and revalidate routes |
|
|
166
|
+
| `/api/leads/[id]/convert` | `server/ci/server` | the Fixed convert-lead workflow route |
|
|
167
|
+
|
|
168
|
+
The BFF holds the CI session in a sealed cookie and proxies resource calls, so the browser never holds a CI secret. [External applications](../develop/external-apps.md) covers the BFF in depth. The intake app API keeps its data in `IntakeStore.layerMemory`, and you replace that layer when a demo needs its own database.
|
|
169
|
+
|
|
170
|
+
## Start a new demo
|
|
171
|
+
|
|
172
|
+
1. Generate a repository with **Use this template** on the template repository. In the new repository, delete the README "Contributing" section and `.github/workflows/close-pull-requests.yml`, which only matter in the template repository itself.
|
|
173
|
+
2. Rename the template for the customer. Replace the `@acme/` app names, the product folder `packages/products/acme` with its package names `@packages/products-acme-*`, and the `acme.app.` FQNs. Replace `https://acme.localhost` in `packages/products/acme/identity/ci/src/application.ts` and `.env.example`, and replace the theme tokens and the sidebar brand in `apps/web/src/composition/routing/shells/workspace/app-sidebar.tsx`. Theme tokens live once, in `packages/ui/design-system/src/styles/globals.css`.
|
|
174
|
+
3. Run it locally. The Overview and Lead intake pages work with no configuration, because the intake API keeps requests in memory:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
bun install
|
|
178
|
+
bun run dev:web # http://localhost:3000
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
The CRM page needs a CI tenant.
|
|
182
|
+
|
|
183
|
+
4. Deploy the package to an Organization. `ci deploy` runs the whole release path in one command, as [Extensions](../develop/extensions.md) describes. The long path runs each step by hand:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
ci package build --declaration ./apps/extensions/src/index.ts --out apps/extensions/dist/release
|
|
187
|
+
ci package validate --archive apps/extensions/dist/release/release.tar \
|
|
188
|
+
--manifest apps/extensions/dist/release/manifest.json \
|
|
189
|
+
--package-manifest apps/extensions/dist/release/package-manifest.json
|
|
190
|
+
ci package publish --backend-url <url> \
|
|
191
|
+
--archive apps/extensions/dist/release/release.tar \
|
|
192
|
+
--manifest apps/extensions/dist/release/manifest.json \
|
|
193
|
+
--package-manifest apps/extensions/dist/release/package-manifest.json \
|
|
194
|
+
--idempotency-key <key>
|
|
195
|
+
ci package promote --backend-url <url> --release <release-id> --idempotency-key <key>
|
|
196
|
+
ci package install --backend-url <url> --organization <organization-id> \
|
|
197
|
+
--package acme.app.knowledge --release <release-id> --idempotency-key <key>
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Running `package build` into a scratch folder and then `package validate` is the dry run for any change to the package.
|
|
201
|
+
|
|
202
|
+
5. Connect the web app to its CI application. Installing the package registered `acme.app.application` as a confidential client with no secret. Sign in to the CLI as an Organization admin, copy the env example, write the connection values and issue the sign-in secret:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
ci login <api-url> --organization <organization-id>
|
|
206
|
+
cp apps/web/.env.example apps/web/.env.local
|
|
207
|
+
ci apps env acme.app.application --env-file apps/web/.env.local
|
|
208
|
+
ci apps rotate-secret <application-id>
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
`ci apps env` writes `CI_ISSUER`, `CI_AUDIENCE`, `CI_APPLICATION_ID`, `CI_CLIENT_ID`, `CI_ORGANIZATION_ID` and `CI_JWKS_URL` into the file and changes nothing in CI. It leaves out the client secret and prints the `ci apps rotate-secret` command with the Application Id. `ci apps rotate-secret` prints the new sign-in secret once, as `clientSecret`; store it as `CI_CLIENT_SECRET` in `apps/web/.env.local`. Then set `APP_ORIGIN`, `CI_TENANT_URL`, `SESSION_SECRETS` and `NEXT_PUBLIC_APPLICATION_ID`, which equals `CI_APPLICATION_ID` and is the only value the browser sees.
|
|
212
|
+
|
|
213
|
+
The sign-in secret only signs users in. The server's own reads, such as the Read Port, need a Server Credential in a separate env file:
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
ci apps credentials upsert acme.app.application --name web --env-file apps/web/.env.server
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
CI shows its secret once and writes it only to that file. The Server Credential acts with the grants given to the app's server, and the package declares none, so an Organization admin also gives the app server read access to Leads. Management tokens never go to Next.
|
|
220
|
+
|
|
221
|
+
6. Add users to the Sales group. CI accepts a user's token only when the user holds the application gate, so nobody can sign in yet. An Organization admin adds each user to the Sales group (Sales rep profile) or to its `managers` subgroup (Sales manager profile).
|
|
222
|
+
7. Sign in over HTTPS. The sealed session cookie requires HTTPS, so serve the dev server through a local HTTPS proxy:
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
portless acme bun run dev:web # https://acme.localhost
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
> **Warning:** Use `ci apps env` for the template's application. `ci apps enroll` refuses an
|
|
229
|
+
> application that a package declared. Run `ci apps env` before you paste the
|
|
230
|
+
> secret, because it refuses to write a file whose secret belongs to another
|
|
231
|
+
> Client Id.
|
|
232
|
+
|
|
233
|
+
> **Warning:** The `./` in `--declaration ./apps/extensions/src/index.ts` is required.
|
|
234
|
+
> Without it, the CLI resolves the path like a module name and fails.
|
|
235
|
+
|
|
236
|
+
> **Note:** After each npm release of the CI packages, the template gets the released SDK
|
|
237
|
+
> versions pinned and one sync commit. A repository you generated earlier does
|
|
238
|
+
> not receive these updates by itself.
|
|
239
|
+
|
|
240
|
+
## What to change and what to keep
|
|
241
|
+
|
|
242
|
+
A new demo changes the Identity Domain, the `features` domains, the theme and the origins. It keeps the `modules/identity-*` and `modules/app-api*` packages, the BFF and server wiring, the Boundary Tags, the Layout Guard, the lint configuration and the harness files, because they hold no business logic. A new environment variable goes into `apps/web/.env.example`, `packages/modules/identity-server/src/env.ts`, `turbo.json` `globalEnv` and the README tenant section together.
|
|
243
|
+
|
|
244
|
+
## Checks that keep the structure honest
|
|
245
|
+
|
|
246
|
+
Three checks keep the layout. `turbo boundaries` checks every import against the Boundary Tags. The Layout Guard, the Bun test `packages/tooling/config/src/workspace-layout.test.ts`, checks what the tags cannot express: the root `workspaces` globs, package names, each `turbo.json`, `workspace:*` ranges and product isolation. The `ci-solution/workspace-layout` lint rule reports a package that sits outside the accepted places. All three read one layout definition, `@collective-intelligence/lint/layout`.
|
|
247
|
+
|
|
248
|
+
`@collective-intelligence/lint` is one Oxlint plugin named `ci-solution`. Extending `recommended` turns every rule on as an error:
|
|
249
|
+
|
|
250
|
+
| Rule | Checks |
|
|
251
|
+
| -------------------------------- | ---------------------------------------------------------------------------------------------- |
|
|
252
|
+
| `ci-solution/package-entrypoint` | an import of another package targets an entrypoint in its `package.json` `exports` |
|
|
253
|
+
| `ci-solution/workspace-layout` | each workspace sits at `apps/<name>`, a domain part, or `packages/{ui,modules,tooling}/<name>` |
|
|
254
|
+
| `ci-solution/effect-subpath` | SDK Effect APIs come from the SDK `/effect` subpath |
|
|
255
|
+
| `ci-solution/no-run-in-view` | a view module calls no `fetch` and runs no Effect |
|
|
256
|
+
| `ci-solution/effect-actors` | XState side-effect actors are `fromEffect` actors |
|
|
257
|
+
| `ci-solution/effect-writes` | no module uses TanStack Query `useMutation`; writes run in `fromEffect` actors |
|
|
258
|
+
|
|
259
|
+
Each package has an `oxlint.local.ts` that extends the preset:
|
|
260
|
+
|
|
261
|
+
```ts
|
|
262
|
+
import { recommended as ciSolution } from "@collective-intelligence/lint"
|
|
263
|
+
import { defineConfig } from "oxlint"
|
|
264
|
+
|
|
265
|
+
export default defineConfig({
|
|
266
|
+
extends: [ciSolution],
|
|
267
|
+
overrides: [
|
|
268
|
+
{
|
|
269
|
+
files: ["**/*.proof.ts"],
|
|
270
|
+
rules: { "eslint/curly": "off", "jsdoc/check-tag-names": "off" }
|
|
271
|
+
}
|
|
272
|
+
]
|
|
273
|
+
})
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
The web app also runs a `frontend-layers` lint for layer order, domain entrypoints, folder names and the `no-peer-feature` and `no-peer-entity` rules. For coding agents, the template ships Codebase Rules in `.agents/rules/`, such as `web-layer-imports`, `ci-sdk-boundaries` and `ci-realtime-topics`, each with a path trigger and a task trigger. The day-to-day checks are:
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
bun run check-types
|
|
280
|
+
bun run test # includes the Layout Guard
|
|
281
|
+
bunx turbo boundaries
|
|
282
|
+
bun run lint
|
|
283
|
+
bun run format:check
|
|
284
|
+
bun run build
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
When you change the Lead cache, a Lead write or Lead Realtime, also run `bun run check:models` in `packages/features/lead/client`. [State machines](state-machines.md) explains what that command checks.
|
|
288
|
+
|
|
289
|
+
## Related pages
|
|
290
|
+
|
|
291
|
+
- [State machines](state-machines.md)
|
|
292
|
+
- [SDKs](../develop/sdks.md)
|
|
293
|
+
- [Extensions](../develop/extensions.md)
|
|
294
|
+
- [External applications](../develop/external-apps.md)
|
|
295
|
+
- [Access](../platform/access.md)
|