@ycodium-ai/plugin-api 0.2.5557 → 0.2.5751
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -65
- package/dist/_private/ycodium-attachment-kinds/chatAttachmentKinds.d.ts +34 -0
- package/dist/_private/ycodium-attachment-kinds/chatAttachmentKinds.js +70 -0
- package/dist/_private/ycodium-attachment-kinds/mediaKinds.d.ts +23 -0
- package/dist/_private/ycodium-attachment-kinds/mediaKinds.js +73 -0
- package/dist/_private/ycodium-composer-tokens/approvalFileChanges.d.ts +20 -0
- package/dist/_private/ycodium-composer-tokens/approvalFileChanges.js +45 -0
- package/dist/_private/ycodium-composer-tokens/composerFileLink.d.ts +1 -0
- package/dist/_private/ycodium-composer-tokens/composerFileLink.js +20 -0
- package/dist/_private/ycodium-composer-tokens/composerInlineTokens.d.ts +17 -0
- package/dist/_private/ycodium-composer-tokens/composerInlineTokens.js +91 -0
- package/dist/_private/ycodium-composer-tokens/composerLogic.d.ts +30 -0
- package/dist/_private/ycodium-composer-tokens/composerLogic.js +181 -0
- package/dist/_private/ycodium-composer-tokens/composerMentionDrag.d.ts +40 -0
- package/dist/_private/ycodium-composer-tokens/composerMentionDrag.js +60 -0
- package/dist/_private/ycodium-composer-tokens/composerPromptSegments.d.ts +16 -0
- package/dist/_private/ycodium-composer-tokens/composerPromptSegments.js +142 -0
- package/dist/_private/ycodium-composer-tokens/composerTrigger.d.ts +18 -0
- package/dist/_private/ycodium-composer-tokens/composerTrigger.js +44 -0
- package/dist/_private/ycodium-composer-tokens/contextWindowFormat.d.ts +2 -0
- package/dist/_private/ycodium-composer-tokens/contextWindowFormat.js +16 -0
- package/dist/_private/ycodium-composer-tokens/diffCount.d.ts +2 -0
- package/dist/_private/ycodium-composer-tokens/diffCount.js +15 -0
- package/dist/_private/ycodium-composer-tokens/pendingUserInput.d.ts +48 -0
- package/dist/_private/ycodium-composer-tokens/pendingUserInput.js +145 -0
- package/dist/_private/ycodium-composer-tokens/promptContextBlocks.d.ts +58 -0
- package/dist/_private/ycodium-composer-tokens/promptContextBlocks.js +121 -0
- package/dist/_private/ycodium-composer-tokens/proposedPlan.d.ts +21 -0
- package/dist/_private/ycodium-composer-tokens/proposedPlan.js +106 -0
- package/dist/_private/ycodium-composer-tokens/providerSkillSearch.d.ts +3 -0
- package/dist/_private/ycodium-composer-tokens/providerSkillSearch.js +79 -0
- package/dist/_private/ycodium-composer-tokens/providerSkills.d.ts +17 -0
- package/dist/_private/ycodium-composer-tokens/providerSkills.js +57 -0
- package/dist/_private/ycodium-composer-tokens/queueEntry.d.ts +31 -0
- package/dist/_private/ycodium-composer-tokens/queueEntry.js +44 -0
- package/dist/_private/ycodium-composer-tokens/reviewCommentBlocks.d.ts +29 -0
- package/dist/_private/ycodium-composer-tokens/reviewCommentBlocks.js +118 -0
- package/dist/_private/ycodium-composer-tokens/searchRanking.d.ts +27 -0
- package/dist/_private/ycodium-composer-tokens/searchRanking.js +129 -0
- package/dist/_private/ycodium-composer-tokens/skillTokens.d.ts +101 -0
- package/dist/_private/ycodium-composer-tokens/skillTokens.js +148 -0
- package/dist/_private/ycodium-composer-tokens/slashMenu.d.ts +130 -0
- package/dist/_private/ycodium-composer-tokens/slashMenu.js +175 -0
- package/dist/_private/ycodium-composer-tokens/userInputOptionText.d.ts +33 -0
- package/dist/_private/ycodium-composer-tokens/userInputOptionText.js +27 -0
- package/dist/_private/ycodium-credential-account/credentialAccount.d.ts +21 -0
- package/dist/_private/ycodium-credential-account/credentialAccount.js +62 -0
- package/dist/_private/ycodium-credential-account/quotaJson.d.ts +12 -0
- package/dist/_private/ycodium-credential-account/quotaJson.js +14 -0
- package/dist/_private/ycodium-credential-account/quotaRequest.d.ts +32 -0
- package/dist/_private/ycodium-credential-account/quotaRequest.js +60 -0
- package/dist/_private/ycodium-day-format/dayFormat.d.ts +31 -0
- package/dist/_private/ycodium-day-format/dayFormat.js +32 -0
- package/dist/_private/ycodium-day-format/timestampFormat.d.ts +35 -0
- package/dist/_private/ycodium-day-format/timestampFormat.js +119 -0
- package/dist/_private/ycodium-decision-order/decisionOrder.d.ts +19 -0
- package/dist/_private/ycodium-decision-order/decisionOrder.js +38 -0
- package/dist/_private/ycodium-diff-format/diffRendering.d.ts +42 -0
- package/dist/_private/ycodium-diff-format/diffRendering.js +171 -0
- package/dist/_private/ycodium-duration-format/durationFormat.d.ts +20 -0
- package/dist/_private/ycodium-duration-format/durationFormat.js +56 -0
- package/dist/_private/ycodium-fetch-ports/fetchPorts.d.ts +36 -0
- package/dist/_private/ycodium-fetch-ports/fetchPorts.js +69 -0
- package/dist/_private/ycodium-fetch-ports/netFault.d.ts +10 -0
- package/dist/_private/ycodium-fetch-ports/netFault.js +17 -0
- package/dist/_private/ycodium-full-access-mode/fullAccessNativeMode.d.ts +28 -0
- package/dist/_private/ycodium-full-access-mode/fullAccessNativeMode.js +30 -0
- package/dist/_private/ycodium-instance-config/homePath.d.ts +34 -0
- package/dist/_private/ycodium-instance-config/homePath.js +85 -0
- package/dist/_private/ycodium-instance-config/instanceConfig.d.ts +46 -0
- package/dist/_private/ycodium-instance-config/instanceConfig.js +111 -0
- package/dist/_private/ycodium-instance-config/launchArgs.d.ts +5 -0
- package/dist/_private/ycodium-instance-config/launchArgs.js +65 -0
- package/dist/_private/ycodium-instance-config/probeProcess.d.ts +39 -0
- package/dist/_private/ycodium-instance-config/probeProcess.js +55 -0
- package/dist/_private/ycodium-instance-config/programHomeSchema.d.ts +44 -0
- package/dist/_private/ycodium-instance-config/programHomeSchema.js +60 -0
- package/dist/_private/ycodium-instance-config/tomlScalar.d.ts +5 -0
- package/dist/_private/ycodium-instance-config/tomlScalar.js +11 -0
- package/dist/_private/ycodium-jsonl-stream/appendedJsonl.d.ts +47 -0
- package/dist/_private/ycodium-jsonl-stream/appendedJsonl.js +172 -0
- package/dist/_private/ycodium-jsonl-stream/claudeSessions.d.ts +63 -0
- package/dist/_private/ycodium-jsonl-stream/claudeSessions.js +220 -0
- package/dist/_private/ycodium-jsonl-stream/codexSessions.d.ts +41 -0
- package/dist/_private/ycodium-jsonl-stream/codexSessions.js +197 -0
- package/dist/_private/ycodium-jsonl-stream/history.d.ts +6 -0
- package/dist/_private/ycodium-jsonl-stream/history.js +389 -0
- package/dist/_private/ycodium-jsonl-stream/historyErrors.d.ts +6 -0
- package/dist/_private/ycodium-jsonl-stream/historyErrors.js +6 -0
- package/dist/_private/ycodium-jsonl-stream/historyFile.d.ts +19 -0
- package/dist/_private/ycodium-jsonl-stream/historyFile.js +117 -0
- package/dist/_private/ycodium-jsonl-stream/historyRecord.d.ts +31 -0
- package/dist/_private/ycodium-jsonl-stream/historyRecord.js +144 -0
- package/dist/_private/ycodium-jsonl-stream/historyWaiting.d.ts +8 -0
- package/dist/_private/ycodium-jsonl-stream/historyWaiting.js +142 -0
- package/dist/_private/ycodium-jsonl-stream/jsonObjectLine.d.ts +5 -0
- package/dist/_private/ycodium-jsonl-stream/jsonObjectLine.js +18 -0
- package/dist/_private/ycodium-jsonl-stream/jsonlStream.d.ts +79 -0
- package/dist/_private/ycodium-jsonl-stream/jsonlStream.js +603 -0
- package/dist/_private/ycodium-jsonl-stream/scanCache.d.ts +69 -0
- package/dist/_private/ycodium-jsonl-stream/scanCache.js +106 -0
- package/dist/_private/ycodium-jsonl-stream/sessionDirectory.d.ts +5 -0
- package/dist/_private/ycodium-jsonl-stream/sessionDirectory.js +32 -0
- package/dist/_private/ycodium-jsonl-stream/sessionTranscript.d.ts +16 -0
- package/dist/_private/ycodium-jsonl-stream/sessionTranscript.js +112 -0
- package/dist/_private/ycodium-jsonl-stream/usageFields.d.ts +5 -0
- package/dist/_private/ycodium-jsonl-stream/usageFields.js +11 -0
- package/dist/_private/ycodium-markdown-fence/markdownFence.d.ts +6 -0
- package/dist/_private/ycodium-markdown-fence/markdownFence.js +24 -0
- package/dist/_private/ycodium-source-control/pullRequestScope.d.ts +23 -0
- package/dist/_private/ycodium-source-control/pullRequestScope.js +29 -0
- package/dist/_private/ycodium-sse-stream/sseStream.d.ts +37 -0
- package/dist/_private/ycodium-sse-stream/sseStream.js +104 -0
- package/dist/_private/ycodium-system-text/memberInstructions.d.ts +13 -0
- package/dist/_private/ycodium-system-text/memberInstructions.js +9 -0
- package/dist/_private/ycodium-system-text/systemText.d.ts +179 -0
- package/dist/_private/ycodium-system-text/systemText.js +257 -0
- package/dist/_private/ycodium-system-text/threadPreset.d.ts +18 -0
- package/dist/_private/ycodium-system-text/threadPreset.js +21 -0
- package/dist/_private/ycodium-text-generation/branchName.d.ts +6 -0
- package/dist/_private/ycodium-text-generation/branchName.js +26 -0
- package/dist/_private/ycodium-text-generation/prompts.d.ts +70 -0
- package/dist/_private/ycodium-text-generation/prompts.js +266 -0
- package/dist/_private/ycodium-text-generation/sanitize.d.ts +10 -0
- package/dist/_private/ycodium-text-generation/sanitize.js +124 -0
- package/dist/_private/ycodium-text-generation/structuredTextGeneration.d.ts +29 -0
- package/dist/_private/ycodium-text-generation/structuredTextGeneration.js +163 -0
- package/dist/_private/ycodium-tool-label/toolLabel.d.ts +42 -0
- package/dist/_private/ycodium-tool-label/toolLabel.js +249 -0
- package/dist/_private/ycodium-ui-hooks/DiffStatCounts.d.ts +22 -0
- package/dist/_private/ycodium-ui-hooks/DiffStatCounts.js +22 -0
- package/dist/_private/ycodium-ui-hooks/ProviderSignInChallenge.d.ts +29 -0
- package/dist/_private/ycodium-ui-hooks/ProviderSignInChallenge.js +13 -0
- package/dist/_private/ycodium-ui-hooks/RenderErrorBoundary.d.ts +28 -0
- package/dist/_private/ycodium-ui-hooks/RenderErrorBoundary.js +22 -0
- package/dist/_private/ycodium-ui-hooks/RuntimeMaintenanceActions.d.ts +19 -0
- package/dist/_private/ycodium-ui-hooks/RuntimeMaintenanceActions.js +7 -0
- package/dist/_private/ycodium-ui-hooks/SkillInlineText.d.ts +13 -0
- package/dist/_private/ycodium-ui-hooks/SkillInlineText.js +13 -0
- package/dist/_private/ycodium-ui-hooks/bundleStyle.d.ts +4 -0
- package/dist/_private/ycodium-ui-hooks/bundleStyle.js +52 -0
- package/dist/_private/ycodium-ui-hooks/catalogKeys.d.ts +9 -0
- package/dist/_private/ycodium-ui-hooks/catalogKeys.js +1 -0
- package/dist/_private/ycodium-ui-hooks/clipboard.d.ts +22 -0
- package/dist/_private/ycodium-ui-hooks/clipboard.js +149 -0
- package/dist/_private/ycodium-ui-hooks/hostControls.d.ts +24 -0
- package/dist/_private/ycodium-ui-hooks/hostControls.js +25 -0
- package/dist/_private/ycodium-ui-hooks/inlineChips.d.ts +50 -0
- package/dist/_private/ycodium-ui-hooks/inlineChips.js +32 -0
- package/dist/_private/ycodium-ui-hooks/notifyMessages.d.ts +20 -0
- package/dist/_private/ycodium-ui-hooks/notifyMessages.js +26 -0
- package/dist/_private/ycodium-ui-hooks/presenterInputState.d.ts +52 -0
- package/dist/_private/ycodium-ui-hooks/presenterInputState.js +240 -0
- package/dist/_private/ycodium-ui-hooks/processRowHeader.d.ts +6 -0
- package/dist/_private/ycodium-ui-hooks/processRowHeader.js +6 -0
- package/dist/_private/ycodium-ui-hooks/timelineDisclosure.d.ts +5 -0
- package/dist/_private/ycodium-ui-hooks/timelineDisclosure.js +73 -0
- package/dist/_private/ycodium-ui-hooks/useMediaQuery.d.ts +20 -0
- package/dist/_private/ycodium-ui-hooks/useMediaQuery.js +70 -0
- package/dist/_private/ycodium-ui-hooks/workEntryIcons.d.ts +25 -0
- package/dist/_private/ycodium-ui-hooks/workEntryIcons.js +66 -0
- package/dist/_private/ycodium-workspace-path/directoryScope.d.ts +5 -0
- package/dist/_private/ycodium-workspace-path/directoryScope.js +28 -0
- package/dist/_private/ycodium-workspace-path/workspacePath.d.ts +19 -0
- package/dist/_private/ycodium-workspace-path/workspacePath.js +90 -0
- package/dist/cache.d.ts.map +1 -1
- package/dist/cache.js.map +1 -1
- package/dist/capabilityPorts.d.ts.map +1 -1
- package/dist/capabilityPorts.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js.map +1 -1
- package/dist/communication-view.d.ts.map +1 -1
- package/dist/communication-view.js.map +1 -1
- package/dist/communication.d.ts.map +1 -1
- package/dist/communication.js.map +1 -1
- package/dist/composer-control.d.ts.map +1 -1
- package/dist/composer-control.js.map +1 -1
- package/dist/composer.d.ts +22 -0
- package/dist/composer.d.ts.map +1 -0
- package/dist/composer.js +22 -0
- package/dist/composer.js.map +1 -0
- package/dist/conversation-queue.d.ts.map +1 -1
- package/dist/conversation-queue.js.map +1 -1
- package/dist/conversation-view.d.ts.map +1 -1
- package/dist/conversation-view.js.map +1 -1
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js.map +1 -1
- package/dist/conversationAttachments.d.ts.map +1 -1
- package/dist/conversationAttachments.js.map +1 -1
- package/dist/conversationBase.d.ts.map +1 -1
- package/dist/conversationBase.js.map +1 -1
- package/dist/conversationComposerApi.d.ts.map +1 -1
- package/dist/conversationComposerApi.js.map +1 -1
- package/dist/conversationComposerEnvironment.d.ts.map +1 -1
- package/dist/conversationComposerEnvironment.js.map +1 -1
- package/dist/conversationComposerHandle.d.ts.map +1 -1
- package/dist/conversationComposerHandle.js.map +1 -1
- package/dist/conversationComposerParts.d.ts.map +1 -1
- package/dist/conversationComposerParts.js.map +1 -1
- package/dist/conversationDerive.d.ts.map +1 -1
- package/dist/conversationDerive.js.map +1 -1
- package/dist/conversationDrafts.d.ts.map +1 -1
- package/dist/conversationDrafts.js.map +1 -1
- package/dist/conversationForks.d.ts.map +1 -1
- package/dist/conversationForks.js.map +1 -1
- package/dist/conversationHostModels.d.ts.map +1 -1
- package/dist/conversationHostModels.js.map +1 -1
- package/dist/conversationLoadFailure.d.ts.map +1 -1
- package/dist/conversationLoadFailure.js.map +1 -1
- package/dist/conversationMemberMentions.d.ts.map +1 -1
- package/dist/conversationMemberMentions.js.map +1 -1
- package/dist/conversationMessageLinks.d.ts.map +1 -1
- package/dist/conversationMessageLinks.js.map +1 -1
- package/dist/conversationMessageMemory.d.ts.map +1 -1
- package/dist/conversationMessageMemory.js.map +1 -1
- package/dist/conversationPresets.d.ts.map +1 -1
- package/dist/conversationPresets.js.map +1 -1
- package/dist/conversationRows.d.ts.map +1 -1
- package/dist/conversationRows.js.map +1 -1
- package/dist/conversationSessionMessage.d.ts.map +1 -1
- package/dist/conversationSessionMessage.js.map +1 -1
- package/dist/conversationSkills.d.ts.map +1 -1
- package/dist/conversationSkills.js.map +1 -1
- package/dist/conversationTrajectory.d.ts.map +1 -1
- package/dist/conversationTrajectory.js.map +1 -1
- package/dist/conversationTranscript.d.ts.map +1 -1
- package/dist/conversationTranscript.js.map +1 -1
- package/dist/conversationTurnSummaries.d.ts.map +1 -1
- package/dist/conversationTurnSummaries.js.map +1 -1
- package/dist/conversationViewProps.d.ts.map +1 -1
- package/dist/conversationViewProps.js.map +1 -1
- package/dist/conversationWorkEntry.d.ts.map +1 -1
- package/dist/conversationWorkEntry.js.map +1 -1
- package/dist/credential-account.d.ts +4 -0
- package/dist/credential-account.d.ts.map +1 -0
- package/dist/credential-account.js +4 -0
- package/dist/credential-account.js.map +1 -0
- package/dist/dataPorts.gen.d.ts +312 -2
- package/dist/dataPorts.gen.d.ts.map +1 -1
- package/dist/dataPorts.gen.js.map +1 -1
- package/dist/decision-card.d.ts.map +1 -1
- package/dist/decision-card.js.map +1 -1
- package/dist/decisions.d.ts.map +1 -1
- package/dist/decisions.js.map +1 -1
- package/dist/definition.d.ts.map +1 -1
- package/dist/definition.js.map +1 -1
- package/dist/derivedState.d.ts.map +1 -1
- package/dist/derivedState.js.map +1 -1
- package/dist/diagnosticData.d.ts.map +1 -1
- package/dist/diagnosticData.js.map +1 -1
- package/dist/diff-rendering.d.ts +2 -0
- package/dist/diff-rendering.d.ts.map +1 -0
- package/dist/diff-rendering.js +2 -0
- package/dist/diff-rendering.js.map +1 -0
- package/dist/display-format.d.ts +5 -0
- package/dist/display-format.d.ts.map +1 -0
- package/dist/display-format.js +5 -0
- package/dist/display-format.js.map +1 -0
- package/dist/entity-names.d.ts.map +1 -1
- package/dist/entity-names.js.map +1 -1
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js.map +1 -1
- package/dist/executor-mode.d.ts +2 -0
- package/dist/executor-mode.d.ts.map +1 -0
- package/dist/executor-mode.js +2 -0
- package/dist/executor-mode.js.map +1 -0
- package/dist/executor.d.ts +33 -1
- package/dist/executor.d.ts.map +1 -1
- package/dist/executor.js.map +1 -1
- package/dist/executorCapabilities.d.ts.map +1 -1
- package/dist/executorCapabilities.js.map +1 -1
- package/dist/executorCard.d.ts +6 -0
- package/dist/executorCard.d.ts.map +1 -1
- package/dist/executorCard.js.map +1 -1
- package/dist/executorCommandArgv.d.ts.map +1 -1
- package/dist/executorCommandArgv.js.map +1 -1
- package/dist/executorEffective.d.ts.map +1 -1
- package/dist/executorEffective.js.map +1 -1
- package/dist/executorErrors.d.ts.map +1 -1
- package/dist/executorErrors.js.map +1 -1
- package/dist/executorEvents.d.ts.map +1 -1
- package/dist/executorEvents.js.map +1 -1
- package/dist/executorModelOptions.d.ts.map +1 -1
- package/dist/executorModelOptions.js.map +1 -1
- package/dist/executorProcesses.d.ts.map +1 -1
- package/dist/executorProcesses.js.map +1 -1
- package/dist/executorSession.d.ts +8 -2
- package/dist/executorSession.d.ts.map +1 -1
- package/dist/executorSession.js.map +1 -1
- package/dist/executorSpawn.d.ts +5 -4
- package/dist/executorSpawn.d.ts.map +1 -1
- package/dist/executorSpawn.js +20 -7
- package/dist/executorSpawn.js.map +1 -1
- package/dist/fetch-ports.d.ts +2 -0
- package/dist/fetch-ports.d.ts.map +1 -0
- package/dist/fetch-ports.js +2 -0
- package/dist/fetch-ports.js.map +1 -0
- package/dist/file-preview.d.ts.map +1 -1
- package/dist/file-preview.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/inline-tag.d.ts.map +1 -1
- package/dist/inline-tag.js.map +1 -1
- package/dist/instance-config.d.ts +7 -0
- package/dist/instance-config.d.ts.map +1 -0
- package/dist/instance-config.js +7 -0
- package/dist/instance-config.js.map +1 -0
- package/dist/interval.d.ts.map +1 -1
- package/dist/interval.js.map +1 -1
- package/dist/jsonl.d.ts +6 -0
- package/dist/jsonl.d.ts.map +1 -0
- package/dist/jsonl.js +6 -0
- package/dist/jsonl.js.map +1 -0
- package/dist/keyedSubscribers.d.ts.map +1 -1
- package/dist/keyedSubscribers.js.map +1 -1
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js.map +1 -1
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js.map +1 -1
- package/dist/model-picker.d.ts +1 -1
- package/dist/model-picker.d.ts.map +1 -1
- package/dist/model-picker.js.map +1 -1
- package/dist/modelCatalogNotice.d.ts.map +1 -1
- package/dist/modelCatalogNotice.js.map +1 -1
- package/dist/modelChoice.d.ts +1 -1
- package/dist/modelChoice.d.ts.map +1 -1
- package/dist/modelChoice.js.map +1 -1
- package/dist/modelChoiceOptions.d.ts.map +1 -1
- package/dist/modelChoiceOptions.js.map +1 -1
- package/dist/modelChoiceTraits.d.ts.map +1 -1
- package/dist/modelChoiceTraits.js.map +1 -1
- package/dist/modelDisplayName.d.ts.map +1 -1
- package/dist/modelDisplayName.js.map +1 -1
- package/dist/pending-requests.d.ts.map +1 -1
- package/dist/pending-requests.js.map +1 -1
- package/dist/plugin-tools.d.ts.map +1 -1
- package/dist/plugin-tools.js.map +1 -1
- package/dist/pluginContextCommands.d.ts.map +1 -1
- package/dist/pluginContextCommands.js.map +1 -1
- package/dist/pluginContextProviders.d.ts.map +1 -1
- package/dist/pluginContextProviders.js.map +1 -1
- package/dist/pluginContextThreads.d.ts.map +1 -1
- package/dist/pluginContextThreads.js.map +1 -1
- package/dist/pluginContextWorkspace.d.ts.map +1 -1
- package/dist/pluginContextWorkspace.js.map +1 -1
- package/dist/process-operation.d.ts.map +1 -1
- package/dist/process-operation.js.map +1 -1
- package/dist/process-socket.d.ts.map +1 -1
- package/dist/process-socket.js.map +1 -1
- package/dist/process-stdin.d.ts.map +1 -1
- package/dist/process-stdin.js.map +1 -1
- package/dist/projects.d.ts.map +1 -1
- package/dist/projects.js.map +1 -1
- package/dist/provider-settings.d.ts +44 -0
- package/dist/provider-settings.d.ts.map +1 -1
- package/dist/provider-settings.js +10 -2
- package/dist/provider-settings.js.map +1 -1
- package/dist/providerInstanceSelection.d.ts.map +1 -1
- package/dist/providerInstanceSelection.js.map +1 -1
- package/dist/reasoningLevelFallback.d.ts.map +1 -1
- package/dist/reasoningLevelFallback.js.map +1 -1
- package/dist/runtime-maintenance.d.ts +50 -0
- package/dist/runtime-maintenance.d.ts.map +1 -0
- package/dist/runtime-maintenance.js +246 -0
- package/dist/runtime-maintenance.js.map +1 -0
- package/dist/runtimes.d.ts.map +1 -1
- package/dist/runtimes.js.map +1 -1
- package/dist/selectAllCopy.d.ts.map +1 -1
- package/dist/selectAllCopy.js.map +1 -1
- package/dist/session-history.d.ts +6 -0
- package/dist/session-history.d.ts.map +1 -0
- package/dist/session-history.js +6 -0
- package/dist/session-history.js.map +1 -0
- package/dist/settings-actions.d.ts.map +1 -1
- package/dist/settings-actions.js.map +1 -1
- package/dist/settings-card-shape.d.ts.map +1 -1
- package/dist/settings-card-shape.js.map +1 -1
- package/dist/settings-card.d.ts.map +1 -1
- package/dist/settings-card.js.map +1 -1
- package/dist/settings-ui.d.ts.map +1 -1
- package/dist/settings-ui.js.map +1 -1
- package/dist/sign-in.d.ts.map +1 -1
- package/dist/sign-in.js.map +1 -1
- package/dist/slashCommands.d.ts.map +1 -1
- package/dist/slashCommands.js.map +1 -1
- package/dist/slots.d.ts.map +1 -1
- package/dist/slots.js.map +1 -1
- package/dist/source/_private/ycodium-attachment-kinds/chatAttachmentKinds.ts +105 -0
- package/dist/source/_private/ycodium-attachment-kinds/mediaKinds.ts +83 -0
- package/dist/source/_private/ycodium-composer-tokens/approvalFileChanges.ts +58 -0
- package/dist/source/_private/ycodium-composer-tokens/composerFileLink.ts +23 -0
- package/dist/source/_private/ycodium-composer-tokens/composerInlineTokens.ts +130 -0
- package/dist/source/_private/ycodium-composer-tokens/composerLogic.ts +251 -0
- package/dist/source/_private/ycodium-composer-tokens/composerMentionDrag.ts +98 -0
- package/dist/source/_private/ycodium-composer-tokens/composerPromptSegments.ts +222 -0
- package/dist/source/_private/ycodium-composer-tokens/composerTrigger.ts +64 -0
- package/dist/source/_private/ycodium-composer-tokens/contextWindowFormat.ts +16 -0
- package/dist/source/_private/ycodium-composer-tokens/diffCount.ts +14 -0
- package/dist/source/_private/ycodium-composer-tokens/pendingUserInput.ts +256 -0
- package/dist/source/_private/ycodium-composer-tokens/promptContextBlocks.ts +179 -0
- package/dist/source/_private/ycodium-composer-tokens/proposedPlan.ts +134 -0
- package/dist/source/_private/ycodium-composer-tokens/providerSkillSearch.ts +105 -0
- package/dist/source/_private/ycodium-composer-tokens/providerSkills.ts +86 -0
- package/dist/source/_private/ycodium-composer-tokens/queueEntry.ts +49 -0
- package/dist/source/_private/ycodium-composer-tokens/reviewCommentBlocks.ts +177 -0
- package/dist/source/_private/ycodium-composer-tokens/searchRanking.ts +192 -0
- package/dist/source/_private/ycodium-composer-tokens/skillTokens.ts +192 -0
- package/dist/source/_private/ycodium-composer-tokens/slashMenu.ts +293 -0
- package/dist/source/_private/ycodium-composer-tokens/userInputOptionText.ts +51 -0
- package/dist/source/_private/ycodium-credential-account/credentialAccount.ts +83 -0
- package/dist/source/_private/ycodium-credential-account/quotaJson.ts +25 -0
- package/dist/source/_private/ycodium-credential-account/quotaRequest.ts +79 -0
- package/dist/source/_private/ycodium-day-format/dayFormat.ts +57 -0
- package/dist/source/_private/ycodium-day-format/timestampFormat.ts +165 -0
- package/dist/source/_private/ycodium-decision-order/decisionOrder.ts +54 -0
- package/dist/source/_private/ycodium-diff-format/diffRendering.ts +229 -0
- package/dist/source/_private/ycodium-duration-format/durationFormat.ts +60 -0
- package/dist/source/_private/ycodium-executor-common/catalogModel.ts +40 -0
- package/dist/source/_private/ycodium-executor-common/eventTypes.ts +97 -0
- package/dist/source/_private/ycodium-executor-common/modelSelection.ts +24 -0
- package/dist/source/_private/ycodium-executor-common/nodeStreams.ts +212 -0
- package/dist/source/_private/ycodium-executor-common/raceAbort.ts +25 -0
- package/dist/source/_private/ycodium-executor-common/reasoningLevelFallback.ts +28 -0
- package/dist/source/_private/ycodium-executor-common/stderrTail.ts +27 -0
- package/dist/source/_private/ycodium-executor-common/toolPresentation.ts +268 -0
- package/dist/source/_private/ycodium-fetch-ports/fetchPorts.ts +84 -0
- package/dist/source/_private/ycodium-fetch-ports/netFault.ts +30 -0
- package/dist/source/_private/ycodium-full-access-mode/fullAccessNativeMode.ts +32 -0
- package/dist/source/_private/ycodium-instance-config/homePath.ts +140 -0
- package/dist/source/_private/ycodium-instance-config/instanceConfig.ts +149 -0
- package/dist/source/_private/ycodium-instance-config/launchArgs.ts +60 -0
- package/dist/source/_private/ycodium-instance-config/probeProcess.ts +89 -0
- package/dist/source/_private/ycodium-instance-config/programHomeSchema.ts +74 -0
- package/dist/source/_private/ycodium-instance-config/tomlScalar.ts +10 -0
- package/dist/source/_private/ycodium-jsonl-stream/appendedJsonl.ts +222 -0
- package/dist/source/_private/ycodium-jsonl-stream/claudeSessions.ts +263 -0
- package/dist/source/_private/ycodium-jsonl-stream/codexSessions.ts +254 -0
- package/dist/source/_private/ycodium-jsonl-stream/history.ts +492 -0
- package/dist/source/_private/ycodium-jsonl-stream/historyErrors.ts +6 -0
- package/dist/source/_private/ycodium-jsonl-stream/historyFile.ts +139 -0
- package/dist/source/_private/ycodium-jsonl-stream/historyRecord.ts +180 -0
- package/dist/source/_private/ycodium-jsonl-stream/historyWaiting.ts +140 -0
- package/dist/source/_private/ycodium-jsonl-stream/jsonObjectLine.ts +15 -0
- package/dist/source/_private/ycodium-jsonl-stream/jsonlStream.ts +650 -0
- package/dist/source/_private/ycodium-jsonl-stream/scanCache.ts +163 -0
- package/dist/source/_private/ycodium-jsonl-stream/sessionDirectory.ts +39 -0
- package/dist/source/_private/ycodium-jsonl-stream/sessionTranscript.ts +136 -0
- package/dist/source/_private/ycodium-jsonl-stream/usageFields.ts +13 -0
- package/dist/source/_private/ycodium-markdown-fence/markdownFence.ts +28 -0
- package/dist/source/_private/ycodium-source-control/pullRequestScope.ts +35 -0
- package/dist/source/_private/ycodium-sse-stream/sseStream.ts +118 -0
- package/dist/source/_private/ycodium-system-text/memberInstructions.ts +24 -0
- package/dist/source/_private/ycodium-system-text/systemText.ts +356 -0
- package/dist/source/_private/ycodium-system-text/threadPreset.ts +35 -0
- package/dist/source/_private/ycodium-text-generation/branchName.ts +29 -0
- package/dist/source/_private/ycodium-text-generation/prompts.ts +342 -0
- package/dist/source/_private/ycodium-text-generation/sanitize.ts +125 -0
- package/dist/source/_private/ycodium-text-generation/structuredTextGeneration.ts +237 -0
- package/dist/source/_private/ycodium-tool-label/toolLabel.ts +287 -0
- package/dist/source/_private/ycodium-ui-hooks/DiffStatCounts.tsx +76 -0
- package/dist/source/_private/ycodium-ui-hooks/ProviderSignInChallenge.tsx +115 -0
- package/dist/source/_private/ycodium-ui-hooks/RenderErrorBoundary.tsx +34 -0
- package/dist/source/_private/ycodium-ui-hooks/RuntimeMaintenanceActions.tsx +63 -0
- package/dist/source/_private/ycodium-ui-hooks/SkillInlineText.tsx +28 -0
- package/dist/source/_private/ycodium-ui-hooks/bundleStyle.ts +52 -0
- package/dist/source/_private/ycodium-ui-hooks/catalogKeys.ts +11 -0
- package/dist/source/_private/ycodium-ui-hooks/clipboard.ts +176 -0
- package/dist/source/_private/ycodium-ui-hooks/hostControls.ts +43 -0
- package/dist/source/_private/ycodium-ui-hooks/inlineChips.tsx +114 -0
- package/dist/source/_private/ycodium-ui-hooks/notifyMessages.ts +36 -0
- package/dist/source/_private/ycodium-ui-hooks/presenterInputState.ts +341 -0
- package/dist/source/_private/ycodium-ui-hooks/processRowHeader.ts +7 -0
- package/dist/source/_private/ycodium-ui-hooks/timelineDisclosure.ts +98 -0
- package/dist/source/_private/ycodium-ui-hooks/useMediaQuery.ts +87 -0
- package/dist/source/_private/ycodium-ui-hooks/workEntryIcons.ts +99 -0
- package/dist/source/_private/ycodium-workspace-path/directoryScope.ts +34 -0
- package/dist/source/_private/ycodium-workspace-path/workspacePath.ts +110 -0
- package/dist/source/cache.ts +55 -0
- package/dist/source/capabilityPorts.ts +272 -0
- package/dist/source/cli.ts +69 -0
- package/dist/source/commands.ts +208 -0
- package/dist/source/communication-view.ts +107 -0
- package/dist/source/communication.ts +26 -0
- package/dist/source/composer-control.ts +16 -0
- package/dist/source/composer.ts +108 -0
- package/dist/source/conversation-queue.ts +165 -0
- package/dist/source/conversation-view.ts +49 -0
- package/dist/source/conversation.ts +700 -0
- package/dist/source/conversationAttachments.ts +139 -0
- package/dist/source/conversationBase.ts +128 -0
- package/dist/source/conversationComposerApi.ts +339 -0
- package/dist/source/conversationComposerEnvironment.ts +76 -0
- package/dist/source/conversationComposerHandle.ts +89 -0
- package/dist/source/conversationComposerParts.ts +10 -0
- package/dist/source/conversationDerive.ts +252 -0
- package/dist/source/conversationDrafts.ts +281 -0
- package/dist/source/conversationForks.ts +40 -0
- package/dist/source/conversationHostModels.ts +467 -0
- package/dist/source/conversationLoadFailure.ts +9 -0
- package/dist/source/conversationMemberMentions.ts +63 -0
- package/dist/source/conversationMessageLinks.ts +153 -0
- package/dist/source/conversationMessageMemory.ts +45 -0
- package/dist/source/conversationPresets.ts +15 -0
- package/dist/source/conversationRows.ts +132 -0
- package/dist/source/conversationSessionMessage.ts +18 -0
- package/dist/source/conversationSkills.ts +26 -0
- package/dist/source/conversationTrajectory.ts +116 -0
- package/dist/source/conversationTranscript.ts +33 -0
- package/dist/source/conversationTurnSummaries.ts +57 -0
- package/dist/source/conversationViewProps.ts +486 -0
- package/dist/source/conversationWorkEntry.ts +104 -0
- package/dist/source/credential-account.ts +18 -0
- package/dist/source/dataPorts.gen.ts +2207 -0
- package/dist/source/decision-card.ts +87 -0
- package/dist/source/decisions.ts +43 -0
- package/dist/source/definition.ts +28 -0
- package/dist/source/derivedState.ts +55 -0
- package/dist/source/diagnosticData.ts +238 -0
- package/dist/source/diff-rendering.ts +6 -0
- package/dist/source/display-format.ts +14 -0
- package/dist/source/entity-names.ts +73 -0
- package/dist/source/events.ts +326 -0
- package/dist/source/executor-mode.ts +1 -0
- package/dist/source/executor.ts +623 -0
- package/dist/source/executorCapabilities.ts +89 -0
- package/dist/source/executorCard.ts +426 -0
- package/dist/source/executorCommandArgv.ts +114 -0
- package/dist/source/executorEffective.ts +99 -0
- package/dist/source/executorErrors.ts +73 -0
- package/dist/source/executorEvents.ts +258 -0
- package/dist/source/executorModelOptions.ts +179 -0
- package/dist/source/executorProcesses.ts +43 -0
- package/dist/source/executorSession.ts +508 -0
- package/dist/source/executorSpawn.ts +141 -0
- package/dist/source/fetch-ports.ts +1 -0
- package/dist/source/file-preview.ts +32 -0
- package/dist/source/index.ts +416 -0
- package/dist/source/inline-tag.ts +27 -0
- package/dist/source/instance-config.ts +31 -0
- package/dist/source/interval.ts +32 -0
- package/dist/source/jsonl.ts +21 -0
- package/dist/source/keyedSubscribers.ts +55 -0
- package/dist/source/logger.ts +16 -0
- package/dist/source/messages.ts +27 -0
- package/dist/source/model-picker.ts +82 -0
- package/dist/source/modelCatalogNotice.ts +34 -0
- package/dist/source/modelChoice.ts +371 -0
- package/dist/source/modelChoiceOptions.ts +309 -0
- package/dist/source/modelChoiceTraits.ts +133 -0
- package/dist/source/modelDisplayName.ts +42 -0
- package/dist/source/pending-requests.ts +56 -0
- package/dist/source/plugin-tools.ts +181 -0
- package/dist/source/pluginContextCommands.ts +224 -0
- package/dist/source/pluginContextProviders.ts +136 -0
- package/dist/source/pluginContextThreads.ts +83 -0
- package/dist/source/pluginContextWorkspace.ts +74 -0
- package/dist/source/process-operation.ts +291 -0
- package/dist/source/process-socket.ts +371 -0
- package/dist/source/process-stdin.ts +214 -0
- package/dist/source/projects.ts +31 -0
- package/dist/source/provider-settings.ts +343 -0
- package/dist/source/providerInstanceSelection.ts +72 -0
- package/dist/source/reasoningLevelFallback.ts +13 -0
- package/dist/source/runtime-maintenance.ts +307 -0
- package/dist/source/runtimes.ts +14 -0
- package/dist/source/selectAllCopy.ts +12 -0
- package/dist/source/session-history.ts +45 -0
- package/dist/source/settings-actions.ts +91 -0
- package/dist/source/settings-card-shape.ts +229 -0
- package/dist/source/settings-card.ts +311 -0
- package/dist/source/settings-ui.ts +48 -0
- package/dist/source/sign-in.ts +52 -0
- package/dist/source/slashCommands.ts +36 -0
- package/dist/source/slots.ts +243 -0
- package/dist/source/source-control.ts +5 -0
- package/dist/source/sse.ts +1 -0
- package/dist/source/system-text.ts +18 -0
- package/dist/source/teamView.ts +67 -0
- package/dist/source/testing.ts +203 -0
- package/dist/source/text-generation.ts +5 -0
- package/dist/source/threadAnnotation.ts +12 -0
- package/dist/source/threads.ts +77 -0
- package/dist/source/timeline-process.ts +87 -0
- package/dist/source/timeline-row-error.ts +14 -0
- package/dist/source/tool-display.ts +130 -0
- package/dist/source/traits-picker.ts +84 -0
- package/dist/source/ui-bridge-version.ts +64 -0
- package/dist/source/ui-hooks.ts +26 -0
- package/dist/source/ui-i18n.ts +1 -0
- package/dist/source/ui-media-query.ts +1 -0
- package/dist/source/ui-presenter-state.ts +6 -0
- package/dist/source/ui.ts +671 -0
- package/dist/source/uiHostCapabilities.ts +85 -0
- package/dist/source/uiMachineAdmission.ts +21 -0
- package/dist/source/uiSessionProjections.ts +19 -0
- package/dist/source/usage.ts +225 -0
- package/dist/source/version.ts +30 -0
- package/dist/source/workspace-path.ts +2 -0
- package/dist/source-control.d.ts +3 -0
- package/dist/source-control.d.ts.map +1 -0
- package/dist/source-control.js +3 -0
- package/dist/source-control.js.map +1 -0
- package/dist/sse.d.ts +2 -0
- package/dist/sse.d.ts.map +1 -0
- package/dist/sse.js +2 -0
- package/dist/sse.js.map +1 -0
- package/dist/system-text.d.ts +4 -0
- package/dist/system-text.d.ts.map +1 -0
- package/dist/system-text.js +4 -0
- package/dist/system-text.js.map +1 -0
- package/dist/teamView.d.ts.map +1 -1
- package/dist/teamView.js.map +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js.map +1 -1
- package/dist/text-generation.d.ts +3 -0
- package/dist/text-generation.d.ts.map +1 -0
- package/dist/text-generation.js +3 -0
- package/dist/text-generation.js.map +1 -0
- package/dist/threadAnnotation.d.ts.map +1 -1
- package/dist/threadAnnotation.js.map +1 -1
- package/dist/threads.d.ts.map +1 -1
- package/dist/threads.js.map +1 -1
- package/dist/timeline-process.d.ts +32 -0
- package/dist/timeline-process.d.ts.map +1 -1
- package/dist/timeline-process.js.map +1 -1
- package/dist/timeline-row-error.d.ts.map +1 -1
- package/dist/timeline-row-error.js.map +1 -1
- package/dist/tool-display.d.ts.map +1 -1
- package/dist/tool-display.js.map +1 -1
- package/dist/traits-picker.d.ts.map +1 -1
- package/dist/traits-picker.js.map +1 -1
- package/dist/ui-bridge-version.d.ts.map +1 -1
- package/dist/ui-bridge-version.js.map +1 -1
- package/dist/ui-hooks.d.ts +14 -0
- package/dist/ui-hooks.d.ts.map +1 -0
- package/dist/ui-hooks.js +14 -0
- package/dist/ui-hooks.js.map +1 -0
- package/dist/ui-i18n.d.ts +2 -0
- package/dist/ui-i18n.d.ts.map +1 -0
- package/dist/ui-i18n.js +2 -0
- package/dist/ui-i18n.js.map +1 -0
- package/dist/ui-media-query.d.ts +2 -0
- package/dist/ui-media-query.d.ts.map +1 -0
- package/dist/ui-media-query.js +2 -0
- package/dist/ui-media-query.js.map +1 -0
- package/dist/ui-presenter-state.d.ts +2 -0
- package/dist/ui-presenter-state.d.ts.map +1 -0
- package/dist/ui-presenter-state.js +2 -0
- package/dist/ui-presenter-state.js.map +1 -0
- package/dist/ui.d.ts +2 -2
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js.map +1 -1
- package/dist/uiHostCapabilities.d.ts.map +1 -1
- package/dist/uiHostCapabilities.js.map +1 -1
- package/dist/uiMachineAdmission.d.ts.map +1 -1
- package/dist/uiMachineAdmission.js.map +1 -1
- package/dist/uiSessionProjections.d.ts.map +1 -1
- package/dist/uiSessionProjections.js.map +1 -1
- package/dist/usage.d.ts.map +1 -1
- package/dist/usage.js.map +1 -1
- package/dist/version.d.ts +2 -2
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/dist/workspace-path.d.ts +3 -0
- package/dist/workspace-path.d.ts.map +1 -0
- package/dist/workspace-path.js +3 -0
- package/dist/workspace-path.js.map +1 -0
- package/package.json +118 -3
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 插件 ctx 的工作区面:项目 setup、代理选择和项目只读视图。
|
|
3
|
+
* 公开名字从包入口再导出。
|
|
4
|
+
*
|
|
5
|
+
* @module @ycodium-ai/plugin-api/pluginContextWorkspace
|
|
6
|
+
*/
|
|
7
|
+
import type { MachineSettingsProxiesListOutput, ProjectsGetOutput } from "./dataPorts.gen.ts";
|
|
8
|
+
|
|
9
|
+
export interface PluginWorkspace {
|
|
10
|
+
/** 为本插件创建的独立工作树会话运行项目已配置的 setup 脚本,沿用宿主终端。 */
|
|
11
|
+
readonly setupThread: (threadId: string) => Promise<
|
|
12
|
+
| { readonly status: "no-script" }
|
|
13
|
+
| {
|
|
14
|
+
readonly status: "started";
|
|
15
|
+
readonly scriptId: string;
|
|
16
|
+
readonly scriptName: string;
|
|
17
|
+
readonly terminalId: string;
|
|
18
|
+
readonly cwd: string;
|
|
19
|
+
}
|
|
20
|
+
>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* 这台机器上配着的一个代理,即 `ctx.machineSettings.proxies.list({})` 的一项(形状由公共契约生成)。
|
|
25
|
+
* **不含用户名与密码**:宿主自己往连接上加 `Proxy-Authorization`。`isDefault` 为 true 的是机器的全局默认,
|
|
26
|
+
* 整张表都没有 true 时默认即直连;`bypass` 是不经这个代理直连的地址,逗号分隔。
|
|
27
|
+
*/
|
|
28
|
+
export type PluginProxy = MachineSettingsProxiesListOutput[number];
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 代理下拉里的一条:{@link PluginProxy} 里下拉用得着的那几格,整条传进来也行。插件服务端拼下拉数据、
|
|
32
|
+
* 设置界面画下拉(`@ycodium-ai/plugin-api/ui` 的 `ProxyChoiceSelect`)用同一个类型。
|
|
33
|
+
*/
|
|
34
|
+
export type ProxyChoiceOption = Pick<PluginProxy, "id" | "displayName" | "isDefault">;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* 选哪个代理。与设置里每条功能的代理选择同义:
|
|
38
|
+
*
|
|
39
|
+
* - **省略 / `undefined`** —— 跟这台机器的全局默认走。
|
|
40
|
+
* - **`null`** —— 不加 Ycodium 配的代理。注意它只停 Ycodium 这一份:机器环境里的
|
|
41
|
+
* `HTTP_PROXY` / `HTTPS_PROXY` 照旧生效,宿主不去剥它们。
|
|
42
|
+
* - **代理 id** —— 用那一个。指向一个不存在的 id **静默退化成直连**。
|
|
43
|
+
* - **`{ required: id }`** —— 必须用那一个。代理不存在、设置读不出来、连不上
|
|
44
|
+
* 都 **reject**,不改走直连。订阅凭据这种不能从本机打出去的请求用这一档。
|
|
45
|
+
*
|
|
46
|
+
* 三态里悬空 id 仍静默直连,与 `ctx.http` 同一条规则:手改配置文件不该把长连接搞挂。
|
|
47
|
+
* 要确认某个 id 现在还在,先 `ctx.machineSettings.proxies.list({})`。
|
|
48
|
+
*/
|
|
49
|
+
export type PluginRequiredProxySelection = { readonly required: string };
|
|
50
|
+
export type PluginProxySelection = string | null | PluginRequiredProxySelection;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* 按代理出网。这台机器配了哪些代理用 `ctx.machineSettings.proxies.list({})` 读,然后挑一个出网 —— IM 桥那种
|
|
54
|
+
* 「每个实例各配各的代理」的功能靠它,不必给每个实例塞一份自己的 HTTP 客户端。
|
|
55
|
+
*/
|
|
56
|
+
export interface PluginProxies {
|
|
57
|
+
/**
|
|
58
|
+
* 按三态选择出网的 fetch。选择在**调用时**解析(跟着当前设置走),拿到的 fetch
|
|
59
|
+
* 之后一直走那个代理 —— 所以设置改了要重新调一次,别把返回值缓存一辈子。
|
|
60
|
+
*
|
|
61
|
+
* `ctx.http` 等价于建插件时调过一次 `fetch()`(省略参数那一档):一样的解析规则、
|
|
62
|
+
* 一样的连接池,只是解析发生在宿主建能力面的时刻。想让改过的代理设置立刻生效而
|
|
63
|
+
* 不重启,就用这条重新要一个。
|
|
64
|
+
*/
|
|
65
|
+
readonly fetch: (proxy?: PluginProxySelection | undefined) => Promise<typeof globalThis.fetch>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* 一个 project:`ctx.projects.get` 的结果、`ctx.projects.list` 的一行,形状由公共契约生成。项目号是 `id`;
|
|
70
|
+
* 仓库身份在 `repositoryIdentity`(工作区不是 git 仓库、没有可用 remote、或远端地址认不准时是 null),
|
|
71
|
+
* 其中 `canonicalKey` 是跨机器可比的 `host/owner/repo`,`provider` 认不出托管方时缺席,远端在 `locator` 里
|
|
72
|
+
* (地址已去掉凭据,只供显示与取主机名)。`archivedAt` 缺席或 null 都表示未归档。
|
|
73
|
+
*/
|
|
74
|
+
export type PluginProject = ProjectsGetOutput;
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
// @effect-diagnostics globalTimers:off - 公开插件边界只使用 Promise,不引入宿主 Effect 运行时。
|
|
2
|
+
import type { ExecutorHost } from "./executor.ts";
|
|
3
|
+
|
|
4
|
+
export type OperationProcess = Awaited<ReturnType<ExecutorHost["process"]["spawn"]>>;
|
|
5
|
+
export type OperationSpawnInput = Omit<Parameters<ExecutorHost["process"]["spawn"]>[0], "signal">;
|
|
6
|
+
|
|
7
|
+
export type ProcessOperationOptions = {
|
|
8
|
+
readonly signal?: AbortSignal | undefined;
|
|
9
|
+
readonly timeoutMs?: number | undefined;
|
|
10
|
+
readonly timeoutMessage?: string | undefined;
|
|
11
|
+
readonly cleanupTimeoutMs?: number | undefined;
|
|
12
|
+
readonly terminateGraceMs?: number | undefined;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type ProcessOperation = {
|
|
16
|
+
readonly signal: AbortSignal;
|
|
17
|
+
readonly abortController: AbortController;
|
|
18
|
+
readonly spawn: (input: OperationSpawnInput) => Promise<OperationProcess>;
|
|
19
|
+
/** 协议自己消费输出;这里只登记完成信号,不再读取同一条流。 */
|
|
20
|
+
readonly track: <A>(task: Promise<A>) => Promise<A>;
|
|
21
|
+
/** 先尝试关闭协议;挂起的关闭不能挡住后面的进程终止。 */
|
|
22
|
+
readonly defer: (cleanup: () => void | Promise<void>) => void;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const cleanupErrorBrand = Symbol.for("ycodium.operation.cleanup-error");
|
|
26
|
+
|
|
27
|
+
/** 收尾未确认完成;使用过的临时目录必须保留。errors 同时保留业务与清理失败。 */
|
|
28
|
+
export class OperationCleanupError extends AggregateError {
|
|
29
|
+
readonly [cleanupErrorBrand] = true;
|
|
30
|
+
|
|
31
|
+
constructor(errors: ReadonlyArray<unknown>) {
|
|
32
|
+
super(errors, "Auxiliary operation cleanup failed", { cause: errors[0] });
|
|
33
|
+
this.name = "OperationCleanupError";
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** 宿主与插件可能加载不同模块实例;判断不能依赖构造器身份。 */
|
|
38
|
+
export const isOperationCleanupError = (value: unknown): value is OperationCleanupError =>
|
|
39
|
+
typeof value === "object" &&
|
|
40
|
+
value !== null &&
|
|
41
|
+
cleanupErrorBrand in value &&
|
|
42
|
+
value[cleanupErrorBrand] === true;
|
|
43
|
+
|
|
44
|
+
export class OperationOutputLimitError extends Error {
|
|
45
|
+
readonly stream: "stdout" | "stderr";
|
|
46
|
+
readonly maxBytes: number;
|
|
47
|
+
|
|
48
|
+
constructor(stream: "stdout" | "stderr", maxBytes: number) {
|
|
49
|
+
super(`Auxiliary process ${stream} exceeded ${maxBytes} bytes`);
|
|
50
|
+
this.name = "OperationOutputLimitError";
|
|
51
|
+
this.stream = stream;
|
|
52
|
+
this.maxBytes = maxBytes;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const timeoutError = (message: string) => new Error(message);
|
|
57
|
+
|
|
58
|
+
async function within<A>(task: Promise<A>, milliseconds: number, message: string): Promise<A> {
|
|
59
|
+
let timer: ReturnType<typeof setTimeout> | undefined;
|
|
60
|
+
try {
|
|
61
|
+
return await Promise.race([
|
|
62
|
+
task,
|
|
63
|
+
new Promise<never>((_, reject) => {
|
|
64
|
+
timer = setTimeout(() => reject(timeoutError(message)), Math.max(0, milliseconds));
|
|
65
|
+
}),
|
|
66
|
+
]);
|
|
67
|
+
} finally {
|
|
68
|
+
if (timer !== undefined) clearTimeout(timer);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** 资源在申请开始时归属操作;关闭后到达的进程也必须收尾,不能交给已经离开的回调。 */
|
|
73
|
+
export async function withProcessOperation<A>(
|
|
74
|
+
host: Pick<ExecutorHost, "process" | "log">,
|
|
75
|
+
options: ProcessOperationOptions,
|
|
76
|
+
body: (operation: ProcessOperation) => Promise<A>,
|
|
77
|
+
): Promise<A> {
|
|
78
|
+
options.signal?.throwIfAborted();
|
|
79
|
+
const controller = new AbortController();
|
|
80
|
+
const budget = options.cleanupTimeoutMs ?? 5_000;
|
|
81
|
+
const grace = Math.min(options.terminateGraceMs ?? 250, budget / 4);
|
|
82
|
+
const forwardAbort = () => controller.abort(options.signal?.reason);
|
|
83
|
+
options.signal?.addEventListener("abort", forwardAbort, { once: true });
|
|
84
|
+
if (options.signal?.aborted) forwardAbort();
|
|
85
|
+
const timer =
|
|
86
|
+
options.timeoutMs === undefined
|
|
87
|
+
? undefined
|
|
88
|
+
: setTimeout(
|
|
89
|
+
() =>
|
|
90
|
+
controller.abort(
|
|
91
|
+
timeoutError(options.timeoutMessage ?? "Auxiliary operation timed out"),
|
|
92
|
+
),
|
|
93
|
+
options.timeoutMs,
|
|
94
|
+
);
|
|
95
|
+
let closing = false;
|
|
96
|
+
let cleanupFinished = false;
|
|
97
|
+
const acquisitions: Promise<void>[] = [];
|
|
98
|
+
const tasks: Promise<unknown>[] = [];
|
|
99
|
+
const finalizers: (() => void | Promise<void>)[] = [];
|
|
100
|
+
const failures: unknown[] = [];
|
|
101
|
+
const processes: { handle: OperationProcess; exited: boolean; stopped?: Promise<void> }[] = [];
|
|
102
|
+
const recordFailure = (cause: unknown) => {
|
|
103
|
+
failures.push(cause);
|
|
104
|
+
if (cleanupFinished) host.log.error("Late auxiliary operation cleanup failed", { cause });
|
|
105
|
+
};
|
|
106
|
+
const stop = (process: (typeof processes)[number]): Promise<void> => {
|
|
107
|
+
if (process.stopped) return process.stopped;
|
|
108
|
+
process.stopped = (async () => {
|
|
109
|
+
if (!process.exited) {
|
|
110
|
+
// kill 自身也可能挂起;升级不能排在它的无界等待后面。
|
|
111
|
+
const term = Promise.resolve().then(() => process.handle.kill("SIGTERM"));
|
|
112
|
+
void term.catch(recordFailure);
|
|
113
|
+
try {
|
|
114
|
+
await within(process.handle.exited, grace, "Process did not exit after SIGTERM");
|
|
115
|
+
} catch {
|
|
116
|
+
const force = Promise.resolve().then(() => process.handle.kill("SIGKILL"));
|
|
117
|
+
void force.catch(recordFailure);
|
|
118
|
+
await within(
|
|
119
|
+
Promise.all([term, force, process.handle.exited]),
|
|
120
|
+
budget,
|
|
121
|
+
"Process did not finish termination",
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
await within(term, budget, "Process termination did not finish");
|
|
125
|
+
}
|
|
126
|
+
await process.handle.exited;
|
|
127
|
+
})();
|
|
128
|
+
void process.stopped.catch(recordFailure);
|
|
129
|
+
return process.stopped;
|
|
130
|
+
};
|
|
131
|
+
const operation: ProcessOperation = {
|
|
132
|
+
signal: controller.signal,
|
|
133
|
+
abortController: controller,
|
|
134
|
+
spawn: (input) => {
|
|
135
|
+
if (closing) return Promise.reject(new Error("Auxiliary operation is closing"));
|
|
136
|
+
controller.signal.throwIfAborted();
|
|
137
|
+
const acquired = Promise.resolve()
|
|
138
|
+
.then(() => {
|
|
139
|
+
controller.signal.throwIfAborted();
|
|
140
|
+
return host.process.spawn({ ...input, signal: controller.signal });
|
|
141
|
+
})
|
|
142
|
+
.then((handle) => {
|
|
143
|
+
const process: (typeof processes)[number] = { handle, exited: false };
|
|
144
|
+
processes.push(process);
|
|
145
|
+
void handle.exited.then(
|
|
146
|
+
() => {
|
|
147
|
+
process.exited = true;
|
|
148
|
+
},
|
|
149
|
+
() => {},
|
|
150
|
+
);
|
|
151
|
+
if (closing) {
|
|
152
|
+
void stop(process);
|
|
153
|
+
throw controller.signal.reason ?? new Error("Auxiliary operation is closing");
|
|
154
|
+
}
|
|
155
|
+
return handle;
|
|
156
|
+
});
|
|
157
|
+
acquisitions.push(
|
|
158
|
+
acquired.then(
|
|
159
|
+
() => {},
|
|
160
|
+
() => {},
|
|
161
|
+
),
|
|
162
|
+
);
|
|
163
|
+
return acquired;
|
|
164
|
+
},
|
|
165
|
+
track: (task) => {
|
|
166
|
+
// 拒绝也表示消费者已停止;业务路径负责保留该错误。
|
|
167
|
+
tasks.push(
|
|
168
|
+
task.then(
|
|
169
|
+
() => {},
|
|
170
|
+
() => {},
|
|
171
|
+
),
|
|
172
|
+
);
|
|
173
|
+
return task;
|
|
174
|
+
},
|
|
175
|
+
defer: (cleanup) => {
|
|
176
|
+
if (closing) throw new Error("Auxiliary operation is closing");
|
|
177
|
+
finalizers.push(cleanup);
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
let result: A | undefined;
|
|
181
|
+
let bodyFailed = false;
|
|
182
|
+
let bodyError: unknown;
|
|
183
|
+
let onAbort: () => void = () => {};
|
|
184
|
+
const bodyTask = Promise.resolve().then(() => {
|
|
185
|
+
controller.signal.throwIfAborted();
|
|
186
|
+
return body(operation);
|
|
187
|
+
});
|
|
188
|
+
const bodyCompletion = bodyTask.then(
|
|
189
|
+
() => {},
|
|
190
|
+
() => {},
|
|
191
|
+
);
|
|
192
|
+
try {
|
|
193
|
+
const cancelled = new Promise<never>((_, reject) => {
|
|
194
|
+
onAbort = () => reject(controller.signal.reason);
|
|
195
|
+
controller.signal.addEventListener("abort", onAbort, { once: true });
|
|
196
|
+
if (controller.signal.aborted) onAbort();
|
|
197
|
+
});
|
|
198
|
+
result = await Promise.race([bodyTask, cancelled]);
|
|
199
|
+
} catch (cause) {
|
|
200
|
+
bodyFailed = true;
|
|
201
|
+
bodyError = cause;
|
|
202
|
+
} finally {
|
|
203
|
+
closing = true;
|
|
204
|
+
if (timer !== undefined) clearTimeout(timer);
|
|
205
|
+
options.signal?.removeEventListener("abort", forwardAbort);
|
|
206
|
+
controller.signal.removeEventListener("abort", onAbort);
|
|
207
|
+
controller.abort();
|
|
208
|
+
const cleanup = (async () => {
|
|
209
|
+
const protocol = Promise.all(
|
|
210
|
+
finalizers
|
|
211
|
+
.toReversed()
|
|
212
|
+
.map((finalizer) => Promise.resolve().then(finalizer).catch(recordFailure)),
|
|
213
|
+
);
|
|
214
|
+
try {
|
|
215
|
+
await within(protocol, grace, "Auxiliary protocol close did not finish");
|
|
216
|
+
} catch {
|
|
217
|
+
// 协议可能只有在进程终止后才落定;总预算内结束即可确认收尾。
|
|
218
|
+
}
|
|
219
|
+
const stopping = processes.map(stop);
|
|
220
|
+
await Promise.all(acquisitions);
|
|
221
|
+
await Promise.all([...stopping, ...processes.map(stop)]);
|
|
222
|
+
await bodyCompletion;
|
|
223
|
+
await protocol;
|
|
224
|
+
// 回调或协议关闭也会登记消费者;等登记方结束后再排空,避免只等旧快照。
|
|
225
|
+
let completed = 0;
|
|
226
|
+
while (completed < tasks.length) {
|
|
227
|
+
const batch = tasks.slice(completed);
|
|
228
|
+
completed = tasks.length;
|
|
229
|
+
await Promise.all(batch);
|
|
230
|
+
}
|
|
231
|
+
})();
|
|
232
|
+
try {
|
|
233
|
+
await within(cleanup, budget, "Auxiliary operation cleanup timed out");
|
|
234
|
+
} catch (cause) {
|
|
235
|
+
recordFailure(cause);
|
|
236
|
+
}
|
|
237
|
+
cleanupFinished = true;
|
|
238
|
+
}
|
|
239
|
+
if (failures.length > 0) {
|
|
240
|
+
throw new OperationCleanupError(bodyFailed ? [bodyError, ...failures] : failures);
|
|
241
|
+
}
|
|
242
|
+
if (bodyFailed) throw bodyError;
|
|
243
|
+
return result as A;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export type RunProcessOperationInput = OperationSpawnInput &
|
|
247
|
+
ProcessOperationOptions & {
|
|
248
|
+
readonly input?: string | Uint8Array | undefined;
|
|
249
|
+
readonly maxOutputBytes?: number | undefined;
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
/** 一次性命令只有一个输出消费者;超过保存上限仍持续读到结束,避免管道背压。 */
|
|
253
|
+
export async function runProcessOperation(
|
|
254
|
+
host: Pick<ExecutorHost, "process" | "log">,
|
|
255
|
+
input: RunProcessOperationInput,
|
|
256
|
+
): Promise<{ readonly stdout: string; readonly stderr: string; readonly exitCode: number | null }> {
|
|
257
|
+
return withProcessOperation(host, input, async (operation) => {
|
|
258
|
+
const handle = await operation.spawn({
|
|
259
|
+
program: input.program,
|
|
260
|
+
...(input.args === undefined ? {} : { args: input.args }),
|
|
261
|
+
...(input.cwd === undefined ? {} : { cwd: input.cwd }),
|
|
262
|
+
...(input.env === undefined ? {} : { env: input.env }),
|
|
263
|
+
owner: input.owner,
|
|
264
|
+
});
|
|
265
|
+
const max = input.maxOutputBytes ?? 4 * 1024 * 1024;
|
|
266
|
+
const collect = async (stream: AsyncIterable<Uint8Array>, name: "stdout" | "stderr") => {
|
|
267
|
+
const decoder = new TextDecoder();
|
|
268
|
+
let output = "";
|
|
269
|
+
let bytes = 0;
|
|
270
|
+
let exceeded = false;
|
|
271
|
+
for await (const chunk of stream) {
|
|
272
|
+
bytes += chunk.byteLength;
|
|
273
|
+
if (bytes <= max) output += decoder.decode(chunk, { stream: true });
|
|
274
|
+
else exceeded = true;
|
|
275
|
+
}
|
|
276
|
+
output += decoder.decode();
|
|
277
|
+
if (exceeded) throw new OperationOutputLimitError(name, max);
|
|
278
|
+
return output;
|
|
279
|
+
};
|
|
280
|
+
const stdout = operation.track(collect(handle.stdout, "stdout"));
|
|
281
|
+
const stderr = operation.track(collect(handle.stderr, "stderr"));
|
|
282
|
+
const writing = operation.track(
|
|
283
|
+
(async () => {
|
|
284
|
+
if (input.input !== undefined) await handle.writeStdin(input.input);
|
|
285
|
+
await handle.closeStdin();
|
|
286
|
+
})(),
|
|
287
|
+
);
|
|
288
|
+
const [out, err, exitCode] = await Promise.all([stdout, stderr, handle.exited, writing]);
|
|
289
|
+
return { stdout: out, stderr: err, exitCode };
|
|
290
|
+
});
|
|
291
|
+
}
|