@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.
- 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 +10 -3
- package/dist/index.js +63 -6
- 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/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/tenant-workflow-action.js +10 -1
- package/dist/sdk-types.d.ts +169 -4
- package/dist/sdk-types.js +20 -2
- 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 +23 -23
- 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/workflow-state.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { collectPublicPackageReleaseLineState } from './operations/services/workspace-save.ts';
|
|
2
|
+
import { packageAdapterPlanSummary } from './operations/services/package-adapters.ts';
|
|
2
3
|
import { inspectWorkspaceDependencyMode } from './operations/services/workspace-dependency-mode.ts';
|
|
3
4
|
import type { TreeseedWorkflowNextStep } from './workflow.ts';
|
|
4
5
|
import { type TreeseedWorkflowBranchRole } from './workflow/policy.ts';
|
|
@@ -71,6 +72,8 @@ export type TreeseedWorkflowState = {
|
|
|
71
72
|
nextStep: string | null;
|
|
72
73
|
reasons: string[];
|
|
73
74
|
}>;
|
|
75
|
+
staleRunsTotal: number;
|
|
76
|
+
staleRunsOmitted: number;
|
|
74
77
|
obsoleteRuns: Array<{
|
|
75
78
|
runId: string;
|
|
76
79
|
command: string;
|
|
@@ -104,6 +107,7 @@ export type TreeseedWorkflowState = {
|
|
|
104
107
|
blockers: string[];
|
|
105
108
|
warnings: string[];
|
|
106
109
|
releaseLine: ReturnType<typeof collectPublicPackageReleaseLineState> | null;
|
|
110
|
+
packages: ReturnType<typeof packageAdapterPlanSummary>;
|
|
107
111
|
};
|
|
108
112
|
preview: {
|
|
109
113
|
enabled: boolean;
|
|
@@ -224,6 +228,15 @@ export type TreeseedWorkflowState = {
|
|
|
224
228
|
}>;
|
|
225
229
|
recommendations: TreeseedWorkflowRecommendation[];
|
|
226
230
|
};
|
|
231
|
+
export declare function capWorkflowRunHistory<T>(runs: T[], options?: {
|
|
232
|
+
history?: 'recent' | 'all';
|
|
233
|
+
limit?: number;
|
|
234
|
+
}): {
|
|
235
|
+
historyMode: string;
|
|
236
|
+
runs: T[];
|
|
237
|
+
total: number;
|
|
238
|
+
omitted: number;
|
|
239
|
+
};
|
|
227
240
|
export declare function capObsoleteWorkflowRuns<T>(obsoleteRuns: T[], options?: {
|
|
228
241
|
history?: 'recent' | 'all';
|
|
229
242
|
limit?: number;
|
package/dist/workflow-state.js
CHANGED
|
@@ -22,7 +22,8 @@ import {
|
|
|
22
22
|
import { loadCliDeployConfig } from "./operations/services/runtime-tools.js";
|
|
23
23
|
import { collectCliPreflight } from "./operations/services/workspace-preflight.js";
|
|
24
24
|
import { collectPublicPackageReleaseLineState, currentBranch, gitStatusPorcelain } from "./operations/services/workspace-save.js";
|
|
25
|
-
import { hasCompleteTreeseedPackageCheckout, isWorkspaceRoot, run
|
|
25
|
+
import { hasCompleteTreeseedPackageCheckout, isWorkspaceRoot, run } from "./operations/services/workspace-tools.js";
|
|
26
|
+
import { packageAdapterPlanSummary } from "./operations/services/package-adapters.js";
|
|
26
27
|
import { inspectWorkspaceDependencyMode } from "./operations/services/workspace-dependency-mode.js";
|
|
27
28
|
import { inspectDetachedHeadRepair, PRODUCTION_BRANCH, STAGING_BRANCH } from "./operations/services/git-workflow.js";
|
|
28
29
|
import { classifyWorkflowRunJournals, inspectWorkflowLock } from "./workflow/runs.js";
|
|
@@ -293,25 +294,34 @@ function safeReleaseHistory(repoDir) {
|
|
|
293
294
|
};
|
|
294
295
|
}
|
|
295
296
|
}
|
|
296
|
-
const
|
|
297
|
-
function
|
|
297
|
+
const DEFAULT_WORKFLOW_RUN_HISTORY_LIMIT = 20;
|
|
298
|
+
function capWorkflowRunHistory(runs, options = {}) {
|
|
298
299
|
const historyMode = options.history === "all" ? "all" : "recent";
|
|
299
|
-
const limit = options.limit ??
|
|
300
|
-
const
|
|
300
|
+
const limit = options.limit ?? DEFAULT_WORKFLOW_RUN_HISTORY_LIMIT;
|
|
301
|
+
const total = runs.length;
|
|
301
302
|
if (historyMode === "all") {
|
|
302
303
|
return {
|
|
303
304
|
historyMode,
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
305
|
+
runs,
|
|
306
|
+
total,
|
|
307
|
+
omitted: 0
|
|
307
308
|
};
|
|
308
309
|
}
|
|
309
|
-
const cappedRuns =
|
|
310
|
+
const cappedRuns = runs.slice(0, limit);
|
|
310
311
|
return {
|
|
311
312
|
historyMode,
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
313
|
+
runs: cappedRuns,
|
|
314
|
+
total,
|
|
315
|
+
omitted: Math.max(0, total - cappedRuns.length)
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
function capObsoleteWorkflowRuns(obsoleteRuns, options = {}) {
|
|
319
|
+
const capped = capWorkflowRunHistory(obsoleteRuns, options);
|
|
320
|
+
return {
|
|
321
|
+
historyMode: capped.historyMode,
|
|
322
|
+
obsoleteRuns: capped.runs,
|
|
323
|
+
obsoleteRunsTotal: capped.total,
|
|
324
|
+
obsoleteRunsOmitted: capped.omitted
|
|
315
325
|
};
|
|
316
326
|
}
|
|
317
327
|
function resolveLocalStatusUrl(deployConfig) {
|
|
@@ -329,28 +339,30 @@ function resolveTreeseedWorkflowState(cwd, options = {}) {
|
|
|
329
339
|
const dirtyWorktree = root ? gitStatusPorcelain(root).length > 0 : false;
|
|
330
340
|
const completePackageCheckout = hasCompleteTreeseedPackageCheckout(effectiveCwd);
|
|
331
341
|
const workspaceDependencyMode = inspectWorkspaceDependencyMode(effectiveCwd);
|
|
332
|
-
const
|
|
333
|
-
|
|
334
|
-
const
|
|
342
|
+
const packageAdapters = workspaceRoot ? packageAdapterPlanSummary(effectiveCwd) : [];
|
|
343
|
+
const packageSyncRepos = workspaceRoot ? packageAdapters.map((pkg) => {
|
|
344
|
+
const packageDir = resolve(effectiveCwd, pkg.path);
|
|
345
|
+
const repoBranch = currentBranch(packageDir) || null;
|
|
346
|
+
const dirty = gitStatusPorcelain(packageDir).length > 0;
|
|
335
347
|
const expectedBranch = branchName;
|
|
336
|
-
const detachedRepair = repoBranch ? null : inspectDetachedHeadRepair(
|
|
348
|
+
const detachedRepair = repoBranch ? null : inspectDetachedHeadRepair(packageDir, [expectedBranch, STAGING_BRANCH, PRODUCTION_BRANCH].filter((branch) => Boolean(branch)));
|
|
337
349
|
let localBranch = false;
|
|
338
350
|
if (expectedBranch) {
|
|
339
351
|
if (repoBranch === expectedBranch) {
|
|
340
352
|
localBranch = true;
|
|
341
353
|
} else {
|
|
342
354
|
try {
|
|
343
|
-
run("git", ["show-ref", "--verify", "--quiet", `refs/heads/${expectedBranch}`], { cwd:
|
|
355
|
+
run("git", ["show-ref", "--verify", "--quiet", `refs/heads/${expectedBranch}`], { cwd: packageDir, capture: true });
|
|
344
356
|
localBranch = true;
|
|
345
357
|
} catch {
|
|
346
358
|
localBranch = false;
|
|
347
359
|
}
|
|
348
360
|
}
|
|
349
361
|
}
|
|
350
|
-
const remoteBranch = Boolean(expectedBranch) ? knownRemoteTrackingBranchExists(
|
|
362
|
+
const remoteBranch = Boolean(expectedBranch) ? knownRemoteTrackingBranchExists(packageDir, expectedBranch) : false;
|
|
351
363
|
return {
|
|
352
|
-
name: pkg.
|
|
353
|
-
path: pkg.
|
|
364
|
+
name: pkg.id,
|
|
365
|
+
path: pkg.path,
|
|
354
366
|
branchName: repoBranch,
|
|
355
367
|
dirty,
|
|
356
368
|
aligned: expectedBranch ? repoBranch === expectedBranch : true,
|
|
@@ -401,15 +413,15 @@ function resolveTreeseedWorkflowState(cwd, options = {}) {
|
|
|
401
413
|
const machineConfig = existsSync(configPath) ? loadTreeseedMachineConfig(effectiveCwd) : null;
|
|
402
414
|
const keyStatus = inspectTreeseedKeyAgentStatus(effectiveCwd);
|
|
403
415
|
const marketSettings = machineConfig?.settings?.market && typeof machineConfig.settings.market === "object" ? machineConfig.settings.market : null;
|
|
404
|
-
const runnerHostId = typeof marketSettings?.runnerHostId === "string" && marketSettings.runnerHostId.trim() ? marketSettings.runnerHostId.trim() : typeof marketSettings?.projectId === "string" && marketSettings.projectId.trim() ? `
|
|
416
|
+
const runnerHostId = typeof marketSettings?.runnerHostId === "string" && marketSettings.runnerHostId.trim() ? marketSettings.runnerHostId.trim() : typeof marketSettings?.projectId === "string" && marketSettings.projectId.trim() ? `operations-runner:${marketSettings.projectId.trim()}` : null;
|
|
405
417
|
const runnerSession = runnerHostId ? safeResolveRemoteSession(effectiveCwd, runnerHostId) : null;
|
|
406
418
|
const workflowLock = inspectWorkflowLock(effectiveCwd);
|
|
407
419
|
const workflowRunHeads = {};
|
|
408
420
|
if (root) {
|
|
409
421
|
workflowRunHeads["@treeseed/market"] = safeHeadCommit(root);
|
|
410
422
|
}
|
|
411
|
-
for (const pkg of
|
|
412
|
-
workflowRunHeads[pkg.
|
|
423
|
+
for (const pkg of packageAdapters) {
|
|
424
|
+
workflowRunHeads[pkg.id] = safeHeadCommit(resolve(effectiveCwd, pkg.path));
|
|
413
425
|
}
|
|
414
426
|
const classifiedRuns = classifyWorkflowRunJournals(effectiveCwd, {
|
|
415
427
|
currentBranch: branchName,
|
|
@@ -428,6 +440,7 @@ function resolveTreeseedWorkflowState(cwd, options = {}) {
|
|
|
428
440
|
nextStep: journal.steps.find((step) => step.status === "pending")?.description ?? null,
|
|
429
441
|
reasons: classification.reasons
|
|
430
442
|
}));
|
|
443
|
+
const staleHistory = capWorkflowRunHistory(staleRuns, { history: options.history });
|
|
431
444
|
const obsoleteRuns = classifiedRuns.filter((entry) => entry.classification.state === "obsolete").map(({ journal, classification }) => ({
|
|
432
445
|
runId: journal.runId,
|
|
433
446
|
command: journal.command,
|
|
@@ -467,7 +480,9 @@ function resolveTreeseedWorkflowState(cwd, options = {}) {
|
|
|
467
480
|
staleReason: workflowLock.staleReason
|
|
468
481
|
},
|
|
469
482
|
interruptedRuns,
|
|
470
|
-
staleRuns,
|
|
483
|
+
staleRuns: staleHistory.runs,
|
|
484
|
+
staleRunsTotal: staleHistory.total,
|
|
485
|
+
staleRunsOmitted: staleHistory.omitted,
|
|
471
486
|
obsoleteRuns: obsoleteHistory.obsoleteRuns,
|
|
472
487
|
historyMode: obsoleteHistory.historyMode,
|
|
473
488
|
obsoleteRunsTotal: obsoleteHistory.obsoleteRunsTotal,
|
|
@@ -485,7 +500,8 @@ function resolveTreeseedWorkflowState(cwd, options = {}) {
|
|
|
485
500
|
repos: packageSyncRepos,
|
|
486
501
|
blockers: packageSyncBlockers,
|
|
487
502
|
warnings: packageSyncWarnings,
|
|
488
|
-
releaseLine: packageReleaseLine
|
|
503
|
+
releaseLine: packageReleaseLine,
|
|
504
|
+
packages: packageAdapters
|
|
489
505
|
},
|
|
490
506
|
preview: {
|
|
491
507
|
enabled: false,
|
|
@@ -601,7 +617,7 @@ function resolveTreeseedWorkflowState(cwd, options = {}) {
|
|
|
601
617
|
state.auth.wrangler = state.auth.wrangler || hasStatusConfigValue(statusConfigByScope, "CLOUDFLARE_API_TOKEN");
|
|
602
618
|
state.auth.railway = state.auth.railway || hasStatusConfigValue(statusConfigByScope, "RAILWAY_API_TOKEN");
|
|
603
619
|
state.auth.copilot = state.auth.copilot || state.auth.gh;
|
|
604
|
-
state.marketConnection.baseUrl = state.marketConnection.baseUrl ?? sharedConfigValues.
|
|
620
|
+
state.marketConnection.baseUrl = state.marketConnection.baseUrl ?? sharedConfigValues.TREESEED_API_BASE_URL ?? deployConfig.runtime?.marketBaseUrl ?? deployConfig.hosting?.marketBaseUrl ?? null;
|
|
605
621
|
state.marketConnection.teamId = state.marketConnection.teamId ?? sharedConfigValues.TREESEED_HOSTING_TEAM_ID ?? deployConfig.runtime?.teamId ?? deployConfig.hosting?.teamId ?? null;
|
|
606
622
|
state.marketConnection.projectId = state.marketConnection.projectId ?? sharedConfigValues.TREESEED_PROJECT_ID ?? deployConfig.runtime?.projectId ?? deployConfig.hosting?.projectId ?? null;
|
|
607
623
|
state.marketConnection.hubMode = deployConfig.hub?.mode ?? null;
|
|
@@ -812,6 +828,7 @@ function recommendTreeseedNextSteps(state) {
|
|
|
812
828
|
}
|
|
813
829
|
export {
|
|
814
830
|
capObsoleteWorkflowRuns,
|
|
831
|
+
capWorkflowRunHistory,
|
|
815
832
|
recommendTreeseedNextSteps,
|
|
816
833
|
resolveTreeseedWorkflowState
|
|
817
834
|
};
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
export { applyTreeseedConfigValues, applyTreeseedEnvironmentToProcess, applyTreeseedSafeRepairs, assertTreeseedCommandEnvironment, checkTreeseedProviderConnections, clearTreeseedRemoteSession, collectTreeseedConfigContext, collectTreeseedPrintEnvReport, createDefaultTreeseedMachineConfig, ensureTreeseedActVerificationTooling, ensureTreeseedSecretSessionForConfig, ensureTreeseedGitignoreEntries, getTreeseedMachineConfigPaths, loadTreeseedMachineConfig, listRelevantTreeseedConfigEntries, finalizeTreeseedConfig, inspectTreeseedKeyAgentTransportDiagnostic, inspectTreeseedPassphraseEnvDiagnostic, listDeprecatedTreeseedLocalEnvFiles, inspectTreeseedKeyAgentStatus, lockTreeseedSecretSession, migrateTreeseedMachineKeyToWrapped, resolveTreeseedMachineEnvironmentValues, resolveTreeseedLaunchEnvironment, resolveTreeseedRemoteConfig, resolveTreeseedRemoteSession, rotateTreeseedMachineKey, rotateTreeseedMachineKeyPassphrase, setTreeseedRemoteSession, TREESEED_MACHINE_KEY_PASSPHRASE_ENV, TreeseedKeyAgentError, updateTreeseedDeployConfigFeatureToggles, unlockTreeseedSecretSessionFromEnv, unlockTreeseedSecretSessionInteractive, unlockTreeseedSecretSessionWithPassphrase, withTreeseedKeyAgentAutopromptDisabled, warnDeprecatedTreeseedLocalEnvFiles, writeTreeseedMachineConfig, } from './operations/services/config-runtime.ts';
|
|
1
|
+
export { applyTreeseedConfigValues, applyTreeseedEnvironmentToProcess, applyTreeseedSafeRepairs, assertTreeseedCommandEnvironment, checkTreeseedProviderConnections, clearTreeseedRemoteSession, collectTreeseedConfigContext, collectTreeseedConfigSeedValues, collectTreeseedPrintEnvReport, createDefaultTreeseedMachineConfig, ensureTreeseedActVerificationTooling, ensureTreeseedSecretSessionForConfig, ensureTreeseedGitignoreEntries, getTreeseedMachineConfigPaths, loadTreeseedMachineConfig, listRelevantTreeseedConfigEntries, finalizeTreeseedConfig, inspectTreeseedKeyAgentTransportDiagnostic, inspectTreeseedPassphraseEnvDiagnostic, listDeprecatedTreeseedLocalEnvFiles, inspectTreeseedKeyAgentStatus, lockTreeseedSecretSession, migrateTreeseedMachineKeyToWrapped, resolveTreeseedMachineEnvironmentValues, resolveTreeseedLaunchEnvironment, resolveTreeseedRemoteConfig, resolveTreeseedRemoteSession, rotateTreeseedMachineKey, rotateTreeseedMachineKeyPassphrase, setTreeseedRemoteSession, TREESEED_MACHINE_KEY_PASSPHRASE_ENV, TreeseedKeyAgentError, updateTreeseedDeployConfigFeatureToggles, unlockTreeseedSecretSessionFromEnv, unlockTreeseedSecretSessionInteractive, unlockTreeseedSecretSessionWithPassphrase, withTreeseedKeyAgentAutopromptDisabled, warnDeprecatedTreeseedLocalEnvFiles, writeTreeseedMachineConfig, } from './operations/services/config-runtime.ts';
|
|
2
2
|
export { exportTreeseedCodebase } from './operations/services/export-runtime.ts';
|
|
3
3
|
export { formatTreeseedHostingAuditReport, resolveTreeseedHostingAuditTarget, runTreeseedHostingAudit, type TreeseedHostingAuditCheck, type TreeseedHostingAuditEnvironment, type TreeseedHostingAuditHostKind, type TreeseedHostingAuditReport, } from './operations/services/hosting-audit.ts';
|
|
4
|
+
export { collectTreeseedHostedServiceChecks, type TreeseedHostedServiceCheck, type TreeseedHostedServiceCheckReport, type TreeseedHostedServiceCheckStatus, type TreeseedHostedServiceType, type TreeseedObservedRailwayServiceState, } from './operations/services/hosted-service-checks.ts';
|
|
5
|
+
export { collectTreeseedDeploymentReadiness, formatTreeseedReadinessReport, type TreeseedDeploymentReadinessCheck, type TreeseedDeploymentReadinessReport, type TreeseedDeploymentReadinessStatus, } from './operations/services/deployment-readiness.ts';
|
|
6
|
+
export { collectTreeseedLiveHostedServiceChecks, type TreeseedLiveHostedServiceCheckOptions, type TreeseedLiveHostedServiceCheckReport, } from './operations/services/live-hosted-service-checks.ts';
|
|
7
|
+
export { runTreeseedOperationsRunnerSmoke, type TreeseedOperationsRunnerSmokeOptions, type TreeseedOperationsRunnerSmokeReport, } from './operations/services/operations-runner-smoke.ts';
|
|
8
|
+
export { readTreeseedVerificationCache, treeseedVerificationCacheKey, writeTreeseedVerificationCache, type TreeseedVerificationCacheEntry, } from './operations/services/verification-cache.ts';
|
|
4
9
|
export { assertDeploymentInitialized, cleanupDestroyedState, createBranchPreviewDeployTarget, createPersistentDeployTarget, deployTargetLabel, destroyCloudflareResources, ensureGeneratedWranglerConfig, finalizeDeploymentState, loadDeployState, printDeploySummary, printDestroySummary, provisionCloudflareResources, runRemoteD1Migrations, syncCloudflareSecrets, validateDeployPrerequisites, validateDestroyPrerequisites, } from './operations/services/deploy.ts';
|
|
5
10
|
export { assertCleanWorktree, assertFeatureBranch, branchExists, checkoutBranch, createDeprecatedTaskTag, createFeatureBranchFromStaging, currentManagedBranch, deleteLocalBranch, deleteRemoteBranch, ensureLocalBranchTracking, gitWorkflowRoot, listTaskBranches, mergeCurrentBranchIntoStaging, mergeStagingIntoMain, prepareReleaseBranches, PRODUCTION_BRANCH, pushBranch, remoteBranchExists, STAGING_BRANCH, syncBranchWithOrigin, waitForStagingAutomation, } from './operations/services/git-workflow.ts';
|
|
6
11
|
export { dockerIsAvailable, stopKnownMailpitContainers, type TreeseedMailpitContainer, } from './operations/services/mailpit-runtime.ts';
|
|
7
12
|
export { loadCliDeployConfig, packageScriptPath, resolveWranglerBin, } from './operations/services/runtime-tools.ts';
|
|
8
13
|
export { configuredRailwayServices, deployRailwayService, validateRailwayDeployPrerequisites, } from './operations/services/railway-deploy.ts';
|
|
9
|
-
export { ensureRailwayEnvironment, ensureRailwayProject, ensureRailwayService, getRailwayAuthProfile, listRailwayEnvironments, listRailwayProjects, listRailwayServices, listRailwayVariables, railwayGraphqlRequest, resolveRailwayApiToken, resolveRailwayApiUrl, resolveRailwayWorkspace, resolveRailwayWorkspaceContext, upsertRailwayVariables, } from './operations/services/railway-api.ts';
|
|
14
|
+
export { deleteRailwayProject, ensureRailwayEnvironment, ensureRailwayProject, ensureRailwayService, getRailwayAuthProfile, listRailwayEnvironments, listRailwayProjects, listRailwayServices, listRailwayVariables, railwayGraphqlRequest, resolveRailwayApiToken, resolveRailwayApiUrl, resolveRailwayWorkspace, resolveRailwayWorkspaceContext, upsertRailwayVariables, } from './operations/services/railway-api.ts';
|
|
15
|
+
export { githubRepositoryCredentialEnvName, resolveGitHubCredentialForRepository, type TreeseedGitHubCredentialResolution, } from './operations/services/github-credentials.ts';
|
|
16
|
+
export { createGitHubApiClient, dispatchGitHubWorkflowRun, ensureGitHubActionsEnvironment, getLatestGitHubWorkflowRun, listGitHubEnvironmentSecretNames, listGitHubEnvironmentVariableNames, type GitHubWorkflowDispatchResult, type GitHubWorkflowRunSummary, upsertGitHubEnvironmentSecret, upsertGitHubEnvironmentVariable, } from './operations/services/github-api.ts';
|
|
17
|
+
export { discoverTreeseedPackageAdapters, findTreeseedPackageAdapter, packageAdapterPlanSummary, planTreeseedPackageDevelopmentImage, type TreeseedPackageAdapter, type TreeseedPackageDevelopmentImagePlan, } from './operations/services/package-adapters.ts';
|
|
10
18
|
export { runTenantDeployPreflight, runWorkspaceReleasePreflight, runWorkspaceSavePreflight, } from './operations/services/save-deploy-preflight.ts';
|
|
11
19
|
export { collectCliPreflight } from './operations/services/workspace-preflight.ts';
|
|
12
20
|
export { collectTreeseedDependencyStatus, collectTreeseedToolStatus, createTreeseedManagedToolEnv, formatTreeseedDependencyFailureDetails, formatTreeseedDependencyReport, installTreeseedDependencies, resolveTreeseedToolBinary, resolveTreeseedToolCommand, type TreeseedToolStatusResult, } from './managed-dependencies.ts';
|
|
@@ -14,4 +22,4 @@ export { runTreeseedCopilotTask, type TreeseedCopilotTaskInput, type TreeseedCop
|
|
|
14
22
|
export { applyWorkspaceVersionChanges, collectMergeConflictReport, currentBranch, formatMergeConflictReport, gitStatusPorcelain, hasMeaningfulChanges, incrementVersion, originRemoteUrl, planWorkspaceReleaseBump, repoRoot, } from './operations/services/workspace-save.ts';
|
|
15
23
|
export { assertNoWorkspaceLinksInDeploymentLockfiles, collectDeploymentLockfileWorkspaceIssues, discoverWorkspaceLinks, ensureLocalWorkspaceLinks, inspectWorkspaceDependencyMode, unlinkLocalWorkspaceLinks, type DependencyResolutionMode, type DeploymentLockfileWorkspaceIssue, type WorkspaceLinksMode, } from './operations/services/workspace-dependency-mode.ts';
|
|
16
24
|
export { findNearestTreeseedRoot, findNearestTreeseedWorkspaceRoot, isWorkspaceRoot, run, workspaceRoot, } from './operations/services/workspace-tools.ts';
|
|
17
|
-
export { collectTreeseedReconcileStatus, createTreeseedReconcileRegistry, deriveTreeseedDesiredUnits, destroyTreeseedTargetUnits,
|
|
25
|
+
export { collectTreeseedReconcileStatus, createTreeseedReconcileRegistry, deriveTreeseedDesiredUnits, destroyTreeseedTargetUnits, planTreeseedReconciliation, refreshTreeseedUnits, reconcileTreeseedTarget, } from './reconcile/index.ts';
|
package/dist/workflow-support.js
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
checkTreeseedProviderConnections,
|
|
7
7
|
clearTreeseedRemoteSession,
|
|
8
8
|
collectTreeseedConfigContext,
|
|
9
|
+
collectTreeseedConfigSeedValues,
|
|
9
10
|
collectTreeseedPrintEnvReport,
|
|
10
11
|
createDefaultTreeseedMachineConfig,
|
|
11
12
|
ensureTreeseedActVerificationTooling,
|
|
@@ -44,6 +45,24 @@ import {
|
|
|
44
45
|
resolveTreeseedHostingAuditTarget,
|
|
45
46
|
runTreeseedHostingAudit
|
|
46
47
|
} from "./operations/services/hosting-audit.js";
|
|
48
|
+
import {
|
|
49
|
+
collectTreeseedHostedServiceChecks
|
|
50
|
+
} from "./operations/services/hosted-service-checks.js";
|
|
51
|
+
import {
|
|
52
|
+
collectTreeseedDeploymentReadiness,
|
|
53
|
+
formatTreeseedReadinessReport
|
|
54
|
+
} from "./operations/services/deployment-readiness.js";
|
|
55
|
+
import {
|
|
56
|
+
collectTreeseedLiveHostedServiceChecks
|
|
57
|
+
} from "./operations/services/live-hosted-service-checks.js";
|
|
58
|
+
import {
|
|
59
|
+
runTreeseedOperationsRunnerSmoke
|
|
60
|
+
} from "./operations/services/operations-runner-smoke.js";
|
|
61
|
+
import {
|
|
62
|
+
readTreeseedVerificationCache,
|
|
63
|
+
treeseedVerificationCacheKey,
|
|
64
|
+
writeTreeseedVerificationCache
|
|
65
|
+
} from "./operations/services/verification-cache.js";
|
|
47
66
|
import {
|
|
48
67
|
assertDeploymentInitialized,
|
|
49
68
|
cleanupDestroyedState,
|
|
@@ -100,6 +119,7 @@ import {
|
|
|
100
119
|
validateRailwayDeployPrerequisites
|
|
101
120
|
} from "./operations/services/railway-deploy.js";
|
|
102
121
|
import {
|
|
122
|
+
deleteRailwayProject,
|
|
103
123
|
ensureRailwayEnvironment,
|
|
104
124
|
ensureRailwayProject,
|
|
105
125
|
ensureRailwayService,
|
|
@@ -115,6 +135,26 @@ import {
|
|
|
115
135
|
resolveRailwayWorkspaceContext,
|
|
116
136
|
upsertRailwayVariables
|
|
117
137
|
} from "./operations/services/railway-api.js";
|
|
138
|
+
import {
|
|
139
|
+
githubRepositoryCredentialEnvName,
|
|
140
|
+
resolveGitHubCredentialForRepository
|
|
141
|
+
} from "./operations/services/github-credentials.js";
|
|
142
|
+
import {
|
|
143
|
+
createGitHubApiClient,
|
|
144
|
+
dispatchGitHubWorkflowRun,
|
|
145
|
+
ensureGitHubActionsEnvironment,
|
|
146
|
+
getLatestGitHubWorkflowRun,
|
|
147
|
+
listGitHubEnvironmentSecretNames,
|
|
148
|
+
listGitHubEnvironmentVariableNames,
|
|
149
|
+
upsertGitHubEnvironmentSecret,
|
|
150
|
+
upsertGitHubEnvironmentVariable
|
|
151
|
+
} from "./operations/services/github-api.js";
|
|
152
|
+
import {
|
|
153
|
+
discoverTreeseedPackageAdapters,
|
|
154
|
+
findTreeseedPackageAdapter,
|
|
155
|
+
packageAdapterPlanSummary,
|
|
156
|
+
planTreeseedPackageDevelopmentImage
|
|
157
|
+
} from "./operations/services/package-adapters.js";
|
|
118
158
|
import {
|
|
119
159
|
runTenantDeployPreflight,
|
|
120
160
|
runWorkspaceReleasePreflight,
|
|
@@ -166,8 +206,8 @@ import {
|
|
|
166
206
|
createTreeseedReconcileRegistry,
|
|
167
207
|
deriveTreeseedDesiredUnits,
|
|
168
208
|
destroyTreeseedTargetUnits,
|
|
169
|
-
observeTreeseedUnits,
|
|
170
209
|
planTreeseedReconciliation,
|
|
210
|
+
refreshTreeseedUnits,
|
|
171
211
|
reconcileTreeseedTarget
|
|
172
212
|
} from "./reconcile/index.js";
|
|
173
213
|
export {
|
|
@@ -193,7 +233,11 @@ export {
|
|
|
193
233
|
collectDeploymentLockfileWorkspaceIssues,
|
|
194
234
|
collectMergeConflictReport,
|
|
195
235
|
collectTreeseedConfigContext,
|
|
236
|
+
collectTreeseedConfigSeedValues,
|
|
196
237
|
collectTreeseedDependencyStatus,
|
|
238
|
+
collectTreeseedDeploymentReadiness,
|
|
239
|
+
collectTreeseedHostedServiceChecks,
|
|
240
|
+
collectTreeseedLiveHostedServiceChecks,
|
|
197
241
|
collectTreeseedPrintEnvReport,
|
|
198
242
|
collectTreeseedReconcileStatus,
|
|
199
243
|
collectTreeseedToolStatus,
|
|
@@ -202,21 +246,26 @@ export {
|
|
|
202
246
|
createDefaultTreeseedMachineConfig,
|
|
203
247
|
createDeprecatedTaskTag,
|
|
204
248
|
createFeatureBranchFromStaging,
|
|
249
|
+
createGitHubApiClient,
|
|
205
250
|
createPersistentDeployTarget,
|
|
206
251
|
createTreeseedManagedToolEnv,
|
|
207
252
|
createTreeseedReconcileRegistry,
|
|
208
253
|
currentBranch,
|
|
209
254
|
currentManagedBranch,
|
|
210
255
|
deleteLocalBranch,
|
|
256
|
+
deleteRailwayProject,
|
|
211
257
|
deleteRemoteBranch,
|
|
212
258
|
deployRailwayService,
|
|
213
259
|
deployTargetLabel,
|
|
214
260
|
deriveTreeseedDesiredUnits,
|
|
215
261
|
destroyCloudflareResources,
|
|
216
262
|
destroyTreeseedTargetUnits,
|
|
263
|
+
discoverTreeseedPackageAdapters,
|
|
217
264
|
discoverWorkspaceLinks,
|
|
265
|
+
dispatchGitHubWorkflowRun,
|
|
218
266
|
dockerIsAvailable,
|
|
219
267
|
ensureGeneratedWranglerConfig,
|
|
268
|
+
ensureGitHubActionsEnvironment,
|
|
220
269
|
ensureLocalBranchTracking,
|
|
221
270
|
ensureLocalWorkspaceLinks,
|
|
222
271
|
ensureRailwayEnvironment,
|
|
@@ -230,14 +279,18 @@ export {
|
|
|
230
279
|
finalizeTreeseedConfig,
|
|
231
280
|
findNearestTreeseedRoot,
|
|
232
281
|
findNearestTreeseedWorkspaceRoot,
|
|
282
|
+
findTreeseedPackageAdapter,
|
|
233
283
|
formatMergeConflictReport,
|
|
234
284
|
formatTreeseedDependencyFailureDetails,
|
|
235
285
|
formatTreeseedDependencyReport,
|
|
236
286
|
formatTreeseedHostingAuditReport,
|
|
287
|
+
formatTreeseedReadinessReport,
|
|
288
|
+
getLatestGitHubWorkflowRun,
|
|
237
289
|
getRailwayAuthProfile,
|
|
238
290
|
getTreeseedMachineConfigPaths,
|
|
239
291
|
gitStatusPorcelain,
|
|
240
292
|
gitWorkflowRoot,
|
|
293
|
+
githubRepositoryCredentialEnvName,
|
|
241
294
|
hasMeaningfulChanges,
|
|
242
295
|
incrementVersion,
|
|
243
296
|
inspectTreeseedKeyAgentStatus,
|
|
@@ -247,6 +300,8 @@ export {
|
|
|
247
300
|
installTreeseedDependencies,
|
|
248
301
|
isWorkspaceRoot,
|
|
249
302
|
listDeprecatedTreeseedLocalEnvFiles,
|
|
303
|
+
listGitHubEnvironmentSecretNames,
|
|
304
|
+
listGitHubEnvironmentVariableNames,
|
|
250
305
|
listRailwayEnvironments,
|
|
251
306
|
listRailwayProjects,
|
|
252
307
|
listRailwayServices,
|
|
@@ -260,9 +315,10 @@ export {
|
|
|
260
315
|
mergeCurrentBranchIntoStaging,
|
|
261
316
|
mergeStagingIntoMain,
|
|
262
317
|
migrateTreeseedMachineKeyToWrapped,
|
|
263
|
-
observeTreeseedUnits,
|
|
264
318
|
originRemoteUrl,
|
|
319
|
+
packageAdapterPlanSummary,
|
|
265
320
|
packageScriptPath,
|
|
321
|
+
planTreeseedPackageDevelopmentImage,
|
|
266
322
|
planTreeseedReconciliation,
|
|
267
323
|
planWorkspaceReleaseBump,
|
|
268
324
|
prepareReleaseBranches,
|
|
@@ -271,9 +327,12 @@ export {
|
|
|
271
327
|
provisionCloudflareResources,
|
|
272
328
|
pushBranch,
|
|
273
329
|
railwayGraphqlRequest,
|
|
330
|
+
readTreeseedVerificationCache,
|
|
274
331
|
reconcileTreeseedTarget,
|
|
332
|
+
refreshTreeseedUnits,
|
|
275
333
|
remoteBranchExists,
|
|
276
334
|
repoRoot,
|
|
335
|
+
resolveGitHubCredentialForRepository,
|
|
277
336
|
resolveRailwayApiToken,
|
|
278
337
|
resolveRailwayApiUrl,
|
|
279
338
|
resolveRailwayWorkspace,
|
|
@@ -293,17 +352,21 @@ export {
|
|
|
293
352
|
runTenantDeployPreflight,
|
|
294
353
|
runTreeseedCopilotTask,
|
|
295
354
|
runTreeseedHostingAudit,
|
|
355
|
+
runTreeseedOperationsRunnerSmoke,
|
|
296
356
|
runWorkspaceReleasePreflight,
|
|
297
357
|
runWorkspaceSavePreflight,
|
|
298
358
|
setTreeseedRemoteSession,
|
|
299
359
|
stopKnownMailpitContainers,
|
|
300
360
|
syncBranchWithOrigin,
|
|
301
361
|
syncCloudflareSecrets,
|
|
362
|
+
treeseedVerificationCacheKey,
|
|
302
363
|
unlinkLocalWorkspaceLinks,
|
|
303
364
|
unlockTreeseedSecretSessionFromEnv,
|
|
304
365
|
unlockTreeseedSecretSessionInteractive,
|
|
305
366
|
unlockTreeseedSecretSessionWithPassphrase,
|
|
306
367
|
updateTreeseedDeployConfigFeatureToggles,
|
|
368
|
+
upsertGitHubEnvironmentSecret,
|
|
369
|
+
upsertGitHubEnvironmentVariable,
|
|
307
370
|
upsertRailwayVariables,
|
|
308
371
|
validateDeployPrerequisites,
|
|
309
372
|
validateDestroyPrerequisites,
|
|
@@ -312,5 +375,6 @@ export {
|
|
|
312
375
|
warnDeprecatedTreeseedLocalEnvFiles,
|
|
313
376
|
withTreeseedKeyAgentAutopromptDisabled,
|
|
314
377
|
workspaceRoot,
|
|
315
|
-
writeTreeseedMachineConfig
|
|
378
|
+
writeTreeseedMachineConfig,
|
|
379
|
+
writeTreeseedVerificationCache
|
|
316
380
|
};
|
package/dist/workflow.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export type TreeseedWorkflowExecutionMode = 'execute' | 'plan';
|
|
|
31
31
|
export type TreeseedWorkflowWorktreeMode = 'auto' | 'on' | 'off';
|
|
32
32
|
export type TreeseedWorkflowCiMode = 'auto' | 'hosted' | 'off';
|
|
33
33
|
export type TreeseedWorkflowVerifyMode = 'fast' | 'local' | 'hosted' | 'both' | 'skip';
|
|
34
|
+
export type TreeseedReleaseCandidateMode = 'hybrid' | 'strict' | 'skip';
|
|
34
35
|
export type TreeseedWorkflowContext = {
|
|
35
36
|
cwd?: string;
|
|
36
37
|
env?: NodeJS.ProcessEnv;
|
|
@@ -108,9 +109,11 @@ export type TreeseedSaveInput = {
|
|
|
108
109
|
gitRemoteWriteMode?: 'ssh-pushurl' | 'off';
|
|
109
110
|
verifyMode?: 'action-first' | 'local-only' | 'skip' | TreeseedWorkflowVerifyMode;
|
|
110
111
|
ciMode?: TreeseedWorkflowCiMode;
|
|
112
|
+
lane?: 'fast' | 'promotion';
|
|
111
113
|
worktreeMode?: TreeseedWorkflowWorktreeMode;
|
|
112
114
|
commitMessageMode?: 'auto' | 'cloudflare' | 'generated' | 'fallback';
|
|
113
115
|
workspaceLinks?: 'auto' | 'off';
|
|
116
|
+
releaseCandidate?: TreeseedReleaseCandidateMode;
|
|
114
117
|
verifyDeployedResources?: boolean;
|
|
115
118
|
plan?: boolean;
|
|
116
119
|
dryRun?: boolean;
|
|
@@ -219,6 +222,7 @@ export type TreeseedReleaseInput = {
|
|
|
219
222
|
ciMode?: TreeseedWorkflowCiMode;
|
|
220
223
|
worktreeMode?: TreeseedWorkflowWorktreeMode;
|
|
221
224
|
workspaceLinks?: 'auto' | 'off';
|
|
225
|
+
verifyDeployedResources?: boolean;
|
|
222
226
|
fresh?: boolean;
|
|
223
227
|
plan?: boolean;
|
|
224
228
|
dryRun?: boolean;
|
|
@@ -248,6 +252,7 @@ export type TreeseedDestroyInput = {
|
|
|
248
252
|
destroyLocal?: boolean;
|
|
249
253
|
force?: boolean;
|
|
250
254
|
deleteData?: boolean;
|
|
255
|
+
sweepTreeseed?: boolean;
|
|
251
256
|
removeBuildArtifacts?: boolean;
|
|
252
257
|
};
|
|
253
258
|
export type TreeseedWorkflowDevInput = {
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
CREATE TABLE IF NOT EXISTS "treedx_instances" (
|
|
2
|
+
"id" text PRIMARY KEY NOT NULL,
|
|
3
|
+
"team_id" text NOT NULL,
|
|
4
|
+
"kind" text NOT NULL,
|
|
5
|
+
"provider" text NOT NULL,
|
|
6
|
+
"name" text NOT NULL,
|
|
7
|
+
"base_url" text,
|
|
8
|
+
"registry_url" text,
|
|
9
|
+
"public_read" integer DEFAULT 0 NOT NULL,
|
|
10
|
+
"primary" integer DEFAULT 1 NOT NULL,
|
|
11
|
+
"status" text DEFAULT 'pending' NOT NULL,
|
|
12
|
+
"image_ref" text,
|
|
13
|
+
"railway_project_id" text,
|
|
14
|
+
"railway_service_id" text,
|
|
15
|
+
"railway_environment_id" text,
|
|
16
|
+
"volume_mount_path" text,
|
|
17
|
+
"metadata_json" text DEFAULT '{}' NOT NULL,
|
|
18
|
+
"created_at" text NOT NULL,
|
|
19
|
+
"updated_at" text NOT NULL
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
CREATE TABLE IF NOT EXISTS "treedx_project_libraries" (
|
|
23
|
+
"id" text PRIMARY KEY NOT NULL,
|
|
24
|
+
"team_id" text NOT NULL,
|
|
25
|
+
"project_id" text NOT NULL,
|
|
26
|
+
"instance_id" text NOT NULL,
|
|
27
|
+
"library_id" text NOT NULL,
|
|
28
|
+
"repository_id" text,
|
|
29
|
+
"content_path" text DEFAULT 'src/content' NOT NULL,
|
|
30
|
+
"content_repository_url" text,
|
|
31
|
+
"content_repository_default_branch" text,
|
|
32
|
+
"content_repository_ref" text,
|
|
33
|
+
"r2_bucket_name" text,
|
|
34
|
+
"r2_manifest_key" text,
|
|
35
|
+
"topology_json" text DEFAULT '{}' NOT NULL,
|
|
36
|
+
"metadata_json" text DEFAULT '{}' NOT NULL,
|
|
37
|
+
"created_at" text NOT NULL,
|
|
38
|
+
"updated_at" text NOT NULL
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
CREATE TABLE IF NOT EXISTS "treedx_mirrors" (
|
|
42
|
+
"id" text PRIMARY KEY NOT NULL,
|
|
43
|
+
"team_id" text NOT NULL,
|
|
44
|
+
"instance_id" text NOT NULL,
|
|
45
|
+
"name" text NOT NULL,
|
|
46
|
+
"direction" text DEFAULT 'bidirectional' NOT NULL,
|
|
47
|
+
"target_kind" text NOT NULL,
|
|
48
|
+
"target_url" text,
|
|
49
|
+
"status" text DEFAULT 'pending' NOT NULL,
|
|
50
|
+
"instructions" text,
|
|
51
|
+
"last_sync_at" text,
|
|
52
|
+
"last_sync_status" text,
|
|
53
|
+
"last_sync_metadata_json" text DEFAULT '{}' NOT NULL,
|
|
54
|
+
"metadata_json" text DEFAULT '{}' NOT NULL,
|
|
55
|
+
"created_at" text NOT NULL,
|
|
56
|
+
"updated_at" text NOT NULL
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
CREATE TABLE IF NOT EXISTS "treedx_shares" (
|
|
60
|
+
"id" text PRIMARY KEY NOT NULL,
|
|
61
|
+
"team_id" text NOT NULL,
|
|
62
|
+
"instance_id" text,
|
|
63
|
+
"project_id" text,
|
|
64
|
+
"library_id" text,
|
|
65
|
+
"scope" text NOT NULL,
|
|
66
|
+
"target_team_id" text,
|
|
67
|
+
"trust_grant_json" text DEFAULT '{}' NOT NULL,
|
|
68
|
+
"public_read" integer DEFAULT 0 NOT NULL,
|
|
69
|
+
"status" text DEFAULT 'active' NOT NULL,
|
|
70
|
+
"expires_at" text,
|
|
71
|
+
"metadata_json" text DEFAULT '{}' NOT NULL,
|
|
72
|
+
"created_at" text NOT NULL,
|
|
73
|
+
"updated_at" text NOT NULL,
|
|
74
|
+
"revoked_at" text
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
CREATE TABLE IF NOT EXISTS "treedx_deployments" (
|
|
78
|
+
"id" text PRIMARY KEY NOT NULL,
|
|
79
|
+
"team_id" text NOT NULL,
|
|
80
|
+
"instance_id" text,
|
|
81
|
+
"provider" text NOT NULL,
|
|
82
|
+
"status" text DEFAULT 'queued' NOT NULL,
|
|
83
|
+
"image_ref" text,
|
|
84
|
+
"volume_mount_path" text,
|
|
85
|
+
"service_refs_json" text DEFAULT '{}' NOT NULL,
|
|
86
|
+
"result_json" text DEFAULT '{}' NOT NULL,
|
|
87
|
+
"error_json" text,
|
|
88
|
+
"created_at" text NOT NULL,
|
|
89
|
+
"updated_at" text NOT NULL,
|
|
90
|
+
"completed_at" text
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
CREATE INDEX IF NOT EXISTS "idx_treedx_instances_team_status" ON "treedx_instances" USING btree ("team_id","status");
|
|
94
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "idx_treedx_instances_one_active_primary" ON "treedx_instances" USING btree ("team_id") WHERE "primary" = 1 AND "status" = 'active';
|
|
95
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "idx_treedx_project_libraries_project" ON "treedx_project_libraries" USING btree ("project_id");
|
|
96
|
+
CREATE INDEX IF NOT EXISTS "idx_treedx_project_libraries_instance" ON "treedx_project_libraries" USING btree ("instance_id");
|
|
97
|
+
CREATE INDEX IF NOT EXISTS "idx_treedx_mirrors_team_instance" ON "treedx_mirrors" USING btree ("team_id","instance_id");
|
|
98
|
+
CREATE INDEX IF NOT EXISTS "idx_treedx_shares_team_scope" ON "treedx_shares" USING btree ("team_id","scope","status");
|
|
99
|
+
CREATE INDEX IF NOT EXISTS "idx_treedx_deployments_team_instance" ON "treedx_deployments" USING btree ("team_id","instance_id","created_at");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@treeseed/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Shared Treeseed SDK for content-backed and D1-backed object models.",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"setup:ci": "npm ci",
|
|
36
36
|
"build": "npm run build:dist",
|
|
37
37
|
"build:dist": "node ./scripts/run-ts.mjs ./scripts/build-dist.ts",
|
|
38
|
-
"db:generate:d1": "
|
|
39
|
-
"db:generate:market": "
|
|
38
|
+
"db:generate:d1": "drizzle-kit export --config drizzle.config.ts > drizzle/d1/0000_treeseed_d1.sql",
|
|
39
|
+
"db:generate:market": "drizzle-kit export --config drizzle.market.config.ts > drizzle/market/0000_market_control_plane.sql",
|
|
40
40
|
"prepare": "node ./scripts/prepare.mjs",
|
|
41
41
|
"prepack": "npm run build:dist",
|
|
42
42
|
"test": "npm run test:unit",
|
|
@@ -45,6 +45,9 @@
|
|
|
45
45
|
"test:workflow:lifecycle": "vitest run --config ./vitest.config.ts test/utils/workflow-lifecycle.test.ts",
|
|
46
46
|
"test:release": "npm run test:unit:fast",
|
|
47
47
|
"test:smoke": "node ./scripts/run-ts.mjs ./scripts/test-smoke.ts",
|
|
48
|
+
"treedx:generate-types": "node ./scripts/run-ts.mjs ./scripts/generate-treedx-openapi-types.ts",
|
|
49
|
+
"treedx:check-types": "node ./scripts/run-ts.mjs ./scripts/generate-treedx-openapi-types.ts --check",
|
|
50
|
+
"treedx:contract": "vitest run --config ./vitest.config.ts test/utils/treedx-openapi-contract.test.ts test/utils/treedx-sdk-request-contract.test.ts test/utils/treedx-generated-types.test.ts",
|
|
48
51
|
"fixtures:resolve": "node ./scripts/run-ts.mjs ./scripts/fixture-tools.ts resolve",
|
|
49
52
|
"fixtures:check": "node ./scripts/run-ts.mjs ./scripts/fixture-tools.ts check",
|
|
50
53
|
"lint": "npm run fixtures:check && npm run build:dist",
|
|
@@ -142,6 +145,10 @@
|
|
|
142
145
|
"types": "./dist/reconcile/index.d.ts",
|
|
143
146
|
"default": "./dist/reconcile/index.js"
|
|
144
147
|
},
|
|
148
|
+
"./hosting": {
|
|
149
|
+
"types": "./dist/hosting/index.d.ts",
|
|
150
|
+
"default": "./dist/hosting/index.js"
|
|
151
|
+
},
|
|
145
152
|
"./platform/contracts": {
|
|
146
153
|
"types": "./dist/platform/contracts.d.ts",
|
|
147
154
|
"default": "./dist/platform/contracts.js"
|
|
@@ -194,6 +201,10 @@
|
|
|
194
201
|
"types": "./dist/content-store.d.ts",
|
|
195
202
|
"default": "./dist/content-store.js"
|
|
196
203
|
},
|
|
204
|
+
"./treedx-backends": {
|
|
205
|
+
"types": "./dist/treedx-backends.d.ts",
|
|
206
|
+
"default": "./dist/treedx-backends.js"
|
|
207
|
+
},
|
|
197
208
|
"./template-catalog": {
|
|
198
209
|
"types": "./dist/template-catalog.d.ts",
|
|
199
210
|
"default": "./dist/template-catalog.js"
|
|
@@ -234,6 +245,26 @@
|
|
|
234
245
|
"types": "./dist/graph/context-query-contracts.d.ts",
|
|
235
246
|
"default": "./dist/graph/context-query-contracts.js"
|
|
236
247
|
},
|
|
248
|
+
"./treedx": {
|
|
249
|
+
"types": "./dist/treedx/index.d.ts",
|
|
250
|
+
"import": "./dist/treedx/index.js",
|
|
251
|
+
"default": "./dist/treedx/index.js"
|
|
252
|
+
},
|
|
253
|
+
"./treedx/client": {
|
|
254
|
+
"types": "./dist/treedx/client.d.ts",
|
|
255
|
+
"import": "./dist/treedx/client.js",
|
|
256
|
+
"default": "./dist/treedx/client.js"
|
|
257
|
+
},
|
|
258
|
+
"./treedx/types": {
|
|
259
|
+
"types": "./dist/treedx/types.d.ts",
|
|
260
|
+
"import": "./dist/treedx/types.js",
|
|
261
|
+
"default": "./dist/treedx/types.js"
|
|
262
|
+
},
|
|
263
|
+
"./treedx/adapters": {
|
|
264
|
+
"types": "./dist/treedx/adapters.d.ts",
|
|
265
|
+
"import": "./dist/treedx/adapters.js",
|
|
266
|
+
"default": "./dist/treedx/adapters.js"
|
|
267
|
+
},
|
|
237
268
|
"./sdk-filters": {
|
|
238
269
|
"types": "./dist/sdk-filters.d.ts",
|
|
239
270
|
"default": "./dist/sdk-filters.js"
|