@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
@@ -1086,7 +1086,7 @@ function click(button, count) {
1086
1086
  modifiers: modifierChord(raw.text)
1087
1087
  });
1088
1088
  }
1089
- var SCROLL_STEP_PX, NOT_EXECUTED, MAX_ERROR2, SCROLL_DIRECTIONS, MEMBERS, AnthropicComputer, AnthropicComputer20251124;
1089
+ var SCROLL_STEP_PX, NOT_EXECUTED, MAX_ERROR2, SCROLL_DIRECTIONS, IMAGE_PARTS, MEMBERS, AnthropicComputer, AnthropicComputer20251124;
1090
1090
  var init_anthropic = __esm({
1091
1091
  "src/worlds/nativeComputer/anthropic.ts"() {
1092
1092
  "use strict";
@@ -1102,6 +1102,14 @@ var init_anthropic = __esm({
1102
1102
  left: [-1, 0],
1103
1103
  right: [1, 0]
1104
1104
  };
1105
+ IMAGE_PARTS = {
1106
+ 6: (data) => ({ type: "image-data", data, mediaType: "image/png" }),
1107
+ 7: (data) => ({
1108
+ type: "file",
1109
+ mediaType: "image/png",
1110
+ data: { type: "data", data }
1111
+ })
1112
+ };
1105
1113
  MEMBERS = {
1106
1114
  screenshot: () => new ComputerAction("screenshot"),
1107
1115
  zoom: (raw) => new ComputerAction("zoom", {
@@ -1211,15 +1219,17 @@ var init_anthropic = __esm({
1211
1219
  ];
1212
1220
  return [{ type: "text", text: result.text ?? "OK" }];
1213
1221
  }
1214
- /** For `anthropic.tools.computerToolset_20260801({ ...computer.aiSdk() })`
1215
- * (or `computer_20251124` with the legacy kind): `execute` runs one action
1216
- * and returns `{ type: "image", data }` or text; `toModelOutput` turns that
1217
- * into the tool result. Calls run one at a time, and once a call fails the
1222
+ /** For `anthropic.tools.computerToolset_20260801(computer.aiSdk({ version: 7 }))`
1223
+ * (AI SDK 7 only), or `computer_20251124` with the legacy kind (AI SDK 6
1224
+ * and 7): `execute` runs one action and returns `{ type: "image", data }` or
1225
+ * text; `toModelOutput` turns that into the tool result in the part shape
1226
+ * of `options.version`. Calls run one at a time, and once a call fails the
1218
1227
  * rest of that step's calls answer as not executed. */
1219
- aiSdk() {
1228
+ aiSdk(options = {}) {
1229
+ const imagePart = _AnthropicComputer.imagePart(options);
1220
1230
  let failedStep;
1221
- const execute = (input, options) => this.serial(async () => {
1222
- const step = options?.messages?.length;
1231
+ const execute = (input, options2) => this.serial(async () => {
1232
+ const step = options2?.messages?.length;
1223
1233
  if (step !== void 0 && step === failedStep)
1224
1234
  throw new Error(NOT_EXECUTED);
1225
1235
  try {
@@ -1231,7 +1241,7 @@ var init_anthropic = __esm({
1231
1241
  });
1232
1242
  return {
1233
1243
  execute,
1234
- toModelOutput: ({ output }) => _AnthropicComputer.aiSdkModelOutput(output)
1244
+ toModelOutput: ({ output }) => _AnthropicComputer.modelOutput(output, imagePart)
1235
1245
  };
1236
1246
  }
1237
1247
  static aiSdkOutput(result) {
@@ -1239,16 +1249,26 @@ var init_anthropic = __esm({
1239
1249
  return { type: "image", data: result.image.toString("base64") };
1240
1250
  return result.text ?? "OK";
1241
1251
  }
1242
- /** `image-data` is what AI SDK 6's Anthropic provider turns into an image
1243
- * block; AI SDK 7 still accepts it (and converts it to a `file` part). */
1244
- static aiSdkModelOutput(output) {
1252
+ /** A screenshot as the image part of AI SDK `options.version`:
1253
+ * `image-data` for 6 (the default), `file` with `{ type: "data", data }`
1254
+ * for 7. */
1255
+ static aiSdkModelOutput(output, options = {}) {
1256
+ return _AnthropicComputer.modelOutput(
1257
+ output,
1258
+ _AnthropicComputer.imagePart(options)
1259
+ );
1260
+ }
1261
+ static imagePart({
1262
+ version = 6
1263
+ }) {
1264
+ if (Object.hasOwn(IMAGE_PARTS, version)) return IMAGE_PARTS[version];
1265
+ throw new Error(
1266
+ `unsupported AI SDK version ${version}; choose ${Object.keys(IMAGE_PARTS).join(" or ")}`
1267
+ );
1268
+ }
1269
+ static modelOutput(output, imagePart) {
1245
1270
  if (typeof output === "string") return { type: "text", value: output };
1246
- return {
1247
- type: "content",
1248
- value: [
1249
- { type: "image-data", data: output.data, mediaType: "image/png" }
1250
- ]
1251
- };
1271
+ return { type: "content", value: [imagePart(output.data)] };
1252
1272
  }
1253
1273
  envelope(block, content, isError = false) {
1254
1274
  return {
@@ -1778,6 +1798,14 @@ var init_requestLog = __esm({
1778
1798
  }
1779
1799
  });
1780
1800
 
1801
+ // src/worlds/webhooks.ts
1802
+ var init_webhooks = __esm({
1803
+ "src/worlds/webhooks.ts"() {
1804
+ "use strict";
1805
+ init_worlds();
1806
+ }
1807
+ });
1808
+
1781
1809
  // src/worlds/checkoutTarget.ts
1782
1810
  var fs2, path3;
1783
1811
  var init_checkoutTarget = __esm({
@@ -2025,6 +2053,7 @@ var init_worlds = __esm({
2025
2053
  init_surfaceDescriptor();
2026
2054
  init_requestLog();
2027
2055
  init_requestLedger();
2056
+ init_webhooks();
2028
2057
  init_browserReconnect();
2029
2058
  init_nativeComputer();
2030
2059
  init_hub();