replicas-cli 0.3.514 → 0.3.516

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 (2) hide show
  1. package/dist/index.cjs +136 -118
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -500,8 +500,8 @@ function assertNever(_x) {
500
500
  function assert(_) {
501
501
  }
502
502
  function getEnumValues(entries) {
503
- const numericValues = Object.values(entries).filter((v) => typeof v === "number");
504
- const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
503
+ const numericValues = Object.values(entries).filter((v2) => typeof v2 === "number");
504
+ const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v2]) => v2);
505
505
  return values;
506
506
  }
507
507
  function joinValues(array2, separator = "|") {
@@ -544,9 +544,9 @@ function defineLazy(object2, key, getter) {
544
544
  }
545
545
  return value;
546
546
  },
547
- set(v) {
547
+ set(v2) {
548
548
  Object.defineProperty(object2, key, {
549
- value: v
549
+ value: v2
550
550
  // configurable: true,
551
551
  });
552
552
  },
@@ -3327,10 +3327,10 @@ var init_schemas = __esm({
3327
3327
  v7: 7,
3328
3328
  v8: 8
3329
3329
  };
3330
- const v = versionMap[def.version];
3331
- if (v === void 0)
3330
+ const v2 = versionMap[def.version];
3331
+ if (v2 === void 0)
3332
3332
  throw new Error(`Invalid UUID version: "${def.version}"`);
3333
- def.pattern ?? (def.pattern = uuid(v));
3333
+ def.pattern ?? (def.pattern = uuid(v2));
3334
3334
  } else
3335
3335
  def.pattern ?? (def.pattern = uuid());
3336
3336
  $ZodStringFormat.init(inst, def);
@@ -3840,8 +3840,8 @@ var init_schemas = __esm({
3840
3840
  if (!Object.prototype.hasOwnProperty.call(propValues, key)) {
3841
3841
  assignProp(propValues, key, /* @__PURE__ */ new Set());
3842
3842
  }
3843
- for (const v of field2.values)
3844
- propValues[key].add(v);
3843
+ for (const v2 of field2.values)
3844
+ propValues[key].add(v2);
3845
3845
  if (field2.optin !== void 0)
3846
3846
  propValues[key].add(void 0);
3847
3847
  }
@@ -4108,11 +4108,11 @@ var init_schemas = __esm({
4108
4108
  throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
4109
4109
  if (pv[zod.def.discriminator]?.has(void 0))
4110
4110
  undefinedCount++;
4111
- for (const [k, v] of Object.entries(pv)) {
4111
+ for (const [k, v2] of Object.entries(pv)) {
4112
4112
  if (!Object.prototype.hasOwnProperty.call(propValues, k)) {
4113
4113
  assignProp(propValues, k, /* @__PURE__ */ new Set());
4114
4114
  }
4115
- for (const val of v) {
4115
+ for (const val of v2) {
4116
4116
  propValues[k].add(val);
4117
4117
  }
4118
4118
  }
@@ -4659,8 +4659,8 @@ var init_schemas = __esm({
4659
4659
  $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, def) => {
4660
4660
  $ZodType.init(inst, def);
4661
4661
  defineLazyInternal(inst, "values", (zod) => {
4662
- const v = zod.def.innerType._zod.values;
4663
- return v ? new Set([...v].filter((x) => x !== void 0)) : void 0;
4662
+ const v2 = zod.def.innerType._zod.values;
4663
+ return v2 ? new Set([...v2].filter((x) => x !== void 0)) : void 0;
4664
4664
  });
4665
4665
  inst._zod.parse = (payload, ctx) => {
4666
4666
  const result = def.innerType._zod.run(payload, ctx);
@@ -7790,7 +7790,7 @@ var init_he = __esm({
7790
7790
  if (issue3.values.length === 1) {
7791
7791
  return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${stringifyPrimitive(issue3.values[0])}`;
7792
7792
  }
7793
- const stringified = issue3.values.map((v) => stringifyPrimitive(v));
7793
+ const stringified = issue3.values.map((v2) => stringifyPrimitive(v2));
7794
7794
  if (issue3.values.length === 2) {
7795
7795
  return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${stringified[0]} \u05D0\u05D5 ${stringified[1]}`;
7796
7796
  }
@@ -13470,8 +13470,8 @@ ${code}
13470
13470
  return fn;
13471
13471
  }
13472
13472
  function addConstant(ctx, value) {
13473
- for (const [name2, v] of ctx.constants) {
13474
- if (v === value)
13473
+ for (const [name2, v2] of ctx.constants) {
13474
+ if (v2 === value)
13475
13475
  return name2;
13476
13476
  }
13477
13477
  const name = `c${ctx.constantCounter++}`;
@@ -13606,9 +13606,9 @@ function generateChecks(doc, ctx, schema, accessor) {
13606
13606
  }
13607
13607
  function codePointLengthVar(doc, ctx, accessor, inDoubt) {
13608
13608
  const cpLen = addConstant(ctx, codePointLength);
13609
- const v = newVar(ctx);
13610
- doc.write(`const ${v} = typeof ${accessor} === "string" && ${inDoubt} ? ${cpLen}(${accessor}) : ${accessor}.length;`);
13611
- return v;
13609
+ const v2 = newVar(ctx);
13610
+ doc.write(`const ${v2} = typeof ${accessor} === "string" && ${inDoubt} ? ${cpLen}(${accessor}) : ${accessor}.length;`);
13611
+ return v2;
13612
13612
  }
13613
13613
  function numericOperand(value, label) {
13614
13614
  if (typeof value !== "number" || !Number.isFinite(value)) {
@@ -15757,7 +15757,7 @@ function _set(Class2, valueType, params) {
15757
15757
  }
15758
15758
  // @__NO_SIDE_EFFECTS__
15759
15759
  function _enum(Class2, values, params) {
15760
- const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
15760
+ const entries = Array.isArray(values) ? Object.fromEntries(values.map((v2) => [v2, v2])) : values;
15761
15761
  return new Class2({
15762
15762
  type: "enum",
15763
15763
  entries,
@@ -15963,8 +15963,8 @@ function _stringbool(Classes, _params) {
15963
15963
  let truthyArray = params.truthy ?? ["true", "1", "yes", "on", "y", "enabled"];
15964
15964
  let falsyArray = params.falsy ?? ["false", "0", "no", "off", "n", "disabled"];
15965
15965
  if (params.case !== "sensitive") {
15966
- truthyArray = truthyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
15967
- falsyArray = falsyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
15966
+ truthyArray = truthyArray.map((v2) => typeof v2 === "string" ? v2.toLowerCase() : v2);
15967
+ falsyArray = falsyArray.map((v2) => typeof v2 === "string" ? v2.toLowerCase() : v2);
15968
15968
  }
15969
15969
  const truthySet = new Set(truthyArray);
15970
15970
  const falsySet = new Set(falsyArray);
@@ -16644,11 +16644,11 @@ function stringifyKeyNames(bySchema, json2, visited) {
16644
16644
  const types = Array.isArray(json2.type) ? json2.type : [json2.type];
16645
16645
  const numericType = !types.includes("string") && types.some((t) => t === "number" || t === "integer");
16646
16646
  const values = json2.enum ?? (json2.const !== void 0 ? [json2.const] : void 0);
16647
- if (!numericType && !values?.some((v) => typeof v === "number"))
16647
+ if (!numericType && !values?.some((v2) => typeof v2 === "number"))
16648
16648
  return json2;
16649
16649
  const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format, id, ...rest } = json2;
16650
16650
  if (rest.enum)
16651
- rest.enum = rest.enum.map((v) => typeof v === "number" ? String(v) : v);
16651
+ rest.enum = rest.enum.map((v2) => typeof v2 === "number" ? String(v2) : v2);
16652
16652
  else if (typeof rest.const === "number")
16653
16653
  rest.const = String(rest.const);
16654
16654
  if (!numericType)
@@ -16927,9 +16927,9 @@ var init_json_schema_processors = __esm({
16927
16927
  json2.not = {};
16928
16928
  return;
16929
16929
  }
16930
- if (values.every((v) => typeof v === "number"))
16930
+ if (values.every((v2) => typeof v2 === "number"))
16931
16931
  json2.type = "number";
16932
- if (values.every((v) => typeof v === "string"))
16932
+ if (values.every((v2) => typeof v2 === "string"))
16933
16933
  json2.type = "string";
16934
16934
  json2.enum = values;
16935
16935
  };
@@ -16962,13 +16962,13 @@ var init_json_schema_processors = __esm({
16962
16962
  json2.const = val;
16963
16963
  }
16964
16964
  } else {
16965
- if (vals.every((v) => typeof v === "number"))
16965
+ if (vals.every((v2) => typeof v2 === "number"))
16966
16966
  json2.type = "number";
16967
- if (vals.every((v) => typeof v === "string"))
16967
+ if (vals.every((v2) => typeof v2 === "string"))
16968
16968
  json2.type = "string";
16969
- if (vals.every((v) => typeof v === "boolean"))
16969
+ if (vals.every((v2) => typeof v2 === "boolean"))
16970
16970
  json2.type = "boolean";
16971
- if (vals.every((v) => v === null))
16971
+ if (vals.every((v2) => v2 === null))
16972
16972
  json2.type = "null";
16973
16973
  json2.enum = vals;
16974
16974
  }
@@ -17206,7 +17206,7 @@ var init_json_schema_processors = __esm({
17206
17206
  const keyValues = keyType._zod.values;
17207
17207
  const omittableOnInput = ctx.io === "input" && inputOptin(def.valueType) !== void 0;
17208
17208
  if (keyValues && !def.partial && !omittableOnInput) {
17209
- const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
17209
+ const validKeyValues = [...keyValues].filter((v2) => typeof v2 === "string" || typeof v2 === "number");
17210
17210
  if (validKeyValues.length > 0) {
17211
17211
  json2.required = validKeyValues.map(String);
17212
17212
  }
@@ -18364,7 +18364,7 @@ function set(valueType, params) {
18364
18364
  });
18365
18365
  }
18366
18366
  function _enum2(values, params) {
18367
- const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
18367
+ const entries = Array.isArray(values) ? Object.fromEntries(values.map((v2) => [v2, v2])) : values;
18368
18368
  return new ZodEnum({
18369
18369
  type: "enum",
18370
18370
  entries,
@@ -19871,10 +19871,10 @@ function convertBaseSchema(schema, ctx) {
19871
19871
  if (enumValues.length === 1) {
19872
19872
  return z.literal(enumValues[0]);
19873
19873
  }
19874
- if (enumValues.every((v) => typeof v === "string")) {
19874
+ if (enumValues.every((v2) => typeof v2 === "string")) {
19875
19875
  return z.enum(enumValues);
19876
19876
  }
19877
- const literalSchemas = enumValues.map((v) => z.literal(v));
19877
+ const literalSchemas = enumValues.map((v2) => z.literal(v2));
19878
19878
  if (literalSchemas.length < 2) {
19879
19879
  return literalSchemas[0];
19880
19880
  }
@@ -21598,7 +21598,7 @@ var init_pixel_crew = __esm({
21598
21598
  });
21599
21599
 
21600
21600
  // ../shared/src/routes/manager.ts
21601
- var avatarColorSchema, MANAGER_AVATAR_BACKGROUNDS, MANAGER_AVATAR_PRIMARIES, managerPresetAvatarSchema, managerEmojiAvatarSchema, managerChosenAvatarSchema, setUpManagerTextingRequestSchema, linearRuleFields, withLabelIds, managerLinearRuleSchema, SUBAGENT_SERVICE_TIERS, managerSubagentSettingsSchema, QUEUE_SECTIONS, MANAGER_QUEUE_GROUPS, MANAGER_SHIPPING_LOOKBACK_MS;
21601
+ var avatarColorSchema, MANAGER_AVATAR_BACKGROUNDS, MANAGER_AVATAR_PRIMARIES, managerPresetAvatarSchema, managerEmojiAvatarSchema, managerChosenAvatarSchema, managerAvatarSchema, setUpManagerTextingRequestSchema, linearRuleFields, withLabelIds, managerLinearRuleSchema, SUBAGENT_SERVICE_TIERS, managerSubagentSettingsSchema, QUEUE_SECTIONS, MANAGER_QUEUE_GROUPS, MANAGER_SHIPPING_LOOKBACK_MS;
21602
21602
  var init_manager = __esm({
21603
21603
  "../shared/src/routes/manager.ts"() {
21604
21604
  "use strict";
@@ -21649,6 +21649,7 @@ var init_manager = __esm({
21649
21649
  background: avatarColorSchema
21650
21650
  });
21651
21651
  managerChosenAvatarSchema = external_exports.discriminatedUnion("kind", [managerPresetAvatarSchema, managerEmojiAvatarSchema]);
21652
+ managerAvatarSchema = external_exports.union([managerChosenAvatarSchema, external_exports.object({ kind: external_exports.literal("image"), url: external_exports.string() })]);
21652
21653
  setUpManagerTextingRequestSchema = external_exports.object({ line: external_exports.string().optional() });
21653
21654
  linearRuleFields = linearIssueFiltersSchema.extend({ team_id: external_exports.string().min(1) }).strict();
21654
21655
  withLabelIds = (value) => {
@@ -24578,11 +24579,13 @@ replicas gpu delete
24578
24579
  });
24579
24580
 
24580
24581
  // ../shared/src/routes/issues.ts
24581
- var ISSUE_STATUSES, ISSUE_PRIORITIES, ISSUE_ACTOR_TYPES, ISSUE_SUBSCRIBER_ROLES, ISSUE_RELATION_TYPES, ISSUE_PULL_REQUEST_STATES, normalizeIssueStatus, issueStatusSchema, issuePrioritySchema, issueSubscriberRoleSchema, issueRelationTypeSchema, issuePullRequestStateSchema, ISSUE_STATUS_LABELS, ISSUE_PRIORITY_LABELS, issueActorSchema, ISSUE_KEY_RE, timestamp, nullableTimestamp, issueSchema, issueSubscriberSchema, issueRelationSchema, issuePullRequestSchema, issueCommentSchema, change, nullableId, ISSUE_EVENT_TYPES, issueEventDataSchemas, issueEventBase, issueEventVariant, issueEventSchema, clientMutationId, title, description, body, createIssueRequestSchema, updateIssueRequestSchema, issueActorRequestSchema, createIssueCommentRequestSchema, updateIssueCommentRequestSchema, createIssueRelationRequestSchema, linkIssuePullRequestRequestSchema, updateIssuePullRequestRequestSchema, issueMutationRequestSchema, updateIssueSettingsRequestSchema, listIssuesQuerySchema, issueDetailResponseSchema, listIssuesResponseSchema, issuesDeltaQuerySchema, issueInboxQuerySchema, markIssueInboxReadRequestSchema, ISSUE_COMMANDS;
24582
+ var ISSUE_STATUSES, ISSUE_PRIORITIES, ISSUE_ACTOR_TYPES, ISSUE_SUBSCRIBER_ROLES, ISSUE_RELATION_TYPES, ISSUE_PULL_REQUEST_STATES, normalizeIssueStatus, issueStatusSchema, issuePrioritySchema, issueSubscriberRoleSchema, issueRelationTypeSchema, issuePullRequestStateSchema, ISSUE_STATUS_LABELS, ISSUE_PRIORITY_LABELS, unknownValues, knownOrRaw, issueActorSchema, ISSUE_KEY_RE, timestamp, nullableTimestamp, issueSchema, issueSubscriberSchema, issueRelationSchema, issuePullRequestSchema, issueCommentSchema, change, nullableId, issueEventDataSchemas, issueEventBase, v, issueEventVariants, created, laterVariants, issueEventSchema, clientMutationId, title, description, body, createIssueRequestSchema, updateIssueRequestSchema, issueActorRequestSchema, createIssueCommentRequestSchema, updateIssueCommentRequestSchema, createIssueRelationRequestSchema, linkIssuePullRequestRequestSchema, updateIssuePullRequestRequestSchema, issueMutationRequestSchema, updateIssueSettingsRequestSchema, listIssuesQuerySchema, issueDetailResponseSchema, listIssuesResponseSchema, issueDirectoryUserSchema, issueDirectoryWorkspaceSchema, issuesBootstrapResponseSchema, issuesDeltaQuerySchema, issuesDeltaResponseSchema, issueInboxQuerySchema, markIssueInboxReadRequestSchema, ISSUE_COMMANDS;
24582
24583
  var init_issues = __esm({
24583
24584
  "../shared/src/routes/issues.ts"() {
24584
24585
  "use strict";
24585
24586
  init_zod();
24587
+ init_manager();
24588
+ init_workspaces();
24586
24589
  ISSUE_STATUSES = ["backlog", "todo", "in_progress", "review", "approved", "done", "canceled", "duplicate"];
24587
24590
  ISSUE_PRIORITIES = ["none", "urgent", "high", "medium", "low"];
24588
24591
  ISSUE_ACTOR_TYPES = ["user", "workspace", "system"];
@@ -24597,6 +24600,12 @@ var init_issues = __esm({
24597
24600
  issuePullRequestStateSchema = external_exports.enum(ISSUE_PULL_REQUEST_STATES);
24598
24601
  ISSUE_STATUS_LABELS = { backlog: "Backlog", todo: "Todo", in_progress: "In Progress", review: "Review", approved: "Approved", done: "Done", canceled: "Canceled", duplicate: "Duplicate" };
24599
24602
  ISSUE_PRIORITY_LABELS = { none: "No priority", urgent: "Urgent", high: "High", medium: "Medium", low: "Low" };
24603
+ unknownValues = null;
24604
+ knownOrRaw = (known) => external_exports.union([known, external_exports.custom((value) => {
24605
+ if (typeof value !== "string") return false;
24606
+ unknownValues?.push(value);
24607
+ return true;
24608
+ })]);
24600
24609
  issueActorSchema = external_exports.object({
24601
24610
  type: external_exports.enum(ISSUE_ACTOR_TYPES),
24602
24611
  id: external_exports.string().toLowerCase().uuid()
@@ -24611,8 +24620,8 @@ var init_issues = __esm({
24611
24620
  identifier: external_exports.string(),
24612
24621
  title: external_exports.string(),
24613
24622
  description: external_exports.string(),
24614
- status: issueStatusSchema,
24615
- priority: issuePrioritySchema,
24623
+ status: knownOrRaw(issueStatusSchema),
24624
+ priority: knownOrRaw(issuePrioritySchema),
24616
24625
  parent_id: external_exports.string().uuid().nullable(),
24617
24626
  manager_id: external_exports.string().uuid().nullable(),
24618
24627
  creator: issueActorSchema,
@@ -24643,7 +24652,7 @@ var init_issues = __esm({
24643
24652
  url: external_exports.string(),
24644
24653
  pull_request_id: external_exports.string().uuid().nullable(),
24645
24654
  title: external_exports.string().nullable(),
24646
- state: issuePullRequestStateSchema,
24655
+ state: knownOrRaw(issuePullRequestStateSchema),
24647
24656
  approved: external_exports.boolean(),
24648
24657
  created_at: timestamp,
24649
24658
  updated_at: timestamp
@@ -24658,36 +24667,12 @@ var init_issues = __esm({
24658
24667
  });
24659
24668
  change = (value) => external_exports.object({ from: value, to: value });
24660
24669
  nullableId = external_exports.string().uuid().nullable();
24661
- ISSUE_EVENT_TYPES = [
24662
- "created",
24663
- "title_changed",
24664
- "description_changed",
24665
- "status_changed",
24666
- "priority_changed",
24667
- "parent_changed",
24668
- "manager_changed",
24669
- "sort_order_changed",
24670
- "assignee_added",
24671
- "assignee_removed",
24672
- "subscriber_added",
24673
- "subscriber_removed",
24674
- "relation_added",
24675
- "relation_removed",
24676
- "pr_linked",
24677
- "pr_unlinked",
24678
- "pr_state_changed",
24679
- "comment_added",
24680
- "comment_edited",
24681
- "comment_deleted",
24682
- "archived",
24683
- "restored"
24684
- ];
24685
24670
  issueEventDataSchemas = {
24686
24671
  created: external_exports.object({ issue: issueSchema }),
24687
24672
  title_changed: change(external_exports.string()),
24688
24673
  description_changed: change(external_exports.string()),
24689
- status_changed: change(issueStatusSchema).extend({ completed_at: nullableTimestamp, canceled_at: nullableTimestamp, reason: external_exports.string().optional() }),
24690
- priority_changed: change(issuePrioritySchema),
24674
+ status_changed: change(knownOrRaw(issueStatusSchema)).extend({ completed_at: nullableTimestamp, canceled_at: nullableTimestamp, reason: external_exports.string().optional() }),
24675
+ priority_changed: change(knownOrRaw(issuePrioritySchema)),
24691
24676
  parent_changed: change(nullableId),
24692
24677
  manager_changed: change(nullableId),
24693
24678
  sort_order_changed: change(external_exports.number()),
@@ -24700,7 +24685,7 @@ var init_issues = __esm({
24700
24685
  relation_removed: external_exports.object({ relation: issueRelationSchema }),
24701
24686
  pr_linked: external_exports.object({ pull_request: issuePullRequestSchema }),
24702
24687
  pr_unlinked: external_exports.object({ pull_request: issuePullRequestSchema }),
24703
- pr_state_changed: external_exports.object({ pull_request: issuePullRequestSchema, from: issuePullRequestStateSchema }),
24688
+ pr_state_changed: external_exports.object({ pull_request: issuePullRequestSchema, from: knownOrRaw(issuePullRequestStateSchema) }),
24704
24689
  comment_added: external_exports.object({ comment: issueCommentSchema }),
24705
24690
  comment_edited: external_exports.object({ comment: issueCommentSchema, from: external_exports.string() }),
24706
24691
  comment_deleted: external_exports.object({ comment: issueCommentSchema }),
@@ -24720,8 +24705,10 @@ var init_issues = __esm({
24720
24705
  client_mutation_id: external_exports.string().nullable(),
24721
24706
  created_at: timestamp
24722
24707
  });
24723
- issueEventVariant = (type) => issueEventBase.extend({ type: external_exports.literal(type), data: issueEventDataSchemas[type] });
24724
- issueEventSchema = external_exports.discriminatedUnion("type", [issueEventVariant(ISSUE_EVENT_TYPES[0]), ...ISSUE_EVENT_TYPES.slice(1).map(issueEventVariant)]);
24708
+ v = (type) => issueEventBase.extend({ type: external_exports.literal(type), data: issueEventDataSchemas[type] });
24709
+ issueEventVariants = { created: v("created"), title_changed: v("title_changed"), description_changed: v("description_changed"), status_changed: v("status_changed"), priority_changed: v("priority_changed"), parent_changed: v("parent_changed"), manager_changed: v("manager_changed"), sort_order_changed: v("sort_order_changed"), assignee_added: v("assignee_added"), assignee_removed: v("assignee_removed"), subscriber_added: v("subscriber_added"), subscriber_removed: v("subscriber_removed"), relation_added: v("relation_added"), relation_removed: v("relation_removed"), pr_linked: v("pr_linked"), pr_unlinked: v("pr_unlinked"), pr_state_changed: v("pr_state_changed"), comment_added: v("comment_added"), comment_edited: v("comment_edited"), comment_deleted: v("comment_deleted"), archived: v("archived"), restored: v("restored") };
24710
+ ({ created, ...laterVariants } = issueEventVariants);
24711
+ issueEventSchema = external_exports.discriminatedUnion("type", [created, ...Object.values(laterVariants)]);
24725
24712
  clientMutationId = external_exports.string().min(1).max(128).optional();
24726
24713
  title = external_exports.string().trim().min(1).max(500);
24727
24714
  description = external_exports.string().max(1e5);
@@ -24801,10 +24788,41 @@ var init_issues = __esm({
24801
24788
  sub_issues: external_exports.array(issueSchema)
24802
24789
  });
24803
24790
  listIssuesResponseSchema = external_exports.object({ issues: external_exports.array(issueSchema), next_cursor: external_exports.number().nullable() });
24791
+ issueDirectoryUserSchema = external_exports.object({
24792
+ id: external_exports.string(),
24793
+ display_name: external_exports.string(),
24794
+ avatar_url: external_exports.string().nullable()
24795
+ });
24796
+ issueDirectoryWorkspaceSchema = external_exports.object({
24797
+ id: external_exports.string(),
24798
+ name: external_exports.string(),
24799
+ kind: external_exports.enum(WORKSPACE_KINDS),
24800
+ status: external_exports.enum(WORKSPACE_STATUSES),
24801
+ avatar: managerAvatarSchema.nullable(),
24802
+ manager_id: external_exports.string().nullable()
24803
+ });
24804
+ issuesBootstrapResponseSchema = external_exports.object({
24805
+ sync_id: external_exports.number().int(),
24806
+ issue_key: external_exports.string(),
24807
+ users: external_exports.array(issueDirectoryUserSchema),
24808
+ workspaces: external_exports.array(issueDirectoryWorkspaceSchema),
24809
+ issues: external_exports.array(issueSchema),
24810
+ subscribers: external_exports.array(issueSubscriberSchema),
24811
+ relations: external_exports.array(issueRelationSchema),
24812
+ pull_requests: external_exports.array(issuePullRequestSchema)
24813
+ });
24804
24814
  issuesDeltaQuerySchema = external_exports.object({
24805
24815
  after: external_exports.coerce.number().int().min(0).max(Number.MAX_SAFE_INTEGER),
24806
24816
  limit: external_exports.coerce.number().int().min(1).max(1e3).optional()
24807
24817
  });
24818
+ issuesDeltaResponseSchema = external_exports.object({
24819
+ sync_id: external_exports.number().int(),
24820
+ issue_key: external_exports.string(),
24821
+ users: external_exports.array(issueDirectoryUserSchema),
24822
+ workspaces: external_exports.array(issueDirectoryWorkspaceSchema),
24823
+ events: external_exports.array(issueEventSchema),
24824
+ has_more: external_exports.boolean()
24825
+ });
24808
24826
  issueInboxQuerySchema = external_exports.object({
24809
24827
  limit: external_exports.coerce.number().int().min(1).max(100).optional(),
24810
24828
  before: external_exports.coerce.number().int().min(1).optional()
@@ -29181,7 +29199,7 @@ var require_toJS = __commonJS({
29181
29199
  var identity = require_identity();
29182
29200
  function toJS(value, arg, ctx) {
29183
29201
  if (Array.isArray(value))
29184
- return value.map((v, i) => toJS(v, String(i), ctx));
29202
+ return value.map((v2, i) => toJS(v2, String(i), ctx));
29185
29203
  if (value && typeof value.toJSON === "function") {
29186
29204
  if (!ctx || !identity.hasAnchor(value))
29187
29205
  return value.toJSON(arg, ctx);
@@ -29474,18 +29492,18 @@ var require_Collection = __commonJS({
29474
29492
  var identity = require_identity();
29475
29493
  var Node = require_Node();
29476
29494
  function collectionFromPath(schema, path12, value) {
29477
- let v = value;
29495
+ let v2 = value;
29478
29496
  for (let i = path12.length - 1; i >= 0; --i) {
29479
29497
  const k = path12[i];
29480
29498
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
29481
29499
  const a = [];
29482
- a[k] = v;
29483
- v = a;
29500
+ a[k] = v2;
29501
+ v2 = a;
29484
29502
  } else {
29485
- v = /* @__PURE__ */ new Map([[k, v]]);
29503
+ v2 = /* @__PURE__ */ new Map([[k, v2]]);
29486
29504
  }
29487
29505
  }
29488
- return createNode.createNode(v, void 0, {
29506
+ return createNode.createNode(v2, void 0, {
29489
29507
  aliasDuplicateObjects: false,
29490
29508
  keepUndefined: false,
29491
29509
  onAnchor: () => {
@@ -30458,8 +30476,8 @@ var require_Pair = __commonJS({
30458
30476
  var identity = require_identity();
30459
30477
  function createPair(key, value, ctx) {
30460
30478
  const k = createNode.createNode(key, void 0, ctx);
30461
- const v = createNode.createNode(value, void 0, ctx);
30462
- return new Pair(k, v);
30479
+ const v2 = createNode.createNode(value, void 0, ctx);
30480
+ return new Pair(k, v2);
30463
30481
  }
30464
30482
  var Pair = class _Pair {
30465
30483
  constructor(key, value = null) {
@@ -32131,7 +32149,7 @@ var require_Document = __commonJS({
32131
32149
  value = replacer.call({ "": value }, "", value);
32132
32150
  _replacer = replacer;
32133
32151
  } else if (Array.isArray(replacer)) {
32134
- const keyToStr = (v) => typeof v === "number" || v instanceof String || v instanceof Number;
32152
+ const keyToStr = (v2) => typeof v2 === "number" || v2 instanceof String || v2 instanceof Number;
32135
32153
  const asStr = replacer.filter(keyToStr).map(String);
32136
32154
  if (asStr.length > 0)
32137
32155
  replacer = replacer.concat(asStr);
@@ -32167,8 +32185,8 @@ var require_Document = __commonJS({
32167
32185
  */
32168
32186
  createPair(key, value, options = {}) {
32169
32187
  const k = this.createNode(key, null, options);
32170
- const v = this.createNode(value, null, options);
32171
- return new Pair.Pair(k, v);
32188
+ const v2 = this.createNode(value, null, options);
32189
+ return new Pair.Pair(k, v2);
32172
32190
  }
32173
32191
  /**
32174
32192
  * Removes a value from the document.
@@ -40182,7 +40200,7 @@ var CLI_VERSION;
40182
40200
  var init_cli_version = __esm({
40183
40201
  "../shared/src/cli-version.ts"() {
40184
40202
  "use strict";
40185
- CLI_VERSION = "0.3.514";
40203
+ CLI_VERSION = "0.3.516";
40186
40204
  }
40187
40205
  });
40188
40206
 
@@ -43111,7 +43129,7 @@ var require_luxon = __commonJS({
43111
43129
  } else if (typeof settings !== "object") {
43112
43130
  throw new InvalidArgumentError2("Week settings must be an object");
43113
43131
  } else {
43114
- if (!integerBetween(settings.firstDay, 1, 7) || !integerBetween(settings.minimalDays, 1, 7) || !Array.isArray(settings.weekend) || settings.weekend.some((v) => !integerBetween(v, 1, 7))) {
43132
+ if (!integerBetween(settings.firstDay, 1, 7) || !integerBetween(settings.minimalDays, 1, 7) || !Array.isArray(settings.weekend) || settings.weekend.some((v2) => !integerBetween(v2, 1, 7))) {
43115
43133
  throw new InvalidArgumentError2("Invalid week settings");
43116
43134
  }
43117
43135
  return {
@@ -43248,9 +43266,9 @@ var require_luxon = __commonJS({
43248
43266
  const normalized = {};
43249
43267
  for (const u in obj) {
43250
43268
  if (hasOwnProperty(obj, u)) {
43251
- const v = obj[u];
43252
- if (v === void 0 || v === null) continue;
43253
- normalized[normalizer(u)] = asNumber(v);
43269
+ const v2 = obj[u];
43270
+ if (v2 === void 0 || v2 === null) continue;
43271
+ normalized[normalizer(u)] = asNumber(v2);
43254
43272
  }
43255
43273
  }
43256
43274
  return normalized;
@@ -46624,8 +46642,8 @@ var require_luxon = __commonJS({
46624
46642
  }
46625
46643
  let foundFirst = false;
46626
46644
  for (const u of units) {
46627
- const v = normalized[u];
46628
- if (!isUndefined(v)) {
46645
+ const v2 = normalized[u];
46646
+ if (!isUndefined(v2)) {
46629
46647
  foundFirst = true;
46630
46648
  } else if (foundFirst) {
46631
46649
  normalized[u] = defaultValues[u];
@@ -49893,12 +49911,12 @@ var require_CronExpressionParser = __commonJS({
49893
49911
  if (__privateMethod(_a3 = _CronExpressionParser, _CronExpressionParser_static, isValidConstraintChar_fn).call(_a3, constraints2, result)) {
49894
49912
  stack.push(result);
49895
49913
  } else {
49896
- const v = parseInt(result.toString(), 10);
49897
- const isValid = v >= constraints2.min && v <= constraints2.max;
49914
+ const v2 = parseInt(result.toString(), 10);
49915
+ const isValid = v2 >= constraints2.min && v2 <= constraints2.max;
49898
49916
  if (!isValid) {
49899
49917
  throw new Error(`Constraint error, got value ${result} expected range ${constraints2.min}-${constraints2.max}`);
49900
49918
  }
49901
- stack.push(field2 === CronUnit.DayOfWeek ? v % 7 : result);
49919
+ stack.push(field2 === CronUnit.DayOfWeek ? v2 % 7 : result);
49902
49920
  }
49903
49921
  }
49904
49922
  }
@@ -50003,10 +50021,10 @@ var require_CronFileParser = __commonJS({
50003
50021
  if (k2 === void 0) k2 = k;
50004
50022
  o[k2] = m[k];
50005
50023
  }));
50006
- var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
50007
- Object.defineProperty(o, "default", { enumerable: true, value: v });
50008
- }) : function(o, v) {
50009
- o["default"] = v;
50024
+ var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v2) {
50025
+ Object.defineProperty(o, "default", { enumerable: true, value: v2 });
50026
+ }) : function(o, v2) {
50027
+ o["default"] = v2;
50010
50028
  });
50011
50029
  var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
50012
50030
  var ownKeys = function(o) {
@@ -53872,7 +53890,7 @@ async function environmentCreateCommand(name, options) {
53872
53890
  type: "text",
53873
53891
  name: "name",
53874
53892
  message: "Environment name:",
53875
- validate: (v) => v.trim() ? true : "Name is required"
53893
+ validate: (v2) => v2.trim() ? true : "Name is required"
53876
53894
  });
53877
53895
  if (!r.name) {
53878
53896
  console.log(import_chalk21.default.yellow("\nCancelled."));
@@ -53945,11 +53963,11 @@ async function environmentDeleteCommand(idOrName, options) {
53945
53963
  Deleted environment ${idOrName}.
53946
53964
  `);
53947
53965
  }
53948
- function printVariable(v) {
53949
- console.log(import_chalk21.default.white(` ${v.key}`));
53950
- console.log(import_chalk21.default.gray(` ID: ${v.id}`));
53951
- console.log(import_chalk21.default.gray(` Value: ${v.value}`));
53952
- console.log(import_chalk21.default.gray(` Updated: ${formatDate(v.updated_at)}`));
53966
+ function printVariable(v2) {
53967
+ console.log(import_chalk21.default.white(` ${v2.key}`));
53968
+ console.log(import_chalk21.default.gray(` ID: ${v2.id}`));
53969
+ console.log(import_chalk21.default.gray(` Value: ${v2.value}`));
53970
+ console.log(import_chalk21.default.gray(` Updated: ${formatDate(v2.updated_at)}`));
53953
53971
  console.log();
53954
53972
  }
53955
53973
  async function envVarsListCommand(envIdOrName, options) {
@@ -53958,7 +53976,7 @@ async function envVarsListCommand(envIdOrName, options) {
53958
53976
  const response = await orgAuthenticatedFetch(
53959
53977
  `/v1/environments/${id}/variables`
53960
53978
  );
53961
- const variables = options.reveal ? response.environment_variables : response.environment_variables.map((v) => ({ ...v, value: maskValue(v.value) }));
53979
+ const variables = options.reveal ? response.environment_variables : response.environment_variables.map((v2) => ({ ...v2, value: maskValue(v2.value) }));
53962
53980
  output2({ environment_variables: variables }, ({ environment_variables }) => {
53963
53981
  if (environment_variables.length === 0) {
53964
53982
  console.log(import_chalk21.default.yellow("\nNo variables.\n"));
@@ -53970,7 +53988,7 @@ Variables (${environment_variables.length}):
53970
53988
  if (!options.reveal) {
53971
53989
  console.log(import_chalk21.default.gray(" Values are masked. Pass --reveal to show full values.\n"));
53972
53990
  }
53973
- for (const v of environment_variables) printVariable(v);
53991
+ for (const v2 of environment_variables) printVariable(v2);
53974
53992
  });
53975
53993
  }
53976
53994
  async function envVarsSetCommand(envIdOrName, key, value) {
@@ -53979,7 +53997,7 @@ async function envVarsSetCommand(envIdOrName, key, value) {
53979
53997
  const existing = await orgAuthenticatedFetch(
53980
53998
  `/v1/environments/${id}/variables`
53981
53999
  );
53982
- const match = existing.environment_variables.find((v) => v.key === key);
54000
+ const match = existing.environment_variables.find((v2) => v2.key === key);
53983
54001
  if (match) {
53984
54002
  const body3 = { value };
53985
54003
  const response2 = await orgAuthenticatedFetch(
@@ -54012,7 +54030,7 @@ async function envVarsDeleteCommand(envIdOrName, keyOrId, options) {
54012
54030
  const existing = await orgAuthenticatedFetch(
54013
54031
  `/v1/environments/${id}/variables`
54014
54032
  );
54015
- const match = existing.environment_variables.find((v) => v.key === keyOrId);
54033
+ const match = existing.environment_variables.find((v2) => v2.key === keyOrId);
54016
54034
  if (!match) throw new Error(`Variable not found: ${keyOrId}`);
54017
54035
  variableId = match.id;
54018
54036
  }
@@ -54048,12 +54066,12 @@ async function envVarsRequestCommand(requiredKeys, options) {
54048
54066
  });
54049
54067
  return;
54050
54068
  }
54051
- const created = await orgAuthenticatedFetch("/v1/variable-requests", {
54069
+ const created2 = await orgAuthenticatedFetch("/v1/variable-requests", {
54052
54070
  method: "POST",
54053
54071
  body: { reason: options.reason, variables: wanted.map((key) => ({ key, required: !optional2.has(key), ...options.replace ? { replace: true } : {} })), wait: options.wait !== false }
54054
54072
  });
54055
- let { request } = created;
54056
- if (request.status === "pending" && created.wait) {
54073
+ let { request } = created2;
54074
+ if (request.status === "pending" && created2.wait) {
54057
54075
  const id = request.id;
54058
54076
  request = await waitForUser({
54059
54077
  timeoutMs,
@@ -54076,7 +54094,7 @@ async function envVarsRequestCommand(requiredKeys, options) {
54076
54094
  }
54077
54095
  if (request.status !== "pending") await orgAuthenticatedFetch(`/v1/variable-requests/${request.id}/ack`, { method: "POST" });
54078
54096
  const missing = wanted.filter((key) => !exported.includes(key));
54079
- output2({ status: request.status, request_id: request.id, destination: request.destination, url: created.url, exported: [...available, ...exported], missing }, () => {
54097
+ output2({ status: request.status, request_id: request.id, destination: request.destination, url: created2.url, exported: [...available, ...exported], missing }, () => {
54080
54098
  console.log("");
54081
54099
  if (exported.length > 0 || available.length > 0) {
54082
54100
  const where = request.destination === "workspace" ? "this workspace only" : "saved to the environment";
@@ -54085,11 +54103,11 @@ async function envVarsRequestCommand(requiredKeys, options) {
54085
54103
  if (request.status === "pending") {
54086
54104
  console.log(` ${import_chalk21.default.yellow("Still waiting for:")} ${missing.join(", ")}`);
54087
54105
  console.log(import_chalk21.default.gray(options.wait === false ? `
54088
- Asked above the chat composer (${created.url}). Keep working, and run this command again when you need the values.
54089
- ` : created.wait ? `
54090
- The form stays open above the chat composer (${created.url}). End your turn and say what the values are for. When the user saves, you get a message; run this command again then.
54106
+ Asked above the chat composer (${created2.url}). Keep working, and run this command again when you need the values.
54107
+ ` : created2.wait ? `
54108
+ The form stays open above the chat composer (${created2.url}). End your turn and say what the values are for. When the user saves, you get a message; run this command again then.
54091
54109
  ` : `
54092
- The user may not be watching Replicas. Send them this link where you are talking with them (the Slack thread, Linear issue, or pull request) and ask them to add the values there, never in chat: ${created.url}
54110
+ The user may not be watching Replicas. Send them this link where you are talking with them (the Slack thread, Linear issue, or pull request) and ask them to add the values there, never in chat: ${created2.url}
54093
54111
  When they save, you get a message; run this command again then.
54094
54112
  `));
54095
54113
  return;
@@ -58035,12 +58053,12 @@ async function localControlRequestCommand(options) {
58035
58053
  };
58036
58054
  const computers = await connectedComputers();
58037
58055
  if (computers.length > 0) return connected(computers);
58038
- const created = await orgAuthenticatedFetch("/v1/local-control-request", {
58056
+ const created2 = await orgAuthenticatedFetch("/v1/local-control-request", {
58039
58057
  method: "POST",
58040
58058
  body: { reason: options.reason, wait: options.wait !== false }
58041
58059
  });
58042
58060
  let pending = true;
58043
- if (created.wait) {
58061
+ if (created2.wait) {
58044
58062
  const answer = await waitForUser({
58045
58063
  timeoutMs,
58046
58064
  asked: "Asked the user above the chat composer to let you run commands on their computer.",
@@ -58055,17 +58073,17 @@ async function localControlRequestCommand(options) {
58055
58073
  if (answer.computers.length > 0) return connected(answer.computers);
58056
58074
  ({ pending } = answer);
58057
58075
  }
58058
- output2({ status: pending ? "pending" : "declined", computers: [], url: created.url }, () => {
58076
+ output2({ status: pending ? "pending" : "declined", computers: [], url: created2.url }, () => {
58059
58077
  if (!pending) {
58060
58078
  console.log(import_chalk36.default.yellow("\n The user declined. Continue without their computer, or ask how they want to proceed.\n"));
58061
58079
  return;
58062
58080
  }
58063
58081
  console.log(import_chalk36.default.gray(options.wait === false ? `
58064
- Asked above the chat composer (${created.url}). Keep working, and run this command again when you need the computer.
58065
- ` : created.wait ? `
58066
- The request stays open above the chat composer (${created.url}). End your turn and say what you need the computer for. When the user answers, you get a message; run this command again then.
58082
+ Asked above the chat composer (${created2.url}). Keep working, and run this command again when you need the computer.
58083
+ ` : created2.wait ? `
58084
+ The request stays open above the chat composer (${created2.url}). End your turn and say what you need the computer for. When the user answers, you get a message; run this command again then.
58067
58085
  ` : `
58068
- The user may not be watching Replicas. Send them this link where you are talking with them (the Slack thread, Linear issue, or pull request) and ask them to allow local control there: ${created.url}
58086
+ The user may not be watching Replicas. Send them this link where you are talking with them (the Slack thread, Linear issue, or pull request) and ask them to allow local control there: ${created2.url}
58069
58087
  When they answer, you get a message; run this command again then.
58070
58088
  `));
58071
58089
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.514",
3
+ "version": "0.3.516",
4
4
  "description": "CLI for managing Replicas workspaces - SSH into cloud dev environments with automatic port forwarding",
5
5
  "main": "dist/index.cjs",
6
6
  "bin": {