@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.
Files changed (83) hide show
  1. package/dist-embed/chunks/{ChatView-D41Nx5rC.js → ChatView-BpKZPdcp.js} +4 -4
  2. package/dist-embed/datalayer-app-main.js +150 -150
  3. package/lib/apps/apps/appspec.d.ts +13 -0
  4. package/lib/apps/apps/appspec.js +125 -0
  5. package/lib/apps/apps/checks.d.ts +1 -1
  6. package/lib/apps/apps/checks.js +2 -2
  7. package/lib/apps/apps/customComponents.js +1 -1
  8. package/lib/apps/core/canvasBlocks.d.ts +3 -3
  9. package/lib/apps/core/canvasParts.d.ts +6 -4
  10. package/lib/apps/embed/AppEmbed.js +3 -7
  11. package/lib/apps/embed/embedSession.d.ts +8 -4
  12. package/lib/apps/embed/embedSession.js +16 -9
  13. package/lib/apps/plugins/a2ui-surface/AnswerShows.d.ts +21 -0
  14. package/lib/apps/plugins/a2ui-surface/AnswerShows.js +29 -0
  15. package/lib/apps/plugins/a2ui-surface/SurfaceToolResult.js +4 -7
  16. package/lib/apps/plugins/a2ui-surface/index.d.ts +2 -1
  17. package/lib/apps/plugins/a2ui-surface/index.js +10 -1
  18. package/lib/apps/plugins/a2ui-surface/toolResult.d.ts +20 -11
  19. package/lib/apps/plugins/a2ui-surface/toolResult.js +27 -11
  20. package/lib/apps/plugins/app-components/index.d.ts +1 -1
  21. package/lib/apps/plugins/app-components/index.js +2 -2
  22. package/lib/apps/plugins/app-elements/AppElements.d.ts +3 -3
  23. package/lib/apps/plugins/app-elements/AppElements.js +5 -20
  24. package/lib/apps/plugins/app-elements/QuestionView.d.ts +28 -0
  25. package/lib/apps/plugins/app-elements/QuestionView.js +57 -0
  26. package/lib/apps/plugins/app-elements/index.d.ts +7 -4
  27. package/lib/apps/plugins/app-elements/index.js +14 -5
  28. package/lib/apps/plugins/canvas-blocks/index.d.ts +13 -13
  29. package/lib/apps/plugins/canvas-blocks/index.js +24 -24
  30. package/lib/apps/plugins/canvas-parts/index.d.ts +7 -1
  31. package/lib/apps/plugins/canvas-parts/index.js +36 -0
  32. package/lib/apps/plugins/chat/ChatView.js +7 -0
  33. package/lib/chat/base/ChatBase.js +234 -43
  34. package/lib/chat/base/loopElement.d.ts +16 -17
  35. package/lib/chat/base/loopElement.js +11 -27
  36. package/lib/chat/base/loopStep.d.ts +15 -15
  37. package/lib/chat/base/loopStep.js +10 -13
  38. package/lib/chat/base/loopWindow.d.ts +15 -20
  39. package/lib/chat/base/loopWindow.js +26 -27
  40. package/lib/chat/base/uiOps.d.ts +96 -0
  41. package/lib/chat/base/uiOps.js +251 -0
  42. package/lib/chat/messages/ChatMessageList.d.ts +8 -1
  43. package/lib/chat/messages/ChatMessageList.js +4 -4
  44. package/lib/components/a2ui/datalayer/Chart.d.ts +1 -1
  45. package/lib/components/a2ui/datalayer/schema.js +1 -1
  46. package/lib/components/teams/AnswerSurfaces.d.ts +3 -2
  47. package/lib/components/teams/AnswerSurfaces.js +7 -7
  48. package/lib/components/teams/useA2ATeam.d.ts +1 -1
  49. package/lib/config/AgentConfiguration.d.ts +1 -1
  50. package/lib/protocols/AGUIAdapter.d.ts +7 -0
  51. package/lib/protocols/AGUIAdapter.js +43 -3
  52. package/lib/protocols/agentic-commerce/index.d.ts +5 -9
  53. package/lib/protocols/agentic-commerce/index.js +6 -10
  54. package/lib/protocols/commerce.d.ts +8 -9
  55. package/lib/protocols/commerce.js +29 -0
  56. package/lib/protocols/ucp/index.d.ts +5 -10
  57. package/lib/protocols/ucp/index.js +6 -11
  58. package/lib/specs/actions.d.ts +8 -0
  59. package/lib/specs/actions.js +56 -0
  60. package/lib/specs/agents/agents.js +338 -169
  61. package/lib/specs/apps.d.ts +1 -0
  62. package/lib/specs/apps.js +272 -0
  63. package/lib/specs/appspecSchema.js +125 -0
  64. package/lib/specs/cogs.js +6 -3
  65. package/lib/specs/index.d.ts +2 -1
  66. package/lib/specs/index.js +2 -1
  67. package/lib/specs/protocols.d.ts +24 -0
  68. package/lib/specs/protocols.js +197 -0
  69. package/lib/specs/ui.d.ts +21 -0
  70. package/lib/specs/{uiPlugins.js → ui.js} +14 -14
  71. package/lib/types/agentspecs.d.ts +72 -5
  72. package/lib/types/messages.d.ts +7 -0
  73. package/lib/types/protocol.d.ts +8 -0
  74. package/package.json +2 -2
  75. package/scripts/codegen/generate_agents.py +43 -8
  76. package/scripts/codegen/generate_apps.py +38 -1
  77. package/scripts/codegen/generate_protocols.py +207 -0
  78. package/scripts/codegen/generate_sandbox_agents.py +1 -1
  79. package/scripts/codegen/{generate_ui_plugins.py → generate_ui.py} +40 -40
  80. package/scripts/gen_workers.py +2 -2
  81. package/lib/chat/base/loopMessage.d.ts +0 -37
  82. package/lib/chat/base/loopMessage.js +0 -37
  83. 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
- * What every commerce protocol shares (AGENT_PROTOCOLS §3, one approval
3
- * model) — the twin of `agent_runtimes.protocols.commerce`. A purchase over
4
- * UCP or the Agentic Commerce Protocol is an exact, revisioned
5
- * {@link CheckoutProposal}, approved by the person through the host's
6
- * {@link CheckoutApprover} (contributed to each plugin's `<protocol>.approver`),
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
- type Json = Record<string, any>;
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
- /** Each operation's action class (F-10), for Rules (R-05). */
22
- export declare const UCP_ACTION_CLASSES: {
23
- readonly search: "read";
24
- readonly proposeCompletion: "read";
25
- readonly getCheckout: "read";
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
- /** Each operation's action class (F-10), for Rules (R-05). */
28
- export const UCP_ACTION_CLASSES = {
29
- search: 'read',
30
- proposeCompletion: 'read',
31
- getCheckout: 'read',
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
  }
@@ -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
@@ -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
  };