@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/sdk-types.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare const SDK_DISPATCH_EXECUTION_CLASSES: readonly ["local_only", "re
|
|
|
7
7
|
export declare const SDK_DISPATCH_TARGETS: readonly ["local", "project_api", "project_runner", "market_catalog"];
|
|
8
8
|
export declare const SDK_DISPATCH_POLICIES: readonly ["auto", "prefer_local", "prefer_remote", "remote_only"];
|
|
9
9
|
export declare const SDK_DISPATCH_NAMESPACES: readonly ["sdk", "workflow"];
|
|
10
|
-
export declare const TREESEED_HOSTING_KINDS: readonly ["
|
|
10
|
+
export declare const TREESEED_HOSTING_KINDS: readonly ["treeseed_control_plane", "hosted_project", "self_hosted_project"];
|
|
11
11
|
export declare const TREESEED_HOSTING_REGISTRATIONS: readonly ["optional", "none"];
|
|
12
12
|
export declare const PROJECT_CONNECTION_MODES: readonly ["hosted", "self_hosted", "hybrid"];
|
|
13
13
|
export declare const PROJECT_RUNNER_REGISTRATION_STATES: readonly ["pending", "registered", "offline"];
|
|
@@ -24,7 +24,16 @@ export declare const AGENT_POOL_STATUSES: readonly ["pending", "active", "degrad
|
|
|
24
24
|
export declare const TREESEED_DEFAULT_STARTER_TEMPLATE_ID: "research";
|
|
25
25
|
export declare const TREESEED_TEMPLATE_ID_ALIASES: {};
|
|
26
26
|
export declare function normalizeTreeseedTemplateId(templateId: string | null | undefined): string;
|
|
27
|
-
export declare const TEMPLATE_HOST_REQUIREMENT_TYPES: readonly ["repository", "web", "email", "ai"];
|
|
27
|
+
export declare const TEMPLATE_HOST_REQUIREMENT_TYPES: readonly ["repository", "web", "email", "ai", "knowledge-library"];
|
|
28
|
+
export declare const TREEDX_INSTANCE_KINDS: readonly ["managed_private", "managed_public_federation", "self_hosted"];
|
|
29
|
+
export declare const TREEDX_INSTANCE_STATUSES: readonly ["pending", "active", "degraded", "offline", "disabled"];
|
|
30
|
+
export declare const TREEDX_DEPLOYMENT_PROVIDERS: readonly ["railway", "self_hosted", "public_federation"];
|
|
31
|
+
export declare const TREEDX_MIRROR_DIRECTIONS: readonly ["pull", "push", "bidirectional"];
|
|
32
|
+
export declare const TREEDX_MIRROR_STATUSES: readonly ["pending", "active", "syncing", "degraded", "disabled"];
|
|
33
|
+
export declare const TREEDX_SHARE_SCOPES: readonly ["team", "library", "public_federation"];
|
|
34
|
+
export declare const TREEDX_SHARE_STATUSES: readonly ["active", "revoked", "expired"];
|
|
35
|
+
export declare const PROJECT_REPOSITORY_ACCESS_MODES: readonly ["treedx", "filesystem"];
|
|
36
|
+
export declare const PROJECT_REPOSITORY_TOPOLOGY_PARTS: readonly ["contentRepository", "siteRepository", "projectRepository"];
|
|
28
37
|
export declare const TEMPLATE_RESOURCE_REQUIREMENT_TYPES: readonly ["service", "database", "object-storage", "queue", "dns-zone"];
|
|
29
38
|
export declare const TEMPLATE_SECRET_SENSITIVITIES: readonly ["secret", "plain", "derived"];
|
|
30
39
|
export declare const TEMPLATE_SECRET_TARGETS: readonly ["github-secret", "github-variable", "cloudflare-secret", "cloudflare-var", "railway-secret", "railway-var", "config-file", "local-runtime"];
|
|
@@ -56,12 +65,21 @@ export type ProjectDeploymentEnvironment = (typeof PROJECT_DEPLOYMENT_ENVIRONMEN
|
|
|
56
65
|
export type ProjectDeploymentStatus = (typeof PROJECT_DEPLOYMENT_STATUSES)[number];
|
|
57
66
|
export type ProjectWebMonitorStatus = 'healthy' | 'degraded' | 'failed' | 'unknown';
|
|
58
67
|
export type ProjectWebMonitorCheckStatus = 'passed' | 'warning' | 'failed' | 'skipped';
|
|
59
|
-
export type ProjectWebMonitorCheckSource = 'market' | 'github' | 'cloudflare' | 'http' | 'sdk';
|
|
68
|
+
export type ProjectWebMonitorCheckSource = 'market' | 'github' | 'cloudflare' | 'http' | 'sdk' | 'treedx';
|
|
60
69
|
export type ProjectInfrastructureResourceProvider = (typeof PROJECT_INFRA_RESOURCE_PROVIDERS)[number];
|
|
61
70
|
export type ProjectInfrastructureResourceKind = (typeof PROJECT_INFRA_RESOURCE_KINDS)[number];
|
|
62
71
|
export type AgentPoolStatus = (typeof AGENT_POOL_STATUSES)[number];
|
|
63
72
|
export type RemoteJobRequestedByType = 'user' | 'team_api_key' | 'service' | 'runner' | 'system';
|
|
64
73
|
export type TemplateHostRequirementType = (typeof TEMPLATE_HOST_REQUIREMENT_TYPES)[number];
|
|
74
|
+
export type TreeDxInstanceKind = (typeof TREEDX_INSTANCE_KINDS)[number];
|
|
75
|
+
export type TreeDxInstanceStatus = (typeof TREEDX_INSTANCE_STATUSES)[number];
|
|
76
|
+
export type TreeDxDeploymentProvider = (typeof TREEDX_DEPLOYMENT_PROVIDERS)[number];
|
|
77
|
+
export type TreeDxMirrorDirection = (typeof TREEDX_MIRROR_DIRECTIONS)[number];
|
|
78
|
+
export type TreeDxMirrorStatus = (typeof TREEDX_MIRROR_STATUSES)[number];
|
|
79
|
+
export type TreeDxShareScope = (typeof TREEDX_SHARE_SCOPES)[number];
|
|
80
|
+
export type TreeDxShareStatus = (typeof TREEDX_SHARE_STATUSES)[number];
|
|
81
|
+
export type ProjectRepositoryAccessMode = (typeof PROJECT_REPOSITORY_ACCESS_MODES)[number];
|
|
82
|
+
export type ProjectRepositoryTopologyPart = (typeof PROJECT_REPOSITORY_TOPOLOGY_PARTS)[number];
|
|
65
83
|
export type TemplateResourceRequirementType = (typeof TEMPLATE_RESOURCE_REQUIREMENT_TYPES)[number];
|
|
66
84
|
export type TemplateSecretSensitivity = (typeof TEMPLATE_SECRET_SENSITIVITIES)[number];
|
|
67
85
|
export type TemplateSecretTarget = (typeof TEMPLATE_SECRET_TARGETS)[number];
|
|
@@ -137,6 +155,153 @@ export interface ProjectLaunchHostBindingInput {
|
|
|
137
155
|
secretRefs?: Record<string, string>;
|
|
138
156
|
selectedBy?: 'user' | 'team-default' | 'managed-default' | 'template-default';
|
|
139
157
|
}
|
|
158
|
+
export interface TreeDxInstance {
|
|
159
|
+
id: string;
|
|
160
|
+
teamId: string;
|
|
161
|
+
kind: TreeDxInstanceKind;
|
|
162
|
+
provider: TreeDxDeploymentProvider | (string & {});
|
|
163
|
+
name: string;
|
|
164
|
+
baseUrl?: string | null;
|
|
165
|
+
registryUrl?: string | null;
|
|
166
|
+
publicRead: boolean;
|
|
167
|
+
primary: boolean;
|
|
168
|
+
status: TreeDxInstanceStatus;
|
|
169
|
+
imageRef?: string | null;
|
|
170
|
+
railwayProjectId?: string | null;
|
|
171
|
+
railwayServiceId?: string | null;
|
|
172
|
+
railwayEnvironmentId?: string | null;
|
|
173
|
+
volumeMountPath?: string | null;
|
|
174
|
+
metadata?: Record<string, unknown>;
|
|
175
|
+
createdAt?: string;
|
|
176
|
+
updatedAt?: string;
|
|
177
|
+
}
|
|
178
|
+
export interface TreeDxDeployment {
|
|
179
|
+
id: string;
|
|
180
|
+
teamId: string;
|
|
181
|
+
instanceId?: string | null;
|
|
182
|
+
provider: TreeDxDeploymentProvider | (string & {});
|
|
183
|
+
status: string;
|
|
184
|
+
imageRef?: string | null;
|
|
185
|
+
volumeMountPath?: string | null;
|
|
186
|
+
serviceRefs?: Record<string, unknown>;
|
|
187
|
+
result?: Record<string, unknown>;
|
|
188
|
+
error?: Record<string, unknown> | null;
|
|
189
|
+
createdAt?: string;
|
|
190
|
+
updatedAt?: string;
|
|
191
|
+
completedAt?: string | null;
|
|
192
|
+
}
|
|
193
|
+
export interface TreeDxDeploymentRequest {
|
|
194
|
+
teamId: string;
|
|
195
|
+
instanceId?: string | null;
|
|
196
|
+
deploymentId?: string | null;
|
|
197
|
+
provider?: TreeDxDeploymentProvider | (string & {});
|
|
198
|
+
imageRef?: string | null;
|
|
199
|
+
volumeMountPath?: string | null;
|
|
200
|
+
publicRead?: boolean;
|
|
201
|
+
baseUrl?: string | null;
|
|
202
|
+
dryRun?: boolean;
|
|
203
|
+
}
|
|
204
|
+
export interface TreeDxDeploymentResult {
|
|
205
|
+
ok: boolean;
|
|
206
|
+
teamId: string;
|
|
207
|
+
instanceId: string;
|
|
208
|
+
deploymentId: string;
|
|
209
|
+
provider: TreeDxDeploymentProvider | (string & {});
|
|
210
|
+
status: string;
|
|
211
|
+
baseUrl?: string | null;
|
|
212
|
+
imageRef?: string | null;
|
|
213
|
+
volumeMountPath?: string | null;
|
|
214
|
+
serviceRefs?: Record<string, unknown>;
|
|
215
|
+
health?: Record<string, unknown> | string | null;
|
|
216
|
+
error?: Record<string, unknown> | null;
|
|
217
|
+
}
|
|
218
|
+
export interface TreeDxMirror {
|
|
219
|
+
id: string;
|
|
220
|
+
teamId: string;
|
|
221
|
+
instanceId: string;
|
|
222
|
+
name: string;
|
|
223
|
+
direction: TreeDxMirrorDirection;
|
|
224
|
+
targetKind: string;
|
|
225
|
+
targetUrl?: string | null;
|
|
226
|
+
status: TreeDxMirrorStatus;
|
|
227
|
+
instructions?: string | null;
|
|
228
|
+
lastSyncAt?: string | null;
|
|
229
|
+
lastSyncStatus?: string | null;
|
|
230
|
+
lastSyncMetadata?: Record<string, unknown>;
|
|
231
|
+
metadata?: Record<string, unknown>;
|
|
232
|
+
createdAt?: string;
|
|
233
|
+
updatedAt?: string;
|
|
234
|
+
}
|
|
235
|
+
export interface TreeDxShareLink {
|
|
236
|
+
id: string;
|
|
237
|
+
teamId: string;
|
|
238
|
+
instanceId?: string | null;
|
|
239
|
+
projectId?: string | null;
|
|
240
|
+
libraryId?: string | null;
|
|
241
|
+
scope: TreeDxShareScope;
|
|
242
|
+
targetTeamId?: string | null;
|
|
243
|
+
trustGrant?: Record<string, unknown>;
|
|
244
|
+
publicRead: boolean;
|
|
245
|
+
status: TreeDxShareStatus;
|
|
246
|
+
expiresAt?: string | null;
|
|
247
|
+
metadata?: Record<string, unknown>;
|
|
248
|
+
createdAt?: string;
|
|
249
|
+
updatedAt?: string;
|
|
250
|
+
revokedAt?: string | null;
|
|
251
|
+
}
|
|
252
|
+
export interface TreeDxProjectLibraryBinding {
|
|
253
|
+
id: string;
|
|
254
|
+
teamId: string;
|
|
255
|
+
projectId: string;
|
|
256
|
+
instanceId: string;
|
|
257
|
+
libraryId: string;
|
|
258
|
+
repositoryId?: string | null;
|
|
259
|
+
contentPath: string;
|
|
260
|
+
contentRepositoryUrl?: string | null;
|
|
261
|
+
contentRepositoryDefaultBranch?: string | null;
|
|
262
|
+
contentRepositoryRef?: string | null;
|
|
263
|
+
r2BucketName?: string | null;
|
|
264
|
+
r2ManifestKey?: string | null;
|
|
265
|
+
metadata?: Record<string, unknown>;
|
|
266
|
+
createdAt?: string;
|
|
267
|
+
updatedAt?: string;
|
|
268
|
+
}
|
|
269
|
+
export interface ProjectContentRepositoryTopology {
|
|
270
|
+
accessMode: 'treedx';
|
|
271
|
+
githubUrl?: string | null;
|
|
272
|
+
defaultBranch?: string | null;
|
|
273
|
+
ref?: string | null;
|
|
274
|
+
contentPath: string;
|
|
275
|
+
treeDx: {
|
|
276
|
+
instanceId: string;
|
|
277
|
+
libraryId: string;
|
|
278
|
+
repositoryId?: string | null;
|
|
279
|
+
baseUrl?: string | null;
|
|
280
|
+
};
|
|
281
|
+
r2?: {
|
|
282
|
+
bucketName?: string | null;
|
|
283
|
+
manifestKey?: string | null;
|
|
284
|
+
publicBaseUrl?: string | null;
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
export interface ProjectFilesystemRepositoryTopology {
|
|
288
|
+
accessMode: 'filesystem';
|
|
289
|
+
provider?: string | null;
|
|
290
|
+
owner?: string | null;
|
|
291
|
+
name?: string | null;
|
|
292
|
+
url?: string | null;
|
|
293
|
+
defaultBranch?: string | null;
|
|
294
|
+
ref?: string | null;
|
|
295
|
+
checkoutPath?: string | null;
|
|
296
|
+
volumePath?: string | null;
|
|
297
|
+
submoduleMountPath?: string | null;
|
|
298
|
+
siteSubmodulePath?: string | null;
|
|
299
|
+
}
|
|
300
|
+
export interface ProjectRepositoryTopology {
|
|
301
|
+
contentRepository: ProjectContentRepositoryTopology;
|
|
302
|
+
siteRepository: ProjectFilesystemRepositoryTopology;
|
|
303
|
+
projectRepository?: ProjectFilesystemRepositoryTopology | null;
|
|
304
|
+
}
|
|
140
305
|
export declare function projectConnectionModeFromHosting(kind: TreeseedHostingKind, registration?: TreeseedHostingRegistration): ProjectConnectionMode;
|
|
141
306
|
export interface SdkDispatchCapability {
|
|
142
307
|
namespace: SdkDispatchNamespace;
|
|
@@ -377,7 +542,7 @@ export interface ProjectDeploymentReadiness {
|
|
|
377
542
|
export interface CreateProjectWebDeploymentRequest {
|
|
378
543
|
environment: ProjectDeploymentEnvironment;
|
|
379
544
|
action: ProjectWebDeploymentAction;
|
|
380
|
-
source?: 'market_ui' | '
|
|
545
|
+
source?: 'market_ui' | 'api' | 'cli' | 'launch_flow';
|
|
381
546
|
reason?: string;
|
|
382
547
|
idempotencyKey?: string;
|
|
383
548
|
previewId?: string | null;
|
package/dist/sdk-types.js
CHANGED
|
@@ -33,7 +33,7 @@ const SDK_DISPATCH_EXECUTION_CLASSES = ["local_only", "remote_inline", "remote_j
|
|
|
33
33
|
const SDK_DISPATCH_TARGETS = ["local", "project_api", "project_runner", "market_catalog"];
|
|
34
34
|
const SDK_DISPATCH_POLICIES = ["auto", "prefer_local", "prefer_remote", "remote_only"];
|
|
35
35
|
const SDK_DISPATCH_NAMESPACES = ["sdk", "workflow"];
|
|
36
|
-
const TREESEED_HOSTING_KINDS = ["
|
|
36
|
+
const TREESEED_HOSTING_KINDS = ["treeseed_control_plane", "hosted_project", "self_hosted_project"];
|
|
37
37
|
const TREESEED_HOSTING_REGISTRATIONS = ["optional", "none"];
|
|
38
38
|
const PROJECT_CONNECTION_MODES = ["hosted", "self_hosted", "hybrid"];
|
|
39
39
|
const PROJECT_RUNNER_REGISTRATION_STATES = ["pending", "registered", "offline"];
|
|
@@ -65,7 +65,16 @@ function normalizeTreeseedTemplateId(templateId) {
|
|
|
65
65
|
const trimmed = String(templateId ?? "").trim();
|
|
66
66
|
return TREESEED_TEMPLATE_ID_ALIASES[trimmed] ?? trimmed;
|
|
67
67
|
}
|
|
68
|
-
const TEMPLATE_HOST_REQUIREMENT_TYPES = ["repository", "web", "email", "ai"];
|
|
68
|
+
const TEMPLATE_HOST_REQUIREMENT_TYPES = ["repository", "web", "email", "ai", "knowledge-library"];
|
|
69
|
+
const TREEDX_INSTANCE_KINDS = ["managed_private", "managed_public_federation", "self_hosted"];
|
|
70
|
+
const TREEDX_INSTANCE_STATUSES = ["pending", "active", "degraded", "offline", "disabled"];
|
|
71
|
+
const TREEDX_DEPLOYMENT_PROVIDERS = ["railway", "self_hosted", "public_federation"];
|
|
72
|
+
const TREEDX_MIRROR_DIRECTIONS = ["pull", "push", "bidirectional"];
|
|
73
|
+
const TREEDX_MIRROR_STATUSES = ["pending", "active", "syncing", "degraded", "disabled"];
|
|
74
|
+
const TREEDX_SHARE_SCOPES = ["team", "library", "public_federation"];
|
|
75
|
+
const TREEDX_SHARE_STATUSES = ["active", "revoked", "expired"];
|
|
76
|
+
const PROJECT_REPOSITORY_ACCESS_MODES = ["treedx", "filesystem"];
|
|
77
|
+
const PROJECT_REPOSITORY_TOPOLOGY_PARTS = ["contentRepository", "siteRepository", "projectRepository"];
|
|
69
78
|
const TEMPLATE_RESOURCE_REQUIREMENT_TYPES = ["service", "database", "object-storage", "queue", "dns-zone"];
|
|
70
79
|
const TEMPLATE_SECRET_SENSITIVITIES = ["secret", "plain", "derived"];
|
|
71
80
|
const TEMPLATE_SECRET_TARGETS = [
|
|
@@ -103,6 +112,8 @@ export {
|
|
|
103
112
|
PROJECT_INFRA_RESOURCE_KINDS,
|
|
104
113
|
PROJECT_INFRA_RESOURCE_PROVIDERS,
|
|
105
114
|
PROJECT_LAUNCH_REQUIREMENT_KINDS,
|
|
115
|
+
PROJECT_REPOSITORY_ACCESS_MODES,
|
|
116
|
+
PROJECT_REPOSITORY_TOPOLOGY_PARTS,
|
|
106
117
|
PROJECT_RUNNER_REGISTRATION_STATES,
|
|
107
118
|
PROJECT_WEB_DEPLOYMENT_ACTIONS,
|
|
108
119
|
REMOTE_JOB_STATUSES,
|
|
@@ -122,6 +133,13 @@ export {
|
|
|
122
133
|
TEMPLATE_SECRET_SENSITIVITIES,
|
|
123
134
|
TEMPLATE_SECRET_SOURCES,
|
|
124
135
|
TEMPLATE_SECRET_TARGETS,
|
|
136
|
+
TREEDX_DEPLOYMENT_PROVIDERS,
|
|
137
|
+
TREEDX_INSTANCE_KINDS,
|
|
138
|
+
TREEDX_INSTANCE_STATUSES,
|
|
139
|
+
TREEDX_MIRROR_DIRECTIONS,
|
|
140
|
+
TREEDX_MIRROR_STATUSES,
|
|
141
|
+
TREEDX_SHARE_SCOPES,
|
|
142
|
+
TREEDX_SHARE_STATUSES,
|
|
125
143
|
TREESEED_DEFAULT_STARTER_TEMPLATE_ID,
|
|
126
144
|
TREESEED_HOSTING_KINDS,
|
|
127
145
|
TREESEED_HOSTING_REGISTRATIONS,
|
package/dist/sdk.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AgentPermissionConfig, AgentRuntimeSpec } from './types/agents.ts';
|
|
2
|
-
import { ContentStore } from './content-store.ts';
|
|
3
2
|
import { type AgentDatabase } from './d1-store.ts';
|
|
3
|
+
import { type AgentSdkContentRepositoryOptions, type AgentSdkTreeDxOptions, type ContentBackend } from './treedx-backends.ts';
|
|
4
|
+
import { LocalGraphPort, LocalRepositoryPort, LocalRepositoryQueryPort, TreeDxArtifactPort, TreeDxExecPort, TreeDxFederatedClient, TreeDxFederatedPort, TreeDxGraphAdapter, TreeDxGraphPort, TreeDxRegistryClient, TreeDxRegistryPort, TreeDxRepositoryPort, TreeDxRepositoryQueryPort, TreeDxClient as PublicTreeDxClient } from './treedx/index.ts';
|
|
4
5
|
import { type LoadedTreeseedPluginEntry } from './platform/plugins.ts';
|
|
5
6
|
import type { ReleaseDetail, ReleaseSummary, SharePackageStatus, WorkstreamDetail, WorkstreamEvent, WorkstreamSummary } from './project-workflow.ts';
|
|
6
7
|
import type { SdkAckMessageRequest, SdkClaimMessageRequest, SdkClaimTaskRequest, SdkCloseWorkDayRequest, SdkCompleteTaskRequest, CreateApprovalRequestRequest, SdkCreateReportRequest, SdkCreateMessageRequest, SdkCreatePrioritySnapshotRequest, SdkCreateTaskRequest, SdkCursorRequest, SdkFailTaskRequest, SdkFollowRequest, SdkGetRequest, SdkGetCursorRequest, SdkJsonEnvelope, SdkLeaseReleaseRequest, SdkManagerContextPayload, SdkMutationRequest, SdkGraphQueryOptions, SdkGraphQueryRequest, SdkGraphRefreshRequest, SdkGraphSearchOptions, SdkContextPackRequest, SdkGraphDslParseResult, SdkPickRequest, SdkPriorityOverrideRequest, SdkClaimWorkdayManagerLeaseRequest, SdkCreateWorkdayRequest, SdkRecordRepositoryClaimRequest, SdkRecordRunnerScaleDecisionRequest, SdkRecordWorkerRunnerRequest, SdkRecordRunRequest, SdkRecordScaleDecisionRequest, SdkRecordTaskCreditsRequest, SdkReleaseWorkdayManagerLeaseRequest, SdkSearchRequest, SdkStartWorkDayRequest, SdkTaskProgressRequest, SdkTaskSearchRequest, SdkUpsertWorkPolicyRequest, SdkUpdateWorkDayGraphRequest, SdkUpdateRequest, SdkModelDefinition, SdkModelRegistry, SdkGraphRankingProvider, SdkDispatchConfig, SdkDispatchRequest, SdkDispatchResult, DecideApprovalRequestRequest, ListApprovalRequestsRequest, PrioritySnapshot, RepositoryClaim, RunnerScaleDecision, ScaleDecision, TaskCreditLedgerEntry, WorkdayManagerLease, WorkdayPolicy, WorkdayRequest, WorkerRunner, UpsertTeamInboxItemRequest } from './sdk-types.ts';
|
|
@@ -12,12 +13,34 @@ export interface AgentSdkOptions {
|
|
|
12
13
|
graphRankingProvider?: SdkGraphRankingProvider;
|
|
13
14
|
plugins?: LoadedTreeseedPluginEntry[];
|
|
14
15
|
dispatch?: SdkDispatchConfig;
|
|
16
|
+
treeDx?: AgentSdkTreeDxOptions;
|
|
17
|
+
contentRepository?: AgentSdkContentRepositoryOptions;
|
|
15
18
|
}
|
|
19
|
+
export type { AgentSdkContentRepositoryOptions, AgentSdkTreeDxOptions, TreeSeedTreeDxContentPathRule, TreeSeedTreeDxRepositoryHint, } from './treedx-backends.ts';
|
|
16
20
|
export declare class AgentSdk {
|
|
17
21
|
readonly repoRoot: string;
|
|
18
22
|
readonly database: AgentDatabase;
|
|
19
|
-
readonly content:
|
|
23
|
+
readonly content: ContentBackend;
|
|
20
24
|
readonly models: SdkModelRegistry;
|
|
25
|
+
readonly ports: {
|
|
26
|
+
repository: LocalRepositoryPort | TreeDxRepositoryPort;
|
|
27
|
+
query: LocalRepositoryQueryPort | TreeDxRepositoryQueryPort;
|
|
28
|
+
graph: LocalGraphPort | TreeDxGraphPort;
|
|
29
|
+
registry?: TreeDxRegistryPort;
|
|
30
|
+
federated?: TreeDxFederatedPort;
|
|
31
|
+
exec?: TreeDxExecPort;
|
|
32
|
+
artifact?: TreeDxArtifactPort;
|
|
33
|
+
};
|
|
34
|
+
readonly treeDx?: {
|
|
35
|
+
client: PublicTreeDxClient;
|
|
36
|
+
graph: TreeDxGraphAdapter;
|
|
37
|
+
registry?: TreeDxRegistryClient;
|
|
38
|
+
federated?: TreeDxFederatedClient;
|
|
39
|
+
exec?: TreeDxExecPort;
|
|
40
|
+
artifact?: TreeDxArtifactPort;
|
|
41
|
+
};
|
|
42
|
+
private readonly localContentStore;
|
|
43
|
+
private readonly localGraphRuntime;
|
|
21
44
|
private readonly graph;
|
|
22
45
|
private readonly dispatchConfig?;
|
|
23
46
|
constructor(options?: AgentSdkOptions);
|
|
@@ -49,14 +72,8 @@ export declare class AgentSdk {
|
|
|
49
72
|
since: string;
|
|
50
73
|
}>>;
|
|
51
74
|
pick(request: SdkPickRequest): Promise<SdkJsonEnvelope<import("./sdk-types.ts").SdkPickResult<Record<string, unknown>> | import("./sdk-types.ts").SdkPickResult<import("./sdk-types.ts").SdkContentEntry>>>;
|
|
52
|
-
create(request: SdkMutationRequest): Promise<SdkJsonEnvelope<
|
|
53
|
-
|
|
54
|
-
git: import("./git-runtime.ts").GitMutationResult;
|
|
55
|
-
}>>;
|
|
56
|
-
update(request: SdkUpdateRequest): Promise<SdkJsonEnvelope<Record<string, unknown> | {
|
|
57
|
-
item: import("./sdk-types.ts").SdkContentEntry;
|
|
58
|
-
git: import("./git-runtime.ts").GitMutationResult;
|
|
59
|
-
} | null>>;
|
|
75
|
+
create(request: SdkMutationRequest): Promise<SdkJsonEnvelope<unknown>>;
|
|
76
|
+
update(request: SdkUpdateRequest): Promise<SdkJsonEnvelope<unknown>>;
|
|
60
77
|
claimMessage(request: SdkClaimMessageRequest): Promise<SdkJsonEnvelope<import("./sdk-types.ts").SdkMessageEntity | null>>;
|
|
61
78
|
ackMessage(request: SdkAckMessageRequest): Promise<SdkJsonEnvelope<{
|
|
62
79
|
id: number;
|
|
@@ -132,7 +149,7 @@ export declare class AgentSdk {
|
|
|
132
149
|
}): Promise<Record<string, unknown>[] | import("./sdk-types.ts").SdkContentEntry[]>;
|
|
133
150
|
scopeForAgent(agent: Pick<AgentRuntimeSpec, 'slug' | 'permissions'>): ScopedAgentSdk;
|
|
134
151
|
/** Advanced graph maintenance helper. Most application code should use parseGraphDsl() -> queryGraph() -> buildContextPack(). */
|
|
135
|
-
refreshGraph(request?: SdkGraphRefreshRequest): Promise<
|
|
152
|
+
refreshGraph(request?: SdkGraphRefreshRequest): Promise<unknown>;
|
|
136
153
|
/** Advanced lexical graph primitive for file nodes. Prefer queryGraph() or buildContextPack() for AI-context retrieval. */
|
|
137
154
|
searchFiles(query: string, options?: SdkGraphSearchOptions): Promise<import("./sdk-types.ts").SdkGraphSearchResult[]>;
|
|
138
155
|
/** Advanced lexical graph primitive for section nodes. Prefer queryGraph() or buildContextPack() for AI-context retrieval. */
|
|
@@ -162,9 +179,9 @@ export declare class AgentSdk {
|
|
|
162
179
|
/** Primary graph workflow helper. Resolves roots before ranking and traversal. */
|
|
163
180
|
resolveSeeds(request: SdkGraphQueryRequest): Promise<import("./sdk-types.ts").SdkGraphSeedResolution>;
|
|
164
181
|
/** Primary graph workflow entrypoint for ranked graph retrieval. */
|
|
165
|
-
queryGraph(request: SdkGraphQueryRequest): Promise<
|
|
182
|
+
queryGraph(request: SdkGraphQueryRequest): Promise<unknown>;
|
|
166
183
|
/** Primary graph workflow entrypoint for prompt-ready AI context assembly. */
|
|
167
|
-
buildContextPack(request: SdkContextPackRequest): Promise<
|
|
184
|
+
buildContextPack(request: SdkContextPackRequest): Promise<unknown>;
|
|
168
185
|
/** Primary graph workflow helper. Parses the public ctx DSL into a typed graph request. */
|
|
169
186
|
parseGraphDsl(source: string): Promise<SdkGraphDslParseResult>;
|
|
170
187
|
/** Primary graph workflow helper for resolving ids, paths, and anchors into graph nodes. */
|
|
@@ -202,14 +219,8 @@ export declare class ScopedAgentSdk {
|
|
|
202
219
|
since: string;
|
|
203
220
|
}>>;
|
|
204
221
|
pick(request: SdkPickRequest): Promise<SdkJsonEnvelope<import("./sdk-types.ts").SdkPickResult<Record<string, unknown>> | import("./sdk-types.ts").SdkPickResult<import("./sdk-types.ts").SdkContentEntry>>>;
|
|
205
|
-
create(request: Omit<SdkMutationRequest, 'actor'>): Promise<SdkJsonEnvelope<
|
|
206
|
-
|
|
207
|
-
git: import("./git-runtime.ts").GitMutationResult;
|
|
208
|
-
}>>;
|
|
209
|
-
update(request: Omit<SdkUpdateRequest, 'actor'>): Promise<SdkJsonEnvelope<Record<string, unknown> | {
|
|
210
|
-
item: import("./sdk-types.ts").SdkContentEntry;
|
|
211
|
-
git: import("./git-runtime.ts").GitMutationResult;
|
|
212
|
-
} | null>>;
|
|
222
|
+
create(request: Omit<SdkMutationRequest, 'actor'>): Promise<SdkJsonEnvelope<unknown>>;
|
|
223
|
+
update(request: Omit<SdkUpdateRequest, 'actor'>): Promise<SdkJsonEnvelope<unknown>>;
|
|
213
224
|
claimMessage(request: SdkClaimMessageRequest): Promise<SdkJsonEnvelope<import("./sdk-types.ts").SdkMessageEntity | null>>;
|
|
214
225
|
ackMessage(request: SdkAckMessageRequest): Promise<SdkJsonEnvelope<{
|
|
215
226
|
id: number;
|
|
@@ -223,7 +234,7 @@ export declare class ScopedAgentSdk {
|
|
|
223
234
|
releaseAllLeases(): Promise<SdkJsonEnvelope<{
|
|
224
235
|
count: number;
|
|
225
236
|
}>>;
|
|
226
|
-
refreshGraph(request?: SdkGraphRefreshRequest): Promise<
|
|
237
|
+
refreshGraph(request?: SdkGraphRefreshRequest): Promise<unknown>;
|
|
227
238
|
/** Advanced lexical graph primitive for file nodes. Scoped to models the agent may search. */
|
|
228
239
|
searchFiles(query: string, options?: SdkGraphSearchOptions): Promise<import("./sdk-types.ts").SdkGraphSearchResult[]>;
|
|
229
240
|
/** Advanced lexical graph primitive for section nodes. Scoped to models the agent may search. */
|
|
@@ -247,9 +258,9 @@ export declare class ScopedAgentSdk {
|
|
|
247
258
|
/** Primary graph workflow helper, scoped to followable models. */
|
|
248
259
|
resolveSeeds(request: SdkGraphQueryRequest): Promise<import("./sdk-types.ts").SdkGraphSeedResolution>;
|
|
249
260
|
/** Primary graph workflow entrypoint for ranked graph retrieval, scoped to followable models. */
|
|
250
|
-
queryGraph(request: SdkGraphQueryRequest): Promise<
|
|
261
|
+
queryGraph(request: SdkGraphQueryRequest): Promise<unknown>;
|
|
251
262
|
/** Primary graph workflow entrypoint for prompt-ready context assembly, scoped to followable models. */
|
|
252
|
-
buildContextPack(request: SdkContextPackRequest): Promise<
|
|
263
|
+
buildContextPack(request: SdkContextPackRequest): Promise<unknown>;
|
|
253
264
|
parseGraphDsl(source: string): Promise<SdkGraphDslParseResult>;
|
|
254
265
|
resolveReference(reference: string, options?: {
|
|
255
266
|
fromNodeId?: string;
|