@treeseed/sdk 0.8.11 → 0.8.13
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/index.d.ts +3 -3
- package/dist/index.js +61 -1
- package/dist/operations/services/d1-migration.js +27 -0
- package/dist/operations/services/deploy.js +8 -8
- package/dist/scripts/tenant-d1-migrate-local.js +1 -0
- package/dist/sdk-types.d.ts +231 -0
- package/package.json +1 -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/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';
|
|
@@ -34,11 +34,11 @@ export { TreeseedWorkflowSdk } from './workflow.ts';
|
|
|
34
34
|
export * from './db/index.ts';
|
|
35
35
|
export { collectTreeseedReconcileStatus, createTreeseedReconcileRegistry, deriveTreeseedDesiredUnits, destroyTreeseedTargetUnits, observeTreeseedUnits, planTreeseedReconciliation, reconcileTreeseedTarget, } from './reconcile/index.ts';
|
|
36
36
|
export { getTreeseedVerifyDriverStatus, runTreeseedVerifyDriver } from './verification.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, 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';
|
|
38
38
|
export type * from './project-workflow.ts';
|
|
39
39
|
export type { ControlPlaneAgentPoolHeartbeat, ControlPlaneDeploymentReport, ControlPlaneEnvironmentReport, ControlPlaneReporter, ControlPlaneReporterKind, ControlPlaneResourceReport, ControlPlaneScaleDecisionReport, ControlPlaneWorkdaySummaryReport, } from './control-plane.ts';
|
|
40
40
|
export type { ControlPlaneClientOptions } from './control-plane-client.ts';
|
|
41
|
-
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';
|
|
42
42
|
export type { TreeseedFieldAliasBinding, TreeseedFieldAliasRegistry, } from './field-aliases.ts';
|
|
43
43
|
export type * from './operations-types.ts';
|
|
44
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,
|
|
@@ -223,7 +253,10 @@ export {
|
|
|
223
253
|
CloudflareQueuePushClient,
|
|
224
254
|
ContentGraphRuntime,
|
|
225
255
|
ControlPlaneClient,
|
|
256
|
+
DEFAULT_EXECUTION_PROFILES,
|
|
257
|
+
DEFAULT_EXECUTION_PROFILE_ID,
|
|
226
258
|
DEFAULT_GRAPH_RANKING_PROVIDER,
|
|
259
|
+
DEFAULT_TASK_ADMISSION_POLICY,
|
|
227
260
|
DEFAULT_TREESEED_MARKET_BASE_URL,
|
|
228
261
|
EDITORIAL_PREVIEW_COOKIE,
|
|
229
262
|
MODEL_REGISTRY,
|
|
@@ -260,6 +293,7 @@ export {
|
|
|
260
293
|
buildKnowledgePackMarketPackage,
|
|
261
294
|
buildModelRegistry,
|
|
262
295
|
buildScopedModelRegistry,
|
|
296
|
+
buildTaskEstimateProfileFromActuals,
|
|
263
297
|
buildTemplateMarketPackage,
|
|
264
298
|
canonicalizeFrontmatter,
|
|
265
299
|
clearMarketSession,
|
|
@@ -267,6 +301,7 @@ export {
|
|
|
267
301
|
collectTreeseedReconcileStatus,
|
|
268
302
|
collectTreeseedToolStatus,
|
|
269
303
|
compileDeclarativeContextQuery,
|
|
304
|
+
computeWorkdayBudgetEnvelope,
|
|
270
305
|
createAgentOperationEvent,
|
|
271
306
|
createControlPlaneReporter,
|
|
272
307
|
createDefaultGraphRankingProvider,
|
|
@@ -279,6 +314,7 @@ export {
|
|
|
279
314
|
createTreeseedManagedToolEnv,
|
|
280
315
|
createTreeseedReconcileRegistry,
|
|
281
316
|
decideAgentOperationPermission,
|
|
317
|
+
decideTaskAdmission,
|
|
282
318
|
declarativeContextFormatToGraphView,
|
|
283
319
|
declarativeContextPurposeToGraphStage,
|
|
284
320
|
defaultHubContentResolutionPolicy,
|
|
@@ -288,6 +324,13 @@ export {
|
|
|
288
324
|
ensureRailwayEnvironment,
|
|
289
325
|
ensureRailwayProject,
|
|
290
326
|
ensureRailwayService,
|
|
327
|
+
estimateAttentionForTask,
|
|
328
|
+
estimateConfidenceFromProfile,
|
|
329
|
+
estimateForClassification,
|
|
330
|
+
estimateLearningPercentile,
|
|
331
|
+
estimateLearningVariance,
|
|
332
|
+
estimateProfileConfidenceScore,
|
|
333
|
+
estimateUtilityForTask,
|
|
291
334
|
executeKnowledgeHubLaunch,
|
|
292
335
|
executeKnowledgeHubProviderLaunch,
|
|
293
336
|
executeSdkOperation,
|
|
@@ -301,6 +344,7 @@ export {
|
|
|
301
344
|
importKnowledgePack,
|
|
302
345
|
installTreeseedDependencies,
|
|
303
346
|
isAgentOperationName,
|
|
347
|
+
isInterruptedUsageActual,
|
|
304
348
|
isTeamScopedR2ContentEnabled,
|
|
305
349
|
listIntegratedMarketCatalog,
|
|
306
350
|
listRailwayEnvironments,
|
|
@@ -315,15 +359,24 @@ export {
|
|
|
315
359
|
loadTreeseedManifest,
|
|
316
360
|
loadTreeseedTenantManifest,
|
|
317
361
|
mergeModelRegistries,
|
|
362
|
+
mutationRequiresRepositoryClaim,
|
|
318
363
|
normalizeAgentCliOptions,
|
|
319
364
|
normalizeAliasedRecord,
|
|
365
|
+
normalizeAttentionPolicy,
|
|
366
|
+
normalizeExecutionProfile,
|
|
320
367
|
normalizeFilterFields,
|
|
368
|
+
normalizeHybridExecutionPlan,
|
|
321
369
|
normalizeKnowledgeHubLaunchIntent,
|
|
322
370
|
normalizeMutationData,
|
|
371
|
+
normalizePlanningPolicy,
|
|
372
|
+
normalizePredictiveReservePolicy,
|
|
323
373
|
normalizeProjectJobStatus,
|
|
324
374
|
normalizeRecordToCanonicalShape,
|
|
325
375
|
normalizeRemoteJobStatus,
|
|
326
376
|
normalizeSortFields,
|
|
377
|
+
normalizeTaskAdmissionPolicy,
|
|
378
|
+
normalizeTaskPlanProposal,
|
|
379
|
+
normalizeUtilityPolicy,
|
|
327
380
|
observeTreeseedUnits,
|
|
328
381
|
parseGraphDsl,
|
|
329
382
|
parsePublishedCollectionIndex,
|
|
@@ -333,9 +386,12 @@ export {
|
|
|
333
386
|
planKnowledgeHubLaunch,
|
|
334
387
|
planKnowledgeHubRepositories,
|
|
335
388
|
planTreeseedReconciliation,
|
|
389
|
+
predictReserveForCapacityPlan,
|
|
336
390
|
preprocessAliasedRecord,
|
|
391
|
+
progressivelyAdmitPlanProposal,
|
|
337
392
|
projectConnectionModeFromHosting,
|
|
338
393
|
railwayGraphqlRequest,
|
|
394
|
+
rankPlannedTaskNodes,
|
|
339
395
|
readCanonicalFieldValue,
|
|
340
396
|
readPublishedContentManifest,
|
|
341
397
|
readPublishedOverlayManifest,
|
|
@@ -371,19 +427,23 @@ export {
|
|
|
371
427
|
runTreeseedVerifyDriver,
|
|
372
428
|
scoreCapacityLane,
|
|
373
429
|
selectBestCapacityLane,
|
|
430
|
+
selectTaskEstimateProfile,
|
|
374
431
|
setActiveMarketProfile,
|
|
375
432
|
setMarketSession,
|
|
376
433
|
settleCapacityActuals,
|
|
434
|
+
shouldInterruptForCapacity,
|
|
377
435
|
signEditorialPreviewToken,
|
|
378
436
|
summarizeCapacityPlan,
|
|
379
437
|
summarizeProjectCapacityPlan,
|
|
380
438
|
summarizeTeamCapacityPlan,
|
|
439
|
+
synthesizePlanEstimate,
|
|
381
440
|
tenantFeatureEnabled,
|
|
382
441
|
tenantModelRendered,
|
|
383
442
|
upsertRailwayVariables,
|
|
384
443
|
validateKnowledgeHubProviderLaunchPrerequisites,
|
|
385
444
|
validateModelFieldAliases,
|
|
386
445
|
validateRepositoryHost,
|
|
446
|
+
validateTaskPlanProposal,
|
|
387
447
|
verifyArtifactBytes,
|
|
388
448
|
verifyEditorialPreviewToken,
|
|
389
449
|
writeMarketRegistryState
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { existsSync, readdirSync } from "node:fs";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
2
3
|
import { resolve } from "node:path";
|
|
3
4
|
import { spawnSync } from "node:child_process";
|
|
4
5
|
import { resolveWranglerBin } from "./runtime-tools.js";
|
|
@@ -98,6 +99,28 @@ function markMigrationApplied({ cwd, wranglerConfig, persistTo, migration }) {
|
|
|
98
99
|
command: `INSERT OR REPLACE INTO treeseed_schema_migrations (name, applied_at) VALUES ('${migration.replace(/'/g, "''")}', datetime('now'));`
|
|
99
100
|
});
|
|
100
101
|
}
|
|
102
|
+
function tableColumns({ cwd, wranglerConfig, persistTo, tableName }) {
|
|
103
|
+
const result = executeSqlCommand({
|
|
104
|
+
cwd,
|
|
105
|
+
wranglerConfig,
|
|
106
|
+
persistTo,
|
|
107
|
+
capture: true,
|
|
108
|
+
command: `PRAGMA table_info(${tableName.replace(/[^A-Za-z0-9_]/g, "")});`
|
|
109
|
+
});
|
|
110
|
+
const parsed = parseWranglerJsonOutput(result.stdout);
|
|
111
|
+
const rows = (Array.isArray(parsed) ? parsed : [parsed]).flatMap((entry) => entry.results ?? []);
|
|
112
|
+
return new Set(rows.map((row) => row.name).filter(Boolean));
|
|
113
|
+
}
|
|
114
|
+
function migrationAlreadySatisfied({ cwd, wranglerConfig, persistTo, filePath }) {
|
|
115
|
+
const sql = readFileSync(filePath, "utf8");
|
|
116
|
+
if (!sql.includes("execution_profile_id") || !sql.includes("task_estimate_profiles")) {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
const estimateColumns = tableColumns({ cwd, wranglerConfig, persistTo, tableName: "task_estimates" });
|
|
120
|
+
const actualColumns = tableColumns({ cwd, wranglerConfig, persistTo, tableName: "task_usage_actuals" });
|
|
121
|
+
const profileColumns = tableColumns({ cwd, wranglerConfig, persistTo, tableName: "task_estimate_profiles" });
|
|
122
|
+
return estimateColumns.has("execution_profile_id") && actualColumns.has("execution_profile_id") && profileColumns.has("execution_profile_id") && profileColumns.has("completed_sample_count") && profileColumns.has("interrupted_sample_count") && profileColumns.has("confidence_score");
|
|
123
|
+
}
|
|
101
124
|
function runLocalD1Migrations({ cwd, wranglerConfig, migrationsRoot, persistTo }) {
|
|
102
125
|
ensureSchemaMigrationsTable({ cwd, wranglerConfig, persistTo });
|
|
103
126
|
const appliedMigrations = loadAppliedMigrations({ cwd, wranglerConfig, persistTo });
|
|
@@ -111,6 +134,10 @@ function runLocalD1Migrations({ cwd, wranglerConfig, migrationsRoot, persistTo }
|
|
|
111
134
|
console.error(`Unable to find migration file at ${filePath}.`);
|
|
112
135
|
process.exit(1);
|
|
113
136
|
}
|
|
137
|
+
if (migrationAlreadySatisfied({ cwd, wranglerConfig, persistTo, filePath })) {
|
|
138
|
+
markMigrationApplied({ cwd, wranglerConfig, persistTo, migration });
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
114
141
|
executeSqlFile({ cwd, wranglerConfig, filePath, persistTo });
|
|
115
142
|
markMigrationApplied({ cwd, wranglerConfig, persistTo, migration });
|
|
116
143
|
}
|
|
@@ -340,14 +340,14 @@ const LOCAL_RUNTIME_AUTH_ENV_KEYS = [
|
|
|
340
340
|
"TREESEED_API_DEVICE_ACCESS_TOKEN_TTL",
|
|
341
341
|
"TREESEED_API_DEVICE_POLL_INTERVAL",
|
|
342
342
|
"TREESEED_API_WEB_EXCHANGE_TTL",
|
|
343
|
-
"
|
|
344
|
-
"
|
|
345
|
-
"
|
|
346
|
-
"
|
|
347
|
-
"
|
|
348
|
-
"
|
|
349
|
-
"
|
|
350
|
-
"
|
|
343
|
+
"TREESEED_AUTH_GITHUB_CLIENT_ID",
|
|
344
|
+
"TREESEED_AUTH_GITHUB_CLIENT_SECRET",
|
|
345
|
+
"TREESEED_AUTH_GOOGLE_CLIENT_ID",
|
|
346
|
+
"TREESEED_AUTH_GOOGLE_CLIENT_SECRET",
|
|
347
|
+
"TREESEED_AUTH_MICROSOFT_CLIENT_ID",
|
|
348
|
+
"TREESEED_AUTH_MICROSOFT_CLIENT_SECRET",
|
|
349
|
+
"TREESEED_AUTH_APPLE_CLIENT_ID",
|
|
350
|
+
"TREESEED_AUTH_APPLE_CLIENT_SECRET"
|
|
351
351
|
];
|
|
352
352
|
function localAuthRuntimeVars(env) {
|
|
353
353
|
return Object.fromEntries(
|
package/dist/sdk-types.d.ts
CHANGED
|
@@ -412,6 +412,224 @@ export type CapacityReservationState = 'reserved' | 'consuming' | 'consumed' | '
|
|
|
412
412
|
export type CapacityEstimatePhase = 'intent' | 'discovery' | 'plan' | 'execution' | 'actual';
|
|
413
413
|
export type CapacityEstimateConfidence = 'low' | 'medium' | 'high';
|
|
414
414
|
export type CapacityApprovalState = 'pending' | 'approved' | 'rejected' | 'expired' | 'superseded';
|
|
415
|
+
export type TaskRiskClass = 'low' | 'medium' | 'high';
|
|
416
|
+
export type TaskMutationScope = 'none' | 'repository_read' | 'repository_write' | 'production';
|
|
417
|
+
export type TaskConcurrencyClass = 'read_only' | 'repository_claim' | 'exclusive_project' | 'human_attention';
|
|
418
|
+
export type TaskAdmissionOutcome = 'admitted' | 'planning_required' | 'approval_required' | 'budget_blocked' | 'deferred' | 'rejected';
|
|
419
|
+
export type CanonicalTaskState = 'pending' | 'queued' | 'claimed' | 'running' | 'completed' | 'failed' | 'waiting' | 'paused_for_approval' | 'checkpointing' | 'checkpointed' | 'continuation_required' | 'rollback_required' | 'rollback_complete' | 'provider_exhausted' | 'reservation_exhausted';
|
|
420
|
+
export type RepositoryWorkState = 'clean' | 'claimed_dirty' | 'checkpointed_dirty' | 'parked_dirty' | 'rollback_required';
|
|
421
|
+
export interface TaskClassification {
|
|
422
|
+
taskSignature: string;
|
|
423
|
+
risk: TaskRiskClass;
|
|
424
|
+
mutationScope: TaskMutationScope;
|
|
425
|
+
concurrencyClass: TaskConcurrencyClass;
|
|
426
|
+
expectedFanout: number;
|
|
427
|
+
confidence: CapacityEstimateConfidence;
|
|
428
|
+
requiresPlanning: boolean;
|
|
429
|
+
requiresApproval: boolean;
|
|
430
|
+
features?: Record<string, unknown>;
|
|
431
|
+
}
|
|
432
|
+
export interface ExecutionProfile {
|
|
433
|
+
id: string;
|
|
434
|
+
providerId?: string | null;
|
|
435
|
+
laneId?: string | null;
|
|
436
|
+
modelFamily?: string | null;
|
|
437
|
+
modelClass?: string | null;
|
|
438
|
+
contextWindowTokens?: number | null;
|
|
439
|
+
qualityWeight: number;
|
|
440
|
+
costMultiplier: number;
|
|
441
|
+
latencyClass: 'low' | 'medium' | 'high' | string;
|
|
442
|
+
concurrencyClass?: TaskConcurrencyClass | null;
|
|
443
|
+
quotaBehavior?: 'api_metered' | 'subscription_limited' | 'compute_bound' | 'attention_bound' | string | null;
|
|
444
|
+
metadata?: Record<string, unknown>;
|
|
445
|
+
}
|
|
446
|
+
export interface AttentionEstimate {
|
|
447
|
+
attentionWeight: number;
|
|
448
|
+
coordinationWeight: number;
|
|
449
|
+
totalAttentionWeight: number;
|
|
450
|
+
estimatedContextTokens: number;
|
|
451
|
+
requiredContextTokens: number;
|
|
452
|
+
source: string;
|
|
453
|
+
metadata?: Record<string, unknown>;
|
|
454
|
+
}
|
|
455
|
+
export interface AttentionPolicy {
|
|
456
|
+
maxAttentionLoad: number | null;
|
|
457
|
+
reserveAttentionPercent: number;
|
|
458
|
+
maxContextTokens: number | null;
|
|
459
|
+
maxContextSaturationPercent: number;
|
|
460
|
+
coordinationOverheadFactor: number;
|
|
461
|
+
}
|
|
462
|
+
export interface UtilityEstimate {
|
|
463
|
+
utilityValue: number;
|
|
464
|
+
maintenanceValue: number;
|
|
465
|
+
deadlinePressure: number;
|
|
466
|
+
successProbability: number;
|
|
467
|
+
qualityScore: number;
|
|
468
|
+
riskPenalty: number;
|
|
469
|
+
utilityScore: number;
|
|
470
|
+
utilityPerCredit: number;
|
|
471
|
+
source: string;
|
|
472
|
+
metadata?: Record<string, unknown>;
|
|
473
|
+
}
|
|
474
|
+
export interface UtilityPolicy {
|
|
475
|
+
minimumUtilityScore: number | null;
|
|
476
|
+
minimumUtilityPerCredit: number | null;
|
|
477
|
+
riskPenaltyFactor: number;
|
|
478
|
+
deadlineWindowHours: number;
|
|
479
|
+
maintenanceWeight: number;
|
|
480
|
+
priorityWeight: number;
|
|
481
|
+
}
|
|
482
|
+
export interface PredictiveReservePolicy {
|
|
483
|
+
enabled: boolean;
|
|
484
|
+
baseReservePercent: number;
|
|
485
|
+
maxReservePercent: number;
|
|
486
|
+
incidentReservePercent: number;
|
|
487
|
+
triggerBurstReservePercent: number;
|
|
488
|
+
deploymentWindowReservePercent: number;
|
|
489
|
+
providerDegradationReservePercent: number;
|
|
490
|
+
quotaPressureReservePercent: number;
|
|
491
|
+
}
|
|
492
|
+
export interface ReservePrediction {
|
|
493
|
+
reservePercent: number;
|
|
494
|
+
reserveCredits: number;
|
|
495
|
+
activelyAllocatableCredits: number;
|
|
496
|
+
reasons: string[];
|
|
497
|
+
signals: Record<string, unknown>;
|
|
498
|
+
}
|
|
499
|
+
export interface HybridExecutionPhase {
|
|
500
|
+
id: string;
|
|
501
|
+
kind: 'planning' | 'implementation' | 'review' | 'human_escalation' | string;
|
|
502
|
+
executionProfileId: string;
|
|
503
|
+
taskSignature?: string | null;
|
|
504
|
+
required: boolean;
|
|
505
|
+
admissionRequired: boolean;
|
|
506
|
+
mutationAllowed: boolean;
|
|
507
|
+
metadata?: Record<string, unknown>;
|
|
508
|
+
}
|
|
509
|
+
export interface HybridExecutionPlan {
|
|
510
|
+
schemaVersion: 1;
|
|
511
|
+
planId: string;
|
|
512
|
+
phases: HybridExecutionPhase[];
|
|
513
|
+
escalationPolicy?: Record<string, unknown>;
|
|
514
|
+
metadata?: Record<string, unknown>;
|
|
515
|
+
}
|
|
516
|
+
export interface WorkdayBudgetEnvelope {
|
|
517
|
+
dailyCreditBudget: number;
|
|
518
|
+
usedCredits: number;
|
|
519
|
+
queuedCredits: number;
|
|
520
|
+
reserveBufferCredits: number;
|
|
521
|
+
recoveryBudgetCredits: number;
|
|
522
|
+
activelyAllocatableCredits: number;
|
|
523
|
+
remainingCredits: number;
|
|
524
|
+
}
|
|
525
|
+
export interface TaskAdmissionPolicy {
|
|
526
|
+
planningThresholdCredits: number;
|
|
527
|
+
approvalThresholdCredits: number;
|
|
528
|
+
reserveBufferPercent: number;
|
|
529
|
+
recoveryBudgetCredits: number;
|
|
530
|
+
maxDownstreamTasks: number;
|
|
531
|
+
maxPlanningDepth: number;
|
|
532
|
+
maxAdmittedPlanTasksPerCycle: number;
|
|
533
|
+
planningTaskSignature: string;
|
|
534
|
+
allowBackfill?: boolean;
|
|
535
|
+
maxAttentionLoad?: number | null;
|
|
536
|
+
reserveAttentionPercent?: number | null;
|
|
537
|
+
maxContextTokens?: number | null;
|
|
538
|
+
maxContextSaturationPercent?: number | null;
|
|
539
|
+
coordinationOverheadFactor?: number | null;
|
|
540
|
+
predictiveReservePolicy?: Partial<PredictiveReservePolicy> | null;
|
|
541
|
+
utilityPolicy?: Partial<UtilityPolicy> | null;
|
|
542
|
+
}
|
|
543
|
+
export interface TaskAdmissionDecision {
|
|
544
|
+
outcome: TaskAdmissionOutcome;
|
|
545
|
+
taskSignature: string;
|
|
546
|
+
estimatedCreditsP50: number;
|
|
547
|
+
estimatedCreditsP90: number;
|
|
548
|
+
reservedCredits: number;
|
|
549
|
+
baseReservedCredits?: number;
|
|
550
|
+
executionProfileId?: string | null;
|
|
551
|
+
costMultiplier?: number | null;
|
|
552
|
+
reasons: string[];
|
|
553
|
+
requiresApproval: boolean;
|
|
554
|
+
requiresPlanning: boolean;
|
|
555
|
+
budget: WorkdayBudgetEnvelope;
|
|
556
|
+
policySnapshot: TaskAdmissionPolicy;
|
|
557
|
+
metadata?: Record<string, unknown>;
|
|
558
|
+
}
|
|
559
|
+
export interface TaskCheckpointArtifact {
|
|
560
|
+
id?: string;
|
|
561
|
+
taskId: string;
|
|
562
|
+
checkpointId?: string;
|
|
563
|
+
branch?: string | null;
|
|
564
|
+
baseCommit?: string | null;
|
|
565
|
+
currentCommit?: string | null;
|
|
566
|
+
currentGoal?: string | null;
|
|
567
|
+
currentPhase?: string | null;
|
|
568
|
+
filesChanged: string[];
|
|
569
|
+
commandsRun: string[];
|
|
570
|
+
testStatus?: 'not_run' | 'passing' | 'failing' | 'unknown' | string;
|
|
571
|
+
knownFailures: string[];
|
|
572
|
+
completedWork: string[];
|
|
573
|
+
remainingWorkEstimate?: {
|
|
574
|
+
p50: number;
|
|
575
|
+
p90: number;
|
|
576
|
+
} | null;
|
|
577
|
+
rollbackStrategy?: string | null;
|
|
578
|
+
continuationStrategy?: string | null;
|
|
579
|
+
repositoryState: RepositoryWorkState;
|
|
580
|
+
createdAt: string;
|
|
581
|
+
metadata?: Record<string, unknown>;
|
|
582
|
+
}
|
|
583
|
+
export interface PlannedTaskNode {
|
|
584
|
+
id?: string;
|
|
585
|
+
type: string;
|
|
586
|
+
agentId?: string | null;
|
|
587
|
+
title?: string | null;
|
|
588
|
+
priority?: number | null;
|
|
589
|
+
taskSignature?: string | null;
|
|
590
|
+
payload?: Record<string, unknown>;
|
|
591
|
+
estimatedCreditsP50?: number | null;
|
|
592
|
+
estimatedCreditsP90?: number | null;
|
|
593
|
+
risk?: TaskRiskClass | null;
|
|
594
|
+
mutationScope?: TaskMutationScope | null;
|
|
595
|
+
confidence?: CapacityEstimateConfidence | null;
|
|
596
|
+
expectedFanout?: number | null;
|
|
597
|
+
requiresApproval?: boolean | null;
|
|
598
|
+
requiresPlanning?: boolean | null;
|
|
599
|
+
dependsOn?: string[];
|
|
600
|
+
metadata?: Record<string, unknown>;
|
|
601
|
+
}
|
|
602
|
+
export interface TaskPlanProposal {
|
|
603
|
+
schemaVersion: 1;
|
|
604
|
+
planId: string;
|
|
605
|
+
sourceTaskId?: string | null;
|
|
606
|
+
parentTaskId?: string | null;
|
|
607
|
+
planningDepth: number;
|
|
608
|
+
tasks: PlannedTaskNode[];
|
|
609
|
+
totalEstimatedCreditsP50: number;
|
|
610
|
+
totalEstimatedCreditsP90: number;
|
|
611
|
+
createdAt?: string | null;
|
|
612
|
+
metadata?: Record<string, unknown>;
|
|
613
|
+
}
|
|
614
|
+
export interface PlanningPolicy {
|
|
615
|
+
maxDownstreamTasks: number;
|
|
616
|
+
maxPlanningDepth: number;
|
|
617
|
+
maxAdmittedPlanTasksPerCycle: number;
|
|
618
|
+
planningTaskSignature: string;
|
|
619
|
+
}
|
|
620
|
+
export interface PlanningAdmissionResult {
|
|
621
|
+
proposal: TaskPlanProposal;
|
|
622
|
+
admitted: PlannedTaskNode[];
|
|
623
|
+
deferred: PlannedTaskNode[];
|
|
624
|
+
rejected: Array<{
|
|
625
|
+
node: PlannedTaskNode;
|
|
626
|
+
reasons: string[];
|
|
627
|
+
}>;
|
|
628
|
+
totalEstimatedCreditsP50: number;
|
|
629
|
+
totalEstimatedCreditsP90: number;
|
|
630
|
+
admittedCreditsP90: number;
|
|
631
|
+
reasons: string[];
|
|
632
|
+
}
|
|
415
633
|
export interface CapacityProvider {
|
|
416
634
|
id: string;
|
|
417
635
|
teamId: string | null;
|
|
@@ -536,6 +754,7 @@ export interface TaskEstimate {
|
|
|
536
754
|
projectId: string;
|
|
537
755
|
estimatePhase: CapacityEstimatePhase;
|
|
538
756
|
taskSignature: string;
|
|
757
|
+
executionProfileId: string;
|
|
539
758
|
confidence: CapacityEstimateConfidence;
|
|
540
759
|
estimatedCreditsP50: number;
|
|
541
760
|
estimatedCreditsP90: number;
|
|
@@ -555,6 +774,7 @@ export interface TaskUsageActual {
|
|
|
555
774
|
workDayId: string | null;
|
|
556
775
|
projectId: string;
|
|
557
776
|
taskSignature: string;
|
|
777
|
+
executionProfileId: string;
|
|
558
778
|
capacityProviderId: string | null;
|
|
559
779
|
laneId: string | null;
|
|
560
780
|
businessModel: CapacityBusinessModel | string;
|
|
@@ -577,7 +797,10 @@ export interface TaskUsageActual {
|
|
|
577
797
|
}
|
|
578
798
|
export interface TaskEstimateProfile {
|
|
579
799
|
taskSignature: string;
|
|
800
|
+
executionProfileId: string;
|
|
580
801
|
sampleCount: number;
|
|
802
|
+
completedSampleCount?: number;
|
|
803
|
+
interruptedSampleCount?: number;
|
|
581
804
|
inputTokensP50: number | null;
|
|
582
805
|
inputTokensP90: number | null;
|
|
583
806
|
outputTokensP50: number | null;
|
|
@@ -588,6 +811,12 @@ export interface TaskEstimateProfile {
|
|
|
588
811
|
filesChangedP90: number | null;
|
|
589
812
|
creditsP50: number | null;
|
|
590
813
|
creditsP90: number | null;
|
|
814
|
+
creditsVariance?: number | null;
|
|
815
|
+
confidenceScore?: number | null;
|
|
816
|
+
outlierCount?: number;
|
|
817
|
+
partialCredits?: number | null;
|
|
818
|
+
firstSampleAt?: string | null;
|
|
819
|
+
lastSampleAt?: string | null;
|
|
591
820
|
updatedAt: string;
|
|
592
821
|
}
|
|
593
822
|
export interface ApprovalRequest {
|
|
@@ -1690,6 +1919,7 @@ export interface CreateTaskEstimateRequest {
|
|
|
1690
1919
|
projectId: string;
|
|
1691
1920
|
estimatePhase: CapacityEstimatePhase;
|
|
1692
1921
|
taskSignature: string;
|
|
1922
|
+
executionProfileId?: string | null;
|
|
1693
1923
|
confidence: CapacityEstimateConfidence;
|
|
1694
1924
|
estimatedCreditsP50: number;
|
|
1695
1925
|
estimatedCreditsP90: number;
|
|
@@ -1708,6 +1938,7 @@ export interface CreateTaskUsageActualRequest {
|
|
|
1708
1938
|
workDayId?: string | null;
|
|
1709
1939
|
projectId: string;
|
|
1710
1940
|
taskSignature: string;
|
|
1941
|
+
executionProfileId?: string | null;
|
|
1711
1942
|
capacityProviderId?: string | null;
|
|
1712
1943
|
laneId?: string | null;
|
|
1713
1944
|
businessModel: CapacityBusinessModel | string;
|