@datalayer/agent-runtimes 1.6.49 → 1.6.52

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 (101) hide show
  1. package/dist-embed/chunks/{CollapsiblePlugin-DyobyCLm.js → CollapsiblePlugin-O3bSOnT2.js} +1 -1
  2. package/dist-embed/chunks/{DeckComponent-B5IMw4r1.js → DeckComponent-BBzW9lJ6.js} +1 -1
  3. package/dist-embed/chunks/{DocumentView-IqGVIpnF.js → DocumentView-cAXnkJfm.js} +1 -1
  4. package/dist-embed/chunks/{EphemeralDocument-DZ8Wk5du.js → EphemeralDocument-Dhya_KwN.js} +1 -1
  5. package/dist-embed/chunks/{ExcalidrawComponent-9ant-hu6.js → ExcalidrawComponent-B8OYc8cp.js} +1 -1
  6. package/dist-embed/chunks/{ExcalidrawModal-92wiYWnH.js → ExcalidrawModal-BW5tAKHi.js} +1 -1
  7. package/dist-embed/chunks/{JupyterLexicalExtension-DbMi7Dam.js → JupyterLexicalExtension-BZdwpb1B.js} +5 -5
  8. package/dist-embed/chunks/{NotebookToolSurfaces-Gk8Hsn0c.js → NotebookToolSurfaces-Bh-LUzM-.js} +1 -1
  9. package/dist-embed/chunks/{Output-DtWAAuKd.js → Output-DNFUWYih.js} +8 -8
  10. package/dist-embed/chunks/{YouTubePlugin-DS4rJSGB.js → YouTubePlugin-N0bkcExZ.js} +1 -1
  11. package/dist-embed/chunks/{ar-SA-G6X2FPQ2-oGeNqqRN.js → ar-SA-G6X2FPQ2-E6Tk_QWw.js} +1 -1
  12. package/dist-embed/chunks/{az-AZ-76LH7QW2-Ckdua9fG.js → az-AZ-76LH7QW2-K7Oiu-pY.js} +1 -1
  13. package/dist-embed/chunks/{bg-BG-XCXSNQG7-D0NWa5AJ.js → bg-BG-XCXSNQG7-6JXDKtWk.js} +1 -1
  14. package/dist-embed/chunks/{bn-BD-2XOGV67Q-CZbU71zu.js → bn-BD-2XOGV67Q-Djg2MZl8.js} +1 -1
  15. package/dist-embed/chunks/{ca-ES-6MX7JW3Y-CDkEhhvJ.js → ca-ES-6MX7JW3Y-BTPklJXF.js} +1 -1
  16. package/dist-embed/chunks/{cs-CZ-2BRQDIVT-D3Tf2yLX.js → cs-CZ-2BRQDIVT-gVrmcBET.js} +1 -1
  17. package/dist-embed/chunks/{da-DK-5WZEPLOC-8FuM_s_4.js → da-DK-5WZEPLOC-BBbJOknE.js} +1 -1
  18. package/dist-embed/chunks/{de-DE-XR44H4JA-BczLv19p.js → de-DE-XR44H4JA-DDAe1n4-.js} +1 -1
  19. package/dist-embed/chunks/{el-GR-BZB4AONW-XmdkMj04.js → el-GR-BZB4AONW-_O5d2fpo.js} +1 -1
  20. package/dist-embed/chunks/{es-ES-U4NZUMDT-BM8o7VhK.js → es-ES-U4NZUMDT-8tcn7kxA.js} +1 -1
  21. package/dist-embed/chunks/{eu-ES-A7QVB2H4-C92PACcO.js → eu-ES-A7QVB2H4-swWuvm8T.js} +1 -1
  22. package/dist-embed/chunks/{fa-IR-HGAKTJCU-C0v8l3W9.js → fa-IR-HGAKTJCU-BMdvmquE.js} +1 -1
  23. package/dist-embed/chunks/{fi-FI-Z5N7JZ37-C5OmBq6V.js → fi-FI-Z5N7JZ37-CtiUEJw3.js} +1 -1
  24. package/dist-embed/chunks/{fr-FR-RHASNOE6-D2EL4poR.js → fr-FR-RHASNOE6-9oRayPJc.js} +1 -1
  25. package/dist-embed/chunks/{gl-ES-HMX3MZ6V-YWFm4WxA.js → gl-ES-HMX3MZ6V-BOznTumG.js} +1 -1
  26. package/dist-embed/chunks/{he-IL-6SHJWFNN-mX7JSlN-.js → he-IL-6SHJWFNN-DUVMGygM.js} +1 -1
  27. package/dist-embed/chunks/{hi-IN-IWLTKZ5I-D6yhTM4e.js → hi-IN-IWLTKZ5I-oYSW7Bx5.js} +1 -1
  28. package/dist-embed/chunks/{hu-HU-A5ZG7DT2-eb6aNn0F.js → hu-HU-A5ZG7DT2-BJFV7jEm.js} +1 -1
  29. package/dist-embed/chunks/{id-ID-SAP4L64H-EhGa_Mrn.js → id-ID-SAP4L64H-DG1Dwi63.js} +1 -1
  30. package/dist-embed/chunks/{index-mXYl0SDo.js → index-BIl72fAm.js} +2 -2
  31. package/dist-embed/chunks/{it-IT-JPQ66NNP-BEhvmrUK.js → it-IT-JPQ66NNP-B6bSeHaH.js} +1 -1
  32. package/dist-embed/chunks/{ja-JP-DBVTYXUO-lmsxmH6A.js → ja-JP-DBVTYXUO-BRWx5KlM.js} +1 -1
  33. package/dist-embed/chunks/{kaa-6HZHGXH3-C2eZOrFk.js → kaa-6HZHGXH3-SpLqZeKb.js} +1 -1
  34. package/dist-embed/chunks/{kab-KAB-ZGHBKWFO-BtO_Ccgd.js → kab-KAB-ZGHBKWFO-dGdDDYwn.js} +1 -1
  35. package/dist-embed/chunks/{kk-KZ-P5N5QNE5-BlIG0olU.js → kk-KZ-P5N5QNE5-ZTSO8W-K.js} +1 -1
  36. package/dist-embed/chunks/{km-KH-HSX4SM5Z-Dixy2EU_.js → km-KH-HSX4SM5Z-CleCdXdx.js} +1 -1
  37. package/dist-embed/chunks/{ko-KR-MTYHY66A-CUkVgSOW.js → ko-KR-MTYHY66A-Ff92uevY.js} +1 -1
  38. package/dist-embed/chunks/{ku-TR-6OUDTVRD-BKl1H1lo.js → ku-TR-6OUDTVRD-cBz5nBl7.js} +1 -1
  39. package/dist-embed/chunks/{lib-BuHiJKfL.js → lib-6TPLItTb.js} +1 -1
  40. package/dist-embed/chunks/{lib-DEmXqC05.js → lib-Bd-DHxvY.js} +1 -1
  41. package/dist-embed/chunks/{lib-3oZnFGZf.js → lib-CCVTi39i.js} +1 -1
  42. package/dist-embed/chunks/{lib-C65GpCKu.js → lib-CU3GZ7XB.js} +1 -1
  43. package/dist-embed/chunks/{lib-ClP1grrt.js → lib-CUtLTghG.js} +1 -1
  44. package/dist-embed/chunks/{lib-BCX_PXlV.js → lib-CYUbVv7y.js} +1 -1
  45. package/dist-embed/chunks/{lib-DdpVsCS-.js → lib-CaT_vwu7.js} +1 -1
  46. package/dist-embed/chunks/{lib-D7ZIPOgc.js → lib-Co6Mrwf9.js} +1 -1
  47. package/dist-embed/chunks/{lib-B9Uql7XT.js → lib-Cq0WigYa.js} +1 -1
  48. package/dist-embed/chunks/{lib-Bj5kYV-X.js → lib-CuhljIuI.js} +1 -1
  49. package/dist-embed/chunks/{lib-BpgMIewI.js → lib-DNmIagIq.js} +1 -1
  50. package/dist-embed/chunks/{lib-C1F_0rhP.js → lib-Dn5yvA1f.js} +1 -1
  51. package/dist-embed/chunks/{lib-jE6-GvLb.js → lib-FBlRWkj7.js} +1 -1
  52. package/dist-embed/chunks/{lib-ByfYxpOp.js → lib-Ipz2nrlj.js} +1 -1
  53. package/dist-embed/chunks/{lib-BBoRpP0j.js → lib-O-8MG1Py.js} +1 -1
  54. package/dist-embed/chunks/{lib-UcItgdUY.js → lib-pMZ7syE4.js} +1 -1
  55. package/dist-embed/chunks/{lib-DHfhUiNX.js → lib-sw4DQLI8.js} +1 -1
  56. package/dist-embed/chunks/{lib-DgCQUDNp.js → lib-x42_0GMo.js} +1 -1
  57. package/dist-embed/chunks/{lt-LT-XHIRWOB4-TTj82TW7.js → lt-LT-XHIRWOB4-DfXp5Gx2.js} +1 -1
  58. package/dist-embed/chunks/{lv-LV-5QDEKY6T-DLiLVd-V.js → lv-LV-5QDEKY6T-DNVNDCM1.js} +1 -1
  59. package/dist-embed/chunks/{mr-IN-CRQNXWMA-CiVi-oiY.js → mr-IN-CRQNXWMA-CnaNZ5Wl.js} +1 -1
  60. package/dist-embed/chunks/{my-MM-5M5IBNSE-DiSnYIcD.js → my-MM-5M5IBNSE-B5iDGCTn.js} +1 -1
  61. package/dist-embed/chunks/{nb-NO-T6EIAALU-DfSOBb64.js → nb-NO-T6EIAALU-LWClJ4r8.js} +1 -1
  62. package/dist-embed/chunks/{nl-NL-IS3SIHDZ-BF72RX5n.js → nl-NL-IS3SIHDZ-DSjZNAbY.js} +1 -1
  63. package/dist-embed/chunks/{nn-NO-6E72VCQL-Ck3xjqMu.js → nn-NO-6E72VCQL-2WY6Xk1L.js} +1 -1
  64. package/dist-embed/chunks/{oc-FR-POXYY2M6-CEdstZI1.js → oc-FR-POXYY2M6-Ddep6jAF.js} +1 -1
  65. package/dist-embed/chunks/{pa-IN-N4M65BXN-D8DDwUFn.js → pa-IN-N4M65BXN-BqkRbMII.js} +1 -1
  66. package/dist-embed/chunks/{percentages-BXMCSKIN-CxyBCxgG.js → percentages-BXMCSKIN-2Z9DWWGZ.js} +3 -3
  67. package/dist-embed/chunks/{pl-PL-T2D74RX3-bJIlJVUJ.js → pl-PL-T2D74RX3-B2bWZwI4.js} +1 -1
  68. package/dist-embed/chunks/{pt-BR-5N22H2LF-T_zS_1UI.js → pt-BR-5N22H2LF-C7L47RXu.js} +1 -1
  69. package/dist-embed/chunks/{pt-PT-UZXXM6DQ-BGYBI-AZ.js → pt-PT-UZXXM6DQ-BVYWqiIW.js} +1 -1
  70. package/dist-embed/chunks/{ro-RO-JPDTUUEW-BF-LNyWr.js → ro-RO-JPDTUUEW-CCpzzSh1.js} +1 -1
  71. package/dist-embed/chunks/{ru-RU-B4JR7IUQ-CYsp0VFS.js → ru-RU-B4JR7IUQ-D6MNDylx.js} +1 -1
  72. package/dist-embed/chunks/{si-LK-N5RQ5JYF-DPP2zzI4.js → si-LK-N5RQ5JYF-eSMzuFfz.js} +1 -1
  73. package/dist-embed/chunks/{sk-SK-C5VTKIMK-Bsy5tZJ9.js → sk-SK-C5VTKIMK-DCnPMFe9.js} +1 -1
  74. package/dist-embed/chunks/{sl-SI-NN7IZMDC-BSN6metY.js → sl-SI-NN7IZMDC-DrRNO1Te.js} +1 -1
  75. package/dist-embed/chunks/{subset-shared.chunk-cWEwjmHn.js → subset-shared.chunk-1Lj1fws8.js} +1 -1
  76. package/dist-embed/chunks/{subset-worker.chunk-CoJnEmh6.js → subset-worker.chunk-BY_1WzGX.js} +1 -1
  77. package/dist-embed/chunks/{sv-SE-XGPEYMSR-DtD64Ekq.js → sv-SE-XGPEYMSR-C1C77U8p.js} +1 -1
  78. package/dist-embed/chunks/{ta-IN-2NMHFXQM-DgbGGIjW.js → ta-IN-2NMHFXQM-kh2J7KJQ.js} +1 -1
  79. package/dist-embed/chunks/{th-TH-HPSO5L25-CCZDC3pr.js → th-TH-HPSO5L25-CY7qyqUN.js} +1 -1
  80. package/dist-embed/chunks/{tr-TR-DEFEU3FU-akGa6iYJ.js → tr-TR-DEFEU3FU-DcrDFByj.js} +1 -1
  81. package/dist-embed/chunks/{uk-UA-QMV73CPH-t35eBlzl.js → uk-UA-QMV73CPH-D0oYF2ZU.js} +1 -1
  82. package/dist-embed/chunks/{vi-VN-M7AON7JQ-xWA8FWTO.js → vi-VN-M7AON7JQ-PLL4mabe.js} +1 -1
  83. package/dist-embed/chunks/{zh-CN-LNUGB5OW-D7M8yyYf.js → zh-CN-LNUGB5OW-CTSXkL4H.js} +1 -1
  84. package/dist-embed/chunks/{zh-HK-E62DVLB3-DvMmnROR.js → zh-HK-E62DVLB3-CfhgYw9m.js} +1 -1
  85. package/dist-embed/chunks/{zh-TW-RAJ6MFWO-DSL_-5li.js → zh-TW-RAJ6MFWO-BTJqeNq3.js} +1 -1
  86. package/dist-embed/datalayer-app-main.js +14 -14
  87. package/lib/specs/actions.js +6 -28
  88. package/lib/specs/agents/agents.d.ts +2 -1
  89. package/lib/specs/agents/agents.js +32 -9
  90. package/lib/specs/agents/index.d.ts +2 -1
  91. package/lib/specs/agents/index.js +7 -1
  92. package/lib/specs/apps.js +40 -43
  93. package/lib/specs/appspecSchema.js +6 -0
  94. package/lib/specs/backendTools.d.ts +3 -0
  95. package/lib/specs/backendTools.js +59 -0
  96. package/lib/types/agentspecs.d.ts +37 -0
  97. package/lib/types/agentspecs.js +15 -0
  98. package/lib/types/tools.d.ts +5 -0
  99. package/package.json +1 -1
  100. package/scripts/codegen/generate_agents.py +78 -4
  101. package/scripts/codegen/generate_backend_tools.py +10 -0
@@ -962,6 +962,11 @@ export interface AppConnectionSpec {
962
962
  as: 'owner' | 'user';
963
963
  /** The tools it may use, by name or pattern; all when empty. */
964
964
  only: string[];
965
+ /**
966
+ * Whether it runs without this connection when its secrets are not set up,
967
+ * as its agent does (agentspecs 0.0.189): only a server its agent says optional.
968
+ */
969
+ optional?: boolean;
965
970
  }
966
971
  /** How a Personal Agent Protocol company is reached (PAP §3.1). */
967
972
  export type PapInterface = 'agent' | 'openapi' | 'mcp' | 'web';
@@ -1869,6 +1874,32 @@ export interface AgentPolicy {
1869
1874
  * keep it out (`listed: false`), as the home page's five since agentspecs 0.0.187.
1870
1875
  */
1871
1876
  export declare const isAgentspecOffered: (spec: Pick<Agentspec, "enabled" | "listed"> | undefined | null) => boolean;
1877
+ /**
1878
+ * What an agent starts without (agentspecs 0.0.188, the user, 14 November
1879
+ * 2026): MCP servers and skills of its own, by id without version. One whose
1880
+ * secrets are not set up is left out, and the agent told which, instead of
1881
+ * holding the start back; of each group of `atLeastOne`, one must be set up.
1882
+ */
1883
+ export interface AgentspecOptional {
1884
+ mcpServers: string[];
1885
+ skills: string[];
1886
+ /**
1887
+ * Backend tools set up by an account the person links in Settings
1888
+ * (`linkedAccounts`, agentspecs 0.0.189): the posting tools of
1889
+ * datalayer-social, left out while that account is not linked.
1890
+ */
1891
+ backendTools?: string[];
1892
+ atLeastOne: string[][];
1893
+ }
1894
+ /** A component of an agent: one of its MCP servers, skills or backend tools. */
1895
+ export type AgentspecComponentKind = 'mcpServer' | 'skill' | 'backendTool';
1896
+ /** Whether the agent starts without this MCP server, skill or backend tool when it is not set up. */
1897
+ export declare const isAgentspecComponentOptional: (spec: Pick<Agentspec, "optional"> | undefined | null, kind: AgentspecComponentKind, id: string) => boolean;
1898
+ /**
1899
+ * The groups of an agent's optional components none of which is set up:
1900
+ * each names its members by id. `isSetUp` says whether one is, by id.
1901
+ */
1902
+ export declare const unmetAgentspecGroups: (spec: Pick<Agentspec, "optional"> | undefined | null, isSetUp: (id: string) => boolean) => string[][];
1872
1903
  /** The engines that run and host an agent (`runtime_engine`), the default first. */
1873
1904
  export declare const RUNTIME_ENGINES: readonly ["datalayer", "kagent", "agentcore"];
1874
1905
  /** What runs and hosts an agent: a Datalayer runtime, kagent, or AWS AgentCore. */
@@ -1902,6 +1933,12 @@ export interface Agentspec {
1902
1933
  * not listed runs by id and as a default, without being offered.
1903
1934
  */
1904
1935
  listed?: boolean;
1936
+ /**
1937
+ * What the agent starts without (agentspecs 0.0.188): its MCP servers and
1938
+ * skills, by id, left out when their secrets are not set up, and groups of
1939
+ * which one must be.
1940
+ */
1941
+ optional?: AgentspecOptional;
1905
1942
  /** AI model identifier to use for this agent */
1906
1943
  model?: string;
1907
1944
  /**
@@ -11,6 +11,21 @@ export const stagedRefOf = (stage) => stage.scene || stage.app || stage.battle;
11
11
  * keep it out (`listed: false`), as the home page's five since agentspecs 0.0.187.
12
12
  */
13
13
  export const isAgentspecOffered = (spec) => spec?.enabled === true && spec.listed !== false;
14
+ const componentIdOf = (ref) => String(ref ?? '').split(':')[0];
15
+ /** Whether the agent starts without this MCP server, skill or backend tool when it is not set up. */
16
+ export const isAgentspecComponentOptional = (spec, kind, id) => {
17
+ const listed = kind === 'mcpServer'
18
+ ? spec?.optional?.mcpServers
19
+ : kind === 'skill'
20
+ ? spec?.optional?.skills
21
+ : spec?.optional?.backendTools;
22
+ return (listed ?? []).includes(componentIdOf(id));
23
+ };
24
+ /**
25
+ * The groups of an agent's optional components none of which is set up:
26
+ * each names its members by id. `isSetUp` says whether one is, by id.
27
+ */
28
+ export const unmetAgentspecGroups = (spec, isSetUp) => (spec?.optional?.atLeastOne ?? []).filter(group => !group.some(id => isSetUp(componentIdOf(id))));
14
29
  /** The engines that run and host an agent (`runtime_engine`), the default first. */
15
30
  export const RUNTIME_ENGINES = ['datalayer', 'kagent', 'agentcore'];
16
31
  /** How an engine is named to a person. */
@@ -33,6 +33,11 @@ export interface BackendToolSpec {
33
33
  requiresApproval?: boolean;
34
34
  /** Runtime binding metadata */
35
35
  runtime: BackendToolRuntimeSpec;
36
+ /**
37
+ * The accounts the person links in Settings that set it up, one of them
38
+ * enough (`x`, `bluesky`; agentspecs 0.0.189): no secret is pasted for it.
39
+ */
40
+ linkedAccounts?: string[];
36
41
  /** The icon, `<package>:<name>` — `@datalayer/icons-react:odoo` (agentspecs.marks; see `SpecMark`) */
37
42
  icon?: string;
38
43
  /** Drawn where there is no icon */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datalayer/agent-runtimes",
3
- "version": "1.6.49",
3
+ "version": "1.6.52",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  ".",
@@ -514,6 +514,47 @@ def check_model_additionals(
514
514
  raise SystemExit("\n".join(problems))
515
515
 
516
516
 
517
+ def optional_of(spec: Dict[str, Any]) -> Dict[str, Any] | None:
518
+ """What an agent starts without (agentspecs 0.0.188), by id without version.
519
+
520
+ Refuses an entry that is not among the agent's own MCP servers, skills or
521
+ backend tools (a backend tool set up by a linked account, 0.0.189), and a
522
+ group naming what is not optional: the catalogue says it once. The backend
523
+ tools are said only when there are some, so the other agents read as before.
524
+ """
525
+ optional = spec.get("optional")
526
+ if optional is None:
527
+ return None
528
+ base = lambda ref: str(ref).split(":")[0] # noqa: E731
529
+ servers = [base(ref) for ref in optional.get("mcp_servers") or []]
530
+ skills = [base(ref) for ref in optional.get("skills") or []]
531
+ tools = [base(ref) for ref in optional.get("backend_tools") or []]
532
+ own_servers = {base(ref) for ref in spec.get("mcp_servers") or []}
533
+ own_skills = {base(ref) for ref in spec.get("skills") or []}
534
+ own_tools = {base(ref) for ref in spec.get("backend_tools") or []}
535
+ agent = spec.get("id")
536
+ for kind, named, own in (
537
+ ("MCP server", servers, own_servers),
538
+ ("skill", skills, own_skills),
539
+ ("backend tool", tools, own_tools),
540
+ ):
541
+ for ref in named:
542
+ if ref not in own:
543
+ raise SystemExit(f"{agent}: optional {kind} {ref} is not its own")
544
+ groups = [
545
+ [base(ref) for ref in group] for group in optional.get("at_least_one") or []
546
+ ]
547
+ for group in groups:
548
+ for ref in group:
549
+ if ref not in servers and ref not in skills and ref not in tools:
550
+ raise SystemExit(f"{agent}: {ref} in at_least_one is not optional")
551
+ said: Dict[str, Any] = {"mcp_servers": servers, "skills": skills}
552
+ if tools:
553
+ said["backend_tools"] = tools
554
+ said["at_least_one"] = groups
555
+ return said
556
+
557
+
517
558
  def generate_python_code(specs: List[tuple[str, Dict[str, Any]]]) -> str:
518
559
  """Generate Python code from agent specifications."""
519
560
  # Header
@@ -665,6 +706,10 @@ from agent_runtimes.types import (
665
706
  if model_additionals
666
707
  else ""
667
708
  )
709
+ optional = optional_of(spec)
710
+ optional_py_line = (
711
+ f" optional={_fmt_py_literal(optional)},\n" if optional else ""
712
+ )
668
713
  voice = voice_of(spec)
669
714
  voice_py_line = (
670
715
  f" voice={_fmt_py_literal(voice)},\n" if voice is not None else ""
@@ -797,7 +842,7 @@ from agent_runtimes.types import (
797
842
  domain={f'"{domain_value}"' if domain_value else "None"},
798
843
  enabled={spec.get("enabled", True)},
799
844
  listed={spec.get("listed", True)},
800
- model={model_str},
845
+ {optional_py_line} model={model_str},
801
846
  {model_additionals_py_line} inference_provider={inference_provider_str},
802
847
  mcp_servers=[{mcp_servers_str}],
803
848
  skills={_fmt_list(skill_refs)},
@@ -1066,6 +1111,9 @@ def generate_typescript_code(
1066
1111
  import type { Agentspec } from '"""
1067
1112
  code += types_import_path
1068
1113
  code += """';
1114
+ import { isAgentspecComponentOptional } from '"""
1115
+ code += types_import_path
1116
+ code += """/agentspecs';
1069
1117
  """
1070
1118
 
1071
1119
  # Only add MCP server imports if needed
@@ -1309,6 +1357,25 @@ const FRONTEND_TOOL_MAP: Record<string, any> = {
1309
1357
  if model_additionals
1310
1358
  else ""
1311
1359
  )
1360
+ optional = optional_of(spec)
1361
+ optional_ts_line = (
1362
+ " optional: "
1363
+ + _fmt_ts_literal(
1364
+ {
1365
+ "mcpServers": optional["mcp_servers"],
1366
+ "skills": optional["skills"],
1367
+ **(
1368
+ {"backendTools": optional["backend_tools"]}
1369
+ if optional.get("backend_tools")
1370
+ else {}
1371
+ ),
1372
+ "atLeastOne": optional["at_least_one"],
1373
+ }
1374
+ )
1375
+ + ",\n"
1376
+ if optional
1377
+ else ""
1378
+ )
1312
1379
  voice = voice_of(spec)
1313
1380
  voice_ts_line = (
1314
1381
  f" voice: {_fmt_ts_literal(voice)},\n" if voice is not None else ""
@@ -1390,7 +1457,7 @@ const FRONTEND_TOOL_MAP: Record<string, any> = {
1390
1457
  domain: {domain_ts},
1391
1458
  enabled: {str(spec.get("enabled", True)).lower()},
1392
1459
  listed: {str(spec.get("listed", True)).lower()},
1393
- model: {model_ts},
1460
+ {optional_ts_line} model: {model_ts},
1394
1461
  {model_additionals_ts_line}{inference_provider_line} mcpServers: [{mcp_servers_str}],
1395
1462
  skills: [{skills_str}].filter(Boolean) as SkillSpec[],
1396
1463
  backendTools: [{tools_str}],
@@ -1487,17 +1554,20 @@ export function listAgentspecs(prefix?: string): Agentspec[] {
1487
1554
  * Collect all required environment variables for an agent spec.
1488
1555
  *
1489
1556
  * Iterates over the spec's MCP servers and skills and returns the
1490
- * deduplicated union of their `requiredEnvVars` arrays.
1557
+ * deduplicated union of their `requiredEnvVars` arrays, without those of
1558
+ * the servers and skills it starts without (`optional`, agentspecs 0.0.188).
1491
1559
  */
1492
1560
  export function getAgentspecRequiredEnvVars(spec: Agentspec): string[] {
1493
1561
  const vars = new Set<string>();
1494
1562
  const baseEnvVar = (v: string): string => v.split(':')[0] ?? v;
1495
1563
  for (const server of spec.mcpServers) {
1564
+ if (isAgentspecComponentOptional(spec, 'mcpServer', server.id)) continue;
1496
1565
  for (const v of server.requiredEnvVars ?? []) {
1497
1566
  vars.add(baseEnvVar(v));
1498
1567
  }
1499
1568
  }
1500
1569
  for (const skill of spec.skills) {
1570
+ if (isAgentspecComponentOptional(spec, 'skill', skill.id)) continue;
1501
1571
  for (const v of skill.requiredEnvVars ?? []) {
1502
1572
  vars.add(baseEnvVar(v));
1503
1573
  }
@@ -1742,6 +1812,7 @@ __all__ = ["AGENTSPECS", "get_agent_spec", "list_agentspecs"]
1742
1812
  */
1743
1813
 
1744
1814
  import type { Agentspec } from '../../types';
1815
+ import { isAgentspecComponentOptional } from '../../types/agentspecs';
1745
1816
 
1746
1817
  """
1747
1818
 
@@ -1799,16 +1870,19 @@ export function listAgentspecs(prefix?: string): Agentspec[] {
1799
1870
  }
1800
1871
 
1801
1872
  /**
1802
- * Collect all required environment variables for an agent spec.
1873
+ * Collect all required environment variables for an agent spec, without
1874
+ * those of the servers and skills it starts without (`optional`).
1803
1875
  */
1804
1876
  export function getAgentspecRequiredEnvVars(spec: Agentspec): string[] {
1805
1877
  const vars = new Set<string>();
1806
1878
  for (const server of spec.mcpServers) {
1879
+ if (isAgentspecComponentOptional(spec, 'mcpServer', server.id)) continue;
1807
1880
  for (const v of server.requiredEnvVars ?? []) {
1808
1881
  vars.add(v);
1809
1882
  }
1810
1883
  }
1811
1884
  for (const skill of spec.skills) {
1885
+ if (isAgentspecComponentOptional(spec, 'skill', skill.id)) continue;
1812
1886
  for (const v of skill.requiredEnvVars ?? []) {
1813
1887
  vars.add(v);
1814
1888
  }
@@ -135,6 +135,11 @@ def generate_python_code(specs: list[dict[str, Any]]) -> str:
135
135
  f' package="{runtime["package"]}",',
136
136
  f' method="{runtime["method"]}",',
137
137
  " ),",
138
+ *(
139
+ [f" linked_accounts={_fmt_list(spec['linked_accounts'])},"]
140
+ if spec.get("linked_accounts")
141
+ else []
142
+ ),
138
143
  f" icon={icon},",
139
144
  f" emoji={emoji},",
140
145
  ")",
@@ -238,6 +243,11 @@ def generate_typescript_code(specs: list[dict[str, Any]]) -> str:
238
243
  f" package: '{runtime['package']}',",
239
244
  f" method: '{runtime['method']}',",
240
245
  " },",
246
+ *(
247
+ [f" linkedAccounts: {json.dumps(list(spec['linked_accounts']))},"]
248
+ if spec.get("linked_accounts")
249
+ else []
250
+ ),
241
251
  f" icon: {icon},",
242
252
  f" emoji: {emoji},",
243
253
  "};",