@segmentstream/ontology 0.197.0 → 0.198.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/CHANGELOG.md +103 -0
- package/dist/analyze.d.ts +2 -0
- package/dist/analyze.js +17 -0
- package/dist/bin/check.js +12 -0
- package/dist/bin/migrate.js +1 -1
- package/dist/connection.d.ts +109 -6
- package/dist/connection.js +132 -17
- package/dist/diagnostics.d.ts +3 -3
- package/dist/diagnostics.js +2 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/manifest.d.ts +28 -0
- package/dist/manifest.js +6 -0
- package/dist/migrate/apply.d.ts +7 -1
- package/dist/migrate/apply.js +12 -3
- package/dist/migrate/model.d.ts +8 -0
- package/dist/migrate/plan.js +14 -1
- package/dist/owned-workflows.d.ts +10 -0
- package/dist/owned-workflows.js +16 -0
- package/dist/runtime/owner-departures.d.ts +35 -0
- package/dist/runtime/owner-departures.js +64 -0
- package/dist/runtime/pipeline.d.ts +15 -1
- package/dist/runtime/pipeline.js +67 -1
- package/dist/runtime/principals.d.ts +17 -2
- package/dist/runtime/principals.js +33 -2
- package/dist/runtime/service-binding.js +17 -3
- package/dist/runtime/workflow-starts.d.ts +108 -8
- package/dist/runtime/workflow-starts.js +276 -49
- package/dist/service/agent/attachments.js +27 -6
- package/dist/service/agent/authentication.d.ts +5 -0
- package/dist/service/agent/authentication.js +1 -1
- package/dist/service/agent/task-caller.d.ts +4 -2
- package/dist/service/agent/task-caller.js +4 -2
- package/dist/service/authentication.d.ts +7 -0
- package/dist/service/authentication.js +12 -0
- package/dist/service/chat/envelope.d.ts +7 -0
- package/dist/service/chat/envelope.js +15 -0
- package/dist/service/config.d.ts +6 -0
- package/dist/service/connections.d.ts +17 -2
- package/dist/service/connections.js +21 -1
- package/dist/service/errors.js +27 -1
- package/dist/service/member-files.js +6 -0
- package/dist/service/operations.d.ts +8 -0
- package/dist/service/operations.js +11 -4
- package/dist/service/owned-connections.d.ts +80 -0
- package/dist/service/owned-connections.js +488 -0
- package/dist/service/runtime-contract.d.ts +22 -0
- package/dist/service/schemas.d.ts +2 -0
- package/dist/service/service.js +23 -2
- package/dist/service/workflow-errors.d.ts +18 -1
- package/dist/service/workflow-errors.js +51 -2
- package/dist/service/workflows.d.ts +24 -0
- package/dist/service/workflows.js +360 -50
- package/dist/start-recovery-contract.d.ts +17 -1
- package/dist/start-recovery-contract.js +11 -1
- package/dist/start-recovery.js +4 -1
- package/dist/storage/tables.d.ts +15 -0
- package/dist/storage/tables.js +21 -0
- package/dist/workflow.d.ts +20 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,108 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.198.0
|
|
4
|
+
|
|
5
|
+
A user who leaves keeps no credential of an owned connection (`owner="user"`). Once an action that
|
|
6
|
+
deactivates a user, deletes one, or revokes a user's last sign-in or chat identity commits, the
|
|
7
|
+
ontology service asks SegmentStream to retire every owned connection credential of that user in the
|
|
8
|
+
workspace, with the deployment's identity. A failure is logged and never undoes the action; the
|
|
9
|
+
next deployment retires what was missed. A preview, a local run and a test retire nothing.
|
|
10
|
+
|
|
11
|
+
Only a production deployment whose ontology declares an owned connection handle makes that call:
|
|
12
|
+
in any other workspace, and in every preview, a deactivation, a deletion or an identity
|
|
13
|
+
revocation makes no extra request and no extra database read.
|
|
14
|
+
|
|
15
|
+
`listMembers` takes `ids` to list only the members with those ids, found by the user's primary
|
|
16
|
+
key; an id that is no UUID names no member. Each member it lists, and the member that
|
|
17
|
+
`setMemberActive` and `setMemberBlocked` return, now has `deactivated: true` once deactivated,
|
|
18
|
+
whether or not they are also blocked. `active` keeps its meaning, active and not blocked, so a
|
|
19
|
+
reader that must tell a deactivation from a block, such as retiring a departed user's
|
|
20
|
+
credentials, reads `deactivated`.
|
|
21
|
+
|
|
22
|
+
Owned connections in actions. `connection(key, { owner: "user", description })` declares the
|
|
23
|
+
ontology's handle of a connection `connections.py` declares with `owner="user"`, and the manifest
|
|
24
|
+
writes `owner: "user"` for it only. A call through an owned handle in an action uses the
|
|
25
|
+
credential of the person who called it, as an interactive call; a call made as anyone else, a
|
|
26
|
+
workflow's user, an agent task, a service or a guest, fails before reaching SegmentStream with
|
|
27
|
+
`ConnectionError` reason `owner_required`. A call from a step of a workflow run with no owner does
|
|
28
|
+
so too. `ConnectionError.reason` also gains `background_consent_required`. When the
|
|
29
|
+
person has not connected, `authorization_required` carries `connect`,
|
|
30
|
+
`/account/connections?connection=<key>`, in the error, the action's 409 body and the MCP tool
|
|
31
|
+
error. `Connections.test` stubs receive `{ owner, call }` as an optional second
|
|
32
|
+
argument for an owned handle's call, and `Connections.test(stubs, { owner: userId })` runs the
|
|
33
|
+
owned calls that fake transport answers for that user, so a test can run an owned action
|
|
34
|
+
directly; an action run with another transport ignores it. No other API names an owner: the owner
|
|
35
|
+
and the call kind are not part of `ConnectionCall` or any other exported type.
|
|
36
|
+
|
|
37
|
+
A call made through an API key with delegation never uses the credential of the member the key
|
|
38
|
+
names: its owned calls fail with `owner_required`, also when it promotes an attachment into an
|
|
39
|
+
action. The app's own agent acting for the verified sender of a chat message uses that sender's
|
|
40
|
+
credential. Only a verified caller gives an owner: an action run in process without one, a direct
|
|
41
|
+
`runAction` included, fails its owned calls with `owner_required`, and a `runAction` nested in a
|
|
42
|
+
verified request gets one only when it runs as that request's member. An attachment promotion,
|
|
43
|
+
by the agent or by a member over REST or MCP, whose action `input` carries `_segmentstream` is
|
|
44
|
+
refused with 400 `invalid_request` naming `input._segmentstream`: a promotion's chat provenance
|
|
45
|
+
comes only from its `_meta`. When the agent promotes for a member it has not paired with and
|
|
46
|
+
`_meta` names no source, owned calls fail with `owner_required`.
|
|
47
|
+
|
|
48
|
+
The ontology service serves each signed-in member their own owned connections under
|
|
49
|
+
`/api/ontology/me/connections`: list, their calls, starting consent, a supplied token, confirming,
|
|
50
|
+
discarding a code with no session, background use and disconnecting. A guest, a service, a
|
|
51
|
+
workflow's user, an agent task, the deployment's runtime token, an MCP client's token and an API
|
|
52
|
+
key with delegation are refused, no route takes a user, and none changes anything on a GET. The
|
|
53
|
+
discard answers a key the ontology does not declare owned without asking SegmentStream.
|
|
54
|
+
|
|
55
|
+
Owned connections in workflows. A workflow that lists an owned connection in its `connections`
|
|
56
|
+
is an owned workflow: each run belongs to one user, fixed when it starts, and acts as that user,
|
|
57
|
+
with all of their current roles, permissions and scopes read at each step and their credentials
|
|
58
|
+
of the owned connections the workflow lists. The workflow's `role` does not bound such a run; it is
|
|
59
|
+
what a run with no user, and an agent task a run starts, holds.
|
|
60
|
+
|
|
61
|
+
- A cron starts one background run for each user who is an active member, has connected every
|
|
62
|
+
owned connection the workflow lists and allowed background use on each. It reads the eligible
|
|
63
|
+
users from SegmentStream 500 at a time, for up to 40 seconds after the request arrived, writes
|
|
64
|
+
one pending row per user and scheduled minute in `_workflow_starts`, starts them until 25
|
|
65
|
+
seconds after the request arrived, launching none after that and cutting off any still in
|
|
66
|
+
flight, and leaves the rest to the recovery run, whose sweeps drain them batch after batch and
|
|
67
|
+
whose last sweep arms another run while rows still wait. A delivery is for the latest instant
|
|
68
|
+
the expression fires at, up to 5 seconds after it arrives, so one that arrives a moment early,
|
|
69
|
+
late or again starts no second run. The log line `ontology.workflow.owned_cron` counts eligible,
|
|
70
|
+
started, pending and skipped users, and says `truncated`, with the users read, when the request
|
|
71
|
+
stopped reading before the last page.
|
|
72
|
+
- A run a member starts, or one an `after(...)` trigger starts for an action a member called,
|
|
73
|
+
belongs to that member and is interactive. An action a step of an owned run calls starts its
|
|
74
|
+
triggers' runs for that run's owner, with its call kind. A retry keeps the original run's owner;
|
|
75
|
+
it keeps the call kind only when that owner retries it, and anyone else's retry, the console's
|
|
76
|
+
included, is background. The CLI, the platform and services start runs with no owner, which act
|
|
77
|
+
as the workflow's user and fail owned calls with `owner_required`, as agent tasks do.
|
|
78
|
+
- An action a step calls fails an owned call to a key the workflow does not list with
|
|
79
|
+
`owner_required`. An owner who is no longer an active member fails the run's next step with
|
|
80
|
+
`OwnerInactive` (`reason: "owner_inactive"`); the run never acts as anyone else.
|
|
81
|
+
- `WorkflowRunContext.owner` is `{ entity: "user", id }` on a run with an owner, and run views
|
|
82
|
+
show `owner`. No API takes it to choose a credential or a principal.
|
|
83
|
+
- `check` refuses a webhook trigger on an owned workflow (`workflow_owned_connection_webhook`) and
|
|
84
|
+
a toolset over an owned connection (`toolset_connection_owned`), and its summary prints which of
|
|
85
|
+
each workflow's connections are owned.
|
|
86
|
+
- `Connections.test(stubs, { owner, call })` takes the call kind its owned calls are stubbed with,
|
|
87
|
+
and a workflow step's calls through that test transport use its owner. It never makes a run act
|
|
88
|
+
as that user.
|
|
89
|
+
- A run of a workflow that lists no owned connection acts as the workflow's user whatever owner
|
|
90
|
+
its attributes record, and a retry of it has no owner.
|
|
91
|
+
- A migration adds the owner columns to `_workflow_starts` only for an ontology that declares an
|
|
92
|
+
owned workflow, and only such an ontology's sweep and migration read them; `readRuntimeTables`
|
|
93
|
+
takes the `target` to know. Workspaces without one run the statements they ran before, and runs
|
|
94
|
+
started before this release keep running as their workflow's user.
|
|
95
|
+
|
|
96
|
+
## 0.197.1
|
|
97
|
+
|
|
98
|
+
A workflow run that the runtime fails for reaching its event limit, its replay limit or its
|
|
99
|
+
queue deliveries now says so. Run detail, in `segmentstream workflow run get` and Cloud, shows
|
|
100
|
+
the runtime's classification as the error code (`MAX_EVENTS_EXCEEDED`, `REPLAY_TIMEOUT` or
|
|
101
|
+
`MAX_DELIVERIES_EXCEEDED`) and the runtime's statement of the limit as the message, such as
|
|
102
|
+
`Workflow exceeded the maximum of 25000 events per run`; the runs list carries the code. Before,
|
|
103
|
+
such a run showed only `MaxEventsExceededError` or `FatalError` with no message. Redeploy the
|
|
104
|
+
workspace after upgrading.
|
|
105
|
+
|
|
3
106
|
## 0.197.0
|
|
4
107
|
|
|
5
108
|
A workflow run's detail now carries what the run returned and what each completed step returned, as `output`: the value as JSON, redacted by the same rules as logs. A value whose JSON text is longer than 4 KB is cut to that length and marked `outputTruncated: true`; a value the service cannot decrypt or deserialize is answered with `output: null` and `outputUnavailable`, with the reference of its operator report. `segmentstream workflow run get`, its `--output json` and the ontology MCP tool show them. Upgrade and redeploy the workspace to serve them.
|
package/dist/analyze.d.ts
CHANGED
|
@@ -199,6 +199,8 @@ export interface ResolvedConnection {
|
|
|
199
199
|
readonly description: string;
|
|
200
200
|
/** Whether the ontology sends data out through the connection. */
|
|
201
201
|
readonly delivers: boolean;
|
|
202
|
+
/** `"user"` for an owned connection, whose every user connects their own account. */
|
|
203
|
+
readonly owner?: "user";
|
|
202
204
|
readonly handle: AnyConnectionHandle;
|
|
203
205
|
}
|
|
204
206
|
export interface ResolvedIndex {
|
package/dist/analyze.js
CHANGED
|
@@ -799,6 +799,16 @@ function resolveWorkflows(input) {
|
|
|
799
799
|
const kinds = new Set((Array.isArray(candidate.triggers) ? candidate.triggers : [])
|
|
800
800
|
.filter(isWorkflowTrigger)
|
|
801
801
|
.map((trigger) => trigger.kind));
|
|
802
|
+
// A webhook's delivery belongs to no user, so an owned workflow has no one to run for.
|
|
803
|
+
const ownedKeys = (Array.isArray(candidate.connections) ? candidate.connections : [])
|
|
804
|
+
.filter((handle) => isConnection(handle) && handle.owner === "user")
|
|
805
|
+
.map((handle) => handle.key);
|
|
806
|
+
if (kinds.has("webhook") && ownedKeys.length > 0) {
|
|
807
|
+
report("workflow_owned_connection_webhook", `${path}.triggers`, `the workflow lists the owned connection${ownedKeys.length === 1 ? "" : "s"} ` +
|
|
808
|
+
`${ownedKeys.join(", ")}, so each run belongs to a user, and a webhook's delivery ` +
|
|
809
|
+
"belongs to none; start the owned work from a cron, an action trigger or a person.");
|
|
810
|
+
valid = false;
|
|
811
|
+
}
|
|
802
812
|
if (kinds.has("webhook")) {
|
|
803
813
|
if (kinds.size > 1) {
|
|
804
814
|
report("workflow_webhook_mixed_triggers", `${path}.triggers`, "a workflow that a webhook starts takes a delivery as its input, so it has only webhook " +
|
|
@@ -1326,6 +1336,12 @@ function resolveToolsets(declared, entities, connections, report) {
|
|
|
1326
1336
|
else if (!keys.has(connection.key)) {
|
|
1327
1337
|
fail("unknown-connection", `${path}.connection`, `the connection ${String(connection.key)} is not listed in defineOntology({ connections }).`);
|
|
1328
1338
|
}
|
|
1339
|
+
else if (connection.owner === "user" ||
|
|
1340
|
+
connections.some((candidate) => candidate.key === connection.key && candidate.owner === "user")) {
|
|
1341
|
+
fail("toolset_connection_owned", `${path}.connection`, `the connection ${connection.key} is owned by each user, and a toolset's tools call a ` +
|
|
1342
|
+
"connection with no user's credential, so every call would be refused; serve the " +
|
|
1343
|
+
"provider's tools over a shared connection, or call the owned one from an action.");
|
|
1344
|
+
}
|
|
1329
1345
|
if (typeof api !== "string" || !/^[a-z][a-z0-9_]{0,63}$/.test(api)) {
|
|
1330
1346
|
fail("invalid-toolset", `${path}.api`, "api names the connection's MCP API in connections/connections.py, such as mcp.");
|
|
1331
1347
|
}
|
|
@@ -1467,6 +1483,7 @@ function collectConnections(config, report) {
|
|
|
1467
1483
|
key: candidate.key,
|
|
1468
1484
|
description: typeof candidate.description === "string" ? candidate.description : "",
|
|
1469
1485
|
delivers: candidate.delivers === true,
|
|
1486
|
+
...(candidate.owner === "user" ? { owner: "user" } : {}),
|
|
1470
1487
|
handle: candidate,
|
|
1471
1488
|
});
|
|
1472
1489
|
});
|
package/dist/bin/check.js
CHANGED
|
@@ -16,6 +16,15 @@ export function catalogSummary(manifest) {
|
|
|
16
16
|
const actions = manifest.entities.flatMap((entity) => entity.actions.map((action) => `${entity.name}.${action.name}`));
|
|
17
17
|
const roles = manifest.roles.map((role) => role.name);
|
|
18
18
|
const workflows = (manifest.workflows ?? []).map((workflow) => workflow.name);
|
|
19
|
+
// Which of each workflow's connections are owned: a workflow listing one runs once per user.
|
|
20
|
+
const owned = new Set((manifest.connections ?? [])
|
|
21
|
+
.filter((connection) => connection.owner === "user")
|
|
22
|
+
.map((connection) => connection.key));
|
|
23
|
+
const workflowConnections = (manifest.workflows ?? [])
|
|
24
|
+
.filter((workflow) => workflow.connections.length > 0)
|
|
25
|
+
.map((workflow) => `${workflow.name}: ${workflow.connections
|
|
26
|
+
.map((key) => (owned.has(key) ? `${key} (owned)` : key))
|
|
27
|
+
.join(", ")}`);
|
|
19
28
|
const tools = (manifest.toolsets ?? []).flatMap((toolset) => toolset.tools.map((tool) => `${toolset.name}_${tool.name} (${tool.access})`));
|
|
20
29
|
return [
|
|
21
30
|
`Entities: ${listed(entities.length, entities)}`,
|
|
@@ -32,6 +41,9 @@ export function catalogSummary(manifest) {
|
|
|
32
41
|
`builders: ${manifest.feedback.builders.join(", ") || "none"}`,
|
|
33
42
|
]),
|
|
34
43
|
...(workflows.length > 0 ? [`Workflows: ${listed(workflows.length, workflows)}`] : []),
|
|
44
|
+
...(workflowConnections.length > 0
|
|
45
|
+
? [`Workflow connections: ${workflowConnections.join("; ")}`]
|
|
46
|
+
: []),
|
|
35
47
|
...(tools.length > 0 ? [`Toolset tools: ${listed(tools.length, tools)}`] : []),
|
|
36
48
|
`Manifest hash: ${manifest.hash}`,
|
|
37
49
|
"",
|
package/dist/bin/migrate.js
CHANGED
|
@@ -95,7 +95,7 @@ function migrateDatabase(input) {
|
|
|
95
95
|
const sql = yield* SqlClient.SqlClient;
|
|
96
96
|
const current = yield* readCatalog({ sql });
|
|
97
97
|
const retained = yield* readRetainedStorage({ sql });
|
|
98
|
-
const existingTables = yield* readRuntimeTables({ sql });
|
|
98
|
+
const existingTables = yield* readRuntimeTables({ sql, target });
|
|
99
99
|
const existingHistoryActivityIndexes = yield* readHistoryActivityIndexes({ sql });
|
|
100
100
|
const existingStorage = yield* readStorageNames({ sql });
|
|
101
101
|
const plan = planMigration({
|
package/dist/connection.d.ts
CHANGED
|
@@ -24,18 +24,35 @@ export declare const MAXIMUM_CONNECTION_RESPONSE_BYTES: number;
|
|
|
24
24
|
* - `refused`: the provider refused the request in a way retrying will not fix;
|
|
25
25
|
* - `timeout`: the call exceeded its deadline;
|
|
26
26
|
* - `invalid_request`: the proxy refused the request itself, such as a forbidden header or path;
|
|
27
|
-
* - `invalid_response`: the response did not match the schema given to `json
|
|
27
|
+
* - `invalid_response`: the response did not match the schema given to `json`;
|
|
28
|
+
* - `owner_required`: the connection is owned (`owner: "user"`) and the code runs as nobody whose
|
|
29
|
+
* credential it may use, such as a workflow run with no owner, a service or a guest, or a key the
|
|
30
|
+
* run's workflow does not list;
|
|
31
|
+
* - `background_consent_required`: the owner has not allowed their credential to be used while
|
|
32
|
+
* nobody is asking for the work.
|
|
28
33
|
*/
|
|
29
|
-
export declare const CONNECTION_ERROR_REASONS: readonly ["authorization_required", "not_deployed", "not_granted", "unavailable", "refused", "timeout", "invalid_request", "invalid_response"];
|
|
34
|
+
export declare const CONNECTION_ERROR_REASONS: readonly ["authorization_required", "not_deployed", "not_granted", "unavailable", "refused", "timeout", "invalid_request", "invalid_response", "owner_required", "background_consent_required"];
|
|
30
35
|
export type ConnectionErrorReason = (typeof CONNECTION_ERROR_REASONS)[number];
|
|
36
|
+
/**
|
|
37
|
+
* The app page where each user connects their own connections. The platform sends every consent
|
|
38
|
+
* back to it, and the app SDK's `CONNECTIONS_PATH` names the same path.
|
|
39
|
+
*/
|
|
40
|
+
export declare const OWNED_CONNECTIONS_PAGE = "/account/connections";
|
|
41
|
+
/** Where the user connects an owned connection they have not connected: an app path. */
|
|
42
|
+
export declare function ownedConnectionLink(key: string): string;
|
|
31
43
|
declare const ConnectionError_base: Schema.Class<ConnectionError, Schema.TaggedStruct<"ConnectionError", {
|
|
32
44
|
/** The connection key. */
|
|
33
45
|
readonly connection: Schema.String;
|
|
34
|
-
readonly reason: Schema.Literals<readonly ["authorization_required", "not_deployed", "not_granted", "unavailable", "refused", "timeout", "invalid_request", "invalid_response"]>;
|
|
46
|
+
readonly reason: Schema.Literals<readonly ["authorization_required", "not_deployed", "not_granted", "unavailable", "refused", "timeout", "invalid_request", "invalid_response", "owner_required", "background_consent_required"]>;
|
|
35
47
|
readonly message: Schema.String;
|
|
36
48
|
readonly retryable: Schema.Boolean;
|
|
37
49
|
/** The request id SegmentStream answered with, for correlating its logs. */
|
|
38
50
|
readonly requestId: Schema.optionalKey<Schema.String>;
|
|
51
|
+
/**
|
|
52
|
+
* For `authorization_required` on an owned connection: the app path where the acting user
|
|
53
|
+
* connects it, `/account/connections?connection=<key>`.
|
|
54
|
+
*/
|
|
55
|
+
readonly connect: Schema.optionalKey<Schema.String>;
|
|
39
56
|
/** Original internal failure, retained for operator diagnostics only. */
|
|
40
57
|
readonly cause: Schema.optionalKey<Schema.Unknown>;
|
|
41
58
|
}>, import("effect/Cause").YieldableError>;
|
|
@@ -45,6 +62,44 @@ declare const ConnectionError_base: Schema.Class<ConnectionError, Schema.TaggedS
|
|
|
45
62
|
*/
|
|
46
63
|
export declare class ConnectionError extends ConnectionError_base {
|
|
47
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* `interactive` when a person asked for the work, such as an action they called; `background` when
|
|
67
|
+
* nobody did.
|
|
68
|
+
*/
|
|
69
|
+
export type ConnectionCallKind = "interactive" | "background";
|
|
70
|
+
/**
|
|
71
|
+
* Whose credential an owned connection's call uses: the id of the acting `user`, and the call's
|
|
72
|
+
* kind. The runtime decides it from where the code runs; code never names it, so it is no field
|
|
73
|
+
* of {@link ConnectionCall} and the package does not export it.
|
|
74
|
+
*/
|
|
75
|
+
export interface ConnectionOwner {
|
|
76
|
+
/** The owner's `user` id. */
|
|
77
|
+
readonly id: string;
|
|
78
|
+
readonly call: ConnectionCallKind;
|
|
79
|
+
}
|
|
80
|
+
/** The call, as the transport receives it, with whose credential it uses. Internal. */
|
|
81
|
+
export declare function withCallOwner<T extends object>(call: T, owner: ConnectionOwner | undefined): T;
|
|
82
|
+
/** Whose credential a call the runtime sent uses: `undefined` for a shared handle's. Internal. */
|
|
83
|
+
export declare function callOwner(call: object): ConnectionOwner | undefined;
|
|
84
|
+
/** Whose credential the owned calls through a `Connections.test` transport use. Internal. */
|
|
85
|
+
export declare function testTransportOwner(transport: object | undefined): ConnectionOwner | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* The owner of a workflow run whose step an action runs in, and the owned keys the run's workflow
|
|
88
|
+
* lists: the only keys whose calls may use the owner's credentials (docs/private-connections-spec.md,
|
|
89
|
+
* "Which users get a run").
|
|
90
|
+
*/
|
|
91
|
+
export interface RunConnectionOwner {
|
|
92
|
+
readonly owner: ConnectionOwner;
|
|
93
|
+
readonly listed: ReadonlySet<string>;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Binds a step's run owner to the transport made for one action the step runs, or for the step's
|
|
97
|
+
* own calls. Internal. It binds a copy, so that a factory that hands out one transport for every
|
|
98
|
+
* request never carries the owner to another request.
|
|
99
|
+
*/
|
|
100
|
+
export declare function withRunOwner(transport: ConnectionTransport["Service"], owner: RunConnectionOwner | undefined): ConnectionTransport["Service"];
|
|
101
|
+
/** The run owner bound to a transport, `undefined` outside an owned run's step. Internal. */
|
|
102
|
+
export declare function runTransportOwner(transport: object | undefined): RunConnectionOwner | undefined;
|
|
48
103
|
/** One HTTP request through the connection proxy, before it is bound to a connection key. */
|
|
49
104
|
export interface ConnectionCall {
|
|
50
105
|
/** One of the connection's declared APIs; when omitted, its `default_api`, or its only API. */
|
|
@@ -158,6 +213,11 @@ export interface ConnectionHandle<Key extends string = string> {
|
|
|
158
213
|
readonly description: string;
|
|
159
214
|
/** Whether the ontology sends data out through this connection, such as conversions or messages. */
|
|
160
215
|
readonly delivers: boolean;
|
|
216
|
+
/**
|
|
217
|
+
* `"user"` when each user connects their own account (`owner="user"` in
|
|
218
|
+
* `connections/connections.py`): a call uses the acting user's credential.
|
|
219
|
+
*/
|
|
220
|
+
readonly owner?: "user";
|
|
161
221
|
/** The context key of this connection's client. */
|
|
162
222
|
readonly service: Context.Service<Connection<Key>, ConnectionClient>;
|
|
163
223
|
request(request: ConnectionRequest): Call<Key>;
|
|
@@ -181,6 +241,14 @@ export interface ConnectionOptions {
|
|
|
181
241
|
* email. The manifest marks it so Cloud can list it as a destination. Default false.
|
|
182
242
|
*/
|
|
183
243
|
readonly delivers?: boolean;
|
|
244
|
+
/**
|
|
245
|
+
* `"user"`: the connection is owned, as `connections/connections.py` declares it with
|
|
246
|
+
* `owner="user"`. Each user connects their own account, and a call uses the credential of the
|
|
247
|
+
* user the code runs as: in an action, the person who called it; in a workflow that lists it, the
|
|
248
|
+
* user the run belongs to. A call made as nobody whose credential may be used, such as from a
|
|
249
|
+
* workflow run with no owner, fails with `owner_required`.
|
|
250
|
+
*/
|
|
251
|
+
readonly owner?: "user";
|
|
184
252
|
}
|
|
185
253
|
/** The call a request describes: query appended, body encoded and its content type set. */
|
|
186
254
|
export declare function connectionCall(key: string, request: ConnectionRequest): ConnectionCall;
|
|
@@ -199,10 +267,18 @@ export declare function bufferedStream(reply: ConnectionReply): ConnectionStream
|
|
|
199
267
|
* connections can be called; the transport is never exposed to the action. `files` is the
|
|
200
268
|
* action's file access, which signs the read of a request's `file` after checking the principal
|
|
201
269
|
* may read the record; without it, the call reaches the transport with its `file` unresolved.
|
|
270
|
+
* `owner` is whose credential an owned handle's calls use; without it they fail with
|
|
271
|
+
* `owner_required`, and a shared handle's calls never carry it.
|
|
202
272
|
*/
|
|
203
273
|
export declare function connectionContext<const C extends ReadonlyArray<AnyConnectionHandle>>(handles: C, transport: ConnectionTransport["Service"], options?: {
|
|
204
274
|
readonly readOnly?: boolean;
|
|
205
275
|
readonly files?: Files["Service"];
|
|
276
|
+
readonly owner?: ConnectionOwner | undefined;
|
|
277
|
+
/**
|
|
278
|
+
* The owned keys `owner` may be used for, when only some may: those a workflow run's workflow
|
|
279
|
+
* lists. An owned handle outside it calls as nobody, and fails with `owner_required`.
|
|
280
|
+
*/
|
|
281
|
+
readonly listed?: ReadonlySet<string> | undefined;
|
|
206
282
|
}): Context.Context<ConnectionsOf<C>>;
|
|
207
283
|
/** A stubbed response for {@link Connections.test}. */
|
|
208
284
|
export interface StubResponse {
|
|
@@ -219,12 +295,39 @@ export interface StubRequest extends ConnectionCall {
|
|
|
219
295
|
/** The request body as UTF-8 text. */
|
|
220
296
|
readonly text: string;
|
|
221
297
|
}
|
|
222
|
-
|
|
298
|
+
/**
|
|
299
|
+
* Whose credential a call to an owned connection uses, as a stub receives it: `undefined` for a
|
|
300
|
+
* shared connection's call.
|
|
301
|
+
*/
|
|
302
|
+
export interface StubSelection {
|
|
303
|
+
/** The owner's `user` id. */
|
|
304
|
+
readonly owner: string;
|
|
305
|
+
readonly call: ConnectionCallKind;
|
|
306
|
+
}
|
|
307
|
+
export type ConnectionStub = (request: StubRequest, selection?: StubSelection) => Effect.Effect<StubResponse | ConnectionReply, ConnectionError>;
|
|
308
|
+
/** Options of {@link Connections.test}. */
|
|
309
|
+
export interface TestConnectionsOptions {
|
|
310
|
+
/**
|
|
311
|
+
* The `user` id whose credential the owned connections' calls this transport answers use,
|
|
312
|
+
* whoever runs the action or the workflow step. Without it, an owned call runs for the user the
|
|
313
|
+
* action's verified caller or the step's run owner selects, and fails with `owner_required` when
|
|
314
|
+
* there is none, as in a direct `runAction`. It applies only to calls this transport answers: an
|
|
315
|
+
* action run with another transport ignores it, and it never makes a run act as that user.
|
|
316
|
+
*/
|
|
317
|
+
readonly owner?: string;
|
|
318
|
+
/**
|
|
319
|
+
* The kind of the owned calls `owner` makes: `interactive` by default, as when a person asked for
|
|
320
|
+
* the work; `background` as in a run a cron started. Only the stubs see it.
|
|
321
|
+
*/
|
|
322
|
+
readonly call?: ConnectionCallKind;
|
|
323
|
+
}
|
|
223
324
|
export declare const Connections: {
|
|
224
325
|
/**
|
|
225
326
|
* A transport that answers with stubs by connection key, for runtime tests of actions that
|
|
226
|
-
* declare connections. A call to a connection without a stub fails the test.
|
|
327
|
+
* declare connections. A call to a connection without a stub fails the test. A stub of an owned
|
|
328
|
+
* connection receives the owner and the call kind as its second argument; `owner` names whose
|
|
329
|
+
* they are.
|
|
227
330
|
*/
|
|
228
|
-
test: (stubs: Readonly<Record<string, ConnectionStub
|
|
331
|
+
test: (stubs: Readonly<Record<string, ConnectionStub>>, options?: TestConnectionsOptions) => Layer.Layer<ConnectionTransport>;
|
|
229
332
|
};
|
|
230
333
|
export {};
|
package/dist/connection.js
CHANGED
|
@@ -30,7 +30,12 @@ export const MAXIMUM_CONNECTION_RESPONSE_BYTES = 64 * 1024 * 1024;
|
|
|
30
30
|
* - `refused`: the provider refused the request in a way retrying will not fix;
|
|
31
31
|
* - `timeout`: the call exceeded its deadline;
|
|
32
32
|
* - `invalid_request`: the proxy refused the request itself, such as a forbidden header or path;
|
|
33
|
-
* - `invalid_response`: the response did not match the schema given to `json
|
|
33
|
+
* - `invalid_response`: the response did not match the schema given to `json`;
|
|
34
|
+
* - `owner_required`: the connection is owned (`owner: "user"`) and the code runs as nobody whose
|
|
35
|
+
* credential it may use, such as a workflow run with no owner, a service or a guest, or a key the
|
|
36
|
+
* run's workflow does not list;
|
|
37
|
+
* - `background_consent_required`: the owner has not allowed their credential to be used while
|
|
38
|
+
* nobody is asking for the work.
|
|
34
39
|
*/
|
|
35
40
|
export const CONNECTION_ERROR_REASONS = [
|
|
36
41
|
"authorization_required",
|
|
@@ -41,7 +46,18 @@ export const CONNECTION_ERROR_REASONS = [
|
|
|
41
46
|
"timeout",
|
|
42
47
|
"invalid_request",
|
|
43
48
|
"invalid_response",
|
|
49
|
+
"owner_required",
|
|
50
|
+
"background_consent_required",
|
|
44
51
|
];
|
|
52
|
+
/**
|
|
53
|
+
* The app page where each user connects their own connections. The platform sends every consent
|
|
54
|
+
* back to it, and the app SDK's `CONNECTIONS_PATH` names the same path.
|
|
55
|
+
*/
|
|
56
|
+
export const OWNED_CONNECTIONS_PAGE = "/account/connections";
|
|
57
|
+
/** Where the user connects an owned connection they have not connected: an app path. */
|
|
58
|
+
export function ownedConnectionLink(key) {
|
|
59
|
+
return `${OWNED_CONNECTIONS_PAGE}?${new URLSearchParams({ connection: key }).toString()}`;
|
|
60
|
+
}
|
|
45
61
|
/**
|
|
46
62
|
* A connection call failed. A provider's non-2xx status is a response, not this error. `prepare` may
|
|
47
63
|
* catch it; if it escapes, the action responds with the matching status and writes nothing.
|
|
@@ -54,10 +70,76 @@ export class ConnectionError extends Schema.TaggedError()("ConnectionError", {
|
|
|
54
70
|
retryable: Schema.Boolean,
|
|
55
71
|
/** The request id SegmentStream answered with, for correlating its logs. */
|
|
56
72
|
requestId: Schema.optionalKey(Schema.String),
|
|
73
|
+
/**
|
|
74
|
+
* For `authorization_required` on an owned connection: the app path where the acting user
|
|
75
|
+
* connects it, `/account/connections?connection=<key>`.
|
|
76
|
+
*/
|
|
77
|
+
connect: Schema.optionalKey(Schema.String),
|
|
57
78
|
/** Original internal failure, retained for operator diagnostics only. */
|
|
58
79
|
cause: Schema.optionalKey(Schema.Unknown),
|
|
59
80
|
}) {
|
|
60
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* The owner of each call the runtime sends for an owned handle, kept beside the call rather than
|
|
84
|
+
* in it, so that no call a builder constructs can name one (docs/private-connections-spec.md,
|
|
85
|
+
* decision 8).
|
|
86
|
+
*/
|
|
87
|
+
const CALL_OWNERS = new WeakMap();
|
|
88
|
+
/** The call, as the transport receives it, with whose credential it uses. Internal. */
|
|
89
|
+
export function withCallOwner(call, owner) {
|
|
90
|
+
if (owner !== undefined) {
|
|
91
|
+
CALL_OWNERS.set(call, owner);
|
|
92
|
+
}
|
|
93
|
+
return call;
|
|
94
|
+
}
|
|
95
|
+
/** Whose credential a call the runtime sent uses: `undefined` for a shared handle's. Internal. */
|
|
96
|
+
export function callOwner(call) {
|
|
97
|
+
return CALL_OWNERS.get(call);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* The owner each `Connections.test` transport made with `{ owner }` runs owned calls for, kept
|
|
101
|
+
* beside that transport, so that no other transport, and nothing a builder constructs, carries one.
|
|
102
|
+
*/
|
|
103
|
+
const TEST_OWNERS = new WeakMap();
|
|
104
|
+
/** Whose credential the owned calls through a `Connections.test` transport use. Internal. */
|
|
105
|
+
export function testTransportOwner(transport) {
|
|
106
|
+
return transport === undefined ? undefined : TEST_OWNERS.get(transport);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The run owner of each transport the ontology service makes for an action a workflow step runs,
|
|
110
|
+
* kept beside that transport. Only the service sets it, from the owner the platform recorded on
|
|
111
|
+
* the run when it started; nothing a step, an action, a hook or a toolset passes can, so a nested
|
|
112
|
+
* call made anywhere else gets no owner.
|
|
113
|
+
*/
|
|
114
|
+
const RUN_OWNERS = new WeakMap();
|
|
115
|
+
/**
|
|
116
|
+
* Binds a step's run owner to the transport made for one action the step runs, or for the step's
|
|
117
|
+
* own calls. Internal. It binds a copy, so that a factory that hands out one transport for every
|
|
118
|
+
* request never carries the owner to another request.
|
|
119
|
+
*/
|
|
120
|
+
export function withRunOwner(transport, owner) {
|
|
121
|
+
if (owner === undefined) {
|
|
122
|
+
return transport;
|
|
123
|
+
}
|
|
124
|
+
const bound = {
|
|
125
|
+
request: (call) => transport.request(call),
|
|
126
|
+
...(transport.stream === undefined
|
|
127
|
+
? {}
|
|
128
|
+
: {
|
|
129
|
+
stream: (call) => transport.stream(call),
|
|
130
|
+
}),
|
|
131
|
+
};
|
|
132
|
+
const tested = TEST_OWNERS.get(transport);
|
|
133
|
+
RUN_OWNERS.set(bound, owner);
|
|
134
|
+
if (tested !== undefined) {
|
|
135
|
+
TEST_OWNERS.set(bound, tested);
|
|
136
|
+
}
|
|
137
|
+
return bound;
|
|
138
|
+
}
|
|
139
|
+
/** The run owner bound to a transport, `undefined` outside an owned run's step. Internal. */
|
|
140
|
+
export function runTransportOwner(transport) {
|
|
141
|
+
return transport === undefined ? undefined : RUN_OWNERS.get(transport);
|
|
142
|
+
}
|
|
61
143
|
/**
|
|
62
144
|
* Sends connection calls: to backend-next from a deployed service, to the local route with a CLI
|
|
63
145
|
* grant in development, or to stubs in tests. The ontology service provides it to actions; tests
|
|
@@ -196,6 +278,7 @@ export function connection(key, options) {
|
|
|
196
278
|
key,
|
|
197
279
|
description: options?.description,
|
|
198
280
|
delivers: options?.delivers === true,
|
|
281
|
+
...(options?.owner === "user" ? { owner: "user" } : {}),
|
|
199
282
|
service,
|
|
200
283
|
request,
|
|
201
284
|
stream: (input) => Effect.gen(function* () {
|
|
@@ -233,10 +316,22 @@ export function bufferedStream(reply) {
|
|
|
233
316
|
* connections can be called; the transport is never exposed to the action. `files` is the
|
|
234
317
|
* action's file access, which signs the read of a request's `file` after checking the principal
|
|
235
318
|
* may read the record; without it, the call reaches the transport with its `file` unresolved.
|
|
319
|
+
* `owner` is whose credential an owned handle's calls use; without it they fail with
|
|
320
|
+
* `owner_required`, and a shared handle's calls never carry it.
|
|
236
321
|
*/
|
|
237
322
|
export function connectionContext(handles, transport, options = {}) {
|
|
238
323
|
let context = Context.empty();
|
|
239
324
|
for (const handle of handles) {
|
|
325
|
+
const owned = handle.owner === "user";
|
|
326
|
+
const owner = options.listed === undefined || options.listed.has(handle.key) ? options.owner : undefined;
|
|
327
|
+
// Whose credential the call uses: the runtime's owner for an owned handle, nobody's for a
|
|
328
|
+
// shared one.
|
|
329
|
+
const select = !owned
|
|
330
|
+
? Effect.succeed(undefined)
|
|
331
|
+
: owner === undefined
|
|
332
|
+
? Effect.fail(connectionFailure(handle.key, "owner_required", "The connection is owned by each user; only code running as a signed-in user, or in " +
|
|
333
|
+
"a workflow run of one that lists it, may call it."))
|
|
334
|
+
: Effect.succeed(owner);
|
|
240
335
|
const resolve = (call) => {
|
|
241
336
|
const sign = options.files?.source;
|
|
242
337
|
if (call.file === undefined || call.source !== undefined || sign === undefined) {
|
|
@@ -271,13 +366,24 @@ export function connectionContext(handles, transport, options = {}) {
|
|
|
271
366
|
return Effect.void;
|
|
272
367
|
}));
|
|
273
368
|
};
|
|
369
|
+
// The acting user has not connected an owned connection: the failure names where they can.
|
|
370
|
+
const linked = (error) => owned && error.reason === "authorization_required" && error.connect === undefined
|
|
371
|
+
? new ConnectionError({
|
|
372
|
+
connection: error.connection,
|
|
373
|
+
reason: error.reason,
|
|
374
|
+
message: error.message,
|
|
375
|
+
retryable: error.retryable,
|
|
376
|
+
...(error.requestId === undefined ? {} : { requestId: error.requestId }),
|
|
377
|
+
...(error.cause === undefined ? {} : { cause: error.cause }),
|
|
378
|
+
connect: ownedConnectionLink(handle.key),
|
|
379
|
+
})
|
|
380
|
+
: error;
|
|
381
|
+
const bound = (call) => select.pipe(Effect.flatMap((owner) => admit(call).pipe(Effect.andThen(resolve(call)), Effect.map((resolved) => withCallOwner({ ...resolved, connection: handle.key }, owner)))));
|
|
274
382
|
context = Context.add(context, handle.service, {
|
|
275
|
-
request: (call) =>
|
|
276
|
-
stream: (call) =>
|
|
277
|
-
? transport.stream(
|
|
278
|
-
: transport
|
|
279
|
-
.request({ ...resolved, connection: handle.key })
|
|
280
|
-
.pipe(Effect.map(bufferedStream)))),
|
|
383
|
+
request: (call) => bound(call).pipe(Effect.flatMap((sent) => transport.request(sent)), Effect.mapError(linked)),
|
|
384
|
+
stream: (call) => bound(call).pipe(Effect.flatMap((sent) => transport.stream
|
|
385
|
+
? transport.stream(sent)
|
|
386
|
+
: transport.request(sent).pipe(Effect.map(bufferedStream))), Effect.mapError(linked)),
|
|
281
387
|
});
|
|
282
388
|
}
|
|
283
389
|
return context;
|
|
@@ -303,15 +409,24 @@ function stubReply(response) {
|
|
|
303
409
|
export const Connections = {
|
|
304
410
|
/**
|
|
305
411
|
* A transport that answers with stubs by connection key, for runtime tests of actions that
|
|
306
|
-
* declare connections. A call to a connection without a stub fails the test.
|
|
412
|
+
* declare connections. A call to a connection without a stub fails the test. A stub of an owned
|
|
413
|
+
* connection receives the owner and the call kind as its second argument; `owner` names whose
|
|
414
|
+
* they are.
|
|
307
415
|
*/
|
|
308
|
-
test: (stubs) =>
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
416
|
+
test: (stubs, options = {}) => {
|
|
417
|
+
const transport = {
|
|
418
|
+
request: (call) => {
|
|
419
|
+
const stub = stubs[call.connection];
|
|
420
|
+
if (stub === undefined) {
|
|
421
|
+
return Effect.die(new Error(`Connections.test has no stub for the connection ${call.connection}.`));
|
|
422
|
+
}
|
|
423
|
+
const owner = callOwner(call);
|
|
424
|
+
return stub({ ...call, text: decoder.decode(call.body) }, owner === undefined ? undefined : { owner: owner.id, call: owner.call }).pipe(Effect.map(stubReply));
|
|
425
|
+
},
|
|
426
|
+
};
|
|
427
|
+
if (options.owner !== undefined) {
|
|
428
|
+
TEST_OWNERS.set(transport, { id: options.owner, call: options.call ?? "interactive" });
|
|
429
|
+
}
|
|
430
|
+
return Layer.succeed(ConnectionTransport, transport);
|
|
431
|
+
},
|
|
317
432
|
};
|
package/dist/diagnostics.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
export declare const DIAGNOSTIC_CODES: readonly ["invalid-source", "missing-column", "invalid-column", "invalid-scope", "invalid-scope-path", "scope-reads-all", "scope-unused", "scope-member-overlap", "source-with-actions", "source-with-index", "invalid-metric", "unknown-metric", "circular-metric", "invalid-join", "missing-join", "invalid-entity", "invalid-property", "invalid-relationship", "invalid-actions", "invalid-action", "invalid-action-input", "invalid-role", "invalid-name", "reserved-name", "duplicate-name", "invalid-entity-id", "duplicate-entity-id", "missing-label", "missing-description", "invalid-title", "invalid-options", "invalid-default", "invalid-constraint", "unknown-relationship-target", "inverse-collision", "invalid-on-delete", "invalid-phrase", "invalid-index", "unknown-reference", "invalid-renamed-from", "earlier-name", "invalid-guide", "invalid-writes", "invalid-erasure", "generated-update-empty", "managed-without-effect", "missing-permissions", "invalid-permission", "unknown-permission", "removed-allow", "unreachable-action", "wildcard-permission", "invalid-sign-in", "invalid-inbox", "invalid-chat", "invalid-connection", "invalid-feedback", "invalid-discovery", "invalid-email", "feedback-unanswerable", "feedback-unreportable", "agent-tools-implicit", "named-secret-deprecated", "unknown-connection", "unused-connection", "invalid-prepare", "invalid-tool-name", "invalid-toolset", "toolset-lock-mismatch", "invalid-alignment", "single-entity-model-metric", "invalid-workflow", "workflow_role_unknown", "workflow_role_is_member", "workflow_role_grants_nothing", "workflow_role_wildcard", "workflow_role_scoped", "workflow_cron_never_fires", "workflow_input_invalid", "workflow_cron_invalid", "workflow_run_missing", "invalid-trigger", "trigger_action_unknown", "trigger_function_async", "trigger_runs_invalid", "workflow_trigger_limit_exceeded", "workflow_webhook_duplicate", "workflow_webhook_input_invalid", "workflow_webhook_mixed_triggers", "workflow_webhook_signature_invalid", "workflow_webhook_verification_invalid", "workflow_webhook_headers_invalid", "workflow_webhook_limit_exceeded"];
|
|
2
|
+
export declare const DIAGNOSTIC_CODES: readonly ["invalid-source", "missing-column", "invalid-column", "invalid-scope", "invalid-scope-path", "scope-reads-all", "scope-unused", "scope-member-overlap", "source-with-actions", "source-with-index", "invalid-metric", "unknown-metric", "circular-metric", "invalid-join", "missing-join", "invalid-entity", "invalid-property", "invalid-relationship", "invalid-actions", "invalid-action", "invalid-action-input", "invalid-role", "invalid-name", "reserved-name", "duplicate-name", "invalid-entity-id", "duplicate-entity-id", "missing-label", "missing-description", "invalid-title", "invalid-options", "invalid-default", "invalid-constraint", "unknown-relationship-target", "inverse-collision", "invalid-on-delete", "invalid-phrase", "invalid-index", "unknown-reference", "invalid-renamed-from", "earlier-name", "invalid-guide", "invalid-writes", "invalid-erasure", "generated-update-empty", "managed-without-effect", "missing-permissions", "invalid-permission", "unknown-permission", "removed-allow", "unreachable-action", "wildcard-permission", "invalid-sign-in", "invalid-inbox", "invalid-chat", "invalid-connection", "invalid-feedback", "invalid-discovery", "invalid-email", "feedback-unanswerable", "feedback-unreportable", "agent-tools-implicit", "named-secret-deprecated", "unknown-connection", "unused-connection", "invalid-prepare", "invalid-tool-name", "invalid-toolset", "toolset-lock-mismatch", "toolset_connection_owned", "invalid-alignment", "single-entity-model-metric", "invalid-workflow", "workflow_role_unknown", "workflow_role_is_member", "workflow_role_grants_nothing", "workflow_role_wildcard", "workflow_role_scoped", "workflow_cron_never_fires", "workflow_input_invalid", "workflow_cron_invalid", "workflow_run_missing", "invalid-trigger", "trigger_action_unknown", "trigger_function_async", "trigger_runs_invalid", "workflow_trigger_limit_exceeded", "workflow_webhook_duplicate", "workflow_webhook_input_invalid", "workflow_webhook_mixed_triggers", "workflow_webhook_signature_invalid", "workflow_webhook_verification_invalid", "workflow_webhook_headers_invalid", "workflow_webhook_limit_exceeded", "workflow_owned_connection_webhook"];
|
|
3
3
|
export type DiagnosticCode = (typeof DIAGNOSTIC_CODES)[number];
|
|
4
4
|
/** A problem `check` found in an ontology definition. */
|
|
5
5
|
export declare const Diagnostic: Schema.Struct<{
|
|
6
6
|
readonly severity: Schema.Literals<readonly ["error", "warning", "info"]>;
|
|
7
|
-
readonly code: Schema.Literals<readonly ["invalid-source", "missing-column", "invalid-column", "invalid-scope", "invalid-scope-path", "scope-reads-all", "scope-unused", "scope-member-overlap", "source-with-actions", "source-with-index", "invalid-metric", "unknown-metric", "circular-metric", "invalid-join", "missing-join", "invalid-entity", "invalid-property", "invalid-relationship", "invalid-actions", "invalid-action", "invalid-action-input", "invalid-role", "invalid-name", "reserved-name", "duplicate-name", "invalid-entity-id", "duplicate-entity-id", "missing-label", "missing-description", "invalid-title", "invalid-options", "invalid-default", "invalid-constraint", "unknown-relationship-target", "inverse-collision", "invalid-on-delete", "invalid-phrase", "invalid-index", "unknown-reference", "invalid-renamed-from", "earlier-name", "invalid-guide", "invalid-writes", "invalid-erasure", "generated-update-empty", "managed-without-effect", "missing-permissions", "invalid-permission", "unknown-permission", "removed-allow", "unreachable-action", "wildcard-permission", "invalid-sign-in", "invalid-inbox", "invalid-chat", "invalid-connection", "invalid-feedback", "invalid-discovery", "invalid-email", "feedback-unanswerable", "feedback-unreportable", "agent-tools-implicit", "named-secret-deprecated", "unknown-connection", "unused-connection", "invalid-prepare", "invalid-tool-name", "invalid-toolset", "toolset-lock-mismatch", "invalid-alignment", "single-entity-model-metric", "invalid-workflow", "workflow_role_unknown", "workflow_role_is_member", "workflow_role_grants_nothing", "workflow_role_wildcard", "workflow_role_scoped", "workflow_cron_never_fires", "workflow_input_invalid", "workflow_cron_invalid", "workflow_run_missing", "invalid-trigger", "trigger_action_unknown", "trigger_function_async", "trigger_runs_invalid", "workflow_trigger_limit_exceeded", "workflow_webhook_duplicate", "workflow_webhook_input_invalid", "workflow_webhook_mixed_triggers", "workflow_webhook_signature_invalid", "workflow_webhook_verification_invalid", "workflow_webhook_headers_invalid", "workflow_webhook_limit_exceeded"]>;
|
|
7
|
+
readonly code: Schema.Literals<readonly ["invalid-source", "missing-column", "invalid-column", "invalid-scope", "invalid-scope-path", "scope-reads-all", "scope-unused", "scope-member-overlap", "source-with-actions", "source-with-index", "invalid-metric", "unknown-metric", "circular-metric", "invalid-join", "missing-join", "invalid-entity", "invalid-property", "invalid-relationship", "invalid-actions", "invalid-action", "invalid-action-input", "invalid-role", "invalid-name", "reserved-name", "duplicate-name", "invalid-entity-id", "duplicate-entity-id", "missing-label", "missing-description", "invalid-title", "invalid-options", "invalid-default", "invalid-constraint", "unknown-relationship-target", "inverse-collision", "invalid-on-delete", "invalid-phrase", "invalid-index", "unknown-reference", "invalid-renamed-from", "earlier-name", "invalid-guide", "invalid-writes", "invalid-erasure", "generated-update-empty", "managed-without-effect", "missing-permissions", "invalid-permission", "unknown-permission", "removed-allow", "unreachable-action", "wildcard-permission", "invalid-sign-in", "invalid-inbox", "invalid-chat", "invalid-connection", "invalid-feedback", "invalid-discovery", "invalid-email", "feedback-unanswerable", "feedback-unreportable", "agent-tools-implicit", "named-secret-deprecated", "unknown-connection", "unused-connection", "invalid-prepare", "invalid-tool-name", "invalid-toolset", "toolset-lock-mismatch", "toolset_connection_owned", "invalid-alignment", "single-entity-model-metric", "invalid-workflow", "workflow_role_unknown", "workflow_role_is_member", "workflow_role_grants_nothing", "workflow_role_wildcard", "workflow_role_scoped", "workflow_cron_never_fires", "workflow_input_invalid", "workflow_cron_invalid", "workflow_run_missing", "invalid-trigger", "trigger_action_unknown", "trigger_function_async", "trigger_runs_invalid", "workflow_trigger_limit_exceeded", "workflow_webhook_duplicate", "workflow_webhook_input_invalid", "workflow_webhook_mixed_triggers", "workflow_webhook_signature_invalid", "workflow_webhook_verification_invalid", "workflow_webhook_headers_invalid", "workflow_webhook_limit_exceeded", "workflow_owned_connection_webhook"]>;
|
|
8
8
|
/** Where the problem is, for example `lead.properties.status.options[1]`. */
|
|
9
9
|
readonly path: Schema.String;
|
|
10
10
|
readonly message: Schema.String;
|
|
@@ -14,7 +14,7 @@ declare const InvalidOntology_base: Schema.Class<InvalidOntology, Schema.TaggedS
|
|
|
14
14
|
readonly message: Schema.String;
|
|
15
15
|
readonly diagnostics: Schema.$Array<Schema.Struct<{
|
|
16
16
|
readonly severity: Schema.Literals<readonly ["error", "warning", "info"]>;
|
|
17
|
-
readonly code: Schema.Literals<readonly ["invalid-source", "missing-column", "invalid-column", "invalid-scope", "invalid-scope-path", "scope-reads-all", "scope-unused", "scope-member-overlap", "source-with-actions", "source-with-index", "invalid-metric", "unknown-metric", "circular-metric", "invalid-join", "missing-join", "invalid-entity", "invalid-property", "invalid-relationship", "invalid-actions", "invalid-action", "invalid-action-input", "invalid-role", "invalid-name", "reserved-name", "duplicate-name", "invalid-entity-id", "duplicate-entity-id", "missing-label", "missing-description", "invalid-title", "invalid-options", "invalid-default", "invalid-constraint", "unknown-relationship-target", "inverse-collision", "invalid-on-delete", "invalid-phrase", "invalid-index", "unknown-reference", "invalid-renamed-from", "earlier-name", "invalid-guide", "invalid-writes", "invalid-erasure", "generated-update-empty", "managed-without-effect", "missing-permissions", "invalid-permission", "unknown-permission", "removed-allow", "unreachable-action", "wildcard-permission", "invalid-sign-in", "invalid-inbox", "invalid-chat", "invalid-connection", "invalid-feedback", "invalid-discovery", "invalid-email", "feedback-unanswerable", "feedback-unreportable", "agent-tools-implicit", "named-secret-deprecated", "unknown-connection", "unused-connection", "invalid-prepare", "invalid-tool-name", "invalid-toolset", "toolset-lock-mismatch", "invalid-alignment", "single-entity-model-metric", "invalid-workflow", "workflow_role_unknown", "workflow_role_is_member", "workflow_role_grants_nothing", "workflow_role_wildcard", "workflow_role_scoped", "workflow_cron_never_fires", "workflow_input_invalid", "workflow_cron_invalid", "workflow_run_missing", "invalid-trigger", "trigger_action_unknown", "trigger_function_async", "trigger_runs_invalid", "workflow_trigger_limit_exceeded", "workflow_webhook_duplicate", "workflow_webhook_input_invalid", "workflow_webhook_mixed_triggers", "workflow_webhook_signature_invalid", "workflow_webhook_verification_invalid", "workflow_webhook_headers_invalid", "workflow_webhook_limit_exceeded"]>;
|
|
17
|
+
readonly code: Schema.Literals<readonly ["invalid-source", "missing-column", "invalid-column", "invalid-scope", "invalid-scope-path", "scope-reads-all", "scope-unused", "scope-member-overlap", "source-with-actions", "source-with-index", "invalid-metric", "unknown-metric", "circular-metric", "invalid-join", "missing-join", "invalid-entity", "invalid-property", "invalid-relationship", "invalid-actions", "invalid-action", "invalid-action-input", "invalid-role", "invalid-name", "reserved-name", "duplicate-name", "invalid-entity-id", "duplicate-entity-id", "missing-label", "missing-description", "invalid-title", "invalid-options", "invalid-default", "invalid-constraint", "unknown-relationship-target", "inverse-collision", "invalid-on-delete", "invalid-phrase", "invalid-index", "unknown-reference", "invalid-renamed-from", "earlier-name", "invalid-guide", "invalid-writes", "invalid-erasure", "generated-update-empty", "managed-without-effect", "missing-permissions", "invalid-permission", "unknown-permission", "removed-allow", "unreachable-action", "wildcard-permission", "invalid-sign-in", "invalid-inbox", "invalid-chat", "invalid-connection", "invalid-feedback", "invalid-discovery", "invalid-email", "feedback-unanswerable", "feedback-unreportable", "agent-tools-implicit", "named-secret-deprecated", "unknown-connection", "unused-connection", "invalid-prepare", "invalid-tool-name", "invalid-toolset", "toolset-lock-mismatch", "toolset_connection_owned", "invalid-alignment", "single-entity-model-metric", "invalid-workflow", "workflow_role_unknown", "workflow_role_is_member", "workflow_role_grants_nothing", "workflow_role_wildcard", "workflow_role_scoped", "workflow_cron_never_fires", "workflow_input_invalid", "workflow_cron_invalid", "workflow_run_missing", "invalid-trigger", "trigger_action_unknown", "trigger_function_async", "trigger_runs_invalid", "workflow_trigger_limit_exceeded", "workflow_webhook_duplicate", "workflow_webhook_input_invalid", "workflow_webhook_mixed_triggers", "workflow_webhook_signature_invalid", "workflow_webhook_verification_invalid", "workflow_webhook_headers_invalid", "workflow_webhook_limit_exceeded", "workflow_owned_connection_webhook"]>;
|
|
18
18
|
/** Where the problem is, for example `lead.properties.status.options[1]`. */
|
|
19
19
|
readonly path: Schema.String;
|
|
20
20
|
readonly message: Schema.String;
|