@withgateway/sdk 0.4.0 → 0.6.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 (94) hide show
  1. package/dist/cli.js +1128 -783
  2. package/dist/cli.js.map +1 -1
  3. package/dist/cli.mjs +1130 -785
  4. package/dist/cli.mjs.map +1 -1
  5. package/dist/files/index.js +47 -18
  6. package/dist/files/index.js.map +1 -1
  7. package/dist/files/index.mjs +47 -18
  8. package/dist/files/index.mjs.map +1 -1
  9. package/dist/{index-mJhG3vZU.d.mts → index-Di9nNqOY.d.mts} +26 -3
  10. package/dist/{index-DUHmS74p.d.ts → index-LA-PMRJT.d.ts} +26 -3
  11. package/dist/index.d.mts +3 -3
  12. package/dist/index.d.ts +3 -3
  13. package/dist/index.js +179 -43
  14. package/dist/index.js.map +1 -1
  15. package/dist/index.mjs +176 -43
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/replay/index.d.mts +1 -1
  18. package/dist/replay/index.d.ts +1 -1
  19. package/dist/replay/index.js.map +1 -1
  20. package/dist/replay/index.mjs.map +1 -1
  21. package/dist/traces/index.js +47 -18
  22. package/dist/traces/index.js.map +1 -1
  23. package/dist/traces/index.mjs +47 -18
  24. package/dist/traces/index.mjs.map +1 -1
  25. package/dist/tracing/index.d.mts +1 -1
  26. package/dist/tracing/index.d.ts +1 -1
  27. package/dist/tracing/index.js +1 -1
  28. package/dist/tracing/index.js.map +1 -1
  29. package/dist/tracing/index.mjs +1 -1
  30. package/dist/tracing/index.mjs.map +1 -1
  31. package/dist/worlds/index.d.mts +184 -85
  32. package/dist/worlds/index.d.ts +184 -85
  33. package/dist/worlds/index.js +176 -43
  34. package/dist/worlds/index.js.map +1 -1
  35. package/dist/worlds/index.mjs +176 -43
  36. package/dist/worlds/index.mjs.map +1 -1
  37. package/package.json +1 -1
  38. package/runtime/gatewaysdk/environment/_bundle.py +4 -6
  39. package/runtime/gatewaysdk/environment/_world.py +24 -1
  40. package/runtime/gatewaysdk/environment/runtime.py +45 -2
  41. package/runtime/gatewaysdk/environment/schema/api.py +24 -3
  42. package/runtime/gatewaysdk/environment/schema/bundle_runtime.py +1 -0
  43. package/runtime/gatewaysdk/environment/schema/call_capture.py +13 -1
  44. package/runtime/gatewaysdk/environment/schema/call_log.py +46 -0
  45. package/runtime/gatewaysdk/environment/schema/call_redaction.py +6 -0
  46. package/runtime/gatewaysdk/environment/schema/compiler.py +4 -1
  47. package/runtime/gatewaysdk/environment/schema/conform.py +32 -8
  48. package/runtime/gatewaysdk/environment/schema/connector.py +5 -0
  49. package/runtime/gatewaysdk/environment/schema/connectors/custom/handlers.py +2 -1
  50. package/runtime/gatewaysdk/environment/schema/connectors/github/api/handlers.py +217 -58
  51. package/runtime/gatewaysdk/environment/schema/connectors/github/connector.toml +9 -19
  52. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_webhooks.json +10 -2
  53. package/runtime/gatewaysdk/environment/schema/connectors/github/tests/webhooks.json +47 -0
  54. package/runtime/gatewaysdk/environment/schema/connectors/github/world.json +21 -0
  55. package/runtime/gatewaysdk/environment/schema/connectors/jamf/api/handlers.py +185 -18
  56. package/runtime/gatewaysdk/environment/schema/connectors/jamf/connector.toml +29 -14
  57. package/runtime/gatewaysdk/environment/schema/connectors/jamf/provenance.json +43 -12
  58. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_webhooks.json +2 -2
  59. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scope.toml +4 -17
  60. package/runtime/gatewaysdk/environment/schema/connectors/jamf/tests/webhooks.json +107 -0
  61. package/runtime/gatewaysdk/environment/schema/connectors/jamf/vendor-openapi.json +1 -1
  62. package/runtime/gatewaysdk/environment/schema/connectors/linear/api/handlers.py +85 -1
  63. package/runtime/gatewaysdk/environment/schema/connectors/linear/connector.toml +19 -31
  64. package/runtime/gatewaysdk/environment/schema/connectors/linear/provenance.json +18 -8
  65. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/webhooks.json +19 -3
  66. package/runtime/gatewaysdk/environment/schema/connectors/linear/tests/test_webhooks.py +71 -0
  67. package/runtime/gatewaysdk/environment/schema/database/guard.py +2 -1
  68. package/runtime/gatewaysdk/environment/schema/handler_errors.py +27 -1
  69. package/runtime/gatewaysdk/environment/schema/journal.py +4 -3
  70. package/runtime/gatewaysdk/environment/schema/local.py +1 -0
  71. package/runtime/gatewaysdk/environment/schema/openapi_schemas.py +20 -5
  72. package/runtime/gatewaysdk/environment/schema/platform.py +16 -219
  73. package/runtime/gatewaysdk/environment/schema/runtime.py +7 -0
  74. package/runtime/gatewaysdk/environment/schema/scaffold.py +2 -1
  75. package/runtime/gatewaysdk/environment/schema/skills/connector-schema-authoring/CONNECTORS.md +3 -3
  76. package/runtime/gatewaysdk/environment/schema/skills/connector-schema-authoring/SKILL.md +19 -22
  77. package/runtime/gatewaysdk/environment/schema/skills/world-data-ingestion/SKILL.md +7 -9
  78. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/SKILL.md +3 -3
  79. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/cli-mcp-map.md +14 -11
  80. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/gotchas.md +36 -5
  81. package/runtime/gatewaysdk/environment/schema/snapshot.py +2 -2
  82. package/runtime/gatewaysdk/environment/schema/tools_world.py +19 -0
  83. package/runtime/gatewaysdk/environment/schema/verbs.py +6 -0
  84. package/runtime/gatewaysdk/environment/schema/webhooks.py +687 -0
  85. package/runtime/gatewaysdk/environment/schema/world_host.py +20 -3
  86. package/runtime/gatewaysdk/environment/schema/world_tests.py +74 -0
  87. package/skills/connector-schema-authoring/CONNECTORS.md +3 -3
  88. package/skills/connector-schema-authoring/SKILL.md +19 -22
  89. package/skills/connector-schema-authoring/connector-worlds.md +153 -11
  90. package/skills/connector-schema-authoring/world-schema.md +7 -6
  91. package/skills/world-data-ingestion/SKILL.md +7 -9
  92. package/skills/worlds-getting-started/SKILL.md +3 -3
  93. package/skills/worlds-getting-started/references/cli-mcp-map.md +14 -11
  94. package/skills/worlds-getting-started/references/gotchas.md +36 -5
@@ -1067,7 +1067,7 @@ function click(button, count) {
1067
1067
  modifiers: modifierChord(raw.text)
1068
1068
  });
1069
1069
  }
1070
- var SCROLL_STEP_PX, NOT_EXECUTED, MAX_ERROR2, SCROLL_DIRECTIONS, MEMBERS, AnthropicComputer, AnthropicComputer20251124;
1070
+ var SCROLL_STEP_PX, NOT_EXECUTED, MAX_ERROR2, SCROLL_DIRECTIONS, IMAGE_PARTS, MEMBERS, AnthropicComputer, AnthropicComputer20251124;
1071
1071
  var init_anthropic = __esm({
1072
1072
  "src/worlds/nativeComputer/anthropic.ts"() {
1073
1073
  "use strict";
@@ -1083,6 +1083,14 @@ var init_anthropic = __esm({
1083
1083
  left: [-1, 0],
1084
1084
  right: [1, 0]
1085
1085
  };
1086
+ IMAGE_PARTS = {
1087
+ 6: (data) => ({ type: "image-data", data, mediaType: "image/png" }),
1088
+ 7: (data) => ({
1089
+ type: "file",
1090
+ mediaType: "image/png",
1091
+ data: { type: "data", data }
1092
+ })
1093
+ };
1086
1094
  MEMBERS = {
1087
1095
  screenshot: () => new ComputerAction("screenshot"),
1088
1096
  zoom: (raw) => new ComputerAction("zoom", {
@@ -1192,15 +1200,17 @@ var init_anthropic = __esm({
1192
1200
  ];
1193
1201
  return [{ type: "text", text: result.text ?? "OK" }];
1194
1202
  }
1195
- /** For `anthropic.tools.computerToolset_20260801({ ...computer.aiSdk() })`
1196
- * (or `computer_20251124` with the legacy kind): `execute` runs one action
1197
- * and returns `{ type: "image", data }` or text; `toModelOutput` turns that
1198
- * into the tool result. Calls run one at a time, and once a call fails the
1203
+ /** For `anthropic.tools.computerToolset_20260801(computer.aiSdk({ version: 7 }))`
1204
+ * (AI SDK 7 only), or `computer_20251124` with the legacy kind (AI SDK 6
1205
+ * and 7): `execute` runs one action and returns `{ type: "image", data }` or
1206
+ * text; `toModelOutput` turns that into the tool result in the part shape
1207
+ * of `options.version`. Calls run one at a time, and once a call fails the
1199
1208
  * rest of that step's calls answer as not executed. */
1200
- aiSdk() {
1209
+ aiSdk(options = {}) {
1210
+ const imagePart = _AnthropicComputer.imagePart(options);
1201
1211
  let failedStep;
1202
- const execute = (input, options) => this.serial(async () => {
1203
- const step = options?.messages?.length;
1212
+ const execute = (input, options2) => this.serial(async () => {
1213
+ const step = options2?.messages?.length;
1204
1214
  if (step !== void 0 && step === failedStep)
1205
1215
  throw new Error(NOT_EXECUTED);
1206
1216
  try {
@@ -1212,7 +1222,7 @@ var init_anthropic = __esm({
1212
1222
  });
1213
1223
  return {
1214
1224
  execute,
1215
- toModelOutput: ({ output }) => _AnthropicComputer.aiSdkModelOutput(output)
1225
+ toModelOutput: ({ output }) => _AnthropicComputer.modelOutput(output, imagePart)
1216
1226
  };
1217
1227
  }
1218
1228
  static aiSdkOutput(result) {
@@ -1220,16 +1230,26 @@ var init_anthropic = __esm({
1220
1230
  return { type: "image", data: result.image.toString("base64") };
1221
1231
  return result.text ?? "OK";
1222
1232
  }
1223
- /** `image-data` is what AI SDK 6's Anthropic provider turns into an image
1224
- * block; AI SDK 7 still accepts it (and converts it to a `file` part). */
1225
- static aiSdkModelOutput(output) {
1233
+ /** A screenshot as the image part of AI SDK `options.version`:
1234
+ * `image-data` for 6 (the default), `file` with `{ type: "data", data }`
1235
+ * for 7. */
1236
+ static aiSdkModelOutput(output, options = {}) {
1237
+ return _AnthropicComputer.modelOutput(
1238
+ output,
1239
+ _AnthropicComputer.imagePart(options)
1240
+ );
1241
+ }
1242
+ static imagePart({
1243
+ version = 6
1244
+ }) {
1245
+ if (Object.hasOwn(IMAGE_PARTS, version)) return IMAGE_PARTS[version];
1246
+ throw new Error(
1247
+ `unsupported AI SDK version ${version}; choose ${Object.keys(IMAGE_PARTS).join(" or ")}`
1248
+ );
1249
+ }
1250
+ static modelOutput(output, imagePart) {
1226
1251
  if (typeof output === "string") return { type: "text", value: output };
1227
- return {
1228
- type: "content",
1229
- value: [
1230
- { type: "image-data", data: output.data, mediaType: "image/png" }
1231
- ]
1232
- };
1252
+ return { type: "content", value: [imagePart(output.data)] };
1233
1253
  }
1234
1254
  envelope(block, content, isError = false) {
1235
1255
  return {
@@ -1755,6 +1775,14 @@ var init_requestLog = __esm({
1755
1775
  }
1756
1776
  });
1757
1777
 
1778
+ // src/worlds/webhooks.ts
1779
+ var init_webhooks = __esm({
1780
+ "src/worlds/webhooks.ts"() {
1781
+ "use strict";
1782
+ init_worlds();
1783
+ }
1784
+ });
1785
+
1758
1786
  // src/worlds/checkoutTarget.ts
1759
1787
  import * as fs2 from "fs";
1760
1788
  import * as path3 from "path";
@@ -1998,6 +2026,7 @@ var init_worlds = __esm({
1998
2026
  init_surfaceDescriptor();
1999
2027
  init_requestLog();
2000
2028
  init_requestLedger();
2029
+ init_webhooks();
2001
2030
  init_browserReconnect();
2002
2031
  init_nativeComputer();
2003
2032
  init_hub();