@rallycry/conveyor-k3 0.1.14 → 0.1.15

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 CHANGED
@@ -4412,7 +4412,7 @@ var init_zod = __esm({
4412
4412
  }
4413
4413
  });
4414
4414
 
4415
- // ../shared/dist/chunk-VSUBG7GR.js
4415
+ // ../shared/dist/chunk-SFSQ7NKP.js
4416
4416
  function formatModelId(provider, model) {
4417
4417
  return `${provider}/${model}`;
4418
4418
  }
@@ -4430,8 +4430,8 @@ function uniqueSortedArray(item, minimum = 0) {
4430
4430
  }).transform((values) => [...values].sort());
4431
4431
  }
4432
4432
  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 init_chunk_VSUBG7GR = __esm({
4434
- "../shared/dist/chunk-VSUBG7GR.js"() {
4433
+ var init_chunk_SFSQ7NKP = __esm({
4434
+ "../shared/dist/chunk-SFSQ7NKP.js"() {
4435
4435
  "use strict";
4436
4436
  init_zod();
4437
4437
  init_zod();
@@ -4557,11 +4557,55 @@ function localBakeSudoersCommands(k3sPath) {
4557
4557
  return `${k3sPath} ctr ${command.args.join(" ")}${suffix}`;
4558
4558
  });
4559
4559
  }
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;
4560
+ function relayAllowanceGiB(relaySlots = BASE_RELAY_SLOTS) {
4561
+ return Math.max(0, relaySlots - BASE_RELAY_SLOTS) * RELAY_RSS_ALLOWANCE_MIB / 1024;
4562
+ }
4563
+ function vmHostMemoryGiB(guestGiB, relaySlots = BASE_RELAY_SLOTS) {
4564
+ return guestGiB + Math.max(1, guestGiB / 4) + relayAllowanceGiB(relaySlots);
4565
+ }
4566
+ function maximumGuestMemoryGiBWithin(budgetGiB, relaySlots = BASE_RELAY_SLOTS) {
4567
+ const guestBudget = budgetGiB - relayAllowanceGiB(relaySlots);
4568
+ if (!Number.isFinite(guestBudget) || guestBudget <= 0) return 0;
4569
+ return Math.max(0, Math.floor(Math.min(guestBudget - 1, guestBudget / 1.25)));
4570
+ }
4571
+ function vmMemoryBudgetGiB(hostMemoryGiB) {
4572
+ return hostMemoryGiB * VM_HOST_MEMORY_SHARE;
4573
+ }
4574
+ function vmCpuBudget(hostCpus) {
4575
+ return Math.max(1, hostCpus - 1);
4576
+ }
4577
+ function recommendedVmSize(hostMemoryGiB, hostCpus) {
4578
+ return {
4579
+ cpus: defaultCpus(hostCpus),
4580
+ memoryGiB: Math.min(
4581
+ VM_DEFAULT_MEMORY_CAP_GIB,
4582
+ maximumGuestMemoryGiBWithin(vmMemoryBudgetGiB(hostMemoryGiB))
4583
+ )
4584
+ };
4585
+ }
4586
+ function defaultCpus(hostCpus) {
4587
+ if (!Number.isFinite(hostCpus) || hostCpus < 1) return 0;
4588
+ const cores = Math.floor(hostCpus);
4589
+ return Math.min(VM_DEFAULT_CPU_CAP, vmCpuBudget(cores), Math.max(2, cores - 2));
4590
+ }
4591
+ function podsThatFit(size) {
4592
+ const memory = size.memoryGiB - GUEST_SYSTEM_RESERVE_GIB;
4593
+ const cpu = size.cpus - GUEST_SYSTEM_RESERVE_CPU;
4594
+ const fit = (preset) => Math.max(0, Math.floor(Math.min(memory / preset.memory, cpu / preset.cpu) + 1e-9));
4595
+ return { medium: fit(POD_SIZE_PRESETS.medium), small: fit(POD_SIZE_PRESETS.small) };
4596
+ }
4597
+ function smallestVmFor(pod) {
4598
+ const preset = POD_SIZE_PRESETS[pod];
4599
+ return {
4600
+ cpus: Math.ceil(preset.cpu + GUEST_SYSTEM_RESERVE_CPU),
4601
+ memoryGiB: Math.ceil(preset.memory + GUEST_SYSTEM_RESERVE_GIB)
4602
+ };
4603
+ }
4604
+ 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, 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
4605
  var init_dist = __esm({
4562
4606
  "../shared/dist/index.js"() {
4563
4607
  "use strict";
4564
- init_chunk_VSUBG7GR();
4608
+ init_chunk_SFSQ7NKP();
4565
4609
  init_zod();
4566
4610
  init_zod();
4567
4611
  init_zod();
@@ -4984,7 +5028,9 @@ var init_dist = __esm({
4984
5028
  GetTaskFileRequestSchema = external_exports.object({
4985
5029
  sessionId: external_exports.string(),
4986
5030
  fileId: external_exports.string(),
4987
- taskId: external_exports.string().optional()
5031
+ taskId: external_exports.string().optional(),
5032
+ /** Ask for a short-lived `agentDownloadUrl` when the bytes are not inlined. */
5033
+ agentDownload: external_exports.boolean().optional()
4988
5034
  });
4989
5035
  DeleteTaskFileRequestSchema = external_exports.object({
4990
5036
  sessionId: external_exports.string(),
@@ -5124,10 +5170,6 @@ var init_dist = __esm({
5124
5170
  sessionId: external_exports.string(),
5125
5171
  ports: external_exports.array(DiscoveredPortSchema).max(64)
5126
5172
  });
5127
- ReportBootMilestoneRequestSchema = external_exports.object({
5128
- sessionId: external_exports.string(),
5129
- key: external_exports.string().max(64)
5130
- });
5131
5173
  CreateSubtaskRequestSchema = external_exports.object({
5132
5174
  sessionId: external_exports.string(),
5133
5175
  title: external_exports.string().min(1),
@@ -6914,6 +6956,18 @@ exec firebase emulators:start --only=auth --project=rally-cry-dev`
6914
6956
  minLevel: (index + 1) * LEVELS_PER_BAND
6915
6957
  }));
6916
6958
  TOP_PRESTIGE_BAND = PRESTIGE_TIERS.length;
6959
+ POD_SIZE_PRESETS = {
6960
+ small: { cpu: 1.25, memory: 7, cpuLimit: 3 },
6961
+ medium: { cpu: 2.25, memory: 14, cpuLimit: 7 },
6962
+ large: { cpu: 2.4, memory: 15.5, cpuLimit: 9.5 }
6963
+ };
6964
+ VM_HOST_MEMORY_SHARE = 0.75;
6965
+ RELAY_RSS_ALLOWANCE_MIB = 128;
6966
+ BASE_RELAY_SLOTS = 16;
6967
+ VM_DEFAULT_MEMORY_CAP_GIB = 32;
6968
+ VM_DEFAULT_CPU_CAP = 8;
6969
+ GUEST_SYSTEM_RESERVE_GIB = 1.5;
6970
+ GUEST_SYSTEM_RESERVE_CPU = 0.25;
6917
6971
  CARD_TYPE_SURFACE = {
6918
6972
  task: "board",
6919
6973
  chat: "board",
@@ -7571,23 +7625,10 @@ var init_host_state = __esm({
7571
7625
  });
7572
7626
 
7573
7627
  // 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
7628
  var init_memory_budget = __esm({
7587
7629
  "src/vm/memory-budget.ts"() {
7588
7630
  "use strict";
7589
- RELAY_RSS_ALLOWANCE_MIB = 128;
7590
- BASE_RELAY_SLOTS = 16;
7631
+ init_dist();
7591
7632
  }
7592
7633
  });
7593
7634
 
@@ -7595,10 +7636,10 @@ var init_memory_budget = __esm({
7595
7636
  import { cpus, freemem, totalmem } from "os";
7596
7637
  import { stringify as stringify2 } from "yaml";
7597
7638
  function cpuBudget(hostCpus) {
7598
- return Math.max(1, hostCpus - 1);
7639
+ return vmCpuBudget(hostCpus);
7599
7640
  }
7600
7641
  function memoryBudgetGiB(hostBytes) {
7601
- return hostBytes / GIB2 * 0.75;
7642
+ return vmMemoryBudgetGiB(hostBytes / GIB2);
7602
7643
  }
7603
7644
  function reservedHostMemoryGiB(allocations2) {
7604
7645
  return allocations2.reduce(
@@ -7626,7 +7667,7 @@ function validateResources(resources, host = { cpus: cpus().length, memory: tota
7626
7667
  );
7627
7668
  }
7628
7669
  const hostGiB = vmHostMemoryGiB(memoryGiB, relaySlots) + reservedHostMemoryGiB(others);
7629
- if (!Number.isInteger(memoryGiB) || memoryGiB < 2 || hostGiB * GIB2 > host.memory * 0.75) {
7670
+ if (!Number.isInteger(memoryGiB) || memoryGiB < 2 || hostGiB > memoryBudgetGiB(host.memory)) {
7630
7671
  throw new Error(
7631
7672
  `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
7673
  );
@@ -7680,6 +7721,7 @@ var GIB2, IMAGES;
7680
7721
  var init_config = __esm({
7681
7722
  "src/vm/config.ts"() {
7682
7723
  "use strict";
7724
+ init_dist();
7683
7725
  init_memory_budget();
7684
7726
  init_instance_name();
7685
7727
  GIB2 = 1024 ** 3;
@@ -10703,24 +10745,47 @@ function setupDefaults(others, host = hostCapacity()) {
10703
10745
  `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
10746
  );
10705
10747
  }
10748
+ const wanted = recommendedVmSize(host.memory / GIB2, host.cpus);
10706
10749
  return {
10707
- cpus: Math.min(4, room.cpus),
10708
- memoryGiB: Math.min(8, Math.floor(host.memory / GIB2 / 2), room.memoryGiB),
10750
+ cpus: Math.min(wanted.cpus, room.cpus),
10751
+ memoryGiB: Math.min(wanted.memoryGiB, room.memoryGiB),
10709
10752
  diskGiB: 64
10710
10753
  };
10711
10754
  }
10755
+ function setupResources(flags, defaults) {
10756
+ return {
10757
+ cpus: resourceFlag(flags, "cpus", defaults.cpus),
10758
+ memoryGiB: resourceFlag(flags, "memory", defaults.memoryGiB),
10759
+ diskGiB: resourceFlag(flags, "disk", defaults.diskGiB)
10760
+ };
10761
+ }
10762
+ function setupSizeNotice(resources, sizedToHost) {
10763
+ const fit = podsThatFit(resources);
10764
+ const pods = `${fit.medium} medium or ${fit.small} small pod${fit.small === 1 ? "" : "s"}`;
10765
+ const vm = `${resources.memoryGiB} GiB, ${resources.cpus}-CPU VM`;
10766
+ const lines2 = [
10767
+ 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.`
10768
+ ];
10769
+ if (fit.small === 0) {
10770
+ const smallest = smallestVmFor("small");
10771
+ lines2.push(
10772
+ `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.`
10773
+ );
10774
+ } else if (fit.medium === 0) {
10775
+ lines2.push(
10776
+ "Only small pods fit in this VM. Builds that need a medium pod use project compute."
10777
+ );
10778
+ }
10779
+ return lines2;
10780
+ }
10712
10781
  async function createInstance(ports, parsed) {
10713
10782
  if (ports.paths.instance !== DEFAULT_INSTANCE) assertInstancePathFits(ports.paths);
10714
10783
  return await withAdmissionLock(async (release) => {
10715
10784
  const defaults = setupDefaults(await readOtherAllocations(ports.paths, ports.layout));
10716
- return await createVm(
10717
- { ...ports, reserved: release },
10718
- {
10719
- cpus: resourceFlag(parsed.flags, "cpus", defaults.cpus),
10720
- memoryGiB: resourceFlag(parsed.flags, "memory", defaults.memoryGiB),
10721
- diskGiB: resourceFlag(parsed.flags, "disk", defaults.diskGiB)
10722
- }
10723
- );
10785
+ const resources = setupResources(parsed.flags, defaults);
10786
+ const sizedToHost = parsed.flags.cpus === void 0 && parsed.flags.memory === void 0;
10787
+ for (const line of setupSizeNotice(resources, sizedToHost)) ports.log(line);
10788
+ return await createVm({ ...ports, reserved: release }, resources);
10724
10789
  }, ports.layout.base);
10725
10790
  }
10726
10791
  async function configureWithAdmission(ports, state, parsed) {
@@ -10863,6 +10928,7 @@ var RESOURCE_FLAGS;
10863
10928
  var init_command_setup = __esm({
10864
10929
  "src/vm/command-setup.ts"() {
10865
10930
  "use strict";
10931
+ init_dist();
10866
10932
  init_config();
10867
10933
  init_dev_artifact();
10868
10934
  init_device_link();
@@ -11765,7 +11831,8 @@ var init_command = __esm({
11765
11831
  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
11832
  Every command but list acts on one VM: --instance=<name> selects a named VM,
11767
11833
  and omitting it selects this user's default VM.
11768
- setup [--cpus=4] [--memory=8] [--disk=64]
11834
+ setup [--cpus=<n>] [--memory=<GiB>] [--disk=64] Without --cpus and --memory, sizes the VM
11835
+ to this computer: the largest the budget allows, up to 32 GiB and 8 CPUs.
11769
11836
  configure --cpus=4 --memory=8 [--disk=64] Changes allocation while stopped.
11770
11837
  configure --profile=default|server [--relay-slots=96] [--relay-max-gib=8]
11771
11838
  [--disk-mbps=1000] [--disk-iops=20000] Changes network and disk capacity while stopped.
@@ -15058,7 +15125,7 @@ async function reportLocalImages(exec, inventory, wantedImages, cache) {
15058
15125
  if (!inventory) return void 0;
15059
15126
  const wanted = new Set(wantedImages);
15060
15127
  const held = inventory.images.flatMap(
15061
- (image) => (image.repoTags ?? []).filter((ref) => ref.startsWith("localhost/") && isImageRef(ref)).map((ref) => ({ ref, imageId: image.id }))
15128
+ (image) => (image.repoTags ?? []).filter((ref) => (ref.startsWith("localhost/") || wanted.has(ref)) && isImageRef(ref)).map((ref) => ({ ref, imageId: image.id }))
15062
15129
  );
15063
15130
  held.sort(
15064
15131
  (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, maximumGuestMemoryGiB, maximumGuestMemoryGiBWithin, 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 };
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-VSUBG7GR.js
4165
+ // ../shared/dist/chunk-SFSQ7NKP.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";
@@ -4656,7 +4656,9 @@ var GetTaskFilesRequestSchema = external_exports.object({
4656
4656
  var GetTaskFileRequestSchema = external_exports.object({
4657
4657
  sessionId: external_exports.string(),
4658
4658
  fileId: external_exports.string(),
4659
- taskId: external_exports.string().optional()
4659
+ taskId: external_exports.string().optional(),
4660
+ /** Ask for a short-lived `agentDownloadUrl` when the bytes are not inlined. */
4661
+ agentDownload: external_exports.boolean().optional()
4660
4662
  });
4661
4663
  var DeleteTaskFileRequestSchema = external_exports.object({
4662
4664
  sessionId: external_exports.string(),
@@ -4796,10 +4798,6 @@ var ReportDiscoveredPortsRequestSchema = external_exports.object({
4796
4798
  sessionId: external_exports.string(),
4797
4799
  ports: external_exports.array(DiscoveredPortSchema).max(64)
4798
4800
  });
4799
- var ReportBootMilestoneRequestSchema = external_exports.object({
4800
- sessionId: external_exports.string(),
4801
- key: external_exports.string().max(64)
4802
- });
4803
4801
  var CreateSubtaskRequestSchema = external_exports.object({
4804
4802
  sessionId: external_exports.string(),
4805
4803
  title: external_exports.string().min(1),
@@ -6611,6 +6609,24 @@ var PRESTIGE_TIERS = ACHIEVEMENT_RARITIES.map((rarity, index) => ({
6611
6609
  minLevel: (index + 1) * LEVELS_PER_BAND
6612
6610
  }));
6613
6611
  var TOP_PRESTIGE_BAND = PRESTIGE_TIERS.length;
6612
+ var VM_HOST_MEMORY_SHARE = 0.75;
6613
+ var RELAY_RSS_ALLOWANCE_MIB = 128;
6614
+ var BASE_RELAY_SLOTS = 16;
6615
+ function relayAllowanceGiB(relaySlots = BASE_RELAY_SLOTS) {
6616
+ return Math.max(0, relaySlots - BASE_RELAY_SLOTS) * RELAY_RSS_ALLOWANCE_MIB / 1024;
6617
+ }
6618
+ function maximumGuestMemoryGiBWithin(budgetGiB, relaySlots = BASE_RELAY_SLOTS) {
6619
+ const guestBudget = budgetGiB - relayAllowanceGiB(relaySlots);
6620
+ if (!Number.isFinite(guestBudget) || guestBudget <= 0) return 0;
6621
+ return Math.max(0, Math.floor(Math.min(guestBudget - 1, guestBudget / 1.25)));
6622
+ }
6623
+ function maximumGuestMemoryGiB(hostBytes, relaySlots = BASE_RELAY_SLOTS) {
6624
+ if (!Number.isFinite(hostBytes) || hostBytes <= 0) return 0;
6625
+ return maximumGuestMemoryGiBWithin(vmMemoryBudgetGiB(hostBytes / 1024 ** 3), relaySlots);
6626
+ }
6627
+ function vmMemoryBudgetGiB(hostMemoryGiB) {
6628
+ return hostMemoryGiB * VM_HOST_MEMORY_SHARE;
6629
+ }
6614
6630
  var CARD_TYPE_SURFACE = {
6615
6631
  task: "board",
6616
6632
  chat: "board",
@@ -9067,7 +9083,7 @@ async function reportLocalImages(exec, inventory, wantedImages, cache) {
9067
9083
  if (!inventory) return void 0;
9068
9084
  const wanted = new Set(wantedImages);
9069
9085
  const held = inventory.images.flatMap(
9070
- (image) => (image.repoTags ?? []).filter((ref) => ref.startsWith("localhost/") && isImageRef(ref)).map((ref) => ({ ref, imageId: image.id }))
9086
+ (image) => (image.repoTags ?? []).filter((ref) => (ref.startsWith("localhost/") || wanted.has(ref)) && isImageRef(ref)).map((ref) => ({ ref, imageId: image.id }))
9071
9087
  );
9072
9088
  held.sort(
9073
9089
  (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 +11401,6 @@ function rewriteQemuArgs(args, network, ncPath = "/usr/bin/nc", hostContext = {}
11385
11401
  return output;
11386
11402
  }
11387
11403
 
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
11404
  // src/vm/host-state.ts
11405
11405
  import { access, chmod as chmod2, lstat, mkdir as mkdir2, readFile as readFile2, rename, rm as rm2, writeFile as writeFile2 } from "fs/promises";
11406
11406
  import { homedir, uptime } from "os";