@rolealpha/n8n-nodes-rolealpha 0.7.3 → 0.8.1
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/README.md +61 -40
- package/dist/lib/changes.d.ts +126 -83
- package/dist/lib/changes.js +200 -197
- package/dist/lib/changes.js.map +1 -1
- package/dist/lib/mcp.d.ts +1 -1
- package/dist/lib/mcp.js +18 -4
- package/dist/lib/mcp.js.map +1 -1
- package/dist/lib/workflows.d.ts +16 -3
- package/dist/lib/workflows.js +43 -5
- package/dist/lib/workflows.js.map +1 -1
- package/dist/nodes/RoleAlphaWorkflowBuilder/RoleAlphaWorkflowBuilder.node.d.ts +1 -1
- package/dist/nodes/RoleAlphaWorkflowBuilder/RoleAlphaWorkflowBuilder.node.js +83 -54
- package/dist/nodes/RoleAlphaWorkflowBuilder/RoleAlphaWorkflowBuilder.node.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -45,8 +45,8 @@ next run follows. You don't edit code and you don't republish anything.
|
|
|
45
45
|
- **Teams of agents on one step.** Several roles share a step. Each agent does its own part,
|
|
46
46
|
waits for what it needs and is woken when it arrives. Agents that hang are escalated to
|
|
47
47
|
the role that leads their circle.
|
|
48
|
-
- **Workflows that follow the organisation.** When a step
|
|
49
|
-
or
|
|
48
|
+
- **Workflows that follow the organisation.** When a step is created or changed in roleALPHA,
|
|
49
|
+
or an entity a workflow is bound to changes or is removed, a model proposes what that means for the n8n workflows. The
|
|
50
50
|
proposal becomes an inactive draft, and only a person filling the deciding role can apply it.
|
|
51
51
|
- **Limits you can change without republishing.** Retries, wait times, run time and tool
|
|
52
52
|
calls come from a settings table and are clamped to fixed bounds.
|
|
@@ -137,10 +137,9 @@ Builder** closes that gap without letting a model change production on its own.
|
|
|
137
137
|
|
|
138
138
|
```
|
|
139
139
|
Scheduler (every 15 min)
|
|
140
|
-
└
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
└ per change: Workflow Builder: Propose ← chat model
|
|
140
|
+
└ Workflow Builder: Detect Changes list_changes since the last run: new / changed
|
|
141
|
+
│ steps, changed / removed bound entities
|
|
142
|
+
└ per change: Workflow Builder: Propose ← chat model
|
|
144
143
|
└ Create Draft inactive, tagged rolealpha-draft
|
|
145
144
|
└ roleALPHA: Get Decider (governing step)
|
|
146
145
|
└ per person: Issue Approval Tokens → e-mail with approve / reject link
|
|
@@ -152,15 +151,31 @@ Confirm button (POST)
|
|
|
152
151
|
└ reject → Workflow Builder: Discard Draft
|
|
153
152
|
```
|
|
154
153
|
|
|
155
|
-
**Detect**
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
154
|
+
**Detect** asks roleALPHA's `list_changes` what changed effectively since the last run:
|
|
155
|
+
approved drafts and every relationship change, fanned out to each end. That is one call per
|
|
156
|
+
run, whatever the size of the organisation. It keeps the cursor in the workflow's static data,
|
|
157
|
+
so no table is needed; the first run starts now and reports nothing from before. What counts:
|
|
158
|
+
|
|
159
|
+
- new and changed entities of the watched types (default: steps), and
|
|
160
|
+
- changed entities a managed workflow is bound to, whatever their type.
|
|
161
|
+
|
|
162
|
+
What does not: relationships the runner reads at run time (who decides, is accountable,
|
|
163
|
+
responsible, consulted or informed, who holds a role, which policy applies). A new holder or a new decider changes no workflow, so it costs no model
|
|
164
|
+
call. A change names what changed, not the old values: the model compares the entity as it is
|
|
165
|
+
now with what the workflows do. **Skip Own Changes** also leaves out what the connection's
|
|
166
|
+
account proposed or approved (`ownChange`); use it only with an account of its own, since with
|
|
167
|
+
a personal login it would leave out that person's approvals too.
|
|
168
|
+
|
|
169
|
+
A deleted entity does not appear in the feed itself; its neighbours get a relationship whose
|
|
170
|
+
other end is gone. Then, and when the cursor was lost, Detect asks for every bound entity
|
|
171
|
+
whether it still exists. Only "not found" counts as removed; an entity it cannot tell is asked
|
|
172
|
+
for again next run. A failed read of the feed fails the run and keeps the old cursor.
|
|
161
173
|
|
|
162
174
|
**Propose** gives the model the change, the entity as roleALPHA shows it now (a step with its
|
|
163
|
-
roles, never persons), the managed workflows
|
|
175
|
+
roles, never persons), the managed workflows, which of them the change affects (bound to the
|
|
176
|
+
entity, or to a step right before, after, above or below it) and the credentials they use. An
|
|
177
|
+
update for a neighbouring step leaves the binding as it is: the workflow does not become bound
|
|
178
|
+
to the neighbour. Its answer is
|
|
164
179
|
checked, and a failed check goes back to the model once more with the problems:
|
|
165
180
|
|
|
166
181
|
- only node types from the allow list (no Code node by default),
|
|
@@ -185,29 +200,16 @@ Opening a link only shows a confirm page; mail scanners that open links decide n
|
|
|
185
200
|
### Setting it up
|
|
186
201
|
|
|
187
202
|
Two ready workflows are in [`examples/`](examples). Installing the package does not set them
|
|
188
|
-
up: n8n runs no code of a community package at install, so the
|
|
189
|
-
|
|
203
|
+
up: n8n runs no code of a community package at install, so the credentials have to be created
|
|
204
|
+
once by hand. No data table is needed; *Detect Changes* keeps its cursor in the workflow.
|
|
190
205
|
|
|
191
|
-
1. **
|
|
192
|
-
|
|
193
|
-
these columns, all of type **String**:
|
|
194
|
-
|
|
195
|
-
| Column | Holds |
|
|
196
|
-
|---|---|
|
|
197
|
-
| `uuid` | UUID of the entity (key of the row) |
|
|
198
|
-
| `entity_type` | `process`, `role`, `agent` … |
|
|
199
|
-
| `name` | Name at the last run |
|
|
200
|
-
| `custom_id` | Custom ID, may be empty |
|
|
201
|
-
| `fingerprint` | Hash over name, custom ID, attributes and edges |
|
|
202
|
-
| `fields` | JSON: a short hash per attribute |
|
|
203
|
-
| `edges` | JSON: the edges as `TYPE>uuid` / `TYPE<uuid` |
|
|
204
|
-
| `seen_at` | Time of the run that stored the row |
|
|
205
|
-
|
|
206
|
-
The name must be exactly `rolealpha_snapshot`; the example finds the table by name. Without
|
|
207
|
-
it, *Read snapshot* fails and nothing is detected.
|
|
206
|
+
1. **Release the modules for AI in roleALPHA** (*AI settings → data release*). Without a
|
|
207
|
+
released module `list_changes` fails instead of reporting nothing.
|
|
208
208
|
2. **Create the credentials** (see [Credentials](#credentials)):
|
|
209
|
-
- **MCP OAuth2** for roleALPHA. It
|
|
210
|
-
|
|
209
|
+
- **MCP OAuth2** for roleALPHA. It sees what its access may see: steps hidden from it are
|
|
210
|
+
neither watched nor reported.
|
|
211
|
+
- **n8n API** with an API key from *Settings → n8n API*. *Detect Changes* uses it too, to
|
|
212
|
+
read which entities the managed workflows are bound to. When `/api` is not reachable from
|
|
211
213
|
outside, use `http://localhost:5678/api/v1` as base URL.
|
|
212
214
|
- **Approval Seal API** with a random key of at least 32 characters. It signs the approval
|
|
213
215
|
links; keep it secret, anybody with it can make links.
|
|
@@ -216,12 +218,14 @@ have to be created once by hand.
|
|
|
216
218
|
`approve-workflow-drafts.json`, and pick the credentials on every node that asks for one.
|
|
217
219
|
4. **Fill in Settings** in both workflows: `endpointUrl` and `organisation` of roleALPHA,
|
|
218
220
|
`governingStep`, and in the first one `n8nUrl`, `approvalUrl` (`<n8nUrl>/webhook/rolealpha-workflow-approval`)
|
|
219
|
-
and `mailFrom`.
|
|
221
|
+
and `mailFrom`. Adjust **Extra Rules** on *Propose* to your systems and runner; the last
|
|
222
|
+
rule keeps the builder off its own steps (see [The builder's own steps](#the-builders-own-steps)).
|
|
220
223
|
5. **Set up the governing step in roleALPHA**, as described in the next section. Without it
|
|
221
224
|
nobody may approve, and every draft stays a draft.
|
|
222
225
|
6. **Activate** *Approve workflow drafts* first, then *Workflows follow the organisation*. The
|
|
223
|
-
first run only
|
|
224
|
-
second run on.
|
|
226
|
+
first run starts now and only checks that the bound entities still exist; changes are
|
|
227
|
+
reported from the second run on. The cursor is kept only by runs of the active workflow:
|
|
228
|
+
a manual test run starts afresh each time.
|
|
225
229
|
|
|
226
230
|
### The governing step in roleALPHA
|
|
227
231
|
|
|
@@ -256,6 +260,20 @@ Changing who approves later needs no change in n8n: give the role to someone els
|
|
|
256
260
|
no longer fills the role do nothing. A person who fills two deciding roles of the step gets
|
|
257
261
|
one mail per role.
|
|
258
262
|
|
|
263
|
+
### The builder's own steps
|
|
264
|
+
|
|
265
|
+
The builder may be modelled in roleALPHA like any other value chain: a process with the steps
|
|
266
|
+
*detect changes*, *propose a draft* and the governing step, a role responsible for them and an
|
|
267
|
+
agent that fills the role. Its two workflows are not managed (they carry no binding), so for
|
|
268
|
+
the model such a step has no workflow yet. Approving these steps then makes it propose a
|
|
269
|
+
second detect workflow, or not, by chance. Give the builder's steps custom IDs of one prefix,
|
|
270
|
+
e.g. `automation:workflow-detect` and `automation:workflow-propose`, and name the prefix in
|
|
271
|
+
**Extra Rules** of *Propose*. The example workflow already has the rule:
|
|
272
|
+
|
|
273
|
+
```
|
|
274
|
+
The steps with Custom-ID automation:* are run by the Workflow Builder itself. Never propose a workflow for them.
|
|
275
|
+
```
|
|
276
|
+
|
|
259
277
|
## Nodes
|
|
260
278
|
|
|
261
279
|
### roleALPHA (`roleAlpha`)
|
|
@@ -288,7 +306,7 @@ one mail per role.
|
|
|
288
306
|
|
|
289
307
|
| Operation | What it does | Credential |
|
|
290
308
|
|---|---|---|
|
|
291
|
-
| Detect Changes |
|
|
309
|
+
| Detect Changes | Reads `list_changes` from the cursor kept in the workflow (or the **Cursor** option). Returns `changes` (`created`, `changed`, `removed`, each with `relationships` and the bound `workflows`), `cursor`, `hasMore`, `started`, `checked`, `unreadable` and `skipped`. | MCP OAuth2, n8n API |
|
|
292
310
|
| List Workflows | The managed workflows with their bound entities and the credentials they use. | n8n API |
|
|
293
311
|
| Propose | Needs a chat model on its **Model** input. Returns `ok`, `action` (`create`, `update`, `deactivate`, `none`), `reason`, `workflow`, `contentHash`, `problems` and `notes`. | MCP OAuth2, n8n API |
|
|
294
312
|
| Create Draft | Stores a proposal with `ok = true` as an inactive draft. Returns `draftId` and `contentHash`. | n8n API |
|
|
@@ -460,13 +478,16 @@ not caught by the graph.
|
|
|
460
478
|
| `roleALPHA refused the run: agent_nicht_gebunden` | The function account may not run this agent. Add the agent under "May run these agents" of the account. |
|
|
461
479
|
| `roleALPHA refused the run: kein_agent_run_recht` | No role of the function account has `agent:run`. |
|
|
462
480
|
| `Acting as an agent needs a function account` | The MCP OAuth2 credential uses another grant type. Use the client ID and secret of a function account. |
|
|
463
|
-
| `MCP initialize failed with HTTP 429` | Many runs started at once and roleALPHA turned some away. The client repeats a call turned away with 429 or 503 up to four times (Retry-After, else 1, 2, 4, 8 s). If it still fails, start fewer runs at once. |
|
|
481
|
+
| `MCP initialize failed with HTTP 429` | Many runs started at once and roleALPHA turned some away (120 calls per minute and access). The client repeats a call turned away with 429 or 503 up to four times and waits as long as the server asks (Retry-After or RateLimit-Reset, else 1, 2, 4, 8 s). If it still fails, start fewer runs at once. |
|
|
464
482
|
| `Empty MCP response` | The server answered with no body. Reading calls are repeated; a writing tool is not, so it cannot run twice. |
|
|
465
483
|
| `Cannot access "arguments" due to security concerns` | n8n blocks the name `arguments` in expressions and in `$fromAI`. Name the tool input `toolArgs` or `args`. |
|
|
466
484
|
| Propose returns `ok: false` | The model's answer failed the check twice; `problems` says why. Often a node type outside the allow list or a hard-coded address. Add what the model needs to **Extra Rules**. |
|
|
485
|
+
| Propose drafts a second detect workflow | The builder's own steps are modelled in roleALPHA and the model does not know that the builder runs them. Reject the draft and add the rule from [The builder's own steps](#the-builders-own-steps). |
|
|
467
486
|
| `The draft changed after it was proposed or approved` | Somebody edited the draft, or the link carries another hash. Discard it; the next change proposes again. |
|
|
468
487
|
| `Workflow … changed after the draft was made` | The target was edited after the draft. Discard the draft and let the builder propose again. |
|
|
469
|
-
| Detect fails with `
|
|
488
|
+
| Detect fails with `kein Modul für die KI freigegeben` | No module is released for AI in roleALPHA. Release it under *AI settings → data release*. |
|
|
489
|
+
| Detect reports `hasMore: true` | More changes waited than **Max Pages** × 500. The next run goes on from there. |
|
|
490
|
+
| Detect reports the same change twice across runs | `list_changes` delivers at least once, after a restore of the tenant also known changes again. Proposals for them usually come back `none`. |
|
|
470
491
|
| Webhook answers `401` | The `X-RA-Signature` does not match. Check the secret in **roleALPHA Webhook API**. |
|
|
471
492
|
|
|
472
493
|
## Licence
|
package/dist/lib/changes.d.ts
CHANGED
|
@@ -1,104 +1,147 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Change detection in the roleALPHA graph. roleALPHA
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Change detection in the roleALPHA graph. roleALPHA's list_changes names the entities that
|
|
3
|
+
* changed effectively since a cursor: approved drafts and every relationship change, fanned out
|
|
4
|
+
* to each end. One call per run replaces reading the whole organisation, so the cost grows with
|
|
5
|
+
* the changes, not with the size of the organisation.
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* What counts: entities a managed workflow is bound to, and entities of the watched types
|
|
8
|
+
* (a new or changed step may need a workflow). What does not: relationships the runner resolves
|
|
9
|
+
* at run time, and on request the access's own writes (who decides, who holds a role, which policy
|
|
10
|
+
* applies). Those never require a workflow to change.
|
|
11
|
+
*
|
|
12
|
+
* A deleted entity does not appear itself; its neighbours get a relationship row whose other
|
|
13
|
+
* end is null. Such a row, a lost cursor or an earlier unreadable check makes the detector ask
|
|
14
|
+
* for every bound entity whether it still exists. Fail-closed: only "not found" counts as removed.
|
|
10
15
|
*/
|
|
11
|
-
import type {
|
|
12
|
-
|
|
13
|
-
/** Fingerprint of a row for an entity that existed in the first run but could not be read. */
|
|
14
|
-
export declare const PENDING = "pending";
|
|
15
|
-
/** Entity types of the lean index (list_entities). */
|
|
16
|
+
import type { McpClient } from './mcp';
|
|
17
|
+
/** Entity types list_changes can filter on and Detect Changes can watch. */
|
|
16
18
|
export declare const ENTITY_TYPES: readonly ["process", "role", "agent", "policy", "organigramm", "project", "okr", "person"];
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
/** Relationships the runner reads at run time: a change to them never changes a workflow. */
|
|
20
|
+
export declare const RUNTIME_RELATIONSHIPS: string[];
|
|
21
|
+
/** Relationships that make a step a neighbour of another: the order and the breakdown of steps. */
|
|
22
|
+
export declare const NEIGHBOUR_RELATIONSHIPS: string[];
|
|
23
|
+
/** One row of list_changes. */
|
|
24
|
+
export interface FeedRow {
|
|
25
|
+
entityUuid: string;
|
|
20
26
|
entityType: string;
|
|
27
|
+
changedAt: string;
|
|
28
|
+
change: 'created' | 'updated' | 'deleted' | 'relationship';
|
|
29
|
+
origin?: string;
|
|
30
|
+
ownChange?: boolean;
|
|
31
|
+
via?: {
|
|
32
|
+
relationshipId?: number | string;
|
|
33
|
+
relTypeId?: number;
|
|
34
|
+
relationshipType: string;
|
|
35
|
+
otherEntityUuid: string | null;
|
|
36
|
+
role?: 'from' | 'to' | 'participant';
|
|
37
|
+
action: 'added' | 'changed' | 'removed';
|
|
38
|
+
};
|
|
21
39
|
}
|
|
22
|
-
export interface
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
fields: Record<string, string>;
|
|
30
|
-
/** `TYPE>uuid` (outgoing) and `TYPE<uuid` (incoming), sorted. */
|
|
31
|
-
edges: string[];
|
|
32
|
-
fingerprint: string;
|
|
33
|
-
}
|
|
34
|
-
/** A stored snapshot row. `fields` and `edges` are JSON strings so any table can hold them. */
|
|
35
|
-
export interface SnapshotRow {
|
|
36
|
-
uuid: string;
|
|
37
|
-
entity_type: string;
|
|
38
|
-
name: string;
|
|
39
|
-
custom_id: string | null;
|
|
40
|
-
fingerprint: string;
|
|
41
|
-
fields: string;
|
|
42
|
-
edges: string;
|
|
43
|
-
seen_at: string;
|
|
40
|
+
export interface RelationshipChange {
|
|
41
|
+
type: string;
|
|
42
|
+
action: 'added' | 'changed' | 'removed';
|
|
43
|
+
/** The other end; null when it was deleted. */
|
|
44
|
+
otherUuid: string | null;
|
|
45
|
+
/** Which end this entity is: from, to or participant. */
|
|
46
|
+
end: string | null;
|
|
44
47
|
}
|
|
45
48
|
export type ChangeKind = 'created' | 'changed' | 'removed';
|
|
49
|
+
/**
|
|
50
|
+
* One entity that changed. It names what changed, not the old values: the model compares the
|
|
51
|
+
* entity as it is now with what the workflows do. Name and custom ID are filled in by Propose.
|
|
52
|
+
*/
|
|
46
53
|
export interface EntityChange {
|
|
47
54
|
change: ChangeKind;
|
|
48
55
|
uuid: string;
|
|
49
|
-
name: string;
|
|
50
56
|
entityType: string;
|
|
57
|
+
name: string;
|
|
51
58
|
customId: string | null;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
59
|
+
changedAt: string | null;
|
|
60
|
+
relationships: RelationshipChange[];
|
|
61
|
+
/** IDs of the managed workflows bound to this entity. */
|
|
62
|
+
workflows: string[];
|
|
56
63
|
}
|
|
57
|
-
export interface
|
|
58
|
-
/** No stored rows yet: the snapshot is stored and nothing is reported. */
|
|
59
|
-
baseline: boolean;
|
|
60
|
-
/** Whether the complete index was read; only then are removals reported. */
|
|
61
|
-
complete: boolean;
|
|
64
|
+
export interface FeedSummary {
|
|
62
65
|
changes: EntityChange[];
|
|
63
|
-
/**
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
/** A relationship lost its other end: something was deleted, maybe a bound entity. */
|
|
67
|
+
deletionSeen: boolean;
|
|
68
|
+
skipped: {
|
|
69
|
+
own: number;
|
|
70
|
+
runtime: number;
|
|
71
|
+
unwatched: number;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/** Rows as list_changes returns them; drops rows without entity or change. */
|
|
75
|
+
export declare function normalizeFeedRows(raw: unknown): FeedRow[];
|
|
76
|
+
/**
|
|
77
|
+
* Turns feed rows into one change per entity. `bound` maps entity UUIDs to the managed
|
|
78
|
+
* workflows bound to them; `watchTypes` are the types whose new and changed entities count
|
|
79
|
+
* even without a workflow.
|
|
80
|
+
*/
|
|
81
|
+
export declare function summarizeFeed(rows: FeedRow[], opts: {
|
|
82
|
+
bound: Map<string, string[]>;
|
|
83
|
+
watchTypes: string[];
|
|
84
|
+
ignoreRelationships?: string[];
|
|
85
|
+
skipOwn?: boolean;
|
|
86
|
+
}): FeedSummary;
|
|
87
|
+
export interface FeedRead {
|
|
88
|
+
rows: FeedRow[];
|
|
89
|
+
cursor: string;
|
|
90
|
+
/** More rows wait; the next run goes on from `cursor`. */
|
|
91
|
+
hasMore: boolean;
|
|
92
|
+
pages: number;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Reads list_changes from a cursor, or on the first run from `since`, page by page.
|
|
96
|
+
* A failed call throws, so the stored cursor stays where it was.
|
|
97
|
+
*/
|
|
98
|
+
export declare function readFeed(client: McpClient, organisation: string, start: {
|
|
99
|
+
cursor?: string;
|
|
100
|
+
since?: string;
|
|
101
|
+
}, opts?: {
|
|
102
|
+
maxPages?: number;
|
|
103
|
+
limit?: number;
|
|
104
|
+
}): Promise<FeedRead>;
|
|
105
|
+
export interface ExistenceCheck {
|
|
106
|
+
removed: string[];
|
|
107
|
+
/** Entities whose existence could not be told; checked again next run. */
|
|
68
108
|
unreadable: Array<{
|
|
69
109
|
uuid: string;
|
|
70
|
-
name: string;
|
|
71
|
-
entityType?: string;
|
|
72
110
|
error: string;
|
|
73
111
|
}>;
|
|
74
112
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
export declare function normalizeRows(raw: unknown): SnapshotRow[];
|
|
83
|
-
export declare function detectChanges(previousRaw: unknown, current: EntitySnapshot[], opts: {
|
|
84
|
-
complete: boolean;
|
|
85
|
-
types: string[];
|
|
86
|
-
unreadable?: DetectResult['unreadable'];
|
|
87
|
-
now?: Date;
|
|
88
|
-
reportBaseline?: boolean;
|
|
89
|
-
}): DetectResult;
|
|
90
|
-
/** Reads the complete lean index of one type, page by page. */
|
|
91
|
-
export declare function listIndex(client: McpClient, organisation: string, entityType: string, maxPages?: number): Promise<IndexEntry[]>;
|
|
92
|
-
export interface SnapshotRead {
|
|
93
|
-
snapshots: EntitySnapshot[];
|
|
94
|
-
unreadable: DetectResult['unreadable'];
|
|
113
|
+
/** Asks for every UUID whether it still exists. Only a plain "not found" counts as removed. */
|
|
114
|
+
export declare function checkExistence(client: McpClient, organisation: string, uuids: string[]): Promise<ExistenceCheck>;
|
|
115
|
+
/** What Detect Changes keeps between runs, in the workflow's static data. */
|
|
116
|
+
export interface FeedState {
|
|
117
|
+
cursor?: string;
|
|
118
|
+
/** An existence check could not finish; run it again. */
|
|
119
|
+
recheck?: boolean;
|
|
95
120
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
*/
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
121
|
+
export interface DetectResult {
|
|
122
|
+
changes: EntityChange[];
|
|
123
|
+
cursor: string;
|
|
124
|
+
hasMore: boolean;
|
|
125
|
+
/** No cursor was stored: the run started at `since` and checked the bound entities. */
|
|
126
|
+
started: boolean;
|
|
127
|
+
/** Bound entities whose existence was checked. */
|
|
128
|
+
checked: number;
|
|
129
|
+
unreadable: ExistenceCheck['unreadable'];
|
|
130
|
+
skipped: FeedSummary['skipped'];
|
|
131
|
+
state: FeedState;
|
|
132
|
+
}
|
|
133
|
+
export declare function detectChanges(client: McpClient, organisation: string, state: FeedState, opts: {
|
|
134
|
+
bound: Map<string, string[]>;
|
|
135
|
+
watchTypes: string[];
|
|
136
|
+
ignoreRelationships?: string[];
|
|
137
|
+
skipOwn?: boolean;
|
|
138
|
+
since?: string;
|
|
139
|
+
maxPages?: number;
|
|
140
|
+
now?: Date;
|
|
141
|
+
}): Promise<DetectResult>;
|
|
142
|
+
/** Bound entity UUIDs of managed workflows (drafts excluded) to the IDs of those workflows. */
|
|
143
|
+
export declare function boundEntities(workflows: Array<{
|
|
144
|
+
id: string;
|
|
145
|
+
entities: string[];
|
|
146
|
+
isDraft: boolean;
|
|
147
|
+
}>): Map<string, string[]>;
|