@treeseed/sdk 0.8.10 → 0.8.12
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 +7 -0
- package/dist/capacity.d.ts +233 -1
- package/dist/capacity.js +1227 -44
- package/dist/control-plane.d.ts +2 -1
- package/dist/control-plane.js +7 -0
- package/dist/d1-store.js +6 -0
- package/dist/git-runtime.js +4 -2
- package/dist/graph/context-query-contracts.d.ts +48 -0
- package/dist/graph/context-query-contracts.js +126 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.js +85 -1
- package/dist/operations/agent-tools.d.ts +114 -0
- package/dist/operations/agent-tools.js +183 -0
- package/dist/operations/services/commit-message-provider.js +1 -1
- package/dist/operations/services/d1-migration.js +27 -0
- package/dist/operations/services/hub-provider-launch.js +1 -1
- package/dist/operations/services/runtime-tools.js +1 -1
- package/dist/operations.d.ts +1 -0
- package/dist/operations.js +16 -0
- package/dist/platform/environment.js +5 -0
- package/dist/platform/plugins/constants.js +1 -1
- package/dist/plugin-default.js +1 -1
- package/dist/sdk-types.d.ts +231 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template/treeseed.site.yaml +1 -1
- package/dist/types/agents.d.ts +12 -0
- package/package.json +9 -1
package/dist/control-plane.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentPoolAutoscalePolicy, ApprovalRequest, CapacityPlan, CapacityReservation, CapacityRoutingDecision, CreateApprovalRequestRequest, CreateCapacityReservationRequest, CreateCapacityRoutingDecisionRequest, ProjectDeploymentKind, ProjectDeploymentStatus, ProjectEnvironmentName, ProjectInfrastructureResourceKind, ProjectInfrastructureResourceProvider, RecordCapacityUsageRequest, TreeseedHostingKind, TreeseedHostingRegistration } from './sdk-types.ts';
|
|
1
|
+
import type { AgentPoolAutoscalePolicy, ApprovalRequest, CapacityPlan, CapacityReservation, CapacityRoutingDecision, CreateApprovalRequestRequest, CreateCapacityReservationRequest, CreateCapacityRoutingDecisionRequest, CreateTaskEstimateRequest, ProjectDeploymentKind, ProjectDeploymentStatus, ProjectEnvironmentName, ProjectInfrastructureResourceKind, ProjectInfrastructureResourceProvider, RecordCapacityUsageRequest, TaskEstimate, TreeseedHostingKind, TreeseedHostingRegistration } from './sdk-types.ts';
|
|
2
2
|
import type { TreeseedDeployConfig } from './platform/contracts.ts';
|
|
3
3
|
export type ControlPlaneReporterKind = 'noop' | 'market_http' | 'self_http';
|
|
4
4
|
export interface ControlPlaneEnvironmentReport {
|
|
@@ -80,6 +80,7 @@ export interface ControlPlaneReporter {
|
|
|
80
80
|
reportWorkdaySummary(input: ControlPlaneWorkdaySummaryReport): Promise<void>;
|
|
81
81
|
getProjectCapacityPlan(environment?: ProjectEnvironmentName | 'local' | null): Promise<CapacityPlan | null>;
|
|
82
82
|
createCapacityReservation(input: CreateCapacityReservationRequest): Promise<CapacityReservation | null>;
|
|
83
|
+
reportCapacityEstimate(input: CreateTaskEstimateRequest): Promise<TaskEstimate | null>;
|
|
83
84
|
reportCapacityUsage(input: RecordCapacityUsageRequest): Promise<void>;
|
|
84
85
|
reportCapacityRoutingDecision(input: CreateCapacityRoutingDecisionRequest): Promise<CapacityRoutingDecision | null>;
|
|
85
86
|
createApprovalRequest(input: CreateApprovalRequestRequest): Promise<ApprovalRequest | null>;
|
package/dist/control-plane.js
CHANGED
|
@@ -47,6 +47,9 @@ class NoopControlPlaneReporter {
|
|
|
47
47
|
async createCapacityReservation() {
|
|
48
48
|
return null;
|
|
49
49
|
}
|
|
50
|
+
async reportCapacityEstimate() {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
50
53
|
async reportCapacityUsage() {
|
|
51
54
|
}
|
|
52
55
|
async reportCapacityRoutingDecision() {
|
|
@@ -134,6 +137,10 @@ class HttpControlPlaneReporter {
|
|
|
134
137
|
if (!this.projectId) return null;
|
|
135
138
|
return this.request("POST", `/v1/projects/${this.projectId}/runner/capacity/reservations`, input);
|
|
136
139
|
}
|
|
140
|
+
async reportCapacityEstimate(input) {
|
|
141
|
+
if (!this.projectId) return null;
|
|
142
|
+
return this.request("POST", `/v1/projects/${this.projectId}/runner/capacity/estimates`, input);
|
|
143
|
+
}
|
|
137
144
|
async reportCapacityUsage(input) {
|
|
138
145
|
if (!this.projectId) return;
|
|
139
146
|
await this.request("POST", `/v1/projects/${this.projectId}/runner/capacity/usage`, input);
|
package/dist/d1-store.js
CHANGED
|
@@ -120,6 +120,9 @@ class MemoryAgentDatabase {
|
|
|
120
120
|
if (model === "task") {
|
|
121
121
|
return [...this.tasks.values()];
|
|
122
122
|
}
|
|
123
|
+
if (model === "task_output") {
|
|
124
|
+
return [...this.taskOutputs.values()].flat();
|
|
125
|
+
}
|
|
123
126
|
if (model === "graph_run") {
|
|
124
127
|
return [...this.graphRuns.values()];
|
|
125
128
|
}
|
|
@@ -160,6 +163,9 @@ class MemoryAgentDatabase {
|
|
|
160
163
|
if (request.model === "task") {
|
|
161
164
|
return this.tasks.get(key) ?? null;
|
|
162
165
|
}
|
|
166
|
+
if (request.model === "task_output") {
|
|
167
|
+
return [...this.taskOutputs.values()].flat().find((output) => output.id === key) ?? null;
|
|
168
|
+
}
|
|
163
169
|
if (request.model === "graph_run") {
|
|
164
170
|
return this.graphRuns.get(key) ?? null;
|
|
165
171
|
}
|
package/dist/git-runtime.js
CHANGED
|
@@ -52,8 +52,10 @@ class GitRuntime {
|
|
|
52
52
|
try {
|
|
53
53
|
await execFileAsync("git", ["commit", "-m", commitMessage], { cwd: worktreePath });
|
|
54
54
|
} catch (error) {
|
|
55
|
-
const
|
|
56
|
-
|
|
55
|
+
const stderr = error && typeof error === "object" && "stderr" in error ? String(error.stderr ?? "") : "";
|
|
56
|
+
const stdout2 = error && typeof error === "object" && "stdout" in error ? String(error.stdout ?? "") : "";
|
|
57
|
+
if (!`${stdout2}
|
|
58
|
+
${stderr}`.includes("nothing to commit")) {
|
|
57
59
|
throw error;
|
|
58
60
|
}
|
|
59
61
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { SdkContextPack, SdkContextPackRequest, SdkGraphQueryStage, SdkGraphQueryView } from '../sdk-types.ts';
|
|
2
|
+
export type DeclarativeContextQueryPurpose = 'plan' | 'research' | 'generate' | 'optimize' | 'implement' | 'review' | 'release' | string;
|
|
3
|
+
export type DeclarativeContextQueryFormat = 'summary' | 'full' | 'sources' | 'list' | 'brief' | 'map' | string;
|
|
4
|
+
export interface DeclarativeContextQuery {
|
|
5
|
+
id: string;
|
|
6
|
+
purpose: DeclarativeContextQueryPurpose;
|
|
7
|
+
query: string;
|
|
8
|
+
scope?: string;
|
|
9
|
+
relations?: string[];
|
|
10
|
+
depth?: number;
|
|
11
|
+
budget?: number;
|
|
12
|
+
format?: DeclarativeContextQueryFormat;
|
|
13
|
+
filters?: Record<string, unknown>;
|
|
14
|
+
required?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export type HandlerContextPackSource = 'agent_spec' | 'content_frontmatter' | 'work_package' | 'task_payload' | 'default_role_context';
|
|
17
|
+
export interface DeclarativeContextQuerySourceRef {
|
|
18
|
+
source: HandlerContextPackSource;
|
|
19
|
+
ref?: string;
|
|
20
|
+
priority: number;
|
|
21
|
+
}
|
|
22
|
+
export interface CompiledDeclarativeContextQuery {
|
|
23
|
+
query: DeclarativeContextQuery;
|
|
24
|
+
request: SdkContextPackRequest;
|
|
25
|
+
warnings: string[];
|
|
26
|
+
}
|
|
27
|
+
export interface DeclarativeContextQueryCompileResult {
|
|
28
|
+
ok: boolean;
|
|
29
|
+
compiled: CompiledDeclarativeContextQuery | null;
|
|
30
|
+
errors: string[];
|
|
31
|
+
warnings: string[];
|
|
32
|
+
}
|
|
33
|
+
export interface ResolvedHandlerContextPack {
|
|
34
|
+
id: string;
|
|
35
|
+
purpose: string;
|
|
36
|
+
source: HandlerContextPackSource;
|
|
37
|
+
sourceRef?: string;
|
|
38
|
+
query: DeclarativeContextQuery;
|
|
39
|
+
request: SdkContextPackRequest;
|
|
40
|
+
pack: SdkContextPack;
|
|
41
|
+
warnings: string[];
|
|
42
|
+
}
|
|
43
|
+
export declare function declarativeContextPurposeToGraphStage(purpose: string): SdkGraphQueryStage;
|
|
44
|
+
export declare function declarativeContextFormatToGraphView(format: string | undefined): SdkGraphQueryView;
|
|
45
|
+
export declare function compileDeclarativeContextQuery(query: DeclarativeContextQuery, options?: {
|
|
46
|
+
defaultLimit?: number;
|
|
47
|
+
maxDepth?: number;
|
|
48
|
+
}): DeclarativeContextQueryCompileResult;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
const VALID_RELATIONS = [
|
|
2
|
+
"related",
|
|
3
|
+
"depends_on",
|
|
4
|
+
"implements",
|
|
5
|
+
"references",
|
|
6
|
+
"parent",
|
|
7
|
+
"child",
|
|
8
|
+
"supersedes"
|
|
9
|
+
];
|
|
10
|
+
const PURPOSE_TO_STAGE = {
|
|
11
|
+
plan: "plan",
|
|
12
|
+
research: "research",
|
|
13
|
+
implement: "implement",
|
|
14
|
+
debug: "debug",
|
|
15
|
+
review: "review"
|
|
16
|
+
};
|
|
17
|
+
const FORMAT_TO_VIEW = {
|
|
18
|
+
summary: "brief",
|
|
19
|
+
brief: "brief",
|
|
20
|
+
full: "full",
|
|
21
|
+
sources: "list",
|
|
22
|
+
list: "list",
|
|
23
|
+
map: "map"
|
|
24
|
+
};
|
|
25
|
+
function asPositiveInteger(value) {
|
|
26
|
+
return typeof value === "number" && Number.isInteger(value) && value > 0;
|
|
27
|
+
}
|
|
28
|
+
function normalizeString(value) {
|
|
29
|
+
return value.trim();
|
|
30
|
+
}
|
|
31
|
+
function declarativeContextPurposeToGraphStage(purpose) {
|
|
32
|
+
return PURPOSE_TO_STAGE[purpose.trim().toLowerCase()] ?? "plan";
|
|
33
|
+
}
|
|
34
|
+
function declarativeContextFormatToGraphView(format) {
|
|
35
|
+
return FORMAT_TO_VIEW[(format ?? "summary").trim().toLowerCase()] ?? "brief";
|
|
36
|
+
}
|
|
37
|
+
function compileDeclarativeContextQuery(query, options = {}) {
|
|
38
|
+
const errors = [];
|
|
39
|
+
const warnings = [];
|
|
40
|
+
const maxDepth = options.maxDepth ?? 3;
|
|
41
|
+
const defaultLimit = options.defaultLimit ?? 8;
|
|
42
|
+
const id = normalizeString(query.id ?? "");
|
|
43
|
+
if (!id) {
|
|
44
|
+
errors.push("Context query id is required.");
|
|
45
|
+
}
|
|
46
|
+
const purpose = normalizeString(query.purpose ?? "");
|
|
47
|
+
if (!purpose) {
|
|
48
|
+
errors.push(`Context query "${id || "<unknown>"}" purpose is required.`);
|
|
49
|
+
}
|
|
50
|
+
const textQuery = normalizeString(query.query ?? "");
|
|
51
|
+
if (!textQuery) {
|
|
52
|
+
errors.push(`Context query "${id || "<unknown>"}" query is required.`);
|
|
53
|
+
}
|
|
54
|
+
const depth = query.depth ?? 1;
|
|
55
|
+
if (!Number.isInteger(depth) || depth < 0 || depth > maxDepth) {
|
|
56
|
+
errors.push(`Context query "${id || "<unknown>"}" depth must be an integer between 0 and ${maxDepth}.`);
|
|
57
|
+
}
|
|
58
|
+
if (query.budget !== void 0 && !asPositiveInteger(query.budget)) {
|
|
59
|
+
errors.push(`Context query "${id || "<unknown>"}" budget must be a positive integer.`);
|
|
60
|
+
}
|
|
61
|
+
const scope = query.scope === void 0 ? void 0 : normalizeString(query.scope);
|
|
62
|
+
if (scope !== void 0 && (!scope || !scope.startsWith("/"))) {
|
|
63
|
+
errors.push(`Context query "${id || "<unknown>"}" scope must start with "/".`);
|
|
64
|
+
}
|
|
65
|
+
const relations = (query.relations ?? ["related", "references"]).map((entry) => entry.trim().toLowerCase());
|
|
66
|
+
const invalidRelations = relations.filter((relation) => !VALID_RELATIONS.includes(relation));
|
|
67
|
+
if (invalidRelations.length > 0) {
|
|
68
|
+
errors.push(`Context query "${id || "<unknown>"}" has invalid relations: ${invalidRelations.join(", ")}.`);
|
|
69
|
+
}
|
|
70
|
+
const uniqueRelations = [...new Set(relations)];
|
|
71
|
+
if (uniqueRelations.length !== relations.length) {
|
|
72
|
+
warnings.push(`Context query "${id || "<unknown>"}" included duplicate relations; duplicates were removed.`);
|
|
73
|
+
}
|
|
74
|
+
const stage = declarativeContextPurposeToGraphStage(purpose);
|
|
75
|
+
if (stage === "plan" && !["plan", ""].includes(purpose.toLowerCase()) && !PURPOSE_TO_STAGE[purpose.toLowerCase()]) {
|
|
76
|
+
warnings.push(`Context query "${id || "<unknown>"}" purpose "${purpose}" is not a graph stage; using "plan".`);
|
|
77
|
+
}
|
|
78
|
+
const view = declarativeContextFormatToGraphView(query.format);
|
|
79
|
+
if (query.format && !FORMAT_TO_VIEW[query.format.trim().toLowerCase()]) {
|
|
80
|
+
warnings.push(`Context query "${id || "<unknown>"}" format "${query.format}" is not a graph view; using "brief".`);
|
|
81
|
+
}
|
|
82
|
+
if (errors.length > 0) {
|
|
83
|
+
return { ok: false, compiled: null, errors, warnings };
|
|
84
|
+
}
|
|
85
|
+
const request = {
|
|
86
|
+
query: textQuery,
|
|
87
|
+
stage,
|
|
88
|
+
relations: uniqueRelations,
|
|
89
|
+
view,
|
|
90
|
+
options: {
|
|
91
|
+
depth,
|
|
92
|
+
limit: defaultLimit,
|
|
93
|
+
maxNodes: defaultLimit
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
if (scope) {
|
|
97
|
+
request.scopePaths = [scope];
|
|
98
|
+
}
|
|
99
|
+
if (query.budget !== void 0) {
|
|
100
|
+
request.budget = {
|
|
101
|
+
maxTokens: query.budget
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
ok: true,
|
|
106
|
+
compiled: {
|
|
107
|
+
query: {
|
|
108
|
+
...query,
|
|
109
|
+
id,
|
|
110
|
+
purpose,
|
|
111
|
+
query: textQuery,
|
|
112
|
+
scope,
|
|
113
|
+
relations: uniqueRelations
|
|
114
|
+
},
|
|
115
|
+
request,
|
|
116
|
+
warnings
|
|
117
|
+
},
|
|
118
|
+
errors: [],
|
|
119
|
+
warnings
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
export {
|
|
123
|
+
compileDeclarativeContextQuery,
|
|
124
|
+
declarativeContextFormatToGraphView,
|
|
125
|
+
declarativeContextPurposeToGraphStage
|
|
126
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { ContentGraphRuntime } from './graph.ts';
|
|
|
3
3
|
export { projectConnectionModeFromHosting } from './sdk-types.ts';
|
|
4
4
|
export { createControlPlaneReporter } from './control-plane.ts';
|
|
5
5
|
export { ControlPlaneClient } from './control-plane-client.ts';
|
|
6
|
-
export { reservationHasCapacity, reserveCreditsForEstimate, routeAndReserveCapacity, scoreCapacityLane, selectBestCapacityLane, settleCapacityActuals, createReservationReleaseEntry, summarizeCapacityPlan, summarizeProjectCapacityPlan, summarizeTeamCapacityPlan, } from './capacity.ts';
|
|
6
|
+
export { DEFAULT_EXECUTION_PROFILE_ID, DEFAULT_EXECUTION_PROFILES, DEFAULT_TASK_ADMISSION_POLICY, buildTaskEstimateProfileFromActuals, computeWorkdayBudgetEnvelope, decideTaskAdmission, estimateAttentionForTask, estimateConfidenceFromProfile, estimateLearningPercentile, estimateLearningVariance, estimateForClassification, estimateProfileConfidenceScore, estimateUtilityForTask, isInterruptedUsageActual, normalizeHybridExecutionPlan, mutationRequiresRepositoryClaim, normalizePlanningPolicy, normalizePredictiveReservePolicy, normalizeTaskPlanProposal, normalizeExecutionProfile, normalizeAttentionPolicy, normalizeTaskAdmissionPolicy, normalizeUtilityPolicy, predictReserveForCapacityPlan, progressivelyAdmitPlanProposal, rankPlannedTaskNodes, reservationHasCapacity, reserveCreditsForEstimate, routeAndReserveCapacity, scoreCapacityLane, selectBestCapacityLane, selectTaskEstimateProfile, settleCapacityActuals, shouldInterruptForCapacity, synthesizePlanEstimate, createReservationReleaseEntry, summarizeCapacityPlan, summarizeProjectCapacityPlan, summarizeTeamCapacityPlan, validateTaskPlanProposal, } from './capacity.ts';
|
|
7
7
|
export { executeKnowledgeHubProviderLaunch, validateKnowledgeHubProviderLaunchPrerequisites, } from './operations/services/hub-provider-launch.ts';
|
|
8
8
|
export { createKnowledgeHubRepositories, defaultHubContentResolutionPolicy, executeKnowledgeHubLaunch, normalizeKnowledgeHubLaunchIntent, planKnowledgeHubLaunch, planKnowledgeHubRepositories, validateRepositoryHost, type HubContentResolutionPolicy, type KnowledgeHubLaunchIntent, type KnowledgeHubLaunchPhase, type KnowledgeHubLaunchPlan, type KnowledgeHubLaunchResult, type KnowledgeHubRepositoryPlan, type RepositoryHost, } from './operations/services/hub-launch.ts';
|
|
9
9
|
export { ensureRailwayEnvironment, ensureRailwayProject, ensureRailwayService, getRailwayAuthProfile, listRailwayEnvironments, listRailwayProjects, listRailwayServices, listRailwayVariables, railwayGraphqlRequest, resolveRailwayApiToken, resolveRailwayApiUrl, resolveRailwayWorkspace, resolveRailwayWorkspaceContext, upsertRailwayVariables, } from './operations/services/railway-api.ts';
|
|
@@ -13,6 +13,7 @@ export { PUBLISHED_CONTENT_MANIFEST_SCHEMA_VERSION, EDITORIAL_PREVIEW_COOKIE, Te
|
|
|
13
13
|
export { createFilesystemContentSource, createPublishedContentPipeline, } from './platform/published-content-pipeline.ts';
|
|
14
14
|
export { loadTreeseedManifest, loadTreeseedTenantManifest, resolveTreeseedTenantRoot, getTenantContentRoot, tenantFeatureEnabled, tenantModelRendered, } from './platform/tenant-config.ts';
|
|
15
15
|
export { parseGraphDsl } from './graph/dsl.ts';
|
|
16
|
+
export { compileDeclarativeContextQuery, declarativeContextFormatToGraphView, declarativeContextPurposeToGraphStage, type CompiledDeclarativeContextQuery, type DeclarativeContextQuery, type DeclarativeContextQueryCompileResult, type DeclarativeContextQueryFormat, type DeclarativeContextQueryPurpose, type DeclarativeContextQuerySourceRef, type HandlerContextPackSource, type ResolvedHandlerContextPack, } from './graph/context-query-contracts.ts';
|
|
16
17
|
export { createDefaultGraphRankingProvider, DEFAULT_GRAPH_RANKING_PROVIDER } from './graph/ranking.ts';
|
|
17
18
|
export { BUILTIN_MODEL_REGISTRY, MODEL_REGISTRY, buildBuiltinModelRegistry, buildModelRegistry, buildScopedModelRegistry, mergeModelRegistries, resolveModelDefinition, } from './model-registry.ts';
|
|
18
19
|
export { normalizeAgentCliOptions, buildCopilotAllowToolArgs } from './cli-tools.ts';
|
|
@@ -20,6 +21,7 @@ export { collectTreeseedDependencyStatus, collectTreeseedToolStatus, createTrees
|
|
|
20
21
|
export { runTreeseedCopilotTask, type TreeseedCopilotTaskInput, type TreeseedCopilotTaskResult, } from './copilot.ts';
|
|
21
22
|
export { findDispatchCapability, listSdkDispatchCapabilities, listWorkflowDispatchCapabilities, } from './dispatch.ts';
|
|
22
23
|
export { executeSdkOperation, findSdkOperation, listSdkOperationNames, } from './sdk-dispatch.ts';
|
|
24
|
+
export { AGENT_OPERATION_MODES, AGENT_OPERATION_NAMES, createAgentOperationEvent, decideAgentOperationPermission, deniedAgentOperationResult, isAgentOperationName, resolveAgentOperationGrant, type AgentDeterministicOperationStep, type AgentOperationApprovalRef, type AgentOperationEvent, type AgentOperationGrant, type AgentOperationMergeFailure, type AgentOperationMode, type AgentOperationName, type AgentOperationPermissionCode, type AgentOperationPermissionDecision, type AgentOperationRequest, type AgentOperationResult, type AgentOperationStatus, } from './operations/agent-tools.ts';
|
|
23
25
|
export { resolveSdkRecordVersion } from './sdk-version.ts';
|
|
24
26
|
export { normalizeAliasedRecord, preprocessAliasedRecord, resolveAliasedField, } from './field-aliases.ts';
|
|
25
27
|
export { canonicalizeFrontmatter, normalizeFilterFields, normalizeMutationData, normalizeRecordToCanonicalShape, normalizeSortFields, readCanonicalFieldValue, resolveModelField, validateModelFieldAliases, } from './sdk-fields.ts';
|
|
@@ -32,11 +34,11 @@ export { TreeseedWorkflowSdk } from './workflow.ts';
|
|
|
32
34
|
export * from './db/index.ts';
|
|
33
35
|
export { collectTreeseedReconcileStatus, createTreeseedReconcileRegistry, deriveTreeseedDesiredUnits, destroyTreeseedTargetUnits, observeTreeseedUnits, planTreeseedReconciliation, reconcileTreeseedTarget, } from './reconcile/index.ts';
|
|
34
36
|
export { getTreeseedVerifyDriverStatus, runTreeseedVerifyDriver } from './verification.ts';
|
|
35
|
-
export type { KnowledgeHubProviderLaunchPreflightReport, KnowledgeHubProviderLaunchFailurePhase, KnowledgeHubProviderLaunchInput, KnowledgeHubProviderLaunchResult, AgentMessageKind, AgentMessageRecord, AgentStatusRecord, DirectBoardItemSummary, InboxItem, ProjectJobStatus, LaunchProjectRequest, LaunchProjectResult, LinkedProjectRecordRef, ProjectConnectionStatus, ProjectOverviewSummary, ReleaseDetail, ReleaseState, ReleaseSummary, SharePackageState, SharePackageStatus, TeamCapability, TeamHomeSummary, TeamMemberSummary, WorkstreamDetail, WorkstreamEvent, WorkstreamState, WorkstreamSummary, 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, WorkdayRequest, WorkdayManagerLease, WorkerRunner, WorkerRunnerState, RepositoryClaim, TaskCreditWeight, TaskCreditBudget, WorkdayPolicy, PrioritySnapshotItem, PrioritySnapshot, TaskCreditLedgerEntry, ApprovalRequest, CapacityBusinessModel, CapacityGrant, CapacityGrantScope, CapacityLedgerEntry, CapacityLaneUnit, CapacityPlan, CapacityProvider, CapacityProviderHost, CapacityProviderKind, CapacityProviderLane, CapacityReservation, CapacityRoutingDecision, CapacityTaskExecutionEnvelope, CreateApprovalRequestRequest, CreateCapacityReservationRequest, CreateCapacityRoutingDecisionRequest, CreateTaskEstimateRequest, CreateTaskUsageActualRequest, RecordCapacityUsageRequest, TaskEstimate, TaskEstimateProfile, TaskUsageActual, UpsertCapacityGrantRequest, UpsertCapacityProviderHostRequest, UpsertCapacityProviderLaneRequest, UpsertCapacityProviderRequest, ScaleDecision, RunnerScaleDecision, TeamStorageLocator, TeamWebHost, TeamWebHostOwnership, TeamWebHostProvider, EncryptedWebHostPayload, UpsertAgentPoolRequest, UpsertCatalogArtifactVersionRequest, UpsertCatalogItemRequest, UpsertProjectEnvironmentRequest, UpsertProjectHostingRequest, UpsertProjectInfrastructureResourceRequest, UpsertTeamStorageLocatorRequest, UpsertTeamWebHostRequest, CreateProjectDeploymentRequest, RecordAgentPoolRegistrationRequest, SdkCreateWorkdayRequest, SdkClaimWorkdayManagerLeaseRequest, SdkReleaseWorkdayManagerLeaseRequest, SdkRecordWorkerRunnerRequest, SdkRecordRepositoryClaimRequest, SdkRecordRunnerScaleDecisionRequest, SdkUpdateWorkDayGraphRequest, WorkerPoolScaleResult, WorkerPoolScaler, } from './sdk-types.ts';
|
|
37
|
+
export type { KnowledgeHubProviderLaunchPreflightReport, KnowledgeHubProviderLaunchFailurePhase, KnowledgeHubProviderLaunchInput, KnowledgeHubProviderLaunchResult, AgentMessageKind, AgentMessageRecord, AgentStatusRecord, DirectBoardItemSummary, InboxItem, ProjectJobStatus, LaunchProjectRequest, LaunchProjectResult, LinkedProjectRecordRef, ProjectConnectionStatus, ProjectOverviewSummary, ReleaseDetail, ReleaseState, ReleaseSummary, SharePackageState, SharePackageStatus, TeamCapability, TeamHomeSummary, TeamMemberSummary, WorkstreamDetail, WorkstreamEvent, WorkstreamState, WorkstreamSummary, 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, WorkdayRequest, WorkdayManagerLease, WorkerRunner, WorkerRunnerState, RepositoryClaim, TaskCreditWeight, TaskCreditBudget, WorkdayPolicy, PrioritySnapshotItem, PrioritySnapshot, TaskCreditLedgerEntry, ApprovalRequest, CapacityBusinessModel, CapacityGrant, CapacityGrantScope, CapacityLedgerEntry, CapacityLaneUnit, CapacityPlan, CapacityProvider, CapacityProviderHost, CapacityProviderKind, CapacityProviderLane, CapacityReservation, CapacityRoutingDecision, CapacityTaskExecutionEnvelope, CanonicalTaskState, CreateApprovalRequestRequest, CreateCapacityReservationRequest, CreateCapacityRoutingDecisionRequest, CreateTaskEstimateRequest, CreateTaskUsageActualRequest, ExecutionProfile, HybridExecutionPhase, HybridExecutionPlan, PlannedTaskNode, PlanningAdmissionResult, PlanningPolicy, PredictiveReservePolicy, RecordCapacityUsageRequest, RepositoryWorkState, ReservePrediction, TaskAdmissionDecision, TaskAdmissionOutcome, TaskAdmissionPolicy, TaskClassification, TaskEstimate, TaskEstimateProfile, TaskCheckpointArtifact, TaskConcurrencyClass, TaskPlanProposal, TaskMutationScope, TaskRiskClass, TaskUsageActual, UtilityEstimate, UtilityPolicy, UpsertCapacityGrantRequest, UpsertCapacityProviderHostRequest, UpsertCapacityProviderLaneRequest, UpsertCapacityProviderRequest, ScaleDecision, RunnerScaleDecision, TeamStorageLocator, TeamWebHost, TeamWebHostOwnership, TeamWebHostProvider, EncryptedWebHostPayload, UpsertAgentPoolRequest, UpsertCatalogArtifactVersionRequest, UpsertCatalogItemRequest, UpsertProjectEnvironmentRequest, UpsertProjectHostingRequest, UpsertProjectInfrastructureResourceRequest, UpsertTeamStorageLocatorRequest, UpsertTeamWebHostRequest, CreateProjectDeploymentRequest, RecordAgentPoolRegistrationRequest, SdkCreateWorkdayRequest, SdkClaimWorkdayManagerLeaseRequest, SdkReleaseWorkdayManagerLeaseRequest, SdkRecordWorkerRunnerRequest, SdkRecordRepositoryClaimRequest, SdkRecordRunnerScaleDecisionRequest, SdkUpdateWorkDayGraphRequest, WorkerPoolScaleResult, WorkerPoolScaler, } from './sdk-types.ts';
|
|
36
38
|
export type * from './project-workflow.ts';
|
|
37
39
|
export type { ControlPlaneAgentPoolHeartbeat, ControlPlaneDeploymentReport, ControlPlaneEnvironmentReport, ControlPlaneReporter, ControlPlaneReporterKind, ControlPlaneResourceReport, ControlPlaneScaleDecisionReport, ControlPlaneWorkdaySummaryReport, } from './control-plane.ts';
|
|
38
40
|
export type { ControlPlaneClientOptions } from './control-plane-client.ts';
|
|
39
|
-
export type { CapacityEstimateInput, CapacityLaneCandidate, CapacityLaneScore, } from './capacity.ts';
|
|
41
|
+
export type { AdmissionEstimateInput, CapacityInterruptionInput, CapacityEstimateInput, CapacityLaneCandidate, CapacityLaneScore, CapacityTaskEstimate, AttentionEstimate, AttentionPolicy, CapacityRoutePressure, RouteAndReserveCandidate, RouteAndReserveResult, TaskAdmissionInput, WorkdayBudgetEnvelopeInput, } from './capacity.ts';
|
|
40
42
|
export type { TreeseedFieldAliasBinding, TreeseedFieldAliasRegistry, } from './field-aliases.ts';
|
|
41
43
|
export type * from './operations-types.ts';
|
|
42
44
|
export type * from './workflow.ts';
|
package/dist/index.js
CHANGED
|
@@ -4,16 +4,46 @@ import { projectConnectionModeFromHosting } from "./sdk-types.js";
|
|
|
4
4
|
import { createControlPlaneReporter } from "./control-plane.js";
|
|
5
5
|
import { ControlPlaneClient } from "./control-plane-client.js";
|
|
6
6
|
import {
|
|
7
|
+
DEFAULT_EXECUTION_PROFILE_ID,
|
|
8
|
+
DEFAULT_EXECUTION_PROFILES,
|
|
9
|
+
DEFAULT_TASK_ADMISSION_POLICY,
|
|
10
|
+
buildTaskEstimateProfileFromActuals,
|
|
11
|
+
computeWorkdayBudgetEnvelope,
|
|
12
|
+
decideTaskAdmission,
|
|
13
|
+
estimateAttentionForTask,
|
|
14
|
+
estimateConfidenceFromProfile,
|
|
15
|
+
estimateLearningPercentile,
|
|
16
|
+
estimateLearningVariance,
|
|
17
|
+
estimateForClassification,
|
|
18
|
+
estimateProfileConfidenceScore,
|
|
19
|
+
estimateUtilityForTask,
|
|
20
|
+
isInterruptedUsageActual,
|
|
21
|
+
normalizeHybridExecutionPlan,
|
|
22
|
+
mutationRequiresRepositoryClaim,
|
|
23
|
+
normalizePlanningPolicy,
|
|
24
|
+
normalizePredictiveReservePolicy,
|
|
25
|
+
normalizeTaskPlanProposal,
|
|
26
|
+
normalizeExecutionProfile,
|
|
27
|
+
normalizeAttentionPolicy,
|
|
28
|
+
normalizeTaskAdmissionPolicy,
|
|
29
|
+
normalizeUtilityPolicy,
|
|
30
|
+
predictReserveForCapacityPlan,
|
|
31
|
+
progressivelyAdmitPlanProposal,
|
|
32
|
+
rankPlannedTaskNodes,
|
|
7
33
|
reservationHasCapacity,
|
|
8
34
|
reserveCreditsForEstimate,
|
|
9
35
|
routeAndReserveCapacity,
|
|
10
36
|
scoreCapacityLane,
|
|
11
37
|
selectBestCapacityLane,
|
|
38
|
+
selectTaskEstimateProfile,
|
|
12
39
|
settleCapacityActuals,
|
|
40
|
+
shouldInterruptForCapacity,
|
|
41
|
+
synthesizePlanEstimate,
|
|
13
42
|
createReservationReleaseEntry,
|
|
14
43
|
summarizeCapacityPlan,
|
|
15
44
|
summarizeProjectCapacityPlan,
|
|
16
|
-
summarizeTeamCapacityPlan
|
|
45
|
+
summarizeTeamCapacityPlan,
|
|
46
|
+
validateTaskPlanProposal
|
|
17
47
|
} from "./capacity.js";
|
|
18
48
|
import {
|
|
19
49
|
executeKnowledgeHubProviderLaunch,
|
|
@@ -94,6 +124,11 @@ import {
|
|
|
94
124
|
tenantModelRendered
|
|
95
125
|
} from "./platform/tenant-config.js";
|
|
96
126
|
import { parseGraphDsl } from "./graph/dsl.js";
|
|
127
|
+
import {
|
|
128
|
+
compileDeclarativeContextQuery,
|
|
129
|
+
declarativeContextFormatToGraphView,
|
|
130
|
+
declarativeContextPurposeToGraphStage
|
|
131
|
+
} from "./graph/context-query-contracts.js";
|
|
97
132
|
import { createDefaultGraphRankingProvider, DEFAULT_GRAPH_RANKING_PROVIDER } from "./graph/ranking.js";
|
|
98
133
|
import {
|
|
99
134
|
BUILTIN_MODEL_REGISTRY,
|
|
@@ -127,6 +162,15 @@ import {
|
|
|
127
162
|
findSdkOperation,
|
|
128
163
|
listSdkOperationNames
|
|
129
164
|
} from "./sdk-dispatch.js";
|
|
165
|
+
import {
|
|
166
|
+
AGENT_OPERATION_MODES,
|
|
167
|
+
AGENT_OPERATION_NAMES,
|
|
168
|
+
createAgentOperationEvent,
|
|
169
|
+
decideAgentOperationPermission,
|
|
170
|
+
deniedAgentOperationResult,
|
|
171
|
+
isAgentOperationName,
|
|
172
|
+
resolveAgentOperationGrant
|
|
173
|
+
} from "./operations/agent-tools.js";
|
|
130
174
|
import { resolveSdkRecordVersion } from "./sdk-version.js";
|
|
131
175
|
import {
|
|
132
176
|
normalizeAliasedRecord,
|
|
@@ -200,6 +244,8 @@ import { getTreeseedVerifyDriverStatus, runTreeseedVerifyDriver } from "./verifi
|
|
|
200
244
|
import { CloudflareHttpD1Database } from "./d1-http.js";
|
|
201
245
|
export {
|
|
202
246
|
AGENT_MESSAGE_KINDS,
|
|
247
|
+
AGENT_OPERATION_MODES,
|
|
248
|
+
AGENT_OPERATION_NAMES,
|
|
203
249
|
AgentSdk,
|
|
204
250
|
BUILTIN_MODEL_REGISTRY,
|
|
205
251
|
CloudflareHttpD1Database,
|
|
@@ -207,7 +253,10 @@ export {
|
|
|
207
253
|
CloudflareQueuePushClient,
|
|
208
254
|
ContentGraphRuntime,
|
|
209
255
|
ControlPlaneClient,
|
|
256
|
+
DEFAULT_EXECUTION_PROFILES,
|
|
257
|
+
DEFAULT_EXECUTION_PROFILE_ID,
|
|
210
258
|
DEFAULT_GRAPH_RANKING_PROVIDER,
|
|
259
|
+
DEFAULT_TASK_ADMISSION_POLICY,
|
|
211
260
|
DEFAULT_TREESEED_MARKET_BASE_URL,
|
|
212
261
|
EDITORIAL_PREVIEW_COOKIE,
|
|
213
262
|
MODEL_REGISTRY,
|
|
@@ -244,12 +293,16 @@ export {
|
|
|
244
293
|
buildKnowledgePackMarketPackage,
|
|
245
294
|
buildModelRegistry,
|
|
246
295
|
buildScopedModelRegistry,
|
|
296
|
+
buildTaskEstimateProfileFromActuals,
|
|
247
297
|
buildTemplateMarketPackage,
|
|
248
298
|
canonicalizeFrontmatter,
|
|
249
299
|
clearMarketSession,
|
|
250
300
|
collectTreeseedDependencyStatus,
|
|
251
301
|
collectTreeseedReconcileStatus,
|
|
252
302
|
collectTreeseedToolStatus,
|
|
303
|
+
compileDeclarativeContextQuery,
|
|
304
|
+
computeWorkdayBudgetEnvelope,
|
|
305
|
+
createAgentOperationEvent,
|
|
253
306
|
createControlPlaneReporter,
|
|
254
307
|
createDefaultGraphRankingProvider,
|
|
255
308
|
createFilesystemContentSource,
|
|
@@ -260,12 +313,24 @@ export {
|
|
|
260
313
|
createTeamScopedR2OverlayContentRuntimeProvider,
|
|
261
314
|
createTreeseedManagedToolEnv,
|
|
262
315
|
createTreeseedReconcileRegistry,
|
|
316
|
+
decideAgentOperationPermission,
|
|
317
|
+
decideTaskAdmission,
|
|
318
|
+
declarativeContextFormatToGraphView,
|
|
319
|
+
declarativeContextPurposeToGraphStage,
|
|
263
320
|
defaultHubContentResolutionPolicy,
|
|
321
|
+
deniedAgentOperationResult,
|
|
264
322
|
deriveTreeseedDesiredUnits,
|
|
265
323
|
destroyTreeseedTargetUnits,
|
|
266
324
|
ensureRailwayEnvironment,
|
|
267
325
|
ensureRailwayProject,
|
|
268
326
|
ensureRailwayService,
|
|
327
|
+
estimateAttentionForTask,
|
|
328
|
+
estimateConfidenceFromProfile,
|
|
329
|
+
estimateForClassification,
|
|
330
|
+
estimateLearningPercentile,
|
|
331
|
+
estimateLearningVariance,
|
|
332
|
+
estimateProfileConfidenceScore,
|
|
333
|
+
estimateUtilityForTask,
|
|
269
334
|
executeKnowledgeHubLaunch,
|
|
270
335
|
executeKnowledgeHubProviderLaunch,
|
|
271
336
|
executeSdkOperation,
|
|
@@ -278,6 +343,8 @@ export {
|
|
|
278
343
|
getTreeseedVerifyDriverStatus,
|
|
279
344
|
importKnowledgePack,
|
|
280
345
|
installTreeseedDependencies,
|
|
346
|
+
isAgentOperationName,
|
|
347
|
+
isInterruptedUsageActual,
|
|
281
348
|
isTeamScopedR2ContentEnabled,
|
|
282
349
|
listIntegratedMarketCatalog,
|
|
283
350
|
listRailwayEnvironments,
|
|
@@ -292,15 +359,24 @@ export {
|
|
|
292
359
|
loadTreeseedManifest,
|
|
293
360
|
loadTreeseedTenantManifest,
|
|
294
361
|
mergeModelRegistries,
|
|
362
|
+
mutationRequiresRepositoryClaim,
|
|
295
363
|
normalizeAgentCliOptions,
|
|
296
364
|
normalizeAliasedRecord,
|
|
365
|
+
normalizeAttentionPolicy,
|
|
366
|
+
normalizeExecutionProfile,
|
|
297
367
|
normalizeFilterFields,
|
|
368
|
+
normalizeHybridExecutionPlan,
|
|
298
369
|
normalizeKnowledgeHubLaunchIntent,
|
|
299
370
|
normalizeMutationData,
|
|
371
|
+
normalizePlanningPolicy,
|
|
372
|
+
normalizePredictiveReservePolicy,
|
|
300
373
|
normalizeProjectJobStatus,
|
|
301
374
|
normalizeRecordToCanonicalShape,
|
|
302
375
|
normalizeRemoteJobStatus,
|
|
303
376
|
normalizeSortFields,
|
|
377
|
+
normalizeTaskAdmissionPolicy,
|
|
378
|
+
normalizeTaskPlanProposal,
|
|
379
|
+
normalizeUtilityPolicy,
|
|
304
380
|
observeTreeseedUnits,
|
|
305
381
|
parseGraphDsl,
|
|
306
382
|
parsePublishedCollectionIndex,
|
|
@@ -310,9 +386,12 @@ export {
|
|
|
310
386
|
planKnowledgeHubLaunch,
|
|
311
387
|
planKnowledgeHubRepositories,
|
|
312
388
|
planTreeseedReconciliation,
|
|
389
|
+
predictReserveForCapacityPlan,
|
|
313
390
|
preprocessAliasedRecord,
|
|
391
|
+
progressivelyAdmitPlanProposal,
|
|
314
392
|
projectConnectionModeFromHosting,
|
|
315
393
|
railwayGraphqlRequest,
|
|
394
|
+
rankPlannedTaskNodes,
|
|
316
395
|
readCanonicalFieldValue,
|
|
317
396
|
readPublishedContentManifest,
|
|
318
397
|
readPublishedOverlayManifest,
|
|
@@ -320,6 +399,7 @@ export {
|
|
|
320
399
|
removeMarketProfile,
|
|
321
400
|
reservationHasCapacity,
|
|
322
401
|
reserveCreditsForEstimate,
|
|
402
|
+
resolveAgentOperationGrant,
|
|
323
403
|
resolveAliasedField,
|
|
324
404
|
resolveCatalogMarketProfiles,
|
|
325
405
|
resolveCloudflareR2Bucket,
|
|
@@ -347,19 +427,23 @@ export {
|
|
|
347
427
|
runTreeseedVerifyDriver,
|
|
348
428
|
scoreCapacityLane,
|
|
349
429
|
selectBestCapacityLane,
|
|
430
|
+
selectTaskEstimateProfile,
|
|
350
431
|
setActiveMarketProfile,
|
|
351
432
|
setMarketSession,
|
|
352
433
|
settleCapacityActuals,
|
|
434
|
+
shouldInterruptForCapacity,
|
|
353
435
|
signEditorialPreviewToken,
|
|
354
436
|
summarizeCapacityPlan,
|
|
355
437
|
summarizeProjectCapacityPlan,
|
|
356
438
|
summarizeTeamCapacityPlan,
|
|
439
|
+
synthesizePlanEstimate,
|
|
357
440
|
tenantFeatureEnabled,
|
|
358
441
|
tenantModelRendered,
|
|
359
442
|
upsertRailwayVariables,
|
|
360
443
|
validateKnowledgeHubProviderLaunchPrerequisites,
|
|
361
444
|
validateModelFieldAliases,
|
|
362
445
|
validateRepositoryHost,
|
|
446
|
+
validateTaskPlanProposal,
|
|
363
447
|
verifyArtifactBytes,
|
|
364
448
|
verifyEditorialPreviewToken,
|
|
365
449
|
writeMarketRegistryState
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
export declare const AGENT_OPERATION_NAMES: readonly ["switch", "dev", "verify", "save", "stage", "merge_to_staging", "close", "release"];
|
|
2
|
+
export declare const AGENT_OPERATION_MODES: readonly ["dry_run", "read_only", "mutating"];
|
|
3
|
+
export type AgentOperationName = (typeof AGENT_OPERATION_NAMES)[number];
|
|
4
|
+
export type AgentOperationMode = (typeof AGENT_OPERATION_MODES)[number];
|
|
5
|
+
export type AgentOperationStatus = 'completed' | 'waiting' | 'failed' | 'skipped' | 'retry_created';
|
|
6
|
+
export interface AgentOperationApprovalRef {
|
|
7
|
+
id: string;
|
|
8
|
+
kind?: string;
|
|
9
|
+
state: 'pending' | 'approved' | 'rejected' | 'expired' | 'superseded';
|
|
10
|
+
}
|
|
11
|
+
export interface AgentOperationRequest {
|
|
12
|
+
operation: AgentOperationName;
|
|
13
|
+
mode: AgentOperationMode;
|
|
14
|
+
taskId: string;
|
|
15
|
+
taskKind?: string;
|
|
16
|
+
workDayId?: string;
|
|
17
|
+
agentSlug: string;
|
|
18
|
+
agentRole: string;
|
|
19
|
+
projectId: string;
|
|
20
|
+
environment: string;
|
|
21
|
+
repoRoot: string;
|
|
22
|
+
worktreeRoot?: string;
|
|
23
|
+
featureBranch?: string;
|
|
24
|
+
stagingBranch?: string;
|
|
25
|
+
approvalId?: string;
|
|
26
|
+
approval?: AgentOperationApprovalRef;
|
|
27
|
+
permissionGrantId?: string;
|
|
28
|
+
allowedPaths?: string[];
|
|
29
|
+
forbiddenPaths?: string[];
|
|
30
|
+
changedPaths?: string[];
|
|
31
|
+
input: Record<string, unknown>;
|
|
32
|
+
}
|
|
33
|
+
export interface AgentDeterministicOperationStep {
|
|
34
|
+
id: string;
|
|
35
|
+
operation: AgentOperationName;
|
|
36
|
+
stage: 'before_mutation' | 'during_mutation' | 'after_mutation' | 'after_verification_passes' | 'after_verification_fails' | 'after_staging_merge_fails' | 'closeout' | string;
|
|
37
|
+
mode: AgentOperationMode;
|
|
38
|
+
required?: boolean;
|
|
39
|
+
}
|
|
40
|
+
export interface AgentOperationGrant {
|
|
41
|
+
id: string;
|
|
42
|
+
state?: 'active' | 'paused' | 'revoked';
|
|
43
|
+
operations: AgentOperationName[];
|
|
44
|
+
modes: AgentOperationMode[];
|
|
45
|
+
agentRoles?: string[];
|
|
46
|
+
taskKinds?: string[];
|
|
47
|
+
projectIds?: string[];
|
|
48
|
+
environments?: string[];
|
|
49
|
+
allowedPaths?: string[];
|
|
50
|
+
forbiddenPaths?: string[];
|
|
51
|
+
requiresApproval?: boolean;
|
|
52
|
+
approvalIds?: string[];
|
|
53
|
+
expiresAt?: string;
|
|
54
|
+
metadata?: Record<string, unknown>;
|
|
55
|
+
}
|
|
56
|
+
export interface AgentOperationMergeFailure {
|
|
57
|
+
targetBranch: string;
|
|
58
|
+
featureBranch: string;
|
|
59
|
+
conflictedPaths: string[];
|
|
60
|
+
message: string;
|
|
61
|
+
repairTaskId?: string;
|
|
62
|
+
}
|
|
63
|
+
export interface AgentOperationResult {
|
|
64
|
+
operation: AgentOperationName;
|
|
65
|
+
status: AgentOperationStatus;
|
|
66
|
+
summary: string;
|
|
67
|
+
changedPaths: string[];
|
|
68
|
+
stagedPaths: string[];
|
|
69
|
+
mergedToStaging?: boolean;
|
|
70
|
+
mergeFailure?: AgentOperationMergeFailure;
|
|
71
|
+
commandsRun: string[];
|
|
72
|
+
artifacts: Array<{
|
|
73
|
+
kind: string;
|
|
74
|
+
ref: string;
|
|
75
|
+
}>;
|
|
76
|
+
error?: {
|
|
77
|
+
code: string;
|
|
78
|
+
message: string;
|
|
79
|
+
retryable: boolean;
|
|
80
|
+
};
|
|
81
|
+
metadata: Record<string, unknown>;
|
|
82
|
+
}
|
|
83
|
+
export type AgentOperationPermissionCode = 'allowed' | 'invalid_operation' | 'operation_permission_required' | 'operation_grant_inactive' | 'operation_grant_expired' | 'operation_mode_not_granted' | 'operation_role_not_granted' | 'operation_task_kind_not_granted' | 'operation_project_not_granted' | 'operation_environment_not_granted' | 'operation_approval_required' | 'operation_release_approval_required' | 'operation_worktree_required' | 'operation_allowed_paths_required' | 'operation_path_not_allowed' | 'operation_path_forbidden';
|
|
84
|
+
export interface AgentOperationPermissionDecision {
|
|
85
|
+
allowed: boolean;
|
|
86
|
+
status: 'completed' | 'waiting' | 'failed';
|
|
87
|
+
code: AgentOperationPermissionCode;
|
|
88
|
+
summary: string;
|
|
89
|
+
grant?: AgentOperationGrant;
|
|
90
|
+
metadata: Record<string, unknown>;
|
|
91
|
+
}
|
|
92
|
+
export interface AgentOperationEvent {
|
|
93
|
+
operation: AgentOperationName;
|
|
94
|
+
mode: AgentOperationMode;
|
|
95
|
+
agentRole: string;
|
|
96
|
+
taskId: string;
|
|
97
|
+
permissionGrantId?: string;
|
|
98
|
+
inputSummary: Record<string, unknown>;
|
|
99
|
+
result: AgentOperationResult;
|
|
100
|
+
createdAt: string;
|
|
101
|
+
}
|
|
102
|
+
export declare function isAgentOperationName(value: string): value is AgentOperationName;
|
|
103
|
+
export declare function resolveAgentOperationGrant(request: AgentOperationRequest, grants: readonly AgentOperationGrant[], now?: Date): AgentOperationGrant | null;
|
|
104
|
+
export declare function decideAgentOperationPermission(input: {
|
|
105
|
+
request: AgentOperationRequest;
|
|
106
|
+
grants: readonly AgentOperationGrant[];
|
|
107
|
+
now?: Date;
|
|
108
|
+
}): AgentOperationPermissionDecision;
|
|
109
|
+
export declare function deniedAgentOperationResult(request: AgentOperationRequest, decision: AgentOperationPermissionDecision): AgentOperationResult;
|
|
110
|
+
export declare function createAgentOperationEvent(input: {
|
|
111
|
+
request: AgentOperationRequest;
|
|
112
|
+
result: AgentOperationResult;
|
|
113
|
+
createdAt?: string;
|
|
114
|
+
}): AgentOperationEvent;
|