@rallycry/conveyor-k3 0.1.14 → 0.1.16
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/dist/cli.js +117 -40
- package/dist/index.d.ts +7 -6
- package/dist/index.js +34 -24
- package/dist/vm-qemu.js +6482 -7
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -4412,7 +4412,7 @@ var init_zod = __esm({
|
|
|
4412
4412
|
}
|
|
4413
4413
|
});
|
|
4414
4414
|
|
|
4415
|
-
// ../shared/dist/chunk-
|
|
4415
|
+
// ../shared/dist/chunk-DUZLPI2K.js
|
|
4416
4416
|
function formatModelId(provider, model) {
|
|
4417
4417
|
return `${provider}/${model}`;
|
|
4418
4418
|
}
|
|
@@ -4425,13 +4425,16 @@ function normalizeCheckpointPath(value) {
|
|
|
4425
4425
|
function uniqueSortedArray(item, minimum = 0) {
|
|
4426
4426
|
return external_exports.array(item).min(minimum).superRefine((values, ctx) => {
|
|
4427
4427
|
if (new Set(values).size !== values.length) {
|
|
4428
|
-
ctx.addIssue({
|
|
4428
|
+
ctx.addIssue({
|
|
4429
|
+
code: external_exports.ZodIssueCode.custom,
|
|
4430
|
+
message: "Duplicate values are not allowed"
|
|
4431
|
+
});
|
|
4429
4432
|
}
|
|
4430
4433
|
}).transform((values) => [...values].sort());
|
|
4431
4434
|
}
|
|
4432
4435
|
var DEFAULT_SONNET_MODEL, DEFAULT_OPUS_MODEL, DEFAULT_HAIKU_MODEL, FABLE_MODEL, PREVIOUS_SONNET_MODEL, PREVIOUS_OPUS_MODEL, JEV_MODEL, JEV_MODEL_ID, JEV_ZEN_MODEL, JEV_ZEN_MODEL_ID, JEV_INPUT_PRICE_PER_TOKEN, JEV_STATE_MAX_CHARS, PTY_STREAM_PORT_BASE, PTY_STREAM_PORT_ATTEMPTS, PREVIEW_PORT_DENY_LIST, checkpointPathSchema, secretNameSchema, checkpointKeySchema, checkpointDigestRefSchema, ACTIONS_PREBAKE_REGISTRY_PATTERN, actionsPrebakeRegistrySchema, projectCheckpointSettingsSchema, CARD_DESCRIPTION_MAX, CARD_DESCRIPTION_LIMIT_MESSAGE, CARD_DESCRIPTION_FIELD_HINT, MAX_MANUAL_TESTS_PER_TASK, MAX_MANUAL_TEST_TITLE_LENGTH, ManualTestItemsSchema, MAX_CI_WAIT_TIMEOUT_MINUTES;
|
|
4433
|
-
var
|
|
4434
|
-
"../shared/dist/chunk-
|
|
4436
|
+
var init_chunk_DUZLPI2K = __esm({
|
|
4437
|
+
"../shared/dist/chunk-DUZLPI2K.js"() {
|
|
4435
4438
|
"use strict";
|
|
4436
4439
|
init_zod();
|
|
4437
4440
|
init_zod();
|
|
@@ -4557,11 +4560,55 @@ function localBakeSudoersCommands(k3sPath) {
|
|
|
4557
4560
|
return `${k3sPath} ctr ${command.args.join(" ")}${suffix}`;
|
|
4558
4561
|
});
|
|
4559
4562
|
}
|
|
4560
|
-
var ACHIEVEMENT_RARITIES, RISK_LEVELS, riskLevelSchema, DEFAULT_RISK_LEVELS, LEVEL_BY_VALUE, ACTIVE_WORK_STATUSES, IDENTIFIED_WORK_STATUSES, DEFAULT_TASK_STATUS_COLOR, DEFAULT_TASK_STATUS_COLOR_INT, MAX_FILE_SIZE_BYTES, MAX_FILE_TAGS, MAX_FILE_TAG_LENGTH, ALLOWED_FILE_MIME_TYPES, ALLOWED_FILE_ACCEPT, EMBED_THRESHOLD_IMAGES, EMBED_THRESHOLD_TEXT, IDLE_HEARTBEAT_MS, siteAssetExtension, RequestSiteAssetUploadRequestSchema, ListSiteAssetTargetsRequestSchema, TurnEndToolCallSchema, AgentTurnUsageSchema, KnownAgentEventSchema, AgentEventSchema, PtyChatAtSchema, PtyChatTurnUsageSchema, PtyChatTurnFileSchema, PTY_CHAT_TURN_FILES_MAX, PtyChatEventPayloadSchema, PtyChatEventRequestSchema, PtyChatAttachRequestSchema, PTY_EFFORT_LEVELS, SetPtyModelEffortRequestSchema, cardDescription, AgentHeartbeatSchema, CreatePRInputSchema, PostToChatInputSchema, GetTaskContextRequestSchema, GetChatMessagesRequestSchema, GetTaskFilesRequestSchema, GetTaskFileRequestSchema, DeleteTaskFileRequestSchema, SetTaskFileShowcaseRequestSchema, GetTaskRequestSchema, GetCliHistoryRequestSchema, ListSubtasksRequestSchema, GetDependenciesRequestSchema, GetSuggestionsRequestSchema, ListManualTestsRequestSchema, QueryManualTestsRequestSchema, CreatePullRequestRequestSchema, RequestFileUploadRequestSchema, ConfirmFileUploadRequestSchema, UpdateTaskStatusRequestSchema, StoreSessionIdRequestSchema, SetManualTestsRequestSchema, EditManualTestRequestSchema, RemoveManualTestRequestSchema, ApproveManualTestRequestSchema, RejectManualTestRequestSchema, SessionStartRequestSchema, SessionStopRequestSchema, EndReviewSessionRequestSchema, ConnectAgentRequestSchema, ReportAgentStatusRequestSchema, NotifyAgentVersionRequestSchema, DiscoveredPortSchema, ReportDiscoveredPortsRequestSchema, ReportBootMilestoneRequestSchema, CreateSubtaskRequestSchema, UpdateSubtaskRequestSchema, DeleteSubtaskRequestSchema, SetSubtaskParentRequestSchema, GetTaskPropertiesRequestSchema, UpdateTaskFieldsRequestSchema, UpdateTaskPropertiesRequestSchema, ListIconsRequestSchema, GenerateTaskIconRequestSchema, SearchFaIconsRequestSchema, PickFaIconRequestSchema, CreateFollowUpTaskRequestSchema, AddDependencyRequestSchema, RemoveDependencyRequestSchema, CreateSuggestionRequestSchema, VoteSuggestionRequestSchema, TriggerIdentificationRequestSchema, HandoffToImplementerRequestSchema, SubmitCodeReviewResultRequestSchema, CycleCodingAgentKeyRequestSchema, PostChildChatMessageRequestSchema, UpdateChildStatusRequestSchema, GetAgentStatusRequestSchema, GetUiCliHistoryRequestSchema, GetActivePtySessionRequestSchema, ListActivePtySessionsRequestSchema, SendSoftStopRequestSchema, StopTaskSessionRequestSchema, FlushTaskQueueRequestSchema, CancelTaskQueuedMessageRequestSchema, FlushSingleQueuedMessageRequestSchema, AnswerAgentQuestionRequestSchema, ClearAgentTodosRequestSchema, AgentQuestionOptionSchema, AgentQuestionSchema, AskUserQuestionRequestSchema, PostAgentMessageRequestSchema, EmitAgentEventRequestSchema, RefreshGithubTokenRequestSchema, ReportCredentialFailureRequestSchema, ReportReviewSpawnFailureRequestSchema, ReportBuilderSpawnFailureRequestSchema, SpawnTaskSessionRequestSchema, StartCodeReviewRequestSchema, StopCodeReviewRequestSchema, ReportSessionSpawnFailureRequestSchema, RefreshGithubTokenResponseSchema, PTY_FRAME_MAX_CHARS, PTY_MAX_DIMENSION, PtyOutputRequestSchema, PtyEndedRequestSchema, PtyInputRequestSchema, PtyResizeRequestSchema, PtyAttachRequestSchema, ReportPtyStreamRequestSchema, ReportPtyInputRequestSchema, GetPtyStreamEndpointRequestSchema, CreatePRResponseSchema, PostToChatResponseSchema, UpdateTaskStatusResponseSchema, StoreSessionIdResponseSchema, HeartbeatResponseSchema, SessionStartResponseSchema, SessionStopResponseSchema, DeleteSubtaskResponseSchema, ParkOnCheckResultRequestSchema, GIT_BRANCH_NAME_MAX, GIT_BRANCH_NAME_MESSAGE, ALLOWED_REF, cardDescription2, ListAccessibleProjectsRequestSchema, ListProjectTasksRequestSchema, GetProjectTaskRequestSchema, SearchProjectTasksRequestSchema, ListProjectTagsRequestSchema, GetProjectTagRequestSchema, ListProjectTagAttachmentsRequestSchema, SetProjectFileTagsRequestSchema, GetProjectSummaryRequestSchema, GetProjectOnboardingStatusRequestSchema, GetProjectOnboardingStepRequestSchema, GetProjectConnectUrlsRequestSchema, conveyorCapabilitySchema, GetConnectionContextRequestSchema, VerifyConnectionRequestSchema, ListAccessibleSubprojectsRequestSchema, CreateProjectTaskRequestSchema, SetProjectTaskParentRequestSchema, UpdateProjectTaskRequestSchema, TransitionProjectTaskStatusRequestSchema, MoveProjectCardRequestSchema, PostToProjectTaskChatRequestSchema, GetProjectTaskCliRequestSchema, GetProjectTaskSessionsRequestSchema, QueryProjectGcpLogsRequestSchema, QueryProjectGrafanaLogsRequestSchema, driveFileNameSchema, DRIVE_MAX_CONTENT_CHARS, ListProjectDriveFilesRequestSchema, ReadProjectDriveFileRequestSchema, CreateProjectDriveFileRequestSchema, UpdateProjectDriveFileRequestSchema, DeleteProjectDriveFileRequestSchema, CreateProjectDriveFolderRequestSchema, StartProjectBuildRequestSchema, StopProjectBuildRequestSchema, StartProjectWorkspaceRequestSchema, StopProjectWorkspaceRequestSchema, ListMyLiveSessionsRequestSchema, ListProjectSessionGroupsRequestSchema, ListMyLiveSessionsAcrossProjectsRequestSchema, ListSessionGroupsAcrossProjectsRequestSchema, GetProjectAvailableTuisRequestSchema, StartAdhocSessionRequestSchema, StopAdhocSessionRequestSchema, ResumeAdhocSessionRequestSchema, RefreshCodingAgentKeyUsageRequestSchema, ListKeysToProbeRequestSchema, CreateProjectReleaseRequestSchema, AddTasksToProjectReleaseRequestSchema, ApproveProjectMergePRRequestSchema, ListProjectSubtasksRequestSchema, CreateProjectSubtaskRequestSchema, UpdateProjectSubtaskRequestSchema, DeleteProjectSubtaskRequestSchema, GetProjectTaskChatRequestSchema, AddProjectTaskDependencyRequestSchema, RemoveProjectTaskDependencyRequestSchema, VoteProjectSuggestionRequestSchema, GetProjectTaskDependenciesRequestSchema, CreateProjectPullRequestRequestSchema, ListProjectMembersRequestSchema, AddProjectTaskReviewerRequestSchema, RemoveProjectTaskReviewerRequestSchema, ListProjectManualTestsRequestSchema, QueryProjectManualTestsRequestSchema, SetProjectManualTestsRequestSchema, EditProjectManualTestRequestSchema, RemoveProjectManualTestRequestSchema, ApproveProjectManualTestRequestSchema, RejectProjectManualTestRequestSchema, CreateProjectSuggestionRequestSchema, ListProjectChannelsRequestSchema, READ_CHANNEL_MESSAGES_MAX_LIMIT, ReadChannelMessagesRequestSchema, POST_CHANNEL_MESSAGE_MAX_CHARS, PostChannelMessageRequestSchema, GET_ANALYTICS_SUMMARY_MAX_RANGE_DAYS, GetProjectAnalyticsSummaryRequestSchema, ListProjectTaskFilesRequestSchema, GetProjectAttachmentRequestSchema, DeleteProjectTaskFileRequestSchema, SetProjectTaskFileShowcaseRequestSchema, RequestProjectFileUploadRequestSchema, ConfirmProjectFileUploadRequestSchema, RequestWorkspaceRecycleRequestSchema, ReportApiOutageRequestSchema, CONTEXT_LINK_LOCATOR_MAX, TAG_DESCRIPTION_MAX, TAG_OVERVIEW_MAX, TAG_REASON_MAX, ProjectTagContextPathSchema, hexColor, overviewPathSchema, CreateProjectTagRequestSchema, UpdateProjectTagRequestSchema, PostToProjectChatRequestSchema, StartTagAuditRequestSchema, StartTaskAuditRequestSchema, GetActiveAuditSessionsRequestSchema, ReportTaskAuditResultRequestSchema, GetTaskAuditsRequestSchema, GetTaskAuditRequestSchema, GetTaskAuditAggregatesRequestSchema, DeleteTaskAuditRequestSchema, MarkInitialPromptSubmittedRequestSchema, PERSONAL_CLUSTER_EVENTS, PERSONAL_CLUSTER_HEARTBEAT_INTERVAL_MS, DECISION_STATUS_LABELS, DECISION_OPTION_KINDS, DECISION_VOTE_SOURCES, DECISION_OPTIONS_MIN, DECISION_OPTIONS_MAX, DECISION_OPTION_LABEL_MAX, DECISION_QUESTION_MAX, DECISION_RESOLUTION_MAX, DECISION_VOTE_REASON_MAX, DECISION_DEADLINE_MIN_HOURS, DECISION_DEADLINE_MAX_DAYS, DECISION_DEADLINE_MAX_HOURS, DECISION_LIST_MAX_LIMIT, decisionIdSchema, optionInputSchema, optionsArraySchema, CreateDecisionRequestSchema, VoteDecisionRequestSchema, RemoveDecisionVoteRequestSchema, ResolveDecisionRequestSchema, CancelDecisionRequestSchema, BulkDecisionIdsRequestSchema, ReopenDecisionRequestSchema, UpdateDecisionRequestSchema, GetDecisionRequestSchema, ListDecisionsRequestSchema, optionInput, optionsInput, deadlineHours, CreateProjectDecisionRequestSchema, ListProjectDecisionsRequestSchema, GetProjectDecisionRequestSchema, VoteProjectDecisionRequestSchema, ResolveProjectDecisionRequestSchema, UpdateProjectDecisionRequestSchema, EVALUATE_MAX_QUESTIONS, EVALUATE_MAX_ITEMS, EVALUATE_ITEM_MAX_CHARS, EVALUATE_REQUEST_MAX_CHARS, TEXT_MAX, QUESTION_KEY, EvaluateQuestionSchema, EvaluateQuestionsRequestSchema, MEETING_CHECKLIST_TITLE_MAX, MEETING_TRANSCRIPT_MAX_CHARS, MEETING_TITLE_MAX, MEETING_OCCURRED_AT_MIN_YEAR, MEETING_OCCURRED_AT_MAX_FUTURE_MS, OCCURRED_AT_RANGE_MESSAGE, MeetingOccurredAtSchema, CreateMeetingFromTranscriptRequestSchema, GetMeetingRequestSchema, UpdateMeetingRequestSchema, RegenerateMeetingSummaryRequestSchema, DeleteMeetingRequestSchema, checklistTitle, ListMeetingChecklistRequestSchema, AddMeetingChecklistItemsRequestSchema, UpdateMeetingChecklistItemRequestSchema, DeleteMeetingChecklistItemRequestSchema, SetMeetingChecklistItemCheckedRequestSchema, ListMeetingsRequestSchema, ReadMeetingTranscriptRequestSchema, MEETING_SUMMARY_MAX_CHARS, AddProjectMeetingChecklistItemsRequestSchema, CheckProjectMeetingChecklistItemRequestSchema, EditProjectMeetingChecklistItemRequestSchema, RemoveProjectMeetingChecklistItemRequestSchema, CreateProjectMeetingRequestSchema, UpdateProjectMeetingRequestSchema, TASK_CHAT_HISTORY_LIMIT, PM_CHAT_HISTORY_LIMIT, AGENT_CHAT_HISTORY_FETCH_LIMIT, ANTHROPIC_CATALOG, PROJECT_ARCHIVE_RETENTION_DAYS, RETENTION_MS, CLAUDESPACE_WORKLOAD_LABEL, CLAUDESPACE_WORKLOAD_VALUE, CONVEYOR_POD_SELECTOR, CONTAINERD_K8S_NAMESPACE, CONTAINERD_PIN_LABEL, CONVEYOR_CONTENT_HASH_LABEL, VM_IMPORT_DISCOVERY_DIR, LOCAL_BAKE_ROOT_COMMANDS, PERSONAL_LOCAL_REGISTRY_NAMESPACE, PERSONAL_LOCAL_REGISTRY_NAME, PERSONAL_LOCAL_REGISTRY_PORT, PERSONAL_LOCAL_REGISTRY_HOST, PERSONAL_LOCAL_REGISTRY_NODE_ENDPOINT, PERSONAL_LOCAL_REGISTRY_PUSH_SECRET, PERSONAL_LOCAL_REGISTRY_PUSH_SECRET_KEY, BAKE_COMPONENT_LABEL, BAKE_COMPONENT_PREBAKE, BAKE_COMPONENT_STATE_BAKE, BAKE_COMPONENT_VALUES, PERSONAL_BAKE_NAMESPACE, MS_PER_DAY, POSTGRES_ENV, FIREBASE_EMULATOR_COMMAND, FIREBASE_EMULATOR_ENV, CATALOG, SERVICE_DEFINITIONS, SUPPORTED_CLAUDESPACE_DEPS, STATEFUL_BAKE_DEPS, MIRRORABLE_SIDECARS, LEVELS_PER_BAND, PRESTIGE_TIERS, TOP_PRESTIGE_BAND, CARD_TYPE_SURFACE, surfaceTypes, BOARD_CARD_TYPES, REPORT_CARD_TYPES, DECISION_CARD_TYPES;
|
|
4563
|
+
function relayAllowanceGiB(relaySlots = BASE_RELAY_SLOTS) {
|
|
4564
|
+
return Math.max(0, relaySlots - BASE_RELAY_SLOTS) * RELAY_RSS_ALLOWANCE_MIB / 1024;
|
|
4565
|
+
}
|
|
4566
|
+
function vmHostMemoryGiB(guestGiB, relaySlots = BASE_RELAY_SLOTS) {
|
|
4567
|
+
return guestGiB + Math.max(1, guestGiB / 4) + relayAllowanceGiB(relaySlots);
|
|
4568
|
+
}
|
|
4569
|
+
function maximumGuestMemoryGiBWithin(budgetGiB, relaySlots = BASE_RELAY_SLOTS) {
|
|
4570
|
+
const guestBudget = budgetGiB - relayAllowanceGiB(relaySlots);
|
|
4571
|
+
if (!Number.isFinite(guestBudget) || guestBudget <= 0) return 0;
|
|
4572
|
+
return Math.max(0, Math.floor(Math.min(guestBudget - 1, guestBudget / 1.25)));
|
|
4573
|
+
}
|
|
4574
|
+
function vmMemoryBudgetGiB(hostMemoryGiB) {
|
|
4575
|
+
return hostMemoryGiB * VM_HOST_MEMORY_SHARE;
|
|
4576
|
+
}
|
|
4577
|
+
function vmCpuBudget(hostCpus) {
|
|
4578
|
+
return Math.max(1, hostCpus - 1);
|
|
4579
|
+
}
|
|
4580
|
+
function recommendedVmSize(hostMemoryGiB, hostCpus) {
|
|
4581
|
+
return {
|
|
4582
|
+
cpus: defaultCpus(hostCpus),
|
|
4583
|
+
memoryGiB: Math.min(
|
|
4584
|
+
VM_DEFAULT_MEMORY_CAP_GIB,
|
|
4585
|
+
maximumGuestMemoryGiBWithin(vmMemoryBudgetGiB(hostMemoryGiB))
|
|
4586
|
+
)
|
|
4587
|
+
};
|
|
4588
|
+
}
|
|
4589
|
+
function defaultCpus(hostCpus) {
|
|
4590
|
+
if (!Number.isFinite(hostCpus) || hostCpus < 1) return 0;
|
|
4591
|
+
const cores = Math.floor(hostCpus);
|
|
4592
|
+
return Math.min(VM_DEFAULT_CPU_CAP, vmCpuBudget(cores), Math.max(2, cores - 2));
|
|
4593
|
+
}
|
|
4594
|
+
function podsThatFit(size) {
|
|
4595
|
+
const memory = size.memoryGiB - GUEST_SYSTEM_RESERVE_GIB;
|
|
4596
|
+
const cpu = size.cpus - GUEST_SYSTEM_RESERVE_CPU;
|
|
4597
|
+
const fit = (preset) => Math.max(0, Math.floor(Math.min(memory / preset.memory, cpu / preset.cpu) + 1e-9));
|
|
4598
|
+
return { medium: fit(POD_SIZE_PRESETS.medium), small: fit(POD_SIZE_PRESETS.small) };
|
|
4599
|
+
}
|
|
4600
|
+
function smallestVmFor(pod) {
|
|
4601
|
+
const preset = POD_SIZE_PRESETS[pod];
|
|
4602
|
+
return {
|
|
4603
|
+
cpus: Math.ceil(preset.cpu + GUEST_SYSTEM_RESERVE_CPU),
|
|
4604
|
+
memoryGiB: Math.ceil(preset.memory + GUEST_SYSTEM_RESERVE_GIB)
|
|
4605
|
+
};
|
|
4606
|
+
}
|
|
4607
|
+
var ACHIEVEMENT_RARITIES, RISK_LEVELS, riskLevelSchema, DEFAULT_RISK_LEVELS, LEVEL_BY_VALUE, ACTIVE_WORK_STATUSES, IDENTIFIED_WORK_STATUSES, DEFAULT_TASK_STATUS_COLOR, DEFAULT_TASK_STATUS_COLOR_INT, MAX_FILE_SIZE_BYTES, MAX_FILE_TAGS, MAX_FILE_TAG_LENGTH, ALLOWED_FILE_MIME_TYPES, ALLOWED_FILE_ACCEPT, EMBED_THRESHOLD_IMAGES, EMBED_THRESHOLD_TEXT, IDLE_HEARTBEAT_MS, siteAssetExtension, RequestSiteAssetUploadRequestSchema, ListSiteAssetTargetsRequestSchema, TurnEndToolCallSchema, AgentTurnUsageSchema, KnownAgentEventSchema, AgentEventSchema, PtyChatAtSchema, PtyChatTurnUsageSchema, PtyChatTurnFileSchema, PTY_CHAT_TURN_FILES_MAX, PtyChatEventPayloadSchema, PtyChatEventRequestSchema, PtyChatAttachRequestSchema, PTY_EFFORT_LEVELS, SetPtyModelEffortRequestSchema, cardDescription, AgentHeartbeatSchema, CreatePRInputSchema, PostToChatInputSchema, GetTaskContextRequestSchema, GetChatMessagesRequestSchema, GetTaskFilesRequestSchema, GetTaskFileRequestSchema, DeleteTaskFileRequestSchema, SetTaskFileShowcaseRequestSchema, GetTaskRequestSchema, GetCliHistoryRequestSchema, ListSubtasksRequestSchema, GetDependenciesRequestSchema, GetSuggestionsRequestSchema, ListManualTestsRequestSchema, QueryManualTestsRequestSchema, CreatePullRequestRequestSchema, RequestFileUploadRequestSchema, ConfirmFileUploadRequestSchema, UpdateTaskStatusRequestSchema, StoreSessionIdRequestSchema, SetManualTestsRequestSchema, EditManualTestRequestSchema, RemoveManualTestRequestSchema, ApproveManualTestRequestSchema, RejectManualTestRequestSchema, SessionStartRequestSchema, SessionStopRequestSchema, EndReviewSessionRequestSchema, ConnectAgentRequestSchema, ReportAgentStatusRequestSchema, NotifyAgentVersionRequestSchema, DiscoveredPortSchema, ReportDiscoveredPortsRequestSchema, CreateSubtaskRequestSchema, UpdateSubtaskRequestSchema, DeleteSubtaskRequestSchema, SetSubtaskParentRequestSchema, GetTaskPropertiesRequestSchema, UpdateTaskFieldsRequestSchema, UpdateTaskPropertiesRequestSchema, ListIconsRequestSchema, GenerateTaskIconRequestSchema, SearchFaIconsRequestSchema, PickFaIconRequestSchema, CreateFollowUpTaskRequestSchema, AddDependencyRequestSchema, RemoveDependencyRequestSchema, CreateSuggestionRequestSchema, VoteSuggestionRequestSchema, TriggerIdentificationRequestSchema, HandoffToImplementerRequestSchema, SubmitCodeReviewResultRequestSchema, CycleCodingAgentKeyRequestSchema, PostChildChatMessageRequestSchema, UpdateChildStatusRequestSchema, GetAgentStatusRequestSchema, GetUiCliHistoryRequestSchema, GetActivePtySessionRequestSchema, ListActivePtySessionsRequestSchema, SendSoftStopRequestSchema, StopTaskSessionRequestSchema, FlushTaskQueueRequestSchema, CancelTaskQueuedMessageRequestSchema, FlushSingleQueuedMessageRequestSchema, AnswerAgentQuestionRequestSchema, ClearAgentTodosRequestSchema, AgentQuestionOptionSchema, AgentQuestionSchema, AskUserQuestionRequestSchema, PostAgentMessageRequestSchema, EmitAgentEventRequestSchema, RefreshGithubTokenRequestSchema, ReportCredentialFailureRequestSchema, ReportReviewSpawnFailureRequestSchema, ReportBuilderSpawnFailureRequestSchema, SpawnTaskSessionRequestSchema, StartCodeReviewRequestSchema, StopCodeReviewRequestSchema, ReportSessionSpawnFailureRequestSchema, RefreshGithubTokenResponseSchema, PTY_FRAME_MAX_CHARS, PTY_MAX_DIMENSION, PtyOutputRequestSchema, PtyEndedRequestSchema, PtyInputRequestSchema, PtyResizeRequestSchema, PtyAttachRequestSchema, ReportPtyStreamRequestSchema, ReportPtyInputRequestSchema, GetPtyStreamEndpointRequestSchema, CreatePRResponseSchema, PostToChatResponseSchema, UpdateTaskStatusResponseSchema, StoreSessionIdResponseSchema, HeartbeatResponseSchema, SessionStartResponseSchema, SessionStopResponseSchema, DeleteSubtaskResponseSchema, ParkOnCheckResultRequestSchema, GIT_BRANCH_NAME_MAX, GIT_BRANCH_NAME_MESSAGE, ALLOWED_REF, cardDescription2, ListAccessibleProjectsRequestSchema, ListProjectTasksRequestSchema, ListCardStatesRequestSchema, GetProjectTaskRequestSchema, SearchProjectTasksRequestSchema, ListProjectTagsRequestSchema, GetProjectTagRequestSchema, ListProjectTagAttachmentsRequestSchema, SetProjectFileTagsRequestSchema, GetProjectSummaryRequestSchema, GetProjectOnboardingStatusRequestSchema, GetProjectOnboardingStepRequestSchema, GetProjectConnectUrlsRequestSchema, conveyorCapabilitySchema, GetConnectionContextRequestSchema, VerifyConnectionRequestSchema, ListAccessibleSubprojectsRequestSchema, CreateProjectTaskRequestSchema, SetProjectTaskParentRequestSchema, UpdateProjectTaskRequestSchema, TransitionProjectTaskStatusRequestSchema, MoveProjectCardRequestSchema, PostToProjectTaskChatRequestSchema, GetProjectTaskCliRequestSchema, GetProjectTaskSessionsRequestSchema, QueryProjectGcpLogsRequestSchema, QueryProjectGrafanaLogsRequestSchema, driveFileNameSchema, DRIVE_MAX_CONTENT_CHARS, ListProjectDriveFilesRequestSchema, ReadProjectDriveFileRequestSchema, CreateProjectDriveFileRequestSchema, UpdateProjectDriveFileRequestSchema, DeleteProjectDriveFileRequestSchema, CreateProjectDriveFolderRequestSchema, StartProjectBuildRequestSchema, StopProjectBuildRequestSchema, StartProjectWorkspaceRequestSchema, StopProjectWorkspaceRequestSchema, ListMyLiveSessionsRequestSchema, ListProjectSessionGroupsRequestSchema, ListMyLiveSessionsAcrossProjectsRequestSchema, ListSessionGroupsAcrossProjectsRequestSchema, GetProjectAvailableTuisRequestSchema, StartAdhocSessionRequestSchema, StopAdhocSessionRequestSchema, ResumeAdhocSessionRequestSchema, RefreshCodingAgentKeyUsageRequestSchema, ListKeysToProbeRequestSchema, CreateProjectReleaseRequestSchema, AddTasksToProjectReleaseRequestSchema, ApproveProjectMergePRRequestSchema, ListProjectSubtasksRequestSchema, CreateProjectSubtaskRequestSchema, UpdateProjectSubtaskRequestSchema, DeleteProjectSubtaskRequestSchema, GetProjectTaskChatRequestSchema, AddProjectTaskDependencyRequestSchema, RemoveProjectTaskDependencyRequestSchema, VoteProjectSuggestionRequestSchema, GetProjectTaskDependenciesRequestSchema, CreateProjectPullRequestRequestSchema, ListProjectMembersRequestSchema, AddProjectTaskReviewerRequestSchema, RemoveProjectTaskReviewerRequestSchema, ListProjectManualTestsRequestSchema, QueryProjectManualTestsRequestSchema, SetProjectManualTestsRequestSchema, EditProjectManualTestRequestSchema, RemoveProjectManualTestRequestSchema, ApproveProjectManualTestRequestSchema, RejectProjectManualTestRequestSchema, CreateProjectSuggestionRequestSchema, ListProjectChannelsRequestSchema, READ_CHANNEL_MESSAGES_MAX_LIMIT, ReadChannelMessagesRequestSchema, POST_CHANNEL_MESSAGE_MAX_CHARS, PostChannelMessageRequestSchema, GET_ANALYTICS_SUMMARY_MAX_RANGE_DAYS, GetProjectAnalyticsSummaryRequestSchema, ListProjectTaskFilesRequestSchema, GetProjectAttachmentRequestSchema, DeleteProjectTaskFileRequestSchema, SetProjectTaskFileShowcaseRequestSchema, RequestProjectFileUploadRequestSchema, ConfirmProjectFileUploadRequestSchema, RequestWorkspaceRecycleRequestSchema, ReportApiOutageRequestSchema, CONTEXT_LINK_LOCATOR_MAX, TAG_DESCRIPTION_MAX, TAG_OVERVIEW_MAX, TAG_REASON_MAX, ProjectTagContextPathSchema, hexColor, overviewPathSchema, CreateProjectTagRequestSchema, UpdateProjectTagRequestSchema, PostToProjectChatRequestSchema, StartTagAuditRequestSchema, StartTaskAuditRequestSchema, GetActiveAuditSessionsRequestSchema, ReportTaskAuditResultRequestSchema, GetTaskAuditsRequestSchema, GetTaskAuditRequestSchema, GetTaskAuditAggregatesRequestSchema, DeleteTaskAuditRequestSchema, MarkInitialPromptSubmittedRequestSchema, PERSONAL_CLUSTER_EVENTS, PERSONAL_CLUSTER_HEARTBEAT_INTERVAL_MS, DECISION_STATUS_LABELS, DECISION_OPTION_KINDS, DECISION_VOTE_SOURCES, DECISION_OPTIONS_MIN, DECISION_OPTIONS_MAX, DECISION_OPTION_LABEL_MAX, DECISION_QUESTION_MAX, DECISION_RESOLUTION_MAX, DECISION_VOTE_REASON_MAX, DECISION_DEADLINE_MIN_HOURS, DECISION_DEADLINE_MAX_DAYS, DECISION_DEADLINE_MAX_HOURS, DECISION_LIST_MAX_LIMIT, decisionIdSchema, optionInputSchema, optionsArraySchema, CreateDecisionRequestSchema, VoteDecisionRequestSchema, RemoveDecisionVoteRequestSchema, ResolveDecisionRequestSchema, CancelDecisionRequestSchema, BulkDecisionIdsRequestSchema, ReopenDecisionRequestSchema, UpdateDecisionRequestSchema, GetDecisionRequestSchema, ListDecisionsRequestSchema, optionInput, optionsInput, deadlineHours, CreateProjectDecisionRequestSchema, ListProjectDecisionsRequestSchema, GetProjectDecisionRequestSchema, VoteProjectDecisionRequestSchema, ResolveProjectDecisionRequestSchema, UpdateProjectDecisionRequestSchema, EVALUATE_MAX_QUESTIONS, EVALUATE_MAX_ITEMS, EVALUATE_ITEM_MAX_CHARS, EVALUATE_REQUEST_MAX_CHARS, TEXT_MAX, QUESTION_KEY, EvaluateQuestionSchema, EvaluateQuestionsRequestSchema, MEETING_CHECKLIST_TITLE_MAX, MEETING_TRANSCRIPT_MAX_CHARS, MEETING_TITLE_MAX, MEETING_OCCURRED_AT_MIN_YEAR, MEETING_OCCURRED_AT_MAX_FUTURE_MS, OCCURRED_AT_RANGE_MESSAGE, MeetingOccurredAtSchema, CreateMeetingFromTranscriptRequestSchema, GetMeetingRequestSchema, UpdateMeetingRequestSchema, RegenerateMeetingSummaryRequestSchema, DeleteMeetingRequestSchema, checklistTitle, ListMeetingChecklistRequestSchema, AddMeetingChecklistItemsRequestSchema, UpdateMeetingChecklistItemRequestSchema, DeleteMeetingChecklistItemRequestSchema, SetMeetingChecklistItemCheckedRequestSchema, ListMeetingsRequestSchema, ReadMeetingTranscriptRequestSchema, MEETING_SUMMARY_MAX_CHARS, AddProjectMeetingChecklistItemsRequestSchema, CheckProjectMeetingChecklistItemRequestSchema, EditProjectMeetingChecklistItemRequestSchema, RemoveProjectMeetingChecklistItemRequestSchema, CreateProjectMeetingRequestSchema, UpdateProjectMeetingRequestSchema, TASK_CHAT_HISTORY_LIMIT, PM_CHAT_HISTORY_LIMIT, AGENT_CHAT_HISTORY_FETCH_LIMIT, ANTHROPIC_CATALOG, PROJECT_ARCHIVE_RETENTION_DAYS, RETENTION_MS, CLAUDESPACE_WORKLOAD_LABEL, CLAUDESPACE_WORKLOAD_VALUE, CONVEYOR_POD_SELECTOR, CONTAINERD_K8S_NAMESPACE, CONTAINERD_PIN_LABEL, CONVEYOR_CONTENT_HASH_LABEL, VM_IMPORT_DISCOVERY_DIR, LOCAL_BAKE_ROOT_COMMANDS, PERSONAL_LOCAL_REGISTRY_NAMESPACE, PERSONAL_LOCAL_REGISTRY_NAME, PERSONAL_LOCAL_REGISTRY_PORT, PERSONAL_LOCAL_REGISTRY_HOST, PERSONAL_LOCAL_REGISTRY_NODE_ENDPOINT, PERSONAL_LOCAL_REGISTRY_PUSH_SECRET, PERSONAL_LOCAL_REGISTRY_PUSH_SECRET_KEY, BAKE_COMPONENT_LABEL, BAKE_COMPONENT_PREBAKE, BAKE_COMPONENT_STATE_BAKE, BAKE_COMPONENT_VALUES, PERSONAL_BAKE_NAMESPACE, MS_PER_DAY, POSTGRES_ENV, FIREBASE_EMULATOR_COMMAND, FIREBASE_EMULATOR_ENV, CATALOG, SERVICE_DEFINITIONS, SUPPORTED_CLAUDESPACE_DEPS, STATEFUL_BAKE_DEPS, MIRRORABLE_SIDECARS, LEVELS_PER_BAND, PRESTIGE_TIERS, TOP_PRESTIGE_BAND, POD_SIZE_PRESETS, VM_HOST_MEMORY_SHARE, RELAY_RSS_ALLOWANCE_MIB, BASE_RELAY_SLOTS, VM_DEFAULT_MEMORY_CAP_GIB, VM_DEFAULT_CPU_CAP, GUEST_SYSTEM_RESERVE_GIB, GUEST_SYSTEM_RESERVE_CPU, CARD_TYPE_SURFACE, surfaceTypes, BOARD_CARD_TYPES, REPORT_CARD_TYPES, DECISION_CARD_TYPES;
|
|
4561
4608
|
var init_dist = __esm({
|
|
4562
4609
|
"../shared/dist/index.js"() {
|
|
4563
4610
|
"use strict";
|
|
4564
|
-
|
|
4611
|
+
init_chunk_DUZLPI2K();
|
|
4565
4612
|
init_zod();
|
|
4566
4613
|
init_zod();
|
|
4567
4614
|
init_zod();
|
|
@@ -4984,7 +5031,9 @@ var init_dist = __esm({
|
|
|
4984
5031
|
GetTaskFileRequestSchema = external_exports.object({
|
|
4985
5032
|
sessionId: external_exports.string(),
|
|
4986
5033
|
fileId: external_exports.string(),
|
|
4987
|
-
taskId: external_exports.string().optional()
|
|
5034
|
+
taskId: external_exports.string().optional(),
|
|
5035
|
+
/** Ask for a short-lived `agentDownloadUrl` when the bytes are not inlined. */
|
|
5036
|
+
agentDownload: external_exports.boolean().optional()
|
|
4988
5037
|
});
|
|
4989
5038
|
DeleteTaskFileRequestSchema = external_exports.object({
|
|
4990
5039
|
sessionId: external_exports.string(),
|
|
@@ -5124,10 +5173,6 @@ var init_dist = __esm({
|
|
|
5124
5173
|
sessionId: external_exports.string(),
|
|
5125
5174
|
ports: external_exports.array(DiscoveredPortSchema).max(64)
|
|
5126
5175
|
});
|
|
5127
|
-
ReportBootMilestoneRequestSchema = external_exports.object({
|
|
5128
|
-
sessionId: external_exports.string(),
|
|
5129
|
-
key: external_exports.string().max(64)
|
|
5130
|
-
});
|
|
5131
5176
|
CreateSubtaskRequestSchema = external_exports.object({
|
|
5132
5177
|
sessionId: external_exports.string(),
|
|
5133
5178
|
title: external_exports.string().min(1),
|
|
@@ -5482,6 +5527,13 @@ var init_dist = __esm({
|
|
|
5482
5527
|
}).refine((p) => !(p.unassigned && p.assigneeId), {
|
|
5483
5528
|
message: "Pass either assigneeId or unassigned, not both"
|
|
5484
5529
|
});
|
|
5530
|
+
ListCardStatesRequestSchema = external_exports.object({
|
|
5531
|
+
projectId: external_exports.string(),
|
|
5532
|
+
statuses: external_exports.array(external_exports.string()).min(1).max(32),
|
|
5533
|
+
types: external_exports.array(external_exports.string()).optional(),
|
|
5534
|
+
cursor: external_exports.string().nullable().optional(),
|
|
5535
|
+
limit: external_exports.number().int().positive().optional().default(500)
|
|
5536
|
+
});
|
|
5485
5537
|
GetProjectTaskRequestSchema = external_exports.object({
|
|
5486
5538
|
projectId: external_exports.string(),
|
|
5487
5539
|
taskId: external_exports.string()
|
|
@@ -6914,6 +6966,18 @@ exec firebase emulators:start --only=auth --project=rally-cry-dev`
|
|
|
6914
6966
|
minLevel: (index + 1) * LEVELS_PER_BAND
|
|
6915
6967
|
}));
|
|
6916
6968
|
TOP_PRESTIGE_BAND = PRESTIGE_TIERS.length;
|
|
6969
|
+
POD_SIZE_PRESETS = {
|
|
6970
|
+
small: { cpu: 1.25, memory: 7, cpuLimit: 3 },
|
|
6971
|
+
medium: { cpu: 2.25, memory: 14, cpuLimit: 7 },
|
|
6972
|
+
large: { cpu: 2.4, memory: 15.5, cpuLimit: 9.5 }
|
|
6973
|
+
};
|
|
6974
|
+
VM_HOST_MEMORY_SHARE = 0.75;
|
|
6975
|
+
RELAY_RSS_ALLOWANCE_MIB = 128;
|
|
6976
|
+
BASE_RELAY_SLOTS = 16;
|
|
6977
|
+
VM_DEFAULT_MEMORY_CAP_GIB = 32;
|
|
6978
|
+
VM_DEFAULT_CPU_CAP = 8;
|
|
6979
|
+
GUEST_SYSTEM_RESERVE_GIB = 1.5;
|
|
6980
|
+
GUEST_SYSTEM_RESERVE_CPU = 0.25;
|
|
6917
6981
|
CARD_TYPE_SURFACE = {
|
|
6918
6982
|
task: "board",
|
|
6919
6983
|
chat: "board",
|
|
@@ -7571,23 +7635,10 @@ var init_host_state = __esm({
|
|
|
7571
7635
|
});
|
|
7572
7636
|
|
|
7573
7637
|
// src/vm/memory-budget.ts
|
|
7574
|
-
function relayAllowanceGiB(relaySlots = BASE_RELAY_SLOTS) {
|
|
7575
|
-
return Math.max(0, relaySlots - BASE_RELAY_SLOTS) * RELAY_RSS_ALLOWANCE_MIB / 1024;
|
|
7576
|
-
}
|
|
7577
|
-
function vmHostMemoryGiB(guestGiB, relaySlots = BASE_RELAY_SLOTS) {
|
|
7578
|
-
return guestGiB + Math.max(1, guestGiB / 4) + relayAllowanceGiB(relaySlots);
|
|
7579
|
-
}
|
|
7580
|
-
function maximumGuestMemoryGiBWithin(budgetGiB, relaySlots = BASE_RELAY_SLOTS) {
|
|
7581
|
-
const guestBudget = budgetGiB - relayAllowanceGiB(relaySlots);
|
|
7582
|
-
if (!Number.isFinite(guestBudget) || guestBudget <= 0) return 0;
|
|
7583
|
-
return Math.max(0, Math.floor(Math.min(guestBudget - 1, guestBudget / 1.25)));
|
|
7584
|
-
}
|
|
7585
|
-
var RELAY_RSS_ALLOWANCE_MIB, BASE_RELAY_SLOTS;
|
|
7586
7638
|
var init_memory_budget = __esm({
|
|
7587
7639
|
"src/vm/memory-budget.ts"() {
|
|
7588
7640
|
"use strict";
|
|
7589
|
-
|
|
7590
|
-
BASE_RELAY_SLOTS = 16;
|
|
7641
|
+
init_dist();
|
|
7591
7642
|
}
|
|
7592
7643
|
});
|
|
7593
7644
|
|
|
@@ -7595,10 +7646,10 @@ var init_memory_budget = __esm({
|
|
|
7595
7646
|
import { cpus, freemem, totalmem } from "os";
|
|
7596
7647
|
import { stringify as stringify2 } from "yaml";
|
|
7597
7648
|
function cpuBudget(hostCpus) {
|
|
7598
|
-
return
|
|
7649
|
+
return vmCpuBudget(hostCpus);
|
|
7599
7650
|
}
|
|
7600
7651
|
function memoryBudgetGiB(hostBytes) {
|
|
7601
|
-
return hostBytes / GIB2
|
|
7652
|
+
return vmMemoryBudgetGiB(hostBytes / GIB2);
|
|
7602
7653
|
}
|
|
7603
7654
|
function reservedHostMemoryGiB(allocations2) {
|
|
7604
7655
|
return allocations2.reduce(
|
|
@@ -7626,7 +7677,7 @@ function validateResources(resources, host = { cpus: cpus().length, memory: tota
|
|
|
7626
7677
|
);
|
|
7627
7678
|
}
|
|
7628
7679
|
const hostGiB = vmHostMemoryGiB(memoryGiB, relaySlots) + reservedHostMemoryGiB(others);
|
|
7629
|
-
if (!Number.isInteger(memoryGiB) || memoryGiB < 2 || hostGiB
|
|
7680
|
+
if (!Number.isInteger(memoryGiB) || memoryGiB < 2 || hostGiB > memoryBudgetGiB(host.memory)) {
|
|
7630
7681
|
throw new Error(
|
|
7631
7682
|
`VM memory must be at least 2 GiB and leave 25% of host memory available, including QEMU and relay overhead.${sharedTotals(others, `${hostGiB.toFixed(1)} of ${memoryBudgetGiB(host.memory).toFixed(1)} GiB of host memory`)}${relayNote(relaySlots)}`
|
|
7632
7683
|
);
|
|
@@ -7680,6 +7731,7 @@ var GIB2, IMAGES;
|
|
|
7680
7731
|
var init_config = __esm({
|
|
7681
7732
|
"src/vm/config.ts"() {
|
|
7682
7733
|
"use strict";
|
|
7734
|
+
init_dist();
|
|
7683
7735
|
init_memory_budget();
|
|
7684
7736
|
init_instance_name();
|
|
7685
7737
|
GIB2 = 1024 ** 3;
|
|
@@ -10703,24 +10755,47 @@ function setupDefaults(others, host = hostCapacity()) {
|
|
|
10703
10755
|
`Your other VMs already reserve this computer's CPU or memory budget: ${reservations}. Stop one and lower it with vm configure --instance=<name> --cpus=<n> --memory=<GiB> or --profile=default, then retry.`
|
|
10704
10756
|
);
|
|
10705
10757
|
}
|
|
10758
|
+
const wanted = recommendedVmSize(host.memory / GIB2, host.cpus);
|
|
10706
10759
|
return {
|
|
10707
|
-
cpus: Math.min(
|
|
10708
|
-
memoryGiB: Math.min(
|
|
10760
|
+
cpus: Math.min(wanted.cpus, room.cpus),
|
|
10761
|
+
memoryGiB: Math.min(wanted.memoryGiB, room.memoryGiB),
|
|
10709
10762
|
diskGiB: 64
|
|
10710
10763
|
};
|
|
10711
10764
|
}
|
|
10765
|
+
function setupResources(flags, defaults) {
|
|
10766
|
+
return {
|
|
10767
|
+
cpus: resourceFlag(flags, "cpus", defaults.cpus),
|
|
10768
|
+
memoryGiB: resourceFlag(flags, "memory", defaults.memoryGiB),
|
|
10769
|
+
diskGiB: resourceFlag(flags, "disk", defaults.diskGiB)
|
|
10770
|
+
};
|
|
10771
|
+
}
|
|
10772
|
+
function setupSizeNotice(resources, sizedToHost) {
|
|
10773
|
+
const fit = podsThatFit(resources);
|
|
10774
|
+
const pods = `${fit.medium} medium or ${fit.small} small pod${fit.small === 1 ? "" : "s"}`;
|
|
10775
|
+
const vm = `${resources.memoryGiB} GiB, ${resources.cpus}-CPU VM`;
|
|
10776
|
+
const lines2 = [
|
|
10777
|
+
sizedToHost ? `Creating a ${vm} sized to this computer. It fits ${pods} at a time. Pass --memory and --cpus to choose another size.` : `Creating a ${vm}. It fits ${pods} at a time.`
|
|
10778
|
+
];
|
|
10779
|
+
if (fit.small === 0) {
|
|
10780
|
+
const smallest = smallestVmFor("small");
|
|
10781
|
+
lines2.push(
|
|
10782
|
+
`No Conveyor pod fits in this VM, so builds skip it and use project compute. A small pod needs a VM with at least ${smallest.memoryGiB} GiB and ${smallest.cpus} CPUs.`
|
|
10783
|
+
);
|
|
10784
|
+
} else if (fit.medium === 0) {
|
|
10785
|
+
lines2.push(
|
|
10786
|
+
"Only small pods fit in this VM. Builds that need a medium pod use project compute."
|
|
10787
|
+
);
|
|
10788
|
+
}
|
|
10789
|
+
return lines2;
|
|
10790
|
+
}
|
|
10712
10791
|
async function createInstance(ports, parsed) {
|
|
10713
10792
|
if (ports.paths.instance !== DEFAULT_INSTANCE) assertInstancePathFits(ports.paths);
|
|
10714
10793
|
return await withAdmissionLock(async (release) => {
|
|
10715
10794
|
const defaults = setupDefaults(await readOtherAllocations(ports.paths, ports.layout));
|
|
10716
|
-
|
|
10717
|
-
|
|
10718
|
-
|
|
10719
|
-
|
|
10720
|
-
memoryGiB: resourceFlag(parsed.flags, "memory", defaults.memoryGiB),
|
|
10721
|
-
diskGiB: resourceFlag(parsed.flags, "disk", defaults.diskGiB)
|
|
10722
|
-
}
|
|
10723
|
-
);
|
|
10795
|
+
const resources = setupResources(parsed.flags, defaults);
|
|
10796
|
+
const sizedToHost = parsed.flags.cpus === void 0 && parsed.flags.memory === void 0;
|
|
10797
|
+
for (const line of setupSizeNotice(resources, sizedToHost)) ports.log(line);
|
|
10798
|
+
return await createVm({ ...ports, reserved: release }, resources);
|
|
10724
10799
|
}, ports.layout.base);
|
|
10725
10800
|
}
|
|
10726
10801
|
async function configureWithAdmission(ports, state, parsed) {
|
|
@@ -10863,6 +10938,7 @@ var RESOURCE_FLAGS;
|
|
|
10863
10938
|
var init_command_setup = __esm({
|
|
10864
10939
|
"src/vm/command-setup.ts"() {
|
|
10865
10940
|
"use strict";
|
|
10941
|
+
init_dist();
|
|
10866
10942
|
init_config();
|
|
10867
10943
|
init_dev_artifact();
|
|
10868
10944
|
init_device_link();
|
|
@@ -11765,7 +11841,8 @@ var init_command = __esm({
|
|
|
11765
11841
|
Usage: conveyor-k3 vm <setup|start|stop|status|list|link|internet|logout|pods|pod-logs|disk-usage|configure|update|allow|deny|refresh|uninstall|image import|runners grant>
|
|
11766
11842
|
Every command but list acts on one VM: --instance=<name> selects a named VM,
|
|
11767
11843
|
and omitting it selects this user's default VM.
|
|
11768
|
-
setup [--cpus
|
|
11844
|
+
setup [--cpus=<n>] [--memory=<GiB>] [--disk=64] Without --cpus and --memory, sizes the VM
|
|
11845
|
+
to this computer: the largest the budget allows, up to 32 GiB and 8 CPUs.
|
|
11769
11846
|
configure --cpus=4 --memory=8 [--disk=64] Changes allocation while stopped.
|
|
11770
11847
|
configure --profile=default|server [--relay-slots=96] [--relay-max-gib=8]
|
|
11771
11848
|
[--disk-mbps=1000] [--disk-iops=20000] Changes network and disk capacity while stopped.
|
|
@@ -15058,7 +15135,7 @@ async function reportLocalImages(exec, inventory, wantedImages, cache) {
|
|
|
15058
15135
|
if (!inventory) return void 0;
|
|
15059
15136
|
const wanted = new Set(wantedImages);
|
|
15060
15137
|
const held = inventory.images.flatMap(
|
|
15061
|
-
(image) => (image.repoTags ?? []).filter((ref) => ref.startsWith("localhost/") && isImageRef(ref)).map((ref) => ({ ref, imageId: image.id }))
|
|
15138
|
+
(image) => (image.repoTags ?? []).filter((ref) => (ref.startsWith("localhost/") || wanted.has(ref)) && isImageRef(ref)).map((ref) => ({ ref, imageId: image.id }))
|
|
15062
15139
|
);
|
|
15063
15140
|
held.sort(
|
|
15064
15141
|
(a, b) => Number(wanted.has(b.ref)) - Number(wanted.has(a.ref)) || (a.ref < b.ref ? -1 : a.ref > b.ref ? 1 : 0)
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PersonalClusterEnrollmentBundle, PersonalClusterEnrollmentCompletion, PersonalClusterDesiredState, PersonalClusterHeartbeat, PersonalClusterWorkloads, PersonalClusterKubeletState } from '@project/shared';
|
|
2
|
+
export { maximumGuestMemoryGiB, maximumGuestMemoryGiBWithin } from '@project/shared';
|
|
2
3
|
|
|
3
4
|
interface ClusterConnectionConfig {
|
|
4
5
|
apiUrl: string;
|
|
@@ -294,6 +295,11 @@ declare function warmImages(exec: Executor, wantedImages: string[], unauthentica
|
|
|
294
295
|
* and should prefer one holding the latest bake. So the heartbeat lists every
|
|
295
296
|
* `localhost/` ref, with the content hash the bake stamped on the image.
|
|
296
297
|
*
|
|
298
|
+
* It also lists every wanted ref the node holds, whatever its registry. A
|
|
299
|
+
* shadow bake's image lives in the machine's own registry, and placement runs
|
|
300
|
+
* a card on the previous shadow while its rebuild is queued only when this
|
|
301
|
+
* list says the node still holds it.
|
|
302
|
+
*
|
|
297
303
|
* The hash takes one `crictl inspecti` per image, cached by image id: an id
|
|
298
304
|
* names exactly one image config, so its label never changes.
|
|
299
305
|
*/
|
|
@@ -962,11 +968,6 @@ interface QemuPolicyContext {
|
|
|
962
968
|
*/
|
|
963
969
|
declare function rewriteQemuArgs(args: string[], network: QemuNetworkPolicy, ncPath?: string, hostContext?: QemuPolicyContext): string[];
|
|
964
970
|
|
|
965
|
-
/** The largest whole-GiB guest whose host cost (see vmHostMemoryGiB) fits in the budget. */
|
|
966
|
-
declare function maximumGuestMemoryGiBWithin(budgetGiB: number, relaySlots?: number): number;
|
|
967
|
-
/** Reserve 25% of physical host RAM after accounting for VM overhead. */
|
|
968
|
-
declare function maximumGuestMemoryGiB(hostBytes: number, relaySlots?: number): number;
|
|
969
|
-
|
|
970
971
|
/** `--instance` omitted or `default`: the original VM, whose paths never move. */
|
|
971
972
|
declare const DEFAULT_INSTANCE = "default";
|
|
972
973
|
/** The `--instance` flag's value. Omitted or `default` selects the default VM. */
|
|
@@ -1016,4 +1017,4 @@ declare function pathsForRoot(root: string, instance?: string): {
|
|
|
1016
1017
|
};
|
|
1017
1018
|
type HostPaths = ReturnType<typeof pathsForRoot>;
|
|
1018
1019
|
|
|
1019
|
-
export { ClusterConnection, type ClusterConnectionConfig, ClusterDaemon, CommandError, type CrictlImage, DEFAULT_INSTANCE, type DaemonPorts, type Executor, type FileSystemPort$1 as FileSystemPort, type GuestDnsProvision, type GuestSrvRecord, HELP, type HostPaths, type ImageInventory, K3S_DISABLED_COMPONENTS, K3S_INSTALL_EXEC, type K3sUpgradeDecision, type MachineState, type NetworkEndpoint, type NetworkPolicy, type QemuNetworkPolicy, type ReconcileContext, type ReconcileResult, type RegistriesFile, type ResolvedNetwork, type ResolvedNetworkHost, type SRVLookup, type UninstallResult, type UnitRenderOptions, VERBS, type Verb, cloudflaredSrvRecords, collectHeartbeat, configuredAuthHosts, countRunningConveyorPods, createMemoryFileSystem, decideK3sUpgrade, hostPaths, isGloballyRoutableIPv4, isVerb,
|
|
1020
|
+
export { ClusterConnection, type ClusterConnectionConfig, ClusterDaemon, CommandError, type CrictlImage, DEFAULT_INSTANCE, type DaemonPorts, type Executor, type FileSystemPort$1 as FileSystemPort, type GuestDnsProvision, type GuestSrvRecord, HELP, type HostPaths, type ImageInventory, K3S_DISABLED_COMPONENTS, K3S_INSTALL_EXEC, type K3sUpgradeDecision, type MachineState, type NetworkEndpoint, type NetworkPolicy, type QemuNetworkPolicy, type ReconcileContext, type ReconcileResult, type RegistriesFile, type ResolvedNetwork, type ResolvedNetworkHost, type SRVLookup, type UninstallResult, type UnitRenderOptions, VERBS, type Verb, cloudflaredSrvRecords, collectHeartbeat, configuredAuthHosts, countRunningConveyorPods, createMemoryFileSystem, decideK3sUpgrade, hostPaths, isGloballyRoutableIPv4, isVerb, meetsK3sMinimum, missingAuthHosts, nodeFileSystem, ownerConfiguredKeys, ownerConfiguredKubeletFlags, parseArgs, parseInstanceName, parseK3sVersion, parseRegistries, pruneStrandedImages, readImageInventory, readState, reconcile, registryAdd, registryList, renderAllUnits, renderGuestDnsProvision, renderK3sDropIn, renderRegistryAuthSummary, resolveCloudflaredSrvRecords, resolveNetwork, rewriteQemuArgs, runOrThrow, runUpdate, selectStrandedImages, serializeRegistries, spawnExecutor, uninstall, upsertRegistryAuth, warmImages, writeState };
|
package/dist/index.js
CHANGED
|
@@ -4162,7 +4162,7 @@ var coerce = {
|
|
|
4162
4162
|
};
|
|
4163
4163
|
var NEVER = INVALID;
|
|
4164
4164
|
|
|
4165
|
-
// ../shared/dist/chunk-
|
|
4165
|
+
// ../shared/dist/chunk-DUZLPI2K.js
|
|
4166
4166
|
var DEFAULT_SONNET_MODEL = "claude-sonnet-5-5";
|
|
4167
4167
|
var DEFAULT_OPUS_MODEL = "claude-opus-5-5";
|
|
4168
4168
|
var DEFAULT_HAIKU_MODEL = "claude-haiku-4-5-20251001";
|
|
@@ -4215,7 +4215,10 @@ var actionsPrebakeRegistrySchema = external_exports.string().trim().min(1).regex
|
|
|
4215
4215
|
function uniqueSortedArray(item, minimum = 0) {
|
|
4216
4216
|
return external_exports.array(item).min(minimum).superRefine((values, ctx) => {
|
|
4217
4217
|
if (new Set(values).size !== values.length) {
|
|
4218
|
-
ctx.addIssue({
|
|
4218
|
+
ctx.addIssue({
|
|
4219
|
+
code: external_exports.ZodIssueCode.custom,
|
|
4220
|
+
message: "Duplicate values are not allowed"
|
|
4221
|
+
});
|
|
4219
4222
|
}
|
|
4220
4223
|
}).transform((values) => [...values].sort());
|
|
4221
4224
|
}
|
|
@@ -4656,7 +4659,9 @@ var GetTaskFilesRequestSchema = external_exports.object({
|
|
|
4656
4659
|
var GetTaskFileRequestSchema = external_exports.object({
|
|
4657
4660
|
sessionId: external_exports.string(),
|
|
4658
4661
|
fileId: external_exports.string(),
|
|
4659
|
-
taskId: external_exports.string().optional()
|
|
4662
|
+
taskId: external_exports.string().optional(),
|
|
4663
|
+
/** Ask for a short-lived `agentDownloadUrl` when the bytes are not inlined. */
|
|
4664
|
+
agentDownload: external_exports.boolean().optional()
|
|
4660
4665
|
});
|
|
4661
4666
|
var DeleteTaskFileRequestSchema = external_exports.object({
|
|
4662
4667
|
sessionId: external_exports.string(),
|
|
@@ -4796,10 +4801,6 @@ var ReportDiscoveredPortsRequestSchema = external_exports.object({
|
|
|
4796
4801
|
sessionId: external_exports.string(),
|
|
4797
4802
|
ports: external_exports.array(DiscoveredPortSchema).max(64)
|
|
4798
4803
|
});
|
|
4799
|
-
var ReportBootMilestoneRequestSchema = external_exports.object({
|
|
4800
|
-
sessionId: external_exports.string(),
|
|
4801
|
-
key: external_exports.string().max(64)
|
|
4802
|
-
});
|
|
4803
4804
|
var CreateSubtaskRequestSchema = external_exports.object({
|
|
4804
4805
|
sessionId: external_exports.string(),
|
|
4805
4806
|
title: external_exports.string().min(1),
|
|
@@ -5163,6 +5164,13 @@ var ListProjectTasksRequestSchema = external_exports.object({
|
|
|
5163
5164
|
}).refine((p) => !(p.unassigned && p.assigneeId), {
|
|
5164
5165
|
message: "Pass either assigneeId or unassigned, not both"
|
|
5165
5166
|
});
|
|
5167
|
+
var ListCardStatesRequestSchema = external_exports.object({
|
|
5168
|
+
projectId: external_exports.string(),
|
|
5169
|
+
statuses: external_exports.array(external_exports.string()).min(1).max(32),
|
|
5170
|
+
types: external_exports.array(external_exports.string()).optional(),
|
|
5171
|
+
cursor: external_exports.string().nullable().optional(),
|
|
5172
|
+
limit: external_exports.number().int().positive().optional().default(500)
|
|
5173
|
+
});
|
|
5166
5174
|
var GetProjectTaskRequestSchema = external_exports.object({
|
|
5167
5175
|
projectId: external_exports.string(),
|
|
5168
5176
|
taskId: external_exports.string()
|
|
@@ -6611,6 +6619,24 @@ var PRESTIGE_TIERS = ACHIEVEMENT_RARITIES.map((rarity, index) => ({
|
|
|
6611
6619
|
minLevel: (index + 1) * LEVELS_PER_BAND
|
|
6612
6620
|
}));
|
|
6613
6621
|
var TOP_PRESTIGE_BAND = PRESTIGE_TIERS.length;
|
|
6622
|
+
var VM_HOST_MEMORY_SHARE = 0.75;
|
|
6623
|
+
var RELAY_RSS_ALLOWANCE_MIB = 128;
|
|
6624
|
+
var BASE_RELAY_SLOTS = 16;
|
|
6625
|
+
function relayAllowanceGiB(relaySlots = BASE_RELAY_SLOTS) {
|
|
6626
|
+
return Math.max(0, relaySlots - BASE_RELAY_SLOTS) * RELAY_RSS_ALLOWANCE_MIB / 1024;
|
|
6627
|
+
}
|
|
6628
|
+
function maximumGuestMemoryGiBWithin(budgetGiB, relaySlots = BASE_RELAY_SLOTS) {
|
|
6629
|
+
const guestBudget = budgetGiB - relayAllowanceGiB(relaySlots);
|
|
6630
|
+
if (!Number.isFinite(guestBudget) || guestBudget <= 0) return 0;
|
|
6631
|
+
return Math.max(0, Math.floor(Math.min(guestBudget - 1, guestBudget / 1.25)));
|
|
6632
|
+
}
|
|
6633
|
+
function maximumGuestMemoryGiB(hostBytes, relaySlots = BASE_RELAY_SLOTS) {
|
|
6634
|
+
if (!Number.isFinite(hostBytes) || hostBytes <= 0) return 0;
|
|
6635
|
+
return maximumGuestMemoryGiBWithin(vmMemoryBudgetGiB(hostBytes / 1024 ** 3), relaySlots);
|
|
6636
|
+
}
|
|
6637
|
+
function vmMemoryBudgetGiB(hostMemoryGiB) {
|
|
6638
|
+
return hostMemoryGiB * VM_HOST_MEMORY_SHARE;
|
|
6639
|
+
}
|
|
6614
6640
|
var CARD_TYPE_SURFACE = {
|
|
6615
6641
|
task: "board",
|
|
6616
6642
|
chat: "board",
|
|
@@ -9067,7 +9093,7 @@ async function reportLocalImages(exec, inventory, wantedImages, cache) {
|
|
|
9067
9093
|
if (!inventory) return void 0;
|
|
9068
9094
|
const wanted = new Set(wantedImages);
|
|
9069
9095
|
const held = inventory.images.flatMap(
|
|
9070
|
-
(image) => (image.repoTags ?? []).filter((ref) => ref.startsWith("localhost/") && isImageRef(ref)).map((ref) => ({ ref, imageId: image.id }))
|
|
9096
|
+
(image) => (image.repoTags ?? []).filter((ref) => (ref.startsWith("localhost/") || wanted.has(ref)) && isImageRef(ref)).map((ref) => ({ ref, imageId: image.id }))
|
|
9071
9097
|
);
|
|
9072
9098
|
held.sort(
|
|
9073
9099
|
(a, b) => Number(wanted.has(b.ref)) - Number(wanted.has(a.ref)) || (a.ref < b.ref ? -1 : a.ref > b.ref ? 1 : 0)
|
|
@@ -11385,22 +11411,6 @@ function rewriteQemuArgs(args, network, ncPath = "/usr/bin/nc", hostContext = {}
|
|
|
11385
11411
|
return output;
|
|
11386
11412
|
}
|
|
11387
11413
|
|
|
11388
|
-
// src/vm/memory-budget.ts
|
|
11389
|
-
var RELAY_RSS_ALLOWANCE_MIB = 128;
|
|
11390
|
-
var BASE_RELAY_SLOTS = 16;
|
|
11391
|
-
function relayAllowanceGiB(relaySlots = BASE_RELAY_SLOTS) {
|
|
11392
|
-
return Math.max(0, relaySlots - BASE_RELAY_SLOTS) * RELAY_RSS_ALLOWANCE_MIB / 1024;
|
|
11393
|
-
}
|
|
11394
|
-
function maximumGuestMemoryGiBWithin(budgetGiB, relaySlots = BASE_RELAY_SLOTS) {
|
|
11395
|
-
const guestBudget = budgetGiB - relayAllowanceGiB(relaySlots);
|
|
11396
|
-
if (!Number.isFinite(guestBudget) || guestBudget <= 0) return 0;
|
|
11397
|
-
return Math.max(0, Math.floor(Math.min(guestBudget - 1, guestBudget / 1.25)));
|
|
11398
|
-
}
|
|
11399
|
-
function maximumGuestMemoryGiB(hostBytes, relaySlots = BASE_RELAY_SLOTS) {
|
|
11400
|
-
if (!Number.isFinite(hostBytes) || hostBytes <= 0) return 0;
|
|
11401
|
-
return maximumGuestMemoryGiBWithin(hostBytes / 1024 ** 3 * 0.75, relaySlots);
|
|
11402
|
-
}
|
|
11403
|
-
|
|
11404
11414
|
// src/vm/host-state.ts
|
|
11405
11415
|
import { access, chmod as chmod2, lstat, mkdir as mkdir2, readFile as readFile2, rename, rm as rm2, writeFile as writeFile2 } from "fs/promises";
|
|
11406
11416
|
import { homedir, uptime } from "os";
|