@treeseed/sdk 0.4.7 → 0.4.9
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 +1 -1
- package/dist/dispatch.d.ts +4 -0
- package/dist/dispatch.js +180 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +25 -3
- package/dist/operations/providers/default.js +1 -0
- package/dist/operations/services/config-runtime.d.ts +121 -26
- package/dist/operations/services/config-runtime.js +332 -198
- package/dist/operations/services/deploy.d.ts +0 -3
- package/dist/operations/services/deploy.js +1 -1
- package/dist/operations/services/export-runtime.d.ts +18 -0
- package/dist/operations/services/export-runtime.js +136 -0
- package/dist/operations/services/railway-deploy.js +2 -2
- package/dist/operations/services/runtime-tools.d.ts +0 -1
- package/dist/operations/services/runtime-tools.js +1 -2
- package/dist/operations-registry.js +1 -0
- package/dist/operations-types.d.ts +1 -1
- package/dist/platform/book-export.d.ts +78 -0
- package/dist/platform/book-export.js +449 -0
- package/dist/platform/contracts.d.ts +6 -2
- package/dist/platform/deploy-config.d.ts +2 -0
- package/dist/platform/deploy-config.js +30 -2
- package/dist/platform/env.yaml +5 -0
- package/dist/platform/environment.d.ts +10 -1
- package/dist/platform/environment.js +82 -6
- package/dist/remote.d.ts +65 -9
- package/dist/remote.js +104 -28
- package/dist/scripts/aggregate-book.js +13 -118
- package/dist/scripts/config-treeseed.js +18 -27
- package/dist/sdk-dispatch.d.ts +12 -0
- package/dist/sdk-dispatch.js +142 -0
- package/dist/sdk-types.d.ts +137 -4
- package/dist/sdk-types.js +16 -0
- package/dist/sdk.d.ts +7 -1
- package/dist/sdk.js +69 -0
- package/dist/workflow/operations.d.ts +59 -15
- package/dist/workflow/operations.js +61 -81
- package/dist/workflow-state.js +2 -1
- package/dist/workflow-support.d.ts +2 -1
- package/dist/workflow-support.js +14 -6
- package/dist/workflow.d.ts +11 -1
- package/dist/workflow.js +6 -0
- package/package.json +6 -1
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
import { readFileSync, writeFileSync
|
|
1
|
+
import { readFileSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { resolve } from "node:path";
|
|
3
3
|
import { spawn, spawnSync } from "node:child_process";
|
|
4
4
|
import {
|
|
5
5
|
applyTreeseedEnvironmentToProcess,
|
|
6
|
+
applyTreeseedConfigValues,
|
|
7
|
+
applyTreeseedSafeRepairs,
|
|
6
8
|
assertTreeseedCommandEnvironment,
|
|
7
9
|
checkTreeseedProviderConnections,
|
|
8
|
-
|
|
10
|
+
collectTreeseedConfigContext,
|
|
11
|
+
collectTreeseedPrintEnvReport,
|
|
9
12
|
ensureTreeseedActVerificationTooling,
|
|
10
13
|
ensureTreeseedGitignoreEntries,
|
|
11
|
-
|
|
12
|
-
formatTreeseedProviderConnectionReport,
|
|
14
|
+
finalizeTreeseedConfig,
|
|
13
15
|
getTreeseedMachineConfigPaths,
|
|
14
|
-
|
|
15
|
-
resolveTreeseedMachineEnvironmentValues,
|
|
16
|
-
rotateTreeseedMachineKey,
|
|
17
|
-
runTreeseedConfigWizard,
|
|
18
|
-
writeTreeseedLocalEnvironmentFiles,
|
|
19
|
-
writeTreeseedMachineConfig
|
|
16
|
+
rotateTreeseedMachineKey
|
|
20
17
|
} from "../operations/services/config-runtime.js";
|
|
18
|
+
import { exportTreeseedCodebase } from "../operations/services/export-runtime.js";
|
|
21
19
|
import {
|
|
22
20
|
assertDeploymentInitialized,
|
|
23
21
|
cleanupDestroyedState,
|
|
@@ -196,51 +194,6 @@ function ensureLocalReadinessOrThrow(operation, tenantRoot) {
|
|
|
196
194
|
}
|
|
197
195
|
return state;
|
|
198
196
|
}
|
|
199
|
-
function dedupeRepairActions(actions) {
|
|
200
|
-
const seen = /* @__PURE__ */ new Set();
|
|
201
|
-
return actions.filter((action) => {
|
|
202
|
-
if (seen.has(action.id)) return false;
|
|
203
|
-
seen.add(action.id);
|
|
204
|
-
return true;
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
function applyTreeseedSafeRepairs(tenantRoot) {
|
|
208
|
-
const actions = [];
|
|
209
|
-
ensureTreeseedGitignoreEntries(tenantRoot);
|
|
210
|
-
actions.push({ id: "gitignore", detail: "Ensured Treeseed gitignore entries are present." });
|
|
211
|
-
const envLocalPath = resolve(tenantRoot, ".env.local");
|
|
212
|
-
const envLocalExamplePath = resolve(tenantRoot, ".env.local.example");
|
|
213
|
-
if (!existsSync(envLocalPath) && existsSync(envLocalExamplePath)) {
|
|
214
|
-
copyFileSync(envLocalExamplePath, envLocalPath);
|
|
215
|
-
actions.push({ id: "env-local", detail: "Created .env.local from .env.local.example." });
|
|
216
|
-
}
|
|
217
|
-
const deployConfig = loadCliDeployConfig(tenantRoot);
|
|
218
|
-
const { configPath } = getTreeseedMachineConfigPaths(tenantRoot);
|
|
219
|
-
if (!existsSync(configPath)) {
|
|
220
|
-
const machineConfig2 = createDefaultTreeseedMachineConfig({
|
|
221
|
-
tenantRoot,
|
|
222
|
-
deployConfig,
|
|
223
|
-
tenantConfig: void 0
|
|
224
|
-
});
|
|
225
|
-
writeTreeseedMachineConfig(tenantRoot, machineConfig2);
|
|
226
|
-
actions.push({ id: "machine-config", detail: "Created the default Treeseed machine config." });
|
|
227
|
-
}
|
|
228
|
-
resolveTreeseedMachineEnvironmentValues(tenantRoot, "local");
|
|
229
|
-
actions.push({ id: "machine-key", detail: "Ensured the Treeseed machine key exists." });
|
|
230
|
-
const machineConfig = loadTreeseedMachineConfig(tenantRoot);
|
|
231
|
-
writeTreeseedMachineConfig(tenantRoot, machineConfig);
|
|
232
|
-
writeTreeseedLocalEnvironmentFiles(tenantRoot);
|
|
233
|
-
actions.push({ id: "local-env", detail: "Regenerated .env.local and .dev.vars from the current machine config." });
|
|
234
|
-
for (const scope of ["local", "staging", "prod"]) {
|
|
235
|
-
const target = createPersistentDeployTarget(scope);
|
|
236
|
-
const state = loadDeployState(tenantRoot, deployConfig, { target });
|
|
237
|
-
if (state.readiness?.initialized || scope === "local") {
|
|
238
|
-
ensureGeneratedWranglerConfig(tenantRoot, { target });
|
|
239
|
-
actions.push({ id: `wrangler-${scope}`, detail: `Regenerated the ${scope} generated Wrangler config.` });
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
return dedupeRepairActions(actions);
|
|
243
|
-
}
|
|
244
197
|
function bumpRootPackageJson(root, level) {
|
|
245
198
|
const packageJsonPath = resolve(root, "package.json");
|
|
246
199
|
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
|
|
@@ -456,23 +409,22 @@ async function workflowConfig(helpers, input = {}) {
|
|
|
456
409
|
});
|
|
457
410
|
ensureTreeseedGitignoreEntries(tenantRoot);
|
|
458
411
|
const preflight = collectCliPreflight({ cwd: tenantRoot, requireAuth: false });
|
|
412
|
+
const contextSnapshot = collectTreeseedConfigContext({
|
|
413
|
+
tenantRoot,
|
|
414
|
+
scopes,
|
|
415
|
+
env: helpers.context.env
|
|
416
|
+
});
|
|
459
417
|
if (printEnvOnly) {
|
|
460
|
-
const
|
|
418
|
+
const reports2 = scopes.map((scope) => ({
|
|
461
419
|
scope,
|
|
462
|
-
|
|
420
|
+
environment: collectTreeseedPrintEnvReport({
|
|
463
421
|
tenantRoot,
|
|
464
422
|
scope,
|
|
465
423
|
env: helpers.context.env,
|
|
466
424
|
revealSecrets
|
|
467
425
|
}),
|
|
468
|
-
|
|
469
|
-
checkTreeseedProviderConnections({ tenantRoot, scope, env: helpers.context.env })
|
|
470
|
-
)
|
|
426
|
+
provider: checkTreeseedProviderConnections({ tenantRoot, scope, env: helpers.context.env })
|
|
471
427
|
}));
|
|
472
|
-
for (const report of reports) {
|
|
473
|
-
maybePrint(helpers.write, report.environmentReport);
|
|
474
|
-
maybePrint(helpers.write, report.providerReport);
|
|
475
|
-
}
|
|
476
428
|
return {
|
|
477
429
|
ok: true,
|
|
478
430
|
operation: "config",
|
|
@@ -481,7 +433,7 @@ async function workflowConfig(helpers, input = {}) {
|
|
|
481
433
|
scopes,
|
|
482
434
|
sync,
|
|
483
435
|
secretsRevealed: revealSecrets,
|
|
484
|
-
reports,
|
|
436
|
+
reports: reports2,
|
|
485
437
|
repairs,
|
|
486
438
|
preflight,
|
|
487
439
|
toolHealth
|
|
@@ -510,25 +462,40 @@ async function workflowConfig(helpers, input = {}) {
|
|
|
510
462
|
])
|
|
511
463
|
};
|
|
512
464
|
}
|
|
513
|
-
const
|
|
465
|
+
const explicitUpdates = Array.isArray(input.updates) ? input.updates.map((update) => ({
|
|
466
|
+
scope: update.scope,
|
|
467
|
+
entryId: String(update.entryId ?? ""),
|
|
468
|
+
value: typeof update.value === "string" ? update.value : "",
|
|
469
|
+
reused: update.reused === true
|
|
470
|
+
})) : null;
|
|
471
|
+
const autoUpdates = scopes.flatMap(
|
|
472
|
+
(scope) => contextSnapshot.entriesByScope[scope].map((entry) => ({
|
|
473
|
+
scope,
|
|
474
|
+
entryId: entry.id,
|
|
475
|
+
value: entry.effectiveValue,
|
|
476
|
+
reused: entry.currentValue.length > 0 || entry.suggestedValue.length > 0
|
|
477
|
+
}))
|
|
478
|
+
);
|
|
479
|
+
const applyResult = applyTreeseedConfigValues({
|
|
480
|
+
tenantRoot,
|
|
481
|
+
updates: explicitUpdates ?? autoUpdates
|
|
482
|
+
});
|
|
483
|
+
const finalizeResult = finalizeTreeseedConfig({
|
|
514
484
|
tenantRoot,
|
|
515
485
|
scopes,
|
|
516
486
|
sync,
|
|
517
|
-
|
|
518
|
-
env: helpers.context.env,
|
|
519
|
-
useInk: input.nonInteractive === true ? false : process.stdin.isTTY && process.stdout.isTTY,
|
|
520
|
-
printEnv,
|
|
521
|
-
revealSecrets,
|
|
522
|
-
write: (line) => maybePrint(helpers.write, line),
|
|
523
|
-
prompt: async (message) => {
|
|
524
|
-
if (input.nonInteractive === true) {
|
|
525
|
-
return "";
|
|
526
|
-
}
|
|
527
|
-
return String(await (helpers.context.prompt?.(message) ?? ""));
|
|
528
|
-
}
|
|
487
|
+
env: helpers.context.env
|
|
529
488
|
});
|
|
530
|
-
|
|
531
|
-
|
|
489
|
+
const reports = printEnv ? scopes.map((scope) => ({
|
|
490
|
+
scope,
|
|
491
|
+
environment: collectTreeseedPrintEnvReport({
|
|
492
|
+
tenantRoot,
|
|
493
|
+
scope,
|
|
494
|
+
env: helpers.context.env,
|
|
495
|
+
revealSecrets
|
|
496
|
+
}),
|
|
497
|
+
provider: finalizeResult.connectionChecks.find((report) => report.scope === scope) ?? checkTreeseedProviderConnections({ tenantRoot, scope, env: helpers.context.env })
|
|
498
|
+
})) : [];
|
|
532
499
|
const { configPath, keyPath } = getTreeseedMachineConfigPaths(tenantRoot);
|
|
533
500
|
const state = resolveTreeseedWorkflowState(tenantRoot);
|
|
534
501
|
return buildWorkflowResult(
|
|
@@ -543,7 +510,12 @@ async function workflowConfig(helpers, input = {}) {
|
|
|
543
510
|
repairs,
|
|
544
511
|
preflight,
|
|
545
512
|
toolHealth,
|
|
546
|
-
|
|
513
|
+
context: contextSnapshot,
|
|
514
|
+
result: {
|
|
515
|
+
...applyResult,
|
|
516
|
+
...finalizeResult
|
|
517
|
+
},
|
|
518
|
+
reports,
|
|
547
519
|
state,
|
|
548
520
|
readiness: state.readiness
|
|
549
521
|
},
|
|
@@ -558,6 +530,13 @@ async function workflowConfig(helpers, input = {}) {
|
|
|
558
530
|
toError("config", error);
|
|
559
531
|
}
|
|
560
532
|
}
|
|
533
|
+
async function workflowExport(helpers, input = {}) {
|
|
534
|
+
return await withContextEnv(helpers.context.env, async () => {
|
|
535
|
+
const directory = resolve(helpers.context.cwd ?? helpers.cwd(), input.directory ?? ".");
|
|
536
|
+
const exported = await exportTreeseedCodebase({ directory });
|
|
537
|
+
return buildWorkflowResult("export", exported.tenantRoot, exported);
|
|
538
|
+
});
|
|
539
|
+
}
|
|
561
540
|
async function workflowSwitch(helpers, input) {
|
|
562
541
|
try {
|
|
563
542
|
return withContextEnv(helpers.context.env, () => {
|
|
@@ -966,6 +945,7 @@ export {
|
|
|
966
945
|
workflowConfig,
|
|
967
946
|
workflowDestroy,
|
|
968
947
|
workflowDev,
|
|
948
|
+
workflowExport,
|
|
969
949
|
workflowRelease,
|
|
970
950
|
workflowSave,
|
|
971
951
|
workflowStage,
|
package/dist/workflow-state.js
CHANGED
|
@@ -88,6 +88,7 @@ function resolveTreeseedWorkflowState(cwd) {
|
|
|
88
88
|
agents: { enabled: false, initialized: false, lastDeploymentTimestamp: null, lastDeployedUrl: null, provider: null },
|
|
89
89
|
manager: { enabled: false, initialized: false, lastDeploymentTimestamp: null, lastDeployedUrl: null, provider: null },
|
|
90
90
|
worker: { enabled: false, initialized: false, lastDeploymentTimestamp: null, lastDeployedUrl: null, provider: null },
|
|
91
|
+
runner: { enabled: false, initialized: false, lastDeploymentTimestamp: null, lastDeployedUrl: null, provider: null },
|
|
91
92
|
workdayStart: { enabled: false, initialized: false, lastDeploymentTimestamp: null, lastDeployedUrl: null, provider: null },
|
|
92
93
|
workdayReport: { enabled: false, initialized: false, lastDeploymentTimestamp: null, lastDeployedUrl: null, provider: null }
|
|
93
94
|
},
|
|
@@ -128,7 +129,7 @@ function resolveTreeseedWorkflowState(cwd) {
|
|
|
128
129
|
url: typeof latestHistory?.url === "string" ? latestHistory.url : deployState.lastDeployedUrl ?? null
|
|
129
130
|
});
|
|
130
131
|
}
|
|
131
|
-
for (const serviceKey of ["api", "agents", "manager", "worker", "workdayStart", "workdayReport"]) {
|
|
132
|
+
for (const serviceKey of ["api", "agents", "manager", "worker", "runner", "workdayStart", "workdayReport"]) {
|
|
132
133
|
const service = deployState.services?.[serviceKey];
|
|
133
134
|
if (!service) continue;
|
|
134
135
|
state.managedServices[serviceKey] = {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { applyTreeseedEnvironmentToProcess, assertTreeseedCommandEnvironment, checkTreeseedProviderConnections, clearTreeseedRemoteSession,
|
|
1
|
+
export { applyTreeseedConfigValues, applyTreeseedEnvironmentToProcess, applyTreeseedSafeRepairs, assertTreeseedCommandEnvironment, checkTreeseedProviderConnections, clearTreeseedRemoteSession, collectTreeseedConfigContext, collectTreeseedPrintEnvReport, createDefaultTreeseedMachineConfig, ensureTreeseedGitignoreEntries, getTreeseedMachineConfigPaths, loadTreeseedMachineConfig, listRelevantTreeseedConfigEntries, finalizeTreeseedConfig, resolveTreeseedMachineEnvironmentValues, resolveTreeseedRemoteConfig, resolveTreeseedRemoteSession, rotateTreeseedMachineKey, setTreeseedRemoteSession, writeTreeseedLocalEnvironmentFiles, writeTreeseedMachineConfig, } from './operations/services/config-runtime.ts';
|
|
2
|
+
export { exportTreeseedCodebase } from './operations/services/export-runtime.ts';
|
|
2
3
|
export { assertDeploymentInitialized, cleanupDestroyedState, createBranchPreviewDeployTarget, createPersistentDeployTarget, deployTargetLabel, destroyCloudflareResources, ensureGeneratedWranglerConfig, finalizeDeploymentState, loadDeployState, printDeploySummary, printDestroySummary, provisionCloudflareResources, runRemoteD1Migrations, syncCloudflareSecrets, validateDeployPrerequisites, validateDestroyPrerequisites, } from './operations/services/deploy.ts';
|
|
3
4
|
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';
|
|
4
5
|
export { loadCliDeployConfig, packageScriptPath, resolveWranglerBin, } from './operations/services/runtime-tools.ts';
|
package/dist/workflow-support.js
CHANGED
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
|
+
applyTreeseedConfigValues,
|
|
2
3
|
applyTreeseedEnvironmentToProcess,
|
|
4
|
+
applyTreeseedSafeRepairs,
|
|
3
5
|
assertTreeseedCommandEnvironment,
|
|
4
6
|
checkTreeseedProviderConnections,
|
|
5
7
|
clearTreeseedRemoteSession,
|
|
8
|
+
collectTreeseedConfigContext,
|
|
9
|
+
collectTreeseedPrintEnvReport,
|
|
6
10
|
createDefaultTreeseedMachineConfig,
|
|
7
11
|
ensureTreeseedGitignoreEntries,
|
|
8
|
-
formatTreeseedConfigEnvironmentReport,
|
|
9
|
-
formatTreeseedProviderConnectionReport,
|
|
10
12
|
getTreeseedMachineConfigPaths,
|
|
11
13
|
loadTreeseedMachineConfig,
|
|
14
|
+
listRelevantTreeseedConfigEntries,
|
|
15
|
+
finalizeTreeseedConfig,
|
|
12
16
|
resolveTreeseedMachineEnvironmentValues,
|
|
13
17
|
resolveTreeseedRemoteConfig,
|
|
14
18
|
resolveTreeseedRemoteSession,
|
|
15
19
|
rotateTreeseedMachineKey,
|
|
16
|
-
runTreeseedConfigWizard,
|
|
17
20
|
setTreeseedRemoteSession,
|
|
18
21
|
writeTreeseedLocalEnvironmentFiles,
|
|
19
22
|
writeTreeseedMachineConfig
|
|
20
23
|
} from "./operations/services/config-runtime.js";
|
|
24
|
+
import { exportTreeseedCodebase } from "./operations/services/export-runtime.js";
|
|
21
25
|
import {
|
|
22
26
|
assertDeploymentInitialized,
|
|
23
27
|
cleanupDestroyedState,
|
|
@@ -96,7 +100,9 @@ import {
|
|
|
96
100
|
export {
|
|
97
101
|
PRODUCTION_BRANCH,
|
|
98
102
|
STAGING_BRANCH,
|
|
103
|
+
applyTreeseedConfigValues,
|
|
99
104
|
applyTreeseedEnvironmentToProcess,
|
|
105
|
+
applyTreeseedSafeRepairs,
|
|
100
106
|
applyWorkspaceVersionChanges,
|
|
101
107
|
assertCleanWorktree,
|
|
102
108
|
assertDeploymentInitialized,
|
|
@@ -109,6 +115,8 @@ export {
|
|
|
109
115
|
clearTreeseedRemoteSession,
|
|
110
116
|
collectCliPreflight,
|
|
111
117
|
collectMergeConflictReport,
|
|
118
|
+
collectTreeseedConfigContext,
|
|
119
|
+
collectTreeseedPrintEnvReport,
|
|
112
120
|
configuredRailwayServices,
|
|
113
121
|
createBranchPreviewDeployTarget,
|
|
114
122
|
createDefaultTreeseedMachineConfig,
|
|
@@ -125,18 +133,19 @@ export {
|
|
|
125
133
|
ensureGeneratedWranglerConfig,
|
|
126
134
|
ensureLocalBranchTracking,
|
|
127
135
|
ensureTreeseedGitignoreEntries,
|
|
136
|
+
exportTreeseedCodebase,
|
|
128
137
|
finalizeDeploymentState,
|
|
138
|
+
finalizeTreeseedConfig,
|
|
129
139
|
findNearestTreeseedRoot,
|
|
130
140
|
findNearestTreeseedWorkspaceRoot,
|
|
131
141
|
formatMergeConflictReport,
|
|
132
|
-
formatTreeseedConfigEnvironmentReport,
|
|
133
|
-
formatTreeseedProviderConnectionReport,
|
|
134
142
|
getTreeseedMachineConfigPaths,
|
|
135
143
|
gitStatusPorcelain,
|
|
136
144
|
gitWorkflowRoot,
|
|
137
145
|
hasMeaningfulChanges,
|
|
138
146
|
incrementVersion,
|
|
139
147
|
isWorkspaceRoot,
|
|
148
|
+
listRelevantTreeseedConfigEntries,
|
|
140
149
|
listTaskBranches,
|
|
141
150
|
loadCliDeployConfig,
|
|
142
151
|
loadDeployState,
|
|
@@ -161,7 +170,6 @@ export {
|
|
|
161
170
|
run,
|
|
162
171
|
runRemoteD1Migrations,
|
|
163
172
|
runTenantDeployPreflight,
|
|
164
|
-
runTreeseedConfigWizard,
|
|
165
173
|
runWorkspaceSavePreflight,
|
|
166
174
|
setTreeseedRemoteSession,
|
|
167
175
|
syncBranchWithOrigin,
|
package/dist/workflow.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { resolveTreeseedWorkflowState } from './workflow-state.ts';
|
|
2
2
|
import { listTaskBranches } from './operations/services/git-workflow.ts';
|
|
3
3
|
import { TreeseedWorkflowError, type TreeseedWorkflowErrorCode } from './workflow/operations.ts';
|
|
4
|
-
export type TreeseedWorkflowOperationId = 'status' | 'config' | 'tasks' | 'switch' | 'dev' | 'save' | 'close' | 'stage' | 'release' | 'destroy';
|
|
4
|
+
export type TreeseedWorkflowOperationId = 'status' | 'config' | 'tasks' | 'switch' | 'dev' | 'save' | 'close' | 'stage' | 'release' | 'destroy' | 'export';
|
|
5
5
|
export type TreeseedWorkflowNextStep = {
|
|
6
6
|
operation: string;
|
|
7
7
|
reason?: string;
|
|
@@ -64,6 +64,12 @@ export type TreeseedConfigInput = {
|
|
|
64
64
|
environment?: TreeseedConfigScope[] | TreeseedConfigScope;
|
|
65
65
|
syncProviders?: 'none' | 'github' | 'cloudflare' | 'railway' | 'all';
|
|
66
66
|
sync?: 'none' | 'github' | 'cloudflare' | 'railway' | 'all';
|
|
67
|
+
updates?: Array<{
|
|
68
|
+
scope: Exclude<TreeseedConfigScope, 'all'>;
|
|
69
|
+
entryId: string;
|
|
70
|
+
value: string;
|
|
71
|
+
reused?: boolean;
|
|
72
|
+
}>;
|
|
67
73
|
repair?: boolean;
|
|
68
74
|
printEnv?: boolean;
|
|
69
75
|
printEnvOnly?: boolean;
|
|
@@ -71,6 +77,9 @@ export type TreeseedConfigInput = {
|
|
|
71
77
|
rotateMachineKey?: boolean;
|
|
72
78
|
nonInteractive?: boolean;
|
|
73
79
|
};
|
|
80
|
+
export type TreeseedExportInput = {
|
|
81
|
+
directory?: string;
|
|
82
|
+
};
|
|
74
83
|
export type TreeseedReleaseInput = {
|
|
75
84
|
bump: 'major' | 'minor' | 'patch';
|
|
76
85
|
};
|
|
@@ -111,4 +120,5 @@ export declare class TreeseedWorkflowSdk {
|
|
|
111
120
|
stage(input: TreeseedStageInput): Promise<TreeseedWorkflowResult>;
|
|
112
121
|
release(input: TreeseedReleaseInput): Promise<TreeseedWorkflowResult>;
|
|
113
122
|
destroy(input: TreeseedDestroyInput): Promise<TreeseedWorkflowResult>;
|
|
123
|
+
export(input?: TreeseedExportInput): Promise<TreeseedWorkflowResult>;
|
|
114
124
|
}
|
package/dist/workflow.js
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
workflowConfig,
|
|
6
6
|
workflowDestroy,
|
|
7
7
|
workflowDev,
|
|
8
|
+
workflowExport,
|
|
8
9
|
workflowRelease,
|
|
9
10
|
workflowSave,
|
|
10
11
|
workflowStage,
|
|
@@ -57,6 +58,8 @@ class TreeseedWorkflowSdk {
|
|
|
57
58
|
return this.release(input);
|
|
58
59
|
case "destroy":
|
|
59
60
|
return this.destroy(input);
|
|
61
|
+
case "export":
|
|
62
|
+
return this.export(input);
|
|
60
63
|
default:
|
|
61
64
|
throw new Error(`Unsupported workflow operation "${operation}".`);
|
|
62
65
|
}
|
|
@@ -91,6 +94,9 @@ class TreeseedWorkflowSdk {
|
|
|
91
94
|
async destroy(input) {
|
|
92
95
|
return workflowDestroy(this.helpers(), input);
|
|
93
96
|
}
|
|
97
|
+
async export(input = {}) {
|
|
98
|
+
return workflowExport(this.helpers(), input);
|
|
99
|
+
}
|
|
94
100
|
}
|
|
95
101
|
export {
|
|
96
102
|
TreeseedWorkflowError,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@treeseed/sdk",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.9",
|
|
4
4
|
"description": "Shared Treeseed SDK for content-backed and D1-backed object models.",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"react": "^19.2.5",
|
|
59
59
|
"remark-mdx": "^3.1.1",
|
|
60
60
|
"remark-parse": "^11.0.0",
|
|
61
|
+
"repomix": "^1.13.1",
|
|
61
62
|
"typescript": "^5.9.3",
|
|
62
63
|
"unified": "^11.0.5",
|
|
63
64
|
"yaml": "^2.8.1"
|
|
@@ -132,6 +133,10 @@
|
|
|
132
133
|
"types": "./dist/platform/books-data.d.ts",
|
|
133
134
|
"default": "./dist/platform/books-data.js"
|
|
134
135
|
},
|
|
136
|
+
"./platform/book-export": {
|
|
137
|
+
"types": "./dist/platform/book-export.d.ts",
|
|
138
|
+
"default": "./dist/platform/book-export.js"
|
|
139
|
+
},
|
|
135
140
|
"./platform/site-config-schema": {
|
|
136
141
|
"types": "./dist/platform/site-config-schema.d.ts",
|
|
137
142
|
"default": "./dist/platform/site-config-schema.js"
|