@primitive.ai/prim 0.1.0-alpha.72 → 0.1.0-alpha.74

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.
@@ -37630,7 +37630,7 @@ function formatShowHuman(result) {
37630
37630
  lines.push(` alternatives: ${d.alternatives.map(terminalSafeLine).join(" | ")}`);
37631
37631
  }
37632
37632
  pushFiles(lines, result.files);
37633
- pushContexts(lines, result.contexts);
37633
+ pushContexts(lines, result.contexts ?? []);
37634
37634
  pushEdges(lines, "dependents", "\u2192", result.dependents);
37635
37635
  pushEdges(lines, "depends on", "\u2190", result.dependsOn);
37636
37636
  if (result.flags.length > 0) {
@@ -39808,6 +39808,20 @@ var MODE = "install_intent_v1";
39808
39808
  var START_PATH = "/api/cli/github/install-intents";
39809
39809
  var POLL_REQUEST_TIMEOUT_MS2 = 1e4;
39810
39810
  var MAX_INTENT_LIFETIME_MS = 15 * 6e4;
39811
+ var REPOSITORY_IDENTITY_MIGRATION_REQUIRED = "repository_identity_migration_required";
39812
+ function isRepositoryIdentityMigrationRequiredStatus(value) {
39813
+ if (typeof value !== "object" || value === null || Array.isArray(value)) {
39814
+ return false;
39815
+ }
39816
+ const record2 = value;
39817
+ if (record2.failureCode !== REPOSITORY_IDENTITY_MIGRATION_REQUIRED) {
39818
+ return false;
39819
+ }
39820
+ return isGitHubInstallIntentStatusResponse({
39821
+ ...record2,
39822
+ failureCode: "proof_commit_failed"
39823
+ });
39824
+ }
39811
39825
  function parseGitHubInstallIntentStart(value, now = Date.now()) {
39812
39826
  if (!isGitHubInstallIntentStartResponse(value) || value.expiresAt <= now || value.expiresAt - now > MAX_INTENT_LIFETIME_MS) {
39813
39827
  return null;
@@ -39815,7 +39829,10 @@ function parseGitHubInstallIntentStart(value, now = Date.now()) {
39815
39829
  return value;
39816
39830
  }
39817
39831
  function parseGitHubInstallIntentStatus(value, expectedExpiresAt) {
39818
- if (!isGitHubInstallIntentStatusResponse(value) || value.expiresAt !== expectedExpiresAt) {
39832
+ if (isGitHubInstallIntentStatusResponse(value)) {
39833
+ return value.expiresAt === expectedExpiresAt ? value : null;
39834
+ }
39835
+ if (!isRepositoryIdentityMigrationRequiredStatus(value) || value.expiresAt !== expectedExpiresAt) {
39819
39836
  return null;
39820
39837
  }
39821
39838
  return value;
package/dist/index.js CHANGED
@@ -15236,7 +15236,7 @@ function formatShowHuman(result) {
15236
15236
  lines.push(` alternatives: ${d.alternatives.map(terminalSafeLine).join(" | ")}`);
15237
15237
  }
15238
15238
  pushFiles(lines, result.files);
15239
- pushContexts(lines, result.contexts);
15239
+ pushContexts(lines, result.contexts ?? []);
15240
15240
  pushEdges(lines, "dependents", "\u2192", result.dependents);
15241
15241
  pushEdges(lines, "depends on", "\u2190", result.dependsOn);
15242
15242
  if (result.flags.length > 0) {
@@ -16933,6 +16933,20 @@ var MODE = "install_intent_v1";
16933
16933
  var START_PATH = "/api/cli/github/install-intents";
16934
16934
  var POLL_REQUEST_TIMEOUT_MS = 1e4;
16935
16935
  var MAX_INTENT_LIFETIME_MS = 15 * 6e4;
16936
+ var REPOSITORY_IDENTITY_MIGRATION_REQUIRED = "repository_identity_migration_required";
16937
+ function isRepositoryIdentityMigrationRequiredStatus(value) {
16938
+ if (typeof value !== "object" || value === null || Array.isArray(value)) {
16939
+ return false;
16940
+ }
16941
+ const record2 = value;
16942
+ if (record2.failureCode !== REPOSITORY_IDENTITY_MIGRATION_REQUIRED) {
16943
+ return false;
16944
+ }
16945
+ return isGitHubInstallIntentStatusResponse({
16946
+ ...record2,
16947
+ failureCode: "proof_commit_failed"
16948
+ });
16949
+ }
16936
16950
  function parseGitHubInstallIntentStart(value, now = Date.now()) {
16937
16951
  if (!isGitHubInstallIntentStartResponse(value) || value.expiresAt <= now || value.expiresAt - now > MAX_INTENT_LIFETIME_MS) {
16938
16952
  return null;
@@ -16940,7 +16954,10 @@ function parseGitHubInstallIntentStart(value, now = Date.now()) {
16940
16954
  return value;
16941
16955
  }
16942
16956
  function parseGitHubInstallIntentStatus(value, expectedExpiresAt) {
16943
- if (!isGitHubInstallIntentStatusResponse(value) || value.expiresAt !== expectedExpiresAt) {
16957
+ if (isGitHubInstallIntentStatusResponse(value)) {
16958
+ return value.expiresAt === expectedExpiresAt ? value : null;
16959
+ }
16960
+ if (!isRepositoryIdentityMigrationRequiredStatus(value) || value.expiresAt !== expectedExpiresAt) {
16944
16961
  return null;
16945
16962
  }
16946
16963
  return value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primitive.ai/prim",
3
- "version": "0.1.0-alpha.72",
3
+ "version": "0.1.0-alpha.74",
4
4
  "description": "CLI for Primitive's decision graph — passive decision capture, conflict gate, and team presence",
5
5
  "type": "module",
6
6
  "license": "MIT",