@zapier/zapier-sdk 0.84.0 → 0.84.2

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.
@@ -2095,9 +2095,7 @@ function buildMethodEntries(descriptors, context, states) {
2095
2095
  }
2096
2096
  );
2097
2097
  } else if (out.type === "item") {
2098
- const itemCore = async (input) => ({
2099
- data: await callRun(input)
2100
- });
2098
+ const itemCore = async (input) => callRun(input);
2101
2099
  entry.value = createFunction(
2102
2100
  fold(itemCore),
2103
2101
  {
@@ -5196,7 +5194,7 @@ function parseDeprecationDate(value) {
5196
5194
  }
5197
5195
 
5198
5196
  // src/sdk-version.ts
5199
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.84.0" : void 0) || "unknown";
5197
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.84.2" : void 0) || "unknown";
5200
5198
 
5201
5199
  // src/utils/open-url.ts
5202
5200
  var nodePrefix = "node:";
@@ -6620,13 +6618,15 @@ var getProfilePlugin = defineMethod({
6620
6618
  authRequired: true
6621
6619
  });
6622
6620
  return {
6623
- id: String(profile.public_id ?? profile.id),
6624
- first_name: profile.first_name,
6625
- last_name: profile.last_name,
6626
- full_name: `${profile.first_name} ${profile.last_name}`,
6627
- email: profile.email,
6628
- email_confirmed: profile.email_confirmed,
6629
- timezone: profile.timezone
6621
+ data: {
6622
+ id: String(profile.public_id ?? profile.id),
6623
+ first_name: profile.first_name,
6624
+ last_name: profile.last_name,
6625
+ full_name: `${profile.first_name} ${profile.last_name}`,
6626
+ email: profile.email,
6627
+ email_confirmed: profile.email_confirmed,
6628
+ timezone: profile.timezone
6629
+ }
6630
6630
  };
6631
6631
  }
6632
6632
  });
@@ -9343,7 +9343,7 @@ var getActionPlugin = defineMethod({
9343
9343
  });
9344
9344
  for await (const action of imports.listActions({ app: appKey }).items()) {
9345
9345
  if ((action.key === actionKey || action.id === actionKey) && action.action_type === actionType) {
9346
- return action;
9346
+ return { data: action };
9347
9347
  }
9348
9348
  }
9349
9349
  throw new ZapierResourceNotFoundError(
@@ -9859,7 +9859,7 @@ var getAppPlugin = defineMethod({
9859
9859
  run: async ({ imports, input }) => {
9860
9860
  const appKey = "app" in input ? input.app : input.appKey;
9861
9861
  for await (const app of imports.listApps({ apps: [appKey] }).items()) {
9862
- return app;
9862
+ return { data: app };
9863
9863
  }
9864
9864
  throw new ZapierAppNotFoundError("App not found", { appKey });
9865
9865
  }
@@ -10081,7 +10081,7 @@ var getConnectionPlugin = defineMethod({
10081
10081
  }
10082
10082
  }
10083
10083
  );
10084
- return transformConnectionItem(response.data);
10084
+ return { data: transformConnectionItem(response.data) };
10085
10085
  }
10086
10086
  });
10087
10087
 
@@ -10116,7 +10116,7 @@ var findFirstConnectionPlugin = defineMethod({
10116
10116
  { resourceType: "Connection" }
10117
10117
  );
10118
10118
  }
10119
- return connectionsResponse.data[0];
10119
+ return { data: connectionsResponse.data[0] };
10120
10120
  }
10121
10121
  });
10122
10122
 
@@ -10157,7 +10157,7 @@ var findUniqueConnectionPlugin = defineMethod({
10157
10157
  "Multiple connections found matching the specified criteria. Expected exactly one."
10158
10158
  );
10159
10159
  }
10160
- return connectionsResponse.data[0];
10160
+ return { data: connectionsResponse.data[0] };
10161
10161
  }
10162
10162
  });
10163
10163
  var GetConnectionStartUrlSchema = z.object({
@@ -10205,12 +10205,14 @@ var getConnectionStartUrlPlugin = defineMethod({
10205
10205
  { selected_api: selectedApi },
10206
10206
  { authRequired: true }
10207
10207
  );
10208
- return GetConnectionStartUrlItemSchema.parse({
10209
- url: response.url,
10210
- expiresAt: response.expires_at,
10211
- startedAt: response.started_at,
10212
- app: selectedApi
10213
- });
10208
+ return {
10209
+ data: GetConnectionStartUrlItemSchema.parse({
10210
+ url: response.url,
10211
+ expiresAt: response.expires_at,
10212
+ startedAt: response.started_at,
10213
+ app: selectedApi
10214
+ })
10215
+ };
10214
10216
  }
10215
10217
  });
10216
10218
  var WaitForNewConnectionSchema = z.object({
@@ -10284,11 +10286,13 @@ var waitForNewConnectionPlugin = defineMethod({
10284
10286
  body.data[0]
10285
10287
  )
10286
10288
  });
10287
- return WaitForNewConnectionItemSchema.parse({
10288
- id: String(top.public_id ?? top.id),
10289
- app: appKey,
10290
- title: top.title ?? null
10291
- });
10289
+ return {
10290
+ data: WaitForNewConnectionItemSchema.parse({
10291
+ id: String(top.public_id ?? top.id),
10292
+ app: appKey,
10293
+ title: top.title ?? null
10294
+ })
10295
+ };
10292
10296
  } catch (err) {
10293
10297
  if (err instanceof ZapierTimeoutError) {
10294
10298
  throw new ZapierTimeoutError(
@@ -10389,11 +10393,13 @@ Open this URL to complete the connection:
10389
10393
  timeoutMs: input.timeoutMs,
10390
10394
  pollIntervalMs: input.pollIntervalMs
10391
10395
  });
10392
- return CreateConnectionItemSchema.parse({
10393
- id: fresh.id,
10394
- app: start2.app,
10395
- title: fresh.title ?? null
10396
- });
10396
+ return {
10397
+ data: CreateConnectionItemSchema.parse({
10398
+ id: fresh.id,
10399
+ app: start2.app,
10400
+ title: fresh.title ?? null
10401
+ })
10402
+ };
10397
10403
  }
10398
10404
  });
10399
10405
 
@@ -10581,7 +10587,7 @@ var createClientCredentialsPlugin = defineMethod({
10581
10587
  requiredScopes: ["credentials"]
10582
10588
  }
10583
10589
  );
10584
- return response.data;
10590
+ return { data: response.data };
10585
10591
  }
10586
10592
  });
10587
10593
  var DeleteClientCredentialsSchema = z.object({
@@ -11044,7 +11050,10 @@ var getActionInputFieldsSchemaPlugin = defineMethod({
11044
11050
  connection: connectionIdResolver,
11045
11051
  inputs: inputsAllOptionalResolver
11046
11052
  },
11047
- run: async ({ imports, input }) => {
11053
+ run: async ({
11054
+ imports,
11055
+ input
11056
+ }) => {
11048
11057
  const api = imports.api;
11049
11058
  const getVersionedImplementationId = imports.manifest.getVersionedImplementationId;
11050
11059
  const resolveConnection = imports.connections.resolveConnection;
@@ -11082,7 +11091,7 @@ var getActionInputFieldsSchemaPlugin = defineMethod({
11082
11091
  connectionId: resolvedConnectionId ?? null,
11083
11092
  inputs
11084
11093
  });
11085
- return needsData.schema || {};
11094
+ return { data: needsData.schema || {} };
11086
11095
  }
11087
11096
  });
11088
11097
  var InputFieldChoiceItemSchema = NeedChoicesSchema;
@@ -11530,7 +11539,7 @@ var createTriggerInboxPlugin = defineMethod({
11530
11539
  }
11531
11540
  }
11532
11541
  );
11533
- return TriggerInboxItemSchema.parse(rawResponse);
11542
+ return { data: TriggerInboxItemSchema.parse(rawResponse) };
11534
11543
  }
11535
11544
  });
11536
11545
  var EnsureTriggerInboxDescription = "Get-or-create a trigger inbox by key. Idempotent on (user, account, key): returns the existing inbox if a matching subscription is registered, creates a new one otherwise. Throws ZapierConflictError if the key exists with a different subscription.";
@@ -11631,7 +11640,7 @@ var ensureTriggerInboxPlugin = defineMethod({
11631
11640
  }
11632
11641
  }
11633
11642
  );
11634
- return TriggerInboxItemSchema.parse(rawResponse);
11643
+ return { data: TriggerInboxItemSchema.parse(rawResponse) };
11635
11644
  }
11636
11645
  });
11637
11646
  var ListTriggerInboxesSchema = z.object({
@@ -11726,7 +11735,7 @@ var getTriggerInboxPlugin = defineMethod({
11726
11735
  resource: { type: "trigger_inbox", id: inboxId }
11727
11736
  }
11728
11737
  );
11729
- return TriggerInboxItemSchema.parse(rawResponse);
11738
+ return { data: TriggerInboxItemSchema.parse(rawResponse) };
11730
11739
  }
11731
11740
  });
11732
11741
  var UpdateTriggerInboxSchema = z.object({
@@ -11764,7 +11773,7 @@ var updateTriggerInboxPlugin = defineMethod({
11764
11773
  resource: { type: "trigger_inbox", id: inboxId }
11765
11774
  }
11766
11775
  );
11767
- return TriggerInboxItemSchema.parse(rawResponse);
11776
+ return { data: TriggerInboxItemSchema.parse(rawResponse) };
11768
11777
  }
11769
11778
  });
11770
11779
  var DeleteTriggerInboxSchema = z.object({
@@ -11829,7 +11838,7 @@ var pauseTriggerInboxPlugin = defineMethod({
11829
11838
  resource: { type: "trigger_inbox", id: inboxId }
11830
11839
  }
11831
11840
  );
11832
- return TriggerInboxItemSchema.parse(rawResponse);
11841
+ return { data: TriggerInboxItemSchema.parse(rawResponse) };
11833
11842
  }
11834
11843
  });
11835
11844
  var ResumeTriggerInboxSchema = z.object({
@@ -11860,7 +11869,7 @@ var resumeTriggerInboxPlugin = defineMethod({
11860
11869
  resource: { type: "trigger_inbox", id: inboxId }
11861
11870
  }
11862
11871
  );
11863
- return TriggerInboxItemSchema.parse(rawResponse);
11872
+ return { data: TriggerInboxItemSchema.parse(rawResponse) };
11864
11873
  }
11865
11874
  });
11866
11875
  var TriggerMessageStatusSchema = z.union([z.enum(["available", "leased", "acked", "quarantined"]), z.string()]).describe("Message lifecycle status");
@@ -12049,7 +12058,7 @@ var leaseTriggerInboxMessagesPlugin = defineMethod({
12049
12058
  }
12050
12059
  }
12051
12060
  );
12052
- return LeaseTriggerInboxMessagesItemSchema.parse(rawResponse);
12061
+ return { data: LeaseTriggerInboxMessagesItemSchema.parse(rawResponse) };
12053
12062
  }
12054
12063
  });
12055
12064
  var AckTriggerInboxMessagesSchema = z.object({
@@ -12099,7 +12108,7 @@ var ackTriggerInboxMessagesPlugin = defineMethod({
12099
12108
  requestBody,
12100
12109
  { authRequired: true }
12101
12110
  );
12102
- return AckTriggerInboxMessagesItemSchema.parse(rawResponse);
12111
+ return { data: AckTriggerInboxMessagesItemSchema.parse(rawResponse) };
12103
12112
  }
12104
12113
  });
12105
12114
  var ReleaseTriggerInboxMessagesSchema = z.object({
@@ -12149,7 +12158,7 @@ var releaseTriggerInboxMessagesPlugin = defineMethod({
12149
12158
  requestBody,
12150
12159
  { authRequired: true }
12151
12160
  );
12152
- return ReleaseTriggerInboxMessagesItemSchema.parse(rawResponse);
12161
+ return { data: ReleaseTriggerInboxMessagesItemSchema.parse(rawResponse) };
12153
12162
  }
12154
12163
  });
12155
12164
 
@@ -13177,7 +13186,7 @@ var getTablePlugin = defineMethod({
13177
13186
  resource: { type: "table", id: tableId }
13178
13187
  });
13179
13188
  const response = GetTableApiResponseSchema.parse(rawResponse);
13180
- return transformTableItem(response.data);
13189
+ return { data: transformTableItem(response.data) };
13181
13190
  }
13182
13191
  });
13183
13192
  var DeleteTableDescription = "Delete a table by its ID";
@@ -13237,7 +13246,7 @@ var createTablePlugin = defineMethod({
13237
13246
  { authRequired: true }
13238
13247
  );
13239
13248
  const response = CreateTableApiResponseSchema.parse(rawResponse);
13240
- return transformTableItem(response.data);
13249
+ return { data: transformTableItem(response.data) };
13241
13250
  }
13242
13251
  });
13243
13252
 
@@ -13257,10 +13266,8 @@ var listTableFieldsPlugin = defineMethod({
13257
13266
  imports: [apiPluginRef],
13258
13267
  categories: tableCategories,
13259
13268
  itemType: "Field",
13260
- // A field list, but the API returns no cursor: legacy used the non-paginated
13261
- // createPluginMethod (a `createFunction` boundary returning a bare `{ data }`,
13262
- // not an iterator). `output: "item"` reproduces that exactly (same boundary +
13263
- // hooks; run returns the bare array, framework wraps to `{ data }`); the
13269
+ // A field list, but the API returns no cursor, so `output: "item"` returns
13270
+ // `{ data: FieldItem[] }` directly instead of a paginated iterator; the
13264
13271
  // `type: "list"` first-class field keeps the list presentation.
13265
13272
  type: "list",
13266
13273
  inputSchema: ListTableFieldsOptionsInputSchema,
@@ -13289,7 +13296,7 @@ var listTableFieldsPlugin = defineMethod({
13289
13296
  }
13290
13297
  );
13291
13298
  const response = ListTableFieldsApiResponseSchema.parse(rawResponse);
13292
- return response.data.map(transformFieldItem);
13299
+ return { data: response.data.map(transformFieldItem) };
13293
13300
  }
13294
13301
  });
13295
13302
  var FieldChangesetItemSchema = z.object({
@@ -13334,8 +13341,8 @@ var createTableFieldsPlugin = defineMethod({
13334
13341
  returnType: "FieldItem[]",
13335
13342
  inputSchema: CreateTableFieldsOptionsInputSchema,
13336
13343
  outputSchema: FieldItemSchema,
13337
- // `run` returns the field array; `output: "item"` wraps it in `{ data }` to
13338
- // match the legacy `{ data: FieldItem[] }` surface.
13344
+ // Item output with an array payload: callers get `{ data: FieldItem[] }`
13345
+ // directly rather than a paginated list.
13339
13346
  output: "item",
13340
13347
  formatter: tableFieldItemFormatter,
13341
13348
  resolvers: { table: tableIdResolver, fields: tableFieldsResolver },
@@ -13348,7 +13355,9 @@ var createTableFieldsPlugin = defineMethod({
13348
13355
  { authRequired: true, resource: { type: "table", id: tableId } }
13349
13356
  );
13350
13357
  const response = CreateTableFieldsApiResponseSchema.parse(rawResponse);
13351
- return response.data.map((changeset) => transformFieldItem(changeset.new));
13358
+ return {
13359
+ data: response.data.map((changeset) => transformFieldItem(changeset.new))
13360
+ };
13352
13361
  }
13353
13362
  });
13354
13363
  var DeleteTableFieldsDescription = "Delete one or more fields from a table";
@@ -13489,8 +13498,10 @@ var getTableRecordPlugin = defineMethod({
13489
13498
  keyMode: input.keyMode
13490
13499
  });
13491
13500
  return {
13492
- ...transformRecordItem(response.data),
13493
- data: translator.translateOutput(response.data.data)
13501
+ data: {
13502
+ ...transformRecordItem(response.data),
13503
+ data: translator.translateOutput(response.data.data)
13504
+ }
13494
13505
  };
13495
13506
  }
13496
13507
  });
@@ -13669,8 +13680,8 @@ var createTableRecordsPlugin = defineMethod({
13669
13680
  returnType: "RecordItem[]",
13670
13681
  inputSchema: CreateTableRecordsOptionsInputSchema,
13671
13682
  outputSchema: RecordItemSchema,
13672
- // `run` returns the record array; `output: "item"` wraps it in `{ data }` to
13673
- // match the legacy `{ data: RecordItem[] }` surface.
13683
+ // Item output with an array payload: callers get `{ data: RecordItem[] }`
13684
+ // directly rather than a paginated list.
13674
13685
  output: "item",
13675
13686
  resolvers: { table: tableIdResolver, records: tableRecordsResolver },
13676
13687
  formatter: tableRecordFormatter,
@@ -13696,10 +13707,12 @@ var createTableRecordsPlugin = defineMethod({
13696
13707
  for (const changeset of response.data) {
13697
13708
  throwOnRecordErrors(changeset.new);
13698
13709
  }
13699
- return response.data.map((changeset) => ({
13700
- ...transformRecordItem(changeset.new),
13701
- data: translator.translateOutput(changeset.new.data)
13702
- }));
13710
+ return {
13711
+ data: response.data.map((changeset) => ({
13712
+ ...transformRecordItem(changeset.new),
13713
+ data: translator.translateOutput(changeset.new.data)
13714
+ }))
13715
+ };
13703
13716
  }
13704
13717
  });
13705
13718
  var DeleteTableRecordsDescription = "Delete one or more records from a table";
@@ -13779,8 +13792,8 @@ var updateTableRecordsPlugin = defineMethod({
13779
13792
  returnType: "RecordItem[]",
13780
13793
  inputSchema: UpdateTableRecordsOptionsInputSchema,
13781
13794
  outputSchema: RecordItemSchema,
13782
- // `run` returns the record array; `output: "item"` wraps it in `{ data }` to
13783
- // match the legacy `{ data: RecordItem[] }` surface.
13795
+ // Item output with an array payload: callers get `{ data: RecordItem[] }`
13796
+ // directly rather than a paginated list.
13784
13797
  output: "item",
13785
13798
  resolvers: { table: tableIdResolver, records: tableUpdateRecordsResolver },
13786
13799
  formatter: tableRecordFormatter,
@@ -13807,10 +13820,12 @@ var updateTableRecordsPlugin = defineMethod({
13807
13820
  for (const changeset of response.data) {
13808
13821
  throwOnRecordErrors(changeset.new);
13809
13822
  }
13810
- return response.data.map((changeset) => ({
13811
- ...transformRecordItem(changeset.new),
13812
- data: translator.translateOutput(changeset.new.data)
13813
- }));
13823
+ return {
13824
+ data: response.data.map((changeset) => ({
13825
+ ...transformRecordItem(changeset.new),
13826
+ data: translator.translateOutput(changeset.new.data)
13827
+ }))
13828
+ };
13814
13829
  }
13815
13830
  });
13816
13831
  var RelayRequestSchema = z.object({
@@ -14078,6 +14093,7 @@ function buildErrorEvent(data, context = {}) {
14078
14093
  app_version_id: context.app_version_id,
14079
14094
  environment: context.environment,
14080
14095
  ...data,
14096
+ ...getTtyContext(),
14081
14097
  agent: getAgent(),
14082
14098
  caller_package: context.caller_package ?? null,
14083
14099
  caller_package_version: context.caller_package_version ?? null,
@@ -14127,6 +14143,7 @@ function buildErrorEventWithContext(data, context = {}) {
14127
14143
  environment: context.environment ?? (globalThis.process?.env?.NODE_ENV || null),
14128
14144
  execution_time_before_error_ms: executionTime,
14129
14145
  ...data,
14146
+ ...getTtyContext(),
14130
14147
  agent: getAgent(),
14131
14148
  caller_package: context.caller_package ?? null,
14132
14149
  caller_package_version: context.caller_package_version ?? null,
@@ -14958,7 +14975,7 @@ var getWorkflowPlugin = defineMethod({
14958
14975
  resource: { type: "workflow", id: input.workflow }
14959
14976
  }
14960
14977
  );
14961
- return GetWorkflowResponseSchema.parse(raw);
14978
+ return { data: GetWorkflowResponseSchema.parse(raw) };
14962
14979
  }
14963
14980
  });
14964
14981
  var CreateWorkflowOptionsSchema = z.object({
@@ -15016,7 +15033,7 @@ var createWorkflowPlugin = defineMethod({
15016
15033
  authRequired: true
15017
15034
  }
15018
15035
  );
15019
- return CreateWorkflowResponseSchema.parse(raw);
15036
+ return { data: CreateWorkflowResponseSchema.parse(raw) };
15020
15037
  }
15021
15038
  });
15022
15039
  var UpdateWorkflowOptionsSchema = z.object({
@@ -15068,7 +15085,7 @@ var updateWorkflowPlugin = defineMethod({
15068
15085
  resource: { type: "workflow", id: input.workflow }
15069
15086
  }
15070
15087
  );
15071
- return UpdateWorkflowResponseSchema.parse(raw);
15088
+ return { data: UpdateWorkflowResponseSchema.parse(raw) };
15072
15089
  }
15073
15090
  });
15074
15091
  var EnableWorkflowOptionsSchema = z.object({
@@ -15100,7 +15117,7 @@ var enableWorkflowPlugin = defineMethod({
15100
15117
  resource: { type: "workflow", id: input.workflow }
15101
15118
  }
15102
15119
  );
15103
- return EnableWorkflowResponseSchema.parse(raw);
15120
+ return { data: EnableWorkflowResponseSchema.parse(raw) };
15104
15121
  }
15105
15122
  });
15106
15123
  var DisableWorkflowOptionsSchema = z.object({
@@ -15134,7 +15151,7 @@ var disableWorkflowPlugin = defineMethod({
15134
15151
  resource: { type: "workflow", id: input.workflow }
15135
15152
  }
15136
15153
  );
15137
- return DisableWorkflowResponseSchema.parse(raw);
15154
+ return { data: DisableWorkflowResponseSchema.parse(raw) };
15138
15155
  }
15139
15156
  });
15140
15157
  var DeleteWorkflowOptionsSchema = z.object({
@@ -15357,7 +15374,7 @@ var getDurableRunPlugin = defineMethod({
15357
15374
  resource: { type: "run", id: input.run }
15358
15375
  }
15359
15376
  );
15360
- return GetDurableRunResponseSchema.parse(raw);
15377
+ return { data: GetDurableRunResponseSchema.parse(raw) };
15361
15378
  }
15362
15379
  });
15363
15380
  var RunNotificationEventSchema = z.enum(["started", "progress", "completed", "error", "cancelled"]).describe("Run lifecycle event this notification subscribes to");
@@ -15457,7 +15474,7 @@ var runDurablePlugin = defineMethod({
15457
15474
  const raw = await api.post(`${CODE_SUBSTRATE_RUNNER_API}/runs`, body, {
15458
15475
  authRequired: true
15459
15476
  });
15460
- return RunDurableResponseSchema.parse(raw);
15477
+ return { data: RunDurableResponseSchema.parse(raw) };
15461
15478
  }
15462
15479
  });
15463
15480
  var CancelDurableRunOptionsSchema = z.object({
@@ -15493,7 +15510,7 @@ var cancelDurableRunPlugin = defineMethod({
15493
15510
  resource: { type: "run", id: input.run }
15494
15511
  }
15495
15512
  );
15496
- return { id: input.run, status: "cancelled" };
15513
+ return { data: { id: input.run, status: "cancelled" } };
15497
15514
  }
15498
15515
  });
15499
15516
  var TriggerConfigSchema = z.object({
@@ -15634,7 +15651,7 @@ var publishWorkflowVersionPlugin = defineMethod({
15634
15651
  resource: { type: "workflow", id: input.workflow }
15635
15652
  }
15636
15653
  );
15637
- return PublishWorkflowVersionResponseSchema.parse(raw);
15654
+ return { data: PublishWorkflowVersionResponseSchema.parse(raw) };
15638
15655
  }
15639
15656
  });
15640
15657
  var WorkflowVersionListItemSchema = z.object({
@@ -15750,7 +15767,7 @@ var getWorkflowVersionPlugin = defineMethod({
15750
15767
  resource: { type: "workflow-version", id: input.version }
15751
15768
  }
15752
15769
  );
15753
- return GetWorkflowVersionResponseSchema.parse(raw);
15770
+ return { data: GetWorkflowVersionResponseSchema.parse(raw) };
15754
15771
  }
15755
15772
  });
15756
15773
  var WorkflowRunStatusSchema = z.union([
@@ -15884,7 +15901,7 @@ var getWorkflowRunPlugin = defineMethod({
15884
15901
  resource: { type: "workflow-run", id: input.run }
15885
15902
  }
15886
15903
  );
15887
- return GetWorkflowRunResponseSchema.parse(raw);
15904
+ return { data: GetWorkflowRunResponseSchema.parse(raw) };
15888
15905
  }
15889
15906
  });
15890
15907
  var GetTriggerRunOptionsSchema = z.object({
@@ -15928,7 +15945,7 @@ var getTriggerRunPlugin = defineMethod({
15928
15945
  resource: { type: "workflow-trigger", id: input.trigger }
15929
15946
  }
15930
15947
  );
15931
- return GetTriggerRunResponseSchema.parse(raw);
15948
+ return { data: GetTriggerRunResponseSchema.parse(raw) };
15932
15949
  }
15933
15950
  });
15934
15951
  var TriggerWorkflowLookupResponseSchema = z.object({
@@ -15985,7 +16002,7 @@ var triggerWorkflowPlugin = defineMethod({
15985
16002
  resource: { type: "workflow", id: input.workflow }
15986
16003
  }
15987
16004
  );
15988
- return TriggerWorkflowResponseSchema.parse(raw);
16005
+ return { data: TriggerWorkflowResponseSchema.parse(raw) };
15989
16006
  }
15990
16007
  });
15991
16008
 
@@ -1081,6 +1081,21 @@ type StrictPage$1<TResponse> = SdkPage<unknown> & {
1081
1081
  type ItemOf$1<TResponse> = TResponse extends SdkPage<infer TItem> ? TItem : TResponse extends {
1082
1082
  data: readonly (infer TItem)[];
1083
1083
  } ? TItem : never;
1084
+ /**
1085
+ * A response whose only own key is `data`. Gates the item overload of
1086
+ * `defineMethod` the way `StrictPage` gates list-standard: `run` returns the
1087
+ * `{ data }` envelope itself, and an envelope with extra keys is rejected (a
1088
+ * future variant may accept metadata alongside `data`).
1089
+ */
1090
+ type StrictItem<TResponse> = {
1091
+ data: unknown;
1092
+ } & {
1093
+ [K in Exclude<keyof TResponse, "data">]?: never;
1094
+ };
1095
+ /** Data type sourced from an item envelope. */
1096
+ type DataOf<TResponse> = TResponse extends {
1097
+ data: infer TData;
1098
+ } ? TData : never;
1084
1099
  /**
1085
1100
  * A leaf plugin that is a single value (not a function). `value` is a static
1086
1101
  * constant; `get({ imports })` computes the value from imports. Like a
@@ -2095,8 +2110,8 @@ declare function createPluginStack<TRequires = object>(): PluginStack<TRequires,
2095
2110
  *
2096
2111
  * The `output` mode shapes `run`'s result into the public surface and drives
2097
2112
  * the overload that types the call: raw (default, passthrough), `item`
2098
- * (`run` returns `T`, surfaced as `Promise<{ data: T }>`), or `list` (`run`
2099
- * returns one `SdkPage`, surfaced as `PaginatedSdkResult`). See Output.
2113
+ * (`run` returns `{ data: T }`, surfaced as `Promise<{ data: T }>`), or `list`
2114
+ * (`run` returns one `SdkPage`, surfaced as `PaginatedSdkResult`). See Output.
2100
2115
  */
2101
2116
  declare function defineMethod<const TName extends string, TInput, TOutput, const TPositional extends readonly (keyof TInput & string)[] = readonly [], const TImports extends ImportsInput = readonly [], const TNamespace extends string = "", TState = undefined>(config: {
2102
2117
  name: TName;
@@ -2125,7 +2140,7 @@ declare function defineMethod<const TName extends string, TInput, TOutput, const
2125
2140
  }) => void | Promise<void>;
2126
2141
  run: (bag: MethodRunBag<ImportsOf<TImports>, TInput, TState>) => TOutput;
2127
2142
  } & LeafMetaFields): MethodPlugin<TName, TInput, TOutput, TPositional> & LeafSummary<TNamespace, TName, TImports>;
2128
- declare function defineMethod<const TName extends string, TInput, TData, const TImports extends ImportsInput = readonly [], const TNamespace extends string = "", TState = undefined>(config: {
2143
+ declare function defineMethod<const TName extends string, TInput, TResponse extends StrictItem<TResponse>, TData = DataOf<TResponse>, const TImports extends ImportsInput = readonly [], const TNamespace extends string = "", TState = undefined>(config: {
2129
2144
  name: TName;
2130
2145
  namespace?: TNamespace;
2131
2146
  imports?: TImports & StaticList<TImports>;
@@ -2143,9 +2158,9 @@ declare function defineMethod<const TName extends string, TInput, TData, const T
2143
2158
  state: TState;
2144
2159
  input?: unknown;
2145
2160
  }) => void | Promise<void>;
2146
- run: (bag: MethodRunBag<ImportsOf<TImports>, TInput, TState>) => TData;
2161
+ run: (bag: MethodRunBag<ImportsOf<TImports>, TInput, TState>) => TResponse | Promise<TResponse>;
2147
2162
  } & LeafMetaFields): MethodPlugin<TName, TInput, Promise<{
2148
- data: Awaited<TData>;
2163
+ data: TData;
2149
2164
  }>> & LeafSummary<TNamespace, TName, TImports>;
2150
2165
  declare function defineMethod<const TName extends string, TInput, TResponse extends StrictPage$1<TResponse>, TItem = ItemOf$1<TResponse>, const TImports extends ImportsInput = readonly [], const TNamespace extends string = "", TState = undefined>(config: {
2151
2166
  name: TName;
@@ -3804,6 +3819,8 @@ interface ErrorOccurredEvent extends BaseEvent {
3804
3819
  recovery_successful?: boolean | null;
3805
3820
  environment?: string | null;
3806
3821
  execution_time_before_error_ms?: number | null;
3822
+ stdin_is_tty?: boolean | null;
3823
+ stdout_is_tty?: boolean | null;
3807
3824
  agent?: string | null;
3808
3825
  caller_package?: string | null;
3809
3826
  caller_package_version?: string | null;
@@ -1081,6 +1081,21 @@ type StrictPage$1<TResponse> = SdkPage<unknown> & {
1081
1081
  type ItemOf$1<TResponse> = TResponse extends SdkPage<infer TItem> ? TItem : TResponse extends {
1082
1082
  data: readonly (infer TItem)[];
1083
1083
  } ? TItem : never;
1084
+ /**
1085
+ * A response whose only own key is `data`. Gates the item overload of
1086
+ * `defineMethod` the way `StrictPage` gates list-standard: `run` returns the
1087
+ * `{ data }` envelope itself, and an envelope with extra keys is rejected (a
1088
+ * future variant may accept metadata alongside `data`).
1089
+ */
1090
+ type StrictItem<TResponse> = {
1091
+ data: unknown;
1092
+ } & {
1093
+ [K in Exclude<keyof TResponse, "data">]?: never;
1094
+ };
1095
+ /** Data type sourced from an item envelope. */
1096
+ type DataOf<TResponse> = TResponse extends {
1097
+ data: infer TData;
1098
+ } ? TData : never;
1084
1099
  /**
1085
1100
  * A leaf plugin that is a single value (not a function). `value` is a static
1086
1101
  * constant; `get({ imports })` computes the value from imports. Like a
@@ -2095,8 +2110,8 @@ declare function createPluginStack<TRequires = object>(): PluginStack<TRequires,
2095
2110
  *
2096
2111
  * The `output` mode shapes `run`'s result into the public surface and drives
2097
2112
  * the overload that types the call: raw (default, passthrough), `item`
2098
- * (`run` returns `T`, surfaced as `Promise<{ data: T }>`), or `list` (`run`
2099
- * returns one `SdkPage`, surfaced as `PaginatedSdkResult`). See Output.
2113
+ * (`run` returns `{ data: T }`, surfaced as `Promise<{ data: T }>`), or `list`
2114
+ * (`run` returns one `SdkPage`, surfaced as `PaginatedSdkResult`). See Output.
2100
2115
  */
2101
2116
  declare function defineMethod<const TName extends string, TInput, TOutput, const TPositional extends readonly (keyof TInput & string)[] = readonly [], const TImports extends ImportsInput = readonly [], const TNamespace extends string = "", TState = undefined>(config: {
2102
2117
  name: TName;
@@ -2125,7 +2140,7 @@ declare function defineMethod<const TName extends string, TInput, TOutput, const
2125
2140
  }) => void | Promise<void>;
2126
2141
  run: (bag: MethodRunBag<ImportsOf<TImports>, TInput, TState>) => TOutput;
2127
2142
  } & LeafMetaFields): MethodPlugin<TName, TInput, TOutput, TPositional> & LeafSummary<TNamespace, TName, TImports>;
2128
- declare function defineMethod<const TName extends string, TInput, TData, const TImports extends ImportsInput = readonly [], const TNamespace extends string = "", TState = undefined>(config: {
2143
+ declare function defineMethod<const TName extends string, TInput, TResponse extends StrictItem<TResponse>, TData = DataOf<TResponse>, const TImports extends ImportsInput = readonly [], const TNamespace extends string = "", TState = undefined>(config: {
2129
2144
  name: TName;
2130
2145
  namespace?: TNamespace;
2131
2146
  imports?: TImports & StaticList<TImports>;
@@ -2143,9 +2158,9 @@ declare function defineMethod<const TName extends string, TInput, TData, const T
2143
2158
  state: TState;
2144
2159
  input?: unknown;
2145
2160
  }) => void | Promise<void>;
2146
- run: (bag: MethodRunBag<ImportsOf<TImports>, TInput, TState>) => TData;
2161
+ run: (bag: MethodRunBag<ImportsOf<TImports>, TInput, TState>) => TResponse | Promise<TResponse>;
2147
2162
  } & LeafMetaFields): MethodPlugin<TName, TInput, Promise<{
2148
- data: Awaited<TData>;
2163
+ data: TData;
2149
2164
  }>> & LeafSummary<TNamespace, TName, TImports>;
2150
2165
  declare function defineMethod<const TName extends string, TInput, TResponse extends StrictPage$1<TResponse>, TItem = ItemOf$1<TResponse>, const TImports extends ImportsInput = readonly [], const TNamespace extends string = "", TState = undefined>(config: {
2151
2166
  name: TName;
@@ -3804,6 +3819,8 @@ interface ErrorOccurredEvent extends BaseEvent {
3804
3819
  recovery_successful?: boolean | null;
3805
3820
  environment?: string | null;
3806
3821
  execution_time_before_error_ms?: number | null;
3822
+ stdin_is_tty?: boolean | null;
3823
+ stdout_is_tty?: boolean | null;
3807
3824
  agent?: string | null;
3808
3825
  caller_package?: string | null;
3809
3826
  caller_package_version?: string | null;