@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
package/README.md
CHANGED
|
@@ -168,7 +168,7 @@ const scoped = sdk.scopeForAgent({
|
|
|
168
168
|
The package also exports:
|
|
169
169
|
|
|
170
170
|
- workflow helpers such as `TreeseedWorkflowSdk`
|
|
171
|
-
-
|
|
171
|
+
- remote and queue clients such as `RemoteTreeseedClient`, `CloudflareQueuePullClient`, and `CloudflareQueuePushClient`
|
|
172
172
|
- model registry, field, and filter utilities
|
|
173
173
|
- plugin/runtime types and helpers
|
|
174
174
|
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SdkDispatchCapability, SdkDispatchNamespace } from './sdk-types.ts';
|
|
2
|
+
export declare function listSdkDispatchCapabilities(): SdkDispatchCapability[];
|
|
3
|
+
export declare function listWorkflowDispatchCapabilities(): SdkDispatchCapability[];
|
|
4
|
+
export declare function findDispatchCapability(namespace: SdkDispatchNamespace, operation: string): SdkDispatchCapability | null;
|
package/dist/dispatch.js
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import {
|
|
2
|
+
findTreeseedOperation
|
|
3
|
+
} from "./operations-registry.js";
|
|
4
|
+
function capability(namespace, operation, options) {
|
|
5
|
+
return {
|
|
6
|
+
namespace,
|
|
7
|
+
operation,
|
|
8
|
+
executionClass: options.executionClass,
|
|
9
|
+
allowedTargets: options.allowedTargets,
|
|
10
|
+
defaultTarget: options.defaultTarget,
|
|
11
|
+
defaultDispatchMode: options.defaultDispatchMode ?? "auto",
|
|
12
|
+
summary: options.summary
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
const INLINE_PROJECT_API_SDK_OPERATIONS = [
|
|
16
|
+
"get",
|
|
17
|
+
"read",
|
|
18
|
+
"search",
|
|
19
|
+
"follow",
|
|
20
|
+
"pick",
|
|
21
|
+
"create",
|
|
22
|
+
"update",
|
|
23
|
+
"claimMessage",
|
|
24
|
+
"ackMessage",
|
|
25
|
+
"createMessage",
|
|
26
|
+
"recordRun",
|
|
27
|
+
"getCursor",
|
|
28
|
+
"upsertCursor",
|
|
29
|
+
"releaseLease",
|
|
30
|
+
"releaseAllLeases",
|
|
31
|
+
"startWorkDay",
|
|
32
|
+
"closeWorkDay",
|
|
33
|
+
"createTask",
|
|
34
|
+
"claimTask",
|
|
35
|
+
"recordTaskProgress",
|
|
36
|
+
"completeTask",
|
|
37
|
+
"failTask",
|
|
38
|
+
"appendTaskEvent",
|
|
39
|
+
"searchTasks",
|
|
40
|
+
"createReport",
|
|
41
|
+
"getManagerContext",
|
|
42
|
+
"listAgentSpecs",
|
|
43
|
+
"listRawAgentSpecs",
|
|
44
|
+
"searchFiles",
|
|
45
|
+
"searchSections",
|
|
46
|
+
"searchEntities",
|
|
47
|
+
"getGraphNode",
|
|
48
|
+
"getNeighbors",
|
|
49
|
+
"followReferences",
|
|
50
|
+
"getBacklinks",
|
|
51
|
+
"getRelated",
|
|
52
|
+
"getSubgraph",
|
|
53
|
+
"resolveSeeds",
|
|
54
|
+
"parseGraphDsl",
|
|
55
|
+
"resolveReference",
|
|
56
|
+
"explainReferenceChain"
|
|
57
|
+
];
|
|
58
|
+
const REMOTE_JOB_SDK_OPERATIONS = [
|
|
59
|
+
"refreshGraph",
|
|
60
|
+
"queryGraph",
|
|
61
|
+
"buildContextPack"
|
|
62
|
+
];
|
|
63
|
+
const LOCAL_ONLY_WORKFLOW_OPERATIONS = /* @__PURE__ */ new Set([
|
|
64
|
+
"init",
|
|
65
|
+
"config",
|
|
66
|
+
"auth:login",
|
|
67
|
+
"auth:logout",
|
|
68
|
+
"dev",
|
|
69
|
+
"dev:watch",
|
|
70
|
+
"mailpit:up",
|
|
71
|
+
"mailpit:down",
|
|
72
|
+
"mailpit:logs",
|
|
73
|
+
"d1:migrate:local",
|
|
74
|
+
"cleanup-markdown",
|
|
75
|
+
"cleanup-markdown:check",
|
|
76
|
+
"astro",
|
|
77
|
+
"sync-devvars",
|
|
78
|
+
"starlight:patch",
|
|
79
|
+
"build",
|
|
80
|
+
"check",
|
|
81
|
+
"preview",
|
|
82
|
+
"lint",
|
|
83
|
+
"test",
|
|
84
|
+
"test:unit"
|
|
85
|
+
]);
|
|
86
|
+
const REMOTE_JOB_WORKFLOW_OPERATIONS = /* @__PURE__ */ new Set([
|
|
87
|
+
"save",
|
|
88
|
+
"close",
|
|
89
|
+
"stage",
|
|
90
|
+
"release",
|
|
91
|
+
"rollback",
|
|
92
|
+
"destroy",
|
|
93
|
+
"sync",
|
|
94
|
+
"export",
|
|
95
|
+
"test:e2e",
|
|
96
|
+
"test:e2e:local",
|
|
97
|
+
"test:e2e:staging",
|
|
98
|
+
"test:e2e:full",
|
|
99
|
+
"test:fast",
|
|
100
|
+
"verify",
|
|
101
|
+
"publish:changed"
|
|
102
|
+
]);
|
|
103
|
+
const INLINE_WORKFLOW_OPERATIONS = /* @__PURE__ */ new Set([
|
|
104
|
+
"status",
|
|
105
|
+
"tasks",
|
|
106
|
+
"doctor",
|
|
107
|
+
"template",
|
|
108
|
+
"auth:whoami"
|
|
109
|
+
]);
|
|
110
|
+
const SDK_CAPABILITIES = [
|
|
111
|
+
...INLINE_PROJECT_API_SDK_OPERATIONS.map((operation) => capability("sdk", operation, {
|
|
112
|
+
executionClass: "remote_inline",
|
|
113
|
+
allowedTargets: ["local", "project_api"],
|
|
114
|
+
defaultTarget: "project_api"
|
|
115
|
+
})),
|
|
116
|
+
...REMOTE_JOB_SDK_OPERATIONS.map((operation) => capability("sdk", operation, {
|
|
117
|
+
executionClass: "remote_job",
|
|
118
|
+
allowedTargets: ["local", "project_api", "project_runner"],
|
|
119
|
+
defaultTarget: "project_runner",
|
|
120
|
+
defaultDispatchMode: "prefer_remote"
|
|
121
|
+
}))
|
|
122
|
+
];
|
|
123
|
+
const SDK_CAPABILITY_INDEX = new Map(
|
|
124
|
+
SDK_CAPABILITIES.map((entry) => [`${entry.namespace}:${entry.operation}`, entry])
|
|
125
|
+
);
|
|
126
|
+
function workflowCapability(operation) {
|
|
127
|
+
const resolved = findTreeseedOperation(operation);
|
|
128
|
+
if (!resolved) {
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
if (LOCAL_ONLY_WORKFLOW_OPERATIONS.has(resolved.name)) {
|
|
132
|
+
return capability("workflow", resolved.name, {
|
|
133
|
+
executionClass: "local_only",
|
|
134
|
+
allowedTargets: ["local"],
|
|
135
|
+
defaultTarget: "local"
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
if (REMOTE_JOB_WORKFLOW_OPERATIONS.has(resolved.name)) {
|
|
139
|
+
return capability("workflow", resolved.name, {
|
|
140
|
+
executionClass: "remote_job",
|
|
141
|
+
allowedTargets: ["local", "project_runner"],
|
|
142
|
+
defaultTarget: "project_runner",
|
|
143
|
+
defaultDispatchMode: "prefer_remote"
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
if (INLINE_WORKFLOW_OPERATIONS.has(resolved.name)) {
|
|
147
|
+
return capability("workflow", resolved.name, {
|
|
148
|
+
executionClass: "remote_inline",
|
|
149
|
+
allowedTargets: resolved.name === "template" ? ["local", "market_catalog", "project_api"] : ["local", "project_api"],
|
|
150
|
+
defaultTarget: resolved.name === "template" ? "market_catalog" : "project_api"
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
return capability("workflow", resolved.name, {
|
|
154
|
+
executionClass: "remote_job",
|
|
155
|
+
allowedTargets: ["local", "project_runner"],
|
|
156
|
+
defaultTarget: "project_runner",
|
|
157
|
+
defaultDispatchMode: "prefer_remote"
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
function listSdkDispatchCapabilities() {
|
|
161
|
+
return [...SDK_CAPABILITIES];
|
|
162
|
+
}
|
|
163
|
+
function listWorkflowDispatchCapabilities() {
|
|
164
|
+
return [
|
|
165
|
+
...LOCAL_ONLY_WORKFLOW_OPERATIONS,
|
|
166
|
+
...REMOTE_JOB_WORKFLOW_OPERATIONS,
|
|
167
|
+
...INLINE_WORKFLOW_OPERATIONS
|
|
168
|
+
].map((operation) => workflowCapability(operation)).filter((entry) => Boolean(entry));
|
|
169
|
+
}
|
|
170
|
+
function findDispatchCapability(namespace, operation) {
|
|
171
|
+
if (namespace === "sdk") {
|
|
172
|
+
return SDK_CAPABILITY_INDEX.get(`sdk:${operation}`) ?? null;
|
|
173
|
+
}
|
|
174
|
+
return workflowCapability(operation);
|
|
175
|
+
}
|
|
176
|
+
export {
|
|
177
|
+
findDispatchCapability,
|
|
178
|
+
listSdkDispatchCapabilities,
|
|
179
|
+
listWorkflowDispatchCapabilities
|
|
180
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -4,16 +4,18 @@ export { parseGraphDsl } from './graph/dsl.ts';
|
|
|
4
4
|
export { createDefaultGraphRankingProvider, DEFAULT_GRAPH_RANKING_PROVIDER } from './graph/ranking.ts';
|
|
5
5
|
export { BUILTIN_MODEL_REGISTRY, MODEL_REGISTRY, buildBuiltinModelRegistry, buildModelRegistry, buildScopedModelRegistry, mergeModelRegistries, resolveModelDefinition, } from './model-registry.ts';
|
|
6
6
|
export { normalizeAgentCliOptions, buildCopilotAllowToolArgs } from './cli-tools.ts';
|
|
7
|
+
export { findDispatchCapability, listSdkDispatchCapabilities, listWorkflowDispatchCapabilities, } from './dispatch.ts';
|
|
8
|
+
export { executeSdkOperation, findSdkOperation, listSdkOperationNames, } from './sdk-dispatch.ts';
|
|
7
9
|
export { resolveSdkRecordVersion } from './sdk-version.ts';
|
|
8
10
|
export { normalizeAliasedRecord, preprocessAliasedRecord, resolveAliasedField, } from './field-aliases.ts';
|
|
9
11
|
export { canonicalizeFrontmatter, normalizeFilterFields, normalizeMutationData, normalizeRecordToCanonicalShape, normalizeSortFields, readCanonicalFieldValue, resolveModelField, validateModelFieldAliases, } from './sdk-fields.ts';
|
|
10
12
|
export { RemoteTemplateCatalogClient, parseTemplateCatalogResponse } from './template-catalog.ts';
|
|
11
|
-
export { TREESEED_REMOTE_CONTRACT_HEADER, TREESEED_REMOTE_CONTRACT_VERSION, CloudflareQueuePullClient, RemoteTreeseedClient, RemoteTreeseedAuthClient, RemoteTreeseedSdkClient, RemoteTreeseedOperationsClient,
|
|
13
|
+
export { TREESEED_REMOTE_CONTRACT_HEADER, TREESEED_REMOTE_CONTRACT_VERSION, CloudflareQueuePullClient, CloudflareQueuePushClient, RemoteTreeseedClient, RemoteTreeseedAuthClient, RemoteTreeseedDispatchClient, RemoteTreeseedJobsClient, RemoteTreeseedRunnerClient, RemoteTreeseedSdkClient, RemoteTreeseedOperationsClient, } from './remote.ts';
|
|
12
14
|
export { TRESEED_OPERATION_SPECS, findTreeseedOperation, listTreeseedOperationNames, } from './operations-registry.ts';
|
|
13
15
|
export { TreeseedOperationsSdk } from './operations/runtime.ts';
|
|
14
16
|
export { TreeseedWorkflowSdk } from './workflow.ts';
|
|
15
17
|
export { getTreeseedVerifyDriverStatus, runTreeseedVerifyDriver } from './verification.ts';
|
|
16
|
-
export type { SdkContentEntry, 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, } from './sdk-types.ts';
|
|
18
|
+
export type { 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, ProjectExecutionOwner, ProjectRunnerRegistrationState, RemoteJob, RemoteJobEvent, RemoteJobStatus, } from './sdk-types.ts';
|
|
17
19
|
export type { TreeseedFieldAliasBinding, TreeseedFieldAliasRegistry, } from './field-aliases.ts';
|
|
18
20
|
export type * from './operations-types.ts';
|
|
19
21
|
export type * from './workflow.ts';
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,16 @@ import {
|
|
|
12
12
|
resolveModelDefinition
|
|
13
13
|
} from "./model-registry.js";
|
|
14
14
|
import { normalizeAgentCliOptions, buildCopilotAllowToolArgs } from "./cli-tools.js";
|
|
15
|
+
import {
|
|
16
|
+
findDispatchCapability,
|
|
17
|
+
listSdkDispatchCapabilities,
|
|
18
|
+
listWorkflowDispatchCapabilities
|
|
19
|
+
} from "./dispatch.js";
|
|
20
|
+
import {
|
|
21
|
+
executeSdkOperation,
|
|
22
|
+
findSdkOperation,
|
|
23
|
+
listSdkOperationNames
|
|
24
|
+
} from "./sdk-dispatch.js";
|
|
15
25
|
import { resolveSdkRecordVersion } from "./sdk-version.js";
|
|
16
26
|
import {
|
|
17
27
|
normalizeAliasedRecord,
|
|
@@ -33,11 +43,14 @@ import {
|
|
|
33
43
|
TREESEED_REMOTE_CONTRACT_HEADER,
|
|
34
44
|
TREESEED_REMOTE_CONTRACT_VERSION,
|
|
35
45
|
CloudflareQueuePullClient,
|
|
46
|
+
CloudflareQueuePushClient,
|
|
36
47
|
RemoteTreeseedClient,
|
|
37
48
|
RemoteTreeseedAuthClient,
|
|
49
|
+
RemoteTreeseedDispatchClient,
|
|
50
|
+
RemoteTreeseedJobsClient,
|
|
51
|
+
RemoteTreeseedRunnerClient,
|
|
38
52
|
RemoteTreeseedSdkClient,
|
|
39
|
-
RemoteTreeseedOperationsClient
|
|
40
|
-
TreeseedGatewayClient
|
|
53
|
+
RemoteTreeseedOperationsClient
|
|
41
54
|
} from "./remote.js";
|
|
42
55
|
import {
|
|
43
56
|
TRESEED_OPERATION_SPECS,
|
|
@@ -53,19 +66,22 @@ export {
|
|
|
53
66
|
BUILTIN_MODEL_REGISTRY,
|
|
54
67
|
CloudflareHttpD1Database,
|
|
55
68
|
CloudflareQueuePullClient,
|
|
69
|
+
CloudflareQueuePushClient,
|
|
56
70
|
ContentGraphRuntime,
|
|
57
71
|
DEFAULT_GRAPH_RANKING_PROVIDER,
|
|
58
72
|
MODEL_REGISTRY,
|
|
59
73
|
RemoteTemplateCatalogClient,
|
|
60
74
|
RemoteTreeseedAuthClient,
|
|
61
75
|
RemoteTreeseedClient,
|
|
76
|
+
RemoteTreeseedDispatchClient,
|
|
77
|
+
RemoteTreeseedJobsClient,
|
|
62
78
|
RemoteTreeseedOperationsClient,
|
|
79
|
+
RemoteTreeseedRunnerClient,
|
|
63
80
|
RemoteTreeseedSdkClient,
|
|
64
81
|
ScopedAgentSdk,
|
|
65
82
|
TREESEED_REMOTE_CONTRACT_HEADER,
|
|
66
83
|
TREESEED_REMOTE_CONTRACT_VERSION,
|
|
67
84
|
TRESEED_OPERATION_SPECS,
|
|
68
|
-
TreeseedGatewayClient,
|
|
69
85
|
TreeseedOperationsSdk,
|
|
70
86
|
TreeseedWorkflowSdk,
|
|
71
87
|
buildBuiltinModelRegistry,
|
|
@@ -74,9 +90,15 @@ export {
|
|
|
74
90
|
buildScopedModelRegistry,
|
|
75
91
|
canonicalizeFrontmatter,
|
|
76
92
|
createDefaultGraphRankingProvider,
|
|
93
|
+
executeSdkOperation,
|
|
94
|
+
findDispatchCapability,
|
|
95
|
+
findSdkOperation,
|
|
77
96
|
findTreeseedOperation,
|
|
78
97
|
getTreeseedVerifyDriverStatus,
|
|
98
|
+
listSdkDispatchCapabilities,
|
|
99
|
+
listSdkOperationNames,
|
|
79
100
|
listTreeseedOperationNames,
|
|
101
|
+
listWorkflowDispatchCapabilities,
|
|
80
102
|
mergeModelRegistries,
|
|
81
103
|
normalizeAgentCliOptions,
|
|
82
104
|
normalizeAliasedRecord,
|
|
@@ -455,6 +455,7 @@ class DefaultTreeseedOperationsProvider {
|
|
|
455
455
|
new WorkflowOperation("close"),
|
|
456
456
|
new WorkflowOperation("stage"),
|
|
457
457
|
new WorkflowOperation("config"),
|
|
458
|
+
new WorkflowOperation("export"),
|
|
458
459
|
new WorkflowOperation("release"),
|
|
459
460
|
new WorkflowOperation("destroy"),
|
|
460
461
|
new WorkflowOperation("dev"),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { RemoteTreeseedConfig } from '../../remote.ts';
|
|
2
|
+
import { TREESEED_ENVIRONMENT_SCOPES, validateTreeseedEnvironmentValues } from '../../platform/environment.ts';
|
|
2
3
|
export declare const DEFAULT_TREESEED_API_BASE_URL = "https://api.treeseed.ai";
|
|
3
4
|
export declare const DEFAULT_TEMPLATE_CATALOG_URL = "https://api.treeseed.ai/search/templates";
|
|
4
5
|
export declare const TREESEED_TEMPLATE_CATALOG_URL_ENV = "TREESEED_TEMPLATE_CATALOG_URL";
|
|
@@ -12,6 +13,47 @@ export declare function getTreeseedMachineConfigPaths(tenantRoot: any): {
|
|
|
12
13
|
export declare function getTreeseedRemoteAuthPaths(tenantRoot: any): {
|
|
13
14
|
authPath: string;
|
|
14
15
|
};
|
|
16
|
+
export type TreeseedConfigScope = (typeof TREESEED_ENVIRONMENT_SCOPES)[number];
|
|
17
|
+
export type TreeseedConfigEntrySnapshot = {
|
|
18
|
+
id: string;
|
|
19
|
+
label: string;
|
|
20
|
+
group: string;
|
|
21
|
+
description: string;
|
|
22
|
+
howToGet: string;
|
|
23
|
+
sensitivity: 'secret' | 'plain' | 'derived';
|
|
24
|
+
targets: string[];
|
|
25
|
+
purposes: string[];
|
|
26
|
+
storage: 'shared' | 'scoped';
|
|
27
|
+
scope: TreeseedConfigScope;
|
|
28
|
+
sharedScopes: TreeseedConfigScope[];
|
|
29
|
+
required: boolean;
|
|
30
|
+
currentValue: string;
|
|
31
|
+
suggestedValue: string;
|
|
32
|
+
effectiveValue: string;
|
|
33
|
+
};
|
|
34
|
+
export type TreeseedCollectedConfigContext = {
|
|
35
|
+
tenantRoot: string;
|
|
36
|
+
scopes: TreeseedConfigScope[];
|
|
37
|
+
project: {
|
|
38
|
+
name: string;
|
|
39
|
+
slug: string;
|
|
40
|
+
siteUrl: string;
|
|
41
|
+
};
|
|
42
|
+
configPath: string;
|
|
43
|
+
keyPath: string;
|
|
44
|
+
entriesByScope: Record<TreeseedConfigScope, TreeseedConfigEntrySnapshot[]>;
|
|
45
|
+
valuesByScope: Record<TreeseedConfigScope, Record<string, string>>;
|
|
46
|
+
suggestedValuesByScope: Record<TreeseedConfigScope, Record<string, string>>;
|
|
47
|
+
authStatusByScope: Record<TreeseedConfigScope, ReturnType<typeof createConfigAuthStatus>>;
|
|
48
|
+
validationByScope: Record<TreeseedConfigScope, ReturnType<typeof validateTreeseedEnvironmentValues>>;
|
|
49
|
+
registry: ReturnType<typeof collectTreeseedEnvironmentContext>;
|
|
50
|
+
};
|
|
51
|
+
export type TreeseedConfigValueUpdate = {
|
|
52
|
+
scope: TreeseedConfigScope;
|
|
53
|
+
entryId: string;
|
|
54
|
+
value: string;
|
|
55
|
+
reused?: boolean;
|
|
56
|
+
};
|
|
15
57
|
export declare function createDefaultTreeseedMachineConfig({ tenantRoot, deployConfig, tenantConfig }: {
|
|
16
58
|
tenantRoot: any;
|
|
17
59
|
deployConfig: any;
|
|
@@ -55,6 +97,10 @@ export declare function createDefaultTreeseedMachineConfig({ tenantRoot, deployC
|
|
|
55
97
|
};
|
|
56
98
|
};
|
|
57
99
|
};
|
|
100
|
+
shared: {
|
|
101
|
+
values: {};
|
|
102
|
+
secrets: {};
|
|
103
|
+
};
|
|
58
104
|
environments: {
|
|
59
105
|
[k: string]: {
|
|
60
106
|
values: {};
|
|
@@ -113,7 +159,12 @@ export declare function resolveTreeseedRemoteConfig(startRoot?: string, env?: No
|
|
|
113
159
|
export declare function resolveTreeseedTemplateCatalogEndpoint(startRoot?: string, env?: NodeJS.ProcessEnv): string;
|
|
114
160
|
export declare function resolveTreeseedTemplateCatalogCachePath(startRoot?: string): string;
|
|
115
161
|
export declare function ensureTreeseedGitignoreEntries(tenantRoot: any): string;
|
|
116
|
-
export
|
|
162
|
+
export type TreeseedRepairAction = {
|
|
163
|
+
id: string;
|
|
164
|
+
detail: string;
|
|
165
|
+
};
|
|
166
|
+
export declare function applyTreeseedSafeRepairs(tenantRoot: string): TreeseedRepairAction[];
|
|
167
|
+
export declare function resolveTreeseedMachineEnvironmentValues(tenantRoot: any, scope: any): {};
|
|
117
168
|
export declare function setTreeseedMachineEnvironmentValue(tenantRoot: any, scope: any, entry: any, value: any): any;
|
|
118
169
|
export declare function collectTreeseedEnvironmentContext(tenantRoot: any): import("../../platform/environment.ts").TreeseedResolvedEnvironmentRegistry;
|
|
119
170
|
export declare function collectTreeseedConfigSeedValues(tenantRoot: any, scope: any, env?: NodeJS.ProcessEnv): any;
|
|
@@ -127,14 +178,14 @@ export declare function applyTreeseedEnvironmentToProcess({ tenantRoot, scope, o
|
|
|
127
178
|
tenantRoot: any;
|
|
128
179
|
scope: any;
|
|
129
180
|
override?: boolean | undefined;
|
|
130
|
-
}):
|
|
181
|
+
}): {};
|
|
131
182
|
export declare function validateTreeseedCommandEnvironment({ tenantRoot, scope, purpose }: {
|
|
132
183
|
tenantRoot: any;
|
|
133
184
|
scope: any;
|
|
134
185
|
purpose: any;
|
|
135
186
|
}): {
|
|
136
187
|
registry: import("../../platform/environment.ts").TreeseedResolvedEnvironmentRegistry;
|
|
137
|
-
values:
|
|
188
|
+
values: {};
|
|
138
189
|
validation: import("../../platform/environment.ts").TreeseedEnvironmentValidationResult;
|
|
139
190
|
};
|
|
140
191
|
export declare function assertTreeseedCommandEnvironment({ tenantRoot, scope, purpose }: {
|
|
@@ -143,7 +194,7 @@ export declare function assertTreeseedCommandEnvironment({ tenantRoot, scope, pu
|
|
|
143
194
|
purpose: any;
|
|
144
195
|
}): {
|
|
145
196
|
registry: import("../../platform/environment.ts").TreeseedResolvedEnvironmentRegistry;
|
|
146
|
-
values:
|
|
197
|
+
values: {};
|
|
147
198
|
validation: import("../../platform/environment.ts").TreeseedEnvironmentValidationResult;
|
|
148
199
|
};
|
|
149
200
|
export declare function writeTreeseedLocalEnvironmentFiles(tenantRoot: any): {
|
|
@@ -245,25 +296,69 @@ export declare function initializeTreeseedPersistentEnvironment({ tenantRoot, sc
|
|
|
245
296
|
};
|
|
246
297
|
secrets: string[];
|
|
247
298
|
};
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
299
|
+
declare function createConfigAuthStatus(values: any): {
|
|
300
|
+
gh: {
|
|
301
|
+
authenticated: boolean;
|
|
302
|
+
};
|
|
303
|
+
wrangler: {
|
|
304
|
+
authenticated: boolean;
|
|
305
|
+
};
|
|
306
|
+
railway: {
|
|
307
|
+
authenticated: boolean;
|
|
308
|
+
};
|
|
309
|
+
copilot: {
|
|
310
|
+
configured: boolean;
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
export declare function listRelevantTreeseedConfigEntries(registry: any, scope: TreeseedConfigScope): any;
|
|
314
|
+
export declare function collectTreeseedConfigContext({ tenantRoot, scopes, env, }: {
|
|
315
|
+
tenantRoot: string;
|
|
316
|
+
scopes?: TreeseedConfigScope[];
|
|
317
|
+
env?: NodeJS.ProcessEnv;
|
|
318
|
+
}): TreeseedCollectedConfigContext;
|
|
319
|
+
export declare function applyTreeseedConfigValues({ tenantRoot, updates, writeLocalFiles, applyLocalEnvironment, }: {
|
|
320
|
+
tenantRoot: string;
|
|
321
|
+
updates: TreeseedConfigValueUpdate[];
|
|
322
|
+
writeLocalFiles?: boolean;
|
|
323
|
+
applyLocalEnvironment?: boolean;
|
|
324
|
+
}): {
|
|
325
|
+
updated: {
|
|
326
|
+
scope: TreeseedConfigScope | "shared";
|
|
327
|
+
id: string;
|
|
328
|
+
reused: boolean;
|
|
329
|
+
cleared: boolean;
|
|
330
|
+
}[];
|
|
331
|
+
envFiles: {
|
|
332
|
+
envLocalPath: string;
|
|
333
|
+
devVarsPath: string;
|
|
334
|
+
} | null;
|
|
335
|
+
};
|
|
336
|
+
export declare function finalizeTreeseedConfig({ tenantRoot, scopes, sync, env, checkConnections, initializePersistent, }: {
|
|
337
|
+
tenantRoot: string;
|
|
338
|
+
scopes?: TreeseedConfigScope[];
|
|
339
|
+
sync?: 'none' | 'github' | 'cloudflare' | 'railway' | 'all';
|
|
340
|
+
env?: NodeJS.ProcessEnv;
|
|
341
|
+
checkConnections?: boolean;
|
|
342
|
+
initializePersistent?: boolean;
|
|
343
|
+
}): {
|
|
344
|
+
scopes: ("local" | "staging" | "prod")[];
|
|
345
|
+
synced: Record<string, unknown>;
|
|
346
|
+
initialized: Array<{
|
|
347
|
+
scope: TreeseedConfigScope;
|
|
348
|
+
secrets: number;
|
|
349
|
+
target: string;
|
|
350
|
+
}>;
|
|
351
|
+
connectionChecks: ReturnType<typeof checkTreeseedProviderConnections>[];
|
|
352
|
+
validationByScope: Record<TreeseedConfigScope, ReturnType<typeof validateTreeseedEnvironmentValues>>;
|
|
353
|
+
};
|
|
354
|
+
export declare function collectTreeseedPrintEnvReport({ tenantRoot, scope, env, revealSecrets, }: {
|
|
355
|
+
tenantRoot: string;
|
|
356
|
+
scope: TreeseedConfigScope;
|
|
357
|
+
env?: NodeJS.ProcessEnv;
|
|
358
|
+
revealSecrets?: boolean;
|
|
359
|
+
}): {
|
|
360
|
+
scope: "local" | "staging" | "prod";
|
|
361
|
+
revealSecrets: boolean;
|
|
362
|
+
entries: any;
|
|
363
|
+
};
|
|
364
|
+
export {};
|