@datalayer/agent-runtimes 1.6.9 → 1.6.12

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.
@@ -167,7 +167,7 @@ export const PONG_STAGE_0_0_1 = {
167
167
  id: 'pong',
168
168
  version: '0.0.1',
169
169
  name: 'Pong',
170
- description: "Two Players at the Pong arena, each with a paddle and the arena's tools. The arena keeps the score; the first to eleven wins.",
170
+ description: "Two players at the Pong arena, each with a paddle: Blue, a Player with the arena's tools; Red, played by Jev, a decision model choosing its moves. The arena keeps the score; the first to eleven wins.",
171
171
  scene: '',
172
172
  app: '',
173
173
  battle: 'pong:0.0.1',
@@ -295,6 +295,19 @@ export interface PolicySpec {
295
295
  headers?: Record<string, string>;
296
296
  };
297
297
  } | null;
298
+ /**
299
+ * A Dogwood policy set deciding every classed action over the session's
300
+ * history (AgentCore Policy's language): `enforce` refuses what it denies,
301
+ * `log_only` records it and lets it through.
302
+ */
303
+ dogwood?: {
304
+ policies: string;
305
+ mode?: 'enforce' | 'log_only';
306
+ } | null;
307
+ /** Per user, through the organization's AgentCore Gateways: requests, tokens and connections per second or minute. */
308
+ rate_limits?: Record<string, unknown> | null;
309
+ /** The Shield firewall's document, as agent-shield takes it. */
310
+ firewall?: Record<string, unknown> | null;
298
311
  };
299
312
  }
300
313
  /**
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * A tool provided by an MCP server.
3
3
  */
4
+ import type { InstallSpec } from './skills';
4
5
  export interface MCPServerTool {
5
6
  /** Tool name/identifier */
6
7
  name: string;
@@ -70,6 +71,8 @@ export interface MCPServer {
70
71
  apiKeyUrl?: string;
71
72
  /** How it is set up, in a sentence: which key, where it goes */
72
73
  setup?: string;
74
+ /** How it is installed where an agent runs it */
75
+ install?: InstallSpec;
73
76
  /** What each tool does to the world (agentspecs.actions): its class by tool name, when it was checked, and a note */
74
77
  actions?: MCPServerActions;
75
78
  }
@@ -105,6 +105,8 @@ export interface SkillSpec {
105
105
  optionalEnvVars?: string[];
106
106
  /** Python package dependencies */
107
107
  dependencies?: string[];
108
+ /** How it is installed where an agent runs it */
109
+ install?: InstallSpec;
108
110
  /** Tags for categorization */
109
111
  tags: string[];
110
112
  /** The icon, `<package>:<name>` — `@datalayer/icons-react:odoo` (agentspecs.marks; see `SpecMark`) */
@@ -114,3 +116,13 @@ export interface SkillSpec {
114
116
  /** Whether the skill is enabled */
115
117
  enabled: boolean;
116
118
  }
119
+ /**
120
+ * How an MCP server or a skill is installed where an agent runs it: what is
121
+ * installed, the shell command that installs it on a person's own machine
122
+ * (`''` when nothing is run), and what else to know.
123
+ */
124
+ export interface InstallSpec {
125
+ type: 'npm' | 'python' | 'docker' | 'git' | 'remote' | 'built-in' | 'other';
126
+ command: string;
127
+ note?: string;
128
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datalayer/agent-runtimes",
3
- "version": "1.6.9",
3
+ "version": "1.6.12",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  ".",
@@ -1102,6 +1102,8 @@ function toAgentSkillSpec(skill: SkillSpec) {
1102
1102
  tags: skill.tags,
1103
1103
  enabled: skill.enabled,
1104
1104
  requiredEnvVars: skill.requiredEnvVars,
1105
+ icon: skill.icon,
1106
+ emoji: skill.emoji,
1105
1107
  };
1106
1108
  }
1107
1109
  """
@@ -22,6 +22,40 @@ import yaml
22
22
  from marks import check_marks
23
23
  from versioning import ensure_spec_version, version_suffix
24
24
 
25
+ #: What an ``install`` says is installed (agentspecs: mcp-servers, skills).
26
+ INSTALL_TYPES = ("npm", "python", "docker", "git", "remote", "built-in", "other")
27
+
28
+
29
+ def install_of(spec: dict) -> dict | None:
30
+ """A spec's ``install``, checked: ``{type, command, note?}``; None when it has none.
31
+
32
+ Raises
33
+ ------
34
+ ValueError
35
+ When it is not of that shape, in a sentence naming the spec.
36
+ """
37
+ install = spec.get("install")
38
+ if install is None:
39
+ return None
40
+ where = f"{spec.get('id')}: install"
41
+ if not isinstance(install, dict) or set(install) - {"type", "command", "note"}:
42
+ raise ValueError(f"{where} is {{type, command, note}}, not {install!r}")
43
+ if install.get("type") not in INSTALL_TYPES:
44
+ raise ValueError(
45
+ f"{where}.type is one of {', '.join(INSTALL_TYPES)}, not {install.get('type')!r}"
46
+ )
47
+ command = install.get("command", "")
48
+ if not isinstance(command, str):
49
+ raise ValueError(f"{where}.command is a shell command, a string")
50
+ if not command.strip() and install["type"] not in ("remote", "built-in", "other"):
51
+ raise ValueError(
52
+ f"{where}.command says how a {install['type']} install is run: it is empty"
53
+ )
54
+ out = {"type": install["type"], "command": command.strip()}
55
+ if install.get("note"):
56
+ out["note"] = " ".join(str(install["note"]).split())
57
+ return out
58
+
25
59
 
26
60
  def load_mcp_specs(specs_dir: Path) -> list[dict[str, Any]]:
27
61
  """Load all MCP server YAML specifications from a directory."""
@@ -53,7 +87,9 @@ def generate_python_code(specs: list[dict[str, Any]]) -> str:
53
87
  "import tempfile",
54
88
  "from typing import Dict",
55
89
  "",
56
- "from agent_runtimes.types import MCPServer"
90
+ "from agent_runtimes.types import "
91
+ + ("InstallSpec, " if any(spec.get("install") for spec in specs) else "")
92
+ + "MCPServer"
57
93
  + (", MCPServerAuth" if any(spec.get("auth") for spec in specs) else ""),
58
94
  "",
59
95
  "# " + "=" * 76,
@@ -170,6 +206,13 @@ def generate_python_code(specs: list[dict[str, Any]]) -> str:
170
206
  for key in ("documentation_url", "signup_url", "api_key_url", "setup"):
171
207
  if spec.get(key):
172
208
  lines.append(f" {key}={str(spec[key])!r},")
209
+ install = install_of(spec)
210
+ if install:
211
+ lines.append(
212
+ " install=InstallSpec("
213
+ + ", ".join(f"{k}={v!r}" for k, v in install.items())
214
+ + "),"
215
+ )
173
216
  if spec.get("actions"):
174
217
  lines.append(f" actions={_actions_of(spec)!r},")
175
218
  lines.extend([")", ""])
@@ -379,6 +422,11 @@ def generate_typescript_code(specs: list[dict[str, Any]]) -> str:
379
422
  )
380
423
  if spec.get(key)
381
424
  ],
425
+ *(
426
+ [f" install: {json.dumps(install_of(spec), ensure_ascii=False)},"]
427
+ if spec.get("install")
428
+ else []
429
+ ),
382
430
  *(
383
431
  [f" actions: {json.dumps(_actions_of(spec), ensure_ascii=False)},"]
384
432
  if spec.get("actions")
@@ -76,6 +76,7 @@ tags:
76
76
  enabled: false
77
77
  model: "bedrock:us.anthropic.claude-sonnet-4-6"
78
78
  harness: pydantic-ai
79
+ identity: datalayer-acting-agent
79
80
 
80
81
  sandbox_variant: {variant}
81
82
  memory: ephemeral
@@ -13,6 +13,7 @@ Usage:
13
13
  """
14
14
 
15
15
  import argparse
16
+ import json
16
17
  import sys
17
18
  from pathlib import Path
18
19
  from typing import Any
@@ -21,6 +22,40 @@ import yaml
21
22
  from marks import check_marks
22
23
  from versioning import ensure_spec_version, version_suffix
23
24
 
25
+ #: What an ``install`` says is installed (agentspecs: mcp-servers, skills).
26
+ INSTALL_TYPES = ("npm", "python", "docker", "git", "remote", "built-in", "other")
27
+
28
+
29
+ def install_of(spec: dict) -> dict | None:
30
+ """A spec's ``install``, checked: ``{type, command, note?}``; None when it has none.
31
+
32
+ Raises
33
+ ------
34
+ ValueError
35
+ When it is not of that shape, in a sentence naming the spec.
36
+ """
37
+ install = spec.get("install")
38
+ if install is None:
39
+ return None
40
+ where = f"{spec.get('id')}: install"
41
+ if not isinstance(install, dict) or set(install) - {"type", "command", "note"}:
42
+ raise ValueError(f"{where} is {{type, command, note}}, not {install!r}")
43
+ if install.get("type") not in INSTALL_TYPES:
44
+ raise ValueError(
45
+ f"{where}.type is one of {', '.join(INSTALL_TYPES)}, not {install.get('type')!r}"
46
+ )
47
+ command = install.get("command", "")
48
+ if not isinstance(command, str):
49
+ raise ValueError(f"{where}.command is a shell command, a string")
50
+ if not command.strip() and install["type"] not in ("remote", "built-in", "other"):
51
+ raise ValueError(
52
+ f"{where}.command says how a {install['type']} install is run: it is empty"
53
+ )
54
+ out = {"type": install["type"], "command": command.strip()}
55
+ if install.get("note"):
56
+ out["note"] = " ".join(str(install["note"]).split())
57
+ return out
58
+
24
59
 
25
60
  def _fmt_list(items: list[str]) -> str:
26
61
  """Format a list of strings with double quotes for ruff compliance."""
@@ -57,7 +92,9 @@ def generate_python_code(specs: list[dict[str, Any]]) -> str:
57
92
  "import os",
58
93
  "from typing import Dict, List",
59
94
  "",
60
- "from agent_runtimes.types import SkillSpec",
95
+ "from agent_runtimes.types import "
96
+ + ("InstallSpec, " if any(spec.get("install") for spec in specs) else "")
97
+ + "SkillSpec",
61
98
  "",
62
99
  "",
63
100
  "# " + "=" * 76,
@@ -113,6 +150,15 @@ def generate_python_code(specs: list[dict[str, Any]]) -> str:
113
150
  f" envvars={_fmt_list(spec.get('envvars', []))},",
114
151
  f" optional_env_vars={_fmt_list(spec.get('optional_env_vars', []))},",
115
152
  f" dependencies={_fmt_list(spec.get('dependencies', []))},",
153
+ *(
154
+ [
155
+ " install=InstallSpec("
156
+ + ", ".join(f"{k}={v!r}" for k, v in install_of(spec).items())
157
+ + "),"
158
+ ]
159
+ if spec.get("install")
160
+ else []
161
+ ),
116
162
  f" tags={_fmt_list(spec.get('tags', []))},",
117
163
  f" icon={icon},",
118
164
  f" emoji={emoji},",
@@ -277,6 +323,11 @@ def generate_typescript_code(specs: list[dict[str, Any]]) -> str:
277
323
  f" requiredEnvVars: {envvars_json},",
278
324
  f" optionalEnvVars: {optional_env_vars_json},",
279
325
  f" dependencies: {dependencies_json},",
326
+ *(
327
+ [f" install: {json.dumps(install_of(spec), ensure_ascii=False)},"]
328
+ if spec.get("install")
329
+ else []
330
+ ),
280
331
  f" tags: {tags_json},",
281
332
  f" icon: {icon},",
282
333
  f" emoji: {emoji},",