@treeseed/sdk 0.4.8 → 0.4.10
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/control-plane-client.d.ts +45 -0
- package/dist/control-plane-client.js +229 -0
- package/dist/control-plane.d.ts +94 -0
- package/dist/control-plane.js +125 -0
- package/dist/d1-store.d.ts +56 -1
- package/dist/d1-store.js +132 -0
- package/dist/dispatch.d.ts +4 -0
- package/dist/dispatch.js +180 -0
- package/dist/index.d.ts +14 -2
- package/dist/index.js +94 -4
- package/dist/operations/services/config-runtime.d.ts +10 -0
- package/dist/operations/services/config-runtime.js +62 -4
- package/dist/operations/services/deploy.d.ts +95 -3
- package/dist/operations/services/deploy.js +351 -10
- package/dist/operations/services/github-automation.d.ts +37 -1
- package/dist/operations/services/github-automation.js +71 -14
- package/dist/operations/services/project-platform.d.ts +835 -0
- package/dist/operations/services/project-platform.js +782 -0
- package/dist/operations/services/railway-deploy.d.ts +113 -18
- package/dist/operations/services/railway-deploy.js +357 -8
- package/dist/operations/services/runtime-tools.d.ts +25 -1
- package/dist/operations/services/runtime-tools.js +66 -5
- package/dist/operations/services/template-registry.d.ts +1 -1
- package/dist/operations/services/template-registry.js +17 -3
- package/dist/platform/books-data.d.ts +3 -4
- package/dist/platform/books-data.js +30 -4
- package/dist/platform/contracts.d.ts +56 -4
- package/dist/platform/deploy-config.js +109 -4
- package/dist/platform/deploy-runtime.d.ts +2 -0
- package/dist/platform/deploy-runtime.js +9 -1
- package/dist/platform/env.yaml +677 -0
- package/dist/platform/environment.js +57 -2
- package/dist/platform/plugin.d.ts +8 -0
- package/dist/platform/plugins/constants.d.ts +2 -0
- package/dist/platform/plugins/constants.js +2 -0
- package/dist/platform/plugins/runtime.d.ts +2 -0
- package/dist/platform/plugins/runtime.js +9 -1
- package/dist/platform/plugins.d.ts +1 -1
- package/dist/platform/plugins.js +4 -0
- package/dist/platform/published-content-pipeline.d.ts +84 -0
- package/dist/platform/published-content-pipeline.js +543 -0
- package/dist/platform/published-content.d.ts +223 -0
- package/dist/platform/published-content.js +588 -0
- package/dist/platform/tenant/runtime-config.d.ts +1 -1
- package/dist/platform/tenant/runtime-config.js +34 -1
- package/dist/platform/tenant-config.d.ts +2 -1
- package/dist/platform/tenant-config.js +17 -1
- package/dist/platform/utils/site-config-schema.js +104 -0
- package/dist/plugin-default.d.ts +2 -0
- package/dist/plugin-default.js +2 -0
- package/dist/remote.d.ts +65 -9
- package/dist/remote.js +104 -28
- package/dist/scripts/check-build-warnings.js +50 -0
- package/dist/scripts/config-treeseed.js +7 -0
- package/dist/scripts/tenant-workflow-action.js +71 -0
- package/dist/sdk-dispatch.d.ts +12 -0
- package/dist/sdk-dispatch.js +142 -0
- package/dist/sdk-types.d.ts +579 -7
- package/dist/sdk-types.js +53 -1
- package/dist/sdk.d.ts +17 -1
- package/dist/sdk.js +109 -0
- package/dist/stores/operational-store.d.ts +22 -2
- package/dist/stores/operational-store.js +235 -0
- package/dist/template-catalog.js +8 -1
- package/dist/treeseed/template-catalog/templates/starter-basic/template/treeseed.site.yaml +20 -0
- package/dist/types/cloudflare.d.ts +23 -0
- package/dist/workflow/operations.d.ts +12 -3
- package/dist/workflow/policy.d.ts +1 -1
- package/dist/workflow-state.js +2 -1
- package/package.json +7 -2
- package/templates/github/deploy.workflow.yml +442 -0
- package/templates/github/hosted-project.workflow.yml +77 -0
package/dist/d1-store.js
CHANGED
|
@@ -52,6 +52,11 @@ class MemoryAgentDatabase {
|
|
|
52
52
|
taskOutputs = /* @__PURE__ */ new Map();
|
|
53
53
|
graphRuns = /* @__PURE__ */ new Map();
|
|
54
54
|
reports = /* @__PURE__ */ new Map();
|
|
55
|
+
workPolicies = /* @__PURE__ */ new Map();
|
|
56
|
+
priorityOverrides = /* @__PURE__ */ new Map();
|
|
57
|
+
prioritySnapshots = /* @__PURE__ */ new Map();
|
|
58
|
+
taskCreditLedger = /* @__PURE__ */ new Map();
|
|
59
|
+
scaleDecisions = /* @__PURE__ */ new Map();
|
|
55
60
|
messageId = 0;
|
|
56
61
|
constructor(seed) {
|
|
57
62
|
for (const item of seed?.subscriptions ?? []) {
|
|
@@ -750,6 +755,103 @@ class MemoryAgentDatabase {
|
|
|
750
755
|
graph: workDay?.graphVersion ? { graphVersion: workDay.graphVersion } : null
|
|
751
756
|
};
|
|
752
757
|
}
|
|
758
|
+
async getWorkPolicy(projectId, environment = "local") {
|
|
759
|
+
return this.workPolicies.get(`${projectId}:${environment}`) ?? null;
|
|
760
|
+
}
|
|
761
|
+
async upsertWorkPolicy(request) {
|
|
762
|
+
const policy = {
|
|
763
|
+
projectId: request.projectId,
|
|
764
|
+
environment: request.environment,
|
|
765
|
+
schedule: request.schedule,
|
|
766
|
+
dailyTaskCreditBudget: request.dailyTaskCreditBudget,
|
|
767
|
+
maxQueuedTasks: request.maxQueuedTasks,
|
|
768
|
+
maxQueuedCredits: request.maxQueuedCredits,
|
|
769
|
+
autoscale: request.autoscale,
|
|
770
|
+
creditWeights: request.creditWeights ?? [],
|
|
771
|
+
metadata: request.metadata ?? {}
|
|
772
|
+
};
|
|
773
|
+
this.workPolicies.set(`${request.projectId}:${request.environment}`, policy);
|
|
774
|
+
return policy;
|
|
775
|
+
}
|
|
776
|
+
async listPriorityOverrides(projectId) {
|
|
777
|
+
return [...this.priorityOverrides.values()].filter((entry) => entry.projectId === projectId);
|
|
778
|
+
}
|
|
779
|
+
async upsertPriorityOverride(request) {
|
|
780
|
+
const record = {
|
|
781
|
+
id: request.id ?? crypto.randomUUID(),
|
|
782
|
+
projectId: request.projectId,
|
|
783
|
+
model: request.model,
|
|
784
|
+
subjectId: request.subjectId,
|
|
785
|
+
priority: request.priority,
|
|
786
|
+
estimatedCredits: request.estimatedCredits ?? null,
|
|
787
|
+
metadata: request.metadata ?? {},
|
|
788
|
+
createdAt: nowIso(),
|
|
789
|
+
updatedAt: nowIso()
|
|
790
|
+
};
|
|
791
|
+
this.priorityOverrides.set(record.id, record);
|
|
792
|
+
return record;
|
|
793
|
+
}
|
|
794
|
+
async createPrioritySnapshot(request) {
|
|
795
|
+
const snapshot = {
|
|
796
|
+
id: request.id ?? crypto.randomUUID(),
|
|
797
|
+
projectId: request.projectId,
|
|
798
|
+
workDayId: request.workDayId ?? null,
|
|
799
|
+
generatedAt: nowIso(),
|
|
800
|
+
items: request.items,
|
|
801
|
+
metadata: request.metadata ?? {}
|
|
802
|
+
};
|
|
803
|
+
this.prioritySnapshots.set(snapshot.id, snapshot);
|
|
804
|
+
return snapshot;
|
|
805
|
+
}
|
|
806
|
+
async getLatestPrioritySnapshot(projectId, workDayId) {
|
|
807
|
+
return [...this.prioritySnapshots.values()].filter((entry) => entry.projectId === projectId).filter((entry) => !workDayId || entry.workDayId === workDayId).sort((left, right) => right.generatedAt.localeCompare(left.generatedAt))[0] ?? null;
|
|
808
|
+
}
|
|
809
|
+
async recordTaskCredits(request) {
|
|
810
|
+
const entry = {
|
|
811
|
+
id: request.id ?? crypto.randomUUID(),
|
|
812
|
+
projectId: request.projectId,
|
|
813
|
+
workDayId: request.workDayId,
|
|
814
|
+
taskId: request.taskId ?? null,
|
|
815
|
+
phase: request.phase,
|
|
816
|
+
credits: request.credits,
|
|
817
|
+
metadata: request.metadata ?? {},
|
|
818
|
+
createdAt: nowIso()
|
|
819
|
+
};
|
|
820
|
+
this.taskCreditLedger.set(entry.id, entry);
|
|
821
|
+
const workDay = this.workDays.get(request.workDayId);
|
|
822
|
+
if (workDay) {
|
|
823
|
+
const delta = request.phase === "refund" ? -Math.abs(request.credits) : Math.abs(request.credits);
|
|
824
|
+
this.workDays.set(workDay.id, {
|
|
825
|
+
...workDay,
|
|
826
|
+
capacityUsed: Math.max(0, workDay.capacityUsed + delta),
|
|
827
|
+
updatedAt: nowIso()
|
|
828
|
+
});
|
|
829
|
+
}
|
|
830
|
+
return entry;
|
|
831
|
+
}
|
|
832
|
+
async listTaskCredits(workDayId) {
|
|
833
|
+
return [...this.taskCreditLedger.values()].filter((entry) => entry.workDayId === workDayId).sort((left, right) => left.createdAt.localeCompare(right.createdAt));
|
|
834
|
+
}
|
|
835
|
+
async recordScaleDecision(request) {
|
|
836
|
+
const decision = {
|
|
837
|
+
id: request.id ?? crypto.randomUUID(),
|
|
838
|
+
projectId: request.projectId,
|
|
839
|
+
environment: request.environment,
|
|
840
|
+
poolName: request.poolName,
|
|
841
|
+
workDayId: request.workDayId ?? null,
|
|
842
|
+
desiredWorkers: request.desiredWorkers,
|
|
843
|
+
observedQueueDepth: request.observedQueueDepth,
|
|
844
|
+
observedActiveLeases: request.observedActiveLeases,
|
|
845
|
+
reason: request.reason,
|
|
846
|
+
metadata: request.metadata ?? {},
|
|
847
|
+
createdAt: nowIso()
|
|
848
|
+
};
|
|
849
|
+
this.scaleDecisions.set(decision.id, decision);
|
|
850
|
+
return decision;
|
|
851
|
+
}
|
|
852
|
+
async getLatestScaleDecision(projectId, environment, poolName) {
|
|
853
|
+
return [...this.scaleDecisions.values()].filter((entry) => entry.projectId === projectId && entry.environment === environment && entry.poolName === poolName).sort((left, right) => right.createdAt.localeCompare(left.createdAt))[0] ?? null;
|
|
854
|
+
}
|
|
753
855
|
}
|
|
754
856
|
class CloudflareD1AgentDatabase {
|
|
755
857
|
constructor(db) {
|
|
@@ -1102,6 +1204,36 @@ class CloudflareD1AgentDatabase {
|
|
|
1102
1204
|
graph: workDay?.graphVersion ? { graphVersion: workDay.graphVersion } : null
|
|
1103
1205
|
};
|
|
1104
1206
|
}
|
|
1207
|
+
getWorkPolicy(projectId, environment = "local") {
|
|
1208
|
+
return this.operational.getWorkPolicy(projectId, environment);
|
|
1209
|
+
}
|
|
1210
|
+
upsertWorkPolicy(request) {
|
|
1211
|
+
return this.operational.upsertWorkPolicy(request);
|
|
1212
|
+
}
|
|
1213
|
+
listPriorityOverrides(projectId) {
|
|
1214
|
+
return this.operational.listPriorityOverrides(projectId);
|
|
1215
|
+
}
|
|
1216
|
+
upsertPriorityOverride(request) {
|
|
1217
|
+
return this.operational.upsertPriorityOverride(request);
|
|
1218
|
+
}
|
|
1219
|
+
createPrioritySnapshot(request) {
|
|
1220
|
+
return this.operational.createPrioritySnapshot(request);
|
|
1221
|
+
}
|
|
1222
|
+
getLatestPrioritySnapshot(projectId, workDayId) {
|
|
1223
|
+
return this.operational.getLatestPrioritySnapshot(projectId, workDayId);
|
|
1224
|
+
}
|
|
1225
|
+
recordTaskCredits(request) {
|
|
1226
|
+
return this.operational.recordTaskCredits(request);
|
|
1227
|
+
}
|
|
1228
|
+
listTaskCredits(workDayId) {
|
|
1229
|
+
return this.operational.listTaskCredits(workDayId);
|
|
1230
|
+
}
|
|
1231
|
+
recordScaleDecision(request) {
|
|
1232
|
+
return this.operational.recordScaleDecision(request);
|
|
1233
|
+
}
|
|
1234
|
+
getLatestScaleDecision(projectId, environment, poolName) {
|
|
1235
|
+
return this.operational.getLatestScaleDecision(projectId, environment, poolName);
|
|
1236
|
+
}
|
|
1105
1237
|
}
|
|
1106
1238
|
export {
|
|
1107
1239
|
CloudflareD1AgentDatabase,
|
|
@@ -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
|
@@ -1,23 +1,35 @@
|
|
|
1
1
|
export { AgentSdk, ScopedAgentSdk } from './sdk.ts';
|
|
2
2
|
export { ContentGraphRuntime } from './graph.ts';
|
|
3
|
+
export { projectConnectionModeFromHosting } from './sdk-types.ts';
|
|
4
|
+
export { createControlPlaneReporter } from './control-plane.ts';
|
|
5
|
+
export { ControlPlaneClient } from './control-plane-client.ts';
|
|
6
|
+
export { PUBLISHED_CONTENT_MANIFEST_SCHEMA_VERSION, EDITORIAL_PREVIEW_COOKIE, TeamScopedR2OverlayContentRuntimeProvider, TeamScopedR2OverlayContentPublishProvider, createTeamScopedR2OverlayContentRuntimeProvider, createTeamScopedR2OverlayContentPublishProvider, isTeamScopedR2ContentEnabled, parsePublishedCollectionIndex, parsePublishedContentManifest, parsePublishedOverlayManifest, readPublishedContentManifest, readPublishedOverlayManifest, resolveCloudflareR2Bucket, resolvePublishedContentBucketBinding, resolvePublishedContentManifestKey, resolvePublishedContentPreviewRoot, resolvePublishedContentPreviewTtlHours, resolveTeamScopedContentLocator, signEditorialPreviewToken, verifyEditorialPreviewToken, } from './platform/published-content.ts';
|
|
7
|
+
export { createFilesystemContentSource, createPublishedContentPipeline, } from './platform/published-content-pipeline.ts';
|
|
8
|
+
export { loadTreeseedManifest, loadTreeseedTenantManifest, resolveTreeseedTenantRoot, getTenantContentRoot, tenantFeatureEnabled, tenantModelRendered, } from './platform/tenant-config.ts';
|
|
3
9
|
export { parseGraphDsl } from './graph/dsl.ts';
|
|
4
10
|
export { createDefaultGraphRankingProvider, DEFAULT_GRAPH_RANKING_PROVIDER } from './graph/ranking.ts';
|
|
5
11
|
export { BUILTIN_MODEL_REGISTRY, MODEL_REGISTRY, buildBuiltinModelRegistry, buildModelRegistry, buildScopedModelRegistry, mergeModelRegistries, resolveModelDefinition, } from './model-registry.ts';
|
|
6
12
|
export { normalizeAgentCliOptions, buildCopilotAllowToolArgs } from './cli-tools.ts';
|
|
13
|
+
export { findDispatchCapability, listSdkDispatchCapabilities, listWorkflowDispatchCapabilities, } from './dispatch.ts';
|
|
14
|
+
export { executeSdkOperation, findSdkOperation, listSdkOperationNames, } from './sdk-dispatch.ts';
|
|
7
15
|
export { resolveSdkRecordVersion } from './sdk-version.ts';
|
|
8
16
|
export { normalizeAliasedRecord, preprocessAliasedRecord, resolveAliasedField, } from './field-aliases.ts';
|
|
9
17
|
export { canonicalizeFrontmatter, normalizeFilterFields, normalizeMutationData, normalizeRecordToCanonicalShape, normalizeSortFields, readCanonicalFieldValue, resolveModelField, validateModelFieldAliases, } from './sdk-fields.ts';
|
|
10
18
|
export { RemoteTemplateCatalogClient, parseTemplateCatalogResponse } from './template-catalog.ts';
|
|
11
|
-
export { TREESEED_REMOTE_CONTRACT_HEADER, TREESEED_REMOTE_CONTRACT_VERSION, CloudflareQueuePullClient, RemoteTreeseedClient, RemoteTreeseedAuthClient, RemoteTreeseedSdkClient, RemoteTreeseedOperationsClient,
|
|
19
|
+
export { TREESEED_REMOTE_CONTRACT_HEADER, TREESEED_REMOTE_CONTRACT_VERSION, CloudflareQueuePullClient, CloudflareQueuePushClient, RemoteTreeseedClient, RemoteTreeseedAuthClient, RemoteTreeseedDispatchClient, RemoteTreeseedJobsClient, RemoteTreeseedRunnerClient, RemoteTreeseedSdkClient, RemoteTreeseedOperationsClient, } from './remote.ts';
|
|
12
20
|
export { TRESEED_OPERATION_SPECS, findTreeseedOperation, listTreeseedOperationNames, } from './operations-registry.ts';
|
|
13
21
|
export { TreeseedOperationsSdk } from './operations/runtime.ts';
|
|
14
22
|
export { TreeseedWorkflowSdk } from './workflow.ts';
|
|
15
23
|
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';
|
|
24
|
+
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, ProjectDeployment, ProjectDeploymentKind, ProjectDeploymentStatus, ProjectEnvironment, ProjectExecutionOwner, ProjectHosting, ProjectInfrastructureResource, ProjectInfrastructureResourceKind, ProjectInfrastructureResourceProvider, ProjectRunnerRegistrationState, RemoteJob, RemoteJobEvent, RemoteJobStatus, AgentPool, AgentPoolAutoscalePolicy, AgentPoolRegistration, AgentPoolScaleDecision, AgentPoolStatus, CatalogArtifactVersion, CatalogItem, CatalogItemFilters, CatalogItemOfferMode, ProjectEnvironmentName, ProjectWorkdaySummary, TreeseedHostingKind, TreeseedHostingRegistration, PriorityOverride, WorkdayWindow, WorkdaySchedule, TaskCreditWeight, TaskCreditBudget, WorkdayPolicy, PrioritySnapshotItem, PrioritySnapshot, TaskCreditLedgerEntry, ScaleDecision, TeamStorageLocator, UpsertAgentPoolRequest, UpsertCatalogArtifactVersionRequest, UpsertCatalogItemRequest, UpsertProjectEnvironmentRequest, UpsertProjectHostingRequest, UpsertProjectInfrastructureResourceRequest, UpsertTeamStorageLocatorRequest, CreateProjectDeploymentRequest, RecordAgentPoolRegistrationRequest, WorkerPoolScaleResult, WorkerPoolScaler, } from './sdk-types.ts';
|
|
25
|
+
export type { ControlPlaneAgentPoolHeartbeat, ControlPlaneDeploymentReport, ControlPlaneEnvironmentReport, ControlPlaneReporter, ControlPlaneReporterKind, ControlPlaneResourceReport, ControlPlaneScaleDecisionReport, ControlPlaneWorkdaySummaryReport, } from './control-plane.ts';
|
|
26
|
+
export type { ControlPlaneClientOptions } from './control-plane-client.ts';
|
|
17
27
|
export type { TreeseedFieldAliasBinding, TreeseedFieldAliasRegistry, } from './field-aliases.ts';
|
|
18
28
|
export type * from './operations-types.ts';
|
|
19
29
|
export type * from './workflow.ts';
|
|
20
30
|
export type { AgentDatabase } from './d1-store.ts';
|
|
21
31
|
export type { D1DatabaseLike, D1PreparedStatementLike } from './types/cloudflare.ts';
|
|
32
|
+
export type { ContentPublishProvider, ContentRuntimeProvider, CatalogIndexEntry, EditorialPreviewTokenPayload, HostedContentMode, PublishContentObjectInput, PublishOverlayInput, PublishContentRevisionInput, PublishContentRevisionResult, PublishOverlayResult, PromoteOverlayInput, PublishedArtifactVersion, PublishedCollectionIndex, PublishedContentEntry, PublishedContentManifest, PublishedContentObjectPointer, PublishedRuntimePointers, PublishedOverlayManifest, PublishedContentVisibility, TeamScopedContentLocator, } from './platform/published-content.ts';
|
|
33
|
+
export type { ArtifactBuilder, ArtifactBuilderResult, CollectionIndexBuilder, ContentSource, ContentSourceEntry, EntryRenderer, PublishedContentPipeline, PublishedContentPipelineContext, RuntimeBundleBuilder, RuntimeBundleBuilderResult, RenderedContentEntry, } from './platform/published-content-pipeline.ts';
|
|
22
34
|
export { CloudflareHttpD1Database } from './d1-http.ts';
|
|
23
35
|
export type * from './remote.ts';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
import { AgentSdk, ScopedAgentSdk } from "./sdk.js";
|
|
2
2
|
import { ContentGraphRuntime } from "./graph.js";
|
|
3
|
+
import { projectConnectionModeFromHosting } from "./sdk-types.js";
|
|
4
|
+
import { createControlPlaneReporter } from "./control-plane.js";
|
|
5
|
+
import { ControlPlaneClient } from "./control-plane-client.js";
|
|
6
|
+
import {
|
|
7
|
+
PUBLISHED_CONTENT_MANIFEST_SCHEMA_VERSION,
|
|
8
|
+
EDITORIAL_PREVIEW_COOKIE,
|
|
9
|
+
TeamScopedR2OverlayContentRuntimeProvider,
|
|
10
|
+
TeamScopedR2OverlayContentPublishProvider,
|
|
11
|
+
createTeamScopedR2OverlayContentRuntimeProvider,
|
|
12
|
+
createTeamScopedR2OverlayContentPublishProvider,
|
|
13
|
+
isTeamScopedR2ContentEnabled,
|
|
14
|
+
parsePublishedCollectionIndex,
|
|
15
|
+
parsePublishedContentManifest,
|
|
16
|
+
parsePublishedOverlayManifest,
|
|
17
|
+
readPublishedContentManifest,
|
|
18
|
+
readPublishedOverlayManifest,
|
|
19
|
+
resolveCloudflareR2Bucket,
|
|
20
|
+
resolvePublishedContentBucketBinding,
|
|
21
|
+
resolvePublishedContentManifestKey,
|
|
22
|
+
resolvePublishedContentPreviewRoot,
|
|
23
|
+
resolvePublishedContentPreviewTtlHours,
|
|
24
|
+
resolveTeamScopedContentLocator,
|
|
25
|
+
signEditorialPreviewToken,
|
|
26
|
+
verifyEditorialPreviewToken
|
|
27
|
+
} from "./platform/published-content.js";
|
|
28
|
+
import {
|
|
29
|
+
createFilesystemContentSource,
|
|
30
|
+
createPublishedContentPipeline
|
|
31
|
+
} from "./platform/published-content-pipeline.js";
|
|
32
|
+
import {
|
|
33
|
+
loadTreeseedManifest,
|
|
34
|
+
loadTreeseedTenantManifest,
|
|
35
|
+
resolveTreeseedTenantRoot,
|
|
36
|
+
getTenantContentRoot,
|
|
37
|
+
tenantFeatureEnabled,
|
|
38
|
+
tenantModelRendered
|
|
39
|
+
} from "./platform/tenant-config.js";
|
|
3
40
|
import { parseGraphDsl } from "./graph/dsl.js";
|
|
4
41
|
import { createDefaultGraphRankingProvider, DEFAULT_GRAPH_RANKING_PROVIDER } from "./graph/ranking.js";
|
|
5
42
|
import {
|
|
@@ -12,6 +49,16 @@ import {
|
|
|
12
49
|
resolveModelDefinition
|
|
13
50
|
} from "./model-registry.js";
|
|
14
51
|
import { normalizeAgentCliOptions, buildCopilotAllowToolArgs } from "./cli-tools.js";
|
|
52
|
+
import {
|
|
53
|
+
findDispatchCapability,
|
|
54
|
+
listSdkDispatchCapabilities,
|
|
55
|
+
listWorkflowDispatchCapabilities
|
|
56
|
+
} from "./dispatch.js";
|
|
57
|
+
import {
|
|
58
|
+
executeSdkOperation,
|
|
59
|
+
findSdkOperation,
|
|
60
|
+
listSdkOperationNames
|
|
61
|
+
} from "./sdk-dispatch.js";
|
|
15
62
|
import { resolveSdkRecordVersion } from "./sdk-version.js";
|
|
16
63
|
import {
|
|
17
64
|
normalizeAliasedRecord,
|
|
@@ -33,11 +80,14 @@ import {
|
|
|
33
80
|
TREESEED_REMOTE_CONTRACT_HEADER,
|
|
34
81
|
TREESEED_REMOTE_CONTRACT_VERSION,
|
|
35
82
|
CloudflareQueuePullClient,
|
|
83
|
+
CloudflareQueuePushClient,
|
|
36
84
|
RemoteTreeseedClient,
|
|
37
85
|
RemoteTreeseedAuthClient,
|
|
86
|
+
RemoteTreeseedDispatchClient,
|
|
87
|
+
RemoteTreeseedJobsClient,
|
|
88
|
+
RemoteTreeseedRunnerClient,
|
|
38
89
|
RemoteTreeseedSdkClient,
|
|
39
|
-
RemoteTreeseedOperationsClient
|
|
40
|
-
TreeseedGatewayClient
|
|
90
|
+
RemoteTreeseedOperationsClient
|
|
41
91
|
} from "./remote.js";
|
|
42
92
|
import {
|
|
43
93
|
TRESEED_OPERATION_SPECS,
|
|
@@ -53,19 +103,27 @@ export {
|
|
|
53
103
|
BUILTIN_MODEL_REGISTRY,
|
|
54
104
|
CloudflareHttpD1Database,
|
|
55
105
|
CloudflareQueuePullClient,
|
|
106
|
+
CloudflareQueuePushClient,
|
|
56
107
|
ContentGraphRuntime,
|
|
108
|
+
ControlPlaneClient,
|
|
57
109
|
DEFAULT_GRAPH_RANKING_PROVIDER,
|
|
110
|
+
EDITORIAL_PREVIEW_COOKIE,
|
|
58
111
|
MODEL_REGISTRY,
|
|
112
|
+
PUBLISHED_CONTENT_MANIFEST_SCHEMA_VERSION,
|
|
59
113
|
RemoteTemplateCatalogClient,
|
|
60
114
|
RemoteTreeseedAuthClient,
|
|
61
115
|
RemoteTreeseedClient,
|
|
116
|
+
RemoteTreeseedDispatchClient,
|
|
117
|
+
RemoteTreeseedJobsClient,
|
|
62
118
|
RemoteTreeseedOperationsClient,
|
|
119
|
+
RemoteTreeseedRunnerClient,
|
|
63
120
|
RemoteTreeseedSdkClient,
|
|
64
121
|
ScopedAgentSdk,
|
|
65
122
|
TREESEED_REMOTE_CONTRACT_HEADER,
|
|
66
123
|
TREESEED_REMOTE_CONTRACT_VERSION,
|
|
67
124
|
TRESEED_OPERATION_SPECS,
|
|
68
|
-
|
|
125
|
+
TeamScopedR2OverlayContentPublishProvider,
|
|
126
|
+
TeamScopedR2OverlayContentRuntimeProvider,
|
|
69
127
|
TreeseedOperationsSdk,
|
|
70
128
|
TreeseedWorkflowSdk,
|
|
71
129
|
buildBuiltinModelRegistry,
|
|
@@ -73,10 +131,25 @@ export {
|
|
|
73
131
|
buildModelRegistry,
|
|
74
132
|
buildScopedModelRegistry,
|
|
75
133
|
canonicalizeFrontmatter,
|
|
134
|
+
createControlPlaneReporter,
|
|
76
135
|
createDefaultGraphRankingProvider,
|
|
136
|
+
createFilesystemContentSource,
|
|
137
|
+
createPublishedContentPipeline,
|
|
138
|
+
createTeamScopedR2OverlayContentPublishProvider,
|
|
139
|
+
createTeamScopedR2OverlayContentRuntimeProvider,
|
|
140
|
+
executeSdkOperation,
|
|
141
|
+
findDispatchCapability,
|
|
142
|
+
findSdkOperation,
|
|
77
143
|
findTreeseedOperation,
|
|
144
|
+
getTenantContentRoot,
|
|
78
145
|
getTreeseedVerifyDriverStatus,
|
|
146
|
+
isTeamScopedR2ContentEnabled,
|
|
147
|
+
listSdkDispatchCapabilities,
|
|
148
|
+
listSdkOperationNames,
|
|
79
149
|
listTreeseedOperationNames,
|
|
150
|
+
listWorkflowDispatchCapabilities,
|
|
151
|
+
loadTreeseedManifest,
|
|
152
|
+
loadTreeseedTenantManifest,
|
|
80
153
|
mergeModelRegistries,
|
|
81
154
|
normalizeAgentCliOptions,
|
|
82
155
|
normalizeAliasedRecord,
|
|
@@ -85,13 +158,30 @@ export {
|
|
|
85
158
|
normalizeRecordToCanonicalShape,
|
|
86
159
|
normalizeSortFields,
|
|
87
160
|
parseGraphDsl,
|
|
161
|
+
parsePublishedCollectionIndex,
|
|
162
|
+
parsePublishedContentManifest,
|
|
163
|
+
parsePublishedOverlayManifest,
|
|
88
164
|
parseTemplateCatalogResponse,
|
|
89
165
|
preprocessAliasedRecord,
|
|
166
|
+
projectConnectionModeFromHosting,
|
|
90
167
|
readCanonicalFieldValue,
|
|
168
|
+
readPublishedContentManifest,
|
|
169
|
+
readPublishedOverlayManifest,
|
|
91
170
|
resolveAliasedField,
|
|
171
|
+
resolveCloudflareR2Bucket,
|
|
92
172
|
resolveModelDefinition,
|
|
93
173
|
resolveModelField,
|
|
174
|
+
resolvePublishedContentBucketBinding,
|
|
175
|
+
resolvePublishedContentManifestKey,
|
|
176
|
+
resolvePublishedContentPreviewRoot,
|
|
177
|
+
resolvePublishedContentPreviewTtlHours,
|
|
94
178
|
resolveSdkRecordVersion,
|
|
179
|
+
resolveTeamScopedContentLocator,
|
|
180
|
+
resolveTreeseedTenantRoot,
|
|
95
181
|
runTreeseedVerifyDriver,
|
|
96
|
-
|
|
182
|
+
signEditorialPreviewToken,
|
|
183
|
+
tenantFeatureEnabled,
|
|
184
|
+
tenantModelRendered,
|
|
185
|
+
validateModelFieldAliases,
|
|
186
|
+
verifyEditorialPreviewToken
|
|
97
187
|
};
|
|
@@ -273,6 +273,7 @@ export declare function syncTreeseedRailwayEnvironment({ tenantRoot, scope, dryR
|
|
|
273
273
|
baseUrl: any;
|
|
274
274
|
environmentName: any;
|
|
275
275
|
secrets: string[];
|
|
276
|
+
variables: string[];
|
|
276
277
|
dryRun: boolean;
|
|
277
278
|
} | null)[];
|
|
278
279
|
};
|
|
@@ -290,9 +291,12 @@ export declare function initializeTreeseedPersistentEnvironment({ tenantRoot, sc
|
|
|
290
291
|
workerName: any;
|
|
291
292
|
siteUrl: any;
|
|
292
293
|
accountId: any;
|
|
294
|
+
pages: any;
|
|
293
295
|
formGuardKv: any;
|
|
294
296
|
sessionKv: any;
|
|
295
297
|
siteDataDb: any;
|
|
298
|
+
queue: any;
|
|
299
|
+
content: any;
|
|
296
300
|
};
|
|
297
301
|
secrets: string[];
|
|
298
302
|
};
|
|
@@ -350,6 +354,12 @@ export declare function finalizeTreeseedConfig({ tenantRoot, scopes, sync, env,
|
|
|
350
354
|
}>;
|
|
351
355
|
connectionChecks: ReturnType<typeof checkTreeseedProviderConnections>[];
|
|
352
356
|
validationByScope: Record<TreeseedConfigScope, ReturnType<typeof validateTreeseedEnvironmentValues>>;
|
|
357
|
+
readinessByScope: Record<TreeseedConfigScope, {
|
|
358
|
+
configured: boolean;
|
|
359
|
+
provisioned: boolean;
|
|
360
|
+
deployable: boolean;
|
|
361
|
+
checks: Record<string, unknown>;
|
|
362
|
+
}>;
|
|
353
363
|
};
|
|
354
364
|
export declare function collectTreeseedPrintEnvReport({ tenantRoot, scope, env, revealSecrets, }: {
|
|
355
365
|
tenantRoot: string;
|