@treeseed/sdk 0.12.60 → 0.12.62

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 (44) hide show
  1. package/dist/guarantees/index.js +59 -56
  2. package/dist/hosting/contracts.d.ts +0 -19
  3. package/dist/hosting/graph.d.ts +1 -86
  4. package/dist/hosting/graph.js +96 -245
  5. package/dist/local-dev/managed-dev.js +30 -8
  6. package/dist/managed-dependencies.d.ts +3 -0
  7. package/dist/managed-dependencies.js +294 -20
  8. package/dist/operations/services/deploy.js +5 -5
  9. package/dist/operations/services/deployment-readiness.js +5 -4
  10. package/dist/operations/services/git-runner.d.ts +2 -0
  11. package/dist/operations/services/git-runner.js +23 -2
  12. package/dist/operations/services/hosted-service-checks.js +28 -0
  13. package/dist/operations/services/live-hosted-service-checks.js +51 -15
  14. package/dist/operations/services/local-cleanup.d.ts +1 -0
  15. package/dist/operations/services/local-cleanup.js +28 -9
  16. package/dist/operations/services/package-adapters.js +3 -3
  17. package/dist/operations/services/railway-api.d.ts +72 -28
  18. package/dist/operations/services/railway-api.js +321 -876
  19. package/dist/operations/services/railway-cli.d.ts +47 -0
  20. package/dist/operations/services/railway-cli.js +142 -0
  21. package/dist/operations/services/railway-deploy.d.ts +2 -2
  22. package/dist/operations/services/railway-deploy.js +36 -91
  23. package/dist/operations/services/railway-source-policy.d.ts +6 -0
  24. package/dist/operations/services/railway-source-policy.js +52 -9
  25. package/dist/operations/services/repository-save-orchestrator.d.ts +2 -0
  26. package/dist/operations/services/repository-save-orchestrator.js +45 -14
  27. package/dist/operations-types.d.ts +3 -1
  28. package/dist/platform/contracts.d.ts +1 -0
  29. package/dist/platform/deploy-config.js +2 -1
  30. package/dist/reconcile/builtin-adapters.js +519 -684
  31. package/dist/reconcile/desired-state.js +5 -3
  32. package/dist/reconcile/engine.js +34 -28
  33. package/dist/reconcile/live-acceptance.js +2 -11
  34. package/dist/reconcile/providers/railway-iac.d.ts +147 -0
  35. package/dist/reconcile/providers/railway-iac.js +289 -16
  36. package/dist/scenes/runner.js +11 -11
  37. package/dist/scripts/build-dist.js +22 -0
  38. package/dist/workflow/operations.d.ts +12 -0
  39. package/dist/workflow/operations.js +441 -105
  40. package/dist/workflow/runs.d.ts +5 -0
  41. package/dist/workflow/runs.js +9 -3
  42. package/dist/workflow-support.d.ts +1 -1
  43. package/dist/workflow-support.js +3 -1
  44. package/package.json +1 -2
@@ -30,7 +30,11 @@ export type TreeseedWorkflowRunStep = {
30
30
  branch: string | null;
31
31
  resumable: boolean;
32
32
  status: 'pending' | 'completed' | 'skipped';
33
+ startedAt?: string | null;
33
34
  completedAt: string | null;
35
+ elapsedMs?: number | null;
36
+ retryCount?: number;
37
+ lastFailure?: string | null;
34
38
  data: Record<string, unknown> | null;
35
39
  };
36
40
  export type TreeseedWorkflowRunJournal = {
@@ -109,6 +113,7 @@ export declare function updateWorkflowRunJournal(root: string, runId: string, up
109
113
  export declare function classifyWorkflowRunJournal(journal: TreeseedWorkflowRunJournal, options?: {
110
114
  currentBranch?: string | null;
111
115
  currentHeads?: Record<string, string | null | undefined>;
116
+ acceptedReleaseHeads?: Record<string, string | null | undefined>;
112
117
  now?: string;
113
118
  }): TreeseedWorkflowRunClassification;
114
119
  export declare function classifyWorkflowRunJournals(root: string, options?: Parameters<typeof classifyWorkflowRunJournal>[1]): {
@@ -406,6 +406,8 @@ function expectedPackageHeadAfterReleaseGate(journal, packageName) {
406
406
  const data = releaseStepData(journal, `release-${packageName}`);
407
407
  const backMerge = stringRecord(data?.backMerge);
408
408
  if (typeof backMerge?.commitSha === "string") return backMerge.commitSha;
409
+ const commit = stringRecord(data?.commit);
410
+ if (typeof commit?.commitSha === "string") return commit.commitSha;
409
411
  if (typeof data?.commitSha === "string") return data.commitSha;
410
412
  return null;
411
413
  }
@@ -512,9 +514,9 @@ function classifyWorkflowRunJournal(journal, options = {}) {
512
514
  }
513
515
  for (const name of selectedReleasePackageNames(releasePlan)) {
514
516
  const currentHead = options.currentHeads[name];
515
- const plannedHead = journalReleasePlanHead(releasePlan, name);
516
- if (currentHead && plannedHead && currentHead !== plannedHead) {
517
- reasons.push(`${name} head changed from ${plannedHead} to ${currentHead}`);
517
+ const expectedHead = expectedPackageHeadAfterReleaseGate(journal, name) ?? options.acceptedReleaseHeads?.[name] ?? journalReleasePlanHead(releasePlan, name);
518
+ if (currentHead && expectedHead && currentHead !== expectedHead) {
519
+ reasons.push(`${name} head changed from ${expectedHead} to ${currentHead}`);
518
520
  }
519
521
  }
520
522
  }
@@ -619,7 +621,11 @@ function createWorkflowRunJournal(root, options) {
619
621
  steps: options.steps.map((step) => ({
620
622
  ...step,
621
623
  status: "pending",
624
+ startedAt: null,
622
625
  completedAt: null,
626
+ elapsedMs: null,
627
+ retryCount: 0,
628
+ lastFailure: null,
623
629
  data: null
624
630
  })),
625
631
  failure: null,
@@ -10,7 +10,7 @@ export { readTreeseedVerificationCache, treeseedVerificationCacheKey, writeTrees
10
10
  export { assertDeploymentInitialized, cleanupDestroyedState, createBranchPreviewDeployTarget, createPersistentDeployTarget, deployTargetLabel, destroyCloudflareResources, ensureGeneratedWranglerConfig, finalizeDeploymentState, loadDeployState, printDeploySummary, printDestroySummary, provisionCloudflareResources, runRemoteD1Migrations, syncCloudflareSecrets, validateDeployPrerequisites, validateDestroyPrerequisites, } from './operations/services/deploy.js';
11
11
  export { assertCleanWorktree, assertFeatureBranch, branchExists, checkoutBranch, createFeatureBranchFromStaging, currentManagedBranch, deleteLocalBranch, deleteRemoteBranch, ensureLocalBranchTracking, gitWorkflowRoot, listTaskBranches, mergeCurrentBranchIntoStaging, mergeStagingIntoMain, prepareReleaseBranches, PRODUCTION_BRANCH, pushBranch, remoteBranchExists, STAGING_BRANCH, syncBranchWithOrigin, waitForStagingAutomation, } from './operations/services/git-workflow.js';
12
12
  export { loadCliDeployConfig, packageScriptPath, resolveWranglerBin, } from './operations/services/runtime-tools.js';
13
- export { configuredRailwayServices, validateRailwayDeployPrerequisites, } from './operations/services/railway-deploy.js';
13
+ export { configuredRailwayServices, validateRailwayDeployPrerequisites, waitForRailwayManagedDeploymentsSettled, } from './operations/services/railway-deploy.js';
14
14
  export { getRailwayAuthProfile, listRailwayEnvironments, listRailwayProjects, listRailwayServices, listRailwayVariables, resolveRailwayApiToken, resolveRailwayApiUrl, resolveRailwayWorkspace, resolveRailwayWorkspaceContext, } from './operations/services/railway-api.js';
15
15
  export { githubRepositoryCredentialEnvName, resolveGitHubCredentialForRepository, type TreeseedGitHubCredentialResolution, } from './operations/services/github-credentials.js';
16
16
  export { createGitHubApiClient, ensureGitHubActionsEnvironment, getLatestGitHubWorkflowRun, listGitHubEnvironmentSecretNames, listGitHubEnvironmentVariableNames, type GitHubWorkflowDispatchResult, type GitHubWorkflowRunSummary, } from './operations/services/github-api.js';
@@ -113,7 +113,8 @@ import {
113
113
  } from "./operations/services/runtime-tools.js";
114
114
  import {
115
115
  configuredRailwayServices,
116
- validateRailwayDeployPrerequisites
116
+ validateRailwayDeployPrerequisites,
117
+ waitForRailwayManagedDeploymentsSettled
117
118
  } from "./operations/services/railway-deploy.js";
118
119
  import {
119
120
  getRailwayAuthProfile,
@@ -379,6 +380,7 @@ export {
379
380
  validateRailwayDeployPrerequisites,
380
381
  validateTreeseedPackageManifests,
381
382
  verifyTreeseedPackageArtifact,
383
+ waitForRailwayManagedDeploymentsSettled,
382
384
  waitForStagingAutomation,
383
385
  warnDeprecatedTreeseedLocalEnvFiles,
384
386
  withTreeseedKeyAgentAutopromptDisabled,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@treeseed/sdk",
3
- "version": "0.12.60",
3
+ "version": "0.12.62",
4
4
  "description": "Shared Treeseed SDK for content-backed and D1-backed object models.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {
@@ -66,7 +66,6 @@
66
66
  "@github/copilot": "1.0.39",
67
67
  "@github/copilot-language-server": "1.480.0",
68
68
  "@github/copilot-sdk": "0.3.0",
69
- "@railway/cli": "5.23.2",
70
69
  "@remotion/bundler": "4.0.477",
71
70
  "@remotion/renderer": "4.0.477",
72
71
  "drizzle-orm": "^0.45.2",