@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
|
@@ -23,7 +23,6 @@ export declare function ensureGeneratedWranglerConfig(tenantRoot: any, options?:
|
|
|
23
23
|
cloudflare: {
|
|
24
24
|
accountId: string;
|
|
25
25
|
workerName: string | undefined;
|
|
26
|
-
gatewayWorkerName: string | undefined;
|
|
27
26
|
queueName: string | undefined;
|
|
28
27
|
dlqName: string | undefined;
|
|
29
28
|
d1Binding: string | undefined;
|
|
@@ -126,7 +125,6 @@ export declare function validateDeployPrerequisites(tenantRoot: any, { requireRe
|
|
|
126
125
|
cloudflare: {
|
|
127
126
|
accountId: string;
|
|
128
127
|
workerName: string | undefined;
|
|
129
|
-
gatewayWorkerName: string | undefined;
|
|
130
128
|
queueName: string | undefined;
|
|
131
129
|
dlqName: string | undefined;
|
|
132
130
|
d1Binding: string | undefined;
|
|
@@ -210,7 +208,6 @@ export declare function validateDestroyPrerequisites(tenantRoot: any, { requireR
|
|
|
210
208
|
cloudflare: {
|
|
211
209
|
accountId: string;
|
|
212
210
|
workerName: string | undefined;
|
|
213
|
-
gatewayWorkerName: string | undefined;
|
|
214
211
|
queueName: string | undefined;
|
|
215
212
|
dlqName: string | undefined;
|
|
216
213
|
d1Binding: string | undefined;
|
|
@@ -10,7 +10,7 @@ const DEFAULT_COMPATIBILITY_FLAGS = ["nodejs_compat"];
|
|
|
10
10
|
const GENERATED_ROOT = ".treeseed/generated";
|
|
11
11
|
const STATE_ROOT = ".treeseed/state";
|
|
12
12
|
const PERSISTENT_SCOPES = /* @__PURE__ */ new Set(["local", "staging", "prod"]);
|
|
13
|
-
const MANAGED_SERVICE_KEYS = ["api", "agents", "
|
|
13
|
+
const MANAGED_SERVICE_KEYS = ["api", "agents", "manager", "worker", "runner", "workdayStart", "workdayReport"];
|
|
14
14
|
const TRESEED_ENVELOPE_SCHEMA_GENERATION = "runtime-envelopes-v1";
|
|
15
15
|
const TRESEED_MIGRATION_WAVE_ID = "0005_runtime_envelopes";
|
|
16
16
|
const TRESEED_SUPPORTED_PAYLOAD_RANGE = { min: 1, max: 1 };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type TreeseedExportResult = {
|
|
2
|
+
directory: string;
|
|
3
|
+
tenantRoot: string;
|
|
4
|
+
outputPath: string;
|
|
5
|
+
branch: string;
|
|
6
|
+
timestamp: string;
|
|
7
|
+
includedBundlePaths: string[];
|
|
8
|
+
ignorePatterns: string[];
|
|
9
|
+
summary: {
|
|
10
|
+
totalFiles: number;
|
|
11
|
+
totalCharacters: number;
|
|
12
|
+
totalTokens: number;
|
|
13
|
+
outputFiles: string[];
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare function exportTreeseedCodebase({ directory, }?: {
|
|
17
|
+
directory?: string;
|
|
18
|
+
}): Promise<TreeseedExportResult>;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, statSync } from "node:fs";
|
|
2
|
+
import { resolve, relative } from "node:path";
|
|
3
|
+
import { runDefaultAction, setLogLevel } from "repomix";
|
|
4
|
+
import { loadTreeseedDeployConfigFromPath, resolveTreeseedDeployConfigPathFromRoot } from "../../platform/deploy-config.js";
|
|
5
|
+
import { findNearestTreeseedRoot } from "./workspace-tools.js";
|
|
6
|
+
import { currentBranch, repoRoot } from "./workspace-save.js";
|
|
7
|
+
function ensureDirectory(directory) {
|
|
8
|
+
if (!existsSync(directory)) {
|
|
9
|
+
throw new Error(`Treeseed export directory does not exist: ${directory}`);
|
|
10
|
+
}
|
|
11
|
+
const stats = statSync(directory);
|
|
12
|
+
if (!stats.isDirectory()) {
|
|
13
|
+
throw new Error(`Treeseed export directory must be a directory: ${directory}`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function formatExportTimestamp(date = /* @__PURE__ */ new Date()) {
|
|
17
|
+
const year = date.getFullYear();
|
|
18
|
+
const month = `${date.getMonth() + 1}`.padStart(2, "0");
|
|
19
|
+
const day = `${date.getDate()}`.padStart(2, "0");
|
|
20
|
+
const hours = `${date.getHours()}`.padStart(2, "0");
|
|
21
|
+
const minutes = `${date.getMinutes()}`.padStart(2, "0");
|
|
22
|
+
const seconds = `${date.getSeconds()}`.padStart(2, "0");
|
|
23
|
+
return `${year}-${month}-${day}-${hours}-${minutes}-${seconds}`;
|
|
24
|
+
}
|
|
25
|
+
function sanitizeBranchSegment(branch) {
|
|
26
|
+
const sanitized = String(branch ?? "").trim().replaceAll(/[\\/]+/g, "-").replaceAll(/[^a-zA-Z0-9._-]+/g, "-").replaceAll(/-+/g, "-").replaceAll(/^-|-$/g, "");
|
|
27
|
+
return sanitized || "detached";
|
|
28
|
+
}
|
|
29
|
+
function resolveGitBranch(directory) {
|
|
30
|
+
try {
|
|
31
|
+
const gitRoot = repoRoot(directory);
|
|
32
|
+
const branch = currentBranch(gitRoot);
|
|
33
|
+
return sanitizeBranchSegment(branch);
|
|
34
|
+
} catch {
|
|
35
|
+
return "detached";
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function resolveExportOutputPath(directory, branch, timestamp) {
|
|
39
|
+
const exportsRoot = resolve(directory, ".treeseed", "exports");
|
|
40
|
+
mkdirSync(exportsRoot, { recursive: true });
|
|
41
|
+
return resolve(exportsRoot, `${branch}-${timestamp}.md`);
|
|
42
|
+
}
|
|
43
|
+
function resolveConfiguredBundlePaths(directory, tenantRoot, config) {
|
|
44
|
+
const includedBundlePaths = [];
|
|
45
|
+
const seen = /* @__PURE__ */ new Set();
|
|
46
|
+
for (const configuredPath of config.export?.bundledPaths ?? []) {
|
|
47
|
+
const absolutePath = resolve(tenantRoot, configuredPath);
|
|
48
|
+
if (!existsSync(absolutePath)) {
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
const relativeToDirectory = relative(directory, absolutePath);
|
|
52
|
+
if (!relativeToDirectory || !relativeToDirectory.startsWith("..") && relativeToDirectory !== ".") {
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
if (seen.has(absolutePath)) {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
seen.add(absolutePath);
|
|
59
|
+
includedBundlePaths.push(absolutePath);
|
|
60
|
+
}
|
|
61
|
+
return includedBundlePaths.sort((left, right) => left.localeCompare(right));
|
|
62
|
+
}
|
|
63
|
+
function resolveIgnorePatterns(config) {
|
|
64
|
+
return [
|
|
65
|
+
".treeseed/exports",
|
|
66
|
+
".treeseed/exports/**",
|
|
67
|
+
"**/.treeseed/exports",
|
|
68
|
+
"**/.treeseed/exports/**",
|
|
69
|
+
...config.export?.ignore ?? []
|
|
70
|
+
];
|
|
71
|
+
}
|
|
72
|
+
function toRepomixDirectories(directory, includedBundlePaths) {
|
|
73
|
+
return [".", ...includedBundlePaths.map((bundlePath) => relative(directory, bundlePath) || ".")];
|
|
74
|
+
}
|
|
75
|
+
function normalizePackResultOutputFiles(packResult, outputPath) {
|
|
76
|
+
return packResult.outputFiles && packResult.outputFiles.length > 0 ? packResult.outputFiles : [outputPath];
|
|
77
|
+
}
|
|
78
|
+
async function withCleanNodeExecArgv(action) {
|
|
79
|
+
const previousExecArgv = [...process.execArgv];
|
|
80
|
+
process.execArgv = previousExecArgv.filter(
|
|
81
|
+
(arg) => !arg.startsWith("--test") && !arg.startsWith("--input-type") && !arg.startsWith("--experimental-test") && !arg.startsWith("--watch")
|
|
82
|
+
);
|
|
83
|
+
try {
|
|
84
|
+
return await action();
|
|
85
|
+
} finally {
|
|
86
|
+
process.execArgv = previousExecArgv;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
async function exportTreeseedCodebase({
|
|
90
|
+
directory = process.cwd()
|
|
91
|
+
} = {}) {
|
|
92
|
+
const resolvedDirectory = resolve(directory);
|
|
93
|
+
ensureDirectory(resolvedDirectory);
|
|
94
|
+
const tenantRoot = findNearestTreeseedRoot(resolvedDirectory);
|
|
95
|
+
if (!tenantRoot) {
|
|
96
|
+
throw new Error(`Treeseed export requires a Treeseed project. No ancestor containing treeseed.site.yaml was found from ${resolvedDirectory}.`);
|
|
97
|
+
}
|
|
98
|
+
const deployConfig = loadTreeseedDeployConfigFromPath(resolveTreeseedDeployConfigPathFromRoot(tenantRoot));
|
|
99
|
+
const includedBundlePaths = resolveConfiguredBundlePaths(resolvedDirectory, tenantRoot, deployConfig);
|
|
100
|
+
const ignorePatterns = resolveIgnorePatterns(deployConfig);
|
|
101
|
+
const branch = resolveGitBranch(resolvedDirectory);
|
|
102
|
+
const timestamp = formatExportTimestamp();
|
|
103
|
+
const outputPath = resolveExportOutputPath(resolvedDirectory, branch, timestamp);
|
|
104
|
+
const options = {
|
|
105
|
+
output: outputPath,
|
|
106
|
+
style: "markdown",
|
|
107
|
+
ignore: ignorePatterns.join(","),
|
|
108
|
+
quiet: true,
|
|
109
|
+
skipLocalConfig: true,
|
|
110
|
+
copy: false,
|
|
111
|
+
stdout: false
|
|
112
|
+
};
|
|
113
|
+
setLogLevel(0);
|
|
114
|
+
const result = await withCleanNodeExecArgv(
|
|
115
|
+
() => runDefaultAction(toRepomixDirectories(resolvedDirectory, includedBundlePaths), resolvedDirectory, options)
|
|
116
|
+
);
|
|
117
|
+
const outputFiles = normalizePackResultOutputFiles(result.packResult, outputPath);
|
|
118
|
+
return {
|
|
119
|
+
directory: resolvedDirectory,
|
|
120
|
+
tenantRoot,
|
|
121
|
+
outputPath,
|
|
122
|
+
branch,
|
|
123
|
+
timestamp,
|
|
124
|
+
includedBundlePaths,
|
|
125
|
+
ignorePatterns,
|
|
126
|
+
summary: {
|
|
127
|
+
totalFiles: result.packResult.totalFiles,
|
|
128
|
+
totalCharacters: result.packResult.totalCharacters,
|
|
129
|
+
totalTokens: result.packResult.totalTokens,
|
|
130
|
+
outputFiles
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
export {
|
|
135
|
+
exportTreeseedCodebase
|
|
136
|
+
};
|
|
@@ -5,7 +5,7 @@ import { loadCliDeployConfig } from "./runtime-tools.js";
|
|
|
5
5
|
function normalizeScope(scope) {
|
|
6
6
|
return scope === "prod" ? "prod" : scope === "staging" ? "staging" : "local";
|
|
7
7
|
}
|
|
8
|
-
const RAILWAY_SERVICE_KEYS = ["api", "agents", "manager", "worker", "workdayStart", "workdayReport"];
|
|
8
|
+
const RAILWAY_SERVICE_KEYS = ["api", "agents", "manager", "worker", "runner", "workdayStart", "workdayReport"];
|
|
9
9
|
function runRailway(args, { cwd, capture = false, allowFailure = false } = {}) {
|
|
10
10
|
const result = spawnSync("railway", args, {
|
|
11
11
|
cwd,
|
|
@@ -26,7 +26,7 @@ function configuredRailwayServices(tenantRoot, scope) {
|
|
|
26
26
|
if (!service || service.enabled === false || (service.provider ?? "railway") !== "railway") {
|
|
27
27
|
return null;
|
|
28
28
|
}
|
|
29
|
-
const defaultRootDir = ["api", "manager", "worker", "workdayStart", "workdayReport"].includes(serviceKey) ? "." : "packages/core";
|
|
29
|
+
const defaultRootDir = ["api", "manager", "worker", "runner", "workdayStart", "workdayReport"].includes(serviceKey) ? "." : "packages/core";
|
|
30
30
|
const serviceRoot = resolve(tenantRoot, service.railway?.rootDir ?? service.rootDir ?? defaultRootDir);
|
|
31
31
|
const railwayEnvironment = service.environments?.[normalizedScope]?.railwayEnvironment ?? normalizedScope;
|
|
32
32
|
const publicBaseUrl = service.environments?.[normalizedScope]?.baseUrl ?? service.publicBaseUrl ?? null;
|
|
@@ -38,7 +38,6 @@ export declare function loadCliDeployConfig(tenantRoot: any): {
|
|
|
38
38
|
cloudflare: {
|
|
39
39
|
accountId: string;
|
|
40
40
|
workerName: string | undefined;
|
|
41
|
-
gatewayWorkerName: string | undefined;
|
|
42
41
|
queueName: string | undefined;
|
|
43
42
|
dlqName: string | undefined;
|
|
44
43
|
d1Binding: string | undefined;
|
|
@@ -50,7 +50,7 @@ const TREESEED_DEFAULT_PROVIDER_SELECTIONS = {
|
|
|
50
50
|
},
|
|
51
51
|
site: "default"
|
|
52
52
|
};
|
|
53
|
-
const TRESEED_MANAGED_SERVICE_KEYS = ["api", "agents", "
|
|
53
|
+
const TRESEED_MANAGED_SERVICE_KEYS = ["api", "agents", "manager", "worker", "runner", "workdayStart", "workdayReport"];
|
|
54
54
|
const TRESEED_WORKSPACE_PACKAGE_DIRS = ["sdk", "core", "cli"];
|
|
55
55
|
const CLOUDFLARE_ACCOUNT_ID_PLACEHOLDER = "replace-with-cloudflare-account-id";
|
|
56
56
|
function parseServiceEnvironmentConfig(value) {
|
|
@@ -301,7 +301,6 @@ function parseFallbackDeployConfig(configPath) {
|
|
|
301
301
|
cloudflare: {
|
|
302
302
|
accountId: optionalCloudflareAccountId(cloudflare.accountId) ?? optionalCloudflareAccountId(process.env.CLOUDFLARE_ACCOUNT_ID) ?? CLOUDFLARE_ACCOUNT_ID_PLACEHOLDER,
|
|
303
303
|
workerName: optionalString(cloudflare.workerName),
|
|
304
|
-
gatewayWorkerName: optionalString(cloudflare.gatewayWorkerName),
|
|
305
304
|
queueName: optionalString(cloudflare.queueName),
|
|
306
305
|
dlqName: optionalString(cloudflare.dlqName),
|
|
307
306
|
d1Binding: optionalString(cloudflare.d1Binding),
|
|
@@ -17,6 +17,7 @@ const TRESEED_OPERATION_SPECS = [
|
|
|
17
17
|
operation({ id: "template.sync", name: "sync", aliases: [], group: "Validation", summary: "Validate or reconcile the managed template surface for the current site.", description: "Use remote template metadata plus the local scaffold artifact to check or apply updates to the managed scaffold surface.", provider: "default", related: ["template", "init", "status"] }),
|
|
18
18
|
operation({ id: "project.init", name: "init", aliases: [], group: "Workflow", summary: "Scaffold a new Treeseed tenant project.", description: "Create a new Treeseed tenant directory from a remote-catalog template backed by the packaged scaffold artifact.", provider: "default", related: ["config", "switch", "dev"] }),
|
|
19
19
|
operation({ id: "project.config", name: "config", aliases: [], group: "Workflow", summary: "Configure and test the runtime foundation.", description: "Apply safe repairs, collect environment values, write local machine config, generate local env files, initialize environments, sync providers, and run doctor-style checks.", provider: "default", related: ["status", "switch", "dev"] }),
|
|
20
|
+
operation({ id: "project.export", name: "export", aliases: [], group: "Utilities", summary: "Export a Markdown snapshot of the current codebase.", description: "Generate a Markdown codebase snapshot for the selected directory using the SDK-owned repomix integration and store it under .treeseed/exports.", provider: "default", related: ["status", "config"] }),
|
|
20
21
|
operation({ id: "deploy.release", name: "release", aliases: [], group: "Workflow", summary: "Promote staging to production with a version bump.", description: "Validate staging, apply one version bump, tag the release, merge staging into main, push, and rely on production deploy automation.", provider: "default", related: ["stage", "status", "rollback"] }),
|
|
21
22
|
operation({ id: "deploy.destroy", name: "destroy", aliases: [], group: "Workflow", summary: "Destroy a persistent environment and its local state.", description: "Delete the selected persistent environment resources and remove the local deploy state after confirmation.", provider: "default", related: ["config", "status"] }),
|
|
22
23
|
operation({ id: "local.dev", name: "dev", aliases: [], group: "Local Development", summary: "Start the unified local Treeseed development environment.", description: "Start the unified local Treeseed development environment.", provider: "default" }),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type TreeseedOperationGroup = 'Workflow' | 'Local Development' | 'Validation' | 'Release Utilities' | 'Utilities' | 'Passthrough';
|
|
2
|
-
export type TreeseedOperationId = 'workspace.status' | 'workspace.doctor' | 'branch.tasks' | 'branch.switch' | 'branch.save' | 'branch.close' | 'branch.stage' | 'deploy.release' | 'deploy.rollback' | 'deploy.destroy' | 'template.list' | 'template.show' | 'template.validate' | 'template.sync' | 'project.init' | 'project.config' | 'local.dev' | 'local.devWatch' | 'local.build' | 'local.check' | 'local.preview' | 'local.lint' | 'local.test' | 'validation.testUnit' | 'validation.preflight' | 'validation.authCheck' | 'auth.login' | 'auth.logout' | 'auth.whoami' | 'release.testE2e' | 'release.testE2eLocal' | 'release.testE2eStaging' | 'release.testE2eFull' | 'release.testFast' | 'release.verify' | 'release.publishChanged' | 'services.mailpitUp' | 'services.mailpitDown' | 'services.mailpitLogs' | 'data.d1MigrateLocal' | 'content.cleanupMarkdown' | 'content.cleanupMarkdownCheck' | 'tools.astro' | 'tools.syncDevvars' | 'tools.starlightPatch' | 'agents.run';
|
|
2
|
+
export type TreeseedOperationId = 'workspace.status' | 'workspace.doctor' | 'branch.tasks' | 'branch.switch' | 'branch.save' | 'branch.close' | 'branch.stage' | 'deploy.release' | 'deploy.rollback' | 'deploy.destroy' | 'template.list' | 'template.show' | 'template.validate' | 'template.sync' | 'project.init' | 'project.config' | 'local.dev' | 'local.devWatch' | 'local.build' | 'local.check' | 'local.preview' | 'local.lint' | 'local.test' | 'validation.testUnit' | 'validation.preflight' | 'validation.authCheck' | 'auth.login' | 'auth.logout' | 'auth.whoami' | 'release.testE2e' | 'release.testE2eLocal' | 'release.testE2eStaging' | 'release.testE2eFull' | 'release.testFast' | 'release.verify' | 'release.publishChanged' | 'services.mailpitUp' | 'services.mailpitDown' | 'services.mailpitLogs' | 'data.d1MigrateLocal' | 'content.cleanupMarkdown' | 'content.cleanupMarkdownCheck' | 'project.export' | 'tools.astro' | 'tools.syncDevvars' | 'tools.starlightPatch' | 'agents.run';
|
|
3
3
|
export type TreeseedOperationProviderId = 'default';
|
|
4
4
|
export type TreeseedOperationMetadata = {
|
|
5
5
|
id: TreeseedOperationId;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export type TreeseedBookExportFileEntry = {
|
|
2
|
+
fileId: string;
|
|
3
|
+
bookId: string;
|
|
4
|
+
memberBookId: string;
|
|
5
|
+
absolutePath: string;
|
|
6
|
+
projectRelativePath: string;
|
|
7
|
+
bookRelativePath: string;
|
|
8
|
+
rootRelativePath: string;
|
|
9
|
+
rootPath: string;
|
|
10
|
+
ordinal: number;
|
|
11
|
+
frontmatterOrder: number | null;
|
|
12
|
+
sourceType: 'md' | 'mdx' | 'text';
|
|
13
|
+
chunkId: string;
|
|
14
|
+
markerId: string;
|
|
15
|
+
};
|
|
16
|
+
export type TreeseedBookExportMemberSummary = {
|
|
17
|
+
bookId: string;
|
|
18
|
+
slug: string;
|
|
19
|
+
title: string;
|
|
20
|
+
order: number;
|
|
21
|
+
downloadFileName: string;
|
|
22
|
+
downloadHref: string;
|
|
23
|
+
sourceFileCount: number;
|
|
24
|
+
markdownPath?: string;
|
|
25
|
+
indexPath?: string;
|
|
26
|
+
};
|
|
27
|
+
export type TreeseedBookExportManifest = {
|
|
28
|
+
packageKind: 'book' | 'library';
|
|
29
|
+
packageVersion: number;
|
|
30
|
+
packageId: string;
|
|
31
|
+
generatedAt: string;
|
|
32
|
+
tenantRoot: string;
|
|
33
|
+
tenantId: string;
|
|
34
|
+
book: {
|
|
35
|
+
id: string;
|
|
36
|
+
slug: string;
|
|
37
|
+
title: string;
|
|
38
|
+
order: number;
|
|
39
|
+
basePath: string;
|
|
40
|
+
downloadFileName: string;
|
|
41
|
+
downloadHref: string;
|
|
42
|
+
downloadTitle: string;
|
|
43
|
+
resolvedRoots: string[];
|
|
44
|
+
};
|
|
45
|
+
files: TreeseedBookExportFileEntry[];
|
|
46
|
+
members?: TreeseedBookExportMemberSummary[];
|
|
47
|
+
};
|
|
48
|
+
export type TreeseedBookPackageResult = {
|
|
49
|
+
manifest: TreeseedBookExportManifest;
|
|
50
|
+
markdownPath: string;
|
|
51
|
+
indexPath: string;
|
|
52
|
+
sourceFileCount: number;
|
|
53
|
+
includedRoots: string[];
|
|
54
|
+
};
|
|
55
|
+
export type TreeseedBookLibraryPackageResult = {
|
|
56
|
+
manifest: TreeseedBookExportManifest;
|
|
57
|
+
markdownPath: string;
|
|
58
|
+
indexPath: string;
|
|
59
|
+
memberPackages: TreeseedBookPackageResult[];
|
|
60
|
+
sourceFileCount: number;
|
|
61
|
+
includedRoots: string[];
|
|
62
|
+
};
|
|
63
|
+
export declare function buildBookExportManifest(bookId: string, options?: {
|
|
64
|
+
projectRoot?: string;
|
|
65
|
+
}): TreeseedBookExportManifest;
|
|
66
|
+
export declare function exportBookPackage(bookId: string, options?: {
|
|
67
|
+
projectRoot?: string;
|
|
68
|
+
}): Promise<TreeseedBookPackageResult>;
|
|
69
|
+
export declare function exportBookLibrary(options?: {
|
|
70
|
+
projectRoot?: string;
|
|
71
|
+
}): Promise<TreeseedBookLibraryPackageResult>;
|
|
72
|
+
export declare function exportTenantBookPackages(options?: {
|
|
73
|
+
projectRoot?: string;
|
|
74
|
+
}): Promise<{
|
|
75
|
+
projectRoot: string;
|
|
76
|
+
bookPackages: TreeseedBookPackageResult[];
|
|
77
|
+
libraryPackage: TreeseedBookLibraryPackageResult;
|
|
78
|
+
}>;
|