@usecontextlayer/ctxe 0.5.7 → 0.5.8

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.
package/dist/cli.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7463ebb3-f56d-51c5-a74a-b15957e43865")}catch(e){}}();
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="540c1501-14bb-5ba6-8d79-8c00f903a9ee")}catch(e){}}();
4
4
  import { createRequire } from "node:module";
5
5
  import * as Sentry from "@sentry/node";
6
6
  import { mkdir, readFile, readdir, rename, rm, stat, writeFile } from "node:fs/promises";
@@ -59,7 +59,7 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
59
59
 
60
60
  //#endregion
61
61
  //#region package.json
62
- var version$2 = "0.5.7";
62
+ var version$2 = "0.5.8";
63
63
 
64
64
  //#endregion
65
65
  //#region sentry.ts
@@ -4147,39 +4147,38 @@ function superRefine$1(fn, params) {
4147
4147
  }
4148
4148
  `${JSON.stringify({ render: {
4149
4149
  elements: {
4150
- ask: {
4151
- children: ["askLabel"],
4152
- on: { press: {
4153
- action: "openChat",
4154
- params: {
4155
- autoSend: false,
4156
- content: { $template: "What should I know about @output/${path}?" }
4157
- }
4158
- } },
4159
- props: { className: null },
4160
- type: "Pressable"
4161
- },
4162
- askLabel: {
4163
- props: { text: "Ask about this doc" },
4164
- type: "Text"
4165
- },
4166
4150
  body: {
4167
4151
  props: { text: { $item: "body" } },
4168
- type: "Text"
4152
+ type: "Markdown",
4153
+ visible: { $item: "body" }
4169
4154
  },
4170
4155
  card: {
4171
4156
  children: [
4172
- "body",
4173
- "draft",
4174
- "ask"
4157
+ "meta",
4158
+ "laneline",
4159
+ "needsline",
4160
+ "body"
4175
4161
  ],
4176
- props: { title: { $item: "title" } },
4162
+ props: { title: { $item: "proposed_title" } },
4177
4163
  type: "Card"
4178
4164
  },
4165
+ day: {
4166
+ props: {
4167
+ text: { $concat: ["Activity ", {
4168
+ $format: "date",
4169
+ locale: "en-US",
4170
+ options: { timeZone: "UTC" },
4171
+ value: { $item: "occurred_on" }
4172
+ }] },
4173
+ variant: "outline"
4174
+ },
4175
+ type: "Badge",
4176
+ visible: { $item: "occurred_on" }
4177
+ },
4179
4178
  detail: {
4180
4179
  children: ["card"],
4181
4180
  props: {
4182
- className: "mx-auto max-w-md p-8",
4181
+ className: "mx-auto max-w-2xl p-8",
4183
4182
  direction: "vertical",
4184
4183
  gap: "md"
4185
4184
  },
@@ -4189,54 +4188,121 @@ function superRefine$1(fn, params) {
4189
4188
  },
4190
4189
  type: "Stack"
4191
4190
  },
4192
- draft: {
4193
- children: ["draftLabel"],
4194
- on: { press: {
4195
- action: "openChat",
4196
- params: {
4197
- autoSend: true,
4198
- content: { $template: "Draft a reply to @output/${path}" }
4199
- }
4200
- } },
4201
- props: { className: null },
4202
- type: "Pressable"
4191
+ kind: {
4192
+ props: {
4193
+ text: { $item: "kind" },
4194
+ variant: "secondary"
4195
+ },
4196
+ type: "Badge"
4203
4197
  },
4204
- draftLabel: {
4205
- props: { text: "Draft reply" },
4206
- type: "Text"
4198
+ laneline: {
4199
+ props: {
4200
+ text: { $concat: ["Lane · ", { $item: "lane" }] },
4201
+ variant: "muted"
4202
+ },
4203
+ type: "Text",
4204
+ visible: { $item: "lane" }
4205
+ },
4206
+ meta: {
4207
+ children: ["kind", "day"],
4208
+ props: {
4209
+ align: "center",
4210
+ direction: "horizontal",
4211
+ gap: "sm"
4212
+ },
4213
+ type: "Stack"
4214
+ },
4215
+ needsline: {
4216
+ props: {
4217
+ text: "Needs a lane",
4218
+ variant: "warning"
4219
+ },
4220
+ type: "Badge",
4221
+ visible: { $item: "needs_lane" }
4207
4222
  }
4208
4223
  },
4209
4224
  root: "detail"
4210
4225
  } }, null, " ")}`, `${JSON.stringify({ render: {
4211
4226
  elements: {
4212
- card: {
4213
- props: { title: { $item: "title" } },
4214
- type: "Card"
4227
+ freshness: {
4228
+ props: {
4229
+ text: { $concat: ["Updated ", { $relativeDate: {
4230
+ now: { $state: "/now" },
4231
+ value: { $maxBy: {
4232
+ field: "last_updated",
4233
+ items: { $state: "/items" }
4234
+ } }
4235
+ } }] },
4236
+ variant: "muted"
4237
+ },
4238
+ type: "Text",
4239
+ visible: { $state: "/items/0" }
4215
4240
  },
4216
- list: {
4217
- children: ["row"],
4241
+ page: {
4242
+ children: ["freshness", "table"],
4218
4243
  props: {
4219
- className: "mx-auto max-w-md p-8",
4244
+ align: "stretch",
4245
+ className: "p-8",
4220
4246
  direction: "vertical",
4221
4247
  gap: "md"
4222
4248
  },
4223
- repeat: {
4224
- key: "path",
4225
- statePath: "/items"
4226
- },
4227
4249
  type: "Stack"
4228
4250
  },
4229
- row: {
4230
- children: ["card"],
4231
- on: { press: {
4232
- action: "navigate",
4233
- params: { path: { $template: "${path}" } }
4234
- } },
4235
- props: { className: null },
4236
- type: "Pressable"
4251
+ table: {
4252
+ props: {
4253
+ columns: [
4254
+ {
4255
+ key: "client",
4256
+ label: "Client",
4257
+ variant: "strong"
4258
+ },
4259
+ {
4260
+ key: "title",
4261
+ label: "Update",
4262
+ width: "wide"
4263
+ },
4264
+ {
4265
+ component: "badge",
4266
+ key: "kind",
4267
+ label: "Kind",
4268
+ variantOverride: {
4269
+ call: "outline",
4270
+ followup: "warning",
4271
+ release: "success"
4272
+ }
4273
+ },
4274
+ {
4275
+ component: "badge",
4276
+ key: "lane",
4277
+ label: "Lane",
4278
+ variantOverride: { "Needs a lane": "warning" }
4279
+ },
4280
+ {
4281
+ key: "occurred_on",
4282
+ label: "Activity",
4283
+ type: "date",
4284
+ variant: "muted",
4285
+ width: "narrow"
4286
+ }
4287
+ ],
4288
+ emptyText: "No updates match",
4289
+ filterable: ["kind", "client"],
4290
+ groupable: [
4291
+ "lane",
4292
+ "client",
4293
+ "kind"
4294
+ ],
4295
+ initialSort: {
4296
+ desc: true,
4297
+ key: "occurred_on"
4298
+ },
4299
+ rowLink: "path",
4300
+ rows: { $state: "/items" }
4301
+ },
4302
+ type: "Table"
4237
4303
  }
4238
4304
  },
4239
- root: "list"
4305
+ root: "page"
4240
4306
  } }, null, " ")}`;
4241
4307
  const segmentSchema = string$4().min(1, "a repoId segment must be non-empty").refine((s) => s !== "." && s !== ".." && !s.includes("/"), { message: "a repoId segment must not be '.'/'..' or contain '/'" });
4242
4308
  const sessionMetaSchema = object$3({
@@ -30864,6 +30930,8 @@ async function cleanAllUntracked(repo) {
30864
30930
  async function createCommit(repo, message) {
30865
30931
  await runGit(repo, ["add", "-A"]);
30866
30932
  await runGit(repo, [
30933
+ "-c",
30934
+ "commit.gpgsign=false",
30867
30935
  "commit",
30868
30936
  "--author",
30869
30937
  `${COMMIT_AUTHOR_NAME} <${COMMIT_AUTHOR_EMAIL}>`,
@@ -34587,7 +34655,14 @@ const CreateBindingInput = object$1({
34587
34655
  models: BindingModels.optionalNullable(),
34588
34656
  pluginId: property$1("plugin_id", string$1())
34589
34657
  });
34658
+ const UpdateBindingInput = object$1({
34659
+ auth: BindingAuthInput.optional(),
34660
+ config: record(string$1(), unknown$1()).optional(),
34661
+ enabled: boolean().optional(),
34662
+ models: BindingModels.optionalNullable()
34663
+ });
34590
34664
  const Binding = object$1({
34665
+ auth: BindingAuthInput,
34591
34666
  authType: property$1("auth_type", string$1()),
34592
34667
  baseId: property$1("base_id", string$1()),
34593
34668
  bindingId: property$1("binding_id", string$1()),
@@ -35079,6 +35154,83 @@ var BindingsClient = class {
35079
35154
  }
35080
35155
  return handleNonStatusCodeError$1(_response.error, _response.rawResponse, "POST", "/base/bases/{base_id}/bindings");
35081
35156
  }
35157
+ /**
35158
+ * @param {BaseAPI.UpdateBindingInput} request
35159
+ * @param {BindingsClient.RequestOptions} requestOptions - Request-specific configuration.
35160
+ *
35161
+ * @throws {@link BaseAPI.BadRequestError}
35162
+ * @throws {@link BaseAPI.ForbiddenError}
35163
+ * @throws {@link BaseAPI.NotFoundError}
35164
+ *
35165
+ * @example
35166
+ * await client.bindings.updateBinding({
35167
+ * baseId: "base_id",
35168
+ * bindingId: "binding_id"
35169
+ * })
35170
+ */
35171
+ updateBinding(request, requestOptions) {
35172
+ return HttpResponsePromise$1.fromPromise(this.__updateBinding(request, requestOptions));
35173
+ }
35174
+ async __updateBinding(request, requestOptions) {
35175
+ const { baseId, bindingId, ..._body } = request;
35176
+ const _headers = mergeHeaders$1(this._options?.headers, requestOptions?.headers);
35177
+ const _response = await fetcher$1({
35178
+ url: join$1(await Supplier$1.get(this._options.baseUrl) ?? await Supplier$1.get(this._options.environment), `base/bases/${encodePathParam$1(baseId)}/bindings/${encodePathParam$1(bindingId)}`),
35179
+ method: "PATCH",
35180
+ headers: _headers,
35181
+ contentType: "application/json",
35182
+ queryString: queryBuilder$1().mergeAdditional(requestOptions?.queryParams).build(),
35183
+ requestType: "json",
35184
+ body: UpdateBindingInput.jsonOrThrow(_body, {
35185
+ unrecognizedObjectKeys: "strip",
35186
+ omitUndefined: true
35187
+ }),
35188
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
35189
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
35190
+ abortSignal: requestOptions?.abortSignal,
35191
+ fetchFn: this._options?.fetch,
35192
+ logging: this._options.logging
35193
+ });
35194
+ if (_response.ok) return {
35195
+ data: Binding.parseOrThrow(_response.body, {
35196
+ unrecognizedObjectKeys: "passthrough",
35197
+ allowUnrecognizedUnionMembers: true,
35198
+ allowUnrecognizedEnumValues: true,
35199
+ skipValidation: true,
35200
+ breadcrumbsPrefix: ["response"]
35201
+ }),
35202
+ rawResponse: _response.rawResponse
35203
+ };
35204
+ if (_response.error.reason === "status-code") switch (_response.error.statusCode) {
35205
+ case 400: throw new BadRequestError$1(Error_$1.parseOrThrow(_response.error.body, {
35206
+ unrecognizedObjectKeys: "passthrough",
35207
+ allowUnrecognizedUnionMembers: true,
35208
+ allowUnrecognizedEnumValues: true,
35209
+ skipValidation: true,
35210
+ breadcrumbsPrefix: ["response"]
35211
+ }), _response.rawResponse);
35212
+ case 403: throw new ForbiddenError$1(Error_$1.parseOrThrow(_response.error.body, {
35213
+ unrecognizedObjectKeys: "passthrough",
35214
+ allowUnrecognizedUnionMembers: true,
35215
+ allowUnrecognizedEnumValues: true,
35216
+ skipValidation: true,
35217
+ breadcrumbsPrefix: ["response"]
35218
+ }), _response.rawResponse);
35219
+ case 404: throw new NotFoundError$1(Error_$1.parseOrThrow(_response.error.body, {
35220
+ unrecognizedObjectKeys: "passthrough",
35221
+ allowUnrecognizedUnionMembers: true,
35222
+ allowUnrecognizedEnumValues: true,
35223
+ skipValidation: true,
35224
+ breadcrumbsPrefix: ["response"]
35225
+ }), _response.rawResponse);
35226
+ default: throw new BaseAPIError({
35227
+ statusCode: _response.error.statusCode,
35228
+ body: _response.error.body,
35229
+ rawResponse: _response.rawResponse
35230
+ });
35231
+ }
35232
+ return handleNonStatusCodeError$1(_response.error, _response.rawResponse, "PATCH", "/base/bases/{base_id}/bindings/{binding_id}");
35233
+ }
35082
35234
  };
35083
35235
  var DsnClient = class {
35084
35236
  _options;
@@ -38970,4 +39122,4 @@ runCli().catch((error) => {
38970
39122
  //#endregion
38971
39123
  export { createProgram, resolveRepoContext, resolveRuntimePaths, runCli };
38972
39124
  //# sourceMappingURL=cli.mjs.map
38973
- //# debugId=7463ebb3-f56d-51c5-a74a-b15957e43865
39125
+ //# debugId=540c1501-14bb-5ba6-8d79-8c00f903a9ee