@m6d/cortex-cli 0.25.1 → 0.26.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/package.json +1 -1
- package/src/commands/management.ts +5 -4
- package/src/contracts/management/procedures.generated.ts +92 -34
- package/src/contracts/manifest/index.ts +12 -0
- package/src/contracts/runs/index.ts +6 -6
- package/src/contracts/server/index.ts +1 -1
- package/src/contracts/triggers/index.ts +25 -14
- package/src/contracts/wire/index.ts +3 -3
- package/src/scaffold/files.ts +2 -2
package/package.json
CHANGED
|
@@ -116,7 +116,7 @@ async function login(given: string | undefined, name: string) {
|
|
|
116
116
|
report.fail({
|
|
117
117
|
what: "Cortex rejected that key",
|
|
118
118
|
blocks: [
|
|
119
|
-
"Mint one on your
|
|
119
|
+
"Mint one under Developer settings on your console Account page, or set BOOTSTRAP_MANAGEMENT_KEY on a headless deployment.",
|
|
120
120
|
],
|
|
121
121
|
});
|
|
122
122
|
}
|
|
@@ -129,14 +129,15 @@ async function login(given: string | undefined, name: string) {
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
/**
|
|
132
|
-
* The key Cortex recognized the bearer as,
|
|
133
|
-
* authenticate. A Cortex that cannot be reached, or answers with
|
|
132
|
+
* The key Cortex recognized the bearer as, with the environment it acts in,
|
|
133
|
+
* or null when it does not authenticate. A Cortex that cannot be reached, or answers with
|
|
134
134
|
* anything but 200/401, is the run's outcome, not a CLI bug.
|
|
135
135
|
*/
|
|
136
136
|
async function whoami(profile: { url: string; key: string }) {
|
|
137
137
|
try {
|
|
138
138
|
const me = await managementClient(profile).managementKeys.mine();
|
|
139
|
-
|
|
139
|
+
const { org, project, environment } = me.environment;
|
|
140
|
+
return `key "${me.name}" (${me.fingerprint}) in ${org}/${project}/${environment}`;
|
|
140
141
|
} catch (error) {
|
|
141
142
|
if (error instanceof ManagementClientError && error.status === 401) return null;
|
|
142
143
|
if (error instanceof ManagementClientError) {
|
|
@@ -478,7 +478,6 @@ export const managementProcedureKinds = {
|
|
|
478
478
|
"documents.prepareUpload": "mutation",
|
|
479
479
|
"documents.remove": "mutation",
|
|
480
480
|
"documents.retry": "mutation",
|
|
481
|
-
"managementKeys.list": "query",
|
|
482
481
|
"managementKeys.mine": "query",
|
|
483
482
|
"manifests.preview": "mutation",
|
|
484
483
|
"manifests.sync": "mutation",
|
|
@@ -518,11 +517,15 @@ export const managementProcedureKinds = {
|
|
|
518
517
|
"observability.updateSchemaDrift": "mutation",
|
|
519
518
|
"orgs.create": "mutation",
|
|
520
519
|
"orgs.delete": "mutation",
|
|
520
|
+
"orgs.deleteEnvironment": "mutation",
|
|
521
|
+
"orgs.deleteProject": "mutation",
|
|
521
522
|
"orgs.inviteOwner": "mutation",
|
|
522
523
|
"orgs.list": "query",
|
|
523
524
|
"orgs.options": "query",
|
|
525
|
+
"orgs.rename": "mutation",
|
|
524
526
|
"orgs.restore": "mutation",
|
|
525
527
|
"orgs.suspend": "mutation",
|
|
528
|
+
"orgs.updateProject": "mutation",
|
|
526
529
|
"publishing.exclusive": "query",
|
|
527
530
|
"publishing.history": "query",
|
|
528
531
|
"publishing.latest": "query",
|
|
@@ -663,6 +666,9 @@ export type ManagementProcedures = {
|
|
|
663
666
|
locationPicker: boolean;
|
|
664
667
|
messages: boolean;
|
|
665
668
|
whileBusy: "refuse" | "queue" | "steer";
|
|
669
|
+
a2a: boolean;
|
|
670
|
+
a2aPushHostnames: string | number | boolean | null | Record<string, unknown> | Array<unknown>;
|
|
671
|
+
description: string;
|
|
666
672
|
media: Array<"mermaid" | "vega-lite" | "map" | "report">;
|
|
667
673
|
suggestions: Record<"en" | "ar", Array<{
|
|
668
674
|
title: string;
|
|
@@ -711,6 +717,9 @@ export type ManagementProcedures = {
|
|
|
711
717
|
locationPicker: boolean;
|
|
712
718
|
messages: boolean;
|
|
713
719
|
whileBusy: "refuse" | "queue" | "steer";
|
|
720
|
+
a2a: boolean;
|
|
721
|
+
a2aPushHostnames: string | number | boolean | null | Record<string, unknown> | Array<unknown>;
|
|
722
|
+
description: string;
|
|
714
723
|
media: Array<"mermaid" | "vega-lite" | "map" | "report">;
|
|
715
724
|
suggestions: Record<"en" | "ar", Array<{
|
|
716
725
|
title: string;
|
|
@@ -771,6 +780,9 @@ export type ManagementProcedures = {
|
|
|
771
780
|
locationPicker: boolean;
|
|
772
781
|
messages: boolean;
|
|
773
782
|
whileBusy: "refuse" | "queue" | "steer";
|
|
783
|
+
a2a: boolean;
|
|
784
|
+
a2aPushHostnames: string | number | boolean | null | Record<string, unknown> | Array<unknown>;
|
|
785
|
+
description: string;
|
|
774
786
|
media: Array<"mermaid" | "vega-lite" | "map" | "report">;
|
|
775
787
|
suggestions: Record<"en" | "ar", Array<{
|
|
776
788
|
title: string;
|
|
@@ -940,6 +952,9 @@ export type ManagementProcedures = {
|
|
|
940
952
|
locationPicker: boolean;
|
|
941
953
|
messages: boolean;
|
|
942
954
|
whileBusy: "refuse" | "queue" | "steer";
|
|
955
|
+
a2a: boolean;
|
|
956
|
+
a2aPushHostnames: string | number | boolean | null | Record<string, unknown> | Array<unknown>;
|
|
957
|
+
description: string;
|
|
943
958
|
media: Array<"mermaid" | "vega-lite" | "map" | "report">;
|
|
944
959
|
suggestions: Record<"en" | "ar", Array<{
|
|
945
960
|
title: string;
|
|
@@ -976,6 +991,9 @@ export type ManagementProcedures = {
|
|
|
976
991
|
media?: Array<"mermaid" | "vega-lite" | "map" | "report">;
|
|
977
992
|
messages?: boolean;
|
|
978
993
|
whileBusy?: "refuse" | "queue" | "steer";
|
|
994
|
+
a2a?: boolean;
|
|
995
|
+
a2aPushHostnames?: Array<string>;
|
|
996
|
+
description?: string;
|
|
979
997
|
defaultLocale?: "en" | "ar";
|
|
980
998
|
context?: {
|
|
981
999
|
maxContextTokens: number;
|
|
@@ -1056,6 +1074,9 @@ export type ManagementProcedures = {
|
|
|
1056
1074
|
locationPicker: boolean;
|
|
1057
1075
|
messages: boolean;
|
|
1058
1076
|
whileBusy: "refuse" | "queue" | "steer";
|
|
1077
|
+
a2a: boolean;
|
|
1078
|
+
a2aPushHostnames: string | number | boolean | null | Record<string, unknown> | Array<unknown>;
|
|
1079
|
+
description: string;
|
|
1059
1080
|
media: Array<"mermaid" | "vega-lite" | "map" | "report">;
|
|
1060
1081
|
suggestions: Record<"en" | "ar", Array<{
|
|
1061
1082
|
title: string;
|
|
@@ -1104,6 +1125,9 @@ export type ManagementProcedures = {
|
|
|
1104
1125
|
locationPicker: boolean;
|
|
1105
1126
|
messages: boolean;
|
|
1106
1127
|
whileBusy: "refuse" | "queue" | "steer";
|
|
1128
|
+
a2a: boolean;
|
|
1129
|
+
a2aPushHostnames: string | number | boolean | null | Record<string, unknown> | Array<unknown>;
|
|
1130
|
+
description: string;
|
|
1107
1131
|
media: Array<"mermaid" | "vega-lite" | "map" | "report">;
|
|
1108
1132
|
suggestions: Record<"en" | "ar", Array<{
|
|
1109
1133
|
title: string;
|
|
@@ -1981,31 +2005,7 @@ export type ManagementProcedures = {
|
|
|
1981
2005
|
updatedAt: string;
|
|
1982
2006
|
};
|
|
1983
2007
|
};
|
|
1984
|
-
/** The
|
|
1985
|
-
"managementKeys.list": {
|
|
1986
|
-
input: {
|
|
1987
|
-
pageIndex?: number;
|
|
1988
|
-
pageSize?: number;
|
|
1989
|
-
q?: string;
|
|
1990
|
-
};
|
|
1991
|
-
output: {
|
|
1992
|
-
items: Array<{
|
|
1993
|
-
id: string;
|
|
1994
|
-
name: string;
|
|
1995
|
-
displayName: Partial<Record<"en" | "ar", string>>;
|
|
1996
|
-
fingerprint: string;
|
|
1997
|
-
permissions: Array<string> | null;
|
|
1998
|
-
lastUsedAt: string | null;
|
|
1999
|
-
revokedAt: string | null;
|
|
2000
|
-
createdAt: string;
|
|
2001
|
-
}>;
|
|
2002
|
-
/** Every row the caller may see, ignoring the search and filters. */
|
|
2003
|
-
count: number;
|
|
2004
|
-
/** The rows matching the search and filters, over all pages: the total to report. */
|
|
2005
|
-
filteredCount: number;
|
|
2006
|
-
};
|
|
2007
|
-
};
|
|
2008
|
-
/** The management key this request authenticated with (name, display name, fingerprint, scope, dates). Refused for a session or an operator token, which are not keys. */
|
|
2008
|
+
/** The management key this request authenticated with (name, display name, fingerprint, scope, dates) and the environment it acts in, by org slug, project and environment name. Refused for a session or an operator token, which are not keys. */
|
|
2009
2009
|
"managementKeys.mine": {
|
|
2010
2010
|
input: undefined;
|
|
2011
2011
|
output: {
|
|
@@ -2017,6 +2017,11 @@ export type ManagementProcedures = {
|
|
|
2017
2017
|
lastUsedAt: string | null;
|
|
2018
2018
|
revokedAt: string | null;
|
|
2019
2019
|
createdAt: string;
|
|
2020
|
+
environment: {
|
|
2021
|
+
org: string;
|
|
2022
|
+
project: string;
|
|
2023
|
+
environment: string;
|
|
2024
|
+
};
|
|
2020
2025
|
};
|
|
2021
2026
|
};
|
|
2022
2027
|
/** What manifests.sync would create, update and delete, kind by kind, after the same checks, dataset host reads, OpenAPI document reads and knowledge document reads, changing nothing: it mints no trigger secret, stores no document and enqueues no job. `conflicts` lists each field that both the manifest and a live write changed since the last apply and that neither `resolutions` nor `prefer` answers; each keeps the manifest's value in what the preview judges. A field holding named parts (an agent's settings, greeting and suggestions, a collection's documents) conflicts part by part, its `key` naming the part. */
|
|
@@ -2077,6 +2082,9 @@ export type ManagementProcedures = {
|
|
|
2077
2082
|
media?: Array<"mermaid" | "vega-lite" | "map" | "report">;
|
|
2078
2083
|
messages?: boolean;
|
|
2079
2084
|
whileBusy?: "refuse" | "queue" | "steer";
|
|
2085
|
+
a2a?: boolean;
|
|
2086
|
+
a2aPushHostnames?: Array<string>;
|
|
2087
|
+
description?: string;
|
|
2080
2088
|
defaultLocale?: "en" | "ar";
|
|
2081
2089
|
context?: {
|
|
2082
2090
|
maxContextTokens?: number;
|
|
@@ -2739,6 +2747,9 @@ export type ManagementProcedures = {
|
|
|
2739
2747
|
media?: Array<"mermaid" | "vega-lite" | "map" | "report">;
|
|
2740
2748
|
messages?: boolean;
|
|
2741
2749
|
whileBusy?: "refuse" | "queue" | "steer";
|
|
2750
|
+
a2a?: boolean;
|
|
2751
|
+
a2aPushHostnames?: Array<string>;
|
|
2752
|
+
description?: string;
|
|
2742
2753
|
defaultLocale?: "en" | "ar";
|
|
2743
2754
|
context?: {
|
|
2744
2755
|
maxContextTokens?: number;
|
|
@@ -4239,6 +4250,24 @@ export type ManagementProcedures = {
|
|
|
4239
4250
|
updatedAt: string;
|
|
4240
4251
|
};
|
|
4241
4252
|
};
|
|
4253
|
+
/** Delete an environment: it serves nothing at once and the daily purge removes it with all it holds. Refused as `last_environment` for a project's last one. */
|
|
4254
|
+
"orgs.deleteEnvironment": {
|
|
4255
|
+
input: {
|
|
4256
|
+
id: string;
|
|
4257
|
+
};
|
|
4258
|
+
output: {
|
|
4259
|
+
environments: number;
|
|
4260
|
+
};
|
|
4261
|
+
};
|
|
4262
|
+
/** Delete a project and every environment in it: they serve nothing at once and the daily purge removes them with all they hold. Refused as `last_project` for an org's last project. */
|
|
4263
|
+
"orgs.deleteProject": {
|
|
4264
|
+
input: {
|
|
4265
|
+
id: string;
|
|
4266
|
+
};
|
|
4267
|
+
output: {
|
|
4268
|
+
environments: number;
|
|
4269
|
+
};
|
|
4270
|
+
};
|
|
4242
4271
|
/** 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. */
|
|
4243
4272
|
"orgs.inviteOwner": {
|
|
4244
4273
|
input: {
|
|
@@ -4284,6 +4313,21 @@ export type ManagementProcedures = {
|
|
|
4284
4313
|
name: string;
|
|
4285
4314
|
}>;
|
|
4286
4315
|
};
|
|
4316
|
+
/** Rename the caller's org; its slug, its address in URLs, never changes. Returns the org. */
|
|
4317
|
+
"orgs.rename": {
|
|
4318
|
+
input: {
|
|
4319
|
+
name: string;
|
|
4320
|
+
};
|
|
4321
|
+
output: {
|
|
4322
|
+
id: string;
|
|
4323
|
+
slug: string;
|
|
4324
|
+
name: string;
|
|
4325
|
+
suspendedAt: string | null;
|
|
4326
|
+
purgeAt: string | null;
|
|
4327
|
+
createdAt: string;
|
|
4328
|
+
updatedAt: string;
|
|
4329
|
+
};
|
|
4330
|
+
};
|
|
4287
4331
|
/** Restore a suspended or deleted org before its purge, as it was, its assistant brought up to this release. */
|
|
4288
4332
|
"orgs.restore": {
|
|
4289
4333
|
input: {
|
|
@@ -4314,6 +4358,20 @@ export type ManagementProcedures = {
|
|
|
4314
4358
|
updatedAt: string;
|
|
4315
4359
|
};
|
|
4316
4360
|
};
|
|
4361
|
+
/** Set a project's display name; its name, its address in URLs, never changes. Returns the project. */
|
|
4362
|
+
"orgs.updateProject": {
|
|
4363
|
+
input: {
|
|
4364
|
+
id: string;
|
|
4365
|
+
displayName: Partial<Record<"en" | "ar", string>>;
|
|
4366
|
+
};
|
|
4367
|
+
output: {
|
|
4368
|
+
id: string;
|
|
4369
|
+
name: string;
|
|
4370
|
+
displayName: Partial<Record<"en" | "ar", string>>;
|
|
4371
|
+
createdAt: string;
|
|
4372
|
+
updatedAt: string;
|
|
4373
|
+
};
|
|
4374
|
+
};
|
|
4317
4375
|
/** Components of every kind shared with this agent alone: what deleting it leaves shared with nobody, unless `agents.delete` names them in `deleteComponentIds`. */
|
|
4318
4376
|
"publishing.exclusive": {
|
|
4319
4377
|
input: {
|
|
@@ -4368,13 +4426,13 @@ export type ManagementProcedures = {
|
|
|
4368
4426
|
input: {
|
|
4369
4427
|
name: string;
|
|
4370
4428
|
description: string;
|
|
4371
|
-
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">;
|
|
4429
|
+
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" | "projects:manage" | "orgs:manage">;
|
|
4372
4430
|
};
|
|
4373
4431
|
output: {
|
|
4374
4432
|
id: string;
|
|
4375
4433
|
name: string;
|
|
4376
4434
|
description: string;
|
|
4377
|
-
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">;
|
|
4435
|
+
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" | "projects:manage" | "orgs:manage">;
|
|
4378
4436
|
};
|
|
4379
4437
|
};
|
|
4380
4438
|
/** Delete a role; the built-in Administrator role cannot be deleted. */
|
|
@@ -4396,7 +4454,7 @@ export type ManagementProcedures = {
|
|
|
4396
4454
|
id: string;
|
|
4397
4455
|
name: string;
|
|
4398
4456
|
description: string;
|
|
4399
|
-
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">;
|
|
4457
|
+
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" | "projects:manage" | "orgs:manage">;
|
|
4400
4458
|
builtInId: string | null;
|
|
4401
4459
|
createdAt: string;
|
|
4402
4460
|
assignedUsers: number;
|
|
@@ -4412,14 +4470,14 @@ export type ManagementProcedures = {
|
|
|
4412
4470
|
input: {
|
|
4413
4471
|
name: string;
|
|
4414
4472
|
description: string;
|
|
4415
|
-
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">;
|
|
4473
|
+
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" | "projects:manage" | "orgs:manage">;
|
|
4416
4474
|
id: string;
|
|
4417
4475
|
};
|
|
4418
4476
|
output: {
|
|
4419
4477
|
id: string;
|
|
4420
4478
|
name: string;
|
|
4421
4479
|
description: string;
|
|
4422
|
-
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">;
|
|
4480
|
+
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" | "projects:manage" | "orgs:manage">;
|
|
4423
4481
|
};
|
|
4424
4482
|
};
|
|
4425
4483
|
/** Delete a secret; fails while a credential or an agent's auth (its signing secret or reCAPTCHA API key) still references it. */
|
|
@@ -4977,7 +5035,7 @@ export type ManagementProcedures = {
|
|
|
4977
5035
|
name: string;
|
|
4978
5036
|
};
|
|
4979
5037
|
};
|
|
4980
|
-
/** The
|
|
5038
|
+
/** The caller's environment's settings: log and thread retention, and the browser origins its engine routes admit. */
|
|
4981
5039
|
"settings.get": {
|
|
4982
5040
|
input: undefined;
|
|
4983
5041
|
output: {
|
|
@@ -4986,12 +5044,12 @@ export type ManagementProcedures = {
|
|
|
4986
5044
|
corsOrigins: Array<string>;
|
|
4987
5045
|
};
|
|
4988
5046
|
};
|
|
4989
|
-
/** Change the
|
|
5047
|
+
/** Change the caller's environment's settings: retention, and the browser origins its engine routes admit. */
|
|
4990
5048
|
"settings.update": {
|
|
4991
5049
|
input: {
|
|
4992
5050
|
logRetentionDays: number;
|
|
4993
5051
|
threadRetentionDays?: number;
|
|
4994
|
-
/** Browser origins, beside the console's own, that may call the
|
|
5052
|
+
/** Browser origins, beside the console's own, that may call the environment's engine routes, such as a site embedding its widget. */
|
|
4995
5053
|
corsOrigins: Array<string>;
|
|
4996
5054
|
};
|
|
4997
5055
|
output: {
|
|
@@ -198,6 +198,9 @@ export const HOSTNAME_PATTERN =
|
|
|
198
198
|
/** At most this many hosts an agent's `fetchImage` tool pulls images from. */
|
|
199
199
|
export const FETCH_IMAGE_HOSTS_LIMIT = 20;
|
|
200
200
|
|
|
201
|
+
/** At most this many hosts an agent's A2A push notifications are posted to. */
|
|
202
|
+
export const A2A_PUSH_HOSTS_LIMIT = 20;
|
|
203
|
+
|
|
201
204
|
/**
|
|
202
205
|
* The widget's landing-page prompt chips, per locale: a short title the chip
|
|
203
206
|
* shows and the prompt it sends when clicked. The console stores this exact
|
|
@@ -1829,6 +1832,15 @@ export const agentSettingsSchema = z.strictObject({
|
|
|
1829
1832
|
messages: z.boolean().default(true),
|
|
1830
1833
|
/** A message sent while the agent works: refused, queued, or steering the running turn. */
|
|
1831
1834
|
whileBusy: z.enum(WHILE_BUSY).default("refuse"),
|
|
1835
|
+
/** Serves the agent over A2A: its agent card and its A2A endpoint. */
|
|
1836
|
+
a2a: z.boolean().default(false),
|
|
1837
|
+
/** Hosts an A2A caller's push notifications may be posted to; none, no push. */
|
|
1838
|
+
a2aPushHostnames: z
|
|
1839
|
+
.array(z.string().max(253).regex(HOSTNAME_PATTERN))
|
|
1840
|
+
.max(A2A_PUSH_HOSTS_LIMIT)
|
|
1841
|
+
.default([]),
|
|
1842
|
+
/** What the agent does, in a sentence or two: its A2A card tells callers. */
|
|
1843
|
+
description: z.string().trim().max(1000).default(""),
|
|
1832
1844
|
defaultLocale: localeSchema.default(BASE_LOCALE),
|
|
1833
1845
|
context: z
|
|
1834
1846
|
.strictObject({
|
|
@@ -130,7 +130,7 @@ export type WaitState = (typeof WAIT_STATES)[number];
|
|
|
130
130
|
|
|
131
131
|
/**
|
|
132
132
|
* One call a waiting run waits on, and the arguments it was made with: an
|
|
133
|
-
* approval, which `POST /orgs/:org/agents/:agentName/runs/:id/answer`
|
|
133
|
+
* approval, which `POST /orgs/:org/projects/:project/envs/:env/agents/:agentName/runs/:id/answer`
|
|
134
134
|
* decides, or a client tool's call, which its widget answers.
|
|
135
135
|
*/
|
|
136
136
|
export const runWaitSchema = z.object({
|
|
@@ -142,8 +142,8 @@ export const runWaitSchema = z.object({
|
|
|
142
142
|
export type RunWait = z.infer<typeof runWaitSchema>;
|
|
143
143
|
|
|
144
144
|
/**
|
|
145
|
-
* A run as `GET /orgs/:org/agents/:agentName/runs/:id` reads it, and each
|
|
146
|
-
* row of `GET /orgs/:org/agents/:agentName/triggers/:name/runs`: the input
|
|
145
|
+
* A run as `GET /orgs/:org/projects/:project/envs/:env/agents/:agentName/runs/:id` reads it, and each
|
|
146
|
+
* row of `GET /orgs/:org/projects/:project/envs/:env/agents/:agentName/triggers/:name/runs`: the input
|
|
147
147
|
* it answers, and its thread, null once that thread is gone.
|
|
148
148
|
*/
|
|
149
149
|
export const runRecordSchema = z.object({
|
|
@@ -169,16 +169,16 @@ export const runRecordSchema = z.object({
|
|
|
169
169
|
});
|
|
170
170
|
export type RunRecord = z.infer<typeof runRecordSchema>;
|
|
171
171
|
|
|
172
|
-
/** `GET /orgs/:org/agents/:agentName/triggers/:name/runs`: a page of the trigger's runs, newest first. */
|
|
172
|
+
/** `GET /orgs/:org/projects/:project/envs/:env/agents/:agentName/triggers/:name/runs`: a page of the trigger's runs, newest first. */
|
|
173
173
|
export const runListSchema = z.object({ runs: z.array(runRecordSchema) });
|
|
174
174
|
export type RunList = z.infer<typeof runListSchema>;
|
|
175
175
|
|
|
176
|
-
/** `POST /orgs/:org/agents/:agentName/runs/:id/cancel`: whether it stopped or ended anything; a run already over is left as it is. */
|
|
176
|
+
/** `POST /orgs/:org/projects/:project/envs/:env/agents/:agentName/runs/:id/cancel`: whether it stopped or ended anything; a run already over is left as it is. */
|
|
177
177
|
export const runCancelSchema = z.object({ cancelled: z.boolean() });
|
|
178
178
|
export type RunCancel = z.infer<typeof runCancelSchema>;
|
|
179
179
|
|
|
180
180
|
/**
|
|
181
|
-
* `POST /orgs/:org/agents/:agentName/runs/:id/answer`: the decision on one
|
|
181
|
+
* `POST /orgs/:org/projects/:project/envs/:env/agents/:agentName/runs/:id/answer`: the decision on one
|
|
182
182
|
* call the run waits on. A call id is as long as the model provider made it
|
|
183
183
|
* (some carry a signature), so only the request's body limit bounds it.
|
|
184
184
|
*/
|
|
@@ -231,7 +231,7 @@ const runEventFields = {
|
|
|
231
231
|
* A run parked on calls that wait for a decision, as every receiver hears
|
|
232
232
|
* of it: a webhook's body and the agent's server's event are this one
|
|
233
233
|
* object. `runId` names the run a receiver decides through
|
|
234
|
-
* `POST /orgs/:org/agents/:agentName/runs/:id/answer`. Every call it waits on is
|
|
234
|
+
* `POST /orgs/:org/projects/:project/envs/:env/agents/:agentName/runs/:id/answer`. Every call it waits on is
|
|
235
235
|
* named, a client tool's among them; one whose input would carry the event
|
|
236
236
|
* past `SERVER_REQUEST_MAX_BYTES` comes without its input. A run waiting
|
|
237
237
|
* only on its widget's calls is not announced.
|
|
@@ -4,7 +4,7 @@ import { inputReceiptSchema, runRecordSchema } from "../runs/index";
|
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
* Triggers: named entry points on an agent. A caller fires one over
|
|
7
|
-
* `POST /orgs/:org/agents/:agentName/triggers/:name` with the trigger's secret as its
|
|
7
|
+
* `POST /orgs/:org/projects/:project/envs/:env/agents/:agentName/triggers/:name` with the trigger's secret as its
|
|
8
8
|
* bearer; the fire is an input on the thread the trigger's policy names,
|
|
9
9
|
* and the run that takes it is read and decided under `/runs/:id`. These
|
|
10
10
|
* are the shapes Cortex answers that caller with.
|
|
@@ -13,24 +13,35 @@ import { inputReceiptSchema, runRecordSchema } from "../runs/index";
|
|
|
13
13
|
/** The tool a trigger run with an output schema answers through; no other tool may take its name. */
|
|
14
14
|
export const TRIGGER_ANSWER_TOOL_NAME = "submitAnswer";
|
|
15
15
|
|
|
16
|
-
/**
|
|
17
|
-
export
|
|
18
|
-
|
|
16
|
+
/** An environment by the names its engine routes carry: its org's slug, its project's name and its own. */
|
|
17
|
+
export const environmentAddressSchema = z.object({
|
|
18
|
+
/** The slug of the org. */
|
|
19
|
+
org: z.string(),
|
|
20
|
+
/** The name of the project in that org. */
|
|
21
|
+
project: z.string(),
|
|
22
|
+
/** The name of the environment of that project, such as `production`. */
|
|
23
|
+
environment: z.string(),
|
|
24
|
+
});
|
|
25
|
+
export type EnvironmentAddress = z.infer<typeof environmentAddressSchema>;
|
|
26
|
+
|
|
27
|
+
/** The engine route of environment `address`, which its agents' routes and its sign-ins sit under. */
|
|
28
|
+
export function environmentRoute({ org, project, environment }: EnvironmentAddress) {
|
|
29
|
+
return `/orgs/${encodeURIComponent(org)}/projects/${encodeURIComponent(project)}/envs/${encodeURIComponent(environment)}`;
|
|
19
30
|
}
|
|
20
31
|
|
|
21
|
-
/** The engine route of agent `agentName` in
|
|
22
|
-
export function agentRoute(
|
|
23
|
-
return `${
|
|
32
|
+
/** The engine route of agent `agentName` in environment `address`, which the widget chats with and its triggers and runs sit under. */
|
|
33
|
+
export function agentRoute(address: EnvironmentAddress, agentName: string) {
|
|
34
|
+
return `${environmentRoute(address)}/agents/${encodeURIComponent(agentName)}`;
|
|
24
35
|
}
|
|
25
36
|
|
|
26
|
-
/** The engine route a trigger is fired at on agent `agentName` in
|
|
27
|
-
export function triggerRoute(
|
|
28
|
-
return `${agentRoute(
|
|
37
|
+
/** The engine route a trigger is fired at on agent `agentName` in environment `address`; its runs are listed under it. */
|
|
38
|
+
export function triggerRoute(address: EnvironmentAddress, agentName: string, name: string) {
|
|
39
|
+
return `${agentRoute(address, agentName)}/triggers/${encodeURIComponent(name)}`;
|
|
29
40
|
}
|
|
30
41
|
|
|
31
|
-
/** The engine route a run of agent `agentName` in
|
|
32
|
-
export function runRoute(
|
|
33
|
-
return `${agentRoute(
|
|
42
|
+
/** The engine route a run of agent `agentName` in environment `address` is read at, and answered and cancelled under. */
|
|
43
|
+
export function runRoute(address: EnvironmentAddress, agentName: string, runId: string) {
|
|
44
|
+
return `${agentRoute(address, agentName)}/runs/${encodeURIComponent(runId)}`;
|
|
34
45
|
}
|
|
35
46
|
|
|
36
47
|
/** What a fire answers once its run started: its input, run and thread; `GET .../runs/:id` reads the run. */
|
|
@@ -48,7 +59,7 @@ export const fireRejectedSchema = z.object({
|
|
|
48
59
|
});
|
|
49
60
|
|
|
50
61
|
/**
|
|
51
|
-
* What `POST
|
|
62
|
+
* What `POST .../agents/:agentName/triggers/:name` answers as JSON: the run it
|
|
52
63
|
* started (`started`, 202); with `?wait=`, that run once it ended (a
|
|
53
64
|
* `RunRecord`, 200) or parked on a decision (202); the fire's input while it
|
|
54
65
|
* waits on the thread, once refused, or once cancelled before any run took
|
|
@@ -216,7 +216,7 @@ export type AccountConnection = {
|
|
|
216
216
|
};
|
|
217
217
|
|
|
218
218
|
/**
|
|
219
|
-
* The form `POST /orgs/:org/oauth/start` takes, posted into the window a sign-in runs
|
|
219
|
+
* The form `POST /orgs/:org/projects/:project/envs/:env/oauth/start` takes, posted into the window a sign-in runs
|
|
220
220
|
* in with its bearer in the body, so no link can start one: the console's
|
|
221
221
|
* operator token and the server's id for the shared connection.
|
|
222
222
|
*/
|
|
@@ -627,8 +627,8 @@ export type WaitingInput<TPart = unknown> = {
|
|
|
627
627
|
inputId: string;
|
|
628
628
|
delivery: "prompt" | "steer" | "followUp" | "answer" | "note";
|
|
629
629
|
message: CortexMessage<TPart>;
|
|
630
|
-
/** Whether
|
|
631
|
-
|
|
630
|
+
/** Whether the widget may move it to steer the running turn: text alone, sent from the widget. One with files, or one an A2A caller sent, which is its own task, waits for a turn of its own. */
|
|
631
|
+
steerable: boolean;
|
|
632
632
|
};
|
|
633
633
|
|
|
634
634
|
/**
|
package/src/scaffold/files.ts
CHANGED
|
@@ -28,7 +28,7 @@ import { applyPorts, type Ports } from "@/scaffold/ports";
|
|
|
28
28
|
* `@m6d/cortex` range below are stamped by scripts/sync-package-versions.ts
|
|
29
29
|
* before the CLI publishes, so a scaffold pins what was current then.
|
|
30
30
|
*/
|
|
31
|
-
const CORTEX_VERSION = "0.
|
|
31
|
+
const CORTEX_VERSION = "0.25.0";
|
|
32
32
|
|
|
33
33
|
/** This machine as Cortex's containers name it: the one private host the stack's egress policy admits. */
|
|
34
34
|
export const DOCKER_HOST = "host.docker.internal";
|
|
@@ -147,7 +147,7 @@ function packageJson({ name, datasets, setup }: Project) {
|
|
|
147
147
|
verify: "bun run format:check && bun run lint && bun run spellcheck && bun run check && bun run audit",
|
|
148
148
|
},
|
|
149
149
|
dependencies: {
|
|
150
|
-
"@m6d/cortex": "~0.
|
|
150
|
+
"@m6d/cortex": "~0.13.0",
|
|
151
151
|
// drizzle 1.0 is in beta; this is the build `@m6d/cortex/drizzle` is tested against.
|
|
152
152
|
...(datasets ? { "drizzle-orm": "1.0.0-beta.15-859cf75" } : {}),
|
|
153
153
|
hono: "^4.12.3",
|