@datalayer/agent-runtimes 1.3.113 → 1.3.114
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 +2 -2
- package/lib/apps/apps/appspec.js +54 -0
- package/lib/protocols/agentic-commerce/index.d.ts +5 -9
- package/lib/protocols/agentic-commerce/index.js +6 -10
- package/lib/protocols/commerce.d.ts +8 -9
- package/lib/protocols/commerce.js +29 -0
- package/lib/protocols/ucp/index.d.ts +5 -10
- package/lib/protocols/ucp/index.js +6 -11
- package/lib/specs/actions.d.ts +8 -0
- package/lib/specs/actions.js +56 -0
- package/lib/specs/apps.d.ts +1 -0
- package/lib/specs/apps.js +225 -0
- package/lib/specs/appspecSchema.js +109 -0
- package/lib/types/agentspecs.d.ts +21 -0
- package/package.json +1 -1
- package/scripts/codegen/generate_apps.py +38 -1
|
@@ -28,6 +28,54 @@ export const APPSPEC_SCHEMA = {
|
|
|
28
28
|
title: 'ActsAs',
|
|
29
29
|
type: 'string',
|
|
30
30
|
},
|
|
31
|
+
AppA2A: {
|
|
32
|
+
additionalProperties: false,
|
|
33
|
+
description: "A2A: what the application's Agent Card says beside its name and skill (AGENT_PROTOCOLS PR-02).",
|
|
34
|
+
properties: {
|
|
35
|
+
extensions: {
|
|
36
|
+
description: "Extensions its card advertises, besides the runtime's own",
|
|
37
|
+
items: {
|
|
38
|
+
$ref: '#/$defs/AppA2AExtension',
|
|
39
|
+
},
|
|
40
|
+
title: 'Extensions',
|
|
41
|
+
type: 'array',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
title: 'AppA2A',
|
|
45
|
+
type: 'object',
|
|
46
|
+
},
|
|
47
|
+
AppA2AExtension: {
|
|
48
|
+
additionalProperties: false,
|
|
49
|
+
description: "An A2A extension the application's Agent Card advertises (A2A 1.0\n*Extensions*, AGENT_PROTOCOLS PR-02), beside the runtime's own.\n\nNamed by its URI, as `capabilities.extensions` writes it; its params are\npublished on the card as they are, so they never hold a credential.\nDatalayer's own extensions (orchestration, the face) are the runtime's,\nnever declared here.",
|
|
50
|
+
properties: {
|
|
51
|
+
uri: {
|
|
52
|
+
description: "The extension's URI: `https://example.com/ext/gift-wrap/v1`",
|
|
53
|
+
title: 'Uri',
|
|
54
|
+
type: 'string',
|
|
55
|
+
},
|
|
56
|
+
description: {
|
|
57
|
+
default: '',
|
|
58
|
+
description: 'What it adds, for whoever reads the card',
|
|
59
|
+
title: 'Description',
|
|
60
|
+
type: 'string',
|
|
61
|
+
},
|
|
62
|
+
required: {
|
|
63
|
+
default: false,
|
|
64
|
+
description: 'Whether a client must support it to talk to the application at all',
|
|
65
|
+
title: 'Required',
|
|
66
|
+
type: 'boolean',
|
|
67
|
+
},
|
|
68
|
+
params: {
|
|
69
|
+
additionalProperties: true,
|
|
70
|
+
description: 'Its parameters on the card, as the extension defines them; public',
|
|
71
|
+
title: 'Params',
|
|
72
|
+
type: 'object',
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
required: ['uri'],
|
|
76
|
+
title: 'AppA2AExtension',
|
|
77
|
+
type: 'object',
|
|
78
|
+
},
|
|
31
79
|
AppChecks: {
|
|
32
80
|
additionalProperties: false,
|
|
33
81
|
description: "Optional: checks from the catalogue, for a builder who wants them — and its code's own.",
|
|
@@ -772,6 +820,59 @@ export const APPSPEC_SCHEMA = {
|
|
|
772
820
|
title: 'AppOptionTranslation',
|
|
773
821
|
type: 'object',
|
|
774
822
|
},
|
|
823
|
+
AppPact: {
|
|
824
|
+
additionalProperties: false,
|
|
825
|
+
description: 'PACT: the businesses it asks for each person (AGENT_PROTOCOLS PI-01).',
|
|
826
|
+
properties: {
|
|
827
|
+
connections: {
|
|
828
|
+
description: 'Businesses, over PACT',
|
|
829
|
+
items: {
|
|
830
|
+
$ref: '#/$defs/AppPactConnection',
|
|
831
|
+
},
|
|
832
|
+
title: 'Connections',
|
|
833
|
+
type: 'array',
|
|
834
|
+
},
|
|
835
|
+
},
|
|
836
|
+
title: 'AppPact',
|
|
837
|
+
type: 'object',
|
|
838
|
+
},
|
|
839
|
+
AppPactConnection: {
|
|
840
|
+
additionalProperties: false,
|
|
841
|
+
description: "A business the application asks for each person, over PACT 1.0 (AGENT_PROTOCOLS PI-01).\n\nThe Brand is named by its domain — its Agent Card is at\n`https://<brand>/.well-known/agent-card.json` (PACT §2.1) — and its\nProvider's `audience`, which the Provider assigns at registration and\nthe personal-agent JWT carries (§3.1). Always in each person's own name:\nPACT acts for a person. No credential is ever part of a spec.",
|
|
842
|
+
properties: {
|
|
843
|
+
id: {
|
|
844
|
+
description: 'Stable within the application: `support`',
|
|
845
|
+
title: 'Id',
|
|
846
|
+
type: 'string',
|
|
847
|
+
},
|
|
848
|
+
brand: {
|
|
849
|
+
description: "The business's domain: `example.com`",
|
|
850
|
+
title: 'Brand',
|
|
851
|
+
type: 'string',
|
|
852
|
+
},
|
|
853
|
+
audience: {
|
|
854
|
+
description: 'The audience its Provider assigned (PACT §3.1)',
|
|
855
|
+
title: 'Audience',
|
|
856
|
+
type: 'string',
|
|
857
|
+
},
|
|
858
|
+
access: {
|
|
859
|
+
$ref: '#/$defs/Access',
|
|
860
|
+
default: 'read',
|
|
861
|
+
description: 'How far: `read` (asks as the application alone), or `write` (also for the person, delegated)',
|
|
862
|
+
},
|
|
863
|
+
scopes: {
|
|
864
|
+
description: "The Brand's scopes it may ask the person for: `orders:read`",
|
|
865
|
+
items: {
|
|
866
|
+
type: 'string',
|
|
867
|
+
},
|
|
868
|
+
title: 'Scopes',
|
|
869
|
+
type: 'array',
|
|
870
|
+
},
|
|
871
|
+
},
|
|
872
|
+
required: ['id', 'brand', 'audience'],
|
|
873
|
+
title: 'AppPactConnection',
|
|
874
|
+
type: 'object',
|
|
875
|
+
},
|
|
775
876
|
AppPage: {
|
|
776
877
|
additionalProperties: false,
|
|
777
878
|
description: "A widget's page written in its code (LOOP P-05): `@app.page`.\n\nIts inputs are a form, drawn on the page; as one changes, the function\nof its code runs again on them and the page shows what it returned, in\nplace. Without its file nothing runs it, and validation says so.",
|
|
@@ -2170,6 +2271,14 @@ export const APPSPEC_SCHEMA = {
|
|
|
2170
2271
|
$ref: '#/$defs/AppPap',
|
|
2171
2272
|
description: 'Personal Agent Protocol: companies it works with, or being one',
|
|
2172
2273
|
},
|
|
2274
|
+
pact: {
|
|
2275
|
+
$ref: '#/$defs/AppPact',
|
|
2276
|
+
description: 'PACT: businesses it asks for each person',
|
|
2277
|
+
},
|
|
2278
|
+
a2a: {
|
|
2279
|
+
$ref: '#/$defs/AppA2A',
|
|
2280
|
+
description: 'A2A: the extensions its Agent Card advertises',
|
|
2281
|
+
},
|
|
2173
2282
|
rules: {
|
|
2174
2283
|
description: 'When it acts alone, and when it asks',
|
|
2175
2284
|
items: {
|
|
@@ -507,6 +507,25 @@ export interface AppPactConnectionSpec {
|
|
|
507
507
|
export interface AppPactSpec {
|
|
508
508
|
connections: AppPactConnectionSpec[];
|
|
509
509
|
}
|
|
510
|
+
/**
|
|
511
|
+
* An A2A extension the application's Agent Card advertises, beside the
|
|
512
|
+
* runtime's own (AGENT_PROTOCOLS PR-02). Its params are public: never a
|
|
513
|
+
* credential.
|
|
514
|
+
*/
|
|
515
|
+
export interface AppA2AExtensionSpec {
|
|
516
|
+
/** The extension's URI: an `https://` URL or a `urn:`. */
|
|
517
|
+
uri: string;
|
|
518
|
+
/** What it adds, for whoever reads the card. */
|
|
519
|
+
description: string;
|
|
520
|
+
/** Whether a client must support it to talk to the application at all. */
|
|
521
|
+
required: boolean;
|
|
522
|
+
/** Its parameters on the card, as the extension defines them. */
|
|
523
|
+
params: Record<string, unknown>;
|
|
524
|
+
}
|
|
525
|
+
/** A2A: the extensions its Agent Card advertises. */
|
|
526
|
+
export interface AppA2ASpec {
|
|
527
|
+
extensions: AppA2AExtensionSpec[];
|
|
528
|
+
}
|
|
510
529
|
/** When an application acts alone, and when it asks. */
|
|
511
530
|
export interface AppRuleSpec {
|
|
512
531
|
/** The action, in the words a person reads. */
|
|
@@ -1067,6 +1086,8 @@ export interface AppSpec {
|
|
|
1067
1086
|
pap?: AppPapSpec;
|
|
1068
1087
|
/** PACT: the businesses it asks for each person (AGENT_PROTOCOLS PI-01). */
|
|
1069
1088
|
pact?: AppPactSpec;
|
|
1089
|
+
/** A2A: the extensions its Agent Card advertises (AGENT_PROTOCOLS PR-02). */
|
|
1090
|
+
a2a?: AppA2ASpec;
|
|
1070
1091
|
rules: AppRuleSpec[];
|
|
1071
1092
|
permissions: AppPermissionsSpec;
|
|
1072
1093
|
interface: AppInterfaceSpec;
|
package/package.json
CHANGED
|
@@ -152,8 +152,16 @@ def load_specs(specs_dir: Path) -> tuple[list[dict[str, Any]], dict[str, Any]]:
|
|
|
152
152
|
# Personal Agent Protocol only when the application says something of it:
|
|
153
153
|
# an Appspec that does not mention `pap` reads back with none (the TypeScript
|
|
154
154
|
# reader's rule), so the catalogue leaves the defaults out too.
|
|
155
|
-
if "pap" in spec and spec["pap"] == type(app.pap)().model_dump(
|
|
155
|
+
if "pap" in spec and spec["pap"] == type(app.pap)().model_dump(
|
|
156
|
+
mode="json", by_alias=True
|
|
157
|
+
):
|
|
156
158
|
spec.pop("pap")
|
|
159
|
+
# PACT and A2A's extensions the same way (AGENT_PROTOCOLS PI-01, PR-02).
|
|
160
|
+
for block in ("pact", "a2a"):
|
|
161
|
+
if block in spec and spec[block] == type(getattr(app, block))().model_dump(
|
|
162
|
+
mode="json", by_alias=True
|
|
163
|
+
):
|
|
164
|
+
spec.pop(block)
|
|
157
165
|
for key in ("description", "instructions", "goal"):
|
|
158
166
|
spec[key] = _flat(spec.get(key))
|
|
159
167
|
spec["interface"]["welcome"] = _flat(spec["interface"].get("welcome"))
|
|
@@ -198,8 +206,24 @@ def load_specs(specs_dir: Path) -> tuple[list[dict[str, Any]], dict[str, Any]]:
|
|
|
198
206
|
if (signs := actions_module.server_tool_signs(server, name))
|
|
199
207
|
},
|
|
200
208
|
}
|
|
209
|
+
# The agent protocols' tools (AGENT_PROTOCOLS PR-54): by protocol, the
|
|
210
|
+
# connection prefix its connections take and what each tool can do.
|
|
211
|
+
protocols = {
|
|
212
|
+
identity: {
|
|
213
|
+
"connection": spec["connection"],
|
|
214
|
+
"tools": {
|
|
215
|
+
name: [
|
|
216
|
+
item.value
|
|
217
|
+
for item in actions_module.protocol_tool_classes(identity, name)
|
|
218
|
+
]
|
|
219
|
+
for name in actions_module.protocol_tool_names(identity)
|
|
220
|
+
},
|
|
221
|
+
}
|
|
222
|
+
for identity, spec in sorted(actions_module.protocol_tool_specs().items())
|
|
223
|
+
}
|
|
201
224
|
actions = {
|
|
202
225
|
"classes": [item.value for item in actions_module.ActionClass],
|
|
226
|
+
"protocols": protocols,
|
|
203
227
|
"tools": tools,
|
|
204
228
|
"servers": servers,
|
|
205
229
|
"behaviours": behaviours,
|
|
@@ -419,6 +443,10 @@ def generate_actions_python_code(actions: dict[str, Any]) -> str:
|
|
|
419
443
|
[
|
|
420
444
|
"}",
|
|
421
445
|
"",
|
|
446
|
+
"#: What each agent protocol's tools do, by protocol id: the prefix its",
|
|
447
|
+
"#: connections take (`pap:<domain>`) and each tool's classes (PR-54).",
|
|
448
|
+
f"PROTOCOL_TOOL_CLASSES: Dict[str, Dict[str, Any]] = {actions['protocols']!r}",
|
|
449
|
+
"",
|
|
422
450
|
"#: What each application of the catalogue does about each classed tool of the",
|
|
423
451
|
"#: servers it connects to, as agentspecs decides it: `do_it`, `if_asked`,",
|
|
424
452
|
"#: `ask_first` or `leave_to_me`. What the rules engine has to reproduce.",
|
|
@@ -471,6 +499,15 @@ def generate_actions_typescript_code(actions: dict[str, Any]) -> str:
|
|
|
471
499
|
+ ";",
|
|
472
500
|
"",
|
|
473
501
|
"/**",
|
|
502
|
+
" * What each agent protocol's tools do, by protocol id: the prefix its",
|
|
503
|
+
" * connections take (`pap:<domain>`) and each tool's classes (PR-54).",
|
|
504
|
+
" */",
|
|
505
|
+
"export const PROTOCOL_TOOL_CLASSES: Record<",
|
|
506
|
+
" string,",
|
|
507
|
+
" { connection: string; tools: Record<string, ActionClass[]> }",
|
|
508
|
+
"> = " + json.dumps(actions["protocols"], indent=2) + ";",
|
|
509
|
+
"",
|
|
510
|
+
"/**",
|
|
474
511
|
" * What each application of the catalogue does about each classed tool of the",
|
|
475
512
|
" * servers it connects to, as agentspecs decides it. What the rules engine has",
|
|
476
513
|
" * to reproduce.",
|