@treeseed/sdk 0.4.6 → 0.4.8

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.
@@ -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 declare function resolveTreeseedMachineEnvironmentValues(tenantRoot: any, scope: any): any;
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
- }): any;
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: any;
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: any;
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
- export declare function runTreeseedConfigWizard({ tenantRoot, scopes, sync, prompt, authStatus, write, env, useInk, printEnv, revealSecrets, checkConnections, }: {
249
- tenantRoot: any;
250
- scopes?: string[] | undefined;
251
- sync?: string | undefined;
252
- prompt: any;
253
- authStatus: any;
254
- write?: {
255
- (...data: any[]): void;
256
- (message?: any, ...optionalParams: any[]): void;
257
- } | undefined;
258
- env?: NodeJS.ProcessEnv | undefined;
259
- useInk?: boolean | undefined;
260
- printEnv?: boolean | undefined;
261
- revealSecrets?: boolean | undefined;
262
- checkConnections?: boolean | undefined;
263
- }): Promise<{
264
- scopes: string[];
265
- updated: never[];
266
- synced: {};
267
- initialized: never[];
268
- connectionChecks: never[];
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 {};