@treeseed/sdk 0.10.27 → 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.
- package/README.md +207 -6
- package/dist/capacity-provider.d.ts +3 -1
- package/dist/capacity-provider.js +25 -5
- package/dist/control-plane.d.ts +1 -0
- package/dist/control-plane.js +38 -13
- package/dist/db/market-schema.d.ts +8860 -6172
- package/dist/db/market-schema.js +108 -0
- package/dist/db/node-sqlite.js +7 -2
- package/dist/hosting/apps.d.ts +12 -0
- package/dist/hosting/apps.js +107 -0
- package/dist/hosting/builtins.d.ts +25 -0
- package/dist/hosting/builtins.js +791 -0
- package/dist/hosting/contracts.d.ts +207 -0
- package/dist/hosting/contracts.js +0 -0
- package/dist/hosting/graph.d.ts +192 -0
- package/dist/hosting/graph.js +1106 -0
- package/dist/hosting/index.d.ts +4 -0
- package/dist/hosting/index.js +4 -0
- package/dist/index.d.ts +11 -4
- package/dist/index.js +71 -7
- package/dist/managed-dependencies.js +1 -2
- package/dist/market-client.d.ts +63 -3
- package/dist/market-client.js +83 -11
- package/dist/operations/services/bootstrap-runner.d.ts +3 -1
- package/dist/operations/services/bootstrap-runner.js +22 -2
- package/dist/operations/services/config-runtime.d.ts +10 -5
- package/dist/operations/services/config-runtime.js +209 -66
- package/dist/operations/services/deploy.d.ts +70 -7
- package/dist/operations/services/deploy.js +579 -64
- package/dist/operations/services/deployment-readiness.d.ts +30 -0
- package/dist/operations/services/deployment-readiness.js +175 -0
- package/dist/operations/services/git-workflow.d.ts +2 -1
- package/dist/operations/services/git-workflow.js +9 -3
- package/dist/operations/services/github-actions-verification.d.ts +1 -0
- package/dist/operations/services/github-actions-verification.js +1 -0
- package/dist/operations/services/github-api.js +1 -1
- package/dist/operations/services/github-automation.d.ts +1 -1
- package/dist/operations/services/github-automation.js +4 -3
- package/dist/operations/services/github-credentials.d.ts +13 -0
- package/dist/operations/services/github-credentials.js +58 -0
- package/dist/operations/services/hosted-service-checks.d.ts +63 -0
- package/dist/operations/services/hosted-service-checks.js +327 -0
- package/dist/operations/services/hub-provider-launch.js +3 -3
- package/dist/operations/services/live-hosted-service-checks.d.ts +25 -0
- package/dist/operations/services/live-hosted-service-checks.js +350 -0
- package/dist/operations/services/managed-host-security.js +1 -1
- package/dist/operations/services/operations-runner-smoke.d.ts +30 -0
- package/dist/operations/services/operations-runner-smoke.js +180 -0
- package/dist/operations/services/package-adapters.d.ts +95 -0
- package/dist/operations/services/package-adapters.js +288 -0
- package/dist/operations/services/package-reference-policy.d.ts +1 -0
- package/dist/operations/services/package-reference-policy.js +15 -2
- package/dist/operations/services/project-platform.d.ts +80 -22
- package/dist/operations/services/project-platform.js +49 -8
- package/dist/operations/services/project-web-monitor.js +26 -4
- package/dist/operations/services/railway-api.d.ts +88 -5
- package/dist/operations/services/railway-api.js +626 -35
- package/dist/operations/services/railway-deploy.d.ts +46 -40
- package/dist/operations/services/railway-deploy.js +261 -293
- package/dist/operations/services/release-candidate.d.ts +19 -0
- package/dist/operations/services/release-candidate.js +375 -38
- package/dist/operations/services/repository-save-orchestrator.d.ts +3 -1
- package/dist/operations/services/repository-save-orchestrator.js +279 -66
- package/dist/operations/services/runtime-tools.d.ts +1 -0
- package/dist/operations/services/runtime-tools.js +10 -9
- package/dist/operations/services/template-registry.js +14 -7
- package/dist/operations/services/verification-cache.d.ts +25 -0
- package/dist/operations/services/verification-cache.js +71 -0
- package/dist/operations/services/workspace-dependency-mode.js +9 -1
- package/dist/operations/services/workspace-save.js +1 -1
- package/dist/operations/services/workspace-tools.js +2 -1
- package/dist/platform/contracts.d.ts +32 -1
- package/dist/platform/deploy-config.js +73 -8
- package/dist/platform/env.yaml +163 -35
- package/dist/platform/environment.d.ts +1 -0
- package/dist/platform/environment.js +74 -5
- package/dist/platform/plugin.d.ts +9 -0
- package/dist/platform-operation-store.js +2 -2
- package/dist/platform-operations.js +1 -1
- package/dist/reconcile/bootstrap-systems.js +2 -2
- package/dist/reconcile/builtin-adapters.js +372 -189
- package/dist/reconcile/contracts.d.ts +9 -5
- package/dist/reconcile/desired-state.d.ts +1 -0
- package/dist/reconcile/desired-state.js +5 -5
- package/dist/reconcile/engine.d.ts +5 -2
- package/dist/reconcile/engine.js +53 -32
- package/dist/reconcile/index.d.ts +2 -0
- package/dist/reconcile/index.js +2 -0
- package/dist/reconcile/live-acceptance.d.ts +79 -0
- package/dist/reconcile/live-acceptance.js +1615 -0
- package/dist/reconcile/platform.d.ts +104 -0
- package/dist/reconcile/platform.js +100 -0
- package/dist/reconcile/state.js +4 -4
- package/dist/reconcile/units.js +2 -2
- package/dist/scripts/deployment-readiness.js +20 -0
- package/dist/scripts/generate-treedx-openapi-types.js +186 -0
- package/dist/scripts/operations-runner-smoke.js +16 -0
- package/dist/scripts/release-verify.js +4 -1
- package/dist/scripts/template-catalog.test.js +7 -7
- package/dist/scripts/tenant-workflow-action.js +10 -1
- package/dist/sdk-types.d.ts +172 -5
- package/dist/sdk-types.js +28 -3
- package/dist/sdk.d.ts +35 -24
- package/dist/sdk.js +186 -17
- package/dist/template-launch-requirements.js +9 -0
- package/dist/treedx/adapters.d.ts +6 -0
- package/dist/treedx/adapters.js +36 -0
- package/dist/treedx/client.d.ts +222 -0
- package/dist/treedx/client.js +871 -0
- package/dist/treedx/errors.d.ts +13 -0
- package/dist/treedx/errors.js +17 -0
- package/dist/treedx/federated-client.d.ts +27 -0
- package/dist/treedx/federated-client.js +158 -0
- package/dist/treedx/generated/openapi-types.d.ts +3558 -0
- package/dist/treedx/generated/openapi-types.js +0 -0
- package/dist/treedx/graph-adapter.d.ts +33 -0
- package/dist/treedx/graph-adapter.js +156 -0
- package/dist/treedx/index.d.ts +14 -0
- package/dist/treedx/index.js +48 -0
- package/dist/treedx/market-integration.d.ts +27 -0
- package/dist/treedx/market-integration.js +131 -0
- package/dist/treedx/ports.d.ts +166 -0
- package/dist/treedx/ports.js +231 -0
- package/dist/treedx/query-adapter.d.ts +19 -0
- package/dist/treedx/query-adapter.js +62 -0
- package/dist/treedx/registry-client.d.ts +11 -0
- package/dist/treedx/registry-client.js +19 -0
- package/dist/treedx/repository-adapter.d.ts +45 -0
- package/dist/treedx/repository-adapter.js +308 -0
- package/dist/treedx/sdk-integration.d.ts +27 -0
- package/dist/treedx/sdk-integration.js +63 -0
- package/dist/treedx/types.d.ts +1084 -0
- package/dist/treedx/types.js +8 -0
- package/dist/treedx/workspace-adapter.d.ts +27 -0
- package/dist/treedx/workspace-adapter.js +65 -0
- package/dist/treedx-backends.d.ts +218 -0
- package/dist/treedx-backends.js +632 -0
- package/dist/treedx-client.d.ts +86 -0
- package/dist/treedx-client.js +175 -0
- package/dist/treeseed/template-catalog/catalog.fixture.json +497 -138
- package/dist/workflow/operations.d.ts +119 -13
- package/dist/workflow/operations.js +309 -53
- package/dist/workflow-state.d.ts +13 -0
- package/dist/workflow-state.js +43 -26
- package/dist/workflow-support.d.ts +11 -3
- package/dist/workflow-support.js +67 -3
- package/dist/workflow.d.ts +5 -0
- package/drizzle/market/0004_treedx_market_integration.sql +99 -0
- package/package.json +34 -3
- package/templates/github/deploy-web.workflow.yml +39 -6
- package/dist/treeseed/template-catalog/templates/starter-basic/template/astro.config.d.ts +0 -3
- package/dist/treeseed/template-catalog/templates/starter-basic/template/astro.config.ts +0 -6
- package/dist/treeseed/template-catalog/templates/starter-basic/template/package.json +0 -35
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/api/server.js +0 -4
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/config.yaml +0 -65
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/content/decisions/adopt-initial-proposal-loop.mdx +0 -22
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/content/empty/.gitkeep +0 -1
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/content/knowledge/handbook/index.mdx +0 -11
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/content/pages/welcome.mdx +0 -11
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/content/people/starter-steward.mdx +0 -11
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/content/proposals/establish-initial-proposal-loop.mdx +0 -17
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/content.config.d.ts +0 -1
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/content.config.ts +0 -3
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/env.yaml +0 -1
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/manifest.yaml +0 -26
- package/dist/treeseed/template-catalog/templates/starter-basic/template/treeseed.site.yaml +0 -74
- package/dist/treeseed/template-catalog/templates/starter-basic/template/tsconfig.json +0 -9
- package/dist/treeseed/template-catalog/templates/starter-basic/template.config.json +0 -103
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
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';
|
|
3
|
-
export
|
|
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';
|
|
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';
|
|
6
10
|
export * from './seeds/index.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,
|
|
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,
|
|
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,6 +1,24 @@
|
|
|
1
1
|
import { AgentSdk, ScopedAgentSdk } from "./sdk.js";
|
|
2
2
|
import { ContentGraphRuntime } from "./graph.js";
|
|
3
|
-
|
|
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";
|
|
16
|
+
import {
|
|
17
|
+
TREESEED_DEFAULT_STARTER_TEMPLATE_ID,
|
|
18
|
+
TREESEED_TEMPLATE_ID_ALIASES,
|
|
19
|
+
normalizeTreeseedTemplateId,
|
|
20
|
+
projectConnectionModeFromHosting
|
|
21
|
+
} from "./sdk-types.js";
|
|
4
22
|
import { createControlPlaneReporter } from "./control-plane.js";
|
|
5
23
|
import { ControlPlaneClient } from "./control-plane-client.js";
|
|
6
24
|
export * from "./seeds/index.js";
|
|
@@ -64,9 +82,19 @@ import {
|
|
|
64
82
|
getLatestGitHubWorkflowRun,
|
|
65
83
|
waitForGitHubWorkflowRunCompletion
|
|
66
84
|
} from "./operations/services/github-api.js";
|
|
85
|
+
import {
|
|
86
|
+
collectTreeseedHostedServiceChecks
|
|
87
|
+
} from "./operations/services/hosted-service-checks.js";
|
|
67
88
|
import {
|
|
68
89
|
buildProjectWebMonitorResult
|
|
69
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";
|
|
70
98
|
import {
|
|
71
99
|
DEFAULT_EXECUTION_PROFILE_ID,
|
|
72
100
|
DEFAULT_EXECUTION_PROFILES,
|
|
@@ -116,6 +144,10 @@ import {
|
|
|
116
144
|
summarizeTeamCapacityPlan,
|
|
117
145
|
validateTaskPlanProposal
|
|
118
146
|
} from "./capacity.js";
|
|
147
|
+
import {
|
|
148
|
+
githubRepositoryCredentialEnvName,
|
|
149
|
+
resolveGitHubCredentialForRepository
|
|
150
|
+
} from "./operations/services/github-credentials.js";
|
|
119
151
|
import {
|
|
120
152
|
executeKnowledgeHubProviderLaunch,
|
|
121
153
|
validateKnowledgeHubProviderLaunchPrerequisites
|
|
@@ -130,14 +162,20 @@ import {
|
|
|
130
162
|
validateRepositoryHost
|
|
131
163
|
} from "./operations/services/hub-launch.js";
|
|
132
164
|
import {
|
|
165
|
+
deployRailwayServiceInstance,
|
|
133
166
|
ensureRailwayEnvironment,
|
|
167
|
+
ensureRailwayGeneratedServiceDomain,
|
|
134
168
|
ensureRailwayProject,
|
|
135
169
|
ensureRailwayService,
|
|
170
|
+
ensureRailwayServiceInstanceConfiguration,
|
|
171
|
+
ensureRailwayServiceVolume,
|
|
136
172
|
getRailwayAuthProfile,
|
|
137
173
|
listRailwayEnvironments,
|
|
138
174
|
listRailwayProjects,
|
|
175
|
+
listRailwayServiceDomains,
|
|
139
176
|
listRailwayServices,
|
|
140
177
|
listRailwayVariables,
|
|
178
|
+
normalizeRailwayEnvironmentName,
|
|
141
179
|
railwayGraphqlRequest,
|
|
142
180
|
resolveRailwayApiToken,
|
|
143
181
|
resolveRailwayApiUrl,
|
|
@@ -286,11 +324,11 @@ import {
|
|
|
286
324
|
} from "./operations/services/project-host-operations.js";
|
|
287
325
|
import {
|
|
288
326
|
MarketClient,
|
|
289
|
-
|
|
327
|
+
MarketClientError,
|
|
290
328
|
DEFAULT_TREESEED_MARKET_BASE_URL,
|
|
291
329
|
TREESEED_CATALOG_MARKET_API_BASE_URLS_ENV,
|
|
292
330
|
TREESEED_CENTRAL_MARKET_API_BASE_URL_ENV,
|
|
293
|
-
|
|
331
|
+
TREESEED_API_BASE_URL_ENV,
|
|
294
332
|
addMarketProfile,
|
|
295
333
|
clearMarketSession,
|
|
296
334
|
listIntegratedMarketCatalog,
|
|
@@ -332,8 +370,8 @@ import {
|
|
|
332
370
|
createTreeseedReconcileRegistry,
|
|
333
371
|
deriveTreeseedDesiredUnits,
|
|
334
372
|
destroyTreeseedTargetUnits,
|
|
335
|
-
observeTreeseedUnits,
|
|
336
373
|
planTreeseedReconciliation,
|
|
374
|
+
refreshTreeseedUnits,
|
|
337
375
|
reconcileTreeseedTarget
|
|
338
376
|
} from "./reconcile/index.js";
|
|
339
377
|
import { getTreeseedVerifyDriverStatus, runTreeseedVerifyDriver } from "./verification.js";
|
|
@@ -361,9 +399,12 @@ export {
|
|
|
361
399
|
DEFAULT_TASK_ADMISSION_POLICY,
|
|
362
400
|
DEFAULT_TREESEED_MARKET_BASE_URL,
|
|
363
401
|
EDITORIAL_PREVIEW_COOKIE,
|
|
402
|
+
LocalContentBackend,
|
|
403
|
+
LocalExecBackend,
|
|
404
|
+
LocalGraphBackend,
|
|
364
405
|
MODEL_REGISTRY,
|
|
365
|
-
MarketApiError,
|
|
366
406
|
MarketClient,
|
|
407
|
+
MarketClientError,
|
|
367
408
|
MarketProviderClient,
|
|
368
409
|
PLATFORM_CONTENT_COLLECTIONS,
|
|
369
410
|
PLATFORM_OPERATION_ENDPOINTS,
|
|
@@ -389,15 +430,22 @@ export {
|
|
|
389
430
|
RemoteTreeseedSdkClient,
|
|
390
431
|
SHARE_PACKAGE_STATES,
|
|
391
432
|
ScopedAgentSdk,
|
|
433
|
+
TREESEED_API_BASE_URL_ENV,
|
|
392
434
|
TREESEED_CATALOG_MARKET_API_BASE_URLS_ENV,
|
|
393
435
|
TREESEED_CENTRAL_MARKET_API_BASE_URL_ENV,
|
|
394
436
|
TREESEED_DEFAULT_STARTER_TEMPLATE_ID,
|
|
395
|
-
TREESEED_MARKET_API_BASE_URL_ENV,
|
|
396
437
|
TREESEED_REMOTE_CONTRACT_HEADER,
|
|
397
438
|
TREESEED_REMOTE_CONTRACT_VERSION,
|
|
439
|
+
TREESEED_TEMPLATE_ID_ALIASES,
|
|
398
440
|
TRESEED_OPERATION_SPECS,
|
|
399
441
|
TeamScopedR2OverlayContentPublishProvider,
|
|
400
442
|
TeamScopedR2OverlayContentRuntimeProvider,
|
|
443
|
+
TreeDxApiError,
|
|
444
|
+
TreeDxContentBackend,
|
|
445
|
+
TreeDxContentRepositoryConfigError,
|
|
446
|
+
TreeDxExecBackend,
|
|
447
|
+
TreeDxGraphBackend,
|
|
448
|
+
TreeDxPortfolioResolver,
|
|
401
449
|
TreeseedOperationsSdk,
|
|
402
450
|
TreeseedWorkflowSdk,
|
|
403
451
|
WORKSTREAM_STATES,
|
|
@@ -426,6 +474,7 @@ export {
|
|
|
426
474
|
canonicalizeFrontmatter,
|
|
427
475
|
clearMarketSession,
|
|
428
476
|
collectTreeseedDependencyStatus,
|
|
477
|
+
collectTreeseedHostedServiceChecks,
|
|
429
478
|
collectTreeseedReconcileStatus,
|
|
430
479
|
collectTreeseedToolStatus,
|
|
431
480
|
compileDeclarativeContextQuery,
|
|
@@ -441,6 +490,7 @@ export {
|
|
|
441
490
|
createReservationReleaseEntry,
|
|
442
491
|
createTeamScopedR2OverlayContentPublishProvider,
|
|
443
492
|
createTeamScopedR2OverlayContentRuntimeProvider,
|
|
493
|
+
createTreeDxClientFromAgentOptions,
|
|
444
494
|
createTreeseedManagedToolEnv,
|
|
445
495
|
createTreeseedReconcileRegistry,
|
|
446
496
|
decideAgentOperationPermission,
|
|
@@ -451,6 +501,7 @@ export {
|
|
|
451
501
|
deniedAgentOperationResult,
|
|
452
502
|
deployCapacityProviderToManagedMarketHost,
|
|
453
503
|
deployCapacityProviderToRailway,
|
|
504
|
+
deployRailwayServiceInstance,
|
|
454
505
|
deriveAvailableCredits,
|
|
455
506
|
derivePlatformOperationNavigation,
|
|
456
507
|
derivePlatformRepositoryKey,
|
|
@@ -458,10 +509,14 @@ export {
|
|
|
458
509
|
deriveProjectLaunchRequirementsViewModel,
|
|
459
510
|
deriveTreeseedDesiredUnits,
|
|
460
511
|
destroyTreeseedTargetUnits,
|
|
512
|
+
discoverTreeseedPackageAdapters,
|
|
461
513
|
dispatchGitHubWorkflowRun,
|
|
462
514
|
ensureRailwayEnvironment,
|
|
515
|
+
ensureRailwayGeneratedServiceDomain,
|
|
463
516
|
ensureRailwayProject,
|
|
464
517
|
ensureRailwayService,
|
|
518
|
+
ensureRailwayServiceInstanceConfiguration,
|
|
519
|
+
ensureRailwayServiceVolume,
|
|
465
520
|
estimateAttentionForTask,
|
|
466
521
|
estimateConfidenceFromProfile,
|
|
467
522
|
estimateForClassification,
|
|
@@ -477,6 +532,7 @@ export {
|
|
|
477
532
|
findDispatchCapability,
|
|
478
533
|
findSdkOperation,
|
|
479
534
|
findTreeseedOperation,
|
|
535
|
+
findTreeseedPackageAdapter,
|
|
480
536
|
formatGitHubWorkflowFailure,
|
|
481
537
|
formatTreeseedDependencyReport,
|
|
482
538
|
getGitHubWorkflowFileStatus,
|
|
@@ -484,6 +540,7 @@ export {
|
|
|
484
540
|
getRailwayAuthProfile,
|
|
485
541
|
getTenantContentRoot,
|
|
486
542
|
getTreeseedVerifyDriverStatus,
|
|
543
|
+
githubRepositoryCredentialEnvName,
|
|
487
544
|
importKnowledgePack,
|
|
488
545
|
installTreeseedDependencies,
|
|
489
546
|
isAgentOperationName,
|
|
@@ -495,6 +552,7 @@ export {
|
|
|
495
552
|
listIntegratedMarketCatalog,
|
|
496
553
|
listRailwayEnvironments,
|
|
497
554
|
listRailwayProjects,
|
|
555
|
+
listRailwayServiceDomains,
|
|
498
556
|
listRailwayServices,
|
|
499
557
|
listRailwayVariables,
|
|
500
558
|
listSdkDispatchCapabilities,
|
|
@@ -522,14 +580,16 @@ export {
|
|
|
522
580
|
normalizePredictiveReservePolicy,
|
|
523
581
|
normalizeProjectJobStatus,
|
|
524
582
|
normalizeProjectLaunchHostBindings,
|
|
583
|
+
normalizeRailwayEnvironmentName,
|
|
525
584
|
normalizeRecordToCanonicalShape,
|
|
526
585
|
normalizeRemoteJobStatus,
|
|
527
586
|
normalizeSortFields,
|
|
528
587
|
normalizeTaskAdmissionPolicy,
|
|
529
588
|
normalizeTaskPlanProposal,
|
|
530
589
|
normalizeTemplateLaunchRequirements,
|
|
590
|
+
normalizeTreeseedTemplateId,
|
|
531
591
|
normalizeUtilityPolicy,
|
|
532
|
-
|
|
592
|
+
packageAdapterPlanSummary,
|
|
533
593
|
parseGraphDsl,
|
|
534
594
|
parseProjectLaunchHostBindingSpecs,
|
|
535
595
|
parsePublishedCollectionIndex,
|
|
@@ -540,6 +600,7 @@ export {
|
|
|
540
600
|
planKnowledgeHubLaunch,
|
|
541
601
|
planKnowledgeHubRepositories,
|
|
542
602
|
planProjectHostBindingOperation,
|
|
603
|
+
planTreeseedPackageDevelopmentImage,
|
|
543
604
|
planTreeseedReconciliation,
|
|
544
605
|
platformContentRelationPolicy,
|
|
545
606
|
pollPlatformOperation,
|
|
@@ -551,11 +612,13 @@ export {
|
|
|
551
612
|
railwayGraphqlRequest,
|
|
552
613
|
rankPlannedTaskNodes,
|
|
553
614
|
readCanonicalFieldValue,
|
|
615
|
+
readMixProjectVersion,
|
|
554
616
|
readPublishedContentManifest,
|
|
555
617
|
readPublishedOverlayManifest,
|
|
556
618
|
reconcileTreeseedTarget,
|
|
557
619
|
redactCapacityProviderEnv,
|
|
558
620
|
redactCapacityProviderSecret,
|
|
621
|
+
refreshTreeseedUnits,
|
|
559
622
|
removeMarketProfile,
|
|
560
623
|
renderCapacityProviderSelfHostInstructions,
|
|
561
624
|
reservationHasCapacity,
|
|
@@ -567,6 +630,7 @@ export {
|
|
|
567
630
|
resolveCatalogMarketProfiles,
|
|
568
631
|
resolveCloudflareR2Bucket,
|
|
569
632
|
resolveDefaultCentralMarketBaseUrl,
|
|
633
|
+
resolveGitHubCredentialForRepository,
|
|
570
634
|
resolveIntegratedCatalogArtifactDownload,
|
|
571
635
|
resolveMarketProfile,
|
|
572
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" }
|
package/dist/market-client.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
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>;
|
package/dist/market-client.js
CHANGED
|
@@ -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
|
|
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(
|
|
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
|
|
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 = "
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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);
|