@treeseed/sdk 0.8.8 → 0.8.10
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/dist/control-plane-client.d.ts +1 -1
- package/dist/d1-store.d.ts +5 -5
- package/dist/d1-store.js +24 -24
- package/dist/db/d1.d.ts +102 -0
- package/dist/db/node-sqlite.d.ts +102 -0
- package/dist/db/schema.d.ts +204 -0
- package/dist/db/schema.js +9 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +22 -22
- package/dist/operations/services/d1-migration.js +10 -2
- package/dist/operations/services/github-automation.js +1 -1
- package/dist/operations/services/hosting-audit.d.ts +2 -1
- package/dist/operations/services/hosting-audit.js +18 -15
- package/dist/operations/services/hub-provider-launch.d.ts +3 -3
- package/dist/operations/services/hub-provider-launch.js +16 -16
- package/dist/operations/services/{knowledge-coop-packaging.d.ts → market-packaging.d.ts} +13 -13
- package/dist/operations/services/{knowledge-coop-packaging.js → market-packaging.js} +10 -10
- package/dist/operations/services/project-platform.d.ts +32 -0
- package/dist/operations/services/project-platform.js +91 -1
- package/dist/platform/books-data.js +2 -2
- package/dist/platform/contracts.d.ts +53 -31
- package/dist/platform/utils/site-config-schema.js +120 -52
- package/dist/{knowledge-coop.d.ts → project-workflow.d.ts} +15 -15
- package/dist/{knowledge-coop.js → project-workflow.js} +15 -15
- package/dist/scripts/tenant-d1-migrate-local.js +1 -0
- package/dist/sdk.d.ts +1 -1
- package/dist/stores/{knowledge-coop-store.d.ts → project-workflow-store.d.ts} +3 -3
- package/dist/stores/{knowledge-coop-store.js → project-workflow-store.js} +4 -4
- package/dist/workflow/operations.js +6 -6
- package/dist/workflow-state.js +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ export { reservationHasCapacity, reserveCreditsForEstimate, routeAndReserveCapac
|
|
|
7
7
|
export { executeKnowledgeHubProviderLaunch, validateKnowledgeHubProviderLaunchPrerequisites, } from './operations/services/hub-provider-launch.ts';
|
|
8
8
|
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';
|
|
9
9
|
export { ensureRailwayEnvironment, ensureRailwayProject, ensureRailwayService, getRailwayAuthProfile, listRailwayEnvironments, listRailwayProjects, listRailwayServices, listRailwayVariables, railwayGraphqlRequest, resolveRailwayApiToken, resolveRailwayApiUrl, resolveRailwayWorkspace, resolveRailwayWorkspaceContext, upsertRailwayVariables, } from './operations/services/railway-api.ts';
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
10
|
+
export { buildKnowledgePackMarketPackage, buildTemplateMarketPackage, importKnowledgePack, } from './operations/services/market-packaging.ts';
|
|
11
|
+
export { AGENT_MESSAGE_KINDS, PROJECT_JOB_STATUSES, RELEASE_STATES, SHARE_PACKAGE_STATES, PROJECT_TEAM_CAPABILITIES, WORKSTREAM_STATES, normalizeProjectJobStatus, normalizeRemoteJobStatus, } from './project-workflow.ts';
|
|
12
12
|
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';
|
|
13
13
|
export { createFilesystemContentSource, createPublishedContentPipeline, } from './platform/published-content-pipeline.ts';
|
|
14
14
|
export { loadTreeseedManifest, loadTreeseedTenantManifest, resolveTreeseedTenantRoot, getTenantContentRoot, tenantFeatureEnabled, tenantModelRendered, } from './platform/tenant-config.ts';
|
|
@@ -32,8 +32,8 @@ export { TreeseedWorkflowSdk } from './workflow.ts';
|
|
|
32
32
|
export * from './db/index.ts';
|
|
33
33
|
export { collectTreeseedReconcileStatus, createTreeseedReconcileRegistry, deriveTreeseedDesiredUnits, destroyTreeseedTargetUnits, observeTreeseedUnits, planTreeseedReconciliation, reconcileTreeseedTarget, } from './reconcile/index.ts';
|
|
34
34
|
export { getTreeseedVerifyDriverStatus, runTreeseedVerifyDriver } from './verification.ts';
|
|
35
|
-
export type { KnowledgeHubProviderLaunchPreflightReport, KnowledgeHubProviderLaunchFailurePhase, KnowledgeHubProviderLaunchInput, KnowledgeHubProviderLaunchResult, AgentMessageKind, AgentMessageRecord, AgentStatusRecord, DirectBoardItemSummary, InboxItem,
|
|
36
|
-
export type * from './
|
|
35
|
+
export type { KnowledgeHubProviderLaunchPreflightReport, KnowledgeHubProviderLaunchFailurePhase, KnowledgeHubProviderLaunchInput, KnowledgeHubProviderLaunchResult, AgentMessageKind, AgentMessageRecord, AgentStatusRecord, DirectBoardItemSummary, InboxItem, ProjectJobStatus, LaunchProjectRequest, LaunchProjectResult, 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, SdkUpdateRequest, ProjectCapabilityGrant, ProjectConnection, ProjectConnectionMode, ProjectDeployment, ProjectDeploymentKind, ProjectDeploymentStatus, ProjectEnvironment, ProjectExecutionOwner, 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, CapacityBusinessModel, CapacityGrant, CapacityGrantScope, CapacityLedgerEntry, CapacityLaneUnit, CapacityPlan, CapacityProvider, CapacityProviderHost, CapacityProviderKind, CapacityProviderLane, CapacityReservation, CapacityRoutingDecision, CapacityTaskExecutionEnvelope, CreateApprovalRequestRequest, CreateCapacityReservationRequest, CreateCapacityRoutingDecisionRequest, CreateTaskEstimateRequest, CreateTaskUsageActualRequest, RecordCapacityUsageRequest, TaskEstimate, TaskEstimateProfile, TaskUsageActual, UpsertCapacityGrantRequest, UpsertCapacityProviderHostRequest, UpsertCapacityProviderLaneRequest, UpsertCapacityProviderRequest, ScaleDecision, RunnerScaleDecision, TeamStorageLocator, TeamWebHost, TeamWebHostOwnership, TeamWebHostProvider, EncryptedWebHostPayload, UpsertAgentPoolRequest, UpsertCatalogArtifactVersionRequest, UpsertCatalogItemRequest, UpsertProjectEnvironmentRequest, UpsertProjectHostingRequest, UpsertProjectInfrastructureResourceRequest, UpsertTeamStorageLocatorRequest, UpsertTeamWebHostRequest, CreateProjectDeploymentRequest, RecordAgentPoolRegistrationRequest, SdkCreateWorkdayRequest, SdkClaimWorkdayManagerLeaseRequest, SdkReleaseWorkdayManagerLeaseRequest, SdkRecordWorkerRunnerRequest, SdkRecordRepositoryClaimRequest, SdkRecordRunnerScaleDecisionRequest, SdkUpdateWorkDayGraphRequest, WorkerPoolScaleResult, WorkerPoolScaler, } from './sdk-types.ts';
|
|
36
|
+
export type * from './project-workflow.ts';
|
|
37
37
|
export type { ControlPlaneAgentPoolHeartbeat, ControlPlaneDeploymentReport, ControlPlaneEnvironmentReport, ControlPlaneReporter, ControlPlaneReporterKind, ControlPlaneResourceReport, ControlPlaneScaleDecisionReport, ControlPlaneWorkdaySummaryReport, } from './control-plane.ts';
|
|
38
38
|
export type { ControlPlaneClientOptions } from './control-plane-client.ts';
|
|
39
39
|
export type { CapacityEstimateInput, CapacityLaneCandidate, CapacityLaneScore, } from './capacity.ts';
|
package/dist/index.js
CHANGED
|
@@ -45,20 +45,20 @@ import {
|
|
|
45
45
|
upsertRailwayVariables
|
|
46
46
|
} from "./operations/services/railway-api.js";
|
|
47
47
|
import {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
} from "./operations/services/
|
|
48
|
+
buildKnowledgePackMarketPackage,
|
|
49
|
+
buildTemplateMarketPackage,
|
|
50
|
+
importKnowledgePack
|
|
51
|
+
} from "./operations/services/market-packaging.js";
|
|
52
52
|
import {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
AGENT_MESSAGE_KINDS,
|
|
54
|
+
PROJECT_JOB_STATUSES,
|
|
55
|
+
RELEASE_STATES,
|
|
56
|
+
SHARE_PACKAGE_STATES,
|
|
57
|
+
PROJECT_TEAM_CAPABILITIES,
|
|
58
|
+
WORKSTREAM_STATES,
|
|
59
|
+
normalizeProjectJobStatus,
|
|
60
60
|
normalizeRemoteJobStatus
|
|
61
|
-
} from "./
|
|
61
|
+
} from "./project-workflow.js";
|
|
62
62
|
import {
|
|
63
63
|
PUBLISHED_CONTENT_MANIFEST_SCHEMA_VERSION,
|
|
64
64
|
EDITORIAL_PREVIEW_COOKIE,
|
|
@@ -199,6 +199,7 @@ import {
|
|
|
199
199
|
import { getTreeseedVerifyDriverStatus, runTreeseedVerifyDriver } from "./verification.js";
|
|
200
200
|
import { CloudflareHttpD1Database } from "./d1-http.js";
|
|
201
201
|
export {
|
|
202
|
+
AGENT_MESSAGE_KINDS,
|
|
202
203
|
AgentSdk,
|
|
203
204
|
BUILTIN_MODEL_REGISTRY,
|
|
204
205
|
CloudflareHttpD1Database,
|
|
@@ -209,16 +210,13 @@ export {
|
|
|
209
210
|
DEFAULT_GRAPH_RANKING_PROVIDER,
|
|
210
211
|
DEFAULT_TREESEED_MARKET_BASE_URL,
|
|
211
212
|
EDITORIAL_PREVIEW_COOKIE,
|
|
212
|
-
KNOWLEDGE_COOP_AGENT_MESSAGE_KINDS,
|
|
213
|
-
KNOWLEDGE_COOP_JOB_STATUSES,
|
|
214
|
-
KNOWLEDGE_COOP_RELEASE_STATES,
|
|
215
|
-
KNOWLEDGE_COOP_SHARE_PACKAGE_STATES,
|
|
216
|
-
KNOWLEDGE_COOP_TEAM_CAPABILITIES,
|
|
217
|
-
KNOWLEDGE_COOP_WORKSTREAM_STATES,
|
|
218
213
|
MODEL_REGISTRY,
|
|
219
214
|
MarketApiError,
|
|
220
215
|
MarketClient,
|
|
216
|
+
PROJECT_JOB_STATUSES,
|
|
217
|
+
PROJECT_TEAM_CAPABILITIES,
|
|
221
218
|
PUBLISHED_CONTENT_MANIFEST_SCHEMA_VERSION,
|
|
219
|
+
RELEASE_STATES,
|
|
222
220
|
RemoteTemplateCatalogClient,
|
|
223
221
|
RemoteTreeseedAuthClient,
|
|
224
222
|
RemoteTreeseedClient,
|
|
@@ -227,6 +225,7 @@ export {
|
|
|
227
225
|
RemoteTreeseedOperationsClient,
|
|
228
226
|
RemoteTreeseedRunnerClient,
|
|
229
227
|
RemoteTreeseedSdkClient,
|
|
228
|
+
SHARE_PACKAGE_STATES,
|
|
230
229
|
ScopedAgentSdk,
|
|
231
230
|
TREESEED_CATALOG_MARKET_API_BASE_URLS_ENV,
|
|
232
231
|
TREESEED_CENTRAL_MARKET_API_BASE_URL_ENV,
|
|
@@ -238,13 +237,14 @@ export {
|
|
|
238
237
|
TeamScopedR2OverlayContentRuntimeProvider,
|
|
239
238
|
TreeseedOperationsSdk,
|
|
240
239
|
TreeseedWorkflowSdk,
|
|
240
|
+
WORKSTREAM_STATES,
|
|
241
241
|
addMarketProfile,
|
|
242
242
|
buildBuiltinModelRegistry,
|
|
243
243
|
buildCopilotAllowToolArgs,
|
|
244
|
-
|
|
245
|
-
buildKnowledgeCoopTemplatePackage,
|
|
244
|
+
buildKnowledgePackMarketPackage,
|
|
246
245
|
buildModelRegistry,
|
|
247
246
|
buildScopedModelRegistry,
|
|
247
|
+
buildTemplateMarketPackage,
|
|
248
248
|
canonicalizeFrontmatter,
|
|
249
249
|
clearMarketSession,
|
|
250
250
|
collectTreeseedDependencyStatus,
|
|
@@ -276,7 +276,7 @@ export {
|
|
|
276
276
|
getRailwayAuthProfile,
|
|
277
277
|
getTenantContentRoot,
|
|
278
278
|
getTreeseedVerifyDriverStatus,
|
|
279
|
-
|
|
279
|
+
importKnowledgePack,
|
|
280
280
|
installTreeseedDependencies,
|
|
281
281
|
isTeamScopedR2ContentEnabled,
|
|
282
282
|
listIntegratedMarketCatalog,
|
|
@@ -295,9 +295,9 @@ export {
|
|
|
295
295
|
normalizeAgentCliOptions,
|
|
296
296
|
normalizeAliasedRecord,
|
|
297
297
|
normalizeFilterFields,
|
|
298
|
-
normalizeKnowledgeCoopJobStatus,
|
|
299
298
|
normalizeKnowledgeHubLaunchIntent,
|
|
300
299
|
normalizeMutationData,
|
|
300
|
+
normalizeProjectJobStatus,
|
|
301
301
|
normalizeRecordToCanonicalShape,
|
|
302
302
|
normalizeRemoteJobStatus,
|
|
303
303
|
normalizeSortFields,
|
|
@@ -3,12 +3,14 @@ import { resolve } from "node:path";
|
|
|
3
3
|
import { spawnSync } from "node:child_process";
|
|
4
4
|
import { resolveWranglerBin } from "./runtime-tools.js";
|
|
5
5
|
const DATABASE_BINDING = "SITE_DATA_DB";
|
|
6
|
+
const WRANGLER_D1_TIMEOUT_MS = 12e4;
|
|
6
7
|
function runWrangler(args, { cwd, capture = false } = {}) {
|
|
7
8
|
return spawnSync(process.execPath, [resolveWranglerBin(), ...args], {
|
|
8
9
|
cwd,
|
|
9
|
-
env: { ...process.env },
|
|
10
|
+
env: { ...process.env, WRANGLER_SEND_METRICS: "false" },
|
|
10
11
|
stdio: capture ? ["ignore", "pipe", "pipe"] : "inherit",
|
|
11
|
-
encoding: capture ? "utf8" : void 0
|
|
12
|
+
encoding: capture ? "utf8" : void 0,
|
|
13
|
+
timeout: WRANGLER_D1_TIMEOUT_MS
|
|
12
14
|
});
|
|
13
15
|
}
|
|
14
16
|
function executeSqlFile({ cwd, wranglerConfig, filePath, persistTo }) {
|
|
@@ -26,12 +28,18 @@ function executeSqlCommand({ cwd, wranglerConfig, command, persistTo, capture =
|
|
|
26
28
|
if (persistTo) {
|
|
27
29
|
args.push("--persist-to", persistTo);
|
|
28
30
|
}
|
|
31
|
+
if (capture) {
|
|
32
|
+
args.push("--json");
|
|
33
|
+
}
|
|
29
34
|
const result = runWrangler(args, { cwd, capture });
|
|
30
35
|
if (result.status !== 0) {
|
|
31
36
|
if (capture) {
|
|
32
37
|
if (result.stdout) process.stdout.write(result.stdout);
|
|
33
38
|
if (result.stderr) process.stderr.write(result.stderr);
|
|
34
39
|
}
|
|
40
|
+
if (result.error && "code" in result.error && result.error.code === "ETIMEDOUT") {
|
|
41
|
+
console.error(`Wrangler D1 command timed out after ${Math.round(WRANGLER_D1_TIMEOUT_MS / 1e3)} seconds.`);
|
|
42
|
+
}
|
|
35
43
|
process.exit(result.status ?? 1);
|
|
36
44
|
}
|
|
37
45
|
return result;
|
|
@@ -221,7 +221,7 @@ async function createGitHubRepository(input, { env = process.env } = {}) {
|
|
|
221
221
|
function initializeGitHubRepositoryWorkingTree(cwd, repository, {
|
|
222
222
|
defaultBranch = "main",
|
|
223
223
|
createStaging = true,
|
|
224
|
-
commitMessage = "Initialize
|
|
224
|
+
commitMessage = "Initialize TreeSeed hub",
|
|
225
225
|
remoteName = "origin",
|
|
226
226
|
push = true
|
|
227
227
|
} = {}) {
|
|
@@ -52,6 +52,7 @@ export type TreeseedHostingAuditOptions = {
|
|
|
52
52
|
env?: NodeJS.ProcessEnv | Record<string, string | undefined>;
|
|
53
53
|
valuesOverlay?: Record<string, string | undefined>;
|
|
54
54
|
hostKinds?: TreeseedHostingAuditHostKind[];
|
|
55
|
+
providerConnectionChecks?: boolean;
|
|
55
56
|
write?: (line: string) => void;
|
|
56
57
|
};
|
|
57
58
|
export declare function resolveTreeseedHostingAuditTarget({ tenantRoot, environment, }: {
|
|
@@ -63,5 +64,5 @@ export declare function resolveTreeseedHostingAuditTarget({ tenantRoot, environm
|
|
|
63
64
|
target: TreeseedReconcileTarget;
|
|
64
65
|
branchName: string | null;
|
|
65
66
|
};
|
|
66
|
-
export declare function runTreeseedHostingAudit({ tenantRoot, environment, repair, env, valuesOverlay, hostKinds: requestedHostKinds, write, }: TreeseedHostingAuditOptions): Promise<TreeseedHostingAuditReport>;
|
|
67
|
+
export declare function runTreeseedHostingAudit({ tenantRoot, environment, repair, env, valuesOverlay, hostKinds: requestedHostKinds, providerConnectionChecks: shouldCheckProviderConnections, write, }: TreeseedHostingAuditOptions): Promise<TreeseedHostingAuditReport>;
|
|
67
68
|
export declare function formatTreeseedHostingAuditReport(report: TreeseedHostingAuditReport): string;
|
|
@@ -28,8 +28,8 @@ import {
|
|
|
28
28
|
const HOST_KINDS = ["repository", "web", "processing", "email"];
|
|
29
29
|
const HOST_GROUPS = {
|
|
30
30
|
repository: /* @__PURE__ */ new Set(["auth", "github"]),
|
|
31
|
-
web: /* @__PURE__ */ new Set(["
|
|
32
|
-
processing: /* @__PURE__ */ new Set(["
|
|
31
|
+
web: /* @__PURE__ */ new Set(["cloudflare", "hosting"]),
|
|
32
|
+
processing: /* @__PURE__ */ new Set(["railway", "hosting"]),
|
|
33
33
|
email: /* @__PURE__ */ new Set(["smtp"])
|
|
34
34
|
};
|
|
35
35
|
function hasValue(value) {
|
|
@@ -486,6 +486,7 @@ async function runTreeseedHostingAudit({
|
|
|
486
486
|
env = process.env,
|
|
487
487
|
valuesOverlay = {},
|
|
488
488
|
hostKinds: requestedHostKinds,
|
|
489
|
+
providerConnectionChecks: shouldCheckProviderConnections = true,
|
|
489
490
|
write
|
|
490
491
|
}) {
|
|
491
492
|
const resolved = resolveTreeseedHostingAuditTarget({ tenantRoot, environment });
|
|
@@ -511,19 +512,21 @@ async function runTreeseedHostingAudit({
|
|
|
511
512
|
const checks = [];
|
|
512
513
|
appendManualConfigChecks(checks, values, hostKinds);
|
|
513
514
|
appendRegistryConfigChecks({ checks, tenantRoot, scope: resolved.scope, values, hostKinds });
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
515
|
+
if (shouldCheckProviderConnections) {
|
|
516
|
+
const connectionReport = await checkTreeseedProviderConnections({
|
|
517
|
+
tenantRoot,
|
|
518
|
+
scope: resolved.scope,
|
|
519
|
+
env: {
|
|
520
|
+
...values,
|
|
521
|
+
TREESEED_GITHUB_IDENTITY_MODE: "account"
|
|
522
|
+
},
|
|
523
|
+
valuesOverlay: {
|
|
524
|
+
...values,
|
|
525
|
+
TREESEED_GITHUB_IDENTITY_MODE: "account"
|
|
526
|
+
}
|
|
527
|
+
});
|
|
528
|
+
checks.push(...providerConnectionChecks(connectionReport, hostKinds));
|
|
529
|
+
}
|
|
527
530
|
if (hostKinds.includes("email")) {
|
|
528
531
|
checks.push(await checkSmtpReachability(values));
|
|
529
532
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { checkTreeseedProviderConnections, syncTreeseedGitHubEnvironment } from './config-runtime.ts';
|
|
2
2
|
import { configuredRailwayServices, deployRailwayService, ensureRailwayScheduledJobs, verifyRailwayScheduledJobs } from './railway-deploy.ts';
|
|
3
|
-
import {
|
|
3
|
+
import { buildKnowledgePackMarketPackage, buildTemplateMarketPackage } from './market-packaging.ts';
|
|
4
4
|
export type KnowledgeHubProviderLaunchFailurePhase = 'repo_provision_failed' | 'content_bootstrap_failed' | 'workflow_bootstrap_failed' | 'hosting_registration_failed' | 'runtime_connection_failed';
|
|
5
5
|
export interface KnowledgeHubProviderLaunchInput {
|
|
6
6
|
projectId: string;
|
|
@@ -133,8 +133,8 @@ export interface KnowledgeHubProviderLaunchResult {
|
|
|
133
133
|
projectMetadata: Record<string, unknown>;
|
|
134
134
|
defaultWorkstream: Record<string, unknown>;
|
|
135
135
|
phases: KnowledgeHubProviderLaunchPhaseRecord[];
|
|
136
|
-
templatePackage: ReturnType<typeof
|
|
137
|
-
knowledgePackPackage: ReturnType<typeof
|
|
136
|
+
templatePackage: ReturnType<typeof buildTemplateMarketPackage>;
|
|
137
|
+
knowledgePackPackage: ReturnType<typeof buildKnowledgePackMarketPackage>;
|
|
138
138
|
}
|
|
139
139
|
export interface KnowledgeHubProviderLaunchPreflightReport {
|
|
140
140
|
ok: boolean;
|
|
@@ -16,7 +16,7 @@ import { configuredRailwayServices, deployRailwayService, ensureRailwayScheduled
|
|
|
16
16
|
import { loadCliDeployConfig } from "./runtime-tools.js";
|
|
17
17
|
import { templateCatalogRoot } from "./runtime-paths.js";
|
|
18
18
|
import { scaffoldTemplateProject } from "./template-registry.js";
|
|
19
|
-
import {
|
|
19
|
+
import { buildKnowledgePackMarketPackage, buildTemplateMarketPackage, importKnowledgePack } from "./market-packaging.js";
|
|
20
20
|
import { resolveTreeseedToolBinary } from "../../managed-dependencies.js";
|
|
21
21
|
class KnowledgeHubProviderLaunchError extends Error {
|
|
22
22
|
phase;
|
|
@@ -81,7 +81,7 @@ function updateYamlFile(path, updater) {
|
|
|
81
81
|
function currentTemplateCatalogUrl() {
|
|
82
82
|
return `file:${resolve(templateCatalogRoot, "catalog.fixture.json")}`;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function seedLaunchContent(projectRoot, input) {
|
|
85
85
|
const objectiveId = `objective:launch-${slugify(input.projectSlug, "hub")}`;
|
|
86
86
|
const questionId = `question:operating-${slugify(input.projectSlug, "hub")}`;
|
|
87
87
|
const proposalId = `proposal:operating-${slugify(input.projectSlug, "hub")}`;
|
|
@@ -108,7 +108,7 @@ date: ${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}
|
|
|
108
108
|
summary: Stand up the hub, connect the runtime, and make the first workstream visible to the team.
|
|
109
109
|
status: live
|
|
110
110
|
timeHorizon: near-term
|
|
111
|
-
motivation:
|
|
111
|
+
motivation: TreeSeed launches should create immediately usable hubs instead of leaving teams in setup limbo.
|
|
112
112
|
primaryContributor: ${stewardSlug}
|
|
113
113
|
---
|
|
114
114
|
|
|
@@ -205,7 +205,7 @@ audience:
|
|
|
205
205
|
|
|
206
206
|
# ${input.projectName}
|
|
207
207
|
|
|
208
|
-
This knowledge hub was launched from
|
|
208
|
+
This knowledge hub was launched from TreeSeed and is ready for Direct, Workstreams, Releases, and Share workflows.
|
|
209
209
|
`);
|
|
210
210
|
writeText(resolve(projectRoot, "src/content/pages", "welcome.mdx"), `---
|
|
211
211
|
title: Welcome
|
|
@@ -419,7 +419,7 @@ function createDefaultWorkstream(projectId, input, seed) {
|
|
|
419
419
|
state: "saved_remote",
|
|
420
420
|
branchName: "task/initial-launch",
|
|
421
421
|
branchRef: "refs/heads/task/initial-launch",
|
|
422
|
-
owner: "
|
|
422
|
+
owner: "TreeSeed",
|
|
423
423
|
linkedItems: [
|
|
424
424
|
{ model: "objective", id: seed.objectiveId },
|
|
425
425
|
{ model: "question", id: seed.questionId },
|
|
@@ -433,7 +433,7 @@ function createDefaultWorkstream(projectId, input, seed) {
|
|
|
433
433
|
createdAt: nowIso(),
|
|
434
434
|
updatedAt: nowIso(),
|
|
435
435
|
metadata: {
|
|
436
|
-
launchedBy: "
|
|
436
|
+
launchedBy: "treeseed_market"
|
|
437
437
|
}
|
|
438
438
|
};
|
|
439
439
|
}
|
|
@@ -567,7 +567,7 @@ function buildProcessingHostEnvironmentOverlay(input, scope) {
|
|
|
567
567
|
overlayValue(overlay, "TREESEED_WORKER_POOL_SCALER", overlay.TREESEED_WORKER_POOL_SCALER || "railway");
|
|
568
568
|
return overlay;
|
|
569
569
|
}
|
|
570
|
-
function
|
|
570
|
+
function scaffoldLaunchSource(projectRoot, input) {
|
|
571
571
|
const repositoryName = slugify(input.repoName ?? input.projectSlug, "project");
|
|
572
572
|
const templateId = input.sourceKind === "template" ? slugify(input.sourceRef ?? "starter-basic", "starter-basic") : "starter-basic";
|
|
573
573
|
const templateCatalogEnv = { TREESEED_TEMPLATE_CATALOG_URL: currentTemplateCatalogUrl() };
|
|
@@ -585,7 +585,7 @@ function scaffoldKnowledgeCoopSource(projectRoot, input) {
|
|
|
585
585
|
if (!input.sourceRef) {
|
|
586
586
|
throw new Error("Knowledge pack launch requires sourceRef to point to a package manifest or directory.");
|
|
587
587
|
}
|
|
588
|
-
return
|
|
588
|
+
return importKnowledgePack(projectRoot, input.sourceRef);
|
|
589
589
|
});
|
|
590
590
|
}
|
|
591
591
|
return scaffoldTemplateProject(templateId, projectRoot, {
|
|
@@ -716,22 +716,22 @@ async function executeKnowledgeHubProviderLaunch(input, options = {}) {
|
|
|
716
716
|
description: input.summary ?? `Knowledge Hub for ${input.projectName}`,
|
|
717
717
|
visibility: input.repoVisibility ?? "private",
|
|
718
718
|
homepageUrl: resolveManagedWebUrl(repoName),
|
|
719
|
-
topics: ["
|
|
719
|
+
topics: ["treeseed", "knowledge-hub", "market"]
|
|
720
720
|
}, { env: githubEnv });
|
|
721
721
|
await appendPhase(phases, "repo_provision", "completed", `${input.existingRepository?.url ? "Connected" : "Created"} ${repository.slug}.`, reportPhase);
|
|
722
722
|
await appendPhase(phases, "content_bootstrap", "running", "Scaffolding the project and seeding initial content.", reportPhase);
|
|
723
|
-
await
|
|
723
|
+
await scaffoldLaunchSource(workingRoot, input);
|
|
724
724
|
ensureHostedProjectFiles(workingRoot);
|
|
725
725
|
const managedDefaults = applyManagedProjectDefaults(workingRoot, input);
|
|
726
|
-
const seed =
|
|
727
|
-
packageSourceRoot = mkdtempSync(join(tmpdir(), `
|
|
726
|
+
const seed = seedLaunchContent(workingRoot, input);
|
|
727
|
+
packageSourceRoot = mkdtempSync(join(tmpdir(), `market-package-${slugify(input.projectSlug, "project")}-`));
|
|
728
728
|
cpSync(workingRoot, packageSourceRoot, { recursive: true });
|
|
729
729
|
await appendPhase(phases, "content_bootstrap", "completed", "Scaffolded the repo and seeded Direct content.", reportPhase);
|
|
730
730
|
let contentRepository = null;
|
|
731
731
|
let contentRepositoryWorkingRoot = null;
|
|
732
732
|
if (input.contentRepository?.name) {
|
|
733
733
|
await appendPhase(phases, "content_repository", "running", "Creating content repository.", reportPhase);
|
|
734
|
-
contentRepositoryWorkingRoot = mkdtempSync(join(tmpdir(), `
|
|
734
|
+
contentRepositoryWorkingRoot = mkdtempSync(join(tmpdir(), `market-content-${slugify(input.projectSlug, "project")}-`));
|
|
735
735
|
prepareKnowledgeHubContentRepositoryRoot(workingRoot, contentRepositoryWorkingRoot, input);
|
|
736
736
|
const createdContentRepository = input.contentRepository.url ? {
|
|
737
737
|
slug: `${slugify(input.contentRepository.owner ?? repoOwner, "treeseed-ai")}/${slugify(input.contentRepository.name, `${repoName}-content`)}`,
|
|
@@ -745,7 +745,7 @@ async function executeKnowledgeHubProviderLaunch(input, options = {}) {
|
|
|
745
745
|
description: input.summary ?? `Content source for ${input.projectName}`,
|
|
746
746
|
visibility: input.contentRepository.visibility ?? input.repoVisibility ?? "private",
|
|
747
747
|
homepageUrl: resolveManagedWebUrl(repoName),
|
|
748
|
-
topics: ["
|
|
748
|
+
topics: ["treeseed", "knowledge-hub", "content"]
|
|
749
749
|
}, { env: githubEnv });
|
|
750
750
|
const contentInitResult = initializeGitHubRepositoryWorkingTree(contentRepositoryWorkingRoot, createdContentRepository, {
|
|
751
751
|
defaultBranch: input.contentRepository.defaultBranch ?? "main",
|
|
@@ -835,7 +835,7 @@ async function executeKnowledgeHubProviderLaunch(input, options = {}) {
|
|
|
835
835
|
{ slug: repository.slug, url: repository.url }
|
|
836
836
|
);
|
|
837
837
|
const packageRoot = packageSourceRoot ?? workingRoot;
|
|
838
|
-
const templatePackage =
|
|
838
|
+
const templatePackage = buildTemplateMarketPackage(packageRoot, {
|
|
839
839
|
projectSlug: input.projectSlug,
|
|
840
840
|
title: `${input.projectName} template`,
|
|
841
841
|
summary: input.summary ?? null,
|
|
@@ -848,7 +848,7 @@ async function executeKnowledgeHubProviderLaunch(input, options = {}) {
|
|
|
848
848
|
}
|
|
849
849
|
}
|
|
850
850
|
});
|
|
851
|
-
const knowledgePackPackage =
|
|
851
|
+
const knowledgePackPackage = buildKnowledgePackMarketPackage(packageRoot, {
|
|
852
852
|
projectSlug: input.projectSlug,
|
|
853
853
|
title: `${input.projectName} knowledge pack`,
|
|
854
854
|
summary: input.summary ?? null,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface MarketPackageManifest {
|
|
2
2
|
schemaVersion: 1;
|
|
3
3
|
kind: 'template' | 'knowledge_pack';
|
|
4
4
|
id: string;
|
|
@@ -24,36 +24,36 @@ export interface KnowledgeCoopPackageManifest {
|
|
|
24
24
|
publishMetadata: Record<string, unknown>;
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
export interface
|
|
27
|
+
export interface MarketPackageBuildResult {
|
|
28
28
|
outputRoot: string;
|
|
29
29
|
payloadRoot: string;
|
|
30
30
|
manifestPath: string;
|
|
31
31
|
files: string[];
|
|
32
|
-
manifest:
|
|
32
|
+
manifest: MarketPackageManifest;
|
|
33
33
|
}
|
|
34
|
-
export interface
|
|
35
|
-
manifest:
|
|
34
|
+
export interface KnowledgePackImportResult {
|
|
35
|
+
manifest: MarketPackageManifest;
|
|
36
36
|
manifestPath: string;
|
|
37
37
|
payloadRoot: string;
|
|
38
38
|
importedPaths: string[];
|
|
39
39
|
}
|
|
40
|
-
export declare function
|
|
41
|
-
export declare function
|
|
40
|
+
export declare function resolveMarketPackageOutputRoot(projectRoot: string, kind: 'template' | 'knowledge_pack', slug: string): string;
|
|
41
|
+
export declare function buildTemplateMarketPackage(projectRoot: string, input?: {
|
|
42
42
|
id?: string;
|
|
43
43
|
title?: string;
|
|
44
44
|
summary?: string | null;
|
|
45
45
|
outputRoot?: string | null;
|
|
46
46
|
projectSlug?: string | null;
|
|
47
|
-
market?:
|
|
48
|
-
}):
|
|
49
|
-
export declare function
|
|
47
|
+
market?: MarketPackageManifest['market'];
|
|
48
|
+
}): MarketPackageBuildResult;
|
|
49
|
+
export declare function buildKnowledgePackMarketPackage(projectRoot: string, input?: {
|
|
50
50
|
id?: string;
|
|
51
51
|
title?: string;
|
|
52
52
|
summary?: string | null;
|
|
53
53
|
outputRoot?: string | null;
|
|
54
54
|
projectSlug?: string | null;
|
|
55
55
|
includePaths?: string[];
|
|
56
|
-
market?:
|
|
57
|
-
}):
|
|
58
|
-
export declare function
|
|
56
|
+
market?: MarketPackageManifest['market'];
|
|
57
|
+
}): MarketPackageBuildResult;
|
|
58
|
+
export declare function importKnowledgePack(targetRoot: string, sourcePath: string): KnowledgePackImportResult;
|
|
59
59
|
export declare function relativePackageFiles(outputRoot: string): string[];
|
|
@@ -139,13 +139,13 @@ function buildManifest(projectRoot, input) {
|
|
|
139
139
|
}
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function resolveMarketPackageOutputRoot(projectRoot, kind, slug) {
|
|
143
143
|
return resolve(projectRoot, ".treeseed", "packages", kind, `${slug}-${nowStamp()}`);
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function buildTemplateMarketPackage(projectRoot, input = {}) {
|
|
146
146
|
const projectSlug = slugify(input.projectSlug ?? basename(projectRoot), "project");
|
|
147
147
|
const packageId = slugify(input.id ?? `${projectSlug}-template`, "template");
|
|
148
|
-
const outputRoot = resolve(input.outputRoot ??
|
|
148
|
+
const outputRoot = resolve(input.outputRoot ?? resolveMarketPackageOutputRoot(projectRoot, "template", packageId));
|
|
149
149
|
const payloadRoot = resolve(outputRoot, "payload");
|
|
150
150
|
ensureDir(payloadRoot);
|
|
151
151
|
const files = copySelectedPaths(projectRoot, payloadRoot, defaultTemplatePaths(projectRoot), TEMPLATE_IGNORES);
|
|
@@ -168,10 +168,10 @@ function buildKnowledgeCoopTemplatePackage(projectRoot, input = {}) {
|
|
|
168
168
|
manifest
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function buildKnowledgePackMarketPackage(projectRoot, input = {}) {
|
|
172
172
|
const projectSlug = slugify(input.projectSlug ?? basename(projectRoot), "project");
|
|
173
173
|
const packageId = slugify(input.id ?? `${projectSlug}-knowledge-pack`, "knowledge-pack");
|
|
174
|
-
const outputRoot = resolve(input.outputRoot ??
|
|
174
|
+
const outputRoot = resolve(input.outputRoot ?? resolveMarketPackageOutputRoot(projectRoot, "knowledge_pack", packageId));
|
|
175
175
|
const payloadRoot = resolve(outputRoot, "payload");
|
|
176
176
|
ensureDir(payloadRoot);
|
|
177
177
|
const includePaths = (input.includePaths ?? KNOWLEDGE_PACK_DEFAULT_PATHS).filter((relativePath) => existsSync(resolve(projectRoot, relativePath)));
|
|
@@ -195,7 +195,7 @@ function buildKnowledgeCoopKnowledgePackPackage(projectRoot, input = {}) {
|
|
|
195
195
|
manifest
|
|
196
196
|
};
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function importKnowledgePack(targetRoot, sourcePath) {
|
|
199
199
|
const resolvedSource = resolve(sourcePath);
|
|
200
200
|
const manifestPath = statSync(resolvedSource).isDirectory() ? resolve(resolvedSource, "manifest.json") : resolvedSource;
|
|
201
201
|
const manifest = JSON.parse(readFileSync(manifestPath, "utf8"));
|
|
@@ -226,9 +226,9 @@ function relativePackageFiles(outputRoot) {
|
|
|
226
226
|
return listFiles(outputRoot).map((entry) => relative(outputRoot, resolve(outputRoot, entry)) || basename(entry));
|
|
227
227
|
}
|
|
228
228
|
export {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
229
|
+
buildKnowledgePackMarketPackage,
|
|
230
|
+
buildTemplateMarketPackage,
|
|
231
|
+
importKnowledgePack,
|
|
232
232
|
relativePackageFiles,
|
|
233
|
-
|
|
233
|
+
resolveMarketPackageOutputRoot
|
|
234
234
|
};
|
|
@@ -214,6 +214,22 @@ export declare function deployProjectPlatform(options: ProjectPlatformActionOpti
|
|
|
214
214
|
readiness: any;
|
|
215
215
|
};
|
|
216
216
|
};
|
|
217
|
+
hostingRepair: {
|
|
218
|
+
ok: boolean;
|
|
219
|
+
phase: "repaired" | "already_ready";
|
|
220
|
+
environment: import("./hosting-audit.ts").TreeseedHostingAuditResolvedEnvironment;
|
|
221
|
+
repairMode: boolean;
|
|
222
|
+
repaired: boolean;
|
|
223
|
+
repairedChecks: number;
|
|
224
|
+
failedChecks: number;
|
|
225
|
+
blockers: string[];
|
|
226
|
+
warnings: string[];
|
|
227
|
+
checkedAt: string;
|
|
228
|
+
} | {
|
|
229
|
+
ok: boolean;
|
|
230
|
+
skipped: boolean;
|
|
231
|
+
reason: string;
|
|
232
|
+
};
|
|
217
233
|
serviceResults: ({
|
|
218
234
|
service: any;
|
|
219
235
|
status: string;
|
|
@@ -641,6 +657,22 @@ export declare function runProjectPlatformAction(action: ProjectPlatformAction,
|
|
|
641
657
|
readiness: any;
|
|
642
658
|
};
|
|
643
659
|
};
|
|
660
|
+
hostingRepair: {
|
|
661
|
+
ok: boolean;
|
|
662
|
+
phase: "repaired" | "already_ready";
|
|
663
|
+
environment: import("./hosting-audit.ts").TreeseedHostingAuditResolvedEnvironment;
|
|
664
|
+
repairMode: boolean;
|
|
665
|
+
repaired: boolean;
|
|
666
|
+
repairedChecks: number;
|
|
667
|
+
failedChecks: number;
|
|
668
|
+
blockers: string[];
|
|
669
|
+
warnings: string[];
|
|
670
|
+
checkedAt: string;
|
|
671
|
+
} | {
|
|
672
|
+
ok: boolean;
|
|
673
|
+
skipped: boolean;
|
|
674
|
+
reason: string;
|
|
675
|
+
};
|
|
644
676
|
serviceResults: ({
|
|
645
677
|
service: any;
|
|
646
678
|
status: string;
|