@burdenoff/fluidgrids-fe-sdk 2026.1111.13 → 2026.1111.15
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 +41 -0
- package/dist/{ExecutionDetailPage-CDkJeeu2.js → ExecutionDetailPage-DO38vZ_F.js} +4 -4
- package/dist/{FluidGridsProvider-CDZjKmfD.js → FluidGridsProvider-B9RR_CI_.js} +237 -325
- package/dist/{HistoryPage-DnVGN_72.js → HistoryPage-CA42pU85.js} +1 -1
- package/dist/{InsightsPage-CGRpZtGu.js → InsightsPage-CBoN_Mj9.js} +2 -2
- package/dist/{ManagedAiPolicyAuthority-DbJBledZ.js → ManagedAiPolicyAuthority-CKihmbJE.js} +2 -2
- package/dist/{MissingNodesInstallModal-Ca4f--lw.js → MissingNodesInstallModal-Dm0nMBXM.js} +1 -1
- package/dist/{TemplateConfigurationModal-ChQsXf0-.js → TemplateConfigurationModal-Bs_V-E4u.js} +1 -1
- package/dist/{TemplateDetailPanel-C0YiVdub.js → TemplateDetailPanel-MlT39VLG.js} +1 -1
- package/dist/{TemplatesPage-QXtq6mI3.js → TemplatesPage-CHVpWBuw.js} +5 -4
- package/dist/{WorkflowSearchRedirect-B4nHALJg.js → WorkflowSearchRedirect-3gyHcYY2.js} +38 -51
- package/dist/{WorkflowShareDialog-ByTSWwwR.js → WorkflowShareDialog-0Ai1HED-.js} +2 -1
- package/dist/{WorkflowsList-B9F2e8M6.js → WorkflowsList-CJ3KmMHX.js} +5 -4
- package/dist/agent-tools.d.ts +3 -0
- package/dist/agent-tools.js +5 -0
- package/dist/{agentTools-C0g2OWvI.js → agentTools-B1IK1JEO.js} +2 -2
- package/dist/{canvasNoteTools-BUWY18XK.js → canvasNoteTools-eewVHVuy.js} +3 -2
- package/dist/executions.js +1 -1
- package/dist/{flow-builder-BvCQAGDR.js → flow-builder-C_3sY3pZ.js} +54 -209
- package/dist/fluidgridsEvents-CNdcrUNN.js +310 -0
- package/dist/history.js +1 -1
- package/dist/index-CHeY7_A1.d.ts +105 -0
- package/dist/{index-CLqh2u28.d.ts → index-DRf25-D3.d.ts} +7 -105
- package/dist/index.d.ts +3 -2
- package/dist/index.js +21 -946
- package/dist/marksStore-DGCXjTmZ.js +151 -0
- package/dist/{node-detail-view-CPD_NSZc.js → node-detail-view-CAws5qjg.js} +3 -3
- package/dist/observability.d.ts +1 -1
- package/dist/observability.js +1 -1
- package/dist/{quick-config-panel-DHkYGaCL.js → quick-config-panel-DOzNkSVV.js} +2 -2
- package/dist/settings.js +1 -1
- package/dist/templates.js +1 -1
- package/dist/uiMarkTools-nlmzsHQM.js +937 -0
- package/dist/{useExecutions-BqoD7XWi.js → useExecutions-DkS0FTfw.js} +2 -1
- package/dist/{useObservability-Cs-5_NHh.js → useObservability-BkxhHZsX.js} +2 -1
- package/dist/{useRunHistory-CEL-CIz-.js → useRunHistory-DHehG09Z.js} +1 -1
- package/dist/{useWorkflows-Bwpvfdgv.js → useWorkflows-DyhtoVwp.js} +25 -5
- package/dist/workflow-builder.js +2 -2
- package/dist/workflow-route.d.ts +33 -0
- package/dist/workflow-route.js +4 -0
- package/dist/workflowRouteData-BkfVOc-O.js +169 -0
- package/dist/workflows-list.js +1 -1
- package/package.json +9 -1
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
// src/billing/quota.ts
|
|
3
|
+
/**
|
|
4
|
+
* Plan-quota refusals for the FluidGrids SDK.
|
|
5
|
+
*
|
|
6
|
+
* wspace-workflow-svc meters two quotas with `@usage`, and the gateway refuses
|
|
7
|
+
* a call past either one with `429 QUOTA_EXHAUSTED`:
|
|
8
|
+
*
|
|
9
|
+
* - `fluidgrids.runs.monthly` — every mutation that starts a run:
|
|
10
|
+
* `triggerWorkflow`, `runFromNode`, `replayWorkflowRun`, `retryWorkflowRuns`
|
|
11
|
+
* and `listenForWebhookTestEvent`.
|
|
12
|
+
* - `fluidgrids.workflows.count` — the mutations that create a workflow
|
|
13
|
+
* (save, duplicate, template import). Those keep their local
|
|
14
|
+
* `QuotaExhaustedDialog`.
|
|
15
|
+
* - `fluidgrids.nodes.count` — node additions are counted by workflow save;
|
|
16
|
+
* the same save dialog handles its refusal.
|
|
17
|
+
*
|
|
18
|
+
* A run refusal opens the shell's shared upgrade prompt — see
|
|
19
|
+
* `openRunQuotaUpgradePrompt` in `./upgradePrompt`. This module is the pure
|
|
20
|
+
* detection half, so it imports nothing from `@burdenoff/fe-libs`.
|
|
21
|
+
*
|
|
22
|
+
* ★★ Why this does not just call fe-libs `isQuotaExhaustedError`. That helper
|
|
23
|
+
* reads the Apollo 3 shapes (`graphQLErrors`, `networkError.result.errors`, a
|
|
24
|
+
* code in the message). Under Apollo 4 — what every host runs — the refusal
|
|
25
|
+
* never takes those shapes:
|
|
26
|
+
*
|
|
27
|
+
* - the gateway answers `429`, and Apollo 4's HTTP link turns any non-2xx
|
|
28
|
+
* `application/json` response into a `ServerError` whose GraphQL body is
|
|
29
|
+
* only in `bodyText` (message: "Response not successful: Received status
|
|
30
|
+
* code 429");
|
|
31
|
+
* - a 2xx GraphQL error arrives as `CombinedGraphQLErrors`, whose list is
|
|
32
|
+
* `.errors`, not `.graphQLErrors`;
|
|
33
|
+
* - `throwIfResultError` wraps either one in a plain `Error`, keeping the
|
|
34
|
+
* original as `cause`.
|
|
35
|
+
*
|
|
36
|
+
* None of those match, so the refusal read as an ordinary failure. This walker
|
|
37
|
+
* reads all of them, and the Apollo 3 shapes too.
|
|
38
|
+
*/
|
|
39
|
+
/** The monthly run allowance every run-starting mutation is metered against. */
|
|
40
|
+
const RUNS_QUOTA_NAME = "fluidgrids.runs.monthly";
|
|
41
|
+
/** The workflow-count allowance save / duplicate / template import consume. */
|
|
42
|
+
const WORKFLOWS_QUOTA_NAME = "fluidgrids.workflows.count";
|
|
43
|
+
/**
|
|
44
|
+
* Where an upgrade CTA sends the user: the plan picker, not the billing
|
|
45
|
+
* overview. Matches the shared `UpgradePromptModal` default and the shell nav.
|
|
46
|
+
*/
|
|
47
|
+
const BILLING_PLANS_PATH = "/billing/plans";
|
|
48
|
+
const QUOTA_EXHAUSTED_CODE = "QUOTA_EXHAUSTED";
|
|
49
|
+
const QUOTA_NOT_PROVISIONED_CODE = "QUOTA_NOT_PROVISIONED";
|
|
50
|
+
function asRecord$1(value) {
|
|
51
|
+
return typeof value === "object" && value !== null ? value : null;
|
|
52
|
+
}
|
|
53
|
+
/** The `extensions` of each entry of an `errors`-like list. */
|
|
54
|
+
function extensionsOfList(list) {
|
|
55
|
+
if (!Array.isArray(list)) return [];
|
|
56
|
+
const found = [];
|
|
57
|
+
for (const entry of list) {
|
|
58
|
+
const extensions = asRecord$1(asRecord$1(entry)?.extensions);
|
|
59
|
+
if (extensions) found.push(extensions);
|
|
60
|
+
}
|
|
61
|
+
return found;
|
|
62
|
+
}
|
|
63
|
+
/** The GraphQL `errors[].extensions` inside a raw response body, if it is JSON. */
|
|
64
|
+
function extensionsOfBody(bodyText) {
|
|
65
|
+
if (typeof bodyText !== "string" || !bodyText.includes("errors")) return [];
|
|
66
|
+
try {
|
|
67
|
+
return extensionsOfList(asRecord$1(JSON.parse(bodyText))?.errors);
|
|
68
|
+
} catch {
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/** Bounds the `cause` walk; real chains are one or two links long. */
|
|
73
|
+
const MAX_CAUSE_DEPTH = 5;
|
|
74
|
+
/**
|
|
75
|
+
* Every `extensions` object reachable on a thrown value, across the Apollo 3
|
|
76
|
+
* and Apollo 4 shapes and the `cause` chain `throwIfResultError` adds.
|
|
77
|
+
*/
|
|
78
|
+
function collectExtensions(error) {
|
|
79
|
+
const found = [];
|
|
80
|
+
const seen = /* @__PURE__ */ new Set();
|
|
81
|
+
let current = error;
|
|
82
|
+
for (let depth = 0; depth < MAX_CAUSE_DEPTH; depth += 1) {
|
|
83
|
+
const host = asRecord$1(current);
|
|
84
|
+
if (!host || seen.has(host)) break;
|
|
85
|
+
seen.add(host);
|
|
86
|
+
const direct = asRecord$1(host.extensions);
|
|
87
|
+
if (direct) found.push(direct);
|
|
88
|
+
found.push(...extensionsOfList(host.errors));
|
|
89
|
+
found.push(...extensionsOfList(host.graphQLErrors));
|
|
90
|
+
const networkError = asRecord$1(host.networkError);
|
|
91
|
+
found.push(...extensionsOfList(asRecord$1(networkError?.result)?.errors));
|
|
92
|
+
found.push(...extensionsOfBody(networkError?.bodyText));
|
|
93
|
+
found.push(...extensionsOfList(asRecord$1(host.result)?.errors));
|
|
94
|
+
found.push(...extensionsOfBody(host.bodyText));
|
|
95
|
+
current = host.cause;
|
|
96
|
+
}
|
|
97
|
+
return found;
|
|
98
|
+
}
|
|
99
|
+
/** Every GraphQL `extensions.code` carried by `error` or its causes. */
|
|
100
|
+
function errorCodesOf(error) {
|
|
101
|
+
return collectExtensions(error).map((ext) => ext.code).filter((code) => typeof code === "string");
|
|
102
|
+
}
|
|
103
|
+
function stringField(extensions, key) {
|
|
104
|
+
const value = extensions[key];
|
|
105
|
+
return typeof value === "string" && value.length > 0 ? value : null;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* The refusal kind one GraphQL `extensions` object reports, or null.
|
|
109
|
+
*
|
|
110
|
+
* The gateway sets both `code` and `quotaBlock` on a quota refusal
|
|
111
|
+
* (`sendQuotaExhausted` in wspace-public-gateway); either is enough here, so
|
|
112
|
+
* a refusal relayed with only one of them (a proxy, an older gateway build)
|
|
113
|
+
* still reads as one.
|
|
114
|
+
*/
|
|
115
|
+
function refusalKindOf(extensions) {
|
|
116
|
+
if (extensions.code === "QUOTA_NOT_PROVISIONED" || extensions.quotaBlock === "not-provisioned") return "not-provisioned";
|
|
117
|
+
if (extensions.code === "QUOTA_EXHAUSTED" || extensions.quotaBlock === "exhausted") return "exhausted";
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* The quota refusal carried by `error`, or null when it is not one.
|
|
122
|
+
*
|
|
123
|
+
* Keyed on `extensions.code` (or the gateway's `extensions.quotaBlock`), never
|
|
124
|
+
* on the HTTP status or the message: both refusals are 429s, and only those
|
|
125
|
+
* fields tell "used up" from "never granted". `not-provisioned` wins when both
|
|
126
|
+
* appear.
|
|
127
|
+
*/
|
|
128
|
+
function findQuotaRefusal(error) {
|
|
129
|
+
const all = collectExtensions(error);
|
|
130
|
+
const notProvisioned = all.find((ext) => refusalKindOf(ext) === "not-provisioned");
|
|
131
|
+
if (notProvisioned) return {
|
|
132
|
+
kind: "not-provisioned",
|
|
133
|
+
quotaName: stringField(notProvisioned, "quotaName"),
|
|
134
|
+
limitLeft: null
|
|
135
|
+
};
|
|
136
|
+
const exhausted = all.find((ext) => refusalKindOf(ext) === "exhausted");
|
|
137
|
+
if (exhausted) {
|
|
138
|
+
const limitLeft = exhausted.limitLeft;
|
|
139
|
+
return {
|
|
140
|
+
kind: "exhausted",
|
|
141
|
+
quotaName: stringField(exhausted, "quotaName"),
|
|
142
|
+
limitLeft: typeof limitLeft === "number" ? limitLeft : null
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
/** True when `error` is an exhausted (not merely unprovisioned) plan quota. */
|
|
148
|
+
function isQuotaExhaustedFailure(error) {
|
|
149
|
+
return findQuotaRefusal(error)?.kind === "exhausted";
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// src/analytics/fluidgridsEvents.ts
|
|
153
|
+
/** `component` stamped on every event so devtools/OTel can tell the emitter. */
|
|
154
|
+
const FLUIDGRIDS_ANALYTICS_COMPONENT = "fluidgrids-fe-sdk";
|
|
155
|
+
/** Upper bound for a slug-like dimension; anything longer is not a slug. */
|
|
156
|
+
const MAX_DIMENSION_LENGTH = 64;
|
|
157
|
+
const SLUG_PATTERN = /^[A-Za-z0-9][A-Za-z0-9_./:-]*$/;
|
|
158
|
+
/**
|
|
159
|
+
* Keep a dimension only when it is a short slug (`integration/slack`,
|
|
160
|
+
* `trigger_webhook`, `marketing`). Anything else — spaces, free text, a very
|
|
161
|
+
* long value — is dropped rather than risk sending user data.
|
|
162
|
+
*/
|
|
163
|
+
function toDimension(value) {
|
|
164
|
+
if (typeof value !== "string") return void 0;
|
|
165
|
+
const trimmed = value.trim();
|
|
166
|
+
if (!trimmed || trimmed.length > MAX_DIMENSION_LENGTH) return void 0;
|
|
167
|
+
return SLUG_PATTERN.test(trimmed) ? trimmed : void 0;
|
|
168
|
+
}
|
|
169
|
+
/** Non-empty string id, or undefined. */
|
|
170
|
+
function idOrUndefined(value) {
|
|
171
|
+
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
172
|
+
}
|
|
173
|
+
/** A finite, non-negative integer count, or undefined. */
|
|
174
|
+
function countOrUndefined(value) {
|
|
175
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0 ? Math.round(value) : void 0;
|
|
176
|
+
}
|
|
177
|
+
function emit(bus, name, payload) {
|
|
178
|
+
if (!bus) return;
|
|
179
|
+
const clean = Object.fromEntries(Object.entries(payload).filter(([, value]) => value !== void 0));
|
|
180
|
+
try {
|
|
181
|
+
bus.emit(name, clean, { component: FLUIDGRIDS_ANALYTICS_COMPONENT });
|
|
182
|
+
} catch (error) {
|
|
183
|
+
console.warn(`[fluidgrids analytics] failed to emit ${name}`, error);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
function asRecord(value) {
|
|
187
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : null;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* The executable node list of a workflow definition, wherever it sits: the
|
|
191
|
+
* flow store's `{ nodes }`, a saved `definitionJson` (`{ data: { nodes } }`) or
|
|
192
|
+
* a raw list.
|
|
193
|
+
*/
|
|
194
|
+
function nodesOf(definition) {
|
|
195
|
+
if (Array.isArray(definition)) return definition;
|
|
196
|
+
const record = asRecord(definition);
|
|
197
|
+
if (!record) return [];
|
|
198
|
+
if (Array.isArray(record.nodes)) return record.nodes;
|
|
199
|
+
const data = asRecord(record.data);
|
|
200
|
+
if (data && Array.isArray(data.nodes)) return data.nodes;
|
|
201
|
+
return [];
|
|
202
|
+
}
|
|
203
|
+
function isTriggerNode(node) {
|
|
204
|
+
if ((typeof node.type === "string" ? node.type.toLowerCase() : "").includes("trigger")) return true;
|
|
205
|
+
const data = asRecord(node.data);
|
|
206
|
+
return data?.isTrigger === true || data?.category === "trigger";
|
|
207
|
+
}
|
|
208
|
+
/** Node-type slug of the workflow's trigger node, when it has one. */
|
|
209
|
+
function triggerTypeOf(definition) {
|
|
210
|
+
const trigger = nodesOf(definition).find(isTriggerNode);
|
|
211
|
+
return trigger ? toDimension(trigger.type) : void 0;
|
|
212
|
+
}
|
|
213
|
+
/** Number of executable nodes on the canvas. */
|
|
214
|
+
function nodeCountOf(definition) {
|
|
215
|
+
const nodes = nodesOf(definition);
|
|
216
|
+
return nodes.length > 0 ? nodes.length : void 0;
|
|
217
|
+
}
|
|
218
|
+
/** `fluidgrids.workflow.created` — a new workflow exists in the workspace. */
|
|
219
|
+
function emitWorkflowCreated(bus, fact) {
|
|
220
|
+
emit(bus, "fluidgrids.workflow.created", {
|
|
221
|
+
workspaceId: idOrUndefined(fact.workspaceId),
|
|
222
|
+
workflowId: idOrUndefined(fact.workflowId),
|
|
223
|
+
source: fact.source,
|
|
224
|
+
triggerType: triggerTypeOf(fact.definition),
|
|
225
|
+
nodeCount: nodeCountOf(fact.definition)
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
/** `fluidgrids.workflow.published` — a version was activated. */
|
|
229
|
+
function emitWorkflowPublished(bus, fact) {
|
|
230
|
+
emit(bus, "fluidgrids.workflow.published", {
|
|
231
|
+
workspaceId: idOrUndefined(fact.workspaceId),
|
|
232
|
+
workflowId: idOrUndefined(fact.workflowId),
|
|
233
|
+
triggerType: triggerTypeOf(fact.definition),
|
|
234
|
+
nodeCount: nodeCountOf(fact.definition)
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
/** `fluidgrids.workflow.run_started` — the backend accepted a run. */
|
|
238
|
+
function emitRunStarted(bus, fact) {
|
|
239
|
+
emit(bus, "fluidgrids.workflow.run_started", {
|
|
240
|
+
workspaceId: idOrUndefined(fact.workspaceId),
|
|
241
|
+
workflowId: idOrUndefined(fact.workflowId),
|
|
242
|
+
executionId: idOrUndefined(fact.executionId),
|
|
243
|
+
trigger: fact.trigger
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* `fluidgrids.workflow.run_failed` — a run this user started ended FAILED.
|
|
248
|
+
* `errorCode` is the run's machine error classification (`TIMEOUT`,
|
|
249
|
+
* `VALIDATION`, …), never its message.
|
|
250
|
+
*/
|
|
251
|
+
function emitRunFailed(bus, fact) {
|
|
252
|
+
emit(bus, "fluidgrids.workflow.run_failed", {
|
|
253
|
+
workspaceId: idOrUndefined(fact.workspaceId),
|
|
254
|
+
workflowId: idOrUndefined(fact.workflowId),
|
|
255
|
+
executionId: idOrUndefined(fact.executionId),
|
|
256
|
+
trigger: fact.trigger,
|
|
257
|
+
errorCode: toDimension(fact.errorCode),
|
|
258
|
+
durationMs: countOrUndefined(fact.durationMs)
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
/** `fluidgrids.template.used` — a store template became a workflow. */
|
|
262
|
+
function emitTemplateUsed(bus, fact) {
|
|
263
|
+
emit(bus, "fluidgrids.template.used", {
|
|
264
|
+
workspaceId: idOrUndefined(fact.workspaceId),
|
|
265
|
+
templateId: idOrUndefined(fact.templateId),
|
|
266
|
+
category: toDimension(fact.category)
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
/** `fluidgrids.node.installed` — a store node was installed. */
|
|
270
|
+
function emitNodeInstalled(bus, fact) {
|
|
271
|
+
emit(bus, "fluidgrids.node.installed", {
|
|
272
|
+
workspaceId: idOrUndefined(fact.workspaceId),
|
|
273
|
+
nodeType: toDimension(fact.nodeType),
|
|
274
|
+
source: fact.source
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
/** `fluidgrids.quota.workflow_limit_hit` — a create was refused at the limit. */
|
|
278
|
+
function emitWorkflowLimitHit(bus, fact) {
|
|
279
|
+
emit(bus, "fluidgrids.quota.workflow_limit_hit", {
|
|
280
|
+
workspaceId: idOrUndefined(fact.workspaceId),
|
|
281
|
+
quotaKey: WORKFLOWS_QUOTA_NAME,
|
|
282
|
+
surface: fact.surface
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
/** `fluidgrids.quota.run_limit_hit` — a run was refused at the monthly limit. */
|
|
286
|
+
function emitRunLimitHit(bus, fact) {
|
|
287
|
+
emit(bus, "fluidgrids.quota.run_limit_hit", {
|
|
288
|
+
workspaceId: idOrUndefined(fact.workspaceId),
|
|
289
|
+
quotaKey: toDimension(fact.quotaKey) ?? "fluidgrids.runs.monthly",
|
|
290
|
+
surface: fact.surface
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
/** `fluidgrids.billing.upgrade_clicked` — a FluidGrids upgrade CTA was clicked. */
|
|
294
|
+
function emitUpgradeClicked(bus, fact) {
|
|
295
|
+
emit(bus, "fluidgrids.billing.upgrade_clicked", {
|
|
296
|
+
workspaceId: idOrUndefined(fact.workspaceId),
|
|
297
|
+
surface: fact.surface,
|
|
298
|
+
quotaKey: toDimension(fact.quotaKey)
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Map a run's backend mode/trigger to the analytics trigger dimension. The
|
|
303
|
+
* builder's debug paths are always `TEST`; anything else a person started by
|
|
304
|
+
* hand is `manual`.
|
|
305
|
+
*/
|
|
306
|
+
function runTriggerFromMode(mode) {
|
|
307
|
+
return typeof mode === "string" && mode.toUpperCase() === "TEST" ? "test" : "manual";
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export { errorCodesOf as _, emitTemplateUsed as a, emitWorkflowLimitHit as c, runTriggerFromMode as d, BILLING_PLANS_PATH as f, collectExtensions as g, WORKFLOWS_QUOTA_NAME as h, emitRunStarted as i, emitWorkflowPublished as l, RUNS_QUOTA_NAME as m, emitRunFailed as n, emitUpgradeClicked as o, QUOTA_EXHAUSTED_CODE as p, emitRunLimitHit as r, emitWorkflowCreated as s, emitNodeInstalled as t, nodesOf as u, findQuotaRefusal as v, isQuotaExhaustedFailure as y };
|
package/dist/history.js
CHANGED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
|
|
2
|
+
import { FC } from "react";
|
|
3
|
+
import { AnyDefinedAgentTool } from "@burdenoff/fe-libs/shared/agent-tools";
|
|
4
|
+
declare const AGENT_OPERATIONS: {
|
|
5
|
+
readonly AgentFindWorkflows: "\n query AgentFindWorkflows($input: ListWorkflowDefinitionsInput!) {\n workflowDefinitions(input: $input) {\n total\n hasMore\n items { id name workflowKey version status updatedAt workspaceId deletedAt description }\n }\n }\n";
|
|
6
|
+
readonly AgentGetWorkflow: "\n query AgentGetWorkflow($workflowKey: String!, $version: String) {\n workflowDefinition(workflowKey: $workflowKey, version: $version) {\n id name workflowKey version status updatedAt description definitionJson totalVersions workspaceId deletedAt\n }\n }\n";
|
|
7
|
+
readonly AgentListRuns: "\n query AgentListRuns($input: ListWorkflowRunsInput!) {\n workflowRuns(input: $input) {\n total\n hasMore\n items { id workflowKey version status mode startedAt completedAt duration errorMessage workflow { name } }\n }\n }\n";
|
|
8
|
+
readonly AgentGetRun: "\n query AgentGetRun($id: ID!) {\n workflowRun(id: $id) {\n id workflowKey version status mode startedAt completedAt duration errorMessage errorType\n totalNodes completedNodes failedNodes\n workflow { name }\n nodeStates { nodeId nodeType status error }\n }\n }\n";
|
|
9
|
+
readonly AgentActivateWorkflow: "\n mutation AgentActivateWorkflow($id: ID!) {\n activateWorkflowDefinition(id: $id) { workflowKey version status }\n }\n";
|
|
10
|
+
readonly AgentDeactivateWorkflow: "\n mutation AgentDeactivateWorkflow($id: ID!) {\n deactivateWorkflowDefinition(id: $id) { workflowKey version status }\n }\n";
|
|
11
|
+
readonly AgentTriggerWorkflow: "\n mutation AgentTriggerWorkflow($input: TriggerWorkflowInput!) {\n triggerWorkflow(input: $input) { runId status workflowKey version }\n }\n";
|
|
12
|
+
readonly AgentCancelRun: "\n mutation AgentCancelRun($id: ID!) {\n cancelWorkflowRun(id: $id) { id status }\n }\n";
|
|
13
|
+
};
|
|
14
|
+
type AgentOperationName = keyof typeof AGENT_OPERATIONS;
|
|
15
|
+
interface FluidGridsAgentToolDeps {
|
|
16
|
+
request: <T>(operation: {
|
|
17
|
+
operationName: AgentOperationName;
|
|
18
|
+
query: string;
|
|
19
|
+
variables: Record<string, unknown>;
|
|
20
|
+
signal: AbortSignal;
|
|
21
|
+
}) => Promise<T>;
|
|
22
|
+
getWorkspaceId: () => string | null;
|
|
23
|
+
navigate: (path: string) => void;
|
|
24
|
+
listFilters?: () => Record<string, unknown> | undefined;
|
|
25
|
+
}
|
|
26
|
+
interface TriggerNode {
|
|
27
|
+
id: string;
|
|
28
|
+
label: string;
|
|
29
|
+
type: string;
|
|
30
|
+
}
|
|
31
|
+
declare function triggerNodesOf(definition: unknown): TriggerNode[];
|
|
32
|
+
declare function pickTriggerNode(triggers: readonly TriggerNode[], requested: string | undefined): TriggerNode;
|
|
33
|
+
declare function createFluidGridsAgentTools(deps: FluidGridsAgentToolDeps): AnyDefinedAgentTool[];
|
|
34
|
+
interface AgentCalloutOverlayProps {
|
|
35
|
+
rightInset?: number;
|
|
36
|
+
}
|
|
37
|
+
declare const AgentCalloutOverlay: FC<AgentCalloutOverlayProps>;
|
|
38
|
+
interface UiMarkToolOptions {
|
|
39
|
+
root?: () => ParentNode | null;
|
|
40
|
+
waitMs?: number;
|
|
41
|
+
}
|
|
42
|
+
declare function createUiMarkTools(options?: UiMarkToolOptions): AnyDefinedAgentTool[];
|
|
43
|
+
type CanvasNoteKind = "fix" | "info";
|
|
44
|
+
interface CalloutTarget {
|
|
45
|
+
role: string;
|
|
46
|
+
name: string;
|
|
47
|
+
nth: number;
|
|
48
|
+
}
|
|
49
|
+
interface AgentCallout {
|
|
50
|
+
id: string;
|
|
51
|
+
label: string;
|
|
52
|
+
target: CalloutTarget;
|
|
53
|
+
route: string;
|
|
54
|
+
element: WeakRef<Element> | null;
|
|
55
|
+
}
|
|
56
|
+
interface CanvasNote {
|
|
57
|
+
id: string;
|
|
58
|
+
number: number;
|
|
59
|
+
workflowKey: string;
|
|
60
|
+
nodeId: string;
|
|
61
|
+
nodeLabel: string;
|
|
62
|
+
paramKey: string | null;
|
|
63
|
+
kind: CanvasNoteKind;
|
|
64
|
+
message: string;
|
|
65
|
+
resolved: boolean;
|
|
66
|
+
}
|
|
67
|
+
interface NewCanvasNote {
|
|
68
|
+
workflowKey: string;
|
|
69
|
+
nodeId: string;
|
|
70
|
+
nodeLabel: string;
|
|
71
|
+
paramKey?: string | null;
|
|
72
|
+
kind: CanvasNoteKind;
|
|
73
|
+
message: string;
|
|
74
|
+
}
|
|
75
|
+
interface AgentMarksState {
|
|
76
|
+
callouts: AgentCallout[];
|
|
77
|
+
notes: CanvasNote[];
|
|
78
|
+
nextNumber: Record<string, number>;
|
|
79
|
+
openNoteId: string | null;
|
|
80
|
+
flash: {
|
|
81
|
+
nodeId: string;
|
|
82
|
+
token: number;
|
|
83
|
+
} | null;
|
|
84
|
+
actions: {
|
|
85
|
+
addCallout: (callout: {
|
|
86
|
+
label: string;
|
|
87
|
+
target: CalloutTarget;
|
|
88
|
+
element: Element | null;
|
|
89
|
+
route: string;
|
|
90
|
+
}) => AgentCallout;
|
|
91
|
+
rebindCallout: (id: string, element: Element) => void;
|
|
92
|
+
removeCallout: (id: string) => void;
|
|
93
|
+
clearCallouts: () => number;
|
|
94
|
+
dropCalloutsOffRoute: (route: string) => number;
|
|
95
|
+
addNote: (note: NewCanvasNote) => CanvasNote | null;
|
|
96
|
+
setResolved: (id: string, resolved: boolean) => void;
|
|
97
|
+
removeNote: (id: string) => void;
|
|
98
|
+
clearNotes: (workflowKey?: string) => number;
|
|
99
|
+
openNote: (id: string | null) => void;
|
|
100
|
+
flashNode: (nodeId: string) => void;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
declare const useAgentMarksStore: import("zustand").UseBoundStore<import("zustand").StoreApi<AgentMarksState>>;
|
|
104
|
+
declare function resetAgentMarks(): void;
|
|
105
|
+
export { createUiMarkTools as a, FluidGridsAgentToolDeps as c, triggerNodesOf as d, UiMarkToolOptions as i, createFluidGridsAgentTools as l, resetAgentMarks as n, AgentCalloutOverlay as o, useAgentMarksStore as r, AgentCalloutOverlayProps as s, CanvasNote as t, pickTriggerNode as u };
|