@m6d/cortex 0.12.0 → 0.13.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 -0
- package/dist/index.d.ts +121 -49
- package/dist/index.js +26 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -118,6 +118,8 @@ import { createTriggerClient } from "@m6d/cortex";
|
|
|
118
118
|
const triggers = createTriggerClient({
|
|
119
119
|
url: "https://engine.cortex.example.com", // the engine's public origin, ENGINE_PUBLIC_URL
|
|
120
120
|
org: "acme", // the slug of the agent's org
|
|
121
|
+
project: "web", // the agent's project
|
|
122
|
+
environment: "production", // the environment it is served from
|
|
121
123
|
agent: "reviewer",
|
|
122
124
|
secrets: { "pr-opened": process.env.PR_TRIGGER_SECRET! },
|
|
123
125
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -79,6 +79,7 @@ declare const runFinishedEventSchema: z.ZodObject<{
|
|
|
79
79
|
stopped: "stopped";
|
|
80
80
|
parent_cancelled: "parent_cancelled";
|
|
81
81
|
lost: "lost";
|
|
82
|
+
output_limit: "output_limit";
|
|
82
83
|
}>>;
|
|
83
84
|
result: z.ZodUnknown;
|
|
84
85
|
waits: z.ZodArray<z.ZodObject<{
|
|
@@ -1358,6 +1359,7 @@ declare const runRecordSchema: z.ZodObject<{
|
|
|
1358
1359
|
stopped: "stopped";
|
|
1359
1360
|
parent_cancelled: "parent_cancelled";
|
|
1360
1361
|
lost: "lost";
|
|
1362
|
+
output_limit: "output_limit";
|
|
1361
1363
|
}>>;
|
|
1362
1364
|
result: z.ZodUnknown;
|
|
1363
1365
|
waits: z.ZodArray<z.ZodObject<{
|
|
@@ -1378,11 +1380,12 @@ declare const runAnswerSchema: z.ZodObject<{
|
|
|
1378
1380
|
approved: z.ZodBoolean;
|
|
1379
1381
|
}, z.core.$strip>;
|
|
1380
1382
|
export type RunAnswer = z.infer<typeof runAnswerSchema>;
|
|
1381
|
-
declare const
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1383
|
+
declare const environmentAddressSchema: z.ZodObject<{
|
|
1384
|
+
org: z.ZodString;
|
|
1385
|
+
project: z.ZodString;
|
|
1386
|
+
environment: z.ZodString;
|
|
1387
|
+
}, z.core.$strip>;
|
|
1388
|
+
export type EnvironmentAddress = z.infer<typeof environmentAddressSchema>;
|
|
1386
1389
|
declare const fireAnswerSchema: z.ZodUnion<readonly [
|
|
1387
1390
|
z.ZodObject<{
|
|
1388
1391
|
inputId: z.ZodUUID;
|
|
@@ -1455,6 +1458,7 @@ declare const fireAnswerSchema: z.ZodUnion<readonly [
|
|
|
1455
1458
|
stopped: "stopped";
|
|
1456
1459
|
parent_cancelled: "parent_cancelled";
|
|
1457
1460
|
lost: "lost";
|
|
1461
|
+
output_limit: "output_limit";
|
|
1458
1462
|
}>>;
|
|
1459
1463
|
result: z.ZodUnknown;
|
|
1460
1464
|
waits: z.ZodArray<z.ZodObject<{
|
|
@@ -1471,11 +1475,15 @@ declare const fireAnswerSchema: z.ZodUnion<readonly [
|
|
|
1471
1475
|
}, z.core.$strip>
|
|
1472
1476
|
]>;
|
|
1473
1477
|
export type FireAnswer = z.infer<typeof fireAnswerSchema>;
|
|
1474
|
-
|
|
1478
|
+
declare const MESSAGE_BUSY: readonly [
|
|
1479
|
+
"queue",
|
|
1480
|
+
"steer"
|
|
1481
|
+
];
|
|
1482
|
+
export type MessageBusy = (typeof MESSAGE_BUSY)[number];
|
|
1483
|
+
/** Where the agent is served from, by its environment's names, and how to reach and fire it. */
|
|
1484
|
+
export type TriggerClientConfig = EnvironmentAddress & {
|
|
1475
1485
|
/** The engine's public origin (`ENGINE_PUBLIC_URL`) as the caller reaches it. */
|
|
1476
1486
|
url: string;
|
|
1477
|
-
/** The slug of the org the agent belongs to. */
|
|
1478
|
-
org: string;
|
|
1479
1487
|
/** The agent whose triggers are fired. */
|
|
1480
1488
|
agent: string;
|
|
1481
1489
|
/** The value of the fire credential shared by the caller's triggers. */
|
|
@@ -1523,7 +1531,7 @@ export declare function createTriggerClient(config: TriggerClientConfig): {
|
|
|
1523
1531
|
kind: "turn" | "subagent" | "tool";
|
|
1524
1532
|
subagentRunId: string | null;
|
|
1525
1533
|
status: "completed" | "cancelled" | "failed" | "running" | "waiting";
|
|
1526
|
-
reason: "timeout" | "cancelled" | "no_output" | "invalid_output" | "stopped" | "parent_cancelled" | "lost" | null;
|
|
1534
|
+
reason: "timeout" | "cancelled" | "no_output" | "invalid_output" | "stopped" | "parent_cancelled" | "lost" | "output_limit" | null;
|
|
1527
1535
|
result: unknown;
|
|
1528
1536
|
waits: {
|
|
1529
1537
|
kind: "approval" | "client_tool";
|
|
@@ -1565,7 +1573,7 @@ export declare function createTriggerClient(config: TriggerClientConfig): {
|
|
|
1565
1573
|
kind: "turn" | "subagent" | "tool";
|
|
1566
1574
|
subagentRunId: string | null;
|
|
1567
1575
|
status: "completed" | "cancelled" | "failed" | "running" | "waiting";
|
|
1568
|
-
reason: "timeout" | "cancelled" | "no_output" | "invalid_output" | "stopped" | "parent_cancelled" | "lost" | null;
|
|
1576
|
+
reason: "timeout" | "cancelled" | "no_output" | "invalid_output" | "stopped" | "parent_cancelled" | "lost" | "output_limit" | null;
|
|
1569
1577
|
result: unknown;
|
|
1570
1578
|
waits: {
|
|
1571
1579
|
kind: "approval" | "client_tool";
|
|
@@ -1597,7 +1605,7 @@ export declare function createTriggerClient(config: TriggerClientConfig): {
|
|
|
1597
1605
|
kind: "turn" | "subagent" | "tool";
|
|
1598
1606
|
subagentRunId: string | null;
|
|
1599
1607
|
status: "completed" | "cancelled" | "failed" | "running" | "waiting";
|
|
1600
|
-
reason: "timeout" | "cancelled" | "no_output" | "invalid_output" | "stopped" | "parent_cancelled" | "lost" | null;
|
|
1608
|
+
reason: "timeout" | "cancelled" | "no_output" | "invalid_output" | "stopped" | "parent_cancelled" | "lost" | "output_limit" | null;
|
|
1601
1609
|
result: unknown;
|
|
1602
1610
|
waits: {
|
|
1603
1611
|
kind: "approval" | "client_tool";
|
|
@@ -1621,7 +1629,7 @@ export declare function createTriggerClient(config: TriggerClientConfig): {
|
|
|
1621
1629
|
kind: "turn" | "subagent" | "tool";
|
|
1622
1630
|
subagentRunId: string | null;
|
|
1623
1631
|
status: "completed" | "cancelled" | "failed" | "running" | "waiting";
|
|
1624
|
-
reason: "timeout" | "cancelled" | "no_output" | "invalid_output" | "stopped" | "parent_cancelled" | "lost" | null;
|
|
1632
|
+
reason: "timeout" | "cancelled" | "no_output" | "invalid_output" | "stopped" | "parent_cancelled" | "lost" | "output_limit" | null;
|
|
1625
1633
|
result: unknown;
|
|
1626
1634
|
waits: {
|
|
1627
1635
|
kind: "approval" | "client_tool";
|
|
@@ -2120,6 +2128,9 @@ export type ManagementProcedures = {
|
|
|
2120
2128
|
locationPicker: boolean;
|
|
2121
2129
|
messages: boolean;
|
|
2122
2130
|
whileBusy: "refuse" | "queue" | "steer";
|
|
2131
|
+
a2a: boolean;
|
|
2132
|
+
a2aPushHostnames: string | number | boolean | null | Record<string, unknown> | Array<unknown>;
|
|
2133
|
+
description: string;
|
|
2123
2134
|
media: Array<"mermaid" | "vega-lite" | "map" | "report">;
|
|
2124
2135
|
suggestions: Record<"en" | "ar", Array<{
|
|
2125
2136
|
title: string;
|
|
@@ -2168,6 +2179,9 @@ export type ManagementProcedures = {
|
|
|
2168
2179
|
locationPicker: boolean;
|
|
2169
2180
|
messages: boolean;
|
|
2170
2181
|
whileBusy: "refuse" | "queue" | "steer";
|
|
2182
|
+
a2a: boolean;
|
|
2183
|
+
a2aPushHostnames: string | number | boolean | null | Record<string, unknown> | Array<unknown>;
|
|
2184
|
+
description: string;
|
|
2171
2185
|
media: Array<"mermaid" | "vega-lite" | "map" | "report">;
|
|
2172
2186
|
suggestions: Record<"en" | "ar", Array<{
|
|
2173
2187
|
title: string;
|
|
@@ -2228,6 +2242,9 @@ export type ManagementProcedures = {
|
|
|
2228
2242
|
locationPicker: boolean;
|
|
2229
2243
|
messages: boolean;
|
|
2230
2244
|
whileBusy: "refuse" | "queue" | "steer";
|
|
2245
|
+
a2a: boolean;
|
|
2246
|
+
a2aPushHostnames: string | number | boolean | null | Record<string, unknown> | Array<unknown>;
|
|
2247
|
+
description: string;
|
|
2231
2248
|
media: Array<"mermaid" | "vega-lite" | "map" | "report">;
|
|
2232
2249
|
suggestions: Record<"en" | "ar", Array<{
|
|
2233
2250
|
title: string;
|
|
@@ -2397,6 +2414,9 @@ export type ManagementProcedures = {
|
|
|
2397
2414
|
locationPicker: boolean;
|
|
2398
2415
|
messages: boolean;
|
|
2399
2416
|
whileBusy: "refuse" | "queue" | "steer";
|
|
2417
|
+
a2a: boolean;
|
|
2418
|
+
a2aPushHostnames: string | number | boolean | null | Record<string, unknown> | Array<unknown>;
|
|
2419
|
+
description: string;
|
|
2400
2420
|
media: Array<"mermaid" | "vega-lite" | "map" | "report">;
|
|
2401
2421
|
suggestions: Record<"en" | "ar", Array<{
|
|
2402
2422
|
title: string;
|
|
@@ -2433,6 +2453,9 @@ export type ManagementProcedures = {
|
|
|
2433
2453
|
media?: Array<"mermaid" | "vega-lite" | "map" | "report">;
|
|
2434
2454
|
messages?: boolean;
|
|
2435
2455
|
whileBusy?: "refuse" | "queue" | "steer";
|
|
2456
|
+
a2a?: boolean;
|
|
2457
|
+
a2aPushHostnames?: Array<string>;
|
|
2458
|
+
description?: string;
|
|
2436
2459
|
defaultLocale?: "en" | "ar";
|
|
2437
2460
|
context?: {
|
|
2438
2461
|
maxContextTokens: number;
|
|
@@ -2513,6 +2536,9 @@ export type ManagementProcedures = {
|
|
|
2513
2536
|
locationPicker: boolean;
|
|
2514
2537
|
messages: boolean;
|
|
2515
2538
|
whileBusy: "refuse" | "queue" | "steer";
|
|
2539
|
+
a2a: boolean;
|
|
2540
|
+
a2aPushHostnames: string | number | boolean | null | Record<string, unknown> | Array<unknown>;
|
|
2541
|
+
description: string;
|
|
2516
2542
|
media: Array<"mermaid" | "vega-lite" | "map" | "report">;
|
|
2517
2543
|
suggestions: Record<"en" | "ar", Array<{
|
|
2518
2544
|
title: string;
|
|
@@ -2561,6 +2587,9 @@ export type ManagementProcedures = {
|
|
|
2561
2587
|
locationPicker: boolean;
|
|
2562
2588
|
messages: boolean;
|
|
2563
2589
|
whileBusy: "refuse" | "queue" | "steer";
|
|
2590
|
+
a2a: boolean;
|
|
2591
|
+
a2aPushHostnames: string | number | boolean | null | Record<string, unknown> | Array<unknown>;
|
|
2592
|
+
description: string;
|
|
2564
2593
|
media: Array<"mermaid" | "vega-lite" | "map" | "report">;
|
|
2565
2594
|
suggestions: Record<"en" | "ar", Array<{
|
|
2566
2595
|
title: string;
|
|
@@ -3444,31 +3473,7 @@ export type ManagementProcedures = {
|
|
|
3444
3473
|
updatedAt: string;
|
|
3445
3474
|
};
|
|
3446
3475
|
};
|
|
3447
|
-
/** The
|
|
3448
|
-
"managementKeys.list": {
|
|
3449
|
-
input: {
|
|
3450
|
-
pageIndex?: number;
|
|
3451
|
-
pageSize?: number;
|
|
3452
|
-
q?: string;
|
|
3453
|
-
};
|
|
3454
|
-
output: {
|
|
3455
|
-
items: Array<{
|
|
3456
|
-
id: string;
|
|
3457
|
-
name: string;
|
|
3458
|
-
displayName: Partial<Record<"en" | "ar", string>>;
|
|
3459
|
-
fingerprint: string;
|
|
3460
|
-
permissions: Array<string> | null;
|
|
3461
|
-
lastUsedAt: string | null;
|
|
3462
|
-
revokedAt: string | null;
|
|
3463
|
-
createdAt: string;
|
|
3464
|
-
}>;
|
|
3465
|
-
/** Every row the caller may see, ignoring the search and filters. */
|
|
3466
|
-
count: number;
|
|
3467
|
-
/** The rows matching the search and filters, over all pages: the total to report. */
|
|
3468
|
-
filteredCount: number;
|
|
3469
|
-
};
|
|
3470
|
-
};
|
|
3471
|
-
/** 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. */
|
|
3476
|
+
/** 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. */
|
|
3472
3477
|
"managementKeys.mine": {
|
|
3473
3478
|
input: undefined;
|
|
3474
3479
|
output: {
|
|
@@ -3480,6 +3485,11 @@ export type ManagementProcedures = {
|
|
|
3480
3485
|
lastUsedAt: string | null;
|
|
3481
3486
|
revokedAt: string | null;
|
|
3482
3487
|
createdAt: string;
|
|
3488
|
+
environment: {
|
|
3489
|
+
org: string;
|
|
3490
|
+
project: string;
|
|
3491
|
+
environment: string;
|
|
3492
|
+
};
|
|
3483
3493
|
};
|
|
3484
3494
|
};
|
|
3485
3495
|
/** 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. */
|
|
@@ -3540,6 +3550,9 @@ export type ManagementProcedures = {
|
|
|
3540
3550
|
media?: Array<"mermaid" | "vega-lite" | "map" | "report">;
|
|
3541
3551
|
messages?: boolean;
|
|
3542
3552
|
whileBusy?: "refuse" | "queue" | "steer";
|
|
3553
|
+
a2a?: boolean;
|
|
3554
|
+
a2aPushHostnames?: Array<string>;
|
|
3555
|
+
description?: string;
|
|
3543
3556
|
defaultLocale?: "en" | "ar";
|
|
3544
3557
|
context?: {
|
|
3545
3558
|
maxContextTokens?: number;
|
|
@@ -4202,6 +4215,9 @@ export type ManagementProcedures = {
|
|
|
4202
4215
|
media?: Array<"mermaid" | "vega-lite" | "map" | "report">;
|
|
4203
4216
|
messages?: boolean;
|
|
4204
4217
|
whileBusy?: "refuse" | "queue" | "steer";
|
|
4218
|
+
a2a?: boolean;
|
|
4219
|
+
a2aPushHostnames?: Array<string>;
|
|
4220
|
+
description?: string;
|
|
4205
4221
|
defaultLocale?: "en" | "ar";
|
|
4206
4222
|
context?: {
|
|
4207
4223
|
maxContextTokens?: number;
|
|
@@ -5316,7 +5332,7 @@ export type ManagementProcedures = {
|
|
|
5316
5332
|
id: string;
|
|
5317
5333
|
kind: "turn" | "subagent" | "tool";
|
|
5318
5334
|
status: "running" | "waiting" | "completed" | "failed" | "cancelled";
|
|
5319
|
-
reason: "no_output" | "invalid_output" | "stopped" | "cancelled" | "parent_cancelled" | "lost" | "timeout" | null;
|
|
5335
|
+
reason: "no_output" | "invalid_output" | "stopped" | "cancelled" | "parent_cancelled" | "lost" | "timeout" | "output_limit" | null;
|
|
5320
5336
|
createdAt: string;
|
|
5321
5337
|
finishedAt: string | null;
|
|
5322
5338
|
source: "user" | "trigger" | "schedule" | "run" | null;
|
|
@@ -5492,7 +5508,7 @@ export type ManagementProcedures = {
|
|
|
5492
5508
|
id: string;
|
|
5493
5509
|
kind: "turn" | "subagent" | "tool";
|
|
5494
5510
|
status: "running" | "waiting" | "completed" | "failed" | "cancelled";
|
|
5495
|
-
reason: "no_output" | "invalid_output" | "stopped" | "cancelled" | "parent_cancelled" | "lost" | "timeout" | null;
|
|
5511
|
+
reason: "no_output" | "invalid_output" | "stopped" | "cancelled" | "parent_cancelled" | "lost" | "timeout" | "output_limit" | null;
|
|
5496
5512
|
createdAt: string;
|
|
5497
5513
|
finishedAt: string | null;
|
|
5498
5514
|
source: "user" | "trigger" | "schedule" | "run" | null;
|
|
@@ -5702,6 +5718,24 @@ export type ManagementProcedures = {
|
|
|
5702
5718
|
updatedAt: string;
|
|
5703
5719
|
};
|
|
5704
5720
|
};
|
|
5721
|
+
/** 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. */
|
|
5722
|
+
"orgs.deleteEnvironment": {
|
|
5723
|
+
input: {
|
|
5724
|
+
id: string;
|
|
5725
|
+
};
|
|
5726
|
+
output: {
|
|
5727
|
+
environments: number;
|
|
5728
|
+
};
|
|
5729
|
+
};
|
|
5730
|
+
/** 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. */
|
|
5731
|
+
"orgs.deleteProject": {
|
|
5732
|
+
input: {
|
|
5733
|
+
id: string;
|
|
5734
|
+
};
|
|
5735
|
+
output: {
|
|
5736
|
+
environments: number;
|
|
5737
|
+
};
|
|
5738
|
+
};
|
|
5705
5739
|
/** 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
5740
|
"orgs.inviteOwner": {
|
|
5707
5741
|
input: {
|
|
@@ -5747,6 +5781,21 @@ export type ManagementProcedures = {
|
|
|
5747
5781
|
name: string;
|
|
5748
5782
|
}>;
|
|
5749
5783
|
};
|
|
5784
|
+
/** Rename the caller's org; its slug, its address in URLs, never changes. Returns the org. */
|
|
5785
|
+
"orgs.rename": {
|
|
5786
|
+
input: {
|
|
5787
|
+
name: string;
|
|
5788
|
+
};
|
|
5789
|
+
output: {
|
|
5790
|
+
id: string;
|
|
5791
|
+
slug: string;
|
|
5792
|
+
name: string;
|
|
5793
|
+
suspendedAt: string | null;
|
|
5794
|
+
purgeAt: string | null;
|
|
5795
|
+
createdAt: string;
|
|
5796
|
+
updatedAt: string;
|
|
5797
|
+
};
|
|
5798
|
+
};
|
|
5750
5799
|
/** Restore a suspended or deleted org before its purge, as it was, its assistant brought up to this release. */
|
|
5751
5800
|
"orgs.restore": {
|
|
5752
5801
|
input: {
|
|
@@ -5777,6 +5826,20 @@ export type ManagementProcedures = {
|
|
|
5777
5826
|
updatedAt: string;
|
|
5778
5827
|
};
|
|
5779
5828
|
};
|
|
5829
|
+
/** Set a project's display name; its name, its address in URLs, never changes. Returns the project. */
|
|
5830
|
+
"orgs.updateProject": {
|
|
5831
|
+
input: {
|
|
5832
|
+
id: string;
|
|
5833
|
+
displayName: Partial<Record<"en" | "ar", string>>;
|
|
5834
|
+
};
|
|
5835
|
+
output: {
|
|
5836
|
+
id: string;
|
|
5837
|
+
name: string;
|
|
5838
|
+
displayName: Partial<Record<"en" | "ar", string>>;
|
|
5839
|
+
createdAt: string;
|
|
5840
|
+
updatedAt: string;
|
|
5841
|
+
};
|
|
5842
|
+
};
|
|
5780
5843
|
/** Components of every kind shared with this agent alone: what deleting it leaves shared with nobody, unless `agents.delete` names them in `deleteComponentIds`. */
|
|
5781
5844
|
"publishing.exclusive": {
|
|
5782
5845
|
input: {
|
|
@@ -5831,13 +5894,13 @@ export type ManagementProcedures = {
|
|
|
5831
5894
|
input: {
|
|
5832
5895
|
name: string;
|
|
5833
5896
|
description: string;
|
|
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">;
|
|
5897
|
+
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">;
|
|
5835
5898
|
};
|
|
5836
5899
|
output: {
|
|
5837
5900
|
id: string;
|
|
5838
5901
|
name: string;
|
|
5839
5902
|
description: string;
|
|
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">;
|
|
5903
|
+
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">;
|
|
5841
5904
|
};
|
|
5842
5905
|
};
|
|
5843
5906
|
/** Delete a role; the built-in Administrator role cannot be deleted. */
|
|
@@ -5859,7 +5922,7 @@ export type ManagementProcedures = {
|
|
|
5859
5922
|
id: string;
|
|
5860
5923
|
name: string;
|
|
5861
5924
|
description: string;
|
|
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">;
|
|
5925
|
+
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">;
|
|
5863
5926
|
builtInId: string | null;
|
|
5864
5927
|
createdAt: string;
|
|
5865
5928
|
assignedUsers: number;
|
|
@@ -5875,14 +5938,14 @@ export type ManagementProcedures = {
|
|
|
5875
5938
|
input: {
|
|
5876
5939
|
name: string;
|
|
5877
5940
|
description: string;
|
|
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">;
|
|
5941
|
+
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">;
|
|
5879
5942
|
id: string;
|
|
5880
5943
|
};
|
|
5881
5944
|
output: {
|
|
5882
5945
|
id: string;
|
|
5883
5946
|
name: string;
|
|
5884
5947
|
description: string;
|
|
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">;
|
|
5948
|
+
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">;
|
|
5886
5949
|
};
|
|
5887
5950
|
};
|
|
5888
5951
|
/** Delete a secret; fails while a credential or an agent's auth (its signing secret or reCAPTCHA API key) still references it. */
|
|
@@ -6440,7 +6503,7 @@ export type ManagementProcedures = {
|
|
|
6440
6503
|
name: string;
|
|
6441
6504
|
};
|
|
6442
6505
|
};
|
|
6443
|
-
/** The
|
|
6506
|
+
/** The caller's environment's settings: log and thread retention, and the browser origins its engine routes admit. */
|
|
6444
6507
|
"settings.get": {
|
|
6445
6508
|
input: undefined;
|
|
6446
6509
|
output: {
|
|
@@ -6449,12 +6512,12 @@ export type ManagementProcedures = {
|
|
|
6449
6512
|
corsOrigins: Array<string>;
|
|
6450
6513
|
};
|
|
6451
6514
|
};
|
|
6452
|
-
/** Change the
|
|
6515
|
+
/** Change the caller's environment's settings: retention, and the browser origins its engine routes admit. */
|
|
6453
6516
|
"settings.update": {
|
|
6454
6517
|
input: {
|
|
6455
6518
|
logRetentionDays: number;
|
|
6456
6519
|
threadRetentionDays?: number;
|
|
6457
|
-
/** Browser origins, beside the console's own, that may call the
|
|
6520
|
+
/** Browser origins, beside the console's own, that may call the environment's engine routes, such as a site embedding its widget. */
|
|
6458
6521
|
corsOrigins: Array<string>;
|
|
6459
6522
|
};
|
|
6460
6523
|
output: {
|
|
@@ -7671,7 +7734,7 @@ export type ManagementProcedures = {
|
|
|
7671
7734
|
kind: "turn" | "subagent" | "tool";
|
|
7672
7735
|
subagentRunId: string | null;
|
|
7673
7736
|
status: "running" | "waiting" | "completed" | "failed" | "cancelled";
|
|
7674
|
-
reason: "no_output" | "invalid_output" | "stopped" | "cancelled" | "parent_cancelled" | "lost" | "timeout" | null;
|
|
7737
|
+
reason: "no_output" | "invalid_output" | "stopped" | "cancelled" | "parent_cancelled" | "lost" | "timeout" | "output_limit" | null;
|
|
7675
7738
|
result: unknown;
|
|
7676
7739
|
waits: Array<{
|
|
7677
7740
|
kind: "approval" | "client_tool";
|
|
@@ -7755,7 +7818,7 @@ export type ManagementProcedures = {
|
|
|
7755
7818
|
kind: "turn" | "subagent" | "tool";
|
|
7756
7819
|
subagentRunId: string | null;
|
|
7757
7820
|
status: "running" | "waiting" | "completed" | "failed" | "cancelled";
|
|
7758
|
-
reason: "no_output" | "invalid_output" | "stopped" | "cancelled" | "parent_cancelled" | "lost" | "timeout" | null;
|
|
7821
|
+
reason: "no_output" | "invalid_output" | "stopped" | "cancelled" | "parent_cancelled" | "lost" | "timeout" | "output_limit" | null;
|
|
7759
7822
|
result: unknown;
|
|
7760
7823
|
waits: Array<{
|
|
7761
7824
|
kind: "approval" | "client_tool";
|
|
@@ -9745,6 +9808,9 @@ declare const manifestAgentSchema: z.ZodObject<{
|
|
|
9745
9808
|
refuse: "refuse";
|
|
9746
9809
|
queue: "queue";
|
|
9747
9810
|
}>>;
|
|
9811
|
+
a2a: z.ZodDefault<z.ZodBoolean>;
|
|
9812
|
+
a2aPushHostnames: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
9813
|
+
description: z.ZodDefault<z.ZodString>;
|
|
9748
9814
|
defaultLocale: z.ZodDefault<z.ZodEnum<{
|
|
9749
9815
|
en: "en";
|
|
9750
9816
|
ar: "ar";
|
|
@@ -9875,6 +9941,9 @@ declare const manifestSchema: z.ZodObject<{
|
|
|
9875
9941
|
refuse: "refuse";
|
|
9876
9942
|
queue: "queue";
|
|
9877
9943
|
}>>;
|
|
9944
|
+
a2a: z.ZodDefault<z.ZodBoolean>;
|
|
9945
|
+
a2aPushHostnames: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
9946
|
+
description: z.ZodDefault<z.ZodString>;
|
|
9878
9947
|
defaultLocale: z.ZodDefault<z.ZodEnum<{
|
|
9879
9948
|
en: "en";
|
|
9880
9949
|
ar: "ar";
|
|
@@ -11020,6 +11089,9 @@ export declare function defineManifest(manifest: Manifest): {
|
|
|
11020
11089
|
media?: ("map" | "mermaid" | "vega-lite" | "report")[] | undefined;
|
|
11021
11090
|
messages?: boolean | undefined;
|
|
11022
11091
|
whileBusy?: "steer" | "refuse" | "queue" | undefined;
|
|
11092
|
+
a2a?: boolean | undefined;
|
|
11093
|
+
a2aPushHostnames?: string[] | undefined;
|
|
11094
|
+
description?: string | undefined;
|
|
11023
11095
|
defaultLocale?: "en" | "ar" | undefined;
|
|
11024
11096
|
context?: {
|
|
11025
11097
|
maxContextTokens?: number | undefined;
|
package/dist/index.js
CHANGED
|
@@ -13424,7 +13424,8 @@ var RUN_REASONS = [
|
|
|
13424
13424
|
"cancelled",
|
|
13425
13425
|
"parent_cancelled",
|
|
13426
13426
|
"lost",
|
|
13427
|
-
"timeout"
|
|
13427
|
+
"timeout",
|
|
13428
|
+
"output_limit"
|
|
13428
13429
|
];
|
|
13429
13430
|
var INPUT_DELIVERIES = ["prompt", "steer", "followUp", "answer", "note"];
|
|
13430
13431
|
var INPUT_REFUSALS = [
|
|
@@ -13485,17 +13486,22 @@ var runAnswerSchema = z.object({
|
|
|
13485
13486
|
// ../../internal/contracts/src/triggers/index.ts
|
|
13486
13487
|
import { z as z2 } from "zod";
|
|
13487
13488
|
var TRIGGER_ANSWER_TOOL_NAME = "submitAnswer";
|
|
13488
|
-
|
|
13489
|
-
|
|
13489
|
+
var environmentAddressSchema = z2.object({
|
|
13490
|
+
org: z2.string(),
|
|
13491
|
+
project: z2.string(),
|
|
13492
|
+
environment: z2.string()
|
|
13493
|
+
});
|
|
13494
|
+
function environmentRoute({ org, project, environment }) {
|
|
13495
|
+
return `/orgs/${encodeURIComponent(org)}/projects/${encodeURIComponent(project)}/envs/${encodeURIComponent(environment)}`;
|
|
13490
13496
|
}
|
|
13491
|
-
function agentRoute(
|
|
13492
|
-
return `${
|
|
13497
|
+
function agentRoute(address, agentName) {
|
|
13498
|
+
return `${environmentRoute(address)}/agents/${encodeURIComponent(agentName)}`;
|
|
13493
13499
|
}
|
|
13494
|
-
function triggerRoute(
|
|
13495
|
-
return `${agentRoute(
|
|
13500
|
+
function triggerRoute(address, agentName, name) {
|
|
13501
|
+
return `${agentRoute(address, agentName)}/triggers/${encodeURIComponent(name)}`;
|
|
13496
13502
|
}
|
|
13497
|
-
function runRoute(
|
|
13498
|
-
return `${agentRoute(
|
|
13503
|
+
function runRoute(address, agentName, runId) {
|
|
13504
|
+
return `${agentRoute(address, agentName)}/runs/${encodeURIComponent(runId)}`;
|
|
13499
13505
|
}
|
|
13500
13506
|
var fireStartedSchema = z2.object({
|
|
13501
13507
|
inputId: z2.uuid(),
|
|
@@ -13961,7 +13967,7 @@ function createTriggerClient(config) {
|
|
|
13961
13967
|
return secret;
|
|
13962
13968
|
}
|
|
13963
13969
|
function runPath(runId) {
|
|
13964
|
-
return runRoute(config
|
|
13970
|
+
return runRoute(config, config.agent, runId);
|
|
13965
13971
|
}
|
|
13966
13972
|
async function send(trigger, path, init, parse, acceptedErrors = []) {
|
|
13967
13973
|
const headers = new Headers(init.headers);
|
|
@@ -13995,7 +14001,7 @@ function createTriggerClient(config) {
|
|
|
13995
14001
|
}
|
|
13996
14002
|
return {
|
|
13997
14003
|
async fire(trigger, payload, options = {}) {
|
|
13998
|
-
return await post(trigger, triggerRoute(config
|
|
14004
|
+
return await post(trigger, triggerRoute(config, config.agent, trigger), payload, options);
|
|
13999
14005
|
},
|
|
14000
14006
|
async answer(trigger, runId, decision, options = {}) {
|
|
14001
14007
|
return await post(trigger, `${runPath(runId)}/answer`, runAnswerSchema.parse(decision), options);
|
|
@@ -14013,7 +14019,7 @@ function createTriggerClient(config) {
|
|
|
14013
14019
|
if (options.before !== undefined)
|
|
14014
14020
|
query.set("before", options.before);
|
|
14015
14021
|
const suffix = query.size ? `?${query.toString()}` : "";
|
|
14016
|
-
return await send(trigger, `${triggerRoute(config
|
|
14022
|
+
return await send(trigger, `${triggerRoute(config, config.agent, trigger)}/runs${suffix}`, { method: "GET", signal: options.signal }, (answer) => runListSchema.parse(answer));
|
|
14017
14023
|
},
|
|
14018
14024
|
async cancel(trigger, runId, options = {}) {
|
|
14019
14025
|
return await send(trigger, `${runPath(runId)}/cancel`, { method: "POST", signal: options.signal }, (answer) => runCancelSchema.parse(answer));
|
|
@@ -14071,7 +14077,6 @@ var managementProcedureKinds = {
|
|
|
14071
14077
|
"documents.prepareUpload": "mutation",
|
|
14072
14078
|
"documents.remove": "mutation",
|
|
14073
14079
|
"documents.retry": "mutation",
|
|
14074
|
-
"managementKeys.list": "query",
|
|
14075
14080
|
"managementKeys.mine": "query",
|
|
14076
14081
|
"manifests.preview": "mutation",
|
|
14077
14082
|
"manifests.sync": "mutation",
|
|
@@ -14111,11 +14116,15 @@ var managementProcedureKinds = {
|
|
|
14111
14116
|
"observability.updateSchemaDrift": "mutation",
|
|
14112
14117
|
"orgs.create": "mutation",
|
|
14113
14118
|
"orgs.delete": "mutation",
|
|
14119
|
+
"orgs.deleteEnvironment": "mutation",
|
|
14120
|
+
"orgs.deleteProject": "mutation",
|
|
14114
14121
|
"orgs.inviteOwner": "mutation",
|
|
14115
14122
|
"orgs.list": "query",
|
|
14116
14123
|
"orgs.options": "query",
|
|
14124
|
+
"orgs.rename": "mutation",
|
|
14117
14125
|
"orgs.restore": "mutation",
|
|
14118
14126
|
"orgs.suspend": "mutation",
|
|
14127
|
+
"orgs.updateProject": "mutation",
|
|
14119
14128
|
"publishing.exclusive": "query",
|
|
14120
14129
|
"publishing.history": "query",
|
|
14121
14130
|
"publishing.latest": "query",
|
|
@@ -14413,6 +14422,7 @@ function overridable(fields) {
|
|
|
14413
14422
|
}
|
|
14414
14423
|
var HOSTNAME_PATTERN = /^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?(\.[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/;
|
|
14415
14424
|
var FETCH_IMAGE_HOSTS_LIMIT = 20;
|
|
14425
|
+
var A2A_PUSH_HOSTS_LIMIT = 20;
|
|
14416
14426
|
var SUGGESTION_LIMITS = { perLocale: 6, titleLength: 120, promptLength: 2000 };
|
|
14417
14427
|
var trimmedText = (max) => z7.string().min(1).max(max).refine((text) => text === text.trim(), "text has surrounding whitespace");
|
|
14418
14428
|
var suggestionsSchema = z7.record(localeSchema, z7.array(z7.object({
|
|
@@ -15262,6 +15272,9 @@ var agentSettingsSchema = z7.strictObject({
|
|
|
15262
15272
|
media: z7.array(z7.enum(MEDIA_FORMS)).default([...DEFAULT_MEDIA_FORMS]),
|
|
15263
15273
|
messages: z7.boolean().default(true),
|
|
15264
15274
|
whileBusy: z7.enum(WHILE_BUSY).default("refuse"),
|
|
15275
|
+
a2a: z7.boolean().default(false),
|
|
15276
|
+
a2aPushHostnames: z7.array(z7.string().max(253).regex(HOSTNAME_PATTERN)).max(A2A_PUSH_HOSTS_LIMIT).default([]),
|
|
15277
|
+
description: z7.string().trim().max(1000).default(""),
|
|
15265
15278
|
defaultLocale: localeSchema.default(BASE_LOCALE),
|
|
15266
15279
|
context: z7.strictObject({
|
|
15267
15280
|
maxContextTokens: setting(agentContext.maxContextTokens),
|
package/package.json
CHANGED