@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,671 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@ycodium-ai/plugin-api/ui` 是插件页面、面板和嵌入视图的契约(ADR-0021)。
|
|
3
|
+
* 本包零运行时依赖。React、JSX runtime 与宿主组件用类型参数表达,
|
|
4
|
+
* 插件自己的 `@types/react` 提供它们的类型。
|
|
5
|
+
*
|
|
6
|
+
* ESM 入口默认导出 `register(bridge)`;宿主按机器及插件版本注册,
|
|
7
|
+
* 停用或卸载时丢弃注册结果。页面和面板的 key 对应 manifest 的 ID。
|
|
8
|
+
* 入口或注册结果无效、声明的槽位缺少组件时,宿主只标记相关插件的槽位加载失败。
|
|
9
|
+
*
|
|
10
|
+
* `views` 的调用方约定 props,组件共享插件的机器作用域、React 和翻译。
|
|
11
|
+
* 执行器的 provider 设置区块也用 view,见 `@ycodium-ai/plugin-api/provider-settings`。
|
|
12
|
+
* 遇到缺失或停用的 view,宿主显示不可用状态。
|
|
13
|
+
*
|
|
14
|
+
* 构建配置、页面外壳、图标和壁纸见 [包 README](../README.md#plugin-pages-panels-and-embedded-views)。
|
|
15
|
+
*
|
|
16
|
+
* @module @ycodium-ai/plugin-api/ui
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import type {
|
|
20
|
+
ConversationChildSeat,
|
|
21
|
+
ConversationSlotName,
|
|
22
|
+
PluginMachineActionContext,
|
|
23
|
+
} from "./slots.ts";
|
|
24
|
+
import type { PluginUiTeamViewRegistration } from "./teamView.ts";
|
|
25
|
+
export * from "./teamView.ts";
|
|
26
|
+
import type { PluginUiDataReadId, PluginUiDataReads } from "./dataPorts.gen.ts";
|
|
27
|
+
export type { PluginUiDataReadId, PluginUiDataReads } from "./dataPorts.gen.ts";
|
|
28
|
+
import type { PluginUiSessionProjections } from "./uiSessionProjections.ts";
|
|
29
|
+
export type {
|
|
30
|
+
PluginUiSessionProjection,
|
|
31
|
+
PluginUiSessionProjections,
|
|
32
|
+
} from "./uiSessionProjections.ts";
|
|
33
|
+
export type * from "./communication-view.ts";
|
|
34
|
+
export { communicationRecordStage } from "./communication-view.ts";
|
|
35
|
+
export type * from "./decision-card.ts";
|
|
36
|
+
export type * from "./inline-tag.ts";
|
|
37
|
+
export type * from "./settings-ui.ts";
|
|
38
|
+
export type * from "./entity-names.ts";
|
|
39
|
+
export type * from "./model-picker.ts";
|
|
40
|
+
export type * from "./composer-control.ts";
|
|
41
|
+
export type * from "./timeline-row-error.ts";
|
|
42
|
+
export type * from "./timeline-process.ts";
|
|
43
|
+
import type { PluginUiProjectNameProps, PluginUiThreadNameProps } from "./entity-names.ts";
|
|
44
|
+
/** 宿主白名单图标,纯装饰、尺寸跟随字号;未知名称不渲染。 */
|
|
45
|
+
export interface PluginIconProps {
|
|
46
|
+
readonly name: string;
|
|
47
|
+
readonly className?: string;
|
|
48
|
+
}
|
|
49
|
+
/** 宿主对象挂在 window 上的名字。它进了已发布的 bundle,改名等于换契约。 */
|
|
50
|
+
export const PLUGIN_UI_GLOBAL_KEY = "__ycodiumPluginHost";
|
|
51
|
+
/** UI 契约版本。加字段不动它;改已有字段的形状必须进位。 */
|
|
52
|
+
export { PLUGIN_UI_BRIDGE_VERSION } from "./ui-bridge-version.ts";
|
|
53
|
+
import type { PluginUiHostCapability } from "./uiHostCapabilities.ts";
|
|
54
|
+
import type { PluginUiAdmitMachineInput, PluginUiMachineAdmission } from "./uiMachineAdmission.ts";
|
|
55
|
+
export type {
|
|
56
|
+
PluginUiAdmitMachineInput,
|
|
57
|
+
PluginUiMachineAdmission,
|
|
58
|
+
PluginUiMachineAdmissionResult,
|
|
59
|
+
} from "./uiMachineAdmission.ts";
|
|
60
|
+
export {
|
|
61
|
+
PLUGIN_UI_HOST_CAPABILITIES,
|
|
62
|
+
PLUGIN_UI_HOST_UPGRADE_MESSAGE,
|
|
63
|
+
PLUGIN_UI_HOST_COMMAND_PALETTE_UNAVAILABLE_MESSAGE,
|
|
64
|
+
pluginUiHostHasCapability,
|
|
65
|
+
type PluginUiHostCapability,
|
|
66
|
+
} from "./uiHostCapabilities.ts";
|
|
67
|
+
/** 浮窗来源的宽高;只取比例,不必是像素。 */
|
|
68
|
+
export interface PluginUiFloatingSize {
|
|
69
|
+
readonly width: number;
|
|
70
|
+
readonly height: number;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* 请求把本插件的一个嵌入视图浮在某条会话的聊天上(与浏览器浮窗共用同一个窗,一条会话一个)。
|
|
75
|
+
* `key` 由插件定、在本插件里唯一,同一 key 再开只更新内容;`viewId` 是 bundle 里 `views` 的 id,
|
|
76
|
+
* 宿主用 {@link PluginUiFloatingViewProps} 加上 `props` 去挂它。
|
|
77
|
+
*/
|
|
78
|
+
export interface PluginUiFloatingRequest {
|
|
79
|
+
readonly viewId: string;
|
|
80
|
+
readonly key: string;
|
|
81
|
+
/** 读屏标签与浮窗说明里的名字,如设备名。 */
|
|
82
|
+
readonly title: string;
|
|
83
|
+
/** 可序列化的数据(宿主按内容比较、不保留函数);回调写在视图自己里。 */
|
|
84
|
+
readonly props?: Readonly<Record<string, unknown>>;
|
|
85
|
+
/** 视图报出真实尺寸之前用的宽高比,如手机竖屏;缺省为方形。 */
|
|
86
|
+
readonly sourceSize?: PluginUiFloatingSize;
|
|
87
|
+
/** 裁切圆角占短边的比例(画面里自带圆角时用);缺省为浮窗通用圆角。 */
|
|
88
|
+
readonly cornerRatio?: number;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** {@link PluginUiFloating.open} 的入参。 */
|
|
92
|
+
export interface PluginUiFloatingOpen extends PluginUiFloatingRequest {
|
|
93
|
+
/**
|
|
94
|
+
* `user`:用户点的,一定浮起。`agent`:agent 打开的,宿主按「自动显示浮动预览」设置决定
|
|
95
|
+
* 浮起,还是改开 `panelId` 那个本插件面板;插件不读这个设置。
|
|
96
|
+
*/
|
|
97
|
+
readonly reason: "user" | "agent";
|
|
98
|
+
/** `reason` 为 `agent` 且不自动浮起时打开的本插件面板 id;缺省就什么都不做。 */
|
|
99
|
+
readonly panelId?: string;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* 浮窗(`bridge.floating`)。只管本插件自己的来源;会话由 `target` 指定。旧宿主没有,先用
|
|
104
|
+
* {@link pluginUiHostHasCapability} 判断 `floating`。
|
|
105
|
+
*/
|
|
106
|
+
export interface PluginUiFloating {
|
|
107
|
+
open(target: PluginUiThreadTarget, request: PluginUiFloatingOpen): void;
|
|
108
|
+
/** 只关本插件、这个 key 的浮窗;浮着别的就不动。 */
|
|
109
|
+
close(target: PluginUiThreadTarget, key: string): void;
|
|
110
|
+
/**
|
|
111
|
+
* 本插件的右面板此刻正呈现什么(面板挂着时上报,换了就再报,卸载报 null)。同一 key 的
|
|
112
|
+
* 浮窗随之让开,同一路画面只出现在一处;用户关掉右面板时,宿主把它浮起来继续看。
|
|
113
|
+
*/
|
|
114
|
+
present(target: PluginUiThreadTarget, request: PluginUiFloatingRequest | null): void;
|
|
115
|
+
/** 打开本插件 manifest 里声明的那个面板。 */
|
|
116
|
+
openPanel(target: PluginUiThreadTarget, panelId: string): void;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** 浮窗挂视图时额外给的 prop 名,值为 {@link PluginUiFloatingViewControls}。 */
|
|
120
|
+
export const PLUGIN_UI_FLOATING_VIEW_PROP = "floating";
|
|
121
|
+
|
|
122
|
+
/** 浮窗里的视图拿到的控制面。 */
|
|
123
|
+
export interface PluginUiFloatingViewControls {
|
|
124
|
+
readonly key: string;
|
|
125
|
+
/** 内容的真实尺寸(如设备旋转后);浮窗按它定宽高比。null 退回请求里的 `sourceSize`。 */
|
|
126
|
+
reportSourceSize(size: PluginUiFloatingSize | null): void;
|
|
127
|
+
/** 浮窗操作条「在右面板打开」的处理;不注册就不显示这个按钮。 */
|
|
128
|
+
setOpenInPanel(handler: (() => void) | null): void;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** 浮窗视图的 props:请求里的 `props`、会话目标,加上 {@link PLUGIN_UI_FLOATING_VIEW_PROP}。 */
|
|
132
|
+
export type PluginUiFloatingViewProps<Props = Readonly<Record<string, unknown>>> = Props &
|
|
133
|
+
PluginUiThreadTarget & {
|
|
134
|
+
readonly [PLUGIN_UI_FLOATING_VIEW_PROP]: PluginUiFloatingViewControls;
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
/** {@link PluginUiNetworkClient.fetch} 的选项。`instance` 是服务实例,缺省 `"default"`。 */
|
|
138
|
+
export interface PluginUiNetworkFetchInit {
|
|
139
|
+
readonly instance?: string;
|
|
140
|
+
readonly method?: string;
|
|
141
|
+
readonly headers?: NonNullable<RequestInit["headers"]>;
|
|
142
|
+
readonly body?: string | Uint8Array;
|
|
143
|
+
readonly signal?: AbortSignal;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** 类 WebSocket:只有插件网络代理用得到的那几样。二进制消息给 ArrayBuffer。 */
|
|
147
|
+
export interface PluginUiNetworkSocket {
|
|
148
|
+
/** 0 连接中、1 已打开、2 正在关、3 已关,同 WebSocket。 */
|
|
149
|
+
readonly readyState: number;
|
|
150
|
+
/** 服务选中的子协议;没有就是空串。 */
|
|
151
|
+
readonly protocol: string;
|
|
152
|
+
onopen: ((event: { readonly type: "open" }) => void) | null;
|
|
153
|
+
onmessage:
|
|
154
|
+
| ((event: { readonly type: "message"; readonly data: string | ArrayBuffer }) => void)
|
|
155
|
+
| null;
|
|
156
|
+
onerror: ((event: { readonly type: "error"; readonly error: Error }) => void) | null;
|
|
157
|
+
onclose:
|
|
158
|
+
| ((event: {
|
|
159
|
+
readonly type: "close";
|
|
160
|
+
readonly code: number;
|
|
161
|
+
readonly reason: string;
|
|
162
|
+
readonly wasClean: boolean;
|
|
163
|
+
}) => void)
|
|
164
|
+
| null;
|
|
165
|
+
send(data: string | ArrayBuffer | Uint8Array): void;
|
|
166
|
+
close(code?: number, reason?: string): void;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* 一台机器上本插件的网络服务(manifest 的 `network.serve`)。只能访问声明过的路由;
|
|
171
|
+
* 请求经宿主的受保护通道到达服务,插件页面拿不到会话凭据。
|
|
172
|
+
*/
|
|
173
|
+
export interface PluginUiNetworkClient {
|
|
174
|
+
/** `pathWithQuery` 以 `/` 开头,可带查询串。响应体是流,适合长画面流。 */
|
|
175
|
+
fetch(service: string, pathWithQuery: string, init?: PluginUiNetworkFetchInit): Promise<Response>;
|
|
176
|
+
connect(
|
|
177
|
+
service: string,
|
|
178
|
+
pathWithQuery: string,
|
|
179
|
+
options?: { readonly instance?: string; readonly protocols?: string | readonly string[] },
|
|
180
|
+
): PluginUiNetworkSocket;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export interface PluginUiNetwork {
|
|
184
|
+
/**
|
|
185
|
+
* 连到某台机器上本插件的服务。连不上时 `client()` 或之后的 `fetch` / `connect` 以带 `code` 的
|
|
186
|
+
* 错误失败,照 `code` 分支:`not-connected`(机器离线)、`direct-or-relay-required`(只剩 SSH
|
|
187
|
+
* 应急通道)、`host-key-unknown`、`host-key-mismatch`。这几种的 `message` 已按用户当前语言写好,
|
|
188
|
+
* 可以直接显示;其余 `code`(如 `route-not-allowed`)多半是插件自己的问题。
|
|
189
|
+
*/
|
|
190
|
+
client(environmentId: string): Promise<PluginUiNetworkClient>;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* `react/jsx-runtime` 的三个导出。本包不引 react 类型,所以这里只保证"有这三个
|
|
195
|
+
* 字段";shim 把它们原样 re-export 出去之后,类型由插件自己的 `@types/react` 给。
|
|
196
|
+
*/
|
|
197
|
+
export interface PluginUiJsxRuntime {
|
|
198
|
+
readonly jsx: unknown;
|
|
199
|
+
readonly jsxs: unknown;
|
|
200
|
+
readonly Fragment: unknown;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export interface PluginUiCommandOptions {
|
|
204
|
+
/** 缺省是这张页面所属的那台机器。 */
|
|
205
|
+
readonly environmentId?: string;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/** `commands.invoke` 的选项。 */
|
|
209
|
+
export interface PluginUiInvokeOptions extends PluginUiCommandOptions {
|
|
210
|
+
/**
|
|
211
|
+
* 用户在这条会话里发起这次调用(比如「在这条会话里开团队 run」)。宿主核实会话存在、没删、
|
|
212
|
+
* 没归档、属于这台机器的项目后,记成本插件可用的父会话:插件开的子会话可以挂在它下面。
|
|
213
|
+
* 核不上就拒绝整次调用。只读的 `useQuery` / `useSubscription` 不接。
|
|
214
|
+
*/
|
|
215
|
+
readonly threadId?: string;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/** `commands.useQuery` 的返回形状。 */
|
|
219
|
+
export interface PluginUiCommandQuery<Value = unknown> {
|
|
220
|
+
readonly data: Value | null;
|
|
221
|
+
readonly error: string | null;
|
|
222
|
+
readonly isPending: boolean;
|
|
223
|
+
/** 这台机器没装 / 未启用该插件(ADR-0021 的多机降级),不是硬错误。 */
|
|
224
|
+
readonly isUnavailable: boolean;
|
|
225
|
+
readonly refresh: () => void;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/** `useQueryEach` 的选项。`refreshKey` 由插件自己选,桥只在它变化时重读。 */
|
|
229
|
+
export interface PluginUiQueryEachOptions {
|
|
230
|
+
readonly refreshKey?: unknown;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/** 跨机器查询的一台目标。payload 可以按机器不同,归属与凭据因此不会串。 */
|
|
234
|
+
export interface PluginUiCommandTarget {
|
|
235
|
+
readonly environmentId: string;
|
|
236
|
+
readonly payload?: unknown;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/** 已连接机器的只读身份。`pluginLoaded` 只谈**这个**插件在那台机器上。 */
|
|
240
|
+
export interface PluginUiConnectedEnvironment {
|
|
241
|
+
readonly environmentId: string;
|
|
242
|
+
readonly label: string;
|
|
243
|
+
/** 这台机器已经配了 serverConfig,页面可以问它。 */
|
|
244
|
+
readonly connected: boolean;
|
|
245
|
+
readonly pluginLoaded: boolean;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export interface PluginUiLocation {
|
|
249
|
+
readonly pathname: string;
|
|
250
|
+
/** 含前导 `?`;没有查询串时是空字符串。 */
|
|
251
|
+
readonly search: string;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/** 文档面板只描述标签,不持有文件系统或插件业务状态。 */
|
|
255
|
+
export interface PluginUiDocumentTab<Icon = unknown> {
|
|
256
|
+
readonly id: string;
|
|
257
|
+
readonly title: string;
|
|
258
|
+
readonly description?: string;
|
|
259
|
+
readonly status?: "loading" | "ready" | "error";
|
|
260
|
+
readonly icon?: Icon;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/** 宿主原语 `DocumentPanel`:带标签页的文档面板(窄屏是底部抽屉)。`Node` 是 React 节点类型。 */
|
|
264
|
+
export interface PluginUiDocumentPanelProps<Node = unknown> {
|
|
265
|
+
readonly tabs: readonly PluginUiDocumentTab<Node>[];
|
|
266
|
+
readonly activeId: string | null;
|
|
267
|
+
readonly widthStorageKey: string;
|
|
268
|
+
readonly defaultWidth?: number;
|
|
269
|
+
readonly onActivate: (id: string) => void;
|
|
270
|
+
readonly onClose: (id: string) => void;
|
|
271
|
+
readonly onCloseOthers: (id: string) => void;
|
|
272
|
+
readonly onCloseToRight: (id: string) => void;
|
|
273
|
+
readonly onCloseAll: () => void;
|
|
274
|
+
readonly children?: Node;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export type PluginUiNotifyTone = "info" | "success" | "warning" | "error";
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* 插件命令的单信封(ADR-0021 第 1 条)。`pluginId` 由宿主补上,插件填不了别人的
|
|
281
|
+
* 名字;`payload` 的形状由插件自己声明的 JSON Schema 决定,宿主在信封入口校验。
|
|
282
|
+
*/
|
|
283
|
+
export interface PluginUiCommands {
|
|
284
|
+
/** 连续读取本插件流命令的所有帧,直到流结束或 signal 中止。 */
|
|
285
|
+
stream?(
|
|
286
|
+
command: string,
|
|
287
|
+
payload: unknown,
|
|
288
|
+
options: PluginUiCommandOptions & {
|
|
289
|
+
readonly signal: AbortSignal;
|
|
290
|
+
readonly onValue: (value: unknown) => void;
|
|
291
|
+
},
|
|
292
|
+
): Promise<void>;
|
|
293
|
+
/** 一次调用。失败时 reject(`plugin-unavailable` 也算失败)。 */
|
|
294
|
+
invoke(command: string, payload?: unknown, options?: PluginUiInvokeOptions): Promise<unknown>;
|
|
295
|
+
/** React hook:带缓存,插件重挂、版本或配置变化时重取;`refresh()` 可主动重取。必须遵守 hooks 调用规则。 */
|
|
296
|
+
useQuery(
|
|
297
|
+
command: string,
|
|
298
|
+
payload?: unknown,
|
|
299
|
+
options?: PluginUiCommandOptions,
|
|
300
|
+
): PluginUiCommandQuery;
|
|
301
|
+
/**
|
|
302
|
+
* React hook:持续读取流式命令的最新值,不轮询。机器、命令或 payload 变化时
|
|
303
|
+
* 切换订阅,组件卸载后释放;相同目标复用宿主订阅。首个值到达前 isPending 为 true,
|
|
304
|
+
* 未选定机器时返回空状态。refresh() 重新建立订阅。
|
|
305
|
+
*/
|
|
306
|
+
useSubscription(
|
|
307
|
+
command: string,
|
|
308
|
+
payload?: unknown,
|
|
309
|
+
options?: PluginUiCommandOptions,
|
|
310
|
+
): PluginUiCommandQuery;
|
|
311
|
+
/**
|
|
312
|
+
* 对若干台机器各发一次同一命令。`targets` 变长时这一钩子的调用次数不变——扇出在
|
|
313
|
+
* 宿主内部,插件不要自己对 `useQuery` 做变长循环。
|
|
314
|
+
* `refreshKey` 变了就重读;宿主不解释这个值,也不在桥里写某个插件的名字。
|
|
315
|
+
*/
|
|
316
|
+
useQueryEach(
|
|
317
|
+
command: string,
|
|
318
|
+
targets: ReadonlyArray<PluginUiCommandTarget>,
|
|
319
|
+
options?: PluginUiQueryEachOptions,
|
|
320
|
+
): {
|
|
321
|
+
readonly rows: ReadonlyArray<PluginUiCommandQuery & { readonly environmentId: string }>;
|
|
322
|
+
readonly refresh: () => void;
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* 读取宿主登记的数据,按插件清单已声明的权限放行。缺省机器是页面所属机器;
|
|
328
|
+
* 机器没装或停用本插件时,查询返回 isUnavailable。要实时更新的继续用插件自己的
|
|
329
|
+
* 流命令(`commands.useSubscription`)。能力号与输入输出只取生成的读子集。
|
|
330
|
+
*/
|
|
331
|
+
export interface PluginUiData {
|
|
332
|
+
/** 一次读取;失败时 reject,插件不可用也算失败。 */
|
|
333
|
+
read<Id extends PluginUiDataReadId>(
|
|
334
|
+
id: Id,
|
|
335
|
+
input: PluginUiDataReads[Id]["input"],
|
|
336
|
+
options?: PluginUiCommandOptions,
|
|
337
|
+
): Promise<PluginUiDataReads[Id]["output"]>;
|
|
338
|
+
/** React hook:带缓存,插件重挂、版本或配置变化时重取;refresh() 可主动重取。遵守 hooks 调用规则。 */
|
|
339
|
+
useQuery<Id extends PluginUiDataReadId>(
|
|
340
|
+
id: Id,
|
|
341
|
+
input: PluginUiDataReads[Id]["input"],
|
|
342
|
+
options?: PluginUiCommandOptions,
|
|
343
|
+
): PluginUiCommandQuery<PluginUiDataReads[Id]["output"]>;
|
|
344
|
+
/** 由宿主对各台机器扇出;refreshKey 变化时重读。 */
|
|
345
|
+
useQueryEach<Id extends PluginUiDataReadId>(
|
|
346
|
+
id: Id,
|
|
347
|
+
targets: ReadonlyArray<{
|
|
348
|
+
readonly environmentId: string;
|
|
349
|
+
readonly input: PluginUiDataReads[Id]["input"];
|
|
350
|
+
}>,
|
|
351
|
+
options?: PluginUiQueryEachOptions,
|
|
352
|
+
): {
|
|
353
|
+
readonly rows: ReadonlyArray<
|
|
354
|
+
PluginUiCommandQuery<PluginUiDataReads[Id]["output"]> & { readonly environmentId: string }
|
|
355
|
+
>;
|
|
356
|
+
readonly refresh: () => void;
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/** 会话身份必须同时包含所属机器,不能根据当前机器猜测。 */
|
|
361
|
+
export interface PluginUiThreadTarget {
|
|
362
|
+
readonly environmentId: string;
|
|
363
|
+
readonly threadId: string;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/** 新建会话时要落到哪一个项目。 */
|
|
367
|
+
export interface PluginUiProjectTarget {
|
|
368
|
+
readonly environmentId: string;
|
|
369
|
+
readonly projectId: string;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
export interface PluginUiComposerDraft {
|
|
373
|
+
readonly prompt: string;
|
|
374
|
+
readonly reviewComments: ReadonlyArray<unknown>;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/** 某条会话工作区里的一个文件。路径相对工作区,也收落在工作区内的绝对路径。 */
|
|
378
|
+
export interface PluginUiWorkspaceFile {
|
|
379
|
+
readonly environmentId: string;
|
|
380
|
+
readonly threadId: string;
|
|
381
|
+
readonly path: string;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/** 文件的签名地址;`failed` 是文件不在、不在工作区内或机器拒绝。 */
|
|
385
|
+
export type PluginUiAssetUrl =
|
|
386
|
+
| { readonly status: "loading" }
|
|
387
|
+
| { readonly status: "ready"; readonly url: string }
|
|
388
|
+
| { readonly status: "failed" };
|
|
389
|
+
export interface PluginUiWorkspaceRef {
|
|
390
|
+
readonly name: string;
|
|
391
|
+
readonly sha?: string | null;
|
|
392
|
+
readonly isDefault?: boolean;
|
|
393
|
+
readonly isRemote?: boolean;
|
|
394
|
+
readonly remoteName?: string | null;
|
|
395
|
+
}
|
|
396
|
+
export interface PluginUiPrepareWorkspaceInput {
|
|
397
|
+
readonly environmentId: string;
|
|
398
|
+
readonly cwd: string;
|
|
399
|
+
readonly reference: string;
|
|
400
|
+
readonly mode: "local" | "worktree";
|
|
401
|
+
readonly threadId?: string;
|
|
402
|
+
}
|
|
403
|
+
export interface PluginUiPrepareWorkspaceResult {
|
|
404
|
+
readonly branch: string;
|
|
405
|
+
readonly worktreePath: string | null;
|
|
406
|
+
readonly isOnPullRequestHead: boolean;
|
|
407
|
+
}
|
|
408
|
+
export interface PluginUiNotifyTaskHandle {
|
|
409
|
+
succeed(result: { title: string; description?: string }): void;
|
|
410
|
+
fail(result: { title: string; description?: string }): void;
|
|
411
|
+
}
|
|
412
|
+
export interface PluginUiComposerDraftApi {
|
|
413
|
+
get(target: unknown): PluginUiComposerDraft | null;
|
|
414
|
+
setPrompt(target: unknown, prompt: string): void;
|
|
415
|
+
/** 在末尾追加,不发送。保留已有正文和引用芯片。 */
|
|
416
|
+
appendPrompt(target: unknown, text: string): void;
|
|
417
|
+
setReviewComments(target: unknown, comments: ReadonlyArray<unknown>): void;
|
|
418
|
+
}
|
|
419
|
+
export interface PluginUiI18n {
|
|
420
|
+
/**
|
|
421
|
+
* 插件自带 `locales/<locale>.json` 注册成的 `plugin:<pluginId>` 命名空间;
|
|
422
|
+
* 缺键按字面显示。是 hook,切语言才会重渲染。
|
|
423
|
+
*/
|
|
424
|
+
usePluginTranslation(): (key: string, options?: Record<string, unknown>) => string;
|
|
425
|
+
/**
|
|
426
|
+
* 宿主替插件说一句本地化的话:插件命令或工具调用因目标项目的家不在这台机器(`not-project-home`)、或暂时读不出家
|
|
427
|
+
* (`project-home-unconfirmed`)而没执行时,拿失败对象(带 `pluginCode` / `pluginData`)问它,得到「这个项目的家在 X,请到那台
|
|
428
|
+
* 机器上操作」或「暂时无法确认」这一句,随界面语言。不是这类失败返回 `undefined`,由插件用自己的文案。是 hook,切语言才会重渲染。
|
|
429
|
+
*/
|
|
430
|
+
useHostFailureText(): (error: unknown) => string | undefined;
|
|
431
|
+
}
|
|
432
|
+
/** 用户发起的端口打开动作。宿主检查登记归属并维护本机转发;插件只传目标内的相对路径。 */
|
|
433
|
+
export interface PluginUiRegisteredPorts {
|
|
434
|
+
readonly availability: "ready" | "desktop-required" | "upgrade-required";
|
|
435
|
+
open(input: {
|
|
436
|
+
readonly environmentId: string;
|
|
437
|
+
readonly portId: string;
|
|
438
|
+
readonly path: string;
|
|
439
|
+
readonly onProgress?: (
|
|
440
|
+
stage: "open-channel" | "open-forward" | "open-browser",
|
|
441
|
+
status: "started" | "succeeded" | "failed",
|
|
442
|
+
) => void;
|
|
443
|
+
readonly signal?: AbortSignal;
|
|
444
|
+
}): Promise<void>;
|
|
445
|
+
close(input: { readonly environmentId: string; readonly portId: string }): Promise<void>;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* `register(bridge)` 拿到的那个对象:冻结、按插件作用域。`Ui` / `Layout` /
|
|
450
|
+
* `React` 是不透明参数——宿主传进来的是真东西,本包只是不给它们类型。
|
|
451
|
+
*/
|
|
452
|
+
export interface PluginUiBridge<Ui = unknown, Layout = unknown, React = unknown> {
|
|
453
|
+
readonly version: number;
|
|
454
|
+
/** 就是这个插件自己的 id,宿主填,插件改不了。 */
|
|
455
|
+
readonly pluginId: string;
|
|
456
|
+
/**
|
|
457
|
+
* 这台宿主声明会做的新动作。缺席 = 旧宿主,请用 {@link pluginUiHostHasCapability}
|
|
458
|
+
* 判断,不要直接调可能不存在的方法。
|
|
459
|
+
*/
|
|
460
|
+
readonly capabilities?: ReadonlyArray<PluginUiHostCapability>;
|
|
461
|
+
readonly react: React;
|
|
462
|
+
readonly jsxRuntime: PluginUiJsxRuntime;
|
|
463
|
+
/** 宿主借出的通用组件(按钮、卡片、表格、PluginIcon 等);图标参数见 PluginIconProps。 */
|
|
464
|
+
readonly ui: Ui;
|
|
465
|
+
/** 整页布局原语。 */
|
|
466
|
+
readonly layout: Layout;
|
|
467
|
+
readonly i18n: PluginUiI18n;
|
|
468
|
+
readonly commands: PluginUiCommands;
|
|
469
|
+
readonly registeredPorts?: PluginUiRegisteredPorts;
|
|
470
|
+
readonly data: PluginUiData;
|
|
471
|
+
readonly sessionProjections: PluginUiSessionProjections;
|
|
472
|
+
readonly signIn: { start(name: string): Promise<"signed-in" | "cancelled"> };
|
|
473
|
+
/** 当前页面所属机器;是 hook,宿主切换机器时会重新渲染。 */
|
|
474
|
+
useEnvironmentId(): string | null;
|
|
475
|
+
/** 工作区里已连接的机器,以及这个插件在各自上面跑没跑。是 hook。 */
|
|
476
|
+
useConnectedEnvironments(): readonly PluginUiConnectedEnvironment[];
|
|
477
|
+
/**
|
|
478
|
+
* 仓库身份补上或变化时变。插件把它传给 `useQueryEach` 的 `refreshKey`。
|
|
479
|
+
* 是 hook。桥不替某个插件决定要不要重读。
|
|
480
|
+
*/
|
|
481
|
+
useRepositoryIdentityKey(): unknown;
|
|
482
|
+
/** 当前路由的 path 与 query;是 hook,宿主导航后会重新渲染。 */
|
|
483
|
+
useLocation(): PluginUiLocation;
|
|
484
|
+
/** 按客户端的时间显示偏好格式化时间;hook 随偏好变化更新。 */
|
|
485
|
+
useFormatTimestamp(): (iso: string) => string;
|
|
486
|
+
/** 默认占位会话标题按界面语言显示;缺席时保留标题原值。是 hook。 */
|
|
487
|
+
useThreadDisplayTitle?(): (title: string) => string;
|
|
488
|
+
/** 句子里提到实体时取纯文本;查不到由宿主写「未知…」,绝不回退到 id。旧宿主可缺席。 */
|
|
489
|
+
useMachineName?(environmentId: string, fallbackName?: string): string;
|
|
490
|
+
useProjectName?(
|
|
491
|
+
projectRef: PluginUiProjectNameProps["projectRef"],
|
|
492
|
+
fallbackName?: string,
|
|
493
|
+
): string;
|
|
494
|
+
useProviderName?(environmentId: string | null, instanceId: string, fallbackName?: string): string;
|
|
495
|
+
useThreadName?(threadRef: PluginUiThreadNameProps["threadRef"], fallbackName?: string): string;
|
|
496
|
+
usePluginName?(environmentId: string | null, pluginId: string, fallbackName?: string): string;
|
|
497
|
+
/** 工作项状态在界面上叫什么:默认状态按界面语言,改过名的与自定义的照原名。是 hook;旧宿主缺席时显示 `name`。 */
|
|
498
|
+
useWorkStateName?(): (state: {
|
|
499
|
+
readonly name: string;
|
|
500
|
+
readonly defaultKey?: string | undefined;
|
|
501
|
+
}) => string;
|
|
502
|
+
/** 是 hook:把连着的一台机器接入项目(同项目设置「机器」的自动接入);已在项目里立即成功,失败的 error 给人看。
|
|
503
|
+
* 不解除移除决定;显式加回用 machineAddBack 能力的 useMachineAdmission。
|
|
504
|
+
* 旧宿主与手机没有它,先判能力 `machineAdmission`。 */
|
|
505
|
+
useAdmitMachine?(): (
|
|
506
|
+
input: PluginUiAdmitMachineInput,
|
|
507
|
+
) => Promise<{ ok: true } | { ok: false; error: string }>;
|
|
508
|
+
/** 只读接入状态与显式加回;缺少 machineAddBack 能力时不得把普通接入当加回。 */
|
|
509
|
+
useMachineAdmission?(input: PluginUiAdmitMachineInput): PluginUiMachineAdmission;
|
|
510
|
+
/** 一条短通知。语气缺省 info。第三参是可选说明,宿主弹层会单独画。 */
|
|
511
|
+
notify(message: string, tone?: PluginUiNotifyTone, detail?: string): void;
|
|
512
|
+
/** 进行中的活条目:同一条从 loading 改到成功或失败。 */
|
|
513
|
+
notifyTask(input: { title: string; description?: string }): PluginUiNotifyTaskHandle;
|
|
514
|
+
writeClipboard(text: string): Promise<void>;
|
|
515
|
+
/** 在系统浏览器打开 http(s) 链接;其它协议丢掉。 */
|
|
516
|
+
openExternal(url: string): void;
|
|
517
|
+
/** 打开管理插件的宿主设置。 */
|
|
518
|
+
openPluginSettings?(): void;
|
|
519
|
+
/** 打开宿主命令面板;`open` 只认宿主已有的入口名。`"add-project"` 改开添加项目弹窗,预选 `environmentId`。 */
|
|
520
|
+
openCommandPalette(detail?: { open?: string; environmentId?: string }): void;
|
|
521
|
+
/**
|
|
522
|
+
* 在指定项目开一条新会话(或复用该项目的草稿)。是 hook。
|
|
523
|
+
* 检出/worktree 通过 `options` 交给宿主,插件自己不起 git。
|
|
524
|
+
*/
|
|
525
|
+
useCreateThread(): (
|
|
526
|
+
project: PluginUiProjectTarget,
|
|
527
|
+
options?: {
|
|
528
|
+
branch?: string | null;
|
|
529
|
+
worktreePath?: string | null;
|
|
530
|
+
},
|
|
531
|
+
) => Promise<{ draftId: string; threadId: string } | null>;
|
|
532
|
+
/**
|
|
533
|
+
* 把工作区切到某个引用(本仓库或独立 worktree)。是 hook。
|
|
534
|
+
* 实际 git 仍走宿主 RPC,不把二进制解析权交给插件。
|
|
535
|
+
*/
|
|
536
|
+
usePrepareWorkspace(): (
|
|
537
|
+
input: PluginUiPrepareWorkspaceInput,
|
|
538
|
+
) => Promise<{ ok: true; value: PluginUiPrepareWorkspaceResult } | { ok: false; error: string }>;
|
|
539
|
+
/** 列出工作区当前引用,用来判断叠放的 PR。是 hook。 */
|
|
540
|
+
useWorkspaceRefs(
|
|
541
|
+
input: {
|
|
542
|
+
environmentId: string;
|
|
543
|
+
cwd: string;
|
|
544
|
+
includeMatchingRemoteRefs?: boolean;
|
|
545
|
+
limit?: number;
|
|
546
|
+
} | null,
|
|
547
|
+
): PluginUiCommandQuery<{ refs: ReadonlyArray<PluginUiWorkspaceRef> }>;
|
|
548
|
+
/** 读写宿主 composer 草稿。不经插件命令,因为草稿只活在客户端。 */
|
|
549
|
+
readonly composerDraft: PluginUiComposerDraftApi;
|
|
550
|
+
/**
|
|
551
|
+
* 第一轮之前的预设选择。不进 `PLUGIN_UI_HOST_CAPABILITIES`:缺席就是这台宿主还没接。
|
|
552
|
+
* 同一进程里的座位改用 owner 上的 `onSelectPreset`,不走这里。
|
|
553
|
+
*/
|
|
554
|
+
readonly agentPreset?: {
|
|
555
|
+
select(presetId: string | null): Promise<void>;
|
|
556
|
+
};
|
|
557
|
+
/**
|
|
558
|
+
* 打开产品浏览器。不进能力表。缺席时插件只给 http(s) 的系统浏览器。
|
|
559
|
+
*/
|
|
560
|
+
readonly browser?: {
|
|
561
|
+
open(input: { environmentId: string; threadId: string; url: string }): Promise<void>;
|
|
562
|
+
};
|
|
563
|
+
/** 插件网络代理(提案 0044)。缺席 = 宿主做不了,用 `pluginUiHostHasCapability(bridge, "network")` 判断。 */
|
|
564
|
+
readonly network?: PluginUiNetwork;
|
|
565
|
+
/** 浮在聊天上的窗。缺席 = 旧宿主,用 `pluginUiHostHasCapability(bridge, "floating")` 判断。 */
|
|
566
|
+
readonly floating?: PluginUiFloating;
|
|
567
|
+
/**
|
|
568
|
+
* 受限跳转:只认自己的页面(`/x/<自己>` 及其子路径)与宿主公开路由。别的目标
|
|
569
|
+
* 被丢弃并留一条 console 警告——插件不该把用户拽进另一个插件的页面。
|
|
570
|
+
*/
|
|
571
|
+
navigate(to: string): void;
|
|
572
|
+
/** 打开项目设置;宿主解析项目的家机器。section 指定要滚到的节,environmentId 指定工具设置的机器。
|
|
573
|
+
* 手机尚无项目设置页,缺席时只显示工具不可用的原因。 */
|
|
574
|
+
openProjectSettings?(target: PluginUiProjectTarget & { readonly section?: "agent-tools" }): void;
|
|
575
|
+
/** 打开指定机器上的普通会话;宿主负责 Web / Desktop 的路由方式。 */
|
|
576
|
+
openThread(target: PluginUiThreadTarget): void;
|
|
577
|
+
/**
|
|
578
|
+
* 会话工作区里一个文件的签名地址,给 `<img>` 这类直接取字节的元素用;到期由宿主续签。
|
|
579
|
+
* 是 hook,一个文件调一次。旧宿主没有,先用 {@link pluginUiHostHasCapability} 判断
|
|
580
|
+
* `workspaceFileUrl`。
|
|
581
|
+
*/
|
|
582
|
+
useWorkspaceFileUrl(target: PluginUiWorkspaceFile): PluginUiAssetUrl;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
/**
|
|
586
|
+
* 挂在 `window.__ycodiumPluginHost` 上的对象:与具体插件无关的那一半。
|
|
587
|
+
*
|
|
588
|
+
* **只有这一半。** 按插件分的那一半(命令、翻译、跳转)从 `register(bridge)` 的参数
|
|
589
|
+
* 进来,不从这里取:同一个 pluginId 可能同时有磁盘条目和某条会话里暂存的条目,是两份
|
|
590
|
+
* 不同的代码,而「谁在问」只有装载器知道——按名字发就必然发错一个(路线图 #33)。
|
|
591
|
+
*/
|
|
592
|
+
export interface PluginUiHostGlobal<Ui = unknown, Layout = unknown, React = unknown> {
|
|
593
|
+
readonly version: number;
|
|
594
|
+
/** 新 bundle 的 API import 指向宿主模块;旧宿主缺少此表时应提示升级。 */
|
|
595
|
+
readonly modules?: {
|
|
596
|
+
readonly "@ycodium-ai/plugin-api": typeof import("./index.ts");
|
|
597
|
+
readonly "@ycodium-ai/plugin-api/ui": typeof import("./ui.ts");
|
|
598
|
+
readonly "@ycodium-ai/plugin-api/slots"?: typeof import("./slots.ts");
|
|
599
|
+
readonly "@ycodium-ai/plugin-api/provider-settings"?: typeof import("./provider-settings.ts");
|
|
600
|
+
};
|
|
601
|
+
readonly react: React;
|
|
602
|
+
readonly jsxRuntime: PluginUiJsxRuntime;
|
|
603
|
+
readonly ui: Ui;
|
|
604
|
+
readonly layout: Layout;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* 注册函数的返回值里 `slots` 的一项。`team.view` 必须带 `key`({@link PluginUiTeamViewRegistration}),
|
|
609
|
+
* 别的座位的形状是 {@link PluginUiOtherSlotRegistration}。
|
|
610
|
+
*/
|
|
611
|
+
export type PluginUiSlotRegistration<Component = unknown> =
|
|
612
|
+
| PluginUiMachineActionRegistration
|
|
613
|
+
| PluginUiTeamViewRegistration<Component>
|
|
614
|
+
| PluginUiOtherSlotRegistration<Component>;
|
|
615
|
+
|
|
616
|
+
/** 用户选中后,宿主在菜单外按本机 bundle 挂载 actionView 对应的视图。 */
|
|
617
|
+
export interface PluginUiMachineActionRegistration {
|
|
618
|
+
readonly name: "sidebar.machine.actions";
|
|
619
|
+
readonly actionView: string;
|
|
620
|
+
readonly titleKey: string;
|
|
621
|
+
readonly icon?: string;
|
|
622
|
+
readonly order?: number;
|
|
623
|
+
readonly disabledReasonKey?: (context: PluginMachineActionContext) => string | null;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
/** 常规组件与项目导航座位。 */
|
|
627
|
+
export interface PluginUiOtherSlotRegistration<Component = unknown> {
|
|
628
|
+
readonly name:
|
|
629
|
+
| Exclude<ConversationSlotName, "team.view" | "sidebar.machine.actions">
|
|
630
|
+
| ConversationChildSeat;
|
|
631
|
+
readonly component?: Component;
|
|
632
|
+
readonly order?: number;
|
|
633
|
+
readonly select?: (owner: unknown) => boolean;
|
|
634
|
+
readonly childLists?: readonly string[];
|
|
635
|
+
readonly titleKey?: string;
|
|
636
|
+
readonly icon?: string;
|
|
637
|
+
readonly hostPage?: "files" | "scm" | "terminal" | "browser";
|
|
638
|
+
/** 项目标签的临时宽度下限不得写回用户的面板布局。 */
|
|
639
|
+
readonly needsWidePanel?: boolean;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
export interface PluginUiRegistration<Page = unknown, Panel = unknown, View = unknown> {
|
|
643
|
+
readonly pages?: Readonly<Record<string, Page>>;
|
|
644
|
+
readonly panels?: Readonly<Record<string, Panel>>;
|
|
645
|
+
/** 不生成导航入口的嵌入视图。props 由插件与调用方约定,可包含本地 UI 回调。 */
|
|
646
|
+
readonly views?: Readonly<Record<string, View>>;
|
|
647
|
+
/** 嵌入视图显式声明能力,缺省为空;宿主不得从版本号或 props 猜能力。字符串由窄契约模块导出。 */
|
|
648
|
+
readonly viewCapabilities?: Readonly<Record<string, ReadonlyArray<string>>>;
|
|
649
|
+
/**
|
|
650
|
+
* 宿主钉死的座位。`name` 必须在座位表里;kind 由座位表钉死。
|
|
651
|
+
* `project.workbench.tab` 与 `sidebar.project.actions` 在 Web 与 Desktop 渲染。
|
|
652
|
+
* Mobile 不画。这两张是试验性的,形状不承诺。`titleKey` 与 `icon` 给标签页和项目菜单用。
|
|
653
|
+
*/
|
|
654
|
+
readonly slots?: ReadonlyArray<PluginUiSlotRegistration<View>>;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
/** bundle 的默认导出。 */
|
|
658
|
+
export type PluginUiRegister<
|
|
659
|
+
Bridge = PluginUiBridge,
|
|
660
|
+
Page = unknown,
|
|
661
|
+
Panel = unknown,
|
|
662
|
+
View = unknown,
|
|
663
|
+
> = (bridge: Bridge) => PluginUiRegistration<Page, Panel, View>;
|
|
664
|
+
|
|
665
|
+
/** 面板组件拿到的作用域:哪台机器、哪条会话。 */
|
|
666
|
+
export interface PluginUiPanelProps {
|
|
667
|
+
readonly environmentId: string;
|
|
668
|
+
readonly threadId: string;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
export type { PluginUiThreadAnnotation } from "./threadAnnotation.ts";
|