@datalayer/agent-runtimes 1.3.113 → 1.4.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/dist-embed/chunks/{ChatView-D41Nx5rC.js → ChatView-BpKZPdcp.js} +4 -4
- package/dist-embed/datalayer-app-main.js +150 -150
- package/lib/apps/apps/appspec.d.ts +13 -0
- package/lib/apps/apps/appspec.js +125 -0
- package/lib/apps/apps/checks.d.ts +1 -1
- package/lib/apps/apps/checks.js +2 -2
- package/lib/apps/apps/customComponents.js +1 -1
- package/lib/apps/core/canvasBlocks.d.ts +3 -3
- package/lib/apps/core/canvasParts.d.ts +6 -4
- package/lib/apps/embed/AppEmbed.js +3 -7
- package/lib/apps/embed/embedSession.d.ts +8 -4
- package/lib/apps/embed/embedSession.js +16 -9
- package/lib/apps/plugins/a2ui-surface/AnswerShows.d.ts +21 -0
- package/lib/apps/plugins/a2ui-surface/AnswerShows.js +29 -0
- package/lib/apps/plugins/a2ui-surface/SurfaceToolResult.js +4 -7
- package/lib/apps/plugins/a2ui-surface/index.d.ts +2 -1
- package/lib/apps/plugins/a2ui-surface/index.js +10 -1
- package/lib/apps/plugins/a2ui-surface/toolResult.d.ts +20 -11
- package/lib/apps/plugins/a2ui-surface/toolResult.js +27 -11
- package/lib/apps/plugins/app-components/index.d.ts +1 -1
- package/lib/apps/plugins/app-components/index.js +2 -2
- package/lib/apps/plugins/app-elements/AppElements.d.ts +3 -3
- package/lib/apps/plugins/app-elements/AppElements.js +5 -20
- package/lib/apps/plugins/app-elements/QuestionView.d.ts +28 -0
- package/lib/apps/plugins/app-elements/QuestionView.js +57 -0
- package/lib/apps/plugins/app-elements/index.d.ts +7 -4
- package/lib/apps/plugins/app-elements/index.js +14 -5
- package/lib/apps/plugins/canvas-blocks/index.d.ts +13 -13
- package/lib/apps/plugins/canvas-blocks/index.js +24 -24
- package/lib/apps/plugins/canvas-parts/index.d.ts +7 -1
- package/lib/apps/plugins/canvas-parts/index.js +36 -0
- package/lib/apps/plugins/chat/ChatView.js +7 -0
- package/lib/chat/base/ChatBase.js +234 -43
- package/lib/chat/base/loopElement.d.ts +16 -17
- package/lib/chat/base/loopElement.js +11 -27
- package/lib/chat/base/loopStep.d.ts +15 -15
- package/lib/chat/base/loopStep.js +10 -13
- package/lib/chat/base/loopWindow.d.ts +15 -20
- package/lib/chat/base/loopWindow.js +26 -27
- package/lib/chat/base/uiOps.d.ts +96 -0
- package/lib/chat/base/uiOps.js +251 -0
- package/lib/chat/messages/ChatMessageList.d.ts +8 -1
- package/lib/chat/messages/ChatMessageList.js +4 -4
- package/lib/components/a2ui/datalayer/Chart.d.ts +1 -1
- package/lib/components/a2ui/datalayer/schema.js +1 -1
- package/lib/components/teams/AnswerSurfaces.d.ts +3 -2
- package/lib/components/teams/AnswerSurfaces.js +7 -7
- package/lib/components/teams/useA2ATeam.d.ts +1 -1
- package/lib/config/AgentConfiguration.d.ts +1 -1
- package/lib/protocols/AGUIAdapter.d.ts +7 -0
- package/lib/protocols/AGUIAdapter.js +43 -3
- 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/agents/agents.js +338 -169
- package/lib/specs/apps.d.ts +1 -0
- package/lib/specs/apps.js +272 -0
- package/lib/specs/appspecSchema.js +125 -0
- package/lib/specs/cogs.js +6 -3
- package/lib/specs/index.d.ts +2 -1
- package/lib/specs/index.js +2 -1
- package/lib/specs/protocols.d.ts +24 -0
- package/lib/specs/protocols.js +197 -0
- package/lib/specs/ui.d.ts +21 -0
- package/lib/specs/{uiPlugins.js → ui.js} +14 -14
- package/lib/types/agentspecs.d.ts +72 -5
- package/lib/types/messages.d.ts +7 -0
- package/lib/types/protocol.d.ts +8 -0
- package/package.json +2 -2
- package/scripts/codegen/generate_agents.py +43 -8
- package/scripts/codegen/generate_apps.py +38 -1
- package/scripts/codegen/generate_protocols.py +207 -0
- package/scripts/codegen/generate_sandbox_agents.py +1 -1
- package/scripts/codegen/{generate_ui_plugins.py → generate_ui.py} +40 -40
- package/scripts/gen_workers.py +2 -2
- package/lib/chat/base/loopMessage.d.ts +0 -37
- package/lib/chat/base/loopMessage.js +0 -37
- package/lib/specs/uiPlugins.d.ts +0 -21
|
@@ -1,14 +1,13 @@
|
|
|
1
|
+
import type { ActionClass } from '../types/agentspecs';
|
|
2
|
+
type Json = Record<string, any>;
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* and completed once ({@link ProposalStore}).
|
|
8
|
-
*
|
|
9
|
-
* @module protocols/commerce
|
|
4
|
+
* Each operation's action class (F-10) for Rules (R-05), as agentspecs
|
|
5
|
+
* classes a protocol's tools (`protocol-tools/<protocol>.yaml`,
|
|
6
|
+
* AGENT_PROTOCOLS PR-54), named as the TypeScript client names them
|
|
7
|
+
* (`complete_checkout` → `completeCheckout`). A commerce operation does one
|
|
8
|
+
* thing: one with several classes, or none, throws rather than guess.
|
|
10
9
|
*/
|
|
11
|
-
|
|
10
|
+
export declare function operationClasses(protocol: string): Record<string, ActionClass>;
|
|
12
11
|
/** One exact purchase, proposed to a person before it is made. */
|
|
13
12
|
export interface CheckoutProposal {
|
|
14
13
|
id: string;
|
|
@@ -2,6 +2,35 @@
|
|
|
2
2
|
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
3
3
|
* Distributed under the terms of the Modified BSD License.
|
|
4
4
|
*/
|
|
5
|
+
/**
|
|
6
|
+
* What every commerce protocol shares (AGENT_PROTOCOLS §3, one approval
|
|
7
|
+
* model) — the twin of `agent_runtimes.protocols.commerce`. A purchase over
|
|
8
|
+
* UCP or the Agentic Commerce Protocol is an exact, revisioned
|
|
9
|
+
* {@link CheckoutProposal}, approved by the person through the host's
|
|
10
|
+
* {@link CheckoutApprover} (contributed to each plugin's `<protocol>.approver`),
|
|
11
|
+
* and completed once ({@link ProposalStore}).
|
|
12
|
+
*
|
|
13
|
+
* @module protocols/commerce
|
|
14
|
+
*/
|
|
15
|
+
import { PROTOCOL_TOOL_CLASSES } from '../specs/actions';
|
|
16
|
+
/**
|
|
17
|
+
* Each operation's action class (F-10) for Rules (R-05), as agentspecs
|
|
18
|
+
* classes a protocol's tools (`protocol-tools/<protocol>.yaml`,
|
|
19
|
+
* AGENT_PROTOCOLS PR-54), named as the TypeScript client names them
|
|
20
|
+
* (`complete_checkout` → `completeCheckout`). A commerce operation does one
|
|
21
|
+
* thing: one with several classes, or none, throws rather than guess.
|
|
22
|
+
*/
|
|
23
|
+
export function operationClasses(protocol) {
|
|
24
|
+
const out = {};
|
|
25
|
+
for (const [name, classes] of Object.entries(PROTOCOL_TOOL_CLASSES[protocol].tools)) {
|
|
26
|
+
if (classes.length !== 1) {
|
|
27
|
+
throw new Error(`${protocol} ${name} is classed ${classes}: one class each`);
|
|
28
|
+
}
|
|
29
|
+
out[name.replace(/_([a-z])/g, (_, c) => c.toUpperCase())] =
|
|
30
|
+
classes[0];
|
|
31
|
+
}
|
|
32
|
+
return out;
|
|
33
|
+
}
|
|
5
34
|
/** A proposal in words, for the person and the model: never a credential. */
|
|
6
35
|
export function proposalSummary(proposal) {
|
|
7
36
|
const items = proposal.lines
|
|
@@ -18,16 +18,11 @@ export declare const SHOPPING_SERVICE = "dev.ucp.shopping";
|
|
|
18
18
|
export declare const CHECKOUT_CAPABILITY = "dev.ucp.shopping.checkout";
|
|
19
19
|
export declare const PROFILE_PATH = "/.well-known/ucp";
|
|
20
20
|
export declare const UCP_PLUGIN = "agent-runtimes.protocols.ucp";
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
readonly createCheckout: "write";
|
|
27
|
-
readonly updateCheckout: "write";
|
|
28
|
-
readonly cancelCheckout: "write";
|
|
29
|
-
readonly complete: "buy";
|
|
30
|
-
};
|
|
21
|
+
/**
|
|
22
|
+
* Each operation's action class (F-10), for Rules (R-05): agentspecs'
|
|
23
|
+
* `protocol-tools/ucp.yaml` (AGENT_PROTOCOLS PR-54).
|
|
24
|
+
*/
|
|
25
|
+
export declare const UCP_ACTION_CLASSES: Record<string, import("../../types").ActionClass>;
|
|
31
26
|
export { InMemoryProposalStore, proposalSummary, type CheckoutApprover, type CheckoutProposal, type ProposalStore, } from '../commerce';
|
|
32
27
|
export declare class UcpError extends Error {
|
|
33
28
|
}
|
|
@@ -17,23 +17,18 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import { contribution, defineContributionPoint, definePlugin, } from '@datalayer/reactor';
|
|
19
19
|
import { ExtendedCheckoutResponseSchema } from '@ucp-js/sdk';
|
|
20
|
-
import { InMemoryProposalStore, digest, } from '../commerce';
|
|
20
|
+
import { InMemoryProposalStore, digest, operationClasses, } from '../commerce';
|
|
21
21
|
import { DEFAULT_ORDER, ProtocolDescriptions, firstContribution, } from '../core';
|
|
22
22
|
export const UCP_VERSION = '2026-08-25';
|
|
23
23
|
export const SHOPPING_SERVICE = 'dev.ucp.shopping';
|
|
24
24
|
export const CHECKOUT_CAPABILITY = 'dev.ucp.shopping.checkout';
|
|
25
25
|
export const PROFILE_PATH = '/.well-known/ucp';
|
|
26
26
|
export const UCP_PLUGIN = 'agent-runtimes.protocols.ucp';
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
createCheckout: 'write',
|
|
33
|
-
updateCheckout: 'write',
|
|
34
|
-
cancelCheckout: 'write',
|
|
35
|
-
complete: 'buy',
|
|
36
|
-
};
|
|
27
|
+
/**
|
|
28
|
+
* Each operation's action class (F-10), for Rules (R-05): agentspecs'
|
|
29
|
+
* `protocol-tools/ucp.yaml` (AGENT_PROTOCOLS PR-54).
|
|
30
|
+
*/
|
|
31
|
+
export const UCP_ACTION_CLASSES = operationClasses('ucp');
|
|
37
32
|
export { InMemoryProposalStore, proposalSummary, } from '../commerce';
|
|
38
33
|
export class UcpError extends Error {
|
|
39
34
|
}
|
package/lib/specs/actions.d.ts
CHANGED
|
@@ -17,6 +17,14 @@ export declare const BACKEND_TOOL_ACTIONS: Record<string, ActionClass[]>;
|
|
|
17
17
|
* names were read off the running server; absent when nobody looked.
|
|
18
18
|
*/
|
|
19
19
|
export declare const SERVER_ACTIONS: Record<string, ServerActionsSpec>;
|
|
20
|
+
/**
|
|
21
|
+
* What each agent protocol's tools do, by protocol id: the prefix its
|
|
22
|
+
* connections take (`pap:<domain>`) and each tool's classes (PR-54).
|
|
23
|
+
*/
|
|
24
|
+
export declare const PROTOCOL_TOOL_CLASSES: Record<string, {
|
|
25
|
+
connection: string;
|
|
26
|
+
tools: Record<string, ActionClass[]>;
|
|
27
|
+
}>;
|
|
20
28
|
/**
|
|
21
29
|
* What each application of the catalogue does about each classed tool of the
|
|
22
30
|
* servers it connects to, as agentspecs decides it. What the rules engine has
|
package/lib/specs/actions.js
CHANGED
|
@@ -663,6 +663,60 @@ export const SERVER_ACTIONS = {
|
|
|
663
663
|
signs: {},
|
|
664
664
|
},
|
|
665
665
|
};
|
|
666
|
+
/**
|
|
667
|
+
* What each agent protocol's tools do, by protocol id: the prefix its
|
|
668
|
+
* connections take (`pap:<domain>`) and each tool's classes (PR-54).
|
|
669
|
+
*/
|
|
670
|
+
export const PROTOCOL_TOOL_CLASSES = {
|
|
671
|
+
'agentic-commerce': {
|
|
672
|
+
connection: 'acp',
|
|
673
|
+
tools: {
|
|
674
|
+
propose_completion: ['read'],
|
|
675
|
+
get_checkout: ['read'],
|
|
676
|
+
create_checkout: ['write'],
|
|
677
|
+
update_checkout: ['write'],
|
|
678
|
+
cancel_checkout: ['write'],
|
|
679
|
+
complete: ['buy'],
|
|
680
|
+
},
|
|
681
|
+
},
|
|
682
|
+
pact: {
|
|
683
|
+
connection: 'pact',
|
|
684
|
+
tools: {
|
|
685
|
+
pact_brand: ['read'],
|
|
686
|
+
pact_ask: ['read'],
|
|
687
|
+
pact_sign_in: ['read'],
|
|
688
|
+
pact_sign_in_status: ['read'],
|
|
689
|
+
pact_ask_for_person: ['write'],
|
|
690
|
+
pact_disconnect: ['write'],
|
|
691
|
+
},
|
|
692
|
+
},
|
|
693
|
+
pap: {
|
|
694
|
+
connection: 'pap',
|
|
695
|
+
tools: {
|
|
696
|
+
pap_company: ['read'],
|
|
697
|
+
pap_ask: ['read'],
|
|
698
|
+
pap_sign_in: ['read'],
|
|
699
|
+
pap_sign_in_status: ['read'],
|
|
700
|
+
pap_read: ['read'],
|
|
701
|
+
pap_mcp_tools: ['read'],
|
|
702
|
+
pap_mcp_call: ['write'],
|
|
703
|
+
pap_confirm: ['write', 'buy'],
|
|
704
|
+
pap_disconnect: ['write'],
|
|
705
|
+
},
|
|
706
|
+
},
|
|
707
|
+
ucp: {
|
|
708
|
+
connection: 'ucp',
|
|
709
|
+
tools: {
|
|
710
|
+
search: ['read'],
|
|
711
|
+
propose_completion: ['read'],
|
|
712
|
+
get_checkout: ['read'],
|
|
713
|
+
create_checkout: ['write'],
|
|
714
|
+
update_checkout: ['write'],
|
|
715
|
+
cancel_checkout: ['write'],
|
|
716
|
+
complete: ['buy'],
|
|
717
|
+
},
|
|
718
|
+
},
|
|
719
|
+
};
|
|
666
720
|
/**
|
|
667
721
|
* What each application of the catalogue does about each classed tool of the
|
|
668
722
|
* servers it connects to, as agentspecs decides it. What the rules engine has
|
|
@@ -922,6 +976,7 @@ export const APP_BEHAVIOURS = {
|
|
|
922
976
|
'ship-or-fix': {},
|
|
923
977
|
'supplier-comparison': {},
|
|
924
978
|
'support-desk': {},
|
|
979
|
+
'travel-desk': {},
|
|
925
980
|
'web-research': {
|
|
926
981
|
'tavily.tavily_crawl': 'do_it',
|
|
927
982
|
'tavily.tavily_extract': 'do_it',
|
|
@@ -988,5 +1043,6 @@ export const APP_ESCALATIONS = {
|
|
|
988
1043
|
'ship-or-fix': {},
|
|
989
1044
|
'supplier-comparison': {},
|
|
990
1045
|
'support-desk': {},
|
|
1046
|
+
'travel-desk': {},
|
|
991
1047
|
'web-research': {},
|
|
992
1048
|
};
|