@treeseed/sdk 0.10.28 → 0.11.0

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 (148) hide show
  1. package/README.md +207 -6
  2. package/dist/capacity-provider.d.ts +3 -1
  3. package/dist/capacity-provider.js +25 -5
  4. package/dist/control-plane.d.ts +1 -0
  5. package/dist/control-plane.js +38 -13
  6. package/dist/db/market-schema.d.ts +8860 -6172
  7. package/dist/db/market-schema.js +108 -0
  8. package/dist/db/node-sqlite.js +7 -2
  9. package/dist/hosting/apps.d.ts +12 -0
  10. package/dist/hosting/apps.js +107 -0
  11. package/dist/hosting/builtins.d.ts +25 -0
  12. package/dist/hosting/builtins.js +791 -0
  13. package/dist/hosting/contracts.d.ts +207 -0
  14. package/dist/hosting/contracts.js +0 -0
  15. package/dist/hosting/graph.d.ts +192 -0
  16. package/dist/hosting/graph.js +1106 -0
  17. package/dist/hosting/index.d.ts +4 -0
  18. package/dist/hosting/index.js +4 -0
  19. package/dist/index.d.ts +10 -3
  20. package/dist/index.js +63 -6
  21. package/dist/managed-dependencies.js +1 -2
  22. package/dist/market-client.d.ts +63 -3
  23. package/dist/market-client.js +83 -11
  24. package/dist/operations/services/bootstrap-runner.d.ts +3 -1
  25. package/dist/operations/services/bootstrap-runner.js +22 -2
  26. package/dist/operations/services/config-runtime.d.ts +10 -5
  27. package/dist/operations/services/config-runtime.js +209 -66
  28. package/dist/operations/services/deploy.d.ts +70 -7
  29. package/dist/operations/services/deploy.js +579 -64
  30. package/dist/operations/services/deployment-readiness.d.ts +30 -0
  31. package/dist/operations/services/deployment-readiness.js +175 -0
  32. package/dist/operations/services/git-workflow.d.ts +2 -1
  33. package/dist/operations/services/git-workflow.js +9 -3
  34. package/dist/operations/services/github-actions-verification.d.ts +1 -0
  35. package/dist/operations/services/github-actions-verification.js +1 -0
  36. package/dist/operations/services/github-api.js +1 -1
  37. package/dist/operations/services/github-automation.d.ts +1 -1
  38. package/dist/operations/services/github-automation.js +4 -3
  39. package/dist/operations/services/github-credentials.d.ts +13 -0
  40. package/dist/operations/services/github-credentials.js +58 -0
  41. package/dist/operations/services/hosted-service-checks.d.ts +63 -0
  42. package/dist/operations/services/hosted-service-checks.js +327 -0
  43. package/dist/operations/services/hub-provider-launch.js +3 -3
  44. package/dist/operations/services/live-hosted-service-checks.d.ts +25 -0
  45. package/dist/operations/services/live-hosted-service-checks.js +350 -0
  46. package/dist/operations/services/managed-host-security.js +1 -1
  47. package/dist/operations/services/operations-runner-smoke.d.ts +30 -0
  48. package/dist/operations/services/operations-runner-smoke.js +180 -0
  49. package/dist/operations/services/package-adapters.d.ts +95 -0
  50. package/dist/operations/services/package-adapters.js +288 -0
  51. package/dist/operations/services/package-reference-policy.d.ts +1 -0
  52. package/dist/operations/services/package-reference-policy.js +15 -2
  53. package/dist/operations/services/project-platform.d.ts +80 -22
  54. package/dist/operations/services/project-platform.js +49 -8
  55. package/dist/operations/services/project-web-monitor.js +26 -4
  56. package/dist/operations/services/railway-api.d.ts +88 -5
  57. package/dist/operations/services/railway-api.js +626 -35
  58. package/dist/operations/services/railway-deploy.d.ts +46 -40
  59. package/dist/operations/services/railway-deploy.js +261 -293
  60. package/dist/operations/services/release-candidate.d.ts +19 -0
  61. package/dist/operations/services/release-candidate.js +375 -38
  62. package/dist/operations/services/repository-save-orchestrator.d.ts +3 -1
  63. package/dist/operations/services/repository-save-orchestrator.js +279 -66
  64. package/dist/operations/services/runtime-tools.d.ts +1 -0
  65. package/dist/operations/services/runtime-tools.js +10 -9
  66. package/dist/operations/services/verification-cache.d.ts +25 -0
  67. package/dist/operations/services/verification-cache.js +71 -0
  68. package/dist/operations/services/workspace-dependency-mode.js +9 -1
  69. package/dist/operations/services/workspace-save.js +1 -1
  70. package/dist/operations/services/workspace-tools.js +2 -1
  71. package/dist/platform/contracts.d.ts +32 -1
  72. package/dist/platform/deploy-config.js +73 -8
  73. package/dist/platform/env.yaml +163 -35
  74. package/dist/platform/environment.d.ts +1 -0
  75. package/dist/platform/environment.js +74 -5
  76. package/dist/platform/plugin.d.ts +9 -0
  77. package/dist/platform-operation-store.js +2 -2
  78. package/dist/platform-operations.js +1 -1
  79. package/dist/reconcile/bootstrap-systems.js +2 -2
  80. package/dist/reconcile/builtin-adapters.js +372 -189
  81. package/dist/reconcile/contracts.d.ts +9 -5
  82. package/dist/reconcile/desired-state.d.ts +1 -0
  83. package/dist/reconcile/desired-state.js +5 -5
  84. package/dist/reconcile/engine.d.ts +5 -2
  85. package/dist/reconcile/engine.js +53 -32
  86. package/dist/reconcile/index.d.ts +2 -0
  87. package/dist/reconcile/index.js +2 -0
  88. package/dist/reconcile/live-acceptance.d.ts +79 -0
  89. package/dist/reconcile/live-acceptance.js +1615 -0
  90. package/dist/reconcile/platform.d.ts +104 -0
  91. package/dist/reconcile/platform.js +100 -0
  92. package/dist/reconcile/state.js +4 -4
  93. package/dist/reconcile/units.js +2 -2
  94. package/dist/scripts/deployment-readiness.js +20 -0
  95. package/dist/scripts/generate-treedx-openapi-types.js +186 -0
  96. package/dist/scripts/operations-runner-smoke.js +16 -0
  97. package/dist/scripts/release-verify.js +4 -1
  98. package/dist/scripts/tenant-workflow-action.js +10 -1
  99. package/dist/sdk-types.d.ts +169 -4
  100. package/dist/sdk-types.js +20 -2
  101. package/dist/sdk.d.ts +35 -24
  102. package/dist/sdk.js +186 -17
  103. package/dist/template-launch-requirements.js +9 -0
  104. package/dist/treedx/adapters.d.ts +6 -0
  105. package/dist/treedx/adapters.js +36 -0
  106. package/dist/treedx/client.d.ts +222 -0
  107. package/dist/treedx/client.js +871 -0
  108. package/dist/treedx/errors.d.ts +13 -0
  109. package/dist/treedx/errors.js +17 -0
  110. package/dist/treedx/federated-client.d.ts +27 -0
  111. package/dist/treedx/federated-client.js +158 -0
  112. package/dist/treedx/generated/openapi-types.d.ts +3558 -0
  113. package/dist/treedx/generated/openapi-types.js +0 -0
  114. package/dist/treedx/graph-adapter.d.ts +33 -0
  115. package/dist/treedx/graph-adapter.js +156 -0
  116. package/dist/treedx/index.d.ts +14 -0
  117. package/dist/treedx/index.js +48 -0
  118. package/dist/treedx/market-integration.d.ts +27 -0
  119. package/dist/treedx/market-integration.js +131 -0
  120. package/dist/treedx/ports.d.ts +166 -0
  121. package/dist/treedx/ports.js +231 -0
  122. package/dist/treedx/query-adapter.d.ts +19 -0
  123. package/dist/treedx/query-adapter.js +62 -0
  124. package/dist/treedx/registry-client.d.ts +11 -0
  125. package/dist/treedx/registry-client.js +19 -0
  126. package/dist/treedx/repository-adapter.d.ts +45 -0
  127. package/dist/treedx/repository-adapter.js +308 -0
  128. package/dist/treedx/sdk-integration.d.ts +27 -0
  129. package/dist/treedx/sdk-integration.js +63 -0
  130. package/dist/treedx/types.d.ts +1084 -0
  131. package/dist/treedx/types.js +8 -0
  132. package/dist/treedx/workspace-adapter.d.ts +27 -0
  133. package/dist/treedx/workspace-adapter.js +65 -0
  134. package/dist/treedx-backends.d.ts +218 -0
  135. package/dist/treedx-backends.js +632 -0
  136. package/dist/treedx-client.d.ts +86 -0
  137. package/dist/treedx-client.js +175 -0
  138. package/dist/treeseed/template-catalog/catalog.fixture.json +23 -23
  139. package/dist/workflow/operations.d.ts +119 -13
  140. package/dist/workflow/operations.js +309 -53
  141. package/dist/workflow-state.d.ts +13 -0
  142. package/dist/workflow-state.js +43 -26
  143. package/dist/workflow-support.d.ts +11 -3
  144. package/dist/workflow-support.js +67 -3
  145. package/dist/workflow.d.ts +5 -0
  146. package/drizzle/market/0004_treedx_market_integration.sql +99 -0
  147. package/package.json +34 -3
  148. package/templates/github/deploy-web.workflow.yml +39 -6
@@ -0,0 +1,4 @@
1
+ export * from './contracts.ts';
2
+ export * from './builtins.ts';
3
+ export * from './apps.ts';
4
+ export * from './graph.ts';
@@ -0,0 +1,4 @@
1
+ export * from "./contracts.js";
2
+ export * from "./builtins.js";
3
+ export * from "./apps.js";
4
+ export * from "./graph.js";
package/dist/index.d.ts CHANGED
@@ -1,5 +1,9 @@
1
1
  export { AgentSdk, ScopedAgentSdk } from './sdk.ts';
2
+ export type { AgentSdkContentRepositoryOptions, AgentSdkTreeDxOptions, TreeSeedTreeDxContentPathRule, TreeSeedTreeDxRepositoryHint, } from './sdk.ts';
2
3
  export { ContentGraphRuntime } from './graph.ts';
4
+ export * from './treedx/index.ts';
5
+ export { createTreeDxClientFromAgentOptions, LocalContentBackend, LocalExecBackend, LocalGraphBackend, TreeDxApiError, TreeDxContentBackend, TreeDxContentRepositoryConfigError, TreeDxExecBackend, TreeDxGraphBackend, TreeDxPortfolioResolver, } from './treedx-backends.ts';
6
+ export type { ContentBackend, ExecBackend, GraphBackend, ResolvedTreeDxOptions, TreeDxRepositoryCandidate, } from './treedx-backends.ts';
3
7
  export { TREESEED_DEFAULT_STARTER_TEMPLATE_ID, TREESEED_TEMPLATE_ID_ALIASES, normalizeTreeseedTemplateId, projectConnectionModeFromHosting, } from './sdk-types.ts';
4
8
  export { createControlPlaneReporter } from './control-plane.ts';
5
9
  export { ControlPlaneClient } from './control-plane-client.ts';
@@ -8,11 +12,14 @@ export { CAPACITY_PROVIDER_ENDPOINTS, CAPACITY_PROVIDER_DEPLOYMENT_SERVICE_ROLES
8
12
  export { PLATFORM_OPERATION_ENDPOINTS, PLATFORM_OPERATION_NAMESPACES, PLATFORM_OPERATION_SCOPES, PLATFORM_OPERATION_STATUSES, PLATFORM_OPERATION_TARGETS, PlatformOperationApiError, PlatformRunnerClient, assertPlatformOperation, assertPlatformOperationEvent, assertPlatformOperationOkEnvelope, buildPlatformRunnerAuthHeaders, createPlatformOperationExecutorRegistry, derivePlatformOperationNavigation, isPlatformOperationSuccessful, isPlatformOperationTerminal, pollPlatformOperation, runPlatformOperationOnce, type PlatformOperation, type PlatformOperationEvent, type PlatformOperationNavigationResult, type PlatformOperationPollOptions, type PlatformOperationPollResult, } from './platform-operations.ts';
9
13
  export { PLATFORM_CONTENT_COLLECTIONS, PLATFORM_WORK_CONTENT_COLLECTIONS, createPlatformRepositoryClaim, derivePlatformRepositoryKey, executePlatformRepositoryOperation, normalizePlatformContentInput, normalizePlatformRelationArray, platformContentRelationPolicy, resolvePlatformRepositoryWorkspacePath, slugifyPlatformContent, type PlatformContentCollection, type PlatformRepositoryClaim, type PlatformRepositoryClaimInput, type PlatformRepositoryDescriptor, type PlatformRepositoryOperationInput, type PlatformRepositoryOperationOptions, type PlatformRepositoryOperationResult, type PlatformRepositoryPathPolicy, type PlatformRepositoryVerificationCommand, type PlatformRepositoryVerificationResult, type NormalizedPlatformContentInput, } from './operations/repository-operations.ts';
10
14
  export { cancelGitHubWorkflowRun, dispatchGitHubWorkflowRun, formatGitHubWorkflowFailure, getGitHubWorkflowFileStatus, getLatestGitHubWorkflowRun, waitForGitHubWorkflowRunCompletion, type GitHubWorkflowCancellationResult, type GitHubWorkflowDispatchResult, type GitHubWorkflowFailureSummary, type GitHubWorkflowFailureSummaryInput, type GitHubWorkflowFileStatus, type GitHubWorkflowProgressEvent, } from './operations/services/github-api.ts';
15
+ export { collectTreeseedHostedServiceChecks, type TreeseedHostedServiceCheck, type TreeseedHostedServiceCheckReport, type TreeseedHostedServiceCheckStatus, type TreeseedHostedServiceType, type TreeseedObservedRailwayServiceState, } from './operations/services/hosted-service-checks.ts';
11
16
  export { buildProjectWebMonitorResult, } from './operations/services/project-web-monitor.ts';
17
+ export { discoverTreeseedPackageAdapters, findTreeseedPackageAdapter, packageAdapterPlanSummary, planTreeseedPackageDevelopmentImage, readMixProjectVersion, type TreeseedPackageAdapter, type TreeseedPackageCommand, type TreeseedPackageDevelopmentImagePlan, type TreeseedPackageKind, } from './operations/services/package-adapters.ts';
12
18
  export { DEFAULT_EXECUTION_PROFILE_ID, DEFAULT_EXECUTION_PROFILES, DEFAULT_TASK_ADMISSION_POLICY, buildTaskEstimateProfileFromActuals, computeWorkdayBudgetEnvelope, decideTaskAdmission, estimateAttentionForTask, estimateConfidenceFromProfile, estimateLearningPercentile, estimateLearningVariance, estimateForClassification, estimateProfileConfidenceScore, estimateUtilityForTask, isInterruptedUsageActual, normalizeHybridExecutionPlan, mutationRequiresRepositoryClaim, normalizePlanningPolicy, normalizePredictiveReservePolicy, normalizeTaskPlanProposal, normalizeExecutionProfile, normalizeAttentionPolicy, normalizeTaskAdmissionPolicy, normalizeUtilityPolicy, predictReserveForCapacityPlan, progressivelyAdmitPlanProposal, rankPlannedTaskNodes, reservationHasCapacity, reserveCreditsForEstimate, routeAndReserveCapacity, scoreCapacityLane, selectBestCapacityLane, selectTaskEstimateProfile, ACTUAL_CREDIT_FORMULA_VERSION, buildCreditConversionProfileFromActuals, calculateActualCredits, deriveAvailableCredits, nativeUsageAmount, nativeUsageUnit, selectCreditConversionProfile, settleCapacityActuals, shouldInterruptForCapacity, synthesizePlanEstimate, createReservationReleaseEntry, summarizeCapacityPlan, summarizeProjectCapacityPlan, summarizeTeamCapacityPlan, validateTaskPlanProposal, } from './capacity.ts';
19
+ export { githubRepositoryCredentialEnvName, resolveGitHubCredentialForRepository, type TreeseedGitHubCredentialResolution, } from './operations/services/github-credentials.ts';
13
20
  export { executeKnowledgeHubProviderLaunch, validateKnowledgeHubProviderLaunchPrerequisites, } from './operations/services/hub-provider-launch.ts';
14
21
  export { createKnowledgeHubRepositories, defaultHubContentResolutionPolicy, executeKnowledgeHubLaunch, normalizeKnowledgeHubLaunchIntent, planKnowledgeHubLaunch, planKnowledgeHubRepositories, validateRepositoryHost, type HubContentResolutionPolicy, type KnowledgeHubLaunchIntent, type KnowledgeHubLaunchPhase, type KnowledgeHubLaunchPlan, type KnowledgeHubLaunchResult, type KnowledgeHubRepositoryPlan, type RepositoryHost, } from './operations/services/hub-launch.ts';
15
- export { ensureRailwayEnvironment, ensureRailwayProject, ensureRailwayService, getRailwayAuthProfile, listRailwayEnvironments, listRailwayProjects, listRailwayServices, listRailwayVariables, railwayGraphqlRequest, resolveRailwayApiToken, resolveRailwayApiUrl, resolveRailwayWorkspace, resolveRailwayWorkspaceContext, upsertRailwayVariables, } from './operations/services/railway-api.ts';
22
+ export { deployRailwayServiceInstance, ensureRailwayEnvironment, ensureRailwayGeneratedServiceDomain, ensureRailwayProject, ensureRailwayService, ensureRailwayServiceInstanceConfiguration, ensureRailwayServiceVolume, getRailwayAuthProfile, listRailwayEnvironments, listRailwayProjects, listRailwayServiceDomains, listRailwayServices, listRailwayVariables, normalizeRailwayEnvironmentName, railwayGraphqlRequest, resolveRailwayApiToken, resolveRailwayApiUrl, resolveRailwayWorkspace, resolveRailwayWorkspaceContext, upsertRailwayVariables, } from './operations/services/railway-api.ts';
16
23
  export { buildKnowledgePackMarketPackage, buildTemplateMarketPackage, importKnowledgePack, } from './operations/services/market-packaging.ts';
17
24
  export { AGENT_MESSAGE_KINDS, PROJECT_JOB_STATUSES, RELEASE_STATES, SHARE_PACKAGE_STATES, PROJECT_TEAM_CAPABILITIES, WORKSTREAM_STATES, normalizeProjectJobStatus, normalizeRemoteJobStatus, } from './project-workflow.ts';
18
25
  export { PUBLISHED_CONTENT_MANIFEST_SCHEMA_VERSION, EDITORIAL_PREVIEW_COOKIE, TeamScopedR2OverlayContentRuntimeProvider, TeamScopedR2OverlayContentPublishProvider, createTeamScopedR2OverlayContentRuntimeProvider, createTeamScopedR2OverlayContentPublishProvider, isTeamScopedR2ContentEnabled, parsePublishedCollectionIndex, parsePublishedContentManifest, parsePublishedOverlayManifest, readPublishedContentManifest, readPublishedOverlayManifest, resolveCloudflareR2Bucket, resolvePublishedContentBucketBinding, resolvePublishedContentManifestKey, resolvePublishedContentPreviewRoot, resolvePublishedContentPreviewTtlHours, resolveTeamScopedContentLocator, signEditorialPreviewToken, verifyEditorialPreviewToken, } from './platform/published-content.ts';
@@ -42,13 +49,13 @@ export { ProjectLaunchSecretSyncError, resolveProjectLaunchSecretValueOverlay, s
42
49
  export type { ProjectLaunchResolvedSecretValueItem, ProjectLaunchSecretSyncAdapters, ProjectLaunchSecretSyncProgressEvent, ProjectLaunchSecretSyncProvider, ProjectLaunchSecretSyncProviderStatus, ProjectLaunchSecretSyncProviderSummary, ProjectLaunchSecretSyncResult, ProjectLaunchSecretSyncStatus, ProjectLaunchSecretSyncSummaryItem, ProjectLaunchSecretSyncTargetKind, ProjectLaunchSecretValueDiagnostic, ProjectLaunchSecretValueOverlayResult, ResolveProjectLaunchSecretValueOverlayOptions, SyncProjectLaunchHostBindingSecretsOptions, } from './operations/services/template-secret-sync.ts';
43
50
  export { deriveProjectHostBindingsView, executeProjectHostBindingOperation, planProjectHostBindingOperation, } from './operations/services/project-host-operations.ts';
44
51
  export type { ExecuteProjectHostBindingOperationContext, ExecuteProjectHostBindingOperationInput, ExecuteProjectHostBindingOperationResult, PlanProjectHostBindingOperationOptions, PlanProjectHostBindingOperationResult, ProjectHostBindingsView, ProjectHostOperationDiagnostic, ProjectHostOperationKind, ProjectHostOperationStatus, ProjectHostRequirementBindingView, } from './operations/services/project-host-operations.ts';
45
- export { MarketClient, MarketApiError, DEFAULT_TREESEED_MARKET_BASE_URL, TREESEED_CATALOG_MARKET_API_BASE_URLS_ENV, TREESEED_CENTRAL_MARKET_API_BASE_URL_ENV, TREESEED_MARKET_API_BASE_URL_ENV, addMarketProfile, clearMarketSession, listIntegratedMarketCatalog, loadMarketRegistryState, removeMarketProfile, resolveCatalogMarketProfiles, resolveDefaultCentralMarketBaseUrl, resolveIntegratedCatalogArtifactDownload, resolveMarketProfile, resolveMarketSession, setActiveMarketProfile, setMarketSession, verifyArtifactBytes, writeMarketRegistryState, } from './market-client.ts';
52
+ export { MarketClient, MarketClientError, DEFAULT_TREESEED_MARKET_BASE_URL, TREESEED_CATALOG_MARKET_API_BASE_URLS_ENV, TREESEED_CENTRAL_MARKET_API_BASE_URL_ENV, TREESEED_API_BASE_URL_ENV, addMarketProfile, clearMarketSession, listIntegratedMarketCatalog, loadMarketRegistryState, removeMarketProfile, resolveCatalogMarketProfiles, resolveDefaultCentralMarketBaseUrl, resolveIntegratedCatalogArtifactDownload, resolveMarketProfile, resolveMarketSession, setActiveMarketProfile, setMarketSession, verifyArtifactBytes, writeMarketRegistryState, } from './market-client.ts';
46
53
  export { TREESEED_REMOTE_CONTRACT_HEADER, TREESEED_REMOTE_CONTRACT_VERSION, CloudflareQueuePullClient, CloudflareQueuePushClient, RemoteTreeseedClient, RemoteTreeseedAuthClient, RemoteTreeseedDispatchClient, RemoteTreeseedJobsClient, RemoteTreeseedRunnerClient, RemoteTreeseedSdkClient, RemoteTreeseedOperationsClient, } from './remote.ts';
47
54
  export { TRESEED_OPERATION_SPECS, findTreeseedOperation, listTreeseedOperationNames, } from './operations-registry.ts';
48
55
  export { TreeseedOperationsSdk } from './operations/runtime.ts';
49
56
  export { TreeseedWorkflowSdk } from './workflow.ts';
50
57
  export * from './db/index.ts';
51
- export { collectTreeseedReconcileStatus, createTreeseedReconcileRegistry, deriveTreeseedDesiredUnits, destroyTreeseedTargetUnits, observeTreeseedUnits, planTreeseedReconciliation, reconcileTreeseedTarget, } from './reconcile/index.ts';
58
+ export { collectTreeseedReconcileStatus, createTreeseedReconcileRegistry, deriveTreeseedDesiredUnits, destroyTreeseedTargetUnits, planTreeseedReconciliation, refreshTreeseedUnits, reconcileTreeseedTarget, } from './reconcile/index.ts';
52
59
  export { getTreeseedVerifyDriverStatus, runTreeseedVerifyDriver } from './verification.ts';
53
60
  export type { KnowledgeHubProviderLaunchPreflightReport, KnowledgeHubProviderLaunchFailurePhase, KnowledgeHubProviderLaunchInput, KnowledgeHubProviderLaunchResult, AgentMessageKind, AgentMessageRecord, AgentStatusRecord, DirectBoardItemSummary, InboxItem, ProjectJobStatus, LaunchProjectRequest, LaunchProjectResult, ProjectLaunchHostBindingInput, LinkedProjectRecordRef, ProjectConnectionStatus, ProjectOverviewSummary, ReleaseDetail, ReleaseState, ReleaseSummary, SharePackageState, SharePackageStatus, TeamCapability, TeamHomeSummary, TeamMemberSummary, WorkstreamDetail, WorkstreamEvent, WorkstreamState, WorkstreamSummary, SdkContentEntry, SdkDispatchCapability, SdkDispatchConfig, SdkDispatchCredentialSource, SdkDispatchExecutionClass, SdkDispatchNamespace, SdkDispatchPolicy, SdkDispatchRequest, SdkDispatchResult, SdkDispatchTarget, SdkCursorEntity, SdkFilterCondition, SdkFollowRequest, SdkGraphEdge, SdkGraphEdgeType, SdkGraphDslRelation, SdkGraphDslParseResult, SdkGraphModelConfig, SdkGraphNode, SdkGraphNodeType, SdkGraphPathExplanation, SdkGraphQueryStage, SdkGraphQueryView, SdkGraphQueryOptions, SdkGraphQueryRequest, SdkGraphQueryResult, SdkGraphRankingBuildInput, SdkGraphRankingDiagnostics, SdkGraphRankingIndex, SdkGraphRankingNodeResult, SdkGraphRankingProvider, SdkGraphRankingQueryRequest, SdkGraphRankingQueryResult, SdkGraphRankingSearchRequest, SdkGraphRefreshPayload, SdkGraphRefreshRequest, SdkGraphSearchOptions, SdkGraphSearchResult, SdkGraphSeed, SdkGraphSeedResolution, SdkGraphTraversalResult, SdkGraphWhereFilter, SdkContextPack, SdkContextPackRequest, SdkGetRequest, SdkJsonEnvelope, SdkLeaseEntity, SdkManagerContextPayload, SdkMessageEntity, SdkModelFieldBinding, SdkModelDefinition, SdkModelRegistry, SdkModelName, SdkMutationRequest, SdkOperation, SdkPickRequest, SdkPickResult, SdkQueueMessageEnvelope, SdkRunEntity, SdkSearchRequest, SdkTaskEntity, SdkTaskEventEntity, SdkTaskOutputEntity, SdkWorkDayEntity, SdkGraphRunEntity, SdkReportEntity, SdkSubscriptionEntity, SdkTemplateCatalogEntry, SdkTemplateCatalogPublisher, SdkTemplateCatalogResponse, SdkTemplateCatalogSource, TemplateConfigWrite, TemplateEnvironmentWrite, TemplateHostRequirement, TemplateLaunchRequirements, TemplateResourceRequirement, TemplateSecretRequirement, SdkUpdateRequest, ProjectCapabilityGrant, ProjectConnection, ProjectConnectionMode, ProjectDeployment, ProjectDeploymentActionAvailability, ProjectDeploymentEnvironment, ProjectDeploymentEvent, ProjectDeploymentKind, ProjectDeploymentReadiness, ProjectDeploymentStatus, ProjectEnvironment, ProjectExecutionOwner, ProjectWebDeploymentAction, ProjectWebMonitorCheck, ProjectWebMonitorCheckSource, ProjectWebMonitorCheckStatus, ProjectWebMonitorResult, ProjectWebMonitorStatus, ProjectHosting, ProjectInfrastructureResource, ProjectInfrastructureResourceKind, ProjectInfrastructureResourceProvider, ProjectRunnerRegistrationState, RemoteJob, RemoteJobEvent, RemoteJobStatus, AgentPool, AgentPoolAutoscalePolicy, AgentPoolRegistration, AgentPoolScaleDecision, AgentPoolStatus, CatalogArtifactVersion, CatalogItem, CatalogItemFilters, CatalogItemOfferMode, ProjectEnvironmentName, ProjectWorkdaySummary, TreeseedHostingKind, TreeseedHostingRegistration, PriorityOverride, WorkdayWindow, WorkdaySchedule, WorkdayRequest, WorkdayManagerLease, WorkerRunner, WorkerRunnerState, RepositoryClaim, TaskCreditWeight, TaskCreditBudget, WorkdayPolicy, PrioritySnapshotItem, PrioritySnapshot, TaskCreditLedgerEntry, ApprovalRequest, DecideApprovalRequestRequest, ListApprovalRequestsRequest, CapacityBusinessModel, CapacityGrant, CapacityGrantScope, CapacityLedgerEntry, CapacityLaneUnit, CapacityPlan, CapacityProvider, CapacityProviderHost, CapacityProviderKind, CapacityProviderLane, CapacityReservation, CapacityRoutingDecision, CapacityTaskExecutionEnvelope, CanonicalTaskState, CreateApprovalRequestRequest, CreateCapacityReservationRequest, CreateCapacityRoutingDecisionRequest, CreateTaskEstimateRequest, CreateTaskUsageActualRequest, CreditConversionProfile, DerivedCapacityAvailability, DerivedCapacityInput, DerivedCapacitySummary, NativeUsageObservation, UpsertTeamInboxItemRequest, ExecutionProfile, HybridExecutionPhase, HybridExecutionPlan, PlannedTaskNode, PlanningAdmissionResult, PlanningPolicy, PredictiveReservePolicy, RecordCapacityUsageRequest, RepositoryWorkState, ReservePrediction, TaskAdmissionDecision, TaskAdmissionOutcome, TaskAdmissionPolicy, TaskClassification, TaskEstimate, TaskEstimateProfile, TaskCheckpointArtifact, TaskConcurrencyClass, TaskPlanProposal, TaskMutationScope, TaskRiskClass, TaskUsageActual, UtilityEstimate, UtilityPolicy, UpsertCapacityGrantRequest, UpsertCapacityProviderHostRequest, UpsertCapacityProviderLaneRequest, UpsertCapacityProviderRequest, ScaleDecision, RunnerScaleDecision, TeamStorageLocator, TeamWebHost, TeamWebHostOwnership, TeamWebHostProvider, EncryptedWebHostPayload, UpsertAgentPoolRequest, UpsertCatalogArtifactVersionRequest, UpsertCatalogItemRequest, UpsertProjectEnvironmentRequest, UpsertProjectHostingRequest, UpsertProjectInfrastructureResourceRequest, UpsertTeamStorageLocatorRequest, UpsertTeamWebHostRequest, CreateProjectDeploymentRequest, CreateProjectWebDeploymentRequest, CreateProjectWebDeploymentResponse, RecordAgentPoolRegistrationRequest, SdkAppendTaskEventRequest, SdkClaimTaskRequest, SdkCreateWorkdayRequest, SdkCloseWorkDayRequest, SdkCompleteTaskRequest, SdkCreateTaskRequest, SdkFailTaskRequest, SdkManagerContextPayload, SdkClaimWorkdayManagerLeaseRequest, SdkReleaseWorkdayManagerLeaseRequest, SdkRecordWorkerRunnerRequest, SdkRecordRepositoryClaimRequest, SdkRecordRunnerScaleDecisionRequest, SdkStartWorkDayRequest, SdkTaskEntity, SdkTaskEventEntity, SdkTaskOutputEntity, SdkTaskProgressRequest, SdkTaskSearchRequest, SdkUpdateWorkDayGraphRequest, SdkWorkDayEntity, WorkerPoolScaleResult, WorkerPoolScaler, } from './sdk-types.ts';
54
61
  export type * from './project-workflow.ts';
package/dist/index.js CHANGED
@@ -1,5 +1,18 @@
1
1
  import { AgentSdk, ScopedAgentSdk } from "./sdk.js";
2
2
  import { ContentGraphRuntime } from "./graph.js";
3
+ export * from "./treedx/index.js";
4
+ import {
5
+ createTreeDxClientFromAgentOptions,
6
+ LocalContentBackend,
7
+ LocalExecBackend,
8
+ LocalGraphBackend,
9
+ TreeDxApiError,
10
+ TreeDxContentBackend,
11
+ TreeDxContentRepositoryConfigError,
12
+ TreeDxExecBackend,
13
+ TreeDxGraphBackend,
14
+ TreeDxPortfolioResolver
15
+ } from "./treedx-backends.js";
3
16
  import {
4
17
  TREESEED_DEFAULT_STARTER_TEMPLATE_ID,
5
18
  TREESEED_TEMPLATE_ID_ALIASES,
@@ -69,9 +82,19 @@ import {
69
82
  getLatestGitHubWorkflowRun,
70
83
  waitForGitHubWorkflowRunCompletion
71
84
  } from "./operations/services/github-api.js";
85
+ import {
86
+ collectTreeseedHostedServiceChecks
87
+ } from "./operations/services/hosted-service-checks.js";
72
88
  import {
73
89
  buildProjectWebMonitorResult
74
90
  } from "./operations/services/project-web-monitor.js";
91
+ import {
92
+ discoverTreeseedPackageAdapters,
93
+ findTreeseedPackageAdapter,
94
+ packageAdapterPlanSummary,
95
+ planTreeseedPackageDevelopmentImage,
96
+ readMixProjectVersion
97
+ } from "./operations/services/package-adapters.js";
75
98
  import {
76
99
  DEFAULT_EXECUTION_PROFILE_ID,
77
100
  DEFAULT_EXECUTION_PROFILES,
@@ -121,6 +144,10 @@ import {
121
144
  summarizeTeamCapacityPlan,
122
145
  validateTaskPlanProposal
123
146
  } from "./capacity.js";
147
+ import {
148
+ githubRepositoryCredentialEnvName,
149
+ resolveGitHubCredentialForRepository
150
+ } from "./operations/services/github-credentials.js";
124
151
  import {
125
152
  executeKnowledgeHubProviderLaunch,
126
153
  validateKnowledgeHubProviderLaunchPrerequisites
@@ -135,14 +162,20 @@ import {
135
162
  validateRepositoryHost
136
163
  } from "./operations/services/hub-launch.js";
137
164
  import {
165
+ deployRailwayServiceInstance,
138
166
  ensureRailwayEnvironment,
167
+ ensureRailwayGeneratedServiceDomain,
139
168
  ensureRailwayProject,
140
169
  ensureRailwayService,
170
+ ensureRailwayServiceInstanceConfiguration,
171
+ ensureRailwayServiceVolume,
141
172
  getRailwayAuthProfile,
142
173
  listRailwayEnvironments,
143
174
  listRailwayProjects,
175
+ listRailwayServiceDomains,
144
176
  listRailwayServices,
145
177
  listRailwayVariables,
178
+ normalizeRailwayEnvironmentName,
146
179
  railwayGraphqlRequest,
147
180
  resolveRailwayApiToken,
148
181
  resolveRailwayApiUrl,
@@ -291,11 +324,11 @@ import {
291
324
  } from "./operations/services/project-host-operations.js";
292
325
  import {
293
326
  MarketClient,
294
- MarketApiError,
327
+ MarketClientError,
295
328
  DEFAULT_TREESEED_MARKET_BASE_URL,
296
329
  TREESEED_CATALOG_MARKET_API_BASE_URLS_ENV,
297
330
  TREESEED_CENTRAL_MARKET_API_BASE_URL_ENV,
298
- TREESEED_MARKET_API_BASE_URL_ENV,
331
+ TREESEED_API_BASE_URL_ENV,
299
332
  addMarketProfile,
300
333
  clearMarketSession,
301
334
  listIntegratedMarketCatalog,
@@ -337,8 +370,8 @@ import {
337
370
  createTreeseedReconcileRegistry,
338
371
  deriveTreeseedDesiredUnits,
339
372
  destroyTreeseedTargetUnits,
340
- observeTreeseedUnits,
341
373
  planTreeseedReconciliation,
374
+ refreshTreeseedUnits,
342
375
  reconcileTreeseedTarget
343
376
  } from "./reconcile/index.js";
344
377
  import { getTreeseedVerifyDriverStatus, runTreeseedVerifyDriver } from "./verification.js";
@@ -366,9 +399,12 @@ export {
366
399
  DEFAULT_TASK_ADMISSION_POLICY,
367
400
  DEFAULT_TREESEED_MARKET_BASE_URL,
368
401
  EDITORIAL_PREVIEW_COOKIE,
402
+ LocalContentBackend,
403
+ LocalExecBackend,
404
+ LocalGraphBackend,
369
405
  MODEL_REGISTRY,
370
- MarketApiError,
371
406
  MarketClient,
407
+ MarketClientError,
372
408
  MarketProviderClient,
373
409
  PLATFORM_CONTENT_COLLECTIONS,
374
410
  PLATFORM_OPERATION_ENDPOINTS,
@@ -394,16 +430,22 @@ export {
394
430
  RemoteTreeseedSdkClient,
395
431
  SHARE_PACKAGE_STATES,
396
432
  ScopedAgentSdk,
433
+ TREESEED_API_BASE_URL_ENV,
397
434
  TREESEED_CATALOG_MARKET_API_BASE_URLS_ENV,
398
435
  TREESEED_CENTRAL_MARKET_API_BASE_URL_ENV,
399
436
  TREESEED_DEFAULT_STARTER_TEMPLATE_ID,
400
- TREESEED_MARKET_API_BASE_URL_ENV,
401
437
  TREESEED_REMOTE_CONTRACT_HEADER,
402
438
  TREESEED_REMOTE_CONTRACT_VERSION,
403
439
  TREESEED_TEMPLATE_ID_ALIASES,
404
440
  TRESEED_OPERATION_SPECS,
405
441
  TeamScopedR2OverlayContentPublishProvider,
406
442
  TeamScopedR2OverlayContentRuntimeProvider,
443
+ TreeDxApiError,
444
+ TreeDxContentBackend,
445
+ TreeDxContentRepositoryConfigError,
446
+ TreeDxExecBackend,
447
+ TreeDxGraphBackend,
448
+ TreeDxPortfolioResolver,
407
449
  TreeseedOperationsSdk,
408
450
  TreeseedWorkflowSdk,
409
451
  WORKSTREAM_STATES,
@@ -432,6 +474,7 @@ export {
432
474
  canonicalizeFrontmatter,
433
475
  clearMarketSession,
434
476
  collectTreeseedDependencyStatus,
477
+ collectTreeseedHostedServiceChecks,
435
478
  collectTreeseedReconcileStatus,
436
479
  collectTreeseedToolStatus,
437
480
  compileDeclarativeContextQuery,
@@ -447,6 +490,7 @@ export {
447
490
  createReservationReleaseEntry,
448
491
  createTeamScopedR2OverlayContentPublishProvider,
449
492
  createTeamScopedR2OverlayContentRuntimeProvider,
493
+ createTreeDxClientFromAgentOptions,
450
494
  createTreeseedManagedToolEnv,
451
495
  createTreeseedReconcileRegistry,
452
496
  decideAgentOperationPermission,
@@ -457,6 +501,7 @@ export {
457
501
  deniedAgentOperationResult,
458
502
  deployCapacityProviderToManagedMarketHost,
459
503
  deployCapacityProviderToRailway,
504
+ deployRailwayServiceInstance,
460
505
  deriveAvailableCredits,
461
506
  derivePlatformOperationNavigation,
462
507
  derivePlatformRepositoryKey,
@@ -464,10 +509,14 @@ export {
464
509
  deriveProjectLaunchRequirementsViewModel,
465
510
  deriveTreeseedDesiredUnits,
466
511
  destroyTreeseedTargetUnits,
512
+ discoverTreeseedPackageAdapters,
467
513
  dispatchGitHubWorkflowRun,
468
514
  ensureRailwayEnvironment,
515
+ ensureRailwayGeneratedServiceDomain,
469
516
  ensureRailwayProject,
470
517
  ensureRailwayService,
518
+ ensureRailwayServiceInstanceConfiguration,
519
+ ensureRailwayServiceVolume,
471
520
  estimateAttentionForTask,
472
521
  estimateConfidenceFromProfile,
473
522
  estimateForClassification,
@@ -483,6 +532,7 @@ export {
483
532
  findDispatchCapability,
484
533
  findSdkOperation,
485
534
  findTreeseedOperation,
535
+ findTreeseedPackageAdapter,
486
536
  formatGitHubWorkflowFailure,
487
537
  formatTreeseedDependencyReport,
488
538
  getGitHubWorkflowFileStatus,
@@ -490,6 +540,7 @@ export {
490
540
  getRailwayAuthProfile,
491
541
  getTenantContentRoot,
492
542
  getTreeseedVerifyDriverStatus,
543
+ githubRepositoryCredentialEnvName,
493
544
  importKnowledgePack,
494
545
  installTreeseedDependencies,
495
546
  isAgentOperationName,
@@ -501,6 +552,7 @@ export {
501
552
  listIntegratedMarketCatalog,
502
553
  listRailwayEnvironments,
503
554
  listRailwayProjects,
555
+ listRailwayServiceDomains,
504
556
  listRailwayServices,
505
557
  listRailwayVariables,
506
558
  listSdkDispatchCapabilities,
@@ -528,6 +580,7 @@ export {
528
580
  normalizePredictiveReservePolicy,
529
581
  normalizeProjectJobStatus,
530
582
  normalizeProjectLaunchHostBindings,
583
+ normalizeRailwayEnvironmentName,
531
584
  normalizeRecordToCanonicalShape,
532
585
  normalizeRemoteJobStatus,
533
586
  normalizeSortFields,
@@ -536,7 +589,7 @@ export {
536
589
  normalizeTemplateLaunchRequirements,
537
590
  normalizeTreeseedTemplateId,
538
591
  normalizeUtilityPolicy,
539
- observeTreeseedUnits,
592
+ packageAdapterPlanSummary,
540
593
  parseGraphDsl,
541
594
  parseProjectLaunchHostBindingSpecs,
542
595
  parsePublishedCollectionIndex,
@@ -547,6 +600,7 @@ export {
547
600
  planKnowledgeHubLaunch,
548
601
  planKnowledgeHubRepositories,
549
602
  planProjectHostBindingOperation,
603
+ planTreeseedPackageDevelopmentImage,
550
604
  planTreeseedReconciliation,
551
605
  platformContentRelationPolicy,
552
606
  pollPlatformOperation,
@@ -558,11 +612,13 @@ export {
558
612
  railwayGraphqlRequest,
559
613
  rankPlannedTaskNodes,
560
614
  readCanonicalFieldValue,
615
+ readMixProjectVersion,
561
616
  readPublishedContentManifest,
562
617
  readPublishedOverlayManifest,
563
618
  reconcileTreeseedTarget,
564
619
  redactCapacityProviderEnv,
565
620
  redactCapacityProviderSecret,
621
+ refreshTreeseedUnits,
566
622
  removeMarketProfile,
567
623
  renderCapacityProviderSelfHostInstructions,
568
624
  reservationHasCapacity,
@@ -574,6 +630,7 @@ export {
574
630
  resolveCatalogMarketProfiles,
575
631
  resolveCloudflareR2Bucket,
576
632
  resolveDefaultCentralMarketBaseUrl,
633
+ resolveGitHubCredentialForRepository,
577
634
  resolveIntegratedCatalogArtifactDownload,
578
635
  resolveMarketProfile,
579
636
  resolveMarketSession,
@@ -22,8 +22,7 @@ const NPM_TOOLS = [
22
22
  name: "railway",
23
23
  packageName: "@railway/cli",
24
24
  binName: "railway",
25
- version: "4.44.0",
26
- runtimeBinary: (packageRoot) => resolve(packageRoot, "bin", process.platform === "win32" ? "railway.exe" : "railway")
25
+ version: "4.44.0"
27
26
  },
28
27
  { name: "copilot", packageName: "@github/copilot", binName: "copilot", version: "1.0.39" },
29
28
  { name: "copilot-language-server", packageName: "@github/copilot-language-server", binName: "copilot-language-server", version: "1.480.0" }
@@ -1,8 +1,8 @@
1
1
  import type { ApiPrincipal, DeviceCodePollRequest, DeviceCodePollResponse, DeviceCodeStartRequest, DeviceCodeStartResponse, TokenRefreshRequest, TokenRefreshResponse } from './remote.ts';
2
- import type { CreateProjectWebDeploymentRequest, CreateProjectWebDeploymentResponse, ProjectDeployment, ProjectDeploymentActionAvailability, ProjectDeploymentEnvironment, ProjectDeploymentEvent, ProjectDeploymentReadiness, ProjectWebDeploymentAction } from './sdk-types.ts';
2
+ import type { CreateProjectWebDeploymentRequest, CreateProjectWebDeploymentResponse, ProjectDeployment, ProjectDeploymentActionAvailability, ProjectDeploymentEnvironment, ProjectDeploymentEvent, ProjectDeploymentReadiness, ProjectRepositoryTopology, ProjectWebDeploymentAction, TreeDxInstance, TreeDxMirror, TreeDxProjectLibraryBinding, TreeDxShareLink } from './sdk-types.ts';
3
3
  export declare const DEFAULT_TREESEED_MARKET_BASE_URL = "https://api.treeseed.ai";
4
4
  export declare const TREESEED_CENTRAL_MARKET_API_BASE_URL_ENV = "TREESEED_CENTRAL_MARKET_API_BASE_URL";
5
- export declare const TREESEED_MARKET_API_BASE_URL_ENV = "TREESEED_MARKET_API_BASE_URL";
5
+ export declare const TREESEED_API_BASE_URL_ENV = "TREESEED_API_BASE_URL";
6
6
  export declare const TREESEED_CATALOG_MARKET_API_BASE_URLS_ENV = "TREESEED_CATALOG_MARKET_API_BASE_URLS";
7
7
  export type MarketProfileKind = 'central' | 'specialized';
8
8
  export interface MarketProfile {
@@ -155,7 +155,7 @@ export declare function clearMarketSession(tenantRoot: string, marketId?: string
155
155
  };
156
156
  };
157
157
  export declare function resolveCatalogMarketProfiles(selector?: string | null, env?: Record<string, string | undefined>): MarketProfile[];
158
- export declare class MarketApiError extends Error {
158
+ export declare class MarketClientError extends Error {
159
159
  readonly status: number;
160
160
  readonly payload: unknown;
161
161
  constructor(message: string, status: number, payload: unknown);
@@ -369,6 +369,66 @@ export declare class MarketClient {
369
369
  ok: true;
370
370
  payload: Record<string, unknown>;
371
371
  }>;
372
+ teamTreeDx(teamId: string): Promise<{
373
+ ok: true;
374
+ payload: {
375
+ instance: TreeDxInstance | null;
376
+ mirrors: TreeDxMirror[];
377
+ shares: TreeDxShareLink[];
378
+ deployments: unknown[];
379
+ };
380
+ }>;
381
+ updateTeamTreeDx(teamId: string, body: Partial<TreeDxInstance> & Record<string, unknown>): Promise<{
382
+ ok: true;
383
+ payload: {
384
+ instance: TreeDxInstance;
385
+ };
386
+ }>;
387
+ provisionTeamTreeDx(teamId: string, body?: Record<string, unknown>): Promise<{
388
+ ok: true;
389
+ payload: {
390
+ instance: TreeDxInstance | null;
391
+ mirrors: TreeDxMirror[];
392
+ shares: TreeDxShareLink[];
393
+ deployments: unknown[];
394
+ };
395
+ }>;
396
+ treeDxMirrors(teamId: string): Promise<{
397
+ ok: true;
398
+ payload: TreeDxMirror[];
399
+ }>;
400
+ createTreeDxMirror(teamId: string, body: Partial<TreeDxMirror> & Record<string, unknown>): Promise<{
401
+ ok: true;
402
+ payload: TreeDxMirror;
403
+ }>;
404
+ syncTreeDxMirror(teamId: string, mirrorId: string, body?: Record<string, unknown>): Promise<{
405
+ ok: true;
406
+ payload: TreeDxMirror;
407
+ }>;
408
+ treeDxShares(teamId: string): Promise<{
409
+ ok: true;
410
+ payload: TreeDxShareLink[];
411
+ }>;
412
+ createTreeDxShare(teamId: string, body: Partial<TreeDxShareLink> & Record<string, unknown>): Promise<{
413
+ ok: true;
414
+ payload: TreeDxShareLink;
415
+ }>;
416
+ projectTreeDxLibrary(projectId: string): Promise<{
417
+ ok: true;
418
+ payload: TreeDxProjectLibraryBinding | null;
419
+ }>;
420
+ upsertProjectTreeDxLibrary(projectId: string, body: Partial<TreeDxProjectLibraryBinding> & Record<string, unknown>): Promise<{
421
+ ok: true;
422
+ payload: TreeDxProjectLibraryBinding;
423
+ }>;
424
+ projectRepositoryTopology(projectId: string): Promise<{
425
+ ok: true;
426
+ payload: ProjectRepositoryTopology;
427
+ }>;
428
+ updateProjectRepositoryTopology(projectId: string, body: ProjectRepositoryTopology | Record<string, unknown>): Promise<{
429
+ ok: true;
430
+ payload: ProjectRepositoryTopology;
431
+ }>;
372
432
  auditProjectHosts(projectId: string, body?: Record<string, unknown>): Promise<{
373
433
  ok: true;
374
434
  payload: Record<string, unknown>;
@@ -13,7 +13,7 @@ import {
13
13
  } from "./operations/services/config-runtime.js";
14
14
  const DEFAULT_TREESEED_MARKET_BASE_URL = "https://api.treeseed.ai";
15
15
  const TREESEED_CENTRAL_MARKET_API_BASE_URL_ENV = "TREESEED_CENTRAL_MARKET_API_BASE_URL";
16
- const TREESEED_MARKET_API_BASE_URL_ENV = "TREESEED_MARKET_API_BASE_URL";
16
+ const TREESEED_API_BASE_URL_ENV = "TREESEED_API_BASE_URL";
17
17
  const TREESEED_CATALOG_MARKET_API_BASE_URLS_ENV = "TREESEED_CATALOG_MARKET_API_BASE_URLS";
18
18
  const MARKET_REGISTRY_RELATIVE_PATH = ".treeseed/config/markets.json";
19
19
  function envValue(name, env = process.env) {
@@ -38,7 +38,7 @@ function defaultLocalMarket(env = process.env) {
38
38
  id: "local",
39
39
  label: "Local TreeSeed Market",
40
40
  baseUrl: normalizeBaseUrl(
41
- envValue(TREESEED_MARKET_API_BASE_URL_ENV, env) ?? "http://127.0.0.1:3000"
41
+ envValue(TREESEED_API_BASE_URL_ENV, env) ?? "http://127.0.0.1:3000"
42
42
  ),
43
43
  kind: "specialized",
44
44
  alwaysAvailable: true
@@ -228,12 +228,12 @@ function resolveCatalogMarketProfiles(selector, env = process.env) {
228
228
  return left.id.localeCompare(right.id);
229
229
  });
230
230
  }
231
- class MarketApiError extends Error {
231
+ class MarketClientError extends Error {
232
232
  constructor(message, status, payload) {
233
233
  super(message);
234
234
  this.status = status;
235
235
  this.payload = payload;
236
- this.name = "MarketApiError";
236
+ this.name = "MarketClientError";
237
237
  }
238
238
  status;
239
239
  payload;
@@ -274,7 +274,7 @@ class MarketClient {
274
274
  if (!response.ok) {
275
275
  const payloadError = payload.error;
276
276
  const error = typeof payloadError === "string" ? String(payloadError) : payloadError && typeof payloadError === "object" && typeof payloadError.message === "string" ? String(payloadError.message) : `Market request failed with ${response.status}.`;
277
- throw new MarketApiError(error, response.status, payload);
277
+ throw new MarketClientError(error, response.status, payload);
278
278
  }
279
279
  return payload;
280
280
  }
@@ -287,14 +287,14 @@ class MarketClient {
287
287
  try {
288
288
  return await this.request(path, options);
289
289
  } catch (error) {
290
- if (error instanceof MarketApiError && error.status === 404) {
290
+ if (error instanceof MarketClientError && error.status === 404) {
291
291
  notFound = error;
292
292
  continue;
293
293
  }
294
294
  throw error;
295
295
  }
296
296
  }
297
- throw notFound ?? new MarketApiError("Market request failed with 404.", 404, {});
297
+ throw notFound ?? new MarketClientError("Market request failed with 404.", 404, {});
298
298
  }
299
299
  startDeviceLogin(request) {
300
300
  return this.requestFirst(this.localAuthPaths("/v1/auth/device/start", "/auth/device/start"), {
@@ -467,6 +467,78 @@ class MarketClient {
467
467
  { requireAuth: true }
468
468
  );
469
469
  }
470
+ teamTreeDx(teamId) {
471
+ return this.request(
472
+ `/v1/teams/${encodeURIComponent(teamId)}/treedx`,
473
+ { requireAuth: true }
474
+ );
475
+ }
476
+ updateTeamTreeDx(teamId, body) {
477
+ return this.request(
478
+ `/v1/teams/${encodeURIComponent(teamId)}/treedx`,
479
+ { method: "PUT", body, requireAuth: true }
480
+ );
481
+ }
482
+ provisionTeamTreeDx(teamId, body = {}) {
483
+ return this.request(
484
+ `/v1/teams/${encodeURIComponent(teamId)}/treedx/provision`,
485
+ { method: "POST", body, requireAuth: true }
486
+ );
487
+ }
488
+ treeDxMirrors(teamId) {
489
+ return this.request(
490
+ `/v1/teams/${encodeURIComponent(teamId)}/treedx/mirrors`,
491
+ { requireAuth: true }
492
+ );
493
+ }
494
+ createTreeDxMirror(teamId, body) {
495
+ return this.request(
496
+ `/v1/teams/${encodeURIComponent(teamId)}/treedx/mirrors`,
497
+ { method: "POST", body, requireAuth: true }
498
+ );
499
+ }
500
+ syncTreeDxMirror(teamId, mirrorId, body = {}) {
501
+ return this.request(
502
+ `/v1/teams/${encodeURIComponent(teamId)}/treedx/mirrors/${encodeURIComponent(mirrorId)}/sync`,
503
+ { method: "POST", body, requireAuth: true }
504
+ );
505
+ }
506
+ treeDxShares(teamId) {
507
+ return this.request(
508
+ `/v1/teams/${encodeURIComponent(teamId)}/treedx/shares`,
509
+ { requireAuth: true }
510
+ );
511
+ }
512
+ createTreeDxShare(teamId, body) {
513
+ return this.request(
514
+ `/v1/teams/${encodeURIComponent(teamId)}/treedx/shares`,
515
+ { method: "POST", body, requireAuth: true }
516
+ );
517
+ }
518
+ projectTreeDxLibrary(projectId) {
519
+ return this.request(
520
+ `/v1/projects/${encodeURIComponent(projectId)}/treedx-library`,
521
+ { requireAuth: true }
522
+ );
523
+ }
524
+ upsertProjectTreeDxLibrary(projectId, body) {
525
+ return this.request(
526
+ `/v1/projects/${encodeURIComponent(projectId)}/treedx-library`,
527
+ { method: "POST", body, requireAuth: true }
528
+ );
529
+ }
530
+ projectRepositoryTopology(projectId) {
531
+ return this.request(
532
+ `/v1/projects/${encodeURIComponent(projectId)}/repository-topology`,
533
+ { requireAuth: true }
534
+ );
535
+ }
536
+ updateProjectRepositoryTopology(projectId, body) {
537
+ return this.request(
538
+ `/v1/projects/${encodeURIComponent(projectId)}/repository-topology`,
539
+ { method: "PUT", body, requireAuth: true }
540
+ );
541
+ }
470
542
  auditProjectHosts(projectId, body = {}) {
471
543
  return this.request(
472
544
  `/v1/projects/${encodeURIComponent(projectId)}/hosts/audit`,
@@ -698,7 +770,7 @@ async function listIntegratedMarketCatalog({
698
770
  } catch (error) {
699
771
  errors.push({
700
772
  market: profileToSource(profile),
701
- status: error instanceof MarketApiError ? error.status : void 0,
773
+ status: error instanceof MarketClientError ? error.status : void 0,
702
774
  error: error instanceof Error ? error.message : String(error)
703
775
  });
704
776
  }
@@ -732,7 +804,7 @@ async function resolveIntegratedCatalogArtifactDownload({
732
804
  }
733
805
  };
734
806
  } catch (error) {
735
- if (error instanceof MarketApiError && error.status === 404) {
807
+ if (error instanceof MarketClientError && error.status === 404) {
736
808
  continue;
737
809
  }
738
810
  errors.push(`${profile.id}: ${error instanceof Error ? error.message : String(error)}`);
@@ -753,11 +825,11 @@ async function verifyArtifactBytes(response, expectedSha256) {
753
825
  }
754
826
  export {
755
827
  DEFAULT_TREESEED_MARKET_BASE_URL,
756
- MarketApiError,
757
828
  MarketClient,
829
+ MarketClientError,
830
+ TREESEED_API_BASE_URL_ENV,
758
831
  TREESEED_CATALOG_MARKET_API_BASE_URLS_ENV,
759
832
  TREESEED_CENTRAL_MARKET_API_BASE_URL_ENV,
760
- TREESEED_MARKET_API_BASE_URL_ENV,
761
833
  addMarketProfile,
762
834
  clearMarketSession,
763
835
  listIntegratedMarketCatalog,
@@ -24,14 +24,16 @@ export declare function runTreeseedBootstrapDag<TResult = unknown>({ nodes, exec
24
24
  timings?: TreeseedTimingEntry[];
25
25
  }): Promise<Map<string, TResult>>;
26
26
  export declare function sleep(milliseconds: number): Promise<void>;
27
- export declare function runPrefixedCommand(command: string, args: string[], { cwd, env, input, write, prefix, }: {
27
+ export declare function runPrefixedCommand(command: string, args: string[], { cwd, env, input, write, prefix, timeoutMs, }: {
28
28
  cwd: string;
29
29
  env?: NodeJS.ProcessEnv | Record<string, string | undefined>;
30
30
  input?: string;
31
31
  write?: TreeseedBootstrapWriter;
32
32
  prefix: TreeseedBootstrapTaskPrefix;
33
+ timeoutMs?: number;
33
34
  }): Promise<{
34
35
  status: number | null;
35
36
  stdout: string;
36
37
  stderr: string;
38
+ timedOut?: boolean;
37
39
  }>;
@@ -99,7 +99,8 @@ async function runPrefixedCommand(command, args, {
99
99
  env = process.env,
100
100
  input,
101
101
  write,
102
- prefix
102
+ prefix,
103
+ timeoutMs
103
104
  }) {
104
105
  return await new Promise((resolvePromise, reject) => {
105
106
  const childEnv = {};
@@ -117,6 +118,19 @@ async function runPrefixedCommand(command, args, {
117
118
  let stderr = "";
118
119
  let stdoutBuffer = "";
119
120
  let stderrBuffer = "";
121
+ let timedOut = false;
122
+ let forceKillTimer = null;
123
+ const timeoutTimer = Number.isFinite(timeoutMs) && Number(timeoutMs) > 0 ? setTimeout(() => {
124
+ timedOut = true;
125
+ const message = `Command timed out after ${Math.round(Number(timeoutMs) / 1e3)}s: ${command} ${args.join(" ")}`;
126
+ stderr += `${stderr.endsWith("\n") || stderr.length === 0 ? "" : "\n"}${message}
127
+ `;
128
+ stderrBuffer += `${stderrBuffer.endsWith("\n") || stderrBuffer.length === 0 ? "" : "\n"}${message}
129
+ `;
130
+ flush("stderr");
131
+ child.kill("SIGTERM");
132
+ forceKillTimer = setTimeout(() => child.kill("SIGKILL"), 5e3);
133
+ }, Number(timeoutMs)) : null;
120
134
  const flush = (stream, force = false) => {
121
135
  let buffer = stream === "stdout" ? stdoutBuffer : stderrBuffer;
122
136
  let newlineIndex = buffer.search(/\r?\n/u);
@@ -150,9 +164,15 @@ async function runPrefixedCommand(command, args, {
150
164
  });
151
165
  child.on("error", reject);
152
166
  child.on("close", (status) => {
167
+ if (timeoutTimer) {
168
+ clearTimeout(timeoutTimer);
169
+ }
170
+ if (forceKillTimer) {
171
+ clearTimeout(forceKillTimer);
172
+ }
153
173
  flush("stdout", true);
154
174
  flush("stderr", true);
155
- resolvePromise({ status, stdout, stderr });
175
+ resolvePromise({ status, stdout, stderr, ...timedOut ? { timedOut: true } : {} });
156
176
  });
157
177
  if (input !== void 0) {
158
178
  child.stdin.end(input);