@datalayer/agent-runtimes 1.5.87 → 1.5.89

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 (50) hide show
  1. package/dist-embed/datalayer-app-main.js +22 -9
  2. package/lib/apps/apps/checks.d.ts +1 -1
  3. package/lib/apps/apps/checks.js +1 -1
  4. package/lib/apps/apps/computer.d.ts +1 -1
  5. package/lib/apps/apps/computer.js +1 -1
  6. package/lib/apps/apps/pluginPair.d.ts +1 -1
  7. package/lib/apps/apps/rules.d.ts +1 -1
  8. package/lib/apps/apps/rules.js +2 -2
  9. package/lib/apps/apps/visitorToken.d.ts +1 -1
  10. package/lib/apps/apps/visitorToken.js +1 -1
  11. package/lib/apps/core/appFiles.js +1 -1
  12. package/lib/apps/plugins/a2ui-surface/toolResult.d.ts +1 -1
  13. package/lib/apps/plugins/a2ui-surface/toolResult.js +1 -1
  14. package/lib/apps/plugins/agent-outputs/sheets.d.ts +76 -0
  15. package/lib/apps/plugins/agent-outputs/sheets.js +230 -0
  16. package/lib/apps/plugins/app-page/appPageModel.d.ts +1 -1
  17. package/lib/apps/plugins/app-page/appPageModel.js +1 -1
  18. package/lib/chat/messages/ChatMarkdown.d.ts +3 -1
  19. package/lib/chat/messages/ChatMarkdown.js +4 -1
  20. package/lib/chat/messages/codeBlocks.d.ts +50 -0
  21. package/lib/chat/messages/codeBlocks.js +81 -0
  22. package/lib/examples/AgentOutputsExample.d.ts +7 -0
  23. package/lib/examples/AgentOutputsExample.js +47 -7
  24. package/lib/examples/utils/agentOutputsPlugins.d.ts +2 -0
  25. package/lib/examples/utils/agentOutputsPlugins.js +27 -0
  26. package/lib/portable/hosts/client.d.ts +11 -1
  27. package/lib/portable/hosts/client.js +12 -6
  28. package/lib/portable/hosts/contracts.json +9 -3
  29. package/lib/portable/hosts/index.d.ts +1 -1
  30. package/lib/portable/records.d.ts +1 -1
  31. package/lib/portable/records.js +1 -1
  32. package/lib/portable/semantic-events.json +3 -3
  33. package/lib/portable/semanticOfAgUi.d.ts +1 -1
  34. package/lib/runtimes/variants.d.ts +1 -1
  35. package/lib/runtimes/variants.js +1 -1
  36. package/lib/specs/agents/agents.d.ts +1 -0
  37. package/lib/specs/agents/agents.js +79 -8
  38. package/lib/specs/apps.js +32 -32
  39. package/lib/specs/frontendTools.d.ts +1 -0
  40. package/lib/specs/frontendTools.js +18 -0
  41. package/lib/specs/harnesses.d.ts +1 -0
  42. package/lib/specs/harnesses.js +62 -19
  43. package/lib/specs/index.d.ts +1 -1
  44. package/lib/specs/index.js +1 -1
  45. package/lib/specs/mcpServers.js +20 -50
  46. package/lib/types/mcp.d.ts +4 -2
  47. package/package.json +2 -1
  48. package/scripts/codegen/generate_apps.py +1 -1
  49. package/scripts/codegen/generate_mcp_servers.py +30 -4
  50. package/scripts/validate_pap_examples.py +1 -1
@@ -7,6 +7,7 @@
7
7
  * DO NOT EDIT MANUALLY - run 'make specs' to regenerate.
8
8
  */
9
9
  import type { FrontendToolSpec } from '../types';
10
+ export declare const CELLS_FRONTEND_TOOL_SPEC_0_0_1: FrontendToolSpec;
10
11
  export declare const DECKS_FRONTEND_TOOL_SPEC_0_0_1: FrontendToolSpec;
11
12
  export declare const JUPYTER_NOTEBOOK_EDIT_FRONTEND_TOOL_SPEC_0_0_1: FrontendToolSpec;
12
13
  export declare const JUPYTER_NOTEBOOK_PROPOSE_FRONTEND_TOOL_SPEC_0_0_1: FrontendToolSpec;
@@ -5,6 +5,23 @@
5
5
  // ============================================================================
6
6
  // Frontend Tool Definitions
7
7
  // ============================================================================
8
+ export const CELLS_FRONTEND_TOOL_SPEC_0_0_1 = {
9
+ id: 'cells',
10
+ version: '0.0.1',
11
+ name: 'Cells',
12
+ description: "Read and write the spreadsheet on the person's screen, and chart it — the grid drawn by Datalayer Cells.",
13
+ tags: ['frontend', 'cells', 'spreadsheets'],
14
+ enabled: true,
15
+ toolset: [
16
+ 'cells_read_range',
17
+ 'cells_write_range',
18
+ 'cells_insert_chart',
19
+ 'cells_list_charts',
20
+ 'cells_select_range',
21
+ ],
22
+ icon: '@primer/octicons-react:table',
23
+ emoji: '🧮',
24
+ };
8
25
  export const DECKS_FRONTEND_TOOL_SPEC_0_0_1 = {
9
26
  id: 'decks',
10
27
  version: '0.0.1',
@@ -101,6 +118,7 @@ export const LEXICAL_DOCUMENT_FRONTEND_TOOL_SPEC_0_0_1 = {
101
118
  // Frontend Tool Catalog
102
119
  // ============================================================================
103
120
  export const FRONTEND_TOOL_CATALOG = {
121
+ cells: CELLS_FRONTEND_TOOL_SPEC_0_0_1,
104
122
  decks: DECKS_FRONTEND_TOOL_SPEC_0_0_1,
105
123
  'jupyter-notebook-edit': JUPYTER_NOTEBOOK_EDIT_FRONTEND_TOOL_SPEC_0_0_1,
106
124
  'jupyter-notebook-propose': JUPYTER_NOTEBOOK_PROPOSE_FRONTEND_TOOL_SPEC_0_0_1,
@@ -15,6 +15,7 @@ export declare const GEMINI_CLI_HARNESS_0_0_1: HarnessSpec;
15
15
  export declare const GOOSE_HARNESS_0_0_1: HarnessSpec;
16
16
  export declare const OPENCODE_HARNESS_0_0_1: HarnessSpec;
17
17
  export declare const OPENHANDS_HARNESS_0_0_1: HarnessSpec;
18
+ export declare const PI_HARNESS_0_0_1: HarnessSpec;
18
19
  export declare const HARNESS_CATALOGUE: Record<string, HarnessSpec>;
19
20
  /** A harness by id. */
20
21
  export declare function getHarness(harnessId: string): HarnessSpec | undefined;
@@ -175,7 +175,7 @@ export const FAST_AGENT_HARNESS_0_0_1 = {
175
175
  name: 'fast-agent',
176
176
  description: "llmindset's agent framework served over ACP; each agent it defines is a session mode, with any model provider it is configured with.",
177
177
  enabled: false,
178
- unavailable_because: 'the catalogue offers four harnesses today — Claude Code, Codex, OpenCode and Gemini CLI (28 October 2026); fast-agent is a framework served over ACP, not a coding agent, its adapter is a Python tool the runtime image does not carry, and it has not been drilled on Datalayer.',
178
+ unavailable_because: 'the catalogue offers four harnesses today — Claude Code, Codex, OpenCode and pi (28 October 2026); fast-agent is a framework served over ACP, not a coding agent, its adapter is a Python tool the runtime image does not carry, and it has not been drilled on Datalayer.',
179
179
  tags: ['harness', 'framework'],
180
180
  docs: 'https://github.com/evalstate/fast-agent/blob/main/docs/docs/acp/index.md',
181
181
  acp: {
@@ -230,8 +230,8 @@ export const GEMINI_CLI_HARNESS_0_0_1 = {
230
230
  version: '0.0.1',
231
231
  name: 'Gemini CLI',
232
232
  description: "Google's coding agent, which speaks ACP itself when started with --experimental-acp.",
233
- enabled: true,
234
- unavailable_because: '',
233
+ enabled: false,
234
+ unavailable_because: "the catalogue offers four harnesses today — Claude Code, Codex, OpenCode and pi (28 October 2026); Gemini CLI's API host (generativelanguage.googleapis.com) is outside a Datalayer runtime's egress boundary and is not routed through ai-inference, so it stays unfunded and unoffered there (the user's decision, 28 October 2026).",
235
235
  tags: ['harness'],
236
236
  docs: 'https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/cli-reference.md',
237
237
  acp: {
@@ -288,7 +288,7 @@ export const GOOSE_HARNESS_0_0_1 = {
288
288
  name: 'goose',
289
289
  description: "Block's open agent (now the Agentic AI Foundation's), which speaks ACP itself with goose acp; any model provider it is configured with.",
290
290
  enabled: false,
291
- unavailable_because: 'the catalogue offers four harnesses today — Claude Code, Codex, OpenCode and Gemini CLI (28 October 2026); goose is a binary of its own release, not an npm adapter, the runtime image does not carry it, and it has not been drilled on Datalayer.',
291
+ unavailable_because: 'the catalogue offers four harnesses today — Claude Code, Codex, OpenCode and pi (28 October 2026); goose is a binary of its own release, not an npm adapter, the runtime image does not carry it, and it has not been drilled on Datalayer.',
292
292
  tags: ['harness'],
293
293
  docs: 'https://block.github.io/goose/docs/gdk/acp/',
294
294
  acp: {
@@ -400,7 +400,7 @@ export const OPENHANDS_HARNESS_0_0_1 = {
400
400
  name: 'OpenHands',
401
401
  description: 'The OpenHands CLI, which speaks ACP itself with openhands acp; any model provider it is configured with.',
402
402
  enabled: false,
403
- unavailable_because: "the catalogue offers four harnesses today — Claude Code, Codex, OpenCode and Gemini CLI (28 October 2026); OpenHands' adapter is a Python tool the runtime image does not carry, and it has not been drilled on Datalayer.",
403
+ unavailable_because: "the catalogue offers four harnesses today — Claude Code, Codex, OpenCode and pi (28 October 2026); OpenHands' adapter is a Python tool the runtime image does not carry, and it has not been drilled on Datalayer.",
404
404
  tags: ['harness'],
405
405
  docs: 'https://docs.openhands.dev/openhands/usage/run-openhands/acp',
406
406
  acp: {
@@ -456,6 +456,62 @@ export const OPENHANDS_HARNESS_0_0_1 = {
456
456
  note: "Open source under MIT, no vendor terms of its own; the model provider's terms apply to the key. Launched as openhands acp (OpenHands-CLI README; docs.openhands.dev's ACP page); resumes with --resume; reads skills from .agents/skills (.openhands/skills is legacy).",
457
457
  },
458
458
  };
459
+ export const PI_HARNESS_0_0_1 = {
460
+ id: 'pi',
461
+ version: '0.0.1',
462
+ name: 'pi',
463
+ description: "Earendil's pi coding agent, driven over ACP through the pi-acp adapter, which spawns the published pi executable; any model provider pi is configured with.",
464
+ enabled: true,
465
+ unavailable_because: '',
466
+ tags: ['harness'],
467
+ docs: 'https://github.com/svkozak/pi-acp',
468
+ acp: {
469
+ command: 'npx',
470
+ args: ['-y', 'pi-acp@0.0.34'],
471
+ protocolVersion: 1,
472
+ loadSession: true,
473
+ mcp: 'lend',
474
+ modes: [],
475
+ env: {},
476
+ nativeSession: 'none',
477
+ },
478
+ requires: {
479
+ secrets: ['ANTHROPIC_API_KEY'],
480
+ binaries: ['node', 'git'],
481
+ },
482
+ terms: {
483
+ servedToThirdParties: 'permitted',
484
+ licence: 'MIT (adapter); MIT (the agent, @earendil-works/pi-coding-agent 1.4.0)',
485
+ },
486
+ skills: {
487
+ format: 'skill-md',
488
+ dir: '.pi/skills',
489
+ },
490
+ honours: {
491
+ model: true,
492
+ subagents: false,
493
+ },
494
+ capabilities: {
495
+ resume: 'load',
496
+ forkHistory: 'replay',
497
+ interrupt: true,
498
+ steering: false,
499
+ images: false,
500
+ compaction: 'own',
501
+ modes: [],
502
+ autoRun: [],
503
+ },
504
+ instructionsFile: 'AGENTS.md',
505
+ registered: {
506
+ adapter: 'pi-acp',
507
+ version: '0.0.34',
508
+ licenceSource: 'https://www.npmjs.com/package/pi-acp',
509
+ termsSource: 'https://github.com/earendil-works/pi/blob/main/LICENSE',
510
+ credential: "The provider's key pi is configured with; ANTHROPIC_API_KEY declared, the person's own",
511
+ binaries: 'Node 22 (pi-coding-agent engines.node >=22.19.0; pi-acp >=20), the pi executable 1.4.0 on the PATH (@earendil-works/pi-coding-agent), git',
512
+ note: "Read 2026-10-28. pi speaks no ACP itself; pi-acp 0.0.34 (MIT, an individual's, github.com/svkozak/pi-acp) speaks ACP JSON-RPC over stdio and spawns the published `pi` executable with `pi --mode rpc`, so pi 1.4.0 runs as published — chosen over @automatalabs/pi-acp 0.9.4 (Apache-2.0, in-process, which embeds pi 0.87.1 through its SDK on a fork's package). Open source under MIT on both sides, no vendor terms of their own; the model provider's terms apply to the key. Session persistence through pi's own session files (session/load).",
513
+ },
514
+ };
459
515
  export const HARNESS_CATALOGUE = {
460
516
  'claude-code': CLAUDE_CODE_HARNESS_0_0_1,
461
517
  codex: CODEX_HARNESS_0_0_1,
@@ -465,6 +521,7 @@ export const HARNESS_CATALOGUE = {
465
521
  goose: GOOSE_HARNESS_0_0_1,
466
522
  opencode: OPENCODE_HARNESS_0_0_1,
467
523
  openhands: OPENHANDS_HARNESS_0_0_1,
524
+ pi: PI_HARNESS_0_0_1,
468
525
  };
469
526
  /** A harness by id. */
470
527
  export function getHarness(harnessId) {
@@ -844,20 +901,6 @@ export const LISTED_HARNESSES = [
844
901
  servedToThirdParties: 'permitted',
845
902
  note: 'Bridges ACP to an OpenClaw Gateway, whose providers keep their own terms.',
846
903
  },
847
- {
848
- id: 'pi',
849
- name: 'pi (through pi-acp)',
850
- docs: 'https://github.com/svkozak/pi-acp',
851
- adapter: 'pi-acp',
852
- version: '0.0.34',
853
- command: 'npx -y pi-acp',
854
- licence: 'MIT',
855
- licenceSource: 'https://github.com/svkozak/pi-acp/blob/main/LICENSE',
856
- termsSource: 'https://github.com/svkozak/pi-acp/blob/main/LICENSE',
857
- credential: "pi's configured provider's API key (a subscription login carries its provider's terms)",
858
- servedToThirdParties: 'permitted',
859
- note: 'Spawns pi --mode rpc from @earendil-works/pi-coding-agent (MIT).',
860
- },
861
904
  {
862
905
  id: 'poolside',
863
906
  name: 'Poolside (pool)',
@@ -26,7 +26,7 @@ export * from './frames';
26
26
  export * from './cogs';
27
27
  export * from './harnesses';
28
28
  export * from './sessionFiles';
29
- export * from './standards';
29
+ export * from './policies';
30
30
  export * from './guards';
31
31
  export * from './gates';
32
32
  export * from './tracks';
@@ -30,7 +30,7 @@ export * from './frames.js';
30
30
  export * from './cogs.js';
31
31
  export * from './harnesses.js';
32
32
  export * from './sessionFiles.js';
33
- export * from './standards.js';
33
+ export * from './policies.js';
34
34
  export * from './guards.js';
35
35
  export * from './gates.js';
36
36
  export * from './tracks.js';
@@ -44,16 +44,10 @@ export const DATALAYER_MCP_SERVER_0_0_1 = {
44
44
  description: 'Read, edit and run Jupyter notebooks on Datalayer, with sandboxes and data',
45
45
  icon: '@datalayer/icons-react:datalayer',
46
46
  emoji: '🚀',
47
- url: '',
48
- command: 'npx',
49
- args: [
50
- '-y',
51
- 'mcp-remote',
52
- 'https://mcp.datalayer.run/mcp',
53
- '--header',
54
- 'Authorization: Bearer ${DATALAYER_API_KEY}',
55
- ],
56
- transport: 'stdio',
47
+ url: 'https://mcp.datalayer.run/mcp',
48
+ args: [],
49
+ headers: { Authorization: 'Bearer ${DATALAYER_API_KEY}' },
50
+ transport: 'streamable-http',
57
51
  enabled: false,
58
52
  isAvailable: false,
59
53
  tools: [],
@@ -66,16 +60,10 @@ export const EARTHDATA_MCP_SERVER_0_0_1 = {
66
60
  description: 'Access NASA Earthdata search and metadata capabilities',
67
61
  icon: '@datalayer/icons-react:globe-americas',
68
62
  emoji: '🌍',
69
- url: '',
70
- command: 'npx',
71
- args: [
72
- '-y',
73
- 'mcp-remote',
74
- 'https://mcp.datalayer.run/mcp?only=earthdata',
75
- '--header',
76
- 'Authorization: Bearer ${DATALAYER_API_KEY}',
77
- ],
78
- transport: 'stdio',
63
+ url: 'https://mcp.datalayer.run/mcp?only=earthdata',
64
+ args: [],
65
+ headers: { Authorization: 'Bearer ${DATALAYER_API_KEY}' },
66
+ transport: 'streamable-http',
79
67
  enabled: true,
80
68
  isAvailable: false,
81
69
  tools: [],
@@ -165,16 +153,10 @@ export const HUGGINGFACE_MCP_SERVER_0_0_1 = {
165
153
  description: 'Hugging Face models, datasets, spaces, and papers access',
166
154
  icon: '@primer/octicons-react:hubot',
167
155
  emoji: '🤗',
168
- url: '',
169
- command: 'npx',
170
- args: [
171
- '-y',
172
- 'mcp-remote',
173
- 'https://huggingface.co/mcp',
174
- '--header',
175
- 'Authorization: Bearer ${HF_TOKEN}',
176
- ],
177
- transport: 'stdio',
156
+ url: 'https://huggingface.co/mcp',
157
+ args: [],
158
+ headers: { Authorization: 'Bearer ${HF_TOKEN}' },
159
+ transport: 'streamable-http',
178
160
  enabled: false,
179
161
  isAvailable: false,
180
162
  tools: [],
@@ -187,16 +169,10 @@ export const KAGGLE_MCP_SERVER_0_0_1 = {
187
169
  description: 'Kaggle datasets, models, competitions, and notebooks access',
188
170
  icon: '@datalayer/icons-react:kaggle',
189
171
  emoji: '🏆',
190
- url: '',
191
- command: 'npx',
192
- args: [
193
- '-y',
194
- 'mcp-remote',
195
- 'https://www.kaggle.com/mcp',
196
- '--header',
197
- 'Authorization: Bearer ${KAGGLE_API_TOKEN}',
198
- ],
199
- transport: 'stdio',
172
+ url: 'https://www.kaggle.com/mcp',
173
+ args: [],
174
+ headers: { Authorization: 'Bearer ${KAGGLE_API_TOKEN}' },
175
+ transport: 'streamable-http',
200
176
  enabled: false,
201
177
  isAvailable: false,
202
178
  tools: [],
@@ -209,16 +185,10 @@ export const ODOO_ACCOUNTING_MCP_SERVER_0_0_1 = {
209
185
  description: "An accountant's day in Odoo — invoices, bills, journal entries, reconciliations, bank lines and tax returns — through the Datalayer MCP server",
210
186
  icon: '@datalayer/icons-react:odoo',
211
187
  emoji: '🧮',
212
- url: '',
213
- command: 'npx',
214
- args: [
215
- '-y',
216
- 'mcp-remote',
217
- 'https://mcp.datalayer.run/mcp?only=odoo-accounting',
218
- '--header',
219
- 'Authorization: Bearer ${DATALAYER_API_KEY}',
220
- ],
221
- transport: 'stdio',
188
+ url: 'https://mcp.datalayer.run/mcp?only=odoo-accounting',
189
+ args: [],
190
+ headers: { Authorization: 'Bearer ${DATALAYER_API_KEY}' },
191
+ transport: 'streamable-http',
222
192
  enabled: false,
223
193
  isAvailable: false,
224
194
  tools: [],
@@ -29,13 +29,15 @@ export interface MCPServer {
29
29
  enabled: boolean;
30
30
  /** List of available tools */
31
31
  tools: MCPServerTool[];
32
- /** Command to run the MCP server (e.g., 'npx', 'uvx') */
32
+ /** Command to run a local MCP server (e.g., 'npx', 'uvx'); a remote one names none and is reached at `url` */
33
33
  command?: string;
34
34
  /** Command arguments for the MCP server */
35
35
  args: string[];
36
+ /** The headers a remote server is sent with every request, `${VAR}` expanded as it starts: the bearer among them */
37
+ headers?: Record<string, string>;
36
38
  /** Whether the server is available (based on tool discovery) */
37
39
  isAvailable: boolean;
38
- /** Transport type: 'stdio', 'http', or 'streamable-http' for a server its command runs as a local HTTP process at `url` */
40
+ /** Transport type: 'stdio', 'http', or 'streamable-http' — a remote server reached at `url` with its `headers` when it has no `command`, a command run as a local HTTP process at `url` when it has one */
39
41
  transport: 'stdio' | 'http' | 'streamable-http';
40
42
  /** Environment variables required by this server (e.g., API keys) */
41
43
  requiredEnvVars?: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datalayer/agent-runtimes",
3
- "version": "1.5.87",
3
+ "version": "1.5.89",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  ".",
@@ -154,6 +154,7 @@
154
154
  "@anthropic-ai/sdk": "^0.52.0",
155
155
  "@datalayer/agent-teams": "^1.0.0",
156
156
  "@datalayer/core": "^1.2.18",
157
+ "@datalayer/cells": "^1.0.0",
157
158
  "@datalayer/decks": "^1.0.4",
158
159
  "@datalayer/design": "^1.0.10",
159
160
  "@datalayer/icons-react": "^1.0.16",
@@ -94,7 +94,7 @@ def python_of(specs_dir: Path, identity: str) -> str:
94
94
  Its own ``app.py`` when it was built in Python; otherwise the file `loop
95
95
  apps eject` writes from its spec, so every example can be read in Python.
96
96
  """
97
- from agent_runtimes.loop.apps.scaffold import eject_text # noqa: PLC0415
97
+ from agent_runtimes.apps.scaffold import eject_text # noqa: PLC0415
98
98
 
99
99
  code = specs_dir / identity / "app.py"
100
100
  if code.is_file():
@@ -105,6 +105,11 @@ def generate_python_code(specs: list[dict[str, Any]]) -> str:
105
105
  icon = f'"{spec.get("icon")}"' if spec.get("icon") else "None"
106
106
  emoji = f'"{spec.get("emoji")}"' if spec.get("emoji") else "None"
107
107
 
108
+ # A remote server names no command: it is reached at its url with its
109
+ # headers (`transport: streamable-http`, the Datalayer gateway's
110
+ # toolsets). A local one names the command that runs it.
111
+ command = f'"{spec["command"]}"' if spec.get("command") else "None"
112
+
108
113
  lines.extend(
109
114
  [
110
115
  f"{const_name} = MCPServer(",
@@ -114,17 +119,26 @@ def generate_python_code(specs: list[dict[str, Any]]) -> str:
114
119
  f' description="{spec["description"]}",',
115
120
  f" icon={icon},",
116
121
  f" emoji={emoji},",
117
- f' command="{spec["command"]}",',
122
+ f" command={command},",
118
123
  f" args={args_formatted},",
119
124
  f' transport="{spec.get("transport", "stdio")}",',
120
125
  f" enabled={spec.get('enabled', False)},",
121
126
  " tools=[],",
122
127
  ]
123
128
  )
124
- # A server its command runs as a local HTTP process: where it is
125
- # reached (W-02, `google-workspace`).
129
+ # Where an HTTP server is reached: a remote one is connected to there
130
+ # (`odoo-accounting`), a local one's command listens there (W-02,
131
+ # `google-workspace`).
126
132
  if spec.get("url"):
127
133
  lines.append(f' url="{spec["url"]}",')
134
+ # The headers a remote server is sent with every request, their
135
+ # `${VAR}` expanded as it starts (the bearer among them).
136
+ headers = spec.get("headers") or {}
137
+ if headers:
138
+ lines.append(" headers={")
139
+ for key, value in headers.items():
140
+ lines.append(f' "{key}": "{value}",')
141
+ lines.append(" },")
128
142
 
129
143
  # Add env field if present
130
144
  if env_formatted:
@@ -285,8 +299,20 @@ def generate_typescript_code(specs: list[dict[str, Any]]) -> str:
285
299
  f" icon: {icon},",
286
300
  f" emoji: {emoji},",
287
301
  f" url: '{spec.get('url', '')}',",
288
- f" command: '{spec['command']}',",
302
+ *([f" command: '{spec['command']}',"] if spec.get("command") else []),
289
303
  f" args: {args_formatted},",
304
+ *(
305
+ [
306
+ " headers: {"
307
+ + ", ".join(
308
+ f"'{key}': '{value}'"
309
+ for key, value in (spec.get("headers") or {}).items()
310
+ )
311
+ + "},"
312
+ ]
313
+ if spec.get("headers")
314
+ else []
315
+ ),
290
316
  f" transport: '{spec.get('transport', 'stdio')}',",
291
317
  f" enabled: {str(spec.get('enabled', False)).lower()},",
292
318
  " isAvailable: false,",
@@ -15,7 +15,7 @@ import json
15
15
  import sys
16
16
  from pathlib import Path
17
17
 
18
- from agent_runtimes.loop.apps.build import build
18
+ from agent_runtimes.apps.build import build
19
19
 
20
20
  ROOT = Path(__file__).parents[1]
21
21
  EXAMPLES = ROOT / "examples" / "personal-agent-protocol"