@m6d/cortex 0.11.0 → 0.12.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/README.md +2 -1
- package/dist/index.d.ts +214 -26
- package/dist/index.js +25 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -116,7 +116,8 @@ Throw `new CortexError(kind, detail)` from a tool, a variable resolver, `verify`
|
|
|
116
116
|
import { createTriggerClient } from "@m6d/cortex";
|
|
117
117
|
|
|
118
118
|
const triggers = createTriggerClient({
|
|
119
|
-
url: "https://engine.cortex.example.com", // ENGINE_PUBLIC_URL
|
|
119
|
+
url: "https://engine.cortex.example.com", // the engine's public origin, ENGINE_PUBLIC_URL
|
|
120
|
+
org: "acme", // the slug of the agent's org
|
|
120
121
|
agent: "reviewer",
|
|
121
122
|
secrets: { "pr-opened": process.env.PR_TRIGGER_SECRET! },
|
|
122
123
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -1474,6 +1474,8 @@ export type FireAnswer = z.infer<typeof fireAnswerSchema>;
|
|
|
1474
1474
|
export type TriggerClientConfig = {
|
|
1475
1475
|
/** The engine's public origin (`ENGINE_PUBLIC_URL`) as the caller reaches it. */
|
|
1476
1476
|
url: string;
|
|
1477
|
+
/** The slug of the org the agent belongs to. */
|
|
1478
|
+
org: string;
|
|
1477
1479
|
/** The agent whose triggers are fired. */
|
|
1478
1480
|
agent: string;
|
|
1479
1481
|
/** The value of the fire credential shared by the caller's triggers. */
|
|
@@ -5661,6 +5663,120 @@ export type ManagementProcedures = {
|
|
|
5661
5663
|
updatedAt: string;
|
|
5662
5664
|
};
|
|
5663
5665
|
};
|
|
5666
|
+
/** Create an org with its Administrator role and assistant, and invite its owner as Administrator; returns the org and the invitation, whose link path is shown only once and expires in 7 days. */
|
|
5667
|
+
"orgs.create": {
|
|
5668
|
+
input: {
|
|
5669
|
+
/** The org's address in engine URLs (`/orgs/<slug>/...`): lowercase letters, digits and single hyphens, unique, and never changed. */
|
|
5670
|
+
slug: string;
|
|
5671
|
+
name: string;
|
|
5672
|
+
ownerEmail: string;
|
|
5673
|
+
};
|
|
5674
|
+
output: {
|
|
5675
|
+
id: string;
|
|
5676
|
+
slug: string;
|
|
5677
|
+
name: string;
|
|
5678
|
+
suspendedAt: string | null;
|
|
5679
|
+
purgeAt: string | null;
|
|
5680
|
+
createdAt: string;
|
|
5681
|
+
updatedAt: string;
|
|
5682
|
+
invitation: {
|
|
5683
|
+
id: string;
|
|
5684
|
+
email: string;
|
|
5685
|
+
expiresAt: string;
|
|
5686
|
+
invitePath: string;
|
|
5687
|
+
};
|
|
5688
|
+
};
|
|
5689
|
+
};
|
|
5690
|
+
/** Delete an org: it is suspended at once and purged with all its data and files after 30 days, unless restored first. */
|
|
5691
|
+
"orgs.delete": {
|
|
5692
|
+
input: {
|
|
5693
|
+
id: string;
|
|
5694
|
+
};
|
|
5695
|
+
output: {
|
|
5696
|
+
id: string;
|
|
5697
|
+
slug: string;
|
|
5698
|
+
name: string;
|
|
5699
|
+
suspendedAt: string | null;
|
|
5700
|
+
purgeAt: string | null;
|
|
5701
|
+
createdAt: string;
|
|
5702
|
+
updatedAt: string;
|
|
5703
|
+
};
|
|
5704
|
+
};
|
|
5705
|
+
/** Invite an email into an org as its Administrator, so an org left without one gets it back; returns the invitation link's path, shown only once, which expires in 7 days. */
|
|
5706
|
+
"orgs.inviteOwner": {
|
|
5707
|
+
input: {
|
|
5708
|
+
id: string;
|
|
5709
|
+
ownerEmail: string;
|
|
5710
|
+
};
|
|
5711
|
+
output: {
|
|
5712
|
+
id: string;
|
|
5713
|
+
email: string;
|
|
5714
|
+
expiresAt: string;
|
|
5715
|
+
invitePath: string;
|
|
5716
|
+
};
|
|
5717
|
+
};
|
|
5718
|
+
/** List the deployment's orgs with pagination and search by name or slug, suspended and deleted ones included. */
|
|
5719
|
+
"orgs.list": {
|
|
5720
|
+
input: {
|
|
5721
|
+
pageIndex?: number;
|
|
5722
|
+
pageSize?: number;
|
|
5723
|
+
q?: string;
|
|
5724
|
+
};
|
|
5725
|
+
output: {
|
|
5726
|
+
items: Array<{
|
|
5727
|
+
id: string;
|
|
5728
|
+
slug: string;
|
|
5729
|
+
name: string;
|
|
5730
|
+
suspendedAt: string | null;
|
|
5731
|
+
purgeAt: string | null;
|
|
5732
|
+
createdAt: string;
|
|
5733
|
+
updatedAt: string;
|
|
5734
|
+
}>;
|
|
5735
|
+
/** Every row the caller may see, ignoring the search and filters. */
|
|
5736
|
+
count: number;
|
|
5737
|
+
/** The rows matching the search and filters, over all pages: the total to report. */
|
|
5738
|
+
filteredCount: number;
|
|
5739
|
+
};
|
|
5740
|
+
};
|
|
5741
|
+
/** Each org's id, slug and name, suspended and deleted ones included, for selectors. */
|
|
5742
|
+
"orgs.options": {
|
|
5743
|
+
input: undefined;
|
|
5744
|
+
output: Array<{
|
|
5745
|
+
id: string;
|
|
5746
|
+
slug: string;
|
|
5747
|
+
name: string;
|
|
5748
|
+
}>;
|
|
5749
|
+
};
|
|
5750
|
+
/** Restore a suspended or deleted org before its purge, as it was, its assistant brought up to this release. */
|
|
5751
|
+
"orgs.restore": {
|
|
5752
|
+
input: {
|
|
5753
|
+
id: string;
|
|
5754
|
+
};
|
|
5755
|
+
output: {
|
|
5756
|
+
id: string;
|
|
5757
|
+
slug: string;
|
|
5758
|
+
name: string;
|
|
5759
|
+
suspendedAt: string | null;
|
|
5760
|
+
purgeAt: string | null;
|
|
5761
|
+
createdAt: string;
|
|
5762
|
+
updatedAt: string;
|
|
5763
|
+
};
|
|
5764
|
+
};
|
|
5765
|
+
/** Suspend an org: its engine routes, sessions and credentials are refused until it is restored. */
|
|
5766
|
+
"orgs.suspend": {
|
|
5767
|
+
input: {
|
|
5768
|
+
id: string;
|
|
5769
|
+
};
|
|
5770
|
+
output: {
|
|
5771
|
+
id: string;
|
|
5772
|
+
slug: string;
|
|
5773
|
+
name: string;
|
|
5774
|
+
suspendedAt: string | null;
|
|
5775
|
+
purgeAt: string | null;
|
|
5776
|
+
createdAt: string;
|
|
5777
|
+
updatedAt: string;
|
|
5778
|
+
};
|
|
5779
|
+
};
|
|
5664
5780
|
/** Components of every kind shared with this agent alone: what deleting it leaves shared with nobody, unless `agents.delete` names them in `deleteComponentIds`. */
|
|
5665
5781
|
"publishing.exclusive": {
|
|
5666
5782
|
input: {
|
|
@@ -5715,13 +5831,13 @@ export type ManagementProcedures = {
|
|
|
5715
5831
|
input: {
|
|
5716
5832
|
name: string;
|
|
5717
5833
|
description: string;
|
|
5718
|
-
permissions: Array<"agents:read" | "agents:write" | "tools:read" | "tools:write" | "tools:execute" | "services:read" | "services:write" | "skills:read" | "skills:write" | "triggers:read" | "triggers:write" | "triggers:fire" | "datasets:read" | "datasets:write" | "datasets:test" | "webhooks:read" | "webhooks:write" | "mcp-servers:read" | "mcp-servers:write" | "knowledge:read" | "knowledge:write" | "secrets:read" | "secrets:write" | "credentials:read" | "credentials:write" | "model-providers:read" | "model-providers:write" | "management-keys:use" | "servers:read" | "servers:write" | "threads:read" | "playground:use" | "publishing:read" | "manifests:apply" | "audit:read" | "observability:read" | "settings:manage" | "users:manage" | "roles:manage">;
|
|
5834
|
+
permissions: Array<"agents:read" | "agents:write" | "tools:read" | "tools:write" | "tools:execute" | "services:read" | "services:write" | "skills:read" | "skills:write" | "triggers:read" | "triggers:write" | "triggers:fire" | "datasets:read" | "datasets:write" | "datasets:test" | "webhooks:read" | "webhooks:write" | "mcp-servers:read" | "mcp-servers:write" | "knowledge:read" | "knowledge:write" | "secrets:read" | "secrets:write" | "credentials:read" | "credentials:write" | "model-providers:read" | "model-providers:write" | "management-keys:use" | "servers:read" | "servers:write" | "threads:read" | "playground:use" | "publishing:read" | "manifests:apply" | "audit:read" | "observability:read" | "settings:manage" | "users:manage" | "roles:manage" | "orgs:manage">;
|
|
5719
5835
|
};
|
|
5720
5836
|
output: {
|
|
5721
5837
|
id: string;
|
|
5722
5838
|
name: string;
|
|
5723
5839
|
description: string;
|
|
5724
|
-
permissions: Array<"agents:read" | "agents:write" | "tools:read" | "tools:write" | "tools:execute" | "services:read" | "services:write" | "skills:read" | "skills:write" | "triggers:read" | "triggers:write" | "triggers:fire" | "datasets:read" | "datasets:write" | "datasets:test" | "webhooks:read" | "webhooks:write" | "mcp-servers:read" | "mcp-servers:write" | "knowledge:read" | "knowledge:write" | "secrets:read" | "secrets:write" | "credentials:read" | "credentials:write" | "model-providers:read" | "model-providers:write" | "management-keys:use" | "servers:read" | "servers:write" | "threads:read" | "playground:use" | "publishing:read" | "manifests:apply" | "audit:read" | "observability:read" | "settings:manage" | "users:manage" | "roles:manage">;
|
|
5840
|
+
permissions: Array<"agents:read" | "agents:write" | "tools:read" | "tools:write" | "tools:execute" | "services:read" | "services:write" | "skills:read" | "skills:write" | "triggers:read" | "triggers:write" | "triggers:fire" | "datasets:read" | "datasets:write" | "datasets:test" | "webhooks:read" | "webhooks:write" | "mcp-servers:read" | "mcp-servers:write" | "knowledge:read" | "knowledge:write" | "secrets:read" | "secrets:write" | "credentials:read" | "credentials:write" | "model-providers:read" | "model-providers:write" | "management-keys:use" | "servers:read" | "servers:write" | "threads:read" | "playground:use" | "publishing:read" | "manifests:apply" | "audit:read" | "observability:read" | "settings:manage" | "users:manage" | "roles:manage" | "orgs:manage">;
|
|
5725
5841
|
};
|
|
5726
5842
|
};
|
|
5727
5843
|
/** Delete a role; the built-in Administrator role cannot be deleted. */
|
|
@@ -5743,7 +5859,7 @@ export type ManagementProcedures = {
|
|
|
5743
5859
|
id: string;
|
|
5744
5860
|
name: string;
|
|
5745
5861
|
description: string;
|
|
5746
|
-
permissions: Array<"agents:read" | "agents:write" | "tools:read" | "tools:write" | "tools:execute" | "services:read" | "services:write" | "skills:read" | "skills:write" | "triggers:read" | "triggers:write" | "triggers:fire" | "datasets:read" | "datasets:write" | "datasets:test" | "webhooks:read" | "webhooks:write" | "mcp-servers:read" | "mcp-servers:write" | "knowledge:read" | "knowledge:write" | "secrets:read" | "secrets:write" | "credentials:read" | "credentials:write" | "model-providers:read" | "model-providers:write" | "management-keys:use" | "servers:read" | "servers:write" | "threads:read" | "playground:use" | "publishing:read" | "manifests:apply" | "audit:read" | "observability:read" | "settings:manage" | "users:manage" | "roles:manage">;
|
|
5862
|
+
permissions: Array<"agents:read" | "agents:write" | "tools:read" | "tools:write" | "tools:execute" | "services:read" | "services:write" | "skills:read" | "skills:write" | "triggers:read" | "triggers:write" | "triggers:fire" | "datasets:read" | "datasets:write" | "datasets:test" | "webhooks:read" | "webhooks:write" | "mcp-servers:read" | "mcp-servers:write" | "knowledge:read" | "knowledge:write" | "secrets:read" | "secrets:write" | "credentials:read" | "credentials:write" | "model-providers:read" | "model-providers:write" | "management-keys:use" | "servers:read" | "servers:write" | "threads:read" | "playground:use" | "publishing:read" | "manifests:apply" | "audit:read" | "observability:read" | "settings:manage" | "users:manage" | "roles:manage" | "orgs:manage">;
|
|
5747
5863
|
builtInId: string | null;
|
|
5748
5864
|
createdAt: string;
|
|
5749
5865
|
assignedUsers: number;
|
|
@@ -5759,14 +5875,14 @@ export type ManagementProcedures = {
|
|
|
5759
5875
|
input: {
|
|
5760
5876
|
name: string;
|
|
5761
5877
|
description: string;
|
|
5762
|
-
permissions: Array<"agents:read" | "agents:write" | "tools:read" | "tools:write" | "tools:execute" | "services:read" | "services:write" | "skills:read" | "skills:write" | "triggers:read" | "triggers:write" | "triggers:fire" | "datasets:read" | "datasets:write" | "datasets:test" | "webhooks:read" | "webhooks:write" | "mcp-servers:read" | "mcp-servers:write" | "knowledge:read" | "knowledge:write" | "secrets:read" | "secrets:write" | "credentials:read" | "credentials:write" | "model-providers:read" | "model-providers:write" | "management-keys:use" | "servers:read" | "servers:write" | "threads:read" | "playground:use" | "publishing:read" | "manifests:apply" | "audit:read" | "observability:read" | "settings:manage" | "users:manage" | "roles:manage">;
|
|
5878
|
+
permissions: Array<"agents:read" | "agents:write" | "tools:read" | "tools:write" | "tools:execute" | "services:read" | "services:write" | "skills:read" | "skills:write" | "triggers:read" | "triggers:write" | "triggers:fire" | "datasets:read" | "datasets:write" | "datasets:test" | "webhooks:read" | "webhooks:write" | "mcp-servers:read" | "mcp-servers:write" | "knowledge:read" | "knowledge:write" | "secrets:read" | "secrets:write" | "credentials:read" | "credentials:write" | "model-providers:read" | "model-providers:write" | "management-keys:use" | "servers:read" | "servers:write" | "threads:read" | "playground:use" | "publishing:read" | "manifests:apply" | "audit:read" | "observability:read" | "settings:manage" | "users:manage" | "roles:manage" | "orgs:manage">;
|
|
5763
5879
|
id: string;
|
|
5764
5880
|
};
|
|
5765
5881
|
output: {
|
|
5766
5882
|
id: string;
|
|
5767
5883
|
name: string;
|
|
5768
5884
|
description: string;
|
|
5769
|
-
permissions: Array<"agents:read" | "agents:write" | "tools:read" | "tools:write" | "tools:execute" | "services:read" | "services:write" | "skills:read" | "skills:write" | "triggers:read" | "triggers:write" | "triggers:fire" | "datasets:read" | "datasets:write" | "datasets:test" | "webhooks:read" | "webhooks:write" | "mcp-servers:read" | "mcp-servers:write" | "knowledge:read" | "knowledge:write" | "secrets:read" | "secrets:write" | "credentials:read" | "credentials:write" | "model-providers:read" | "model-providers:write" | "management-keys:use" | "servers:read" | "servers:write" | "threads:read" | "playground:use" | "publishing:read" | "manifests:apply" | "audit:read" | "observability:read" | "settings:manage" | "users:manage" | "roles:manage">;
|
|
5885
|
+
permissions: Array<"agents:read" | "agents:write" | "tools:read" | "tools:write" | "tools:execute" | "services:read" | "services:write" | "skills:read" | "skills:write" | "triggers:read" | "triggers:write" | "triggers:fire" | "datasets:read" | "datasets:write" | "datasets:test" | "webhooks:read" | "webhooks:write" | "mcp-servers:read" | "mcp-servers:write" | "knowledge:read" | "knowledge:write" | "secrets:read" | "secrets:write" | "credentials:read" | "credentials:write" | "model-providers:read" | "model-providers:write" | "management-keys:use" | "servers:read" | "servers:write" | "threads:read" | "playground:use" | "publishing:read" | "manifests:apply" | "audit:read" | "observability:read" | "settings:manage" | "users:manage" | "roles:manage" | "orgs:manage">;
|
|
5770
5886
|
};
|
|
5771
5887
|
};
|
|
5772
5888
|
/** Delete a secret; fails while a credential or an agent's auth (its signing secret or reCAPTCHA API key) still references it. */
|
|
@@ -5911,7 +6027,6 @@ export type ManagementProcedures = {
|
|
|
5911
6027
|
syncError: "egress_blocked" | "timeout" | "upstream_failed" | "response_too_large" | "upstream_status" | "invalid_manifest" | "key_unavailable" | "name_taken" | "credential_in_name" | "variable_in_use" | "verify_in_use" | "still_referenced" | "unexpected" | null;
|
|
5912
6028
|
syncAttempt: number;
|
|
5913
6029
|
syncSettledAttempt: number;
|
|
5914
|
-
system: boolean;
|
|
5915
6030
|
signInChecksPerMinute: number;
|
|
5916
6031
|
triggerChecksPerMinute: number;
|
|
5917
6032
|
modelProvider: string | null;
|
|
@@ -5958,7 +6073,6 @@ export type ManagementProcedures = {
|
|
|
5958
6073
|
syncError: "egress_blocked" | "timeout" | "upstream_failed" | "response_too_large" | "upstream_status" | "invalid_manifest" | "key_unavailable" | "name_taken" | "credential_in_name" | "variable_in_use" | "verify_in_use" | "still_referenced" | "unexpected" | null;
|
|
5959
6074
|
syncAttempt: number;
|
|
5960
6075
|
syncSettledAttempt: number;
|
|
5961
|
-
system: boolean;
|
|
5962
6076
|
signInChecksPerMinute: number;
|
|
5963
6077
|
triggerChecksPerMinute: number;
|
|
5964
6078
|
modelProvider: string | null;
|
|
@@ -5980,7 +6094,6 @@ export type ManagementProcedures = {
|
|
|
5980
6094
|
description: string | null;
|
|
5981
6095
|
url: string | null;
|
|
5982
6096
|
keySecretName: string | null;
|
|
5983
|
-
system: boolean;
|
|
5984
6097
|
syncedAt: string | null;
|
|
5985
6098
|
syncError: "egress_blocked" | "timeout" | "upstream_failed" | "response_too_large" | "upstream_status" | "invalid_manifest" | "key_unavailable" | "name_taken" | "credential_in_name" | "variable_in_use" | "verify_in_use" | "still_referenced" | "unexpected" | null;
|
|
5986
6099
|
createdAt: string;
|
|
@@ -6022,7 +6135,6 @@ export type ManagementProcedures = {
|
|
|
6022
6135
|
description: string | null;
|
|
6023
6136
|
url: string | null;
|
|
6024
6137
|
keySecretName: string | null;
|
|
6025
|
-
system: boolean;
|
|
6026
6138
|
syncedAt: string | null;
|
|
6027
6139
|
syncError: "egress_blocked" | "timeout" | "upstream_failed" | "response_too_large" | "upstream_status" | "invalid_manifest" | "key_unavailable" | "name_taken" | "credential_in_name" | "variable_in_use" | "verify_in_use" | "still_referenced" | "unexpected" | null;
|
|
6028
6140
|
createdAt: string;
|
|
@@ -6034,11 +6146,9 @@ export type ManagementProcedures = {
|
|
|
6034
6146
|
filteredCount: number;
|
|
6035
6147
|
};
|
|
6036
6148
|
};
|
|
6037
|
-
/** Each server's id, name and display name, for selectors.
|
|
6149
|
+
/** Each server's id, name and display name, for selectors. */
|
|
6038
6150
|
"servers.options": {
|
|
6039
|
-
input:
|
|
6040
|
-
includeSystem?: boolean;
|
|
6041
|
-
};
|
|
6151
|
+
input: undefined;
|
|
6042
6152
|
output: Array<{
|
|
6043
6153
|
id: string;
|
|
6044
6154
|
name: string;
|
|
@@ -6100,7 +6210,6 @@ export type ManagementProcedures = {
|
|
|
6100
6210
|
syncError: "egress_blocked" | "timeout" | "upstream_failed" | "response_too_large" | "upstream_status" | "invalid_manifest" | "key_unavailable" | "name_taken" | "credential_in_name" | "variable_in_use" | "verify_in_use" | "still_referenced" | "unexpected" | null;
|
|
6101
6211
|
syncAttempt: number;
|
|
6102
6212
|
syncSettledAttempt: number;
|
|
6103
|
-
system: boolean;
|
|
6104
6213
|
signInChecksPerMinute: number;
|
|
6105
6214
|
triggerChecksPerMinute: number;
|
|
6106
6215
|
modelProvider: string | null;
|
|
@@ -6331,23 +6440,27 @@ export type ManagementProcedures = {
|
|
|
6331
6440
|
name: string;
|
|
6332
6441
|
};
|
|
6333
6442
|
};
|
|
6334
|
-
/**
|
|
6443
|
+
/** The org's settings: log and thread retention, and the browser origins its engine routes admit. */
|
|
6335
6444
|
"settings.get": {
|
|
6336
6445
|
input: undefined;
|
|
6337
6446
|
output: {
|
|
6338
6447
|
logRetentionDays: number;
|
|
6339
6448
|
threadRetentionDays: number | null;
|
|
6449
|
+
corsOrigins: Array<string>;
|
|
6340
6450
|
};
|
|
6341
6451
|
};
|
|
6342
|
-
/** Change retention
|
|
6452
|
+
/** Change the org's settings: retention, and the browser origins its engine routes admit. */
|
|
6343
6453
|
"settings.update": {
|
|
6344
6454
|
input: {
|
|
6345
6455
|
logRetentionDays: number;
|
|
6346
6456
|
threadRetentionDays?: number;
|
|
6457
|
+
/** Browser origins, beside the console's own, that may call the org's engine routes, such as a site embedding its widget. */
|
|
6458
|
+
corsOrigins: Array<string>;
|
|
6347
6459
|
};
|
|
6348
6460
|
output: {
|
|
6349
6461
|
logRetentionDays: number;
|
|
6350
6462
|
threadRetentionDays: number | null;
|
|
6463
|
+
corsOrigins: Array<string>;
|
|
6351
6464
|
};
|
|
6352
6465
|
};
|
|
6353
6466
|
/** How many published skills an agent has. */
|
|
@@ -7726,8 +7839,8 @@ export type ManagementProcedures = {
|
|
|
7726
7839
|
id: string;
|
|
7727
7840
|
name: string;
|
|
7728
7841
|
displayName: Partial<Record<"en" | "ar", string>>;
|
|
7842
|
+
fireUrl: string | null;
|
|
7729
7843
|
}>;
|
|
7730
|
-
engineUrl: string | null;
|
|
7731
7844
|
variables: Array<{
|
|
7732
7845
|
name: string;
|
|
7733
7846
|
description: string;
|
|
@@ -7934,21 +8047,48 @@ export type ManagementProcedures = {
|
|
|
7934
8047
|
name: string;
|
|
7935
8048
|
};
|
|
7936
8049
|
};
|
|
7937
|
-
/**
|
|
7938
|
-
"users.
|
|
8050
|
+
/** List every account on the deployment with pagination, search by name or email, the orgs each is a member of, and optionally only one org's members. */
|
|
8051
|
+
"users.accounts": {
|
|
8052
|
+
input: {
|
|
8053
|
+
pageIndex?: number;
|
|
8054
|
+
pageSize?: number;
|
|
8055
|
+
q?: string;
|
|
8056
|
+
orgId?: string;
|
|
8057
|
+
};
|
|
8058
|
+
output: {
|
|
8059
|
+
items: Array<{
|
|
8060
|
+
id: string;
|
|
8061
|
+
name: string;
|
|
8062
|
+
email: string;
|
|
8063
|
+
banned: boolean;
|
|
8064
|
+
mustChangePassword: boolean;
|
|
8065
|
+
createdAt: string;
|
|
8066
|
+
orgs: Array<{
|
|
8067
|
+
id: string;
|
|
8068
|
+
name: string;
|
|
8069
|
+
}>;
|
|
8070
|
+
manageable: boolean;
|
|
8071
|
+
}>;
|
|
8072
|
+
/** Every row the caller may see, ignoring the search and filters. */
|
|
8073
|
+
count: number;
|
|
8074
|
+
/** The rows matching the search and filters, over all pages: the total to report. */
|
|
8075
|
+
filteredCount: number;
|
|
8076
|
+
};
|
|
8077
|
+
};
|
|
8078
|
+
/** Invite an email into the org with roles; returns the accept link's path, shown only once, which expires in 7 days. */
|
|
8079
|
+
"users.invite": {
|
|
7939
8080
|
input: {
|
|
7940
|
-
name: string;
|
|
7941
8081
|
email: string;
|
|
7942
|
-
tempPassword: string;
|
|
7943
8082
|
roleIds: Array<string>;
|
|
7944
8083
|
};
|
|
7945
8084
|
output: {
|
|
7946
8085
|
id: string;
|
|
7947
|
-
name: string;
|
|
7948
8086
|
email: string;
|
|
8087
|
+
expiresAt: string;
|
|
8088
|
+
invitePath: string;
|
|
7949
8089
|
};
|
|
7950
8090
|
};
|
|
7951
|
-
/** List
|
|
8091
|
+
/** List the org's members with pagination, search, their roles, and whether each is active in the org. */
|
|
7952
8092
|
"users.list": {
|
|
7953
8093
|
input: {
|
|
7954
8094
|
pageIndex?: number;
|
|
@@ -7962,6 +8102,32 @@ export type ManagementProcedures = {
|
|
|
7962
8102
|
email: string;
|
|
7963
8103
|
banned: boolean;
|
|
7964
8104
|
mustChangePassword: boolean;
|
|
8105
|
+
joinedAt: string;
|
|
8106
|
+
deactivatedAt: string | null;
|
|
8107
|
+
roles: Array<{
|
|
8108
|
+
id: string;
|
|
8109
|
+
name: string;
|
|
8110
|
+
builtInId: string | null;
|
|
8111
|
+
}>;
|
|
8112
|
+
}>;
|
|
8113
|
+
/** Every row the caller may see, ignoring the search and filters. */
|
|
8114
|
+
count: number;
|
|
8115
|
+
/** The rows matching the search and filters, over all pages: the total to report. */
|
|
8116
|
+
filteredCount: number;
|
|
8117
|
+
};
|
|
8118
|
+
};
|
|
8119
|
+
/** List the org's invitations not yet accepted, with the roles each grants. */
|
|
8120
|
+
"users.listInvitations": {
|
|
8121
|
+
input: {
|
|
8122
|
+
pageIndex?: number;
|
|
8123
|
+
pageSize?: number;
|
|
8124
|
+
q?: string;
|
|
8125
|
+
};
|
|
8126
|
+
output: {
|
|
8127
|
+
items: Array<{
|
|
8128
|
+
id: string;
|
|
8129
|
+
email: string;
|
|
8130
|
+
expiresAt: string;
|
|
7965
8131
|
createdAt: string;
|
|
7966
8132
|
roles: Array<{
|
|
7967
8133
|
id: string;
|
|
@@ -7975,6 +8141,20 @@ export type ManagementProcedures = {
|
|
|
7975
8141
|
filteredCount: number;
|
|
7976
8142
|
};
|
|
7977
8143
|
};
|
|
8144
|
+
/** Remove a member from the org with their roles and management keys there; the account stays. */
|
|
8145
|
+
"users.remove": {
|
|
8146
|
+
input: {
|
|
8147
|
+
userId: string;
|
|
8148
|
+
};
|
|
8149
|
+
output: null;
|
|
8150
|
+
};
|
|
8151
|
+
/** Revoke a pending invitation; its link stops working. */
|
|
8152
|
+
"users.revokeInvitation": {
|
|
8153
|
+
input: {
|
|
8154
|
+
id: string;
|
|
8155
|
+
};
|
|
8156
|
+
output: null;
|
|
8157
|
+
};
|
|
7978
8158
|
/** Role id and name pairs for assignment. */
|
|
7979
8159
|
"users.roleOptions": {
|
|
7980
8160
|
input: undefined;
|
|
@@ -7984,7 +8164,15 @@ export type ManagementProcedures = {
|
|
|
7984
8164
|
builtInId: string | null;
|
|
7985
8165
|
}>;
|
|
7986
8166
|
};
|
|
7987
|
-
/** Deactivate or reactivate
|
|
8167
|
+
/** Deactivate or reactivate an account in every org; deactivation also ends its sessions and revokes its management keys. */
|
|
8168
|
+
"users.setAccountActive": {
|
|
8169
|
+
input: {
|
|
8170
|
+
userId: string;
|
|
8171
|
+
active: boolean;
|
|
8172
|
+
};
|
|
8173
|
+
output: null;
|
|
8174
|
+
};
|
|
8175
|
+
/** Deactivate or reactivate a member in the org; deactivation also revokes their management keys there. */
|
|
7988
8176
|
"users.setActive": {
|
|
7989
8177
|
input: {
|
|
7990
8178
|
userId: string;
|
|
@@ -7992,7 +8180,7 @@ export type ManagementProcedures = {
|
|
|
7992
8180
|
};
|
|
7993
8181
|
output: null;
|
|
7994
8182
|
};
|
|
7995
|
-
/** Replace
|
|
8183
|
+
/** Replace a member's roles in the org. */
|
|
7996
8184
|
"users.setRoles": {
|
|
7997
8185
|
input: {
|
|
7998
8186
|
userId: string;
|
|
@@ -8000,7 +8188,7 @@ export type ManagementProcedures = {
|
|
|
8000
8188
|
};
|
|
8001
8189
|
output: null;
|
|
8002
8190
|
};
|
|
8003
|
-
/** Set a temporary password the user must change on next login; this also
|
|
8191
|
+
/** Set a temporary password the user must change on next login; this also ends their sessions and revokes their management keys in every org. */
|
|
8004
8192
|
"users.setTempPassword": {
|
|
8005
8193
|
input: {
|
|
8006
8194
|
userId: string;
|
package/dist/index.js
CHANGED
|
@@ -13485,14 +13485,17 @@ var runAnswerSchema = z.object({
|
|
|
13485
13485
|
// ../../internal/contracts/src/triggers/index.ts
|
|
13486
13486
|
import { z as z2 } from "zod";
|
|
13487
13487
|
var TRIGGER_ANSWER_TOOL_NAME = "submitAnswer";
|
|
13488
|
-
function
|
|
13489
|
-
return `/
|
|
13488
|
+
function orgRoute(orgSlug) {
|
|
13489
|
+
return `/orgs/${encodeURIComponent(orgSlug)}`;
|
|
13490
13490
|
}
|
|
13491
|
-
function
|
|
13492
|
-
return `${
|
|
13491
|
+
function agentRoute(orgSlug, agentName) {
|
|
13492
|
+
return `${orgRoute(orgSlug)}/agents/${encodeURIComponent(agentName)}`;
|
|
13493
13493
|
}
|
|
13494
|
-
function
|
|
13495
|
-
return `${agentRoute(agentName)}/
|
|
13494
|
+
function triggerRoute(orgSlug, agentName, name) {
|
|
13495
|
+
return `${agentRoute(orgSlug, agentName)}/triggers/${encodeURIComponent(name)}`;
|
|
13496
|
+
}
|
|
13497
|
+
function runRoute(orgSlug, agentName, runId) {
|
|
13498
|
+
return `${agentRoute(orgSlug, agentName)}/runs/${encodeURIComponent(runId)}`;
|
|
13496
13499
|
}
|
|
13497
13500
|
var fireStartedSchema = z2.object({
|
|
13498
13501
|
inputId: z2.uuid(),
|
|
@@ -13958,7 +13961,7 @@ function createTriggerClient(config) {
|
|
|
13958
13961
|
return secret;
|
|
13959
13962
|
}
|
|
13960
13963
|
function runPath(runId) {
|
|
13961
|
-
return runRoute(config.agent, runId);
|
|
13964
|
+
return runRoute(config.org, config.agent, runId);
|
|
13962
13965
|
}
|
|
13963
13966
|
async function send(trigger, path, init, parse, acceptedErrors = []) {
|
|
13964
13967
|
const headers = new Headers(init.headers);
|
|
@@ -13992,7 +13995,7 @@ function createTriggerClient(config) {
|
|
|
13992
13995
|
}
|
|
13993
13996
|
return {
|
|
13994
13997
|
async fire(trigger, payload, options = {}) {
|
|
13995
|
-
return await post(trigger, triggerRoute(config.agent, trigger), payload, options);
|
|
13998
|
+
return await post(trigger, triggerRoute(config.org, config.agent, trigger), payload, options);
|
|
13996
13999
|
},
|
|
13997
14000
|
async answer(trigger, runId, decision, options = {}) {
|
|
13998
14001
|
return await post(trigger, `${runPath(runId)}/answer`, runAnswerSchema.parse(decision), options);
|
|
@@ -14010,7 +14013,7 @@ function createTriggerClient(config) {
|
|
|
14010
14013
|
if (options.before !== undefined)
|
|
14011
14014
|
query.set("before", options.before);
|
|
14012
14015
|
const suffix = query.size ? `?${query.toString()}` : "";
|
|
14013
|
-
return await send(trigger, `${triggerRoute(config.agent, trigger)}/runs${suffix}`, { method: "GET", signal: options.signal }, (answer) => runListSchema.parse(answer));
|
|
14016
|
+
return await send(trigger, `${triggerRoute(config.org, config.agent, trigger)}/runs${suffix}`, { method: "GET", signal: options.signal }, (answer) => runListSchema.parse(answer));
|
|
14014
14017
|
},
|
|
14015
14018
|
async cancel(trigger, runId, options = {}) {
|
|
14016
14019
|
return await send(trigger, `${runPath(runId)}/cancel`, { method: "POST", signal: options.signal }, (answer) => runCancelSchema.parse(answer));
|
|
@@ -14106,6 +14109,13 @@ var managementProcedureKinds = {
|
|
|
14106
14109
|
"observability.unhealthyToolIds": "query",
|
|
14107
14110
|
"observability.unusedSkillIds": "query",
|
|
14108
14111
|
"observability.updateSchemaDrift": "mutation",
|
|
14112
|
+
"orgs.create": "mutation",
|
|
14113
|
+
"orgs.delete": "mutation",
|
|
14114
|
+
"orgs.inviteOwner": "mutation",
|
|
14115
|
+
"orgs.list": "query",
|
|
14116
|
+
"orgs.options": "query",
|
|
14117
|
+
"orgs.restore": "mutation",
|
|
14118
|
+
"orgs.suspend": "mutation",
|
|
14109
14119
|
"publishing.exclusive": "query",
|
|
14110
14120
|
"publishing.history": "query",
|
|
14111
14121
|
"publishing.latest": "query",
|
|
@@ -14180,9 +14190,14 @@ var managementProcedureKinds = {
|
|
|
14180
14190
|
"triggers.setAudience": "mutation",
|
|
14181
14191
|
"triggers.toggle": "mutation",
|
|
14182
14192
|
"triggers.update": "mutation",
|
|
14183
|
-
"users.
|
|
14193
|
+
"users.accounts": "query",
|
|
14194
|
+
"users.invite": "mutation",
|
|
14184
14195
|
"users.list": "query",
|
|
14196
|
+
"users.listInvitations": "query",
|
|
14197
|
+
"users.remove": "mutation",
|
|
14198
|
+
"users.revokeInvitation": "mutation",
|
|
14185
14199
|
"users.roleOptions": "query",
|
|
14200
|
+
"users.setAccountActive": "mutation",
|
|
14186
14201
|
"users.setActive": "mutation",
|
|
14187
14202
|
"users.setRoles": "mutation",
|
|
14188
14203
|
"users.setTempPassword": "mutation",
|
package/package.json
CHANGED