@datalayer/agent-runtimes 1.5.9 → 1.5.10
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/dist-embed/datalayer-app-main.js +7 -7
- package/lib/apps/apps/appspec.d.ts +2 -2
- package/lib/apps/apps/appspec.js +47 -1
- package/lib/apps/embed/embeddedSecrets.d.ts +16 -0
- package/lib/apps/embed/embeddedSecrets.js +34 -0
- package/lib/specs/actions.js +12 -0
- package/lib/specs/apps.d.ts +3 -0
- package/lib/specs/apps.js +651 -0
- package/lib/specs/appspecSchema.js +76 -1
- package/lib/specs/protocols.js +3 -2
- package/lib/types/agentspecs.d.ts +33 -1
- package/package.json +1 -1
- package/scripts/codegen/generate_apps.py +2 -2
- package/scripts/codegen/generate_protocols.py +1 -1
|
@@ -106,9 +106,9 @@ export declare function uiProblems(app: Pick<AppSpec, 'ui' | 'enabled'>): string
|
|
|
106
106
|
* What is wrong with the protocols an application says it speaks
|
|
107
107
|
* (AGENT_PROTOCOLS PS-02), as agentspecs says it: an id the catalogue does not
|
|
108
108
|
* know or said twice, a planned protocol while it is offered, and a `pap`,
|
|
109
|
-
* `pact` or `
|
|
109
|
+
* `pact`, `a2a` or `signed_fetch` block configuring a protocol it does not list.
|
|
110
110
|
*/
|
|
111
|
-
export declare function protocolsProblems(app: Pick<AppSpec, 'protocols' | 'enabled' | 'pap' | 'pact' | 'a2a' | 'commerce'>): string[];
|
|
111
|
+
export declare function protocolsProblems(app: Pick<AppSpec, 'protocols' | 'enabled' | 'pap' | 'pact' | 'a2a' | 'commerce' | 'signed_fetch'>): string[];
|
|
112
112
|
/**
|
|
113
113
|
* An application as the document its file holds.
|
|
114
114
|
*
|
package/lib/apps/apps/appspec.js
CHANGED
|
@@ -205,6 +205,8 @@ const KNOWN_KEYS = [
|
|
|
205
205
|
'pap',
|
|
206
206
|
'pact',
|
|
207
207
|
'commerce',
|
|
208
|
+
'signed_fetch',
|
|
209
|
+
'pair',
|
|
208
210
|
'a2a',
|
|
209
211
|
'rules',
|
|
210
212
|
'permissions',
|
|
@@ -443,6 +445,35 @@ function dumpCommerce(commerce) {
|
|
|
443
445
|
}
|
|
444
446
|
: {}).data)).data;
|
|
445
447
|
}
|
|
448
|
+
/** Signed fetch (AGENT_PROTOCOLS EX-11): the exact sites it reads pages of, each request signed. */
|
|
449
|
+
function parseSignedFetch(data) {
|
|
450
|
+
return {
|
|
451
|
+
sites: records(data.sites).map(site => ({
|
|
452
|
+
id: text(site.id),
|
|
453
|
+
site: text(site.site),
|
|
454
|
+
})),
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
/** Signed fetch as its document says it, nothing at its default. */
|
|
458
|
+
function dumpSignedFetch(signedFetch) {
|
|
459
|
+
if (!signedFetch)
|
|
460
|
+
return {};
|
|
461
|
+
return new Writer().list('sites', signedFetch.sites.map(site => new Writer()
|
|
462
|
+
.text('id', site.id, '\u0000')
|
|
463
|
+
.text('site', site.site, '\u0000').data)).data;
|
|
464
|
+
}
|
|
465
|
+
/** One of a pair of examples (AGENT_PROTOCOLS PR-13): its id and its side, or a problem. */
|
|
466
|
+
function parsePair(data) {
|
|
467
|
+
const id = text(data.id);
|
|
468
|
+
const role = text(data.role);
|
|
469
|
+
if (!/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/.test(id)) {
|
|
470
|
+
return `A pair's id is lower-case letters, digits and hyphens: ${JSON.stringify(id)}.`;
|
|
471
|
+
}
|
|
472
|
+
if (role !== 'business' && role !== 'personal_agent') {
|
|
473
|
+
return `One of a pair is its business or its personal_agent, not ${JSON.stringify(role)}.`;
|
|
474
|
+
}
|
|
475
|
+
return { id, role };
|
|
476
|
+
}
|
|
446
477
|
/** PACT as its document says it, nothing at its default. */
|
|
447
478
|
function dumpPact(pact) {
|
|
448
479
|
if (!pact)
|
|
@@ -1047,6 +1078,18 @@ export function parseAppspec(document) {
|
|
|
1047
1078
|
if (isData(data.commerce)) {
|
|
1048
1079
|
app.commerce = parseCommerce(data.commerce);
|
|
1049
1080
|
}
|
|
1081
|
+
if (isData(data.signed_fetch)) {
|
|
1082
|
+
app.signed_fetch = parseSignedFetch(data.signed_fetch);
|
|
1083
|
+
}
|
|
1084
|
+
if (isData(data.pair)) {
|
|
1085
|
+
const pair = parsePair(data.pair);
|
|
1086
|
+
if (typeof pair === 'string') {
|
|
1087
|
+
problems.push(pair);
|
|
1088
|
+
}
|
|
1089
|
+
else {
|
|
1090
|
+
app.pair = pair;
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1050
1093
|
if (isData(data.a2a)) {
|
|
1051
1094
|
app.a2a = parseA2A(data.a2a);
|
|
1052
1095
|
}
|
|
@@ -1081,7 +1124,7 @@ export function uiProblems(app) {
|
|
|
1081
1124
|
* What is wrong with the protocols an application says it speaks
|
|
1082
1125
|
* (AGENT_PROTOCOLS PS-02), as agentspecs says it: an id the catalogue does not
|
|
1083
1126
|
* know or said twice, a planned protocol while it is offered, and a `pap`,
|
|
1084
|
-
* `pact` or `
|
|
1127
|
+
* `pact`, `a2a` or `signed_fetch` block configuring a protocol it does not list.
|
|
1085
1128
|
*/
|
|
1086
1129
|
export function protocolsProblems(app) {
|
|
1087
1130
|
const problems = [];
|
|
@@ -1105,6 +1148,7 @@ export function protocolsProblems(app) {
|
|
|
1105
1148
|
pact: Boolean(app.pact &&
|
|
1106
1149
|
(app.pact.connections.length > 0 || app.pact.business?.enabled)),
|
|
1107
1150
|
a2a: Boolean(app.a2a && app.a2a.extensions.length > 0),
|
|
1151
|
+
signed_fetch: Boolean(app.signed_fetch && app.signed_fetch.sites.length > 0),
|
|
1108
1152
|
};
|
|
1109
1153
|
for (const spec of Object.values(PROTOCOL_CATALOGUE)) {
|
|
1110
1154
|
const block = spec.appspecBlock;
|
|
@@ -1386,6 +1430,8 @@ export function dumpAppspec(app) {
|
|
|
1386
1430
|
.part('pap', dumpPap(app.pap))
|
|
1387
1431
|
.part('pact', dumpPact(app.pact))
|
|
1388
1432
|
.part('commerce', dumpCommerce(app.commerce))
|
|
1433
|
+
.part('signed_fetch', dumpSignedFetch(app.signed_fetch))
|
|
1434
|
+
.part('pair', app.pair ? { id: app.pair.id, role: app.pair.role } : {})
|
|
1389
1435
|
.part('a2a', dumpA2A(app.a2a))
|
|
1390
1436
|
.list('rules', app.rules.map(rule => ({
|
|
1391
1437
|
action: rule.action,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What no file the embed ships may hold (PAP_DATALAYER B-02): the PAP SDK's
|
|
3
|
+
* emitted-bundle test (`src/__tests__/canaries.test.mjs`, `EMBEDDED_SECRETS`)
|
|
4
|
+
* extended to the embed, a browser artifact anybody's page loads. Its build
|
|
5
|
+
* fails on a file holding one (`vite.embed.config.ts`), naming the kind and
|
|
6
|
+
* the file, never what matched.
|
|
7
|
+
*
|
|
8
|
+
* Found 2026-10-13: the embed then served at datalayer.ai held the builder's
|
|
9
|
+
* Datalayer API key, because `import.meta.env` read whole (`env?.VITE_…`) is
|
|
10
|
+
* every `VITE_` variable of the environment it was built in.
|
|
11
|
+
*
|
|
12
|
+
* @module apps/embed/embeddedSecrets
|
|
13
|
+
*/
|
|
14
|
+
export declare const EMBEDDED_SECRETS: ReadonlyArray<readonly [string, RegExp]>;
|
|
15
|
+
/** The kinds of secret a file's text holds, by name: empty when none. */
|
|
16
|
+
export declare function secretsIn(text: string): string[];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* What no file the embed ships may hold (PAP_DATALAYER B-02): the PAP SDK's
|
|
7
|
+
* emitted-bundle test (`src/__tests__/canaries.test.mjs`, `EMBEDDED_SECRETS`)
|
|
8
|
+
* extended to the embed, a browser artifact anybody's page loads. Its build
|
|
9
|
+
* fails on a file holding one (`vite.embed.config.ts`), naming the kind and
|
|
10
|
+
* the file, never what matched.
|
|
11
|
+
*
|
|
12
|
+
* Found 2026-10-13: the embed then served at datalayer.ai held the builder's
|
|
13
|
+
* Datalayer API key, because `import.meta.env` read whole (`env?.VITE_…`) is
|
|
14
|
+
* every `VITE_` variable of the environment it was built in.
|
|
15
|
+
*
|
|
16
|
+
* @module apps/embed/embeddedSecrets
|
|
17
|
+
*/
|
|
18
|
+
export const EMBEDDED_SECRETS = [
|
|
19
|
+
// Key material after the header: a library may name the header to refuse it.
|
|
20
|
+
[
|
|
21
|
+
'a PEM private key',
|
|
22
|
+
/-----BEGIN [A-Z ]*PRIVATE KEY-----(?:\\n|\s)*[A-Za-z0-9+/=]{40,}/,
|
|
23
|
+
],
|
|
24
|
+
['a private JWK member', /["']d["']\s*:\s*["'][A-Za-z0-9_-]{32,}["']/],
|
|
25
|
+
[
|
|
26
|
+
'a compact JWT',
|
|
27
|
+
/eyJ[A-Za-z0-9_-]{10,}\.eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/,
|
|
28
|
+
],
|
|
29
|
+
['a Bearer or DPoP token', /(?:Bearer|DPoP) [A-Za-z0-9_-]{20,}/],
|
|
30
|
+
];
|
|
31
|
+
/** The kinds of secret a file's text holds, by name: empty when none. */
|
|
32
|
+
export function secretsIn(text) {
|
|
33
|
+
return EMBEDDED_SECRETS.filter(([, pattern]) => pattern.test(text)).map(([kind]) => kind);
|
|
34
|
+
}
|
package/lib/specs/actions.js
CHANGED
|
@@ -704,6 +704,12 @@ export const PROTOCOL_TOOL_CLASSES = {
|
|
|
704
704
|
pap_disconnect: ['write'],
|
|
705
705
|
},
|
|
706
706
|
},
|
|
707
|
+
'signed-fetch': {
|
|
708
|
+
connection: 'signed-fetch',
|
|
709
|
+
tools: {
|
|
710
|
+
signed_fetch: ['read'],
|
|
711
|
+
},
|
|
712
|
+
},
|
|
707
713
|
ucp: {
|
|
708
714
|
connection: 'ucp',
|
|
709
715
|
tools: {
|
|
@@ -793,8 +799,10 @@ export const APP_BEHAVIOURS = {
|
|
|
793
799
|
'earthdata.search_earth_datagranules': 'do_it',
|
|
794
800
|
'earthdata.search_earth_datasets': 'do_it',
|
|
795
801
|
},
|
|
802
|
+
'errand-runner': {},
|
|
796
803
|
'event-response': {},
|
|
797
804
|
'exchange-desk': {},
|
|
805
|
+
'guest-desk': {},
|
|
798
806
|
'inbox-triage': {
|
|
799
807
|
'google-workspace.append_table_rows': 'leave_to_me',
|
|
800
808
|
'google-workspace.batch_modify_gmail_message_labels': 'do_it',
|
|
@@ -981,6 +989,7 @@ export const APP_BEHAVIOURS = {
|
|
|
981
989
|
'shop-concierge': {},
|
|
982
990
|
'shopping-desk': {},
|
|
983
991
|
'sign-in-desk': {},
|
|
992
|
+
'signed-reader': {},
|
|
984
993
|
'supplier-comparison': {},
|
|
985
994
|
'support-desk': {},
|
|
986
995
|
'travel-desk': {},
|
|
@@ -1005,8 +1014,10 @@ export const APP_ESCALATIONS = {
|
|
|
1005
1014
|
'data-quality': {},
|
|
1006
1015
|
decide: {},
|
|
1007
1016
|
'disaster-assessment': {},
|
|
1017
|
+
'errand-runner': {},
|
|
1008
1018
|
'event-response': {},
|
|
1009
1019
|
'exchange-desk': {},
|
|
1020
|
+
'guest-desk': {},
|
|
1010
1021
|
'inbox-triage': {
|
|
1011
1022
|
'google-workspace.batch_modify_gmail_message_labels': [
|
|
1012
1023
|
{
|
|
@@ -1055,6 +1066,7 @@ export const APP_ESCALATIONS = {
|
|
|
1055
1066
|
'shop-concierge': {},
|
|
1056
1067
|
'shopping-desk': {},
|
|
1057
1068
|
'sign-in-desk': {},
|
|
1069
|
+
'signed-reader': {},
|
|
1058
1070
|
'supplier-comparison': {},
|
|
1059
1071
|
'support-desk': {},
|
|
1060
1072
|
'travel-desk': {},
|
package/lib/specs/apps.d.ts
CHANGED
|
@@ -16,8 +16,10 @@ export declare const CUSTOMER_INTERVIEW_APP_0_0_1: AppSpec;
|
|
|
16
16
|
export declare const DATA_QUALITY_APP_0_0_1: AppSpec;
|
|
17
17
|
export declare const DECIDE_APP_0_0_1: AppSpec;
|
|
18
18
|
export declare const DISASTER_ASSESSMENT_APP_0_0_1: AppSpec;
|
|
19
|
+
export declare const ERRAND_RUNNER_APP_0_0_1: AppSpec;
|
|
19
20
|
export declare const EVENT_RESPONSE_APP_0_0_1: AppSpec;
|
|
20
21
|
export declare const EXCHANGE_DESK_APP_0_0_1: AppSpec;
|
|
22
|
+
export declare const GUEST_DESK_APP_0_0_1: AppSpec;
|
|
21
23
|
export declare const INBOX_TRIAGE_APP_0_0_1: AppSpec;
|
|
22
24
|
export declare const LIVE_SHOP_CHAT_APP_0_0_1: AppSpec;
|
|
23
25
|
export declare const MODEL_CHOICE_APP_0_0_1: AppSpec;
|
|
@@ -33,6 +35,7 @@ export declare const SHIP_OR_FIX_APP_0_0_1: AppSpec;
|
|
|
33
35
|
export declare const SHOP_CONCIERGE_APP_0_0_1: AppSpec;
|
|
34
36
|
export declare const SHOPPING_DESK_APP_0_0_1: AppSpec;
|
|
35
37
|
export declare const SIGN_IN_DESK_APP_0_0_1: AppSpec;
|
|
38
|
+
export declare const SIGNED_READER_APP_0_0_1: AppSpec;
|
|
36
39
|
export declare const SUPPLIER_COMPARISON_APP_0_0_1: AppSpec;
|
|
37
40
|
export declare const SUPPORT_DESK_APP_0_0_1: AppSpec;
|
|
38
41
|
export declare const TRAVEL_DESK_APP_0_0_1: AppSpec;
|