tines 0.0.187 → 0.0.189

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.js +55 -12
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -4413,6 +4413,51 @@ async function listAll(fetchPage, opts = {}) {
4413
4413
  // ../shared/src/routing.ts
4414
4414
  var INHERIT_RUNNER_ID = "*";
4415
4415
 
4416
+ // ../shared/src/issue-transfer.ts
4417
+ var compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;
4418
+ function conflictsByKey(context) {
4419
+ const repositories = new Map(context.repos.map((repo) => [repo.item_id, repo]));
4420
+ return new Map(
4421
+ context.conflicts.map((conflict) => {
4422
+ const ids = [...new Set(conflict.item_ids)].sort(compare);
4423
+ const key = JSON.stringify([conflict.dir, ids]);
4424
+ return [
4425
+ key,
4426
+ {
4427
+ dir: conflict.dir,
4428
+ participants: ids.map((item_id) => {
4429
+ const repo = repositories.get(item_id);
4430
+ return {
4431
+ item_id,
4432
+ name: repo?.name ?? null,
4433
+ scope_label: repo?.scope.label ?? null
4434
+ };
4435
+ })
4436
+ }
4437
+ ];
4438
+ })
4439
+ );
4440
+ }
4441
+ function deriveTransferConflictDeltas(before, after) {
4442
+ const beforeByKey = conflictsByKey(before);
4443
+ const afterByKey = conflictsByKey(after);
4444
+ const keys = /* @__PURE__ */ new Set([...beforeByKey.keys(), ...afterByKey.keys()]);
4445
+ const rank = { retained: 0, resolved: 1, introduced: 2 };
4446
+ return [...keys].map((key) => {
4447
+ const oldConflict = beforeByKey.get(key);
4448
+ const newConflict = afterByKey.get(key);
4449
+ return {
4450
+ key,
4451
+ change: oldConflict && newConflict ? "retained" : oldConflict ? "resolved" : "introduced",
4452
+ dir: (oldConflict ?? newConflict).dir,
4453
+ before: oldConflict?.participants ?? [],
4454
+ after: newConflict?.participants ?? []
4455
+ };
4456
+ }).sort(
4457
+ (a, b) => rank[a.change] - rank[b.change] || compare(a.dir, b.dir) || compare(a.key, b.key)
4458
+ );
4459
+ }
4460
+
4416
4461
  // ../shared/src/library/types.ts
4417
4462
  var LibraryValidationError = class extends Error {
4418
4463
  constructor(diagnostics) {
@@ -5397,6 +5442,7 @@ function routingLines(preview) {
5397
5442
  lines.push(
5398
5443
  ` ${check.ok ? "pass" : "FAIL"} ${check.name}: ${check.detail}${check.action?.label ? ` (${check.action.label})` : ""}`
5399
5444
  );
5445
+ if (check.action?.cli) lines.push(` fix: ${check.action.cli}`);
5400
5446
  }
5401
5447
  if (explainer.matched_rule)
5402
5448
  lines.push(` matched rule ${explainer.matched_rule.scope_label}`);
@@ -5454,18 +5500,15 @@ function effectiveRepositoryLines(preview) {
5454
5500
  }
5455
5501
  function conflictLines(preview) {
5456
5502
  const lines = ["", "Repository checkout conflicts:"];
5457
- for (const [label, context] of [
5458
- [" before", preview.context.before],
5459
- [" after ", preview.context.after]
5460
- ]) {
5461
- if (!context.conflicts.length) lines.push(`${label}: none`);
5462
- for (const conflict of context.conflicts) {
5463
- const participants = conflict.item_ids.map((id2) => {
5464
- const repo = context.repos.find((item) => item.item_id === id2);
5465
- return repo ? `${repo.name} (${repo.scope.label})` : id2;
5466
- }).join(", ");
5467
- lines.push(`${label}: ${conflict.dir} \u2014 ${participants}`);
5468
- }
5503
+ const deltas = deriveTransferConflictDeltas(preview.context.before, preview.context.after);
5504
+ if (!deltas.length) return [...lines, " none"];
5505
+ const participants = (items) => items.map(
5506
+ (item) => item.name && item.scope_label ? `${item.name} (${item.scope_label})` : item.item_id
5507
+ ).join(", ");
5508
+ for (const delta of deltas) {
5509
+ lines.push(` ${delta.change[0].toUpperCase()}${delta.change.slice(1)} \u2014 ${delta.dir}`);
5510
+ if (delta.before.length) lines.push(` Before: ${participants(delta.before)}`);
5511
+ if (delta.after.length) lines.push(` After: ${participants(delta.after)}`);
5469
5512
  }
5470
5513
  return lines;
5471
5514
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tines",
3
- "version": "0.0.187",
3
+ "version": "0.0.189",
4
4
  "description": "CLI for Tines, an orchestration layer for AI agents",
5
5
  "repository": {
6
6
  "type": "git",