@yadsh/dsh-qa-surface 0.19.0 → 0.21.0
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 +235 -0
- package/lib/access/model-choices.js +103 -0
- package/lib/access/model-choices.js.map +1 -0
- package/lib/access/model-policy.js +79 -7
- package/lib/access/model-policy.js.map +1 -1
- package/lib/access/model.js +29 -1
- package/lib/access/model.js.map +1 -1
- package/lib/access/queue-policy.js +36 -0
- package/lib/access/queue-policy.js.map +1 -0
- package/lib/access/service.js +124 -7
- package/lib/access/service.js.map +1 -1
- package/lib/account-remotes.js +10 -1
- package/lib/account-remotes.js.map +1 -1
- package/lib/accounts/database.js +44 -3
- package/lib/accounts/database.js.map +1 -1
- package/lib/accounts/store.js +28 -0
- package/lib/accounts/store.js.map +1 -1
- package/lib/admin/service.js +6 -1
- package/lib/admin/service.js.map +1 -1
- package/lib/chat-sharing/transport.js +6 -2
- package/lib/chat-sharing/transport.js.map +1 -1
- package/lib/client/QaAccountsController.js +43 -8
- package/lib/client/QaAccountsController.js.map +1 -1
- package/lib/client/QaSessionController.js +55 -23
- package/lib/client/QaSessionController.js.map +1 -1
- package/lib/client/QaSurface.js +61 -3
- package/lib/client/QaSurface.js.map +1 -1
- package/lib/client/QaTranscriptAdapter.js +36 -1
- package/lib/client/QaTranscriptAdapter.js.map +1 -1
- package/lib/client/admin/ModelPolicyEditor.js +28 -2
- package/lib/client/admin/ModelPolicyEditor.js.map +1 -1
- package/lib/client/admin/RoleEditor.js +18 -1
- package/lib/client/admin/RoleEditor.js.map +1 -1
- package/lib/client/admin/pages/SkillFiles.js +1 -1
- package/lib/client/admin/pages/SkillFiles.js.map +1 -1
- package/lib/client/admin/pages/Users.js +36 -16
- package/lib/client/admin/pages/Users.js.map +1 -1
- package/lib/client/admin/styles.js +3 -0
- package/lib/client/admin/styles.js.map +1 -1
- package/lib/client/chat-artifacts.js +1 -0
- package/lib/client/chat-artifacts.js.map +1 -1
- package/lib/client/code-source-styles.js +12 -0
- package/lib/client/code-source-styles.js.map +1 -0
- package/lib/client/components/QaArtifactAttachment.js +12 -0
- package/lib/client/components/QaArtifactAttachment.js.map +1 -0
- package/lib/client/components/QaChangelog.js +94 -0
- package/lib/client/components/QaChangelog.js.map +1 -1
- package/lib/client/components/QaChatActions.js +36 -14
- package/lib/client/components/QaChatActions.js.map +1 -1
- package/lib/client/components/QaCodeSourcePicker.js +18 -0
- package/lib/client/components/QaCodeSourcePicker.js.map +1 -0
- package/lib/client/components/QaComposer.js +11 -12
- package/lib/client/components/QaComposer.js.map +1 -1
- package/lib/client/components/QaComposerSettings.js +202 -0
- package/lib/client/components/QaComposerSettings.js.map +1 -0
- package/lib/client/components/QaFilesPanel.js +2 -8
- package/lib/client/components/QaFilesPanel.js.map +1 -1
- package/lib/client/components/QaFormItem.js +74 -38
- package/lib/client/components/QaFormItem.js.map +1 -1
- package/lib/client/components/QaHistoryCatalog.js +261 -0
- package/lib/client/components/QaHistoryCatalog.js.map +1 -0
- package/lib/client/components/QaInputForm.js +115 -32
- package/lib/client/components/QaInputForm.js.map +1 -1
- package/lib/client/components/QaMessage.js +3 -8
- package/lib/client/components/QaMessage.js.map +1 -1
- package/lib/client/components/QaModelSelector.js +21 -0
- package/lib/client/components/QaModelSelector.js.map +1 -0
- package/lib/client/components/QaSidebar.js +25 -24
- package/lib/client/components/QaSidebar.js.map +1 -1
- package/lib/client/components/QaWorkGroup.js +1 -3
- package/lib/client/components/QaWorkGroup.js.map +1 -1
- package/lib/client/composer-settings-styles.js +21 -0
- package/lib/client/composer-settings-styles.js.map +1 -0
- package/lib/client/forms-styles.js +35 -11
- package/lib/client/forms-styles.js.map +1 -1
- package/lib/client/history-organization-styles.js +31 -0
- package/lib/client/history-organization-styles.js.map +1 -0
- package/lib/client/history-organization.js +155 -0
- package/lib/client/history-organization.js.map +1 -0
- package/lib/client/index.js +13 -4
- package/lib/client/index.js.map +1 -1
- package/lib/client/settings/card.js +2 -2
- package/lib/client/settings/card.js.map +1 -1
- package/lib/client/settings/sections/attachments.js +7 -1
- package/lib/client/settings/sections/attachments.js.map +1 -1
- package/lib/client/settings/sections/file-writes.js +15 -0
- package/lib/client/settings/sections/file-writes.js.map +1 -0
- package/lib/client/settings/sections/session.js +1 -1
- package/lib/client/settings/sections/session.js.map +1 -1
- package/lib/client/settings/sections.js +1 -0
- package/lib/client/settings/sections.js.map +1 -1
- package/lib/client/styles.js +18 -1
- package/lib/client/styles.js.map +1 -1
- package/lib/client/tool-presentation.js +21 -3
- package/lib/client/tool-presentation.js.map +1 -1
- package/lib/client/types.js.map +1 -1
- package/lib/client/use-chat-code-source.js +156 -0
- package/lib/client/use-chat-code-source.js.map +1 -0
- package/lib/client/use-history-organization.js +48 -0
- package/lib/client/use-history-organization.js.map +1 -0
- package/lib/client/use-model-selection.js +96 -0
- package/lib/client/use-model-selection.js.map +1 -0
- package/lib/client/use-qa-file-drop.js +81 -0
- package/lib/client/use-qa-file-drop.js.map +1 -0
- package/lib/client/user-settings/IntegrationTokensPage.js +42 -6
- package/lib/client/user-settings/IntegrationTokensPage.js.map +1 -1
- package/lib/client/user-settings/UserSettingsDialog.js +1 -1
- package/lib/client/user-settings/UserSettingsDialog.js.map +1 -1
- package/lib/client.js +125 -27
- package/lib/client.js.map +1 -1
- package/lib/code-source-selection.js +102 -0
- package/lib/code-source-selection.js.map +1 -0
- package/lib/config-resolvers/accounts.js +26 -1
- package/lib/config-resolvers/accounts.js.map +1 -1
- package/lib/config-resolvers/defaults.js +7 -0
- package/lib/config-resolvers/defaults.js.map +1 -1
- package/lib/config-resolvers/integration.js +8 -1
- package/lib/config-resolvers/integration.js.map +1 -1
- package/lib/config-resolvers/session.js +2 -0
- package/lib/config-resolvers/session.js.map +1 -1
- package/lib/config-resolvers/tools.js +2 -0
- package/lib/config-resolvers/tools.js.map +1 -1
- package/lib/config.js +77 -4
- package/lib/config.js.map +1 -1
- package/lib/enforcement/skill-policy.js +37 -2
- package/lib/enforcement/skill-policy.js.map +1 -1
- package/lib/forms/errors.js +6 -1
- package/lib/forms/errors.js.map +1 -1
- package/lib/forms/gate.js +28 -2
- package/lib/forms/gate.js.map +1 -1
- package/lib/forms/schema-errors.js +47 -0
- package/lib/forms/schema-errors.js.map +1 -0
- package/lib/forms/schema.js +29 -20
- package/lib/forms/schema.js.map +1 -1
- package/lib/index.js +161 -9
- package/lib/index.js.map +1 -1
- package/lib/integration/http.js +9 -10
- package/lib/integration/http.js.map +1 -1
- package/lib/integration/service.js +9 -0
- package/lib/integration/service.js.map +1 -1
- package/lib/personal-skills/provider.js +9 -1
- package/lib/personal-skills/provider.js.map +1 -1
- package/lib/personal-skills/service.js +4 -0
- package/lib/personal-skills/service.js.map +1 -1
- package/lib/personal-skills/shared-seed.js +65 -0
- package/lib/personal-skills/shared-seed.js.map +1 -0
- package/lib/prompt-notes.js +24 -2
- package/lib/prompt-notes.js.map +1 -1
- package/lib/provenance/collector.js +1 -0
- package/lib/provenance/collector.js.map +1 -1
- package/lib/provenance/extractors.js +6 -1
- package/lib/provenance/extractors.js.map +1 -1
- package/lib/qa-tools/catalog.js +33 -1
- package/lib/qa-tools/catalog.js.map +1 -1
- package/lib/qa-tools/code-files.js +207 -0
- package/lib/qa-tools/code-files.js.map +1 -0
- package/lib/qa-tools/code-tools.js +158 -0
- package/lib/qa-tools/code-tools.js.map +1 -0
- package/lib/qa-tools/docs-tools.js +49 -12
- package/lib/qa-tools/docs-tools.js.map +1 -1
- package/lib/qa-tools/file-write-gate.js +47 -0
- package/lib/qa-tools/file-write-gate.js.map +1 -0
- package/lib/qa-tools/index.js +10 -0
- package/lib/qa-tools/index.js.map +1 -1
- package/lib/qa-tools/request-user-form.js +26 -6
- package/lib/qa-tools/request-user-form.js.map +1 -1
- package/lib/qa-tools/subagent-tools.js +159 -0
- package/lib/qa-tools/subagent-tools.js.map +1 -0
- package/lib/request-scheduler.js +32 -5
- package/lib/request-scheduler.js.map +1 -1
- package/lib/resolve-config.js +9 -1
- package/lib/resolve-config.js.map +1 -1
- package/lib/secure-session.js +16 -4
- package/lib/secure-session.js.map +1 -1
- package/lib/session-model.js +43 -1
- package/lib/session-model.js.map +1 -1
- package/lib/shared/file-write-policy.js +29 -0
- package/lib/shared/file-write-policy.js.map +1 -0
- package/lib/shared/history-folder.js +18 -0
- package/lib/shared/history-folder.js.map +1 -0
- package/lib/typert.host.js +757 -162
- package/lib/typert.remote-client.d.ts +19 -7
- package/lib/typert.remote-client.js +688 -153
- package/lib/types/access/model-choices.d.ts +16 -0
- package/lib/types/access/model-policy.d.ts +13 -7
- package/lib/types/access/model.d.ts +9 -0
- package/lib/types/access/queue-policy.d.ts +30 -0
- package/lib/types/access/service.d.ts +27 -0
- package/lib/types/account-remotes.d.ts +5 -4
- package/lib/types/accounts/database.d.ts +5 -0
- package/lib/types/accounts/store.d.ts +6 -0
- package/lib/types/chat-sharing/transport.d.ts +1 -1
- package/lib/types/client/QaAccountsController.d.ts +3 -1
- package/lib/types/client/QaSessionController.d.ts +19 -5
- package/lib/types/client/QaSurface.d.ts +2 -0
- package/lib/types/client/admin/ModelPolicyEditor.d.ts +2 -0
- package/lib/types/client/code-source-styles.d.ts +2 -0
- package/lib/types/client/components/QaArtifactAttachment.d.ts +8 -0
- package/lib/types/client/components/QaChatActions.d.ts +3 -1
- package/lib/types/client/components/QaCodeSourcePicker.d.ts +9 -0
- package/lib/types/client/components/QaComposer.d.ts +2 -0
- package/lib/types/client/components/QaComposerSettings.d.ts +16 -0
- package/lib/types/client/components/QaFormItem.d.ts +4 -2
- package/lib/types/client/components/QaHistoryCatalog.d.ts +19 -0
- package/lib/types/client/components/QaInputForm.d.ts +3 -2
- package/lib/types/client/components/QaModelSelector.d.ts +4 -0
- package/lib/types/client/components/QaSidebar.d.ts +3 -0
- package/lib/types/client/composer-settings-styles.d.ts +2 -0
- package/lib/types/client/forms-styles.d.ts +1 -1
- package/lib/types/client/history-organization-styles.d.ts +3 -0
- package/lib/types/client/history-organization.d.ts +38 -0
- package/lib/types/client/settings/sections/file-writes.d.ts +4 -0
- package/lib/types/client/settings/sections.d.ts +1 -0
- package/lib/types/client/tool-presentation.d.ts +1 -0
- package/lib/types/client/types.d.ts +12 -4
- package/lib/types/client/use-chat-code-source.d.ts +20 -0
- package/lib/types/client/use-history-organization.d.ts +8 -0
- package/lib/types/client/use-model-selection.d.ts +24 -0
- package/lib/types/client/use-qa-file-drop.d.ts +12 -0
- package/lib/types/code-source-selection.d.ts +28 -0
- package/lib/types/code-sources.js +2 -0
- package/lib/types/code-sources.js.map +1 -0
- package/lib/types/config-resolvers/integration.d.ts +7 -1
- package/lib/types/forms/errors.d.ts +3 -2
- package/lib/types/forms/gate.d.ts +4 -2
- package/lib/types/forms/schema-errors.d.ts +7 -0
- package/lib/types/forms/types.d.ts +14 -0
- package/lib/types/index.d.ts +38 -5
- package/lib/types/integration/http.d.ts +1 -3
- package/lib/types/integration/service.d.ts +2 -0
- package/lib/types/personal-skills/shared-seed.d.ts +12 -0
- package/lib/types/prompt-notes.d.ts +6 -2
- package/lib/types/qa-tools/catalog.d.ts +5 -2
- package/lib/types/qa-tools/code-files.d.ts +59 -0
- package/lib/types/qa-tools/code-tools.d.ts +7 -0
- package/lib/types/qa-tools/docs-tools.d.ts +4 -0
- package/lib/types/qa-tools/file-write-gate.d.ts +6 -0
- package/lib/types/qa-tools/index.d.ts +3 -0
- package/lib/types/qa-tools/subagent-tools.d.ts +40 -0
- package/lib/types/request-scheduler.d.ts +21 -2
- package/lib/types/session-model.d.ts +11 -2
- package/lib/types/shared/file-write-policy.d.ts +10 -0
- package/lib/types/shared/history-folder.d.ts +4 -0
- package/lib/types/types/accounts.d.ts +11 -0
- package/lib/types/types/capability.d.ts +31 -4
- package/lib/types/types/code-sources.d.ts +12 -0
- package/lib/types/types/config.d.ts +23 -0
- package/lib/types/types/documents.d.ts +2 -0
- package/lib/types/types.d.ts +1 -0
- package/lib/user-workspace.js +7 -4
- package/lib/user-workspace.js.map +1 -1
- package/package.json +6 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ClientRemote } from "@deepseek-ai/dsh-api-gateway/client";
|
|
2
2
|
import type { ISessions, SessionFace } from "@deepseek-ai/dsh-api-session-controller/client";
|
|
3
3
|
import type { UiConversation } from "@deepseek-ai/dsh-client-ui-conversation/client";
|
|
4
|
-
import type { QaAccountNotificationsInput, QaAccountProfileInput, QaAccountSession, QaAccountStartersInput, QaAccountStarter, QaAccountUserPublic, QaAccessAdminSnapshot, QaApprovalDecision, QaClaimResult, QaLockdownProof, QaModelCatalogEntry, QaOwnershipEntry, QaPasswordResetRequest, QaPendingApproval, QaPendingQuestion, QaQuestionAnswerItem, QaQueueStatus, QaIssuedServiceToken, QaServiceTokenCreateInput, QaServiceTokenSummary, QaSessionState, QaSkillDocument, QaSkillDraftInput, QaSkillRemoval, QaSkillSummary, QaSkillToolDescriptor, QaSkillValidation, QaSourceFilePreview, QaTurnSources, QaWhoamiResult, QaDocumentPreview, QaSpreadsheetPreviewSelection, QaWorkspaceFile, QaWorkspaceFileChunk, QaDocumentWorkflowStatus, QaWorkspaceListing, QaCapabilitySelection, QaCurrentAccess, QaSessionAccess, QaSkillActivationRecord, QaSkillAssignmentOverride, QaSubrole, QaUserAccess, QaAdminAuditEvent, QaAdminOverview, QaAdminPage, QaAdminSkillScope, QaAdminSkillsView, QaAdminUserDetail, QaAdminUserRow, QaAdminUserUpdate, QaAuditQuery, QaConversationDetail, QaConversationDeletion, QaConversationQuery, QaConversationReview, QaConversationReviewInput, QaConversationSummary, QaExpertMemoryDraft, QaExpertMemoryPage, QaExpertMemoryRecord, QaExpertMemoryScope, QaFeedbackQuery, QaFeedbackRow, QaMessageFeedback, QaMessageFeedbackInput, QaQualityMetrics, QaReviewQueueItem, QaReviewQueueRow, QaSlashCatalog, QaSlashExecution, QaSlashSubmitAttachment, QaUserQuery } from "../types.js";
|
|
4
|
+
import type { QaAccountNotificationsInput, QaAccountProfileInput, QaAccountSession, QaAccountStartersInput, QaAccountStarter, QaAccountUserPublic, QaAccessAdminSnapshot, QaApprovalDecision, QaClaimResult, QaLockdownProof, QaModelCatalogEntry, QaModelOptions, QaOwnershipEntry, QaPasswordResetRequest, QaPendingApproval, QaPendingQuestion, QaQuestionAnswerItem, QaQueueStatus, QaIssuedServiceToken, QaServiceTokenCreateInput, QaServiceTokenSummary, QaSessionState, QaSkillDocument, QaSkillDraftInput, QaSkillRemoval, QaSkillSummary, QaSkillToolDescriptor, QaSkillValidation, QaSourceFilePreview, QaTurnSources, QaWhoamiResult, QaDocumentPreview, QaSpreadsheetPreviewSelection, QaWorkspaceFile, QaWorkspaceFileChunk, QaDocumentWorkflowStatus, QaWorkspaceListing, QaCapabilitySelection, QaCurrentAccess, QaSessionAccess, QaSkillActivationRecord, QaSkillAssignmentOverride, QaSubrole, QaUserAccess, QaAdminAuditEvent, QaAdminOverview, QaAdminPage, QaAdminSkillScope, QaAdminSkillsView, QaAdminUserDetail, QaAdminUserRow, QaAdminUserUpdate, QaAuditQuery, QaConversationDetail, QaConversationDeletion, QaConversationQuery, QaConversationReview, QaConversationReviewInput, QaConversationSummary, QaExpertMemoryDraft, QaExpertMemoryPage, QaExpertMemoryRecord, QaExpertMemoryScope, QaFeedbackQuery, QaFeedbackRow, QaMessageFeedback, QaMessageFeedbackInput, QaQualityMetrics, QaReviewQueueItem, QaReviewQueueRow, QaSlashCatalog, QaSlashExecution, QaSlashSubmitAttachment, QaUserQuery } from "../types.js";
|
|
5
5
|
/** Wire content one prompt carries: text plus base64 image uploads. */
|
|
6
6
|
export type QaPromptContent = Parameters<SessionFace["prompt"]>[0];
|
|
7
7
|
/** DSH session runtime surface the QA controller is allowed to touch. */
|
|
@@ -43,6 +43,7 @@ export type QaForkSession = (token: string, sourceId: string, answerSeq: number)
|
|
|
43
43
|
export type QaQueueStatusRemote = (token?: string, sessionId?: string) => Promise<RemoteResult<QaQueueStatus>>;
|
|
44
44
|
/** Role selector plus administrator mutation channel. */
|
|
45
45
|
export interface QaAccessApi {
|
|
46
|
+
userModels?(token: string, sessionId: string | null, subroleId: string | null, adminPreview: boolean): Promise<RemoteResult<QaModelOptions>>;
|
|
46
47
|
current(token: string): Promise<RemoteResult<QaCurrentAccess>>;
|
|
47
48
|
session(token: string, sessionId: string): Promise<RemoteResult<QaSessionAccess>>;
|
|
48
49
|
admin(token: string): Promise<RemoteResult<QaAccessAdminSnapshot>>;
|
|
@@ -337,6 +338,8 @@ export type QaIntegrationTokenResult<Value> = {
|
|
|
337
338
|
};
|
|
338
339
|
/** The integration-token section with the account token bound at the call site. */
|
|
339
340
|
export interface QaIntegrationTokenApi {
|
|
341
|
+
readonly historyStorageKey?: string;
|
|
342
|
+
setFolder?(tokenId: string, folder: import("../types/accounts.js").QaHistoryFolderTarget | null): Promise<QaIntegrationTokenResult<null>>;
|
|
340
343
|
/**
|
|
341
344
|
* Whether this deployment can mint at all. A token is a credential for the
|
|
342
345
|
* HTTP API, so when that API is off the page explains the state instead of
|
|
@@ -351,6 +354,9 @@ export interface QaIntegrationTokenApi {
|
|
|
351
354
|
}
|
|
352
355
|
/** Account remotes exposed by the plugin's own typert namespace. */
|
|
353
356
|
export interface QaAccountsApi {
|
|
357
|
+
accountsSetServiceTokenHistoryFolder?(token: string, tokenId: string, folder: import("../types/accounts.js").QaHistoryFolderTarget | null): Promise<RemoteResult<{
|
|
358
|
+
readonly updated: boolean;
|
|
359
|
+
}>>;
|
|
354
360
|
accountsSetServiceTokenClarifications?(token: string, tokenId: string, allowed: boolean): Promise<RemoteResult<{
|
|
355
361
|
readonly updated: boolean;
|
|
356
362
|
}>>;
|
|
@@ -362,9 +368,7 @@ export interface QaAccountsApi {
|
|
|
362
368
|
accountsLogin(email: string, password: string): Promise<RemoteResult<QaAccountSession>>;
|
|
363
369
|
accountsRegister(email: string, password: string): Promise<RemoteResult<QaAccountSession>>;
|
|
364
370
|
accountsClaimSessions(token: string, sessionIds: readonly string[]): Promise<RemoteResult<QaClaimResult>>;
|
|
365
|
-
accountsOwnedSessions(token: string): Promise<RemoteResult<
|
|
366
|
-
readonly ids: readonly string[];
|
|
367
|
-
}>>;
|
|
371
|
+
accountsOwnedSessions(token: string): Promise<RemoteResult<import("../types/accounts.js").QaOwnedSessionsResult>>;
|
|
368
372
|
accountsListOwnership(token: string): Promise<RemoteResult<{
|
|
369
373
|
readonly entries: readonly QaOwnershipEntry[];
|
|
370
374
|
}>>;
|
|
@@ -412,6 +416,10 @@ export type RemoteResult<Value> = {
|
|
|
412
416
|
readonly ok: false;
|
|
413
417
|
readonly error: unknown;
|
|
414
418
|
};
|
|
419
|
+
export interface QaChatCodeSourceApi {
|
|
420
|
+
read(token: string, sessionId: string): Promise<RemoteResult<import("../types/code-sources.js").QaChatCodeSources>>;
|
|
421
|
+
select(token: string, sessionId: string, source: string | null): Promise<RemoteResult<import("../types/code-sources.js").QaChatCodeSources>>;
|
|
422
|
+
}
|
|
415
423
|
/** Minimal persistence contract; backed by `window.localStorage` in the app. */
|
|
416
424
|
export interface StorageLike {
|
|
417
425
|
getItem(key: string): string | null;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CodeSourcesCatalog } from "@yadsh/dsh-plugin-kit/code-sources";
|
|
2
|
+
import type { QaChatCodeSources } from "../types/code-sources.js";
|
|
3
|
+
import type { QaChatCodeSourceApi } from "./types.js";
|
|
4
|
+
export interface ChatCodeSourceOptions {
|
|
5
|
+
readonly api?: QaChatCodeSourceApi | undefined;
|
|
6
|
+
readonly token: string;
|
|
7
|
+
readonly sessionId: string | null;
|
|
8
|
+
readonly chatKey: number;
|
|
9
|
+
readonly catalog: CodeSourcesCatalog;
|
|
10
|
+
}
|
|
11
|
+
/** Server-backed per-chat state. Drafts do not create sessions until their first send. */
|
|
12
|
+
export declare function useChatCodeSource(options: ChatCodeSourceOptions): {
|
|
13
|
+
value: QaChatCodeSources;
|
|
14
|
+
pending: boolean;
|
|
15
|
+
error: string | null;
|
|
16
|
+
select: (source: string | null) => Promise<boolean>;
|
|
17
|
+
prepareSession: (sessionId: string) => Promise<void>;
|
|
18
|
+
blocked: boolean;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=use-chat-code-source.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type QaHistoryOrganization } from "./history-organization.js";
|
|
2
|
+
/** The catalog is keyed on mount, so changing accounts cannot reuse its state. */
|
|
3
|
+
export declare function useHistoryOrganization(key: string): {
|
|
4
|
+
state: QaHistoryOrganization;
|
|
5
|
+
update: (next: QaHistoryOrganization) => void;
|
|
6
|
+
persistenceFailed: boolean;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=use-history-organization.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { QaModelOptions, QaModelPair } from "../types.js";
|
|
2
|
+
import type { QaAccessApi } from "./types.js";
|
|
3
|
+
export declare const qaModelKey: (pair: QaModelPair) => string;
|
|
4
|
+
export interface QaModelSelectionProps {
|
|
5
|
+
readonly api: NonNullable<QaAccessApi["userModels"]>;
|
|
6
|
+
readonly token: string;
|
|
7
|
+
readonly sessionId: string | null;
|
|
8
|
+
readonly subroleId: string | null;
|
|
9
|
+
readonly preview: boolean;
|
|
10
|
+
readonly disabled: boolean;
|
|
11
|
+
readonly onSelect: (pair: QaModelPair) => Promise<string>;
|
|
12
|
+
}
|
|
13
|
+
/** The existing authenticated selection boundary shared by composer controls. */
|
|
14
|
+
export declare function useQaModelSelection(props: QaModelSelectionProps | undefined): {
|
|
15
|
+
options: QaModelOptions | undefined;
|
|
16
|
+
busy: boolean;
|
|
17
|
+
error: string | undefined;
|
|
18
|
+
selectedKey: string;
|
|
19
|
+
select: (key: string) => Promise<boolean>;
|
|
20
|
+
selected: import("../types.js").QaModelCatalogEntry | undefined;
|
|
21
|
+
disabled: boolean;
|
|
22
|
+
reload: () => void;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=use-model-selection.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
interface FileDropTarget {
|
|
3
|
+
readonly element: RefObject<HTMLElement>;
|
|
4
|
+
readonly fallback?: boolean;
|
|
5
|
+
readonly canDrop: () => boolean;
|
|
6
|
+
readonly onFiles: (files: File[]) => void;
|
|
7
|
+
readonly onActive?: (active: boolean) => void;
|
|
8
|
+
}
|
|
9
|
+
/** Register a QA file receiver; ordinary text and chat drags remain untouched. */
|
|
10
|
+
export declare function useQaFileDrop(target: FileDropTarget): void;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=use-qa-file-drop.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SqliteDatabase } from "@yadsh/dsh-plugin-kit/sqlite";
|
|
2
|
+
import type { CodeSourcesCatalog } from "@yadsh/dsh-plugin-kit/code-sources";
|
|
3
|
+
import type { QaChatCodeSources } from "./types/code-sources.js";
|
|
4
|
+
export interface CodeSourceSession {
|
|
5
|
+
readonly header: {
|
|
6
|
+
readonly parentSession?: unknown;
|
|
7
|
+
readonly isSeeded?: boolean;
|
|
8
|
+
readonly origin?: unknown;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/** Durable chat preference and immutable snapshots for delegated/forked children. */
|
|
12
|
+
export declare class QaCodeSourceSelection {
|
|
13
|
+
private readonly configured;
|
|
14
|
+
private readonly session;
|
|
15
|
+
private readonly busy;
|
|
16
|
+
readonly storage: SqliteDatabase;
|
|
17
|
+
constructor(filePath: string, configured: () => CodeSourcesCatalog, session: (id: string) => CodeSourceSession | undefined, busy: (id: string) => boolean);
|
|
18
|
+
private stored;
|
|
19
|
+
/** Resolve old/resumed children through their durable lineage when no snapshot exists. */
|
|
20
|
+
selected(id: string): string | null;
|
|
21
|
+
catalog(id?: string): CodeSourcesCatalog;
|
|
22
|
+
view(id: string, owner: boolean): QaChatCodeSources;
|
|
23
|
+
select(id: string, source: string | null): QaChatCodeSources;
|
|
24
|
+
inherit(id: string, parent: string, managedParent?: boolean): void;
|
|
25
|
+
private save;
|
|
26
|
+
close(): void;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=code-source-selection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-sources.js","sourceRoot":"","sources":["../../src/types/code-sources.ts"],"names":[],"mappings":""}
|
|
@@ -48,6 +48,12 @@ export declare function normalizeIntegrationBasePath(value: string): string;
|
|
|
48
48
|
* @param accounts - the resolved accounts domain, for the cross-check.
|
|
49
49
|
* @returns the frozen resolved slice.
|
|
50
50
|
*/
|
|
51
|
-
export declare function resolveIntegration(input: QaIntegrationConfig | undefined, accounts: ResolvedQaSurfaceConfig["accounts"]
|
|
51
|
+
export declare function resolveIntegration(input: QaIntegrationConfig | undefined, accounts: ResolvedQaSurfaceConfig["accounts"], attachments?: {
|
|
52
|
+
readonly textFiles: boolean;
|
|
53
|
+
readonly pastedTextLines: number;
|
|
54
|
+
readonly maxFileBytes: number;
|
|
55
|
+
readonly maxPending: number;
|
|
56
|
+
readonly extensions: readonly string[];
|
|
57
|
+
}): ResolvedIntegration;
|
|
52
58
|
export {};
|
|
53
59
|
//# sourceMappingURL=integration.d.ts.map
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type { QaFormFieldError, QaFormResult } from "./types.js";
|
|
1
|
+
import type { QaFormFieldError, QaFormResult, QaFormSchemaIssue } from "./types.js";
|
|
2
2
|
export declare class QaFormError extends Error {
|
|
3
3
|
readonly code: string;
|
|
4
4
|
readonly revision?: number | undefined;
|
|
5
5
|
readonly fields?: QaFormFieldError[] | undefined;
|
|
6
|
-
|
|
6
|
+
readonly schemaIssues?: QaFormSchemaIssue[] | undefined;
|
|
7
|
+
constructor(code: string, message: string, revision?: number | undefined, fields?: QaFormFieldError[] | undefined, schemaIssues?: QaFormSchemaIssue[] | undefined);
|
|
7
8
|
}
|
|
8
9
|
/** Deliberately redact unexpected storage/Host exceptions at the wire boundary. */
|
|
9
10
|
export declare function formFailure(error: unknown): QaFormResult<never>;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { Context } from "@deepseek-ai/cordis";
|
|
2
2
|
import type { ToolExecution } from "@deepseek-ai/dsh-tools";
|
|
3
3
|
import type { QaFormService } from "./service.js";
|
|
4
|
-
import type { QaFormRecord, QaFormSubmission } from "./types.js";
|
|
5
|
-
type
|
|
4
|
+
import type { QaFormRecord, QaFormSubmission, QaFormValidation } from "./types.js";
|
|
5
|
+
type CollectionOutcome = QaFormSubmission | {
|
|
6
6
|
status: "paused";
|
|
7
7
|
form_id: string;
|
|
8
8
|
reason: string;
|
|
9
9
|
};
|
|
10
|
+
type Outcome = CollectionOutcome | QaFormValidation;
|
|
10
11
|
/** A parked tool call is transient. Never reconstruct one from a saved draft. */
|
|
11
12
|
export declare class QaFormGate {
|
|
12
13
|
readonly service: () => QaFormService;
|
|
@@ -22,6 +23,7 @@ export declare class QaFormGate {
|
|
|
22
23
|
install(ctx: Context): void;
|
|
23
24
|
waiting(id: string): boolean;
|
|
24
25
|
touch(session: string): void;
|
|
26
|
+
private clientReady;
|
|
25
27
|
hasSession(session: string): boolean;
|
|
26
28
|
request(raw: unknown, exec: ToolExecution): Promise<Outcome>;
|
|
27
29
|
notify(record: QaFormRecord, pause?: boolean): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
import { QaFormError } from "./errors.js";
|
|
3
|
+
import type { QaFormSchemaIssue } from "./types.js";
|
|
4
|
+
/** Report locations and constraints, never copy input values into diagnostics. */
|
|
5
|
+
export declare function formSchemaError(issues: QaFormSchemaIssue[]): QaFormError;
|
|
6
|
+
export declare function formSchemaIssues(issues: z.ZodError["issues"]): QaFormSchemaIssue[];
|
|
7
|
+
//# sourceMappingURL=schema-errors.d.ts.map
|
|
@@ -106,6 +106,19 @@ export interface QaFormFieldError {
|
|
|
106
106
|
code: string;
|
|
107
107
|
message: string;
|
|
108
108
|
}
|
|
109
|
+
export interface QaFormSchemaIssue {
|
|
110
|
+
path: string;
|
|
111
|
+
code: string;
|
|
112
|
+
message: string;
|
|
113
|
+
}
|
|
114
|
+
export interface QaFormValidation {
|
|
115
|
+
status: "validated";
|
|
116
|
+
valid: boolean;
|
|
117
|
+
interactive_client_ready: boolean;
|
|
118
|
+
file_upload_available: boolean;
|
|
119
|
+
policy: Readonly<QaFormPolicy>;
|
|
120
|
+
issues: QaFormSchemaIssue[];
|
|
121
|
+
}
|
|
109
122
|
export interface QaFormSubmission {
|
|
110
123
|
status: "submitted";
|
|
111
124
|
form_id: string;
|
|
@@ -182,6 +195,7 @@ export type QaFormResult<T> = {
|
|
|
182
195
|
message: string;
|
|
183
196
|
form_revision?: number;
|
|
184
197
|
field_errors?: QaFormFieldError[];
|
|
198
|
+
schema_errors?: QaFormSchemaIssue[];
|
|
185
199
|
};
|
|
186
200
|
};
|
|
187
201
|
/**
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import type { QaChatCodeSources } from "./types/code-sources.js";
|
|
1
2
|
import type { QaChatAccess, QaChatGrant, QaChatMode, QaChatAuthor, QaChatJson } from "./chat-sharing/types.js";
|
|
2
3
|
import type { SessionPageRequest, SessionFollowRequest, SessionPromptRequest, SessionPromptValue, SessionAttachmentRequest, SessionAttachmentValue, SessionRenameRequest, SessionRenameValue, SessionCancelValue, SessionUpdateQueueRequest, SessionUpdateQueueValue, SessionSearchRequest, SessionSelectModelRequest, SessionSelectModelValue } from "@deepseek-ai/dsh-api-session-controller/types";
|
|
3
4
|
import { TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
|
|
4
5
|
import type { Context } from "@deepseek-ai/cordis";
|
|
5
6
|
import type { QaSurfaceConfigRefs } from "./config.js";
|
|
6
7
|
import type { QaFormCommand, QaFormResult, QaFormView } from "./forms/types.js";
|
|
8
|
+
import type { QaModelOptions } from "./types.js";
|
|
7
9
|
import type { QaAccountNotificationsInput } from "./types.js";
|
|
8
10
|
import type { QaTurnSources } from "./provenance/types.js";
|
|
9
|
-
import type { QaAccountProfileInput, QaAccountSession, QaAccountStartersInput, QaAccountUserPublic, QaApprovalDecision, QaClaimResult, QaDocumentPreview, QaSpreadsheetPreviewSelection, QaDocumentWorkflowStatus, QaIssuedServiceToken, QaLockdownProof, QaOwnershipEntry, QaPasswordResetRequest, QaPendingApproval, QaPendingQuestion, QaQuestionAnswerItem, QaQueueStatus, QaServiceTokenCreateInput, QaServiceTokenSummary, ResolvedQaSurfaceConfig, QaAdminSkillScope, QaAdminSkillsView, QaExpertMemoryDraft, QaExpertMemoryPage, QaExpertMemoryRecord, QaExpertMemoryScope, QaSkillDocument, QaSkillDraftInput, QaSkillRemoval, QaSkillSummary, QaSkillToolDescriptor, QaSkillValidation, QaSourceFilePreview, QaWhoamiResult, QaWorkspaceFile, QaWorkspaceFileChunk, QaWorkspaceListing, QaPrincipal, QaAccessAdminSnapshot, QaAdminAuditEvent, QaAdminOverview, QaAdminPage, QaAdminUserDetail, QaAdminUserRow, QaAdminUserUpdate, QaAuditQuery, QaCapabilitySelection, QaConversationDetail, QaConversationDeletion, QaConversationQuery, QaConversationReview, QaConversationReviewInput, QaConversationSummary, QaCurrentAccess, QaFeedbackHarvestEntry, QaFeedbackHarvestResult, QaFeedbackQuery, QaFeedbackRow, QaMessageFeedback, QaMessageFeedbackInput, QaModelCatalogEntry, QaModelPair, QaQualityMetrics, QaReviewQueueItem, QaReviewQueueRow, QaSessionAccess, QaSlashCatalog, QaSlashExecution, QaSlashSubmitAttachment, QaSkillActivationRecord, QaSkillAssignmentOverride, QaSubrole, QaUserAccess, QaUserQuery } from "./types.js";
|
|
11
|
+
import type { QaAccountProfileInput, QaAccountSession, QaAccountStartersInput, QaAccountUserPublic, QaApprovalDecision, QaClaimResult, QaDocumentPreview, QaSpreadsheetPreviewSelection, QaDocumentWorkflowStatus, QaIssuedServiceToken, QaHistoryFolderTarget, QaOwnedSessionsResult, QaLockdownProof, QaOwnershipEntry, QaPasswordResetRequest, QaPendingApproval, QaPendingQuestion, QaQuestionAnswerItem, QaQueueStatus, QaServiceTokenCreateInput, QaServiceTokenSummary, ResolvedQaSurfaceConfig, QaAdminSkillScope, QaAdminSkillsView, QaExpertMemoryDraft, QaExpertMemoryPage, QaExpertMemoryRecord, QaExpertMemoryScope, QaSkillDocument, QaSkillDraftInput, QaSkillRemoval, QaSkillSummary, QaSkillToolDescriptor, QaSkillValidation, QaSourceFilePreview, QaWhoamiResult, QaWorkspaceFile, QaWorkspaceFileChunk, QaWorkspaceListing, QaPrincipal, QaAccessAdminSnapshot, QaAdminAuditEvent, QaAdminOverview, QaAdminPage, QaAdminUserDetail, QaAdminUserRow, QaAdminUserUpdate, QaAuditQuery, QaCapabilitySelection, QaConversationDetail, QaConversationDeletion, QaConversationQuery, QaConversationReview, QaConversationReviewInput, QaConversationSummary, QaCurrentAccess, QaFeedbackHarvestEntry, QaFeedbackHarvestResult, QaFeedbackQuery, QaFeedbackRow, QaMessageFeedback, QaMessageFeedbackInput, QaModelCatalogEntry, QaModelPair, QaQualityMetrics, QaReviewQueueItem, QaReviewQueueRow, QaSessionAccess, QaSlashCatalog, QaSlashExecution, QaSlashSubmitAttachment, QaSkillActivationRecord, QaSkillAssignmentOverride, QaSubrole, QaUserAccess, QaUserQuery } from "./types.js";
|
|
10
12
|
export declare const name = "qa-surface";
|
|
11
13
|
export declare const inject: string[];
|
|
12
14
|
import { QA_SURFACE_SETTINGS_NAMESPACE } from "./shared/settings.js";
|
|
@@ -19,6 +21,8 @@ declare module "@deepseek-ai/cordis" {
|
|
|
19
21
|
}
|
|
20
22
|
/** Host companion: validates config, owns the admission boundary and the route. */
|
|
21
23
|
export declare class QaSurface extends TypertRemoteService {
|
|
24
|
+
private sourceSelections?;
|
|
25
|
+
private codeSourceStore;
|
|
22
26
|
static inject: string[];
|
|
23
27
|
static Config: import("@deepseek-ai/schemastery").default<QaSurfaceConfigRefs>;
|
|
24
28
|
private readonly source;
|
|
@@ -126,6 +130,11 @@ export declare class QaSurface extends TypertRemoteService {
|
|
|
126
130
|
* @param sessionId - the chat the work is delegated from.
|
|
127
131
|
*/
|
|
128
132
|
modelPolicyForSession(sessionId: string): QaModelPair | undefined;
|
|
133
|
+
/** Shared source catalogue consumed by preset-mounted Git tools at call time. */
|
|
134
|
+
getCodeSources(sessionId?: string): ResolvedQaSurfaceConfig["codeSources"];
|
|
135
|
+
getSelectedCodeSource(sessionId: string): string | null;
|
|
136
|
+
chatCodeSources(token: string, sessionId: string): Promise<QaChatCodeSources>;
|
|
137
|
+
chatSelectCodeSource(token: string, sessionId: string, source: string | null): Promise<QaChatCodeSources>;
|
|
129
138
|
getConfig(): ResolvedQaSurfaceConfig;
|
|
130
139
|
/**
|
|
131
140
|
* Ownership plus the role's user-skill grant for one slash read.
|
|
@@ -172,9 +181,7 @@ export declare class QaSurface extends TypertRemoteService {
|
|
|
172
181
|
*/
|
|
173
182
|
accountsClaimSessions(token: string, sessionIds: readonly string[]): QaClaimResult;
|
|
174
183
|
/** The token user's owned session ids; the sidebar list authority. */
|
|
175
|
-
accountsOwnedSessions(token: string):
|
|
176
|
-
readonly ids: readonly string[];
|
|
177
|
-
};
|
|
184
|
+
accountsOwnedSessions(token: string): QaOwnedSessionsResult;
|
|
178
185
|
/**
|
|
179
186
|
* Every chat-ownership entry with owner display names; the cross-user view
|
|
180
187
|
* admin browsers group the sidebar by. Ordinary accounts are refused with
|
|
@@ -229,6 +236,9 @@ export declare class QaSurface extends TypertRemoteService {
|
|
|
229
236
|
accountsSetServiceTokenClarifications(token: string, tokenId: string, allowed: boolean): {
|
|
230
237
|
readonly updated: boolean;
|
|
231
238
|
};
|
|
239
|
+
accountsSetServiceTokenHistoryFolder(token: string, tokenId: string, folder: QaHistoryFolderTarget | null): {
|
|
240
|
+
readonly updated: boolean;
|
|
241
|
+
};
|
|
232
242
|
/**
|
|
233
243
|
* Serve the effective QA configuration to the browser. The DSH gateway pins
|
|
234
244
|
* settings RPCs to loopback, so a browser served over the LAN always sees
|
|
@@ -241,8 +251,30 @@ export declare class QaSurface extends TypertRemoteService {
|
|
|
241
251
|
* Report server admission. Global reads expose counts only; a chat's FIFO
|
|
242
252
|
* position requires that account's current read access to the chat. The
|
|
243
253
|
* scheduler gates every root turn, including native and integration sends.
|
|
254
|
+
*
|
|
255
|
+
* Both arguments are part of the wire contract: the gateway client counts
|
|
256
|
+
* declared parameters rather than TypeScript optionals, so a call that omits
|
|
257
|
+
* them is refused on the browser before the Host ever sees it. An empty
|
|
258
|
+
* session id is the global read — the shape every initial send asks for,
|
|
259
|
+
* while its draft chat has no session to name yet.
|
|
260
|
+
*/
|
|
261
|
+
queueStatus(token: string, sessionId: string): QaQueueStatus;
|
|
262
|
+
/**
|
|
263
|
+
* The ceiling this read answers against: the chat's own account chain when
|
|
264
|
+
* the read names a chat, the caller's account chain when it does not (the
|
|
265
|
+
* pre-send check carries a token but no chat yet), and the deployment's
|
|
266
|
+
* number whenever accounts are off or nobody matches. `undefined` is the
|
|
267
|
+
* scheduler's signal to fall back to that number, so the branch is a value
|
|
268
|
+
* rather than a flag.
|
|
269
|
+
*/
|
|
270
|
+
private queueCeiling;
|
|
271
|
+
/**
|
|
272
|
+
* The ceiling override one arriving turn fills against, or `undefined` when
|
|
273
|
+
* the deployment default governs it: without accounts every turn shares the
|
|
274
|
+
* one number, and an unowned session (an integration or an admin preview)
|
|
275
|
+
* stays in that shared pool whatever its role might say.
|
|
244
276
|
*/
|
|
245
|
-
|
|
277
|
+
private queueSlotsOverride;
|
|
246
278
|
/**
|
|
247
279
|
* Create a QA session from Host-owned inputs. With account workspaces on,
|
|
248
280
|
* cwd is `<configured workspace>/.qa-users/<account UUID>` and the child is
|
|
@@ -261,6 +293,7 @@ export declare class QaSurface extends TypertRemoteService {
|
|
|
261
293
|
accessUpdateSubrole(token: string, id: string, input: QaSubrole): Promise<QaSubrole>;
|
|
262
294
|
/** The pairs this Host can serve, for the surface that writes a policy. */
|
|
263
295
|
accessModelCatalog(token: string): Promise<readonly QaModelCatalogEntry[]>;
|
|
296
|
+
accessUserModels(token: string, sessionId: string | null, subroleId: string | null, adminPreview: boolean): Promise<QaModelOptions>;
|
|
264
297
|
accessDeleteSubrole(token: string, id: string, replacementId: string | null): {
|
|
265
298
|
readonly deleted: boolean;
|
|
266
299
|
};
|
|
@@ -4,8 +4,6 @@ import type { PluginLogger } from "@yadsh/dsh-plugin-log";
|
|
|
4
4
|
import type { ResolvedQaSurfaceConfig } from "../types.js";
|
|
5
5
|
import { type QaAskRequest } from "./contract.js";
|
|
6
6
|
import type { QaIntegrationService } from "./service.js";
|
|
7
|
-
/** The bridge's own ceiling: five attachments per question. */
|
|
8
|
-
export declare const QA_INTEGRATION_MAX_FILES = 5;
|
|
9
7
|
export interface QaIntegrationRouteOptions {
|
|
10
8
|
config: ResolvedQaSurfaceConfig;
|
|
11
9
|
service: QaIntegrationService;
|
|
@@ -59,7 +57,7 @@ interface MultipartBody {
|
|
|
59
57
|
* @param boundary - the boundary parameter of the content type.
|
|
60
58
|
* @returns text fields and file parts, in the order they appeared.
|
|
61
59
|
*/
|
|
62
|
-
export declare function parseMultipart(body: Buffer, boundary: string): MultipartBody;
|
|
60
|
+
export declare function parseMultipart(body: Buffer, boundary: string, maxAttachments?: number): MultipartBody;
|
|
63
61
|
/**
|
|
64
62
|
* Read the whole request body under a byte ceiling.
|
|
65
63
|
* @param request - the incoming request.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PluginLogger } from "@yadsh/dsh-plugin-log";
|
|
2
2
|
import type { QaAccounts } from "../accounts/store.js";
|
|
3
|
+
import type { QaHistoryFolderTarget } from "../types/accounts.js";
|
|
3
4
|
import { type QaServiceTokenScope } from "../accounts/service-token.js";
|
|
4
5
|
import type { QaSourceReference } from "../provenance/types.js";
|
|
5
6
|
import type { ResolvedQaSurfaceConfig } from "../types.js";
|
|
@@ -31,6 +32,7 @@ export declare const QA_INTEGRATION_MAX_CITATIONS = 5;
|
|
|
31
32
|
export declare function sourceCitations(sources: readonly QaSourceReference[]): readonly string[];
|
|
32
33
|
/** Who a presented credential turned out to be. */
|
|
33
34
|
export interface QaIntegrationIdentity {
|
|
35
|
+
readonly historyFolder?: QaHistoryFolderTarget;
|
|
34
36
|
readonly allowClarifications: boolean;
|
|
35
37
|
readonly tokenId: string;
|
|
36
38
|
readonly userId: string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PluginLogger } from "@yadsh/dsh-plugin-log";
|
|
2
|
+
import type { ResolvedQaSurfaceConfig } from "../types.js";
|
|
3
|
+
import { type QaSkillRoots } from "./paths.js";
|
|
4
|
+
/**
|
|
5
|
+
* Promote an operator-selected subset of a read-only catalog into the shared
|
|
6
|
+
* store. Copy complete directories, including resources, before publishing a
|
|
7
|
+
* skill. Neither a restart, an updated seed nor an editor deletion restores
|
|
8
|
+
* the original bytes: a hidden per-name receipt survives rename and removal.
|
|
9
|
+
* Existing shared directories always belong to the operator and win as-is.
|
|
10
|
+
*/
|
|
11
|
+
export declare function seedSharedSkills(roots: QaSkillRoots, seed: ResolvedQaSurfaceConfig["accounts"]["skills"]["sharedSeed"], logger: PluginLogger): boolean;
|
|
12
|
+
//# sourceMappingURL=shared-seed.d.ts.map
|
|
@@ -32,6 +32,7 @@ export declare const QA_DOCUMENTS_NOTE = "dsh-qa-surface:attached-documents";
|
|
|
32
32
|
/** Note name carrying the deployment's rule about where an answer comes from. */
|
|
33
33
|
export declare const QA_SOURCE_PRIORITY_NOTE = "dsh-qa-surface:source-priority";
|
|
34
34
|
export declare const QA_BRANCH_NOTE = "dsh-qa-surface:chat-branch";
|
|
35
|
+
export declare const QA_CODE_SOURCES_NOTE = "dsh-qa-surface:code-sources";
|
|
35
36
|
/**
|
|
36
37
|
* Built-in note texts. Each is the fallback for its settings template
|
|
37
38
|
* (`notes.*.template`); the placeholders mark the parts the injector
|
|
@@ -40,8 +41,8 @@ export declare const QA_BRANCH_NOTE = "dsh-qa-surface:chat-branch";
|
|
|
40
41
|
export declare const QA_IDENTITY_NOTE_TEMPLATE = "{identity}\n\n{instructions}";
|
|
41
42
|
export declare const QA_SOURCES_NOTE_TEMPLATE = "Source provenance is collected automatically from your tool calls; the QA surface lists what it collected beside the answer. Do not append a manual Sources/\u0418\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0438 bibliography of your own.";
|
|
42
43
|
export declare const QA_SOURCES_FALLBACK_TEMPLATE = "A delegated run whose provider cannot expose tool events must call {reportTool} before finishing.";
|
|
43
|
-
export declare const QA_DELEGATION_NOTE_TEMPLATE
|
|
44
|
-
export declare const QA_DOCUMENTS_NOTE_TEMPLATE
|
|
44
|
+
export declare const QA_DELEGATION_NOTE_TEMPLATE: string;
|
|
45
|
+
export declare const QA_DOCUMENTS_NOTE_TEMPLATE: string;
|
|
45
46
|
export declare const QA_SOURCE_PRIORITY_NOTE_TEMPLATE = "Answer from the source that owns the question: read what the conversation and its attachments already carry, then search the product documentation and ask the domain expert, and only then look in memory. Recalled memory is background from earlier sessions \u2014 a miss there is not evidence that no source exists, and it is not where a document, a page or a product fact should be looked up.";
|
|
46
47
|
export interface QaIdentityRenderInput {
|
|
47
48
|
/** The owner's account address; the one fact accounts always provide. */
|
|
@@ -71,6 +72,7 @@ export interface QaPromptNote {
|
|
|
71
72
|
readonly text: string;
|
|
72
73
|
}
|
|
73
74
|
export interface QaPromptNotesOptions {
|
|
75
|
+
readonly codeSources?: (sessionId: string) => import("@yadsh/dsh-plugin-kit/code-sources").CodeSourcesCatalog;
|
|
74
76
|
readonly config: () => ResolvedQaSurfaceConfig;
|
|
75
77
|
/** The live accounts store, or undefined while accounts are disabled. */
|
|
76
78
|
readonly accounts: () => QaAccounts | undefined;
|
|
@@ -116,6 +118,8 @@ export declare class QaPromptNotes {
|
|
|
116
118
|
dispose(): void;
|
|
117
119
|
/** Append every note whose text this step does not already carry. */
|
|
118
120
|
private inject;
|
|
121
|
+
/** Keep Git and file lookups on the same configured tree, including in children. */
|
|
122
|
+
private codeSourceNotes;
|
|
119
123
|
/** Who is asking: the owner's name, handles and their own instructions. */
|
|
120
124
|
private identityNotes;
|
|
121
125
|
/** What the deployment expects around the sources the surface collects. */
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import type { CodeFilesOptions } from "./code-files.js";
|
|
1
2
|
import type { Agent } from "@deepseek-ai/dsh-agent";
|
|
2
3
|
import type { QaToolDescriptor } from "./types.js";
|
|
3
4
|
import type { QaFormGate } from "../forms/gate.js";
|
|
5
|
+
import { type QaSubagentToolsOptions } from "./subagent-tools.js";
|
|
4
6
|
/**
|
|
5
7
|
* Deterministic catalog identity. The durable activation marker is derived from
|
|
6
8
|
* the session log rather than stored, so this version is not compared against a
|
|
@@ -9,9 +11,10 @@ import type { QaFormGate } from "../forms/gate.js";
|
|
|
9
11
|
*
|
|
10
12
|
* Bump it whenever the catalog's tool set or their schemas change.
|
|
11
13
|
*/
|
|
12
|
-
export declare const QA_TOOL_CATALOG_VERSION = "
|
|
14
|
+
export declare const QA_TOOL_CATALOG_VERSION = "6";
|
|
13
15
|
/** What the catalog's definitions read, beyond the execution record. */
|
|
14
|
-
export interface QaToolsSelfcheckDeps {
|
|
16
|
+
export interface QaToolsSelfcheckDeps extends CodeFilesOptions {
|
|
17
|
+
readonly subagents?: QaSubagentToolsOptions;
|
|
15
18
|
readonly forms?: QaFormGate;
|
|
16
19
|
readonly formProjection?: (submission: import("../forms/types.js").QaFormSubmission, sessionId: string) => Promise<unknown>;
|
|
17
20
|
readonly catalogVersion: string;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type CodeSource, type CodeSourcesCatalog } from "@yadsh/dsh-plugin-kit/code-sources";
|
|
2
|
+
export interface CodeExecution {
|
|
3
|
+
readonly agent?: {
|
|
4
|
+
readonly session?: {
|
|
5
|
+
readonly id?: unknown;
|
|
6
|
+
readonly header?: {
|
|
7
|
+
readonly cwd?: unknown;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface CodeFilesOptions {
|
|
13
|
+
readonly codeSources?: ((exec?: CodeExecution) => CodeSourcesCatalog) | undefined;
|
|
14
|
+
readonly codeReadRoots?: (() => readonly string[]) | undefined;
|
|
15
|
+
}
|
|
16
|
+
export interface CodeScope {
|
|
17
|
+
readonly source: CodeSource;
|
|
18
|
+
readonly root: string;
|
|
19
|
+
}
|
|
20
|
+
/** Selection and authorization are separate, including after following root links. */
|
|
21
|
+
export declare function codeScope(options: CodeFilesOptions, exec: CodeExecution, requested?: unknown): Promise<CodeScope>;
|
|
22
|
+
export declare function boundedInteger(value: unknown, fallback: number, max: number): number;
|
|
23
|
+
/** Read a bounded window, with the selected identity on every result. */
|
|
24
|
+
export declare function readCode(scope: CodeScope, args: {
|
|
25
|
+
path?: unknown;
|
|
26
|
+
from?: unknown;
|
|
27
|
+
lines?: unknown;
|
|
28
|
+
}): Promise<{
|
|
29
|
+
source: string;
|
|
30
|
+
label: string;
|
|
31
|
+
root: string;
|
|
32
|
+
path: string;
|
|
33
|
+
absolutePath: string;
|
|
34
|
+
from: number;
|
|
35
|
+
to: number;
|
|
36
|
+
totalLines: number;
|
|
37
|
+
text: string;
|
|
38
|
+
truncated: boolean;
|
|
39
|
+
}>;
|
|
40
|
+
/** Literal search in one tree; entry, file, content, time and output budgets are fixed. */
|
|
41
|
+
export declare function searchCode(scope: CodeScope, args: {
|
|
42
|
+
query?: unknown;
|
|
43
|
+
path?: unknown;
|
|
44
|
+
limit?: unknown;
|
|
45
|
+
}): Promise<{
|
|
46
|
+
source: string;
|
|
47
|
+
label: string;
|
|
48
|
+
root: string;
|
|
49
|
+
query: string;
|
|
50
|
+
hits: {
|
|
51
|
+
path: string;
|
|
52
|
+
line: number;
|
|
53
|
+
text: string;
|
|
54
|
+
}[];
|
|
55
|
+
filesScanned: number;
|
|
56
|
+
skipped: number;
|
|
57
|
+
truncated: boolean;
|
|
58
|
+
}>;
|
|
59
|
+
//# sourceMappingURL=code-files.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ToolDefinition } from "@deepseek-ai/dsh-tools";
|
|
2
|
+
import { type CodeFilesOptions } from "./code-files.js";
|
|
3
|
+
/** Discovery reports availability in this session without granting new roots. */
|
|
4
|
+
export declare function createCodeSourcesTool(options: CodeFilesOptions): ToolDefinition;
|
|
5
|
+
export declare function createCodeReadTool(options: CodeFilesOptions): ToolDefinition;
|
|
6
|
+
export declare function createCodeSearchTool(options: CodeFilesOptions): ToolDefinition;
|
|
7
|
+
//# sourceMappingURL=code-tools.d.ts.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ToolDefinition } from "@deepseek-ai/dsh-tools";
|
|
2
|
+
import { type CodeSourcesCatalog } from "@yadsh/dsh-plugin-kit/code-sources";
|
|
2
3
|
/**
|
|
3
4
|
* `docs_search` and `docs_read` — the documentation surface of the QA catalog.
|
|
4
5
|
*
|
|
@@ -73,6 +74,7 @@ interface QaDocsExecution {
|
|
|
73
74
|
* comes from configuration instead of from the calling chat.
|
|
74
75
|
*/
|
|
75
76
|
export interface QaDocsOptions {
|
|
77
|
+
readonly codeSources?: ((exec?: import("./code-files.js").CodeExecution) => CodeSourcesCatalog) | undefined;
|
|
76
78
|
/** Absolute documentation root, or `""` for `<chat workspace>/docs`. */
|
|
77
79
|
readonly root?: string;
|
|
78
80
|
/**
|
|
@@ -112,6 +114,7 @@ export interface QaDocsHit extends QaDocsIdentity {
|
|
|
112
114
|
}
|
|
113
115
|
/** The outcome of one documentation search. */
|
|
114
116
|
export interface QaDocsSearchResult extends QaDocsIdentity {
|
|
117
|
+
readonly source?: string;
|
|
115
118
|
readonly query: string;
|
|
116
119
|
/** The directory documentation is read from, relative to the workspace. */
|
|
117
120
|
readonly root: string;
|
|
@@ -122,6 +125,7 @@ export interface QaDocsSearchResult extends QaDocsIdentity {
|
|
|
122
125
|
}
|
|
123
126
|
/** The outcome of one documentation read. */
|
|
124
127
|
export interface QaDocsReadResult extends QaDocsIdentity {
|
|
128
|
+
readonly source?: string;
|
|
125
129
|
readonly path: string;
|
|
126
130
|
/** Actual read target, kept out of the model-facing rendering. */
|
|
127
131
|
readonly absolutePath: string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
2
|
+
import type { QaSessionOwnership } from "../session-ownership.js";
|
|
3
|
+
import type { QaFileWritePolicy } from "../shared/file-write-policy.js";
|
|
4
|
+
/** Global monotonic guard: covers attested roots, children and nested dispatch. */
|
|
5
|
+
export declare function installQaFileWriteGate(ctx: Context, ownership: QaSessionOwnership, policy: () => QaFileWritePolicy): () => void;
|
|
6
|
+
//# sourceMappingURL=file-write-gate.d.ts.map
|
|
@@ -3,6 +3,9 @@ import type { Context } from "@deepseek-ai/cordis";
|
|
|
3
3
|
import type { PluginLogger } from "@yadsh/dsh-plugin-log";
|
|
4
4
|
import type { QaToolActivation } from "./types.js";
|
|
5
5
|
export interface QaToolsOptions {
|
|
6
|
+
readonly subagents?: import("./subagent-tools.js").QaSubagentToolsOptions;
|
|
7
|
+
readonly codeSources?: import("./code-files.js").CodeFilesOptions["codeSources"];
|
|
8
|
+
readonly codeReadRoots?: () => readonly string[];
|
|
6
9
|
readonly forms?: import("../forms/gate.js").QaFormGate;
|
|
7
10
|
readonly formsEnabled?: () => boolean;
|
|
8
11
|
readonly formProjection?: (submission: import("../forms/types.js").QaFormSubmission, sessionId: string) => Promise<unknown>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
2
|
+
import type { Agent, AgentOptions } from "@deepseek-ai/dsh-agent";
|
|
3
|
+
import { type ContentBlock } from "@deepseek-ai/dsh-llm";
|
|
4
|
+
import type { ToolDefinition } from "@deepseek-ai/dsh-tools";
|
|
5
|
+
import { type QaSessionModelPolicy } from "../access/model-policy.js";
|
|
6
|
+
/** Optional Host service: loading QA does not require a subagent backend. */
|
|
7
|
+
export interface QaSubagentsFace {
|
|
8
|
+
getProvider(name: string): {
|
|
9
|
+
readonly capabilities: {
|
|
10
|
+
readonly agentOptions: boolean;
|
|
11
|
+
readonly depthLimit: boolean;
|
|
12
|
+
};
|
|
13
|
+
} | undefined;
|
|
14
|
+
resolveMaxDepth(value: undefined): number | undefined;
|
|
15
|
+
startActivation(spec: {
|
|
16
|
+
readonly provider: string;
|
|
17
|
+
readonly label: string;
|
|
18
|
+
readonly signal: AbortSignal;
|
|
19
|
+
readonly delivery: "parent";
|
|
20
|
+
readonly request: {
|
|
21
|
+
readonly parent: Agent;
|
|
22
|
+
readonly prompt: ContentBlock[];
|
|
23
|
+
readonly agentOptions: AgentOptions;
|
|
24
|
+
readonly maxDepth?: number;
|
|
25
|
+
};
|
|
26
|
+
}): Promise<{
|
|
27
|
+
readonly childId: string;
|
|
28
|
+
}>;
|
|
29
|
+
}
|
|
30
|
+
export interface QaSubagentToolsOptions {
|
|
31
|
+
readonly ctx: Context;
|
|
32
|
+
/** Must reject a caller outside an attested QA conversation. */
|
|
33
|
+
readonly policy: (agent: Agent) => QaSessionModelPolicy;
|
|
34
|
+
readonly runtime: () => QaSubagentsFace | undefined;
|
|
35
|
+
}
|
|
36
|
+
/** Only live catalog entries covered by the owner's current model grants. */
|
|
37
|
+
export declare function createQaListSubagentModelsTool(options: QaSubagentToolsOptions): ToolDefinition;
|
|
38
|
+
/** Start a fresh native child, with route authority supplied by QA ownership. */
|
|
39
|
+
export declare function createQaSubagentTool(options: QaSubagentToolsOptions): ToolDefinition;
|
|
40
|
+
//# sourceMappingURL=subagent-tools.d.ts.map
|