@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,181 @@
|
|
|
1
|
+
import type * as CapabilityPorts from "./capabilityPorts.ts";
|
|
2
|
+
import type { PluginAsCaller } from "./commands.ts";
|
|
3
|
+
|
|
4
|
+
// 工具名片、调用上下文与结果。宿主从 index 再导出。
|
|
5
|
+
// `whenPresetId` 只在会话选了这个 preset 时把工具放进 `tools/list`,并且才能调用。
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 工具结果里的一张图。宿主把它翻成 MCP 的 `image` 内容块(协议上是 base64,编码
|
|
9
|
+
* 由宿主做,插件不要自己编)。
|
|
10
|
+
*
|
|
11
|
+
* `data` 只认原始字节,不认文件路径:读磁盘只有 `ctx.fs` 那一道 `fs.read` 前缀门,
|
|
12
|
+
* 工具结果这边不另开第二道。要回一张磁盘上的图就自己走
|
|
13
|
+
* `ctx.fs.createReadStream(path)` 把分片拼起来,权限与越界拒绝与别处完全一致。
|
|
14
|
+
*
|
|
15
|
+
* `mimeType` 只认 `image/png`、`image/jpeg`、`image/gif`、`image/webp` —— 与用户上传
|
|
16
|
+
* 附件共用同一张「provider 能内联的图片」表,大小写不敏感。
|
|
17
|
+
*/
|
|
18
|
+
export interface PluginToolImage {
|
|
19
|
+
readonly data: Uint8Array;
|
|
20
|
+
readonly mimeType: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface PluginToolResult extends CapabilityPorts.PluginToolPresentation {
|
|
24
|
+
readonly text: string;
|
|
25
|
+
/**
|
|
26
|
+
* 随文本一起回给模型的图片。上限:单张 3 MiB,一次结果最多 4 张。
|
|
27
|
+
*
|
|
28
|
+
* 超限的那张、mimeType 不认的那张、`data` 不是 `Uint8Array` 的那张都只是被丢掉,
|
|
29
|
+
* `text` 末尾附一行说明为什么,整次调用**不算失败**(与 `ctx.process.run` 超出
|
|
30
|
+
* `maxOutputBytes` 就截断同一条纪律:降级,不是错误)。
|
|
31
|
+
*
|
|
32
|
+
* provider 认不认图片各家不同,`text` 永远是那条保底的路——别把只有图片才说得清
|
|
33
|
+
* 的信息全押在图上。
|
|
34
|
+
*/
|
|
35
|
+
readonly images?: readonly PluginToolImage[] | undefined;
|
|
36
|
+
/** 置 true 表示这次调用失败;宿主原样转成 MCP 的 `isError`。 */
|
|
37
|
+
readonly isError?: boolean | undefined;
|
|
38
|
+
/** 失败时的机器可读错误码。宿主用于观测字段(span 属性/日志),不上线、不承诺透传给模型;成败仍以 isError 为准。 */
|
|
39
|
+
readonly errorCode?: string | undefined;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* 工具被调用时宿主核实的上下文。字段只增不改;位置与跟踪字段解析不出来时给 null,
|
|
44
|
+
* caller 无认证事实时缺席,插件不得从工具参数补报身份。
|
|
45
|
+
*/
|
|
46
|
+
export interface PluginToolInvocation extends CapabilityPorts.PluginToolInvocationIdentity {
|
|
47
|
+
/** 仅已验证的本机会话 agent 工具调用有;需声明 work.item.claim,并通过会话与项目的 board 准入。调用结束即失效。 */
|
|
48
|
+
readonly asCaller?: PluginAsCaller;
|
|
49
|
+
/** 远端调用没有本机会话,值为 null。 */
|
|
50
|
+
readonly threadId: string | null;
|
|
51
|
+
readonly projectId: string | null;
|
|
52
|
+
/** 该 thread 所属 project 的工作区根目录;远端调用为 null。 */
|
|
53
|
+
readonly projectRoot: string | null;
|
|
54
|
+
/**
|
|
55
|
+
* 宿主从本次认证结果核实的调用者,本机调用也填 thread 身份。
|
|
56
|
+
* 项目与身份以 invocation.projectId / caller 为准;工具参数中的 projectId 或身份由插件
|
|
57
|
+
* 自行校验,宿主不核实,也不据此扩大凭据的项目范围。
|
|
58
|
+
*/
|
|
59
|
+
readonly caller?:
|
|
60
|
+
| { readonly kind: "thread"; readonly threadId: string }
|
|
61
|
+
| {
|
|
62
|
+
readonly kind: "remote-agent";
|
|
63
|
+
/** 加入项目的那台机器;跑在它上面的所有成员共用,只凭它分不出是哪名成员。 */
|
|
64
|
+
readonly principalId: string;
|
|
65
|
+
/**
|
|
66
|
+
* 发起调用的成员:成员机转发时用席位凭据签名、家机器验过签的那个成员号。旧版本的成员机不签、机器级调用没有成员,
|
|
67
|
+
* 这时缺席:要按成员判权的工具必须拒绝,不能退回按 `principalId` 猜。
|
|
68
|
+
*/
|
|
69
|
+
readonly memberId?: string;
|
|
70
|
+
};
|
|
71
|
+
/** 宿主本次调用的跟踪编号,供插件日志关联宿主 trace 记录;宿主解析不出时为 null。 */
|
|
72
|
+
readonly traceId?: string | null;
|
|
73
|
+
readonly spanId?: string | null;
|
|
74
|
+
/**
|
|
75
|
+
* 读发起这次调用的会话所在项目的文件。**只有**同时满足两条才存在:manifest 声明了
|
|
76
|
+
* `workspace.read`,且这次调用来自一条会话;否则是 `undefined`。
|
|
77
|
+
*
|
|
78
|
+
* 只在 handler 返回(或抛错)之前可用:之后每个方法都 reject `invocation-ended`,
|
|
79
|
+
* 所以别把它存下来留到工具结束以后再用,也别在 handler 返回后还让读在后台跑。
|
|
80
|
+
* 要交出去的内容必须在返回前读完。
|
|
81
|
+
*/
|
|
82
|
+
readonly workspace?: PluginInvocationWorkspace;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* 工具调用期间可读的会话工作区(`workspace.read`)。范围由宿主按发起会话算,不取自
|
|
87
|
+
* 工具入参;越界、不是普通文件、过大等一律抛 `PluginCapabilityError`,`capability` 是
|
|
88
|
+
* `"workspace.read"`,`reason` 见 {@link PluginCapabilityDeniedReason}。
|
|
89
|
+
*/
|
|
90
|
+
export interface PluginInvocationWorkspace extends CapabilityPorts.PluginInvocationWorkspaceWrite {
|
|
91
|
+
/** 这条会话在本机的工作目录:roots[0] 是 agent 的 cwd(worktree 路径或起步文件夹),相对路径按它解析;其余是项目在本机挂着的其它文件夹。与 projectRoot 不是一回事,projectRoot 含义不变。 */
|
|
92
|
+
readonly roots: readonly string[];
|
|
93
|
+
/** `path` 是解析符号链接之后的真实路径;目录也能 stat(`isFile` 为 false),不抛 `not-a-file`。 */
|
|
94
|
+
stat(path: string): Promise<{
|
|
95
|
+
readonly path: string;
|
|
96
|
+
readonly size: number;
|
|
97
|
+
readonly isFile: boolean;
|
|
98
|
+
}>;
|
|
99
|
+
/**
|
|
100
|
+
* 读整个文件。`maxBytes` 缺省且上限都是 50 MiB,传更大的值按 50 MiB 算;文件超过它就抛
|
|
101
|
+
* `too-large`(读的过程中长大了也一样),不会返回截断的内容。
|
|
102
|
+
*/
|
|
103
|
+
readFile(
|
|
104
|
+
path: string,
|
|
105
|
+
options?: { readonly maxBytes?: number },
|
|
106
|
+
): Promise<{ readonly path: string; readonly bytes: Uint8Array }>;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* 工具入参的 JSON Schema(draft-07 子集)。
|
|
111
|
+
*
|
|
112
|
+
* **顶层必须是 `"object"`**,这是类型上的硬约束,不是建议:MCP 客户端校验每个工具的
|
|
113
|
+
* `inputSchema.type`,见到一条不是 object 的就**丢弃整张工具表**——不是只丢那一条。
|
|
114
|
+
* 一个插件写错,这台机器上所有 agent 的所有工具一起失效,而且服务端一切正常、日志
|
|
115
|
+
* 一条错都没有。2026-09-16 真发生过,三天才定位。
|
|
116
|
+
*
|
|
117
|
+
* 无参工具写 `{ type: "object", properties: {} }`。别写 `anyOf` / `oneOf` 在根上——
|
|
118
|
+
* 若你的 schema 生成器产出这种形状(effect 的空 `Schema.Struct({})` 就会),在交给
|
|
119
|
+
* 宿主之前自己摊平成 object。
|
|
120
|
+
*
|
|
121
|
+
* 宿主在出口仍会兜一道(把非 object 的顶层归一成空 object),但那是安全网不是许可:
|
|
122
|
+
* 兜底会丢掉你声明的所有字段,agent 将看不到任何参数说明。
|
|
123
|
+
*/
|
|
124
|
+
export type PluginToolInputSchema = {
|
|
125
|
+
readonly type: "object";
|
|
126
|
+
readonly properties?: Readonly<Record<string, unknown>>;
|
|
127
|
+
readonly required?: ReadonlyArray<string>;
|
|
128
|
+
} & Readonly<Record<string, unknown>>;
|
|
129
|
+
|
|
130
|
+
export interface PluginTool {
|
|
131
|
+
readonly name: string;
|
|
132
|
+
readonly description: string;
|
|
133
|
+
readonly inputSchema: PluginToolInputSchema;
|
|
134
|
+
/** MCP 目录中的完整参数示例。可选的反例说明本工具特有的误用;省略时由正例生成形状错误。 */
|
|
135
|
+
readonly argumentUsage?: {
|
|
136
|
+
readonly valid: Readonly<Record<string, CapabilityPorts.PluginJson>>;
|
|
137
|
+
readonly mistake?: { readonly invalid: CapabilityPorts.PluginJson; readonly reason: string };
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* 只在这条会话选了这个 preset 时出现在 `tools/list`,并且才能调用。
|
|
141
|
+
* 缺省则每条会话都能看见。
|
|
142
|
+
*/
|
|
143
|
+
readonly whenPresetId?: string;
|
|
144
|
+
/**
|
|
145
|
+
* 显式允许远端成员凭所属项目的有效凭据列出并调用此工具;缺省或 false 均拒绝。
|
|
146
|
+
* invocation.projectId 来自凭据,caller 来自认证;宿主不校验参数里的 projectId。
|
|
147
|
+
* 会话级挂载与 whenPresetId 的限制仍生效,远端没有本机会话或预设。
|
|
148
|
+
*/
|
|
149
|
+
readonly remoteAvailable?: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* 声明这个工具只在目标项目的家机器上运行(目标项目取自 `invocation.projectId`)。项目的家在别的机器时,
|
|
152
|
+
* 宿主在调用时直接拒绝,不进 `handle`:返回 `isError` 结果,`errorCode` 为 `not-project-home`,文字里带家机器名
|
|
153
|
+
* 并指路;暂时读不出项目的家时同样不进 `handle`,`errorCode` 为 `project-home-unconfirmed`,稍后重试即可。
|
|
154
|
+
* 家为空、家就是本机、单机部署、没有项目的调用(`projectId` 为 null)都照常放行;经 `ycodium-home` 到家机器上的调用
|
|
155
|
+
* 在家机器上执行,项目的家就是本机,同样放行。缺省或 false 不设闸,工具照旧在任何机器上运行。
|
|
156
|
+
* 读取或维护这个插件按项目记下的自有状态的工具应当声明它;只经数据端口读写账本、不碰自有状态的工具不需要。
|
|
157
|
+
*/
|
|
158
|
+
readonly homeOnly?: boolean;
|
|
159
|
+
readonly handle: (
|
|
160
|
+
input: Record<string, unknown>,
|
|
161
|
+
invocation: PluginToolInvocation,
|
|
162
|
+
) => Promise<PluginToolResult>;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* 工具在 MCP 上以 `<pluginId>_<tool>` 出现,防撞名。插件卸载后工具立即从
|
|
167
|
+
* `tools/list` 消失,此后再调用只会拿到一条明确的错误。
|
|
168
|
+
*
|
|
169
|
+
* **线程级插件的工具只发给挂载它的那条线程的 MCP 会话。** 两道门:`tools/list` 时按
|
|
170
|
+
* 会话归属的 threadId 过滤(软边界),`tools/call` 时按 (threadId, name) 硬查表——
|
|
171
|
+
* 别的线程猜到名字硬调也只拿到一条干净的错误。所以两条线程可以各注册一个同名工具,
|
|
172
|
+
* 互不影响;线程工具撞上已装好的全局工具名时让位(同一会话的列表里不出现重名)。
|
|
173
|
+
*
|
|
174
|
+
* 工具表变化时宿主会发 `tools/list_changed`,但 **provider CLI 的工具清单通常在会话
|
|
175
|
+
* 启动时就冻结了**:新挂的工具往往要等这条线程下一次 provider 会话才真正可调。
|
|
176
|
+
* reactor 与触发器不吃这条,注册完立刻生效。
|
|
177
|
+
*/
|
|
178
|
+
export interface PluginToolkit {
|
|
179
|
+
readonly name: string;
|
|
180
|
+
readonly tools: readonly PluginTool[];
|
|
181
|
+
}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 插件 ctx 的命令面:disposer、设置读写、宿主操作守卫与命令回执。
|
|
3
|
+
* 公开名字从包入口再导出。
|
|
4
|
+
*
|
|
5
|
+
* @module @ycodium-ai/plugin-api/pluginContextCommands
|
|
6
|
+
*/
|
|
7
|
+
import type { PluginSettingsWriteOptions } from "./settings-actions.ts";
|
|
8
|
+
import type { PluginDataPorts, ThreadsCommandReceiptsGetOutput } from "./dataPorts.gen.ts";
|
|
9
|
+
import type { WorkItemsCreateInput } from "./dataPorts.gen.ts";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 注册类调用统一返回它;不调用也行,插件 Scope 关闭时宿主会替你撤销。
|
|
13
|
+
*
|
|
14
|
+
* 插件已经 dispose 之后再注册任何贡献(activate 之后异步注册的常见情形):宿主只记
|
|
15
|
+
* 一条 warning,返回一个 **no-op disposer**,那条贡献不会进已经死掉的记录,也不抛错。
|
|
16
|
+
*/
|
|
17
|
+
export type PluginDisposer = () => void;
|
|
18
|
+
|
|
19
|
+
export interface PluginSettings<Config> {
|
|
20
|
+
/** 读本插件在 home patch 层的那份 config(`password` 已解成明文);home 层没写过就回退到 `ctx.config`,不是空对象。 */
|
|
21
|
+
readonly read: () => Promise<Config>;
|
|
22
|
+
/** 整体替换本插件那条 config,之后照 `onChange` 就地换或重启这一个插件;已存的密码引用不被覆盖,存新密码用 options.secrets。 */
|
|
23
|
+
readonly write: (config: Config, options?: PluginSettingsWriteOptions) => Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* 配置变了(存卡片、`write`)时宿主不重启插件,把新 config(密码已解)交给 handler,`ctx.config` 也换成新值。
|
|
26
|
+
* 没注册 handler 的插件照旧重启;handler 抛错或 reject,宿主退回重启这一个插件。返回值取消注册。
|
|
27
|
+
*/
|
|
28
|
+
readonly onChange: (handler: (config: Config) => void | Promise<void>) => () => void;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type PluginCommandReceipt = ThreadsCommandReceiptsGetOutput;
|
|
32
|
+
|
|
33
|
+
/** 工作主体(人、本机 agent、远端主体):指派位里除项目成员以外的那几种。 */
|
|
34
|
+
type WorkPrincipalInput = Exclude<
|
|
35
|
+
NonNullable<WorkItemsCreateInput["assignees"]>[number],
|
|
36
|
+
{ readonly kind: "member" }
|
|
37
|
+
>;
|
|
38
|
+
|
|
39
|
+
/** 宿主会问插件的操作。只增不删:老插件登记过的名字永远还认。 */
|
|
40
|
+
export type PluginOperationName =
|
|
41
|
+
| "server.upgrade"
|
|
42
|
+
| "project.archive"
|
|
43
|
+
| "work.assign"
|
|
44
|
+
| "work.start"
|
|
45
|
+
| "work.dispatch";
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* 交给 check 的入参,按操作名分派。`server.upgrade` 带发起升级的会话;
|
|
49
|
+
* `project.archive` 带即将归档的项目,拿掉这个项目在这台机器上的文件夹时问的也是它。
|
|
50
|
+
*/
|
|
51
|
+
export type PluginOperationCheckInput<O extends PluginOperationName = PluginOperationName> =
|
|
52
|
+
O extends "server.upgrade"
|
|
53
|
+
? { readonly operation: "server.upgrade"; readonly threadId: string }
|
|
54
|
+
: O extends "project.archive"
|
|
55
|
+
? {
|
|
56
|
+
readonly operation: "project.archive";
|
|
57
|
+
readonly projectId: string;
|
|
58
|
+
/**
|
|
59
|
+
* 宿主已提交的事件序号。领域状态由事件异步推进的插件,先追到它再回答,
|
|
60
|
+
* 才看得见归档前一瞬刚发生的事(同 `commands.guard` 的 throughSequence)。
|
|
61
|
+
*/
|
|
62
|
+
readonly throughSequence?: number | undefined;
|
|
63
|
+
}
|
|
64
|
+
: O extends "work.assign"
|
|
65
|
+
? {
|
|
66
|
+
readonly operation: "work.assign";
|
|
67
|
+
readonly projectId: string;
|
|
68
|
+
readonly workItemId: string;
|
|
69
|
+
/** 仅本次新增的指派,沿用数据能力登记表生成的指派位形状:主体,或项目成员(`kind: "member"`)。 */
|
|
70
|
+
readonly added: NonNullable<WorkItemsCreateInput["assignees"]>;
|
|
71
|
+
/** 回答前须用 derivedState.get({ throughSequence }) 追到此已提交序号。 */
|
|
72
|
+
readonly throughSequence: number;
|
|
73
|
+
}
|
|
74
|
+
: O extends "work.start"
|
|
75
|
+
? {
|
|
76
|
+
readonly operation: "work.start";
|
|
77
|
+
readonly projectId: string;
|
|
78
|
+
readonly workItemId: string;
|
|
79
|
+
/** 开工的主体:认领人,或把件挪进 started 组的调用者。只会是人、本机 agent 或远端主体,不会是成员。 */
|
|
80
|
+
readonly starter: WorkPrincipalInput;
|
|
81
|
+
/** `claim`:认领;`update`:改状态从非 started 组进 started 组。 */
|
|
82
|
+
readonly via: "claim" | "update";
|
|
83
|
+
/** 这件提交前的指派,可含项目成员。 */
|
|
84
|
+
readonly assignees: NonNullable<WorkItemsCreateInput["assignees"]>;
|
|
85
|
+
/**
|
|
86
|
+
* 这件提交之后的指派,可含项目成员:认领是认领人一个人;update 是这次给的新整组,没改指派就等于
|
|
87
|
+
* `assignees`。同一次 update 改派又开工时它与 `assignees` 不同,守卫要按它判。
|
|
88
|
+
*/
|
|
89
|
+
readonly assigneesAfter: NonNullable<WorkItemsCreateInput["assignees"]>;
|
|
90
|
+
/** 这件提交前所在的工作线;不在任何线上是 `null`。 */
|
|
91
|
+
readonly workLineId: string | null;
|
|
92
|
+
/**
|
|
93
|
+
* 这件提交之后所在的工作线:认领不换线,与 `workLineId` 相同;update 是这次给的新线(`null` 是移出任何线),
|
|
94
|
+
* 没改线就等于 `workLineId`。同一次 update 可以换线、改派、进 started,守卫按线判执行者时要用它,
|
|
95
|
+
* `throughSequence` 只追到已提交的历史,看不到这次待提交的线。
|
|
96
|
+
*/
|
|
97
|
+
readonly workLineIdAfter: string | null;
|
|
98
|
+
/** 回答前须用 derivedState.get({ throughSequence }) 追到此已提交序号。 */
|
|
99
|
+
readonly throughSequence: number;
|
|
100
|
+
}
|
|
101
|
+
: O extends "work.dispatch"
|
|
102
|
+
? {
|
|
103
|
+
readonly operation: "work.dispatch";
|
|
104
|
+
readonly projectId: string;
|
|
105
|
+
/**
|
|
106
|
+
* 为什么要叫醒它:`item` 件派给了它;`comment` 工作项的评论里 @ 了它、或回复了它的评论;`group` 群消息里
|
|
107
|
+
* @ 了它。
|
|
108
|
+
*/
|
|
109
|
+
readonly reason: "item" | "comment" | "group";
|
|
110
|
+
/** 这件;群消息不挂在件上,是 `null`。 */
|
|
111
|
+
readonly workItemId: string | null;
|
|
112
|
+
/** 这件现在所在的工作线(群消息是群对应的线);不在任何线上是 `null`。 */
|
|
113
|
+
readonly workLineId: string | null;
|
|
114
|
+
/** 要叫醒的本机或远端 agent 成员。 */
|
|
115
|
+
readonly memberId: string;
|
|
116
|
+
/**
|
|
117
|
+
* 引擎要把话交到的本机会话:这个成员在这条线上的会话(线有群会话时是群会话名下带这个成员号的最新一条,负责人
|
|
118
|
+
* 是群会话本身),件已经交出过的是当时那一条。还没有、要由引擎新开一条、或成员在远端时是 `null`。
|
|
119
|
+
*/
|
|
120
|
+
readonly threadId: string | null;
|
|
121
|
+
/** `comment` 才有:那条评论。 */
|
|
122
|
+
readonly commentId?: string | undefined;
|
|
123
|
+
/** `group` 才有:那条群消息的记录。 */
|
|
124
|
+
readonly recordId?: string | undefined;
|
|
125
|
+
/** 回答前须用 derivedState.get({ throughSequence }) 追到此已提交序号。 */
|
|
126
|
+
readonly throughSequence: number;
|
|
127
|
+
}
|
|
128
|
+
: never;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* 叫醒补充(`ctx.operations.supplement`)的入参:引擎按看板叫醒一个本机 agent 成员做一件活之前,派发门槛都放行之后问。
|
|
132
|
+
*/
|
|
133
|
+
export type PluginWakeSupplementInput = {
|
|
134
|
+
readonly operation: "work.dispatch";
|
|
135
|
+
readonly projectId: string;
|
|
136
|
+
readonly workItemId: string;
|
|
137
|
+
/** 这件现在所在的工作线;不在任何线上是 `null`。 */
|
|
138
|
+
readonly workLineId: string | null;
|
|
139
|
+
readonly memberId: string;
|
|
140
|
+
/** 这次叫醒落到的本机会话(会话这时可能还没开出来,号已经定了)。 */
|
|
141
|
+
readonly threadId: string;
|
|
142
|
+
/**
|
|
143
|
+
* 这一次叫醒的稳定号:同一次指派的重试、补扫都相同,改派走再派回来是新的。插件按它让自己随叫醒落的事实幂等
|
|
144
|
+
* (比如「这段群摘要随哪次叫醒发出」)。
|
|
145
|
+
*/
|
|
146
|
+
readonly wakeKey: string;
|
|
147
|
+
/** 回答前须用 derivedState.get({ throughSequence }) 追到此已提交序号。 */
|
|
148
|
+
readonly throughSequence: number;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
export interface PluginOperations {
|
|
152
|
+
/**
|
|
153
|
+
* 给一类宿主操作加规则,规则随插件停用撤销。
|
|
154
|
+
*
|
|
155
|
+
* - `server.upgrade` 只约束本插件创建的会话及其委派后代。
|
|
156
|
+
* - `project.archive` 在归档这台机器上的某个项目、或拿掉它的文件夹之前,问所有已加载的
|
|
157
|
+
* 插件,不按会话归属限定。check 只能读、不能派发命令;5 秒不答、抛错都按拒绝处理。
|
|
158
|
+
* 拒绝原句会点名你的插件,所以 detail 是写给用户看的:说清楚什么还没做完;宿主会折叠
|
|
159
|
+
* 其中的空白并截到 300 字符。
|
|
160
|
+
* - `work.assign` 在引擎串行提交前检查建件带指派、改指派加人及认领,只问新增主体。
|
|
161
|
+
* 不按会话归属限定;只读、5 秒时限与失败拒绝同 `project.archive`。没有新增主体不问,
|
|
162
|
+
* 重放不重问。首次拒绝写持久收据,同 requestId 永远返回首次拒绝;解除门槛后须换新 requestId。
|
|
163
|
+
* - `work.start` 在引擎串行提交前检查开工:认领会真领到这件,或改状态从非 started 组进 started 组;
|
|
164
|
+
* 已经由自己做着的空操作不问。入参带提交前的指派 `assignees`、提交之后的 `assigneesAfter`,以及这件提交前后所在的线 `workLineId` / `workLineIdAfter`。
|
|
165
|
+
* 排在 `work.assign` 之后,两道都拒时先报指派那句。拒绝码是
|
|
166
|
+
* `start-blocked`;只读、5 秒时限、失败拒绝、持久收据与重放同 `work.assign`。
|
|
167
|
+
* - `work.dispatch` 是派发门槛:引擎按看板投递或叫醒一个本机或远端 agent 成员之前问(件派给了它、评论或群消息里 @ 了它、回复了
|
|
168
|
+
* 它,且线与成员都没暂停),`reason` 说是哪一种。回答 `allowed: false` 是「这个成员现在不能派」(例如还没通过
|
|
169
|
+
* 试跑),`detail` 写原因,只进日志与测试收据:引擎这次不开会话、不叫醒,下一次触发或每分钟的补扫再问,评论与群消息
|
|
170
|
+
* 的话留着等下一次。抛错、宿主限时 5 秒不答、插件还在启动时记日志并放行。普通私信与回复不问。没有插件登记它时引擎照常派。只读。
|
|
171
|
+
* 放行时可以带 `threadId`:把话与叫醒改交到这条会话(同项目、没归档没删除,否则这次不派),不带就按入参里引擎挑的
|
|
172
|
+
* 会话。几个插件改投到不同的会话也按「现在不能派」算。远端成员由成员机选会话,忽略改投并记日志。去重、叫醒补充与交件记录照旧。
|
|
173
|
+
*
|
|
174
|
+
* 具名声明规则对象时用 `PluginOperationCheckInput<"server.upgrade">` 标 check 的入参。
|
|
175
|
+
* 不要写 `Parameters<PluginOperations["guard"]>[0]`:泛型 O 取不到具体操作,入参会
|
|
176
|
+
* 变成全部操作的联合,你的 check 赋不进去。直接内联 `guard({...})`、不标入参类型也可以。
|
|
177
|
+
*/
|
|
178
|
+
readonly guard: <O extends PluginOperationName>(guard: {
|
|
179
|
+
readonly operations: readonly O[];
|
|
180
|
+
readonly check: (
|
|
181
|
+
input: PluginOperationCheckInput<O>,
|
|
182
|
+
) => Promise<
|
|
183
|
+
| (O extends "work.dispatch"
|
|
184
|
+
? { readonly allowed: true; readonly threadId?: string | undefined }
|
|
185
|
+
: { readonly allowed: true })
|
|
186
|
+
| { readonly allowed: false; readonly detail: string }
|
|
187
|
+
>;
|
|
188
|
+
}) => PluginDisposer;
|
|
189
|
+
/**
|
|
190
|
+
* 叫醒补充:引擎按看板叫醒一个本机 agent 成员做一件活时(`work.dispatch` 的门槛都放行之后、起轮之前),把 `add`
|
|
191
|
+
* 返回的话接在引擎的叫醒话后面(例如团队规矩、负责人是谁、群里错过的话)。返回 `null` 或空串是不补充。几个插件都补充时
|
|
192
|
+
* 按插件号的次序接上;每段超过 16,000 个字符截断。抛错或 5 秒不答,引擎这次不叫醒(叫醒话少了规矩不如晚一点叫),
|
|
193
|
+
* 下一次触发或补扫再来。只有件派给成员的叫醒问它;评论与群消息走消息投递,不问。随插件停用撤销。
|
|
194
|
+
*/
|
|
195
|
+
readonly supplement: (supplement: {
|
|
196
|
+
readonly operations: readonly "work.dispatch"[];
|
|
197
|
+
readonly add: (input: PluginWakeSupplementInput) => Promise<string | null>;
|
|
198
|
+
}) => PluginDisposer;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* `ctx.commands`。命令写入使用 ctx.threads、ctx.approvals 等生成数据端口;manifest 的 commands.dispatch
|
|
203
|
+
* 权限逐条声明端口所需的命令。`getReceipt(input)` 的签名来自生成的端口:仅查询已声明的原命令类型;落在既有会话上的命令(起轮、
|
|
204
|
+
* 分叉等)要带 threadId 并要求线程执行归属,开会话、导入与其余命令按安装身份映射 commandId、可省略 threadId,
|
|
205
|
+
* 只查得到自己派的。
|
|
206
|
+
*/
|
|
207
|
+
export type PluginCommands = PluginDataPorts["commands"] & {
|
|
208
|
+
/**
|
|
209
|
+
* 为本插件创建的会话检查起轮准入,覆盖聊天、工具和后台入口。
|
|
210
|
+
* 检查期间只能读取状态,不能再派发命令;停用时自动撤销。
|
|
211
|
+
*/
|
|
212
|
+
readonly guard: (guard: {
|
|
213
|
+
readonly name: string;
|
|
214
|
+
readonly check: (input: {
|
|
215
|
+
readonly threadId: string;
|
|
216
|
+
readonly messageId: string;
|
|
217
|
+
/** 有值时,这一轮是已持久通信记录的投递物。 */
|
|
218
|
+
readonly recordId?: string | undefined;
|
|
219
|
+
readonly throughSequence: number;
|
|
220
|
+
}) => Promise<
|
|
221
|
+
{ readonly allowed: true } | { readonly allowed: false; readonly detail: string }
|
|
222
|
+
>;
|
|
223
|
+
}) => PluginDisposer;
|
|
224
|
+
};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 插件 ctx 的 provider 面:机器身份、实例、会话绑定,以及发起 turn 用的模型选择。
|
|
3
|
+
* 公开名字从包入口再导出。
|
|
4
|
+
*
|
|
5
|
+
* @module @ycodium-ai/plugin-api/pluginContextProviders
|
|
6
|
+
*/
|
|
7
|
+
import type { ExecutorSessionCandidate, ExecutorSessionRecord } from "./executorSession.ts";
|
|
8
|
+
import type { PluginDataPorts } from "./dataPorts.gen.ts";
|
|
9
|
+
|
|
10
|
+
/** 这台 environment 的身份。用户看到的名字是「机器」。 */
|
|
11
|
+
export interface PluginEnvironment {
|
|
12
|
+
/** 服务器持久化的 environment id,不是主机名:两台机器可以同名。 */
|
|
13
|
+
readonly id: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* provider 实例当前报出来的一个模型。挑模型只要这三个字段,快照里其余的
|
|
18
|
+
* (能力位、上下文窗口、隐藏标记)是界面的事。
|
|
19
|
+
*/
|
|
20
|
+
export interface PluginProviderModel {
|
|
21
|
+
/** 发起 turn 时写进 modelSelection 的那个值。 */
|
|
22
|
+
readonly slug: string;
|
|
23
|
+
readonly name: string;
|
|
24
|
+
/** 该实例的默认模型。一个实例最多一个。 */
|
|
25
|
+
readonly isDefault: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* 一个 provider 实例的高层视图。宿主替插件解析各 driver 的 home 布局,
|
|
30
|
+
* 插件不抄这些细节。字段只增不改。
|
|
31
|
+
*/
|
|
32
|
+
export interface PluginProviderInstance {
|
|
33
|
+
readonly instanceId: string;
|
|
34
|
+
/** `claudeAgent`、`codex`、`cursor`…… 宿主的 driver 名。 */
|
|
35
|
+
readonly driver: string;
|
|
36
|
+
readonly displayName: string | null;
|
|
37
|
+
readonly enabled: boolean;
|
|
38
|
+
/** 只有解析得出 home 布局的 driver 有值(当前是 claude / codex),其余是 null。 */
|
|
39
|
+
readonly homePath: string | null;
|
|
40
|
+
/** provider CLI 自己的会话转录目录;解析不出来是 null。 */
|
|
41
|
+
readonly transcriptDir: string | null;
|
|
42
|
+
/**
|
|
43
|
+
* provider CLI 读自己配置文件的那个目录:claude 的 `settings.json`、codex 的
|
|
44
|
+
* `config.toml` 都在这里。解析不出来是 null。
|
|
45
|
+
*
|
|
46
|
+
* 判断「这个实例连的到底是不是官方服务」要读这些文件,路径只有宿主算得准
|
|
47
|
+
* (`CLAUDE_CONFIG_DIR` 的优先级、codex 的 auth overlay 布局)。读它本身仍然要
|
|
48
|
+
* `fs.read` 声明覆盖到这个目录。
|
|
49
|
+
*/
|
|
50
|
+
readonly configDirPath: string | null;
|
|
51
|
+
/**
|
|
52
|
+
* 用户为这个实例配了哪些环境变量:只有名字(排序),**不给值**,也不含宿主进程环境。
|
|
53
|
+
*
|
|
54
|
+
* 实例变量里常是 API key,插件拿不到它的值。要判断「用户为这个 provider 配了密钥吗」
|
|
55
|
+
* 看名字在不在这里就够了。
|
|
56
|
+
*/
|
|
57
|
+
readonly environmentKeys: ReadonlyArray<string>;
|
|
58
|
+
/**
|
|
59
|
+
* 这个实例的 **driver 专属设置**,只含名片 `configSchema` 声明过的标量字段(字符串、数字、
|
|
60
|
+
* 布尔),去掉设置表单里画成密码框(`x-ycodium-form.control: "password"`)的字段;未声明的键、
|
|
61
|
+
* 对象与数组字段一律不给——里面可能夹着凭据。
|
|
62
|
+
*
|
|
63
|
+
* **形状随 driver 变,恕不另行通知。** 上面那些字段是宿主挑出来、并且承诺稳定的;
|
|
64
|
+
* 这一份不是承诺,是逃生口——它存在的理由是**不必为每个新需求往上面那张表里再加一个
|
|
65
|
+
* 字段**。读之前必须自己收窄类型;键不存在、类型不对、driver 换了写法,都要能不炸地
|
|
66
|
+
* 退回默认行为。
|
|
67
|
+
*
|
|
68
|
+
* 实例根本没配 driver 设置时是空对象,不是 undefined —— 少一层判空。
|
|
69
|
+
*/
|
|
70
|
+
readonly driverConfig: { readonly [key: string]: unknown };
|
|
71
|
+
/**
|
|
72
|
+
* 实例配置里的启动参数原文;没有就是空串。
|
|
73
|
+
*
|
|
74
|
+
* 与 `apiEndpoint` 一样,是 Usage 搬迁时从 `driverConfig` 里挑出来单开的字段。留着是
|
|
75
|
+
* 因为拿掉会弄坏既有插件,不是因为它们比别的键更重要。**新需求走 `driverConfig`**,
|
|
76
|
+
* 别再往这张表上加 driver 专属字段。
|
|
77
|
+
*/
|
|
78
|
+
readonly launchArgs: string;
|
|
79
|
+
/**
|
|
80
|
+
* 「会话结束后保留它的后台程序」此刻生效的值:实例设置,没设就跟执行器名片的 `keepsBackgroundServices`,
|
|
81
|
+
* 都没有是 false。旧宿主不带这个字段。
|
|
82
|
+
*/
|
|
83
|
+
readonly keepBackgroundServices?: boolean;
|
|
84
|
+
/** 实例配置里的自定义 API endpoint(cursor 的 `-e`);没配是 null。见 `launchArgs`。 */
|
|
85
|
+
readonly apiEndpoint: string | null;
|
|
86
|
+
/**
|
|
87
|
+
* 这个实例当前可选的模型,来自与客户端共用的 provider 模型目录,包含已恢复的缓存。
|
|
88
|
+
*
|
|
89
|
+
* **缺席不等于没有模型**:它表示这个实例在注册表里还没加载出来(driver 没注册、
|
|
90
|
+
* 配置解不动、快照还没建好)。要给一条新 thread 挑模型的插件必须把缺席当作
|
|
91
|
+
* 「这个实例现在起不了 turn」处理,而不是退到某个猜的 slug。
|
|
92
|
+
*/
|
|
93
|
+
readonly models?: readonly PluginProviderModel[];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* 一只手的原生会话入口:终端里跑过、留在磁盘上的那些会话。
|
|
98
|
+
*
|
|
99
|
+
* 形状就是执行器契约里的 `ExecutorSessionCandidate` / `ExecutorSessionRecord`——
|
|
100
|
+
* 宿主只把插件给的值原样递过来,不翻译、不另造同义字段。
|
|
101
|
+
*
|
|
102
|
+
* `scan` 只报手看得见的事实:`availability` 一律是 `"importable"`,「已经有 thread
|
|
103
|
+
* 绑着它了」是宿主的账,调用方自己按 `sessions.list({})` 盖上去。
|
|
104
|
+
*/
|
|
105
|
+
export interface PluginProviderNativeSessions {
|
|
106
|
+
readonly scan: (input: {
|
|
107
|
+
readonly projectId: string;
|
|
108
|
+
readonly directory?: string;
|
|
109
|
+
readonly signal?: AbortSignal;
|
|
110
|
+
}) => Promise<{ readonly candidates: ReadonlyArray<ExecutorSessionCandidate> }>;
|
|
111
|
+
readonly read: (input: {
|
|
112
|
+
readonly nativeSessionId: string;
|
|
113
|
+
readonly cwd: string;
|
|
114
|
+
readonly signal?: AbortSignal;
|
|
115
|
+
}) => Promise<ExecutorSessionRecord>;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
type ProviderDataPorts = PluginDataPorts["providers"];
|
|
119
|
+
|
|
120
|
+
export interface PluginProviders extends ProviderDataPorts {
|
|
121
|
+
/**
|
|
122
|
+
* 这个实例那只手自己会扫原生会话时给出入口;不会扫(宿主内置的 driver,或手没
|
|
123
|
+
* 实现 `sessions`)返回 null,调用方回落到自己那份扫描。
|
|
124
|
+
*
|
|
125
|
+
* 未知 instanceId **拒绝**,不悄悄返回 null:那会把「实例 id 写错了」伪装成
|
|
126
|
+
* 「这只手不会扫」,回落之后照样出结果,没人发现走的一直是自己那份。
|
|
127
|
+
*/
|
|
128
|
+
readonly nativeSessions: (instanceId: string) => Promise<PluginProviderNativeSessions | null>;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** 在某个 provider 实例上选定的一个模型。发起 turn 的命令载荷用的就是这个形状。 */
|
|
132
|
+
export interface PluginModelSelection {
|
|
133
|
+
readonly instanceId: string;
|
|
134
|
+
readonly model: string;
|
|
135
|
+
readonly options?: readonly { readonly id: string; readonly value: string | boolean }[];
|
|
136
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 插件 ctx 的会话面:线程活动、附件、消息、轮次意图和线程只读视图。
|
|
3
|
+
* 公开名字从包入口再导出。
|
|
4
|
+
*
|
|
5
|
+
* @module @ycodium-ai/plugin-api/pluginContextThreads
|
|
6
|
+
*/
|
|
7
|
+
import type {
|
|
8
|
+
ThreadsExecutionGetOutput,
|
|
9
|
+
ThreadsMessagesGetOutput,
|
|
10
|
+
ThreadsTurnsStartInput,
|
|
11
|
+
} from "./dataPorts.gen.ts";
|
|
12
|
+
import type { ExecutorFailureCategory } from "./executorErrors.ts";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 一份要落成会话附件的字节。
|
|
16
|
+
*
|
|
17
|
+
* 大小上限沿用宿主对聊天附件的那一份(按 mime 分档,图片与文件不同),超了就 reject
|
|
18
|
+
* —— 插件不该有一条比人从网页上传更宽的路。
|
|
19
|
+
*/
|
|
20
|
+
export interface PluginAttachmentInput {
|
|
21
|
+
/** 附件挂在哪条会话下。落盘目录按它分,删会话时一起回收。 */
|
|
22
|
+
readonly threadId: string;
|
|
23
|
+
readonly name: string;
|
|
24
|
+
readonly mimeType: string;
|
|
25
|
+
readonly bytes: Uint8Array;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* 落好盘的附件:`{ type, id, name, mimeType, sizeBytes, source? }`。原样塞进 `ctx.threads.turns.start` 的
|
|
30
|
+
* `message.attachments` 即可(宿主核它属于那条会话)。mime 是 `image/*` 就是 `image`,其余都是 `file`。
|
|
31
|
+
* `source`(粘贴文本、截图等来源标记)只出现在读回的消息附件上,`store` 落的不带;塞回时要一起带上,宿主据它
|
|
32
|
+
* 决定怎么投递。
|
|
33
|
+
*/
|
|
34
|
+
export type PluginAttachment = Exclude<
|
|
35
|
+
ThreadsTurnsStartInput["message"]["attachments"][number],
|
|
36
|
+
{ readonly dataUrl: string }
|
|
37
|
+
>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* 把字节落成会话附件。插件面上唯一的字节写口。
|
|
41
|
+
*
|
|
42
|
+
* 起轮带文件时先落盘,再把返回的记录放进 `ctx.threads.turns.start` 的 `message.attachments`;
|
|
43
|
+
* 端口也收网页客户端那种内联 data URL(宿主代为落盘),先落盘能避开大载荷、记录也能复用。
|
|
44
|
+
*/
|
|
45
|
+
export interface PluginAttachments {
|
|
46
|
+
readonly store: (input: PluginAttachmentInput) => Promise<PluginAttachment>;
|
|
47
|
+
/**
|
|
48
|
+
* 按 id 读回字节。附件不在这台机器上就 reject,不回空字节 —— 「没有」与「是空的」
|
|
49
|
+
* 是两回事。
|
|
50
|
+
*
|
|
51
|
+
* 不需要声明:这些 id 本来就写在 `getThread` / `getThreadMessage` 读得到的消息上,
|
|
52
|
+
* 这条只是把「看得见记录」补成「读得到内容」。
|
|
53
|
+
*/
|
|
54
|
+
readonly read: (attachmentId: string) => Promise<Uint8Array>;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** thread 里的一条消息。附件的字节走 `ctx.attachments.read(id)`。 */
|
|
58
|
+
export type PluginThreadMessage = NonNullable<ThreadsMessagesGetOutput>;
|
|
59
|
+
|
|
60
|
+
/** thread 当前的 provider 会话状态。没建过会话是 null。 */
|
|
61
|
+
export interface PluginThreadSession {
|
|
62
|
+
/** `idle` / `starting` / `running` / `stopped`…… 宿主的会话状态名。 */
|
|
63
|
+
readonly status: string;
|
|
64
|
+
readonly providerInstanceId: string | null;
|
|
65
|
+
/** 正在跑的 turn;空闲是 null。 */
|
|
66
|
+
readonly activeTurnId: string | null;
|
|
67
|
+
readonly lastError?: string | null | undefined;
|
|
68
|
+
readonly updatedAt?: string | undefined;
|
|
69
|
+
readonly endReason?: "server-restart" | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* `lastError` 那一次失败是哪一类,跟着它一起写、一起清;适配器没给类别时没有这个键。
|
|
72
|
+
* 它不等于「现在是出错状态」:失败后重新起轮、或收口成 stopped,会话回到 ready 之前它都还在。
|
|
73
|
+
*/
|
|
74
|
+
readonly failureCategory?: ExecutorFailureCategory;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** 完整执行读的生成输出;不存在或不可见时端口回 null。 */
|
|
78
|
+
export type PluginThreadExecution = NonNullable<ThreadsExecutionGetOutput>;
|
|
79
|
+
/** 子会话的来源;与完整执行读的 `origin` 同一份生成类型。 */
|
|
80
|
+
export type PluginThreadOrigin = NonNullable<PluginThreadExecution["origin"]>;
|
|
81
|
+
/** 分叉点;与完整执行读的 `forkedFrom` 同一份生成类型。 */
|
|
82
|
+
export type PluginThreadForkPoint = NonNullable<PluginThreadExecution["forkedFrom"]>;
|
|
83
|
+
export type PluginTurnIntent = PluginThreadExecution["turnIntents"][number];
|