@withgateway/sdk 0.9.1 → 0.9.3

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 (84) hide show
  1. package/dist/agents/index.d.mts +12 -4
  2. package/dist/agents/index.d.ts +12 -4
  3. package/dist/agents/index.js +30 -0
  4. package/dist/agents/index.js.map +1 -1
  5. package/dist/agents/index.mjs +30 -0
  6. package/dist/agents/index.mjs.map +1 -1
  7. package/dist/cli.js +2291 -945
  8. package/dist/cli.js.map +1 -1
  9. package/dist/cli.mjs +2290 -944
  10. package/dist/cli.mjs.map +1 -1
  11. package/dist/files/index.js.map +1 -1
  12. package/dist/files/index.mjs.map +1 -1
  13. package/dist/index.js +325 -184
  14. package/dist/index.js.map +1 -1
  15. package/dist/index.mjs +324 -183
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/traces/index.js.map +1 -1
  18. package/dist/traces/index.mjs.map +1 -1
  19. package/dist/tracing/index.js +1 -1
  20. package/dist/tracing/index.js.map +1 -1
  21. package/dist/tracing/index.mjs +1 -1
  22. package/dist/tracing/index.mjs.map +1 -1
  23. package/dist/worlds/index.d.mts +3 -1
  24. package/dist/worlds/index.d.ts +3 -1
  25. package/dist/worlds/index.js +178 -67
  26. package/dist/worlds/index.js.map +1 -1
  27. package/dist/worlds/index.mjs +177 -66
  28. package/dist/worlds/index.mjs.map +1 -1
  29. package/package.json +1 -1
  30. package/runtime/gatewaysdk/environment/bundle_manifest.py +297 -9
  31. package/runtime/gatewaysdk/environment/factory_documents.py +670 -0
  32. package/runtime/gatewaysdk/environment/factory_rules.py +973 -0
  33. package/runtime/gatewaysdk/environment/factory_shapes.py +253 -0
  34. package/runtime/gatewaysdk/environment/factory_spine.py +1155 -0
  35. package/runtime/gatewaysdk/environment/factory_spine_shapes.py +480 -0
  36. package/runtime/gatewaysdk/environment/schema/admission.py +61 -59
  37. package/runtime/gatewaysdk/environment/schema/cast.py +133 -67
  38. package/runtime/gatewaysdk/environment/schema/compiler.py +16 -17
  39. package/runtime/gatewaysdk/environment/schema/handler_errors.py +58 -4
  40. package/runtime/gatewaysdk/environment/schema/host.py +21 -2
  41. package/runtime/gatewaysdk/environment/schema/host_control.py +3 -1
  42. package/runtime/gatewaysdk/environment/schema/host_loops.py +27 -4
  43. package/runtime/gatewaysdk/environment/schema/host_metrics.py +69 -0
  44. package/runtime/gatewaysdk/environment/schema/host_requests.py +21 -0
  45. package/runtime/gatewaysdk/environment/schema/host_session.py +7 -0
  46. package/runtime/gatewaysdk/environment/schema/host_versions.py +4 -0
  47. package/runtime/gatewaysdk/environment/schema/host_workers.py +172 -50
  48. package/runtime/gatewaysdk/environment/schema/ingest.py +12 -3
  49. package/runtime/gatewaysdk/environment/schema/mapping.py +1 -1
  50. package/runtime/gatewaysdk/environment/schema/measured_tests.py +187 -0
  51. package/runtime/gatewaysdk/environment/schema/platform.py +57 -3
  52. package/runtime/gatewaysdk/environment/schema/platform_query.py +4 -3
  53. package/runtime/gatewaysdk/environment/schema/platform_templates.py +105 -17
  54. package/runtime/gatewaysdk/environment/schema/process_memory.py +76 -0
  55. package/runtime/gatewaysdk/environment/schema/redaction.py +13 -0
  56. package/runtime/gatewaysdk/environment/schema/runtime.py +14 -0
  57. package/runtime/gatewaysdk/environment/schema/scaffold.py +21 -4
  58. package/runtime/gatewaysdk/environment/schema/shape_catalog.py +493 -0
  59. package/runtime/gatewaysdk/environment/schema/shape_declarations.py +219 -0
  60. package/runtime/gatewaysdk/environment/schema/skill.py +1 -0
  61. package/runtime/gatewaysdk/environment/schema/skills/connector-schema-authoring/SKILL.md +1 -0
  62. package/runtime/gatewaysdk/environment/schema/skills/factory-orchestrator/SKILL.md +147 -0
  63. package/runtime/gatewaysdk/environment/schema/skills/world-data-ingestion/ROWS.md +5 -1
  64. package/runtime/gatewaysdk/environment/schema/skills/world-data-ingestion/SKILL.md +4 -4
  65. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/SKILL.md +2 -2
  66. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/cli-mcp-map.md +1 -0
  67. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/shape-catalog.md +59 -0
  68. package/runtime/gatewaysdk/environment/schema/validation.py +14 -0
  69. package/runtime/gatewaysdk/environment/schema/worker.py +7 -4
  70. package/runtime/gatewaysdk/environment/schema/worker_key.py +38 -0
  71. package/runtime/gatewaysdk/environment/schema/worker_peaks.py +38 -0
  72. package/runtime/gatewaysdk/environment/schema/worker_watch.py +50 -0
  73. package/runtime/gatewaysdk/environment/schema/workers.py +237 -68
  74. package/runtime/gatewaysdk/environment/schema/world_host.py +56 -62
  75. package/runtime/gatewaysdk/environment/schema/world_tests.py +3 -1
  76. package/skills/connector-schema-authoring/SKILL.md +1 -0
  77. package/skills/connector-schema-authoring/connector-worlds.md +1 -0
  78. package/skills/connector-schema-authoring/world-schema.md +7 -0
  79. package/skills/factory-orchestrator/SKILL.md +147 -0
  80. package/skills/world-data-ingestion/ROWS.md +5 -1
  81. package/skills/world-data-ingestion/SKILL.md +4 -4
  82. package/skills/worlds-getting-started/SKILL.md +2 -2
  83. package/skills/worlds-getting-started/references/cli-mcp-map.md +1 -0
  84. package/skills/worlds-getting-started/references/shape-catalog.md +59 -0
@@ -11,6 +11,7 @@ type AgentEffort = (typeof AGENT_EFFORTS)[number];
11
11
  declare const TOOL_SERVERS: {
12
12
  readonly docs: readonly ["search_docs"];
13
13
  readonly drive: readonly ["get_drive_file", "list_drive_files", "save_drive_file"];
14
+ readonly factory: readonly ["accept_factory_unit", "check_world_sandbox", "close_world_sandbox", "commit_world_sandbox", "describe_member", "diff_factory_revisions", "exec_in_world_sandbox", "generate_spine", "get_factory", "get_factory_data", "get_factory_revision", "get_spine", "get_spine_rows", "get_world_sandbox", "import_world_sandbox_data", "list_factory_revisions", "open_world_sandbox", "query_factory_data", "read_world_sandbox_file", "release_factory_data", "update_entity_graph", "update_ontology", "update_rules", "update_spine", "update_tests", "write_records", "write_world_sandbox_file"];
14
15
  readonly sandbox: readonly ["copy_file", "execute_python", "grep_files", "ingest_sessions_to_sandbox", "list_files", "query_json", "read_file", "run_bash", "run_gateway_cli", "write_file"];
15
16
  readonly web: readonly ["download_url_to_drive", "fetch_url"];
16
17
  };
@@ -31,6 +32,9 @@ declare const tools: Readonly<{
31
32
  drive: (options?: {
32
33
  only?: readonly ("get_drive_file" | "list_drive_files" | "save_drive_file")[] | undefined;
33
34
  }) => TypedGrant<"drive">;
35
+ factory: (options?: {
36
+ only?: readonly ("accept_factory_unit" | "check_world_sandbox" | "close_world_sandbox" | "commit_world_sandbox" | "describe_member" | "diff_factory_revisions" | "exec_in_world_sandbox" | "generate_spine" | "get_factory" | "get_factory_data" | "get_factory_revision" | "get_spine" | "get_spine_rows" | "get_world_sandbox" | "import_world_sandbox_data" | "list_factory_revisions" | "open_world_sandbox" | "query_factory_data" | "read_world_sandbox_file" | "release_factory_data" | "update_entity_graph" | "update_ontology" | "update_rules" | "update_spine" | "update_tests" | "write_records" | "write_world_sandbox_file")[] | undefined;
37
+ }) => TypedGrant<"factory">;
34
38
  web: (options?: {
35
39
  only?: readonly ("download_url_to_drive" | "fetch_url")[] | undefined;
36
40
  }) => TypedGrant<"web">;
@@ -66,7 +70,7 @@ type Run = {
66
70
  versionId: string;
67
71
  buildHash: string | null;
68
72
  };
69
- trigger: "api";
73
+ trigger: "api" | "factory";
70
74
  createdAt: string;
71
75
  startedAt: string | null;
72
76
  completedAt: string | null;
@@ -154,6 +158,10 @@ type AgentDefinitionSpec = {
154
158
  maxTurns: number;
155
159
  tools: ToolGrant[];
156
160
  };
161
+ /** A definition as the platform stores it: the Data Factory's orchestrator also carries `factory: true`, which no push may send. */
162
+ type StoredAgentDefinition = AgentDefinitionSpec & {
163
+ factory?: true;
164
+ };
157
165
  /** One tool server granted to an agent: all of its tools, or only the ones named. */
158
166
  type ToolGrant = {
159
167
  server: string;
@@ -210,7 +218,7 @@ type LiveAgentRecord = {
210
218
  version: number;
211
219
  buildHash: string;
212
220
  deployed: boolean;
213
- definition: AgentDefinitionSpec;
221
+ definition: StoredAgentDefinition;
214
222
  };
215
223
  /** What one edit made: the version it wrote or found, whether anything changed, and its changes against the version it edited. */
216
224
  type AgentEditResult = LiveAgentRecord & {
@@ -224,7 +232,7 @@ type AgentVersionEntry = {
224
232
  version: number;
225
233
  buildHash: string;
226
234
  isDeployed: boolean;
227
- definition: AgentDefinitionSpec;
235
+ definition: StoredAgentDefinition;
228
236
  changes: unknown | null;
229
237
  createdAt: string;
230
238
  };
@@ -496,7 +504,7 @@ declare class Agent {
496
504
  get version(): number;
497
505
  get buildHash(): string;
498
506
  get deployed(): boolean;
499
- get definition(): Readonly<AgentDefinitionSpec>;
507
+ get definition(): Readonly<StoredAgentDefinition>;
500
508
  /** Change fields: a new version, live unless `deploy: false`; a change to the values it already has writes nothing. */
501
509
  update(fields: AgentUpdate, options?: EditOptions): Promise<AgentEditResult>;
502
510
  /** Apply one patch made of `AgentPatch.update`, `.attach` or `.detach`. */
@@ -11,6 +11,7 @@ type AgentEffort = (typeof AGENT_EFFORTS)[number];
11
11
  declare const TOOL_SERVERS: {
12
12
  readonly docs: readonly ["search_docs"];
13
13
  readonly drive: readonly ["get_drive_file", "list_drive_files", "save_drive_file"];
14
+ readonly factory: readonly ["accept_factory_unit", "check_world_sandbox", "close_world_sandbox", "commit_world_sandbox", "describe_member", "diff_factory_revisions", "exec_in_world_sandbox", "generate_spine", "get_factory", "get_factory_data", "get_factory_revision", "get_spine", "get_spine_rows", "get_world_sandbox", "import_world_sandbox_data", "list_factory_revisions", "open_world_sandbox", "query_factory_data", "read_world_sandbox_file", "release_factory_data", "update_entity_graph", "update_ontology", "update_rules", "update_spine", "update_tests", "write_records", "write_world_sandbox_file"];
14
15
  readonly sandbox: readonly ["copy_file", "execute_python", "grep_files", "ingest_sessions_to_sandbox", "list_files", "query_json", "read_file", "run_bash", "run_gateway_cli", "write_file"];
15
16
  readonly web: readonly ["download_url_to_drive", "fetch_url"];
16
17
  };
@@ -31,6 +32,9 @@ declare const tools: Readonly<{
31
32
  drive: (options?: {
32
33
  only?: readonly ("get_drive_file" | "list_drive_files" | "save_drive_file")[] | undefined;
33
34
  }) => TypedGrant<"drive">;
35
+ factory: (options?: {
36
+ only?: readonly ("accept_factory_unit" | "check_world_sandbox" | "close_world_sandbox" | "commit_world_sandbox" | "describe_member" | "diff_factory_revisions" | "exec_in_world_sandbox" | "generate_spine" | "get_factory" | "get_factory_data" | "get_factory_revision" | "get_spine" | "get_spine_rows" | "get_world_sandbox" | "import_world_sandbox_data" | "list_factory_revisions" | "open_world_sandbox" | "query_factory_data" | "read_world_sandbox_file" | "release_factory_data" | "update_entity_graph" | "update_ontology" | "update_rules" | "update_spine" | "update_tests" | "write_records" | "write_world_sandbox_file")[] | undefined;
37
+ }) => TypedGrant<"factory">;
34
38
  web: (options?: {
35
39
  only?: readonly ("download_url_to_drive" | "fetch_url")[] | undefined;
36
40
  }) => TypedGrant<"web">;
@@ -66,7 +70,7 @@ type Run = {
66
70
  versionId: string;
67
71
  buildHash: string | null;
68
72
  };
69
- trigger: "api";
73
+ trigger: "api" | "factory";
70
74
  createdAt: string;
71
75
  startedAt: string | null;
72
76
  completedAt: string | null;
@@ -154,6 +158,10 @@ type AgentDefinitionSpec = {
154
158
  maxTurns: number;
155
159
  tools: ToolGrant[];
156
160
  };
161
+ /** A definition as the platform stores it: the Data Factory's orchestrator also carries `factory: true`, which no push may send. */
162
+ type StoredAgentDefinition = AgentDefinitionSpec & {
163
+ factory?: true;
164
+ };
157
165
  /** One tool server granted to an agent: all of its tools, or only the ones named. */
158
166
  type ToolGrant = {
159
167
  server: string;
@@ -210,7 +218,7 @@ type LiveAgentRecord = {
210
218
  version: number;
211
219
  buildHash: string;
212
220
  deployed: boolean;
213
- definition: AgentDefinitionSpec;
221
+ definition: StoredAgentDefinition;
214
222
  };
215
223
  /** What one edit made: the version it wrote or found, whether anything changed, and its changes against the version it edited. */
216
224
  type AgentEditResult = LiveAgentRecord & {
@@ -224,7 +232,7 @@ type AgentVersionEntry = {
224
232
  version: number;
225
233
  buildHash: string;
226
234
  isDeployed: boolean;
227
- definition: AgentDefinitionSpec;
235
+ definition: StoredAgentDefinition;
228
236
  changes: unknown | null;
229
237
  createdAt: string;
230
238
  };
@@ -496,7 +504,7 @@ declare class Agent {
496
504
  get version(): number;
497
505
  get buildHash(): string;
498
506
  get deployed(): boolean;
499
- get definition(): Readonly<AgentDefinitionSpec>;
507
+ get definition(): Readonly<StoredAgentDefinition>;
500
508
  /** Change fields: a new version, live unless `deploy: false`; a change to the values it already has writes nothing. */
501
509
  update(fields: AgentUpdate, options?: EditOptions): Promise<AgentEditResult>;
502
510
  /** Apply one patch made of `AgentPatch.update`, `.attach` or `.detach`. */
@@ -1390,6 +1390,35 @@ var AGENT_EFFORTS = ["low", "medium", "high", "xhigh"];
1390
1390
  var TOOL_SERVERS = {
1391
1391
  docs: ["search_docs"],
1392
1392
  drive: ["get_drive_file", "list_drive_files", "save_drive_file"],
1393
+ factory: [
1394
+ "accept_factory_unit",
1395
+ "check_world_sandbox",
1396
+ "close_world_sandbox",
1397
+ "commit_world_sandbox",
1398
+ "describe_member",
1399
+ "diff_factory_revisions",
1400
+ "exec_in_world_sandbox",
1401
+ "generate_spine",
1402
+ "get_factory",
1403
+ "get_factory_data",
1404
+ "get_factory_revision",
1405
+ "get_spine",
1406
+ "get_spine_rows",
1407
+ "get_world_sandbox",
1408
+ "import_world_sandbox_data",
1409
+ "list_factory_revisions",
1410
+ "open_world_sandbox",
1411
+ "query_factory_data",
1412
+ "read_world_sandbox_file",
1413
+ "release_factory_data",
1414
+ "update_entity_graph",
1415
+ "update_ontology",
1416
+ "update_rules",
1417
+ "update_spine",
1418
+ "update_tests",
1419
+ "write_records",
1420
+ "write_world_sandbox_file"
1421
+ ],
1393
1422
  sandbox: [
1394
1423
  "copy_file",
1395
1424
  "execute_python",
@@ -1408,6 +1437,7 @@ var grant = (server) => (options = {}) => options.only ? { server, only: [...opt
1408
1437
  var tools = Object.freeze({
1409
1438
  sandbox: grant("sandbox"),
1410
1439
  drive: grant("drive"),
1440
+ factory: grant("factory"),
1411
1441
  web: grant("web"),
1412
1442
  docs: grant("docs")
1413
1443
  });