@datalayer/agent-runtimes 1.6.28 → 1.6.32
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/chunks/AgentInspector-C66D0b0W.js +1 -0
- package/dist-embed/chunks/{AgentInspectorDialog-DTQHUrHA.js → AgentInspectorDialog-DeK96QG1.js} +1 -1
- package/dist-embed/datalayer-app-main.js +12 -12
- package/lib/apps/apps/appspec.d.ts +3 -2
- package/lib/apps/apps/appspec.js +3 -2
- package/lib/examples/pap/traces/account-tokens.json +6 -8
- package/lib/examples/pap/traces/conversation-control.json +16 -18
- package/lib/examples/pap/traces/conversation-streaming.json +10 -12
- package/lib/examples/pap/traces/mediated-sign-in.json +6 -8
- package/lib/examples/pap/traces/operations.json +38 -32
- package/lib/examples/pap/traces/two-companies.json +40 -37
- package/lib/examples/pap/traces/user-with-a-company.json +22 -22
- package/lib/hooks/index.d.ts +1 -1
- package/lib/hooks/index.js +1 -1
- package/lib/hooks/useMonitoring.d.ts +0 -10
- package/lib/hooks/useMonitoring.js +6 -72
- package/lib/portable/displays.d.ts +8 -1
- package/lib/portable/displays.js +46 -3
- package/lib/protocols/pap/index.d.ts +1 -1
- package/lib/protocols/pap/index.js +2 -2
- package/lib/specs/actions.js +2 -2
- package/lib/specs/apps.d.ts +1 -1
- package/lib/specs/apps.js +386 -384
- package/lib/specs/skills.js +23 -23
- package/package.json +2 -2
- package/scripts/codegen/generate_apps.py +9 -2
- package/scripts/codegen/generate_frontend_tools.py +10 -2
- package/scripts/codegen/generate_ops.py +9 -3
- package/dist-embed/chunks/AgentInspector-CPJcLyP9.js +0 -1
package/lib/portable/displays.js
CHANGED
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
* or a business's `pact_sign_in` answer): Direct, Device or Mediated, its
|
|
13
13
|
* page (`https` only), its code, until when, what it needs.
|
|
14
14
|
* - **An operation to approve** (`…pap.confirm+json`): the company's words
|
|
15
|
-
* verbatim
|
|
15
|
+
* verbatim — its summary, or the values of its terms when it wrote none
|
|
16
|
+
* (Operations 3: `terms` required, `summary` optional) — its terms and what
|
|
17
|
+
* the terms check found, the opaque revision
|
|
16
18
|
* and the one it replaced, what it does (a Rules class; `buy` when money
|
|
17
19
|
* moves — a purchase). Every operation is the person's: it is answered where
|
|
18
20
|
* approvals are, never here, and the approval it stands for is named
|
|
@@ -47,6 +49,42 @@ const record = (value) => value && typeof value === 'object' && !Array.isArray(v
|
|
|
47
49
|
: null;
|
|
48
50
|
const text = (value) => typeof value === 'string' ? value : '';
|
|
49
51
|
const words = (value) => text(value).trim();
|
|
52
|
+
/** Every leaf of the terms with its dotted path, as the SDK's `termsLeaves`. */
|
|
53
|
+
function termsLeaves(value, path = '', found = []) {
|
|
54
|
+
if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
|
|
55
|
+
for (const [key, item] of Object.entries(value)) {
|
|
56
|
+
termsLeaves(item, path ? `${path}.${key}` : key, found);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
found.push([path, value]);
|
|
61
|
+
}
|
|
62
|
+
return found;
|
|
63
|
+
}
|
|
64
|
+
/** A leaf as text, as the SDK's `shownValue` (Python's `str`) writes it. */
|
|
65
|
+
function shownValue(value, nested = false) {
|
|
66
|
+
if (typeof value === 'string')
|
|
67
|
+
return nested ? `'${value}'` : value;
|
|
68
|
+
if (typeof value === 'boolean')
|
|
69
|
+
return value ? 'True' : 'False';
|
|
70
|
+
if (value === null || value === undefined)
|
|
71
|
+
return 'None';
|
|
72
|
+
if (Array.isArray(value)) {
|
|
73
|
+
return `[${value.map(item => shownValue(item, true)).join(', ')}]`;
|
|
74
|
+
}
|
|
75
|
+
if (typeof value === 'object') {
|
|
76
|
+
return `{${Object.entries(value)
|
|
77
|
+
.map(([key, item]) => `'${key}': ${shownValue(item, true)}`)
|
|
78
|
+
.join(', ')}}`;
|
|
79
|
+
}
|
|
80
|
+
return String(value);
|
|
81
|
+
}
|
|
82
|
+
/** The terms as a host shows them when the company wrote no summary (Operations 5). */
|
|
83
|
+
export function shownTerms(terms) {
|
|
84
|
+
return termsLeaves(terms)
|
|
85
|
+
.map(([path, value]) => `${path}: ${shownValue(value)}`)
|
|
86
|
+
.join('\n');
|
|
87
|
+
}
|
|
50
88
|
const ACTIONS = [
|
|
51
89
|
'read',
|
|
52
90
|
'write',
|
|
@@ -83,7 +121,7 @@ export function protocolDisplayOf(wire) {
|
|
|
83
121
|
}
|
|
84
122
|
case PAP_CONFIRM_TYPE: {
|
|
85
123
|
const company = words(data.company);
|
|
86
|
-
const
|
|
124
|
+
const given = text(data.summary);
|
|
87
125
|
const operationRef = words(data.operation_ref);
|
|
88
126
|
const revision = words(data.revision);
|
|
89
127
|
const terms = record(data.terms);
|
|
@@ -91,7 +129,7 @@ export function protocolDisplayOf(wire) {
|
|
|
91
129
|
const wasRevision = was ? words(was.revision) : '';
|
|
92
130
|
const expiresAt = words(data.expires_at);
|
|
93
131
|
if (!company ||
|
|
94
|
-
|
|
132
|
+
(data.summary !== undefined && data.summary !== null && !given.trim()) ||
|
|
95
133
|
!operationRef ||
|
|
96
134
|
!revision ||
|
|
97
135
|
!terms ||
|
|
@@ -108,6 +146,10 @@ export function protocolDisplayOf(wire) {
|
|
|
108
146
|
: ACTIONS.find(a => a === data.does);
|
|
109
147
|
if (does === undefined)
|
|
110
148
|
return unknown;
|
|
149
|
+
const summaryGiven = Boolean(given.trim());
|
|
150
|
+
const summary = summaryGiven ? given : shownTerms(terms);
|
|
151
|
+
if (!summary.trim())
|
|
152
|
+
return unknown;
|
|
111
153
|
const session = record(data.session);
|
|
112
154
|
return {
|
|
113
155
|
kind: 'confirm',
|
|
@@ -115,6 +157,7 @@ export function protocolDisplayOf(wire) {
|
|
|
115
157
|
approvalId: id.slice(0, -'-confirm'.length),
|
|
116
158
|
company,
|
|
117
159
|
summary,
|
|
160
|
+
summaryGiven,
|
|
118
161
|
terms,
|
|
119
162
|
operationRef,
|
|
120
163
|
revision,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const PAP_PLUGIN = "agent-runtimes.protocols.pap";
|
|
2
2
|
/** The PAP draft the SDK implements (its `PROTOCOL_PROFILE`; Python reads it from the SDK). */
|
|
3
|
-
export declare const PAP_PROTOCOL_PROFILE = "0.
|
|
3
|
+
export declare const PAP_PROTOCOL_PROFILE = "0.4";
|
|
4
4
|
export declare const PapPlugin: import("@datalayer/reactor").ReactorPlugin<Record<string, never>, unknown, unknown>;
|
|
@@ -18,7 +18,7 @@ import { contribution, definePlugin } from '@datalayer/reactor';
|
|
|
18
18
|
import { DEFAULT_ORDER, ProtocolDescriptions } from '../core.js';
|
|
19
19
|
export const PAP_PLUGIN = 'agent-runtimes.protocols.pap';
|
|
20
20
|
/** The PAP draft the SDK implements (its `PROTOCOL_PROFILE`; Python reads it from the SDK). */
|
|
21
|
-
export const PAP_PROTOCOL_PROFILE = '0.
|
|
21
|
+
export const PAP_PROTOCOL_PROFILE = '0.4';
|
|
22
22
|
export const PapPlugin = definePlugin({
|
|
23
23
|
name: PAP_PLUGIN,
|
|
24
24
|
version: '1.0.0',
|
|
@@ -32,7 +32,7 @@ export const PapPlugin = definePlugin({
|
|
|
32
32
|
version: PAP_PROTOCOL_PROFILE,
|
|
33
33
|
roles: ['personal-agent', 'company'],
|
|
34
34
|
status: 'implemented',
|
|
35
|
-
specification: 'https://personalagentprotocol.org/docs/0.
|
|
35
|
+
specification: 'https://personalagentprotocol.org/docs/0.4/spec',
|
|
36
36
|
plugin: PAP_PLUGIN,
|
|
37
37
|
catalogue: 'pap',
|
|
38
38
|
points: [],
|
package/lib/specs/actions.js
CHANGED
|
@@ -1036,6 +1036,7 @@ export const APP_BEHAVIOURS = {
|
|
|
1036
1036
|
'odoo-accounting.odoo_accounting_update_vendor_payment': 'leave_to_me',
|
|
1037
1037
|
'odoo-accounting.odoo_accounting_vat_close_check': 'do_it',
|
|
1038
1038
|
},
|
|
1039
|
+
'aws-steward-agent': {},
|
|
1039
1040
|
'bookkeeping-desk': {},
|
|
1040
1041
|
'change-detection': {
|
|
1041
1042
|
'earthdata.download_earth_data_granules': 'leave_to_me',
|
|
@@ -1400,7 +1401,6 @@ export const APP_BEHAVIOURS = {
|
|
|
1400
1401
|
'shopping-desk': {},
|
|
1401
1402
|
'sign-in-desk': {},
|
|
1402
1403
|
'signed-reader': {},
|
|
1403
|
-
'steward-aws': {},
|
|
1404
1404
|
'supplier-comparison': {},
|
|
1405
1405
|
'support-desk': {},
|
|
1406
1406
|
'travel-desk': {},
|
|
@@ -1418,6 +1418,7 @@ export const APP_BEHAVIOURS = {
|
|
|
1418
1418
|
*/
|
|
1419
1419
|
export const APP_ESCALATIONS = {
|
|
1420
1420
|
accounting: {},
|
|
1421
|
+
'aws-steward-agent': {},
|
|
1421
1422
|
'bookkeeping-desk': {},
|
|
1422
1423
|
'change-detection': {},
|
|
1423
1424
|
'code-explainer': {},
|
|
@@ -1483,7 +1484,6 @@ export const APP_ESCALATIONS = {
|
|
|
1483
1484
|
'shopping-desk': {},
|
|
1484
1485
|
'sign-in-desk': {},
|
|
1485
1486
|
'signed-reader': {},
|
|
1486
|
-
'steward-aws': {},
|
|
1487
1487
|
'supplier-comparison': {},
|
|
1488
1488
|
'support-desk': {},
|
|
1489
1489
|
'travel-desk': {},
|
package/lib/specs/apps.d.ts
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import type { AppBuilt, AppKind, AppSpec } from '../types/agentspecs';
|
|
11
11
|
export declare const ACCOUNTING_APP_0_0_2: AppSpec;
|
|
12
|
+
export declare const AWS_STEWARD_AGENT_APP_0_0_1: AppSpec;
|
|
12
13
|
export declare const BOOKKEEPING_DESK_APP_0_0_3: AppSpec;
|
|
13
14
|
export declare const CHANGE_DETECTION_APP_0_0_2: AppSpec;
|
|
14
15
|
export declare const CODE_EXPLAINER_APP_0_0_1: AppSpec;
|
|
@@ -41,7 +42,6 @@ export declare const SHOP_CONCIERGE_APP_0_0_2: AppSpec;
|
|
|
41
42
|
export declare const SHOPPING_DESK_APP_0_0_2: AppSpec;
|
|
42
43
|
export declare const SIGN_IN_DESK_APP_0_0_2: AppSpec;
|
|
43
44
|
export declare const SIGNED_READER_APP_0_0_2: AppSpec;
|
|
44
|
-
export declare const STEWARD_AWS_APP_0_0_1: AppSpec;
|
|
45
45
|
export declare const SUPPLIER_COMPARISON_APP_0_0_3: AppSpec;
|
|
46
46
|
export declare const SUPPORT_DESK_APP_0_0_5: AppSpec;
|
|
47
47
|
export declare const TRAVEL_DESK_APP_0_0_2: AppSpec;
|