@peer-agent/protocol 0.1.0-rc.5 → 0.1.0-rc.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/acceptance-close-gate.d.ts +10 -1
- package/dist/acceptance-close-gate.js +12 -0
- package/dist/agent-supervision.d.ts +81 -0
- package/dist/agent-supervision.js +1 -0
- package/dist/attention.d.ts +44 -0
- package/dist/attention.js +1 -0
- package/dist/bot-access-policy.d.ts +29 -0
- package/dist/bot-access-policy.js +1 -0
- package/dist/bot-conversation-read.d.ts +67 -0
- package/dist/bot-conversation-read.js +9 -0
- package/dist/bot-direct-step.d.ts +11 -0
- package/dist/bot-direct-step.js +1 -0
- package/dist/bot-git.d.ts +55 -0
- package/dist/bot-git.js +1 -0
- package/dist/bot-model-selection.d.ts +13 -0
- package/dist/bot-model-selection.js +1 -0
- package/dist/browser-window.d.ts +48 -0
- package/dist/browser-window.js +23 -0
- package/dist/capability-admission.d.ts +20 -0
- package/dist/capability-admission.js +1 -0
- package/dist/compaction-history-selection.d.ts +15 -0
- package/dist/compaction-history-selection.js +30 -0
- package/dist/compaction.d.ts +5 -0
- package/dist/compaction.js +6 -0
- package/dist/context-accounting.d.ts +3 -0
- package/dist/conversation-execution.d.ts +68 -0
- package/dist/conversation-execution.js +222 -0
- package/dist/delegation-coordination.d.ts +81 -0
- package/dist/delegation-coordination.js +1 -0
- package/dist/delegation.d.ts +260 -7
- package/dist/delegation.js +97 -39
- package/dist/document-reference.d.ts +111 -0
- package/dist/document-reference.js +1 -0
- package/dist/evidence-inspection.d.ts +84 -0
- package/dist/evidence-inspection.js +1 -0
- package/dist/gemini-standard-pricing.json +105 -0
- package/dist/goal.d.ts +50 -2
- package/dist/group-chat.d.ts +87 -0
- package/dist/group-chat.js +1 -0
- package/dist/hook-observation.d.ts +2 -0
- package/dist/hook-observation.js +19 -0
- package/dist/index.d.ts +117 -25
- package/dist/index.js +41 -0
- package/dist/input-prediction.d.ts +86 -0
- package/dist/input-prediction.js +48 -0
- package/dist/intent-coordination.d.ts +201 -0
- package/dist/intent-coordination.js +1 -0
- package/dist/interactive-result.d.ts +363 -0
- package/dist/interactive-result.js +215 -0
- package/dist/interactive-verification.d.ts +41 -0
- package/dist/interactive-verification.js +65 -0
- package/dist/local-git.d.ts +44 -0
- package/dist/local-git.js +3 -0
- package/dist/local-image.d.ts +53 -0
- package/dist/local-image.js +5 -0
- package/dist/local-read.d.ts +9 -0
- package/dist/local-read.js +1 -0
- package/dist/memory.d.ts +117 -12
- package/dist/memory.js +12 -0
- package/dist/model-reasoning.d.ts +16 -0
- package/dist/model-reasoning.js +25 -0
- package/dist/model-routing.d.ts +39 -3
- package/dist/model-routing.js +31 -5
- package/dist/native-process.d.ts +21 -0
- package/dist/native-process.js +51 -0
- package/dist/parent-coordination.d.ts +104 -0
- package/dist/parent-coordination.js +2 -0
- package/dist/persistent-workspace.d.ts +519 -0
- package/dist/persistent-workspace.js +1 -0
- package/dist/project-agent-failure.d.ts +30 -0
- package/dist/project-agent-failure.js +44 -0
- package/dist/project-input-recovery.d.ts +83 -0
- package/dist/project-input-recovery.js +25 -0
- package/dist/project-matter.d.ts +359 -0
- package/dist/project-matter.js +1 -0
- package/dist/project-recovery.d.ts +43 -0
- package/dist/project-recovery.js +1 -0
- package/dist/project.d.ts +233 -0
- package/dist/project.js +134 -5
- package/dist/prompt-skill.d.ts +31 -0
- package/dist/prompt-skill.js +1 -0
- package/dist/quiet-reply.d.ts +9 -0
- package/dist/quiet-reply.js +43 -0
- package/dist/remote-access.d.ts +15 -0
- package/dist/remote-access.js +1 -1
- package/dist/reply-delivery.d.ts +28 -0
- package/dist/reply-delivery.js +1 -0
- package/dist/resource-edit-execution.d.ts +68 -0
- package/dist/resource-edit-execution.js +96 -0
- package/dist/resource-edit.d.ts +237 -0
- package/dist/resource-edit.js +134 -0
- package/dist/resource-feedback-transport.d.ts +26 -0
- package/dist/resource-feedback-transport.js +94 -0
- package/dist/resource-feedback.d.ts +110 -0
- package/dist/resource-feedback.js +168 -0
- package/dist/resource-file-replace.d.ts +36 -0
- package/dist/resource-file-replace.js +40 -0
- package/dist/resource-reference-hints.d.ts +3 -0
- package/dist/resource-reference-hints.js +58 -0
- package/dist/resource-window.d.ts +222 -0
- package/dist/resource-window.js +252 -0
- package/dist/routine.d.ts +82 -0
- package/dist/routine.js +1 -0
- package/dist/runtime-session-facts.d.ts +58 -0
- package/dist/runtime-session-facts.js +57 -0
- package/dist/session-control.d.ts +211 -0
- package/dist/session-control.js +48 -0
- package/dist/session-facts.d.ts +29 -0
- package/dist/session-facts.js +35 -0
- package/dist/skill-marketplace.d.ts +39 -4
- package/dist/spend-budget.d.ts +69 -0
- package/dist/spend-budget.js +1 -0
- package/dist/system-context.d.ts +7 -0
- package/dist/task-overview.d.ts +91 -0
- package/dist/task-overview.js +325 -17
- package/dist/tool-activity-preview.d.ts +4 -0
- package/dist/tool-activity-preview.js +72 -0
- package/dist/updater.d.ts +13 -3
- package/dist/usage-accounting.d.ts +42 -1
- package/dist/user-anchor.d.ts +17 -0
- package/dist/user-anchor.js +1 -0
- package/dist/work-coordination.d.ts +188 -0
- package/dist/work-coordination.js +1 -0
- package/dist/work-hook.d.ts +3 -0
- package/dist/work-hook.js +76 -0
- package/dist/working-plan.d.ts +18 -0
- package/dist/working-plan.js +1 -0
- package/dist/workspace.d.ts +35 -0
- package/dist/workspace.js +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,35 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export type * from './group-chat.ts';
|
|
2
|
+
export type * from './routine.ts';
|
|
3
|
+
export type * from './persistent-workspace.ts';
|
|
4
|
+
export { isGlobalBotProfile } from './project.ts';
|
|
5
|
+
export { BOT_CONTEXT_BOUNDARY_KIND } from './project.ts';
|
|
6
|
+
export type { NewBotConversationResult, EnsureGlobalBotResult, GlobalBotErrorCode, GlobalBotPreferences, GlobalBotPreferencesResult, GlobalBotPreferencesUpdate, GlobalBotRpc, GlobalBotRpcFailure, GlobalBotRpcNotifications } from './project.ts';
|
|
7
|
+
export type { BotTeam, BotTeams, BotTeamsResult, UpdateBotTeams, BotTeamsRpc, BotTeamsNotifications } from './workspace.ts';
|
|
8
|
+
export type { BotDirectAction, BotDirectStep } from './bot-direct-step.ts';
|
|
9
|
+
export { WORK_HOOK_SEMANTIC_FLOOR, nativeWorkHasHookFacts } from './work-hook.ts';
|
|
10
|
+
export type { AttentionCard, BotDecisionSnapshot, BotAttentionItem, BotAttentionRequest, BotAttentionResult } from './attention.ts';
|
|
11
|
+
export type { ProjectWorkBudgetLimits, NativeEpisodeRecorder, ProjectWorkBudgetBoundary, ProjectReplyRecoveryAction, ProjectWorkReceipt, ProjectWorkRecovery, ProjectWorkState, ProjectTurnEnd, ProjectReplyFailureStatus, ProjectAgentSilentWait, } from './work-coordination.ts';
|
|
12
|
+
export type { CoordinationAction, CoordinationLifecycle, CoordinationMandate, CoordinationDecision, TaskTransitionPhase, TaskTransition, CoordinationExecutionBinding, CoordinationSessionFacts, } from './delegation-coordination.ts';
|
|
13
|
+
export { deriveSessionFacts, type SessionFactSnapshot } from './session-facts.ts';
|
|
14
|
+
export { runtimeSessionFacts, runtimeSessionOwnership, hasPendingRuntimeSessions } from './runtime-session-facts.ts';
|
|
15
|
+
export type { RuntimeHandling, RuntimeSessionFacts, RuntimeSessionOwnership, ResourceWaitScope, ResourceWaitReference, ResourceWaitFact, ResourceWaitInspection, ResourceWaitPort } from './runtime-session-facts.ts';
|
|
16
|
+
export { projectAgentFailureKind, classifyProjectAgentFailure, type ProjectRecoveryFailureKind, type ProviderRequestRecovery, type ProjectAgentTurnRecovery, type ReplyAnchorCandidate } from './project-agent-failure.ts';
|
|
17
|
+
export type { EvidenceSourceDescription, EvidenceDeliveryBinding, EvidenceDelivery, ProjectAgentEvidenceReadRequest, ProjectAgentEvidenceReadResult } from './evidence-inspection.ts';
|
|
18
|
+
export { toolActivityPreview, toolActivitySummary } from './tool-activity-preview.ts';
|
|
19
|
+
export { isModelReasoningEffort, modelReasoningLevels, modelDefaultReasoningEffort, type ModelReasoningEffort } from './model-reasoning.ts';
|
|
20
|
+
export type { SelectionRange, SelectionReference, SelectionDraft, SelectionOrigin, SelectionChildSession, SelectionChildSummary, SelectionChildrenPage, SelectionChildRead, } from './selection-reference.ts';
|
|
2
21
|
export { buildModelMenuGroups, modelMenuChannelName, type ModelMenuRow } from './model-menu.ts';
|
|
3
22
|
export { evaluateUiDelivery } from './ui-delivery-verification.ts';
|
|
4
23
|
export { DESKTOP_PREVIEW_PROTOCOL, DESKTOP_PREVIEW_CAPABILITY, DESKTOP_PREVIEW_TOOL } from './desktop-preview.ts';
|
|
5
24
|
export type { DesktopPreviewRequest, DesktopPreviewReply } from './desktop-preview.ts';
|
|
6
|
-
export type { UiDeliveryIdentity, UiDeliveryRequirement, UiDeliveryObservation, UiDeliveryJudgment, UiDeliveryGap } from './ui-delivery-verification.ts';
|
|
25
|
+
export type { UiDeliveryIdentity, UiDeliveryRequirement, UiDeliveryObservation, UiDeliveryJudgment, UiDeliveryGap, } from './ui-delivery-verification.ts';
|
|
7
26
|
export { REMOTE_PROTOCOL_VERSION, parseRemoteReadRequest, admitRemoteRead } from './remote-access.ts';
|
|
8
27
|
export type { RemoteReadRequest, RemoteReadContext, RemoteReadRejection, RemoteReadAdmission } from './remote-access.ts';
|
|
9
28
|
export { REMOTE_PROJECT_LIMITS, parseRemoteProjectRequest, admitRemoteProject, parseRemoteDelegationProjection } from './remote-access.ts';
|
|
10
|
-
export type { RemoteProjectGrant, RemoteProjectRequest, RemoteProjectContext, RemoteProjectRejection, RemoteProjectAdmission, RemoteDelegationProjection } from './remote-access.ts';
|
|
29
|
+
export type { RemoteProjectGrant, RemoteProjectRequest, RemoteProjectInteractiveResult, RemoteProjectContext, RemoteProjectRejection, RemoteProjectAdmission, RemoteDelegationProjection, } from './remote-access.ts';
|
|
11
30
|
export type LocalAccessLevel = 'ask_before_local' | 'session_local' | 'restricted_local' | 'full_local';
|
|
12
|
-
export type {
|
|
31
|
+
export type { BotAccessPolicy, BotAccessPolicyReadRequest, BotAccessPolicyUpdateRequest, BotAccessPolicyResult } from './bot-access-policy.ts';
|
|
32
|
+
export type { ConversationLifetimeUsage, ProviderRequestUsage, RuntimeTurnUsage, NativeRuntimeUsageSnapshot, NativeUsageRecoveryProgress, UsageAmounts, UsageScope, } from './usage-accounting.ts';
|
|
13
33
|
export type CapabilityRiskLevel = 'L0_inert' | 'L1_local_read' | 'L2_local_write' | 'L3_external_write' | 'L4_privileged' | 'L5_destructive';
|
|
14
34
|
export type DataLevel = 'D0_public' | 'D1_internal' | 'D2_sensitive' | 'D3_private' | 'D4_regulated';
|
|
15
35
|
export type CapabilitySource = 'native' | 'shell' | 'plugin' | 'mcp' | 'page_bridge' | 'private' | 'web';
|
|
@@ -151,7 +171,7 @@ export interface McpCredentialMetadataView {
|
|
|
151
171
|
readonly createdAt: string;
|
|
152
172
|
readonly updatedAt: string;
|
|
153
173
|
readonly lastFour?: string;
|
|
154
|
-
readonly storage?: 'safeStorage' | 'file-fallback';
|
|
174
|
+
readonly storage?: 'safeStorage' | 'file-fallback' | 'vault';
|
|
155
175
|
}
|
|
156
176
|
export interface McpCredentialPutRequest {
|
|
157
177
|
readonly credentialRef?: string;
|
|
@@ -222,6 +242,12 @@ export interface LocalMcpServerView {
|
|
|
222
242
|
readonly resources: readonly McpResourceSummary[];
|
|
223
243
|
readonly prompts: readonly McpPromptSummary[];
|
|
224
244
|
readonly health: McpHealthView;
|
|
245
|
+
readonly policy?: {
|
|
246
|
+
readonly trusted?: boolean;
|
|
247
|
+
readonly requirePermission?: boolean;
|
|
248
|
+
readonly visibleByDefault?: boolean;
|
|
249
|
+
readonly maxRiskLevel?: string;
|
|
250
|
+
};
|
|
225
251
|
readonly manifestUpdatedAt?: string | null;
|
|
226
252
|
readonly lastError?: string | null;
|
|
227
253
|
readonly createdAt?: string;
|
|
@@ -325,7 +351,7 @@ export interface WorkspaceProject {
|
|
|
325
351
|
readonly updatedAt: string;
|
|
326
352
|
}
|
|
327
353
|
export type LlmProviderType = 'openai' | 'anthropic';
|
|
328
|
-
export type LlmWireProtocol = 'openai-chat' | 'openai-responses' | 'anthropic-messages' | 'gemini'
|
|
354
|
+
export type LlmWireProtocol = 'openai-chat' | 'openai-responses' | 'anthropic-messages' | 'gemini';
|
|
329
355
|
export type LlmChannelId = string;
|
|
330
356
|
export type LlmReasoningParamStyle = 'openai-effort' | 'anthropic-enabled-budget' | 'anthropic-adaptive-effort' | 'anthropic-output-effort' | 'qwen-enable' | 'none';
|
|
331
357
|
export type LlmReasoningEffortMap = Readonly<Record<string, string | number>>;
|
|
@@ -349,7 +375,7 @@ export type LlmDiagnosticStageStatus = 'passed' | 'failed' | 'skipped' | 'pendin
|
|
|
349
375
|
* 面向用户的错误分类(诊断 / 聊天修复共用)。
|
|
350
376
|
* 技术错误码可进入 sanitizedDetail,不应直接作为主文案。
|
|
351
377
|
*/
|
|
352
|
-
export type LlmDiagnosticErrorCategory = 'credential_missing' | 'credential_invalid' | 'auth_expired' | 'endpoint_unreachable' | 'rate_limited' | 'quota_exhausted' | 'permission_denied' | 'model_not_found' | 'protocol_mismatch' | 'capability_mismatch' | 'local_runtime_stopped' | 'timeout' | 'unknown';
|
|
378
|
+
export type LlmDiagnosticErrorCategory = 'credential_missing' | 'credential_invalid' | 'auth_expired' | 'endpoint_unreachable' | 'gemini_rate_limited' | 'gemini_spend_or_quota_exhausted' | 'gemini_usage_limit_unknown' | 'rate_limited' | 'quota_exhausted' | 'permission_denied' | 'model_not_found' | 'protocol_mismatch' | 'capability_mismatch' | 'local_runtime_stopped' | 'timeout' | 'unknown';
|
|
353
379
|
export interface LlmDiagnosticStage {
|
|
354
380
|
readonly id: LlmDiagnosticStageId;
|
|
355
381
|
readonly status: LlmDiagnosticStageStatus;
|
|
@@ -423,14 +449,14 @@ export interface LlmChannelDescriptor {
|
|
|
423
449
|
/** 可选:将该 channel 映射到一个或多个服务模板(添加服务目录)。 */
|
|
424
450
|
readonly serviceTemplates?: readonly LlmServiceTemplateDescriptor[];
|
|
425
451
|
}
|
|
426
|
-
export type LlmAuthMethod = 'api_key' | 'oauth_chatgpt' | '
|
|
452
|
+
export type LlmAuthMethod = 'api_key' | 'oauth_chatgpt' | 'oauth_grok';
|
|
427
453
|
export type LlmOAuthConnectionStatus = 'connected' | 'expired' | 'disconnected';
|
|
428
454
|
export interface LlmOAuthStatus {
|
|
429
455
|
readonly status: LlmOAuthConnectionStatus;
|
|
430
456
|
readonly accountId?: string;
|
|
431
457
|
readonly expiresAt?: string;
|
|
432
458
|
}
|
|
433
|
-
export type { AccountUsageSource, AccountUsageScope, AccountUsageBalance, AccountUsageSpend, AccountUsageUnavailable, AccountUsageLocal } from './account-usage.js';
|
|
459
|
+
export type { AccountUsageSource, AccountUsageScope, AccountUsageBalance, AccountUsageSpend, AccountUsageUnavailable, AccountUsageLocal, } from './account-usage.js';
|
|
434
460
|
/** 订阅额度窗口(session / weekly / model 等)。 */
|
|
435
461
|
export interface LlmSubscriptionQuotaWindow {
|
|
436
462
|
readonly id: string;
|
|
@@ -446,10 +472,12 @@ export interface LlmSubscriptionQuotaWindow {
|
|
|
446
472
|
readonly scope?: import('./account-usage.js').AccountUsageScope;
|
|
447
473
|
}
|
|
448
474
|
/**
|
|
449
|
-
* GPT / Gemini / Grok / Qoder 订阅额度快照。
|
|
450
475
|
* success=false 时用 status/error 表达未登录、过期或拉取失败,UI 应降级展示。
|
|
451
476
|
*/
|
|
477
|
+
export * from "./spend-budget.js";
|
|
478
|
+
export { default as geminiStandardPricing } from "./gemini-standard-pricing.json";
|
|
452
479
|
export interface LlmSubscriptionQuota {
|
|
480
|
+
readonly localBudget?: import("./spend-budget.js").ChannelLocalBudgetSnapshot;
|
|
453
481
|
readonly accountUsageRevision?: string;
|
|
454
482
|
/** Remote query outcome; localUsage can remain available on failure. */
|
|
455
483
|
readonly success: boolean;
|
|
@@ -463,22 +491,16 @@ export interface LlmSubscriptionQuota {
|
|
|
463
491
|
readonly status?: string;
|
|
464
492
|
readonly providerId?: string;
|
|
465
493
|
readonly authMethod?: LlmAuthMethod;
|
|
466
|
-
readonly provider?: 'chatgpt' | '
|
|
494
|
+
readonly provider?: 'chatgpt' | 'grok';
|
|
467
495
|
readonly planLabel?: string;
|
|
468
496
|
readonly remainingPercent?: number;
|
|
469
497
|
readonly usedPercent?: number;
|
|
470
498
|
readonly resetsAt?: string;
|
|
471
499
|
readonly windows?: readonly LlmSubscriptionQuotaWindow[];
|
|
472
500
|
readonly accountId?: string;
|
|
473
|
-
readonly projectId?: string;
|
|
474
501
|
readonly fetchedAt?: string;
|
|
475
502
|
readonly cached?: boolean;
|
|
476
503
|
readonly error?: string;
|
|
477
|
-
readonly availableCredits?: number;
|
|
478
|
-
readonly planCreditsUsed?: number;
|
|
479
|
-
readonly planCreditsTotal?: number;
|
|
480
|
-
readonly orgPackageUsed?: number;
|
|
481
|
-
readonly orgPackageCap?: number;
|
|
482
504
|
}
|
|
483
505
|
export interface LlmProviderConfig {
|
|
484
506
|
readonly id: string;
|
|
@@ -493,7 +515,7 @@ export interface LlmProviderConfig {
|
|
|
493
515
|
readonly model: string;
|
|
494
516
|
readonly modelLabel?: string;
|
|
495
517
|
readonly metadataSource?: 'remote' | 'models.dev' | 'builtin' | 'local' | 'manual';
|
|
496
|
-
readonly pricingSource?: 'provider' | 'models.dev-reference';
|
|
518
|
+
readonly pricingSource?: 'manual' | 'provider' | 'models.dev-reference' | 'gemini-official-reference';
|
|
497
519
|
readonly metadataSyncedAt?: string;
|
|
498
520
|
readonly enabled: boolean;
|
|
499
521
|
readonly isDefault: boolean;
|
|
@@ -518,7 +540,6 @@ export interface LlmProviderConfig {
|
|
|
518
540
|
readonly reasoningEffortLevels?: readonly string[];
|
|
519
541
|
/** 渠道默认思考强度(如 Grok 为 high)。UI 切模型时用于落到正确默认档。 */
|
|
520
542
|
readonly reasoningDefaultEffort?: string;
|
|
521
|
-
readonly oauthProjectId?: string;
|
|
522
543
|
readonly customHeaders?: Readonly<Record<string, string>>;
|
|
523
544
|
readonly customHeadersInvalid?: boolean;
|
|
524
545
|
/**
|
|
@@ -536,6 +557,7 @@ export interface LlmProviderConfig {
|
|
|
536
557
|
readonly lastErrorCategory?: LlmDiagnosticErrorCategory;
|
|
537
558
|
}
|
|
538
559
|
export interface LlmProviderConfigView extends LlmProviderConfig {
|
|
560
|
+
readonly spendBudget?: import("./spend-budget.js").ChannelSpendBudgetConfig;
|
|
539
561
|
/** Ephemeral main-owned identity for account observations; contains no credential material. */
|
|
540
562
|
readonly accountUsageRevision?: string;
|
|
541
563
|
readonly apiKeyMasked: string;
|
|
@@ -575,6 +597,7 @@ export interface LlmModelConfig {
|
|
|
575
597
|
readonly customHeadersInvalid?: boolean;
|
|
576
598
|
}
|
|
577
599
|
export interface LlmProviderGroupConfig {
|
|
600
|
+
readonly spendBudget?: import("./spend-budget.js").ChannelSpendBudgetConfig;
|
|
578
601
|
readonly id: string;
|
|
579
602
|
readonly provider: LlmProviderType;
|
|
580
603
|
readonly channelId?: LlmChannelId;
|
|
@@ -582,7 +605,6 @@ export interface LlmProviderGroupConfig {
|
|
|
582
605
|
readonly name: string;
|
|
583
606
|
readonly baseUrl: string;
|
|
584
607
|
readonly createdAt: string;
|
|
585
|
-
readonly oauthProjectId?: string;
|
|
586
608
|
readonly models: readonly LlmModelConfig[];
|
|
587
609
|
}
|
|
588
610
|
export interface LlmProviderGroupConfigView extends LlmProviderGroupConfig {
|
|
@@ -623,7 +645,7 @@ export interface LlmModelInfo {
|
|
|
623
645
|
readonly supportsReasoning?: boolean;
|
|
624
646
|
readonly reasoningEffortValues?: readonly string[];
|
|
625
647
|
readonly metadataSource?: 'provider' | 'models.dev';
|
|
626
|
-
readonly pricingSource?: 'provider' | 'models.dev-reference';
|
|
648
|
+
readonly pricingSource?: 'manual' | 'provider' | 'models.dev-reference' | 'gemini-official-reference';
|
|
627
649
|
readonly inputPrice?: number;
|
|
628
650
|
readonly outputPrice?: number;
|
|
629
651
|
readonly cacheReadPrice?: number;
|
|
@@ -632,8 +654,6 @@ export interface LlmModelInfo {
|
|
|
632
654
|
readonly longContextInputPrice?: number;
|
|
633
655
|
readonly longContextCacheReadPrice?: number;
|
|
634
656
|
readonly longContextOutputPrice?: number;
|
|
635
|
-
readonly priceFactor?: number;
|
|
636
|
-
readonly originalPriceFactor?: number;
|
|
637
657
|
}
|
|
638
658
|
export interface LlmModelListResult {
|
|
639
659
|
readonly success: boolean;
|
|
@@ -644,7 +664,6 @@ export interface LlmModelListResult {
|
|
|
644
664
|
export interface LlmModelFetchRequest {
|
|
645
665
|
readonly channelId?: string;
|
|
646
666
|
readonly wireOverride?: string;
|
|
647
|
-
/** Qoder 私有接口等本机鉴权渠道需要显式传入,避免 fetch 路径被默认当成 api_key。 */
|
|
648
667
|
readonly authMethod?: LlmAuthMethod;
|
|
649
668
|
readonly baseUrl?: string;
|
|
650
669
|
readonly apiKey?: string;
|
|
@@ -691,6 +710,7 @@ export interface RuntimeToolCall {
|
|
|
691
710
|
readonly argumentsPreview?: unknown;
|
|
692
711
|
readonly [key: string]: unknown;
|
|
693
712
|
}
|
|
713
|
+
export type { UserAnchorResolution, UserAnchorCandidate, UserAnchorDiagnostic } from './user-anchor.ts';
|
|
694
714
|
export interface RuntimeToolResult {
|
|
695
715
|
readonly toolCallId?: string;
|
|
696
716
|
readonly status?: string;
|
|
@@ -718,6 +738,18 @@ export interface ClientToolCall extends RuntimeToolCall {
|
|
|
718
738
|
readonly dataLevel: DataLevel;
|
|
719
739
|
readonly requestedAt: string;
|
|
720
740
|
}
|
|
741
|
+
/** Host permission wait events. Requests are presentation, never permission truth. */
|
|
742
|
+
export interface ChatPermissionRequest {
|
|
743
|
+
readonly streamId: string;
|
|
744
|
+
readonly call: ClientToolCall;
|
|
745
|
+
readonly deadlineAt?: string;
|
|
746
|
+
}
|
|
747
|
+
export interface ChatPermissionSettled {
|
|
748
|
+
readonly streamId: string;
|
|
749
|
+
readonly toolCallIds: readonly string[];
|
|
750
|
+
readonly granted?: boolean;
|
|
751
|
+
readonly reason?: string;
|
|
752
|
+
}
|
|
721
753
|
export interface ClientToolCallPollRequest {
|
|
722
754
|
readonly sessionId: string;
|
|
723
755
|
readonly projectionId?: string;
|
|
@@ -732,12 +764,20 @@ export interface ClientToolCallPollResult {
|
|
|
732
764
|
readonly idleUntil?: string;
|
|
733
765
|
}
|
|
734
766
|
export type PermissionDuration = 'once' | 'task' | 'session' | 'scope' | 'persistent' | 'denied';
|
|
767
|
+
export interface LocalWritePermissionScope {
|
|
768
|
+
readonly kind: 'local_write';
|
|
769
|
+
readonly executionRoot: string;
|
|
770
|
+
readonly temporaryRoot: string;
|
|
771
|
+
readonly enforcement: 'provider_path_checks' | 'approval_required_no_os_sandbox';
|
|
772
|
+
}
|
|
735
773
|
export interface PermissionGrant {
|
|
774
|
+
/** Host-issued policy version; audit provenance, never a client authority token. */
|
|
775
|
+
readonly policyRevision?: string;
|
|
736
776
|
readonly grantId: string;
|
|
737
777
|
readonly toolCallId: string;
|
|
738
778
|
readonly granted: boolean;
|
|
739
779
|
readonly duration: PermissionDuration;
|
|
740
|
-
readonly scope?: string;
|
|
780
|
+
readonly scope?: string | import('./local-image.ts').LocalImagePermissionScope | import('./local-read.ts').LocalReadPermissionScope | LocalWritePermissionScope;
|
|
741
781
|
readonly decidedAt: string;
|
|
742
782
|
}
|
|
743
783
|
/** Application-owned shell process snapshot. Source conversation is provenance, not ownership. */
|
|
@@ -827,6 +867,23 @@ export interface Evidence {
|
|
|
827
867
|
readonly dataLevel: DataLevel;
|
|
828
868
|
readonly redactions: readonly string[];
|
|
829
869
|
readonly artifactRefs: readonly string[];
|
|
870
|
+
/** Host/Provider observation before tools/call; never read from server output. */
|
|
871
|
+
readonly dispatchOutcome?: 'not_dispatched';
|
|
872
|
+
/** Durable native recovery proof for an unstarted dispatch of a logical call. */
|
|
873
|
+
readonly retiredDispatchId?: string;
|
|
874
|
+
}
|
|
875
|
+
/** Native MCP attempt metadata, including denials and failed initialization. */
|
|
876
|
+
export interface NativeMcpToolEvidenceMetadata {
|
|
877
|
+
readonly evidenceKind: 'local_mcp_tool_call';
|
|
878
|
+
readonly serverId: string;
|
|
879
|
+
readonly providerId: string;
|
|
880
|
+
readonly transport: 'stdio' | 'streamable_http' | 'sse';
|
|
881
|
+
readonly toolName: string;
|
|
882
|
+
readonly projectionId: string;
|
|
883
|
+
readonly permissionGrantId: string;
|
|
884
|
+
readonly status: 'success' | 'denied' | 'failed' | 'cancelled';
|
|
885
|
+
readonly startedAt: string;
|
|
886
|
+
readonly endedAt: string;
|
|
830
887
|
}
|
|
831
888
|
export interface ClientToolResult {
|
|
832
889
|
readonly toolCallId: string;
|
|
@@ -865,8 +922,43 @@ export * from './appshot.ts';
|
|
|
865
922
|
export * from './automation.ts';
|
|
866
923
|
export * from './task-overview.ts';
|
|
867
924
|
export * from './skill-marketplace.ts';
|
|
925
|
+
export * from './prompt-skill.ts';
|
|
868
926
|
export * from './delegation.ts';
|
|
927
|
+
export * from './bot-git.ts';
|
|
869
928
|
export * from './model-routing.ts';
|
|
929
|
+
export * from './document-reference.ts';
|
|
870
930
|
export * from './project.ts';
|
|
871
931
|
export * from './objectives.ts';
|
|
872
932
|
export * from './remote-access-settings.ts';
|
|
933
|
+
export type { BotModelSelectionUpdateRequest, BotModelSelectionUpdateResult } from './bot-model-selection.ts';
|
|
934
|
+
export * from './local-image.ts';
|
|
935
|
+
export * from './local-read.ts';
|
|
936
|
+
export * from './native-process.ts';
|
|
937
|
+
export * from './bot-conversation-read.ts';
|
|
938
|
+
export * from './project-recovery.ts';
|
|
939
|
+
export * from './local-git.ts';
|
|
940
|
+
export * from './agent-supervision.ts';
|
|
941
|
+
export type { CapabilityBlocker, DelegationCapabilityAdmission } from './capability-admission.ts';
|
|
942
|
+
export * from './project-input-recovery.ts';
|
|
943
|
+
export { botResourceReferences } from './resource-reference-hints.ts';
|
|
944
|
+
export type { ResourceWindowCheckpointRequest, ResourceWindowCheckpointAck, ResourceWindowCloseBlocked, ResourceWindowReturnRequest, ResourceWindowReturnAck, ResourceWindowHistoryEntry, ResourceWindowHistoryResult, ResourceWindowReadRequest, ResourceWindowReadResult, ResourceWindowResource, ResourceWindowNavigation, ResourceWindowOpenRequest, ResourceWindowOwner, ResourceWindowIdentity, ResourceWindowContext, ResourceWindowStatus, ResourceWindowResult } from './resource-window.ts';
|
|
945
|
+
export { normalizeResourceWindowRequest, normalizeResourceWindowOwner, normalizeResourceWindowNavigation, resourceWindowWorkspaceId, resourceWindowTask, normalizeResourceLayout, normalizeResourceLayoutSnapshot, normalizeResourceInteractiveSession, normalizeResourceRecentReference, interactiveReferenceKey } from './resource-window.ts';
|
|
946
|
+
export type { ResourceLayoutSnapshot, ResourcePresentationApi, ResourceInteractiveTab, ResourceInteractiveSession, ResourceRecentReference } from './resource-window.ts';
|
|
947
|
+
export * from './browser-window.js';
|
|
948
|
+
export * from './resource-feedback.js';
|
|
949
|
+
export * from './resource-feedback-transport.js';
|
|
950
|
+
export * from './resource-edit.ts';
|
|
951
|
+
export * from './resource-file-replace.ts';
|
|
952
|
+
export * from './resource-edit-execution.ts';
|
|
953
|
+
export { decideFollowUp, type FollowUpOwner, type FollowUpReason, type FollowUpProjection } from './task-overview.ts';
|
|
954
|
+
export type { SessionExecutionIdentity, StopBarrierReceipt, SessionControlOperation, ExecutionResourceBlocker, ExecutionClaimClosure, ExecutionResourceClaim, ExecutionResourceScope, UnknownOutcomePolicy, UnknownOutcomePolicyTier, UnknownOutcomeResolution, UnknownOutcomeResolutionTier, ReconciliationEvidence, ReconciliationProbe, ReconciliationProbeKind, ReconciliationVerdict } from './session-control.ts';
|
|
955
|
+
export { controlPhasesForOrigin, normalizeSessionExecutionIdentity, normalizeExecutionResourceScope } from './session-control.ts';
|
|
956
|
+
export * from './input-prediction.ts';
|
|
957
|
+
export * from './interactive-result.ts';
|
|
958
|
+
export * from './interactive-verification.ts';
|
|
959
|
+
export { normalizeConversationExecution, conversationExecutionPermitsNewRun, validConversationSpend } from './conversation-execution.ts';
|
|
960
|
+
export type { ConversationExecutionIdentity, ConversationExecution } from './conversation-execution.ts';
|
|
961
|
+
export * from './quiet-reply.js';
|
|
962
|
+
export type { WorkingPlanStepStatus, WorkingPlanStepView, WorkingPlanView } from './working-plan.ts';
|
|
963
|
+
export * from "./parent-coordination.js";
|
|
964
|
+
export * from "./project-matter.ts";
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
|
+
export { isGlobalBotProfile } from "./project.js";
|
|
2
|
+
export { BOT_CONTEXT_BOUNDARY_KIND } from "./project.js";
|
|
3
|
+
export { WORK_HOOK_SEMANTIC_FLOOR, nativeWorkHasHookFacts } from "./work-hook.js";
|
|
4
|
+
export { deriveSessionFacts } from "./session-facts.js";
|
|
5
|
+
export { runtimeSessionFacts, runtimeSessionOwnership, hasPendingRuntimeSessions } from "./runtime-session-facts.js";
|
|
6
|
+
export { projectAgentFailureKind, classifyProjectAgentFailure } from "./project-agent-failure.js";
|
|
7
|
+
export { toolActivityPreview, toolActivitySummary } from "./tool-activity-preview.js";
|
|
8
|
+
export { isModelReasoningEffort, modelReasoningLevels, modelDefaultReasoningEffort } from "./model-reasoning.js";
|
|
1
9
|
export { buildModelMenuGroups, modelMenuChannelName } from "./model-menu.js";
|
|
2
10
|
export { evaluateUiDelivery } from "./ui-delivery-verification.js";
|
|
3
11
|
export { DESKTOP_PREVIEW_PROTOCOL, DESKTOP_PREVIEW_CAPABILITY, DESKTOP_PREVIEW_TOOL } from "./desktop-preview.js";
|
|
4
12
|
export { REMOTE_PROTOCOL_VERSION, parseRemoteReadRequest, admitRemoteRead } from "./remote-access.js";
|
|
5
13
|
export { REMOTE_PROJECT_LIMITS, parseRemoteProjectRequest, admitRemoteProject, parseRemoteDelegationProjection } from "./remote-access.js";
|
|
14
|
+
/**
|
|
15
|
+
* success=false 时用 status/error 表达未登录、过期或拉取失败,UI 应降级展示。
|
|
16
|
+
*/
|
|
17
|
+
export * from "./spend-budget.js";
|
|
18
|
+
export { default as geminiStandardPricing } from "./gemini-standard-pricing.json" with { type: "json" };
|
|
6
19
|
export function resolveLlmModelOptionValues(definitions, values) {
|
|
7
20
|
if (!definitions?.length)
|
|
8
21
|
return {};
|
|
@@ -32,8 +45,36 @@ export * from "./appshot.js";
|
|
|
32
45
|
export * from "./automation.js";
|
|
33
46
|
export * from "./task-overview.js";
|
|
34
47
|
export * from "./skill-marketplace.js";
|
|
48
|
+
export * from "./prompt-skill.js";
|
|
35
49
|
export * from "./delegation.js";
|
|
50
|
+
export * from "./bot-git.js";
|
|
36
51
|
export * from "./model-routing.js";
|
|
52
|
+
export * from "./document-reference.js";
|
|
37
53
|
export * from "./project.js";
|
|
38
54
|
export * from "./objectives.js";
|
|
39
55
|
export * from "./remote-access-settings.js";
|
|
56
|
+
export * from "./local-image.js";
|
|
57
|
+
export * from "./local-read.js";
|
|
58
|
+
export * from "./native-process.js";
|
|
59
|
+
export * from "./bot-conversation-read.js";
|
|
60
|
+
export * from "./project-recovery.js";
|
|
61
|
+
export * from "./local-git.js";
|
|
62
|
+
export * from "./agent-supervision.js";
|
|
63
|
+
export * from "./project-input-recovery.js";
|
|
64
|
+
export { botResourceReferences } from "./resource-reference-hints.js";
|
|
65
|
+
export { normalizeResourceWindowRequest, normalizeResourceWindowOwner, normalizeResourceWindowNavigation, resourceWindowWorkspaceId, resourceWindowTask, normalizeResourceLayout, normalizeResourceLayoutSnapshot, normalizeResourceInteractiveSession, normalizeResourceRecentReference, interactiveReferenceKey } from "./resource-window.js";
|
|
66
|
+
export * from './browser-window.js';
|
|
67
|
+
export * from './resource-feedback.js';
|
|
68
|
+
export * from './resource-feedback-transport.js';
|
|
69
|
+
export * from "./resource-edit.js";
|
|
70
|
+
export * from "./resource-file-replace.js";
|
|
71
|
+
export * from "./resource-edit-execution.js";
|
|
72
|
+
export { decideFollowUp } from "./task-overview.js";
|
|
73
|
+
export { controlPhasesForOrigin, normalizeSessionExecutionIdentity, normalizeExecutionResourceScope } from "./session-control.js";
|
|
74
|
+
export * from "./input-prediction.js";
|
|
75
|
+
export * from "./interactive-result.js";
|
|
76
|
+
export * from "./interactive-verification.js";
|
|
77
|
+
export { normalizeConversationExecution, conversationExecutionPermitsNewRun, validConversationSpend } from "./conversation-execution.js";
|
|
78
|
+
export * from './quiet-reply.js';
|
|
79
|
+
export * from "./parent-coordination.js";
|
|
80
|
+
export * from "./project-matter.js";
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/** Suggestions are ephemeral presentation data, never input receipts or grants. */
|
|
2
|
+
export type InputPredictionMode = 'next_turn' | 'continuation';
|
|
3
|
+
export type InputPredictionSurface = 'desktop_bot' | 'desktop_classic';
|
|
4
|
+
export interface InputPredictionSettings {
|
|
5
|
+
readonly schemaVersion: 1;
|
|
6
|
+
readonly enabled: boolean;
|
|
7
|
+
readonly continuationEnabled: boolean;
|
|
8
|
+
readonly disabledWorkspaceIds: readonly string[];
|
|
9
|
+
readonly dailyRequestLimit: number;
|
|
10
|
+
readonly dailyTokenLimit: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const INPUT_PREDICTION_LIMITS: Readonly<{
|
|
13
|
+
inputTokens: 4096;
|
|
14
|
+
outputTokens: 256;
|
|
15
|
+
draftLength: 2048;
|
|
16
|
+
candidateLength: 240;
|
|
17
|
+
candidateGraphemes: 120;
|
|
18
|
+
timeoutMs: 6000;
|
|
19
|
+
validationMs: 150;
|
|
20
|
+
ttlMs: 60000;
|
|
21
|
+
requestIntervalMs: 3000;
|
|
22
|
+
requestsPerMinute: 12;
|
|
23
|
+
}>;
|
|
24
|
+
export declare function normalizeInputPredictionSettings(value: unknown): InputPredictionSettings;
|
|
25
|
+
export interface InputPredictionRequest {
|
|
26
|
+
readonly requestId: string;
|
|
27
|
+
readonly workspaceId: string;
|
|
28
|
+
readonly conversationId: string;
|
|
29
|
+
readonly composerInstanceId: string;
|
|
30
|
+
readonly surface: InputPredictionSurface;
|
|
31
|
+
readonly mode: InputPredictionMode;
|
|
32
|
+
readonly draftVersion: number;
|
|
33
|
+
readonly draftText: string;
|
|
34
|
+
readonly selectionStart: number;
|
|
35
|
+
readonly selectionEnd: number;
|
|
36
|
+
readonly quoteMessageId?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface InputCandidate {
|
|
39
|
+
readonly candidateId: string;
|
|
40
|
+
readonly requestId: string;
|
|
41
|
+
readonly workspaceId: string;
|
|
42
|
+
readonly conversationId: string;
|
|
43
|
+
readonly composerInstanceId: string;
|
|
44
|
+
readonly mode: InputPredictionMode;
|
|
45
|
+
readonly insertionText: string;
|
|
46
|
+
readonly draftVersion: number;
|
|
47
|
+
/** Host context identity only. This conveys no permission. */
|
|
48
|
+
readonly contextToken: string;
|
|
49
|
+
readonly expiresAt: string;
|
|
50
|
+
}
|
|
51
|
+
export type InputPredictionResult = {
|
|
52
|
+
readonly kind: 'candidate';
|
|
53
|
+
readonly candidate: InputCandidate;
|
|
54
|
+
} | {
|
|
55
|
+
readonly kind: 'none';
|
|
56
|
+
readonly reason: string;
|
|
57
|
+
} | {
|
|
58
|
+
readonly kind: 'unavailable';
|
|
59
|
+
readonly reason: string;
|
|
60
|
+
} | {
|
|
61
|
+
readonly kind: 'cancelled';
|
|
62
|
+
} | {
|
|
63
|
+
readonly kind: 'error';
|
|
64
|
+
readonly code: string;
|
|
65
|
+
};
|
|
66
|
+
export interface InputPredictionReference {
|
|
67
|
+
readonly composerInstanceId: string;
|
|
68
|
+
readonly requestId: string;
|
|
69
|
+
readonly candidateId?: string;
|
|
70
|
+
}
|
|
71
|
+
export type InputPredictionValidation = {
|
|
72
|
+
readonly kind: 'valid' | 'stale' | 'expired' | 'unavailable';
|
|
73
|
+
};
|
|
74
|
+
export interface InputPredictionPort {
|
|
75
|
+
request(request: InputPredictionRequest): Promise<InputPredictionResult>;
|
|
76
|
+
cancel(reference: InputPredictionReference): Promise<unknown>;
|
|
77
|
+
validate(reference: InputPredictionReference): Promise<InputPredictionValidation>;
|
|
78
|
+
}
|
|
79
|
+
export interface InputPredictionStatus {
|
|
80
|
+
readonly reason: 'ready' | 'disabled' | 'model_unconfigured' | 'budget' | 'usage_unavailable' | 'provider_error';
|
|
81
|
+
readonly requests: number;
|
|
82
|
+
readonly tokens: number;
|
|
83
|
+
readonly estimated: boolean;
|
|
84
|
+
}
|
|
85
|
+
export declare function isInputPredictionRequest(value: unknown): value is InputPredictionRequest;
|
|
86
|
+
export declare function isInputPredictionReference(value: unknown): value is InputPredictionReference;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export const INPUT_PREDICTION_LIMITS = Object.freeze({
|
|
2
|
+
inputTokens: 4096, outputTokens: 256, draftLength: 2048,
|
|
3
|
+
candidateLength: 240, candidateGraphemes: 120,
|
|
4
|
+
timeoutMs: 6000, validationMs: 150, ttlMs: 60_000,
|
|
5
|
+
requestIntervalMs: 3000, requestsPerMinute: 12,
|
|
6
|
+
});
|
|
7
|
+
export function normalizeInputPredictionSettings(value) {
|
|
8
|
+
const raw = value && typeof value === 'object' && !Array.isArray(value) ? value : {};
|
|
9
|
+
const supported = (value == null || value === raw)
|
|
10
|
+
&& (raw.schemaVersion === undefined || raw.schemaVersion === 1);
|
|
11
|
+
const input = supported ? raw : {};
|
|
12
|
+
const enabled = supported && (input.enabled === undefined || input.enabled === true);
|
|
13
|
+
const limit = (value, fallback) => typeof value === 'number'
|
|
14
|
+
&& Number.isSafeInteger(value) && value >= 0 ? value : fallback;
|
|
15
|
+
return {
|
|
16
|
+
schemaVersion: 1,
|
|
17
|
+
enabled,
|
|
18
|
+
// Preserve an existing explicit refusal until the user enables or selects a model again.
|
|
19
|
+
continuationEnabled: enabled && (input.continuationEnabled === undefined || input.continuationEnabled === true),
|
|
20
|
+
disabledWorkspaceIds: Array.isArray(input.disabledWorkspaceIds)
|
|
21
|
+
? [...new Set(input.disabledWorkspaceIds.filter((id) => typeof id === 'string' && id.length > 0 && id.length <= 200))] : [],
|
|
22
|
+
dailyRequestLimit: limit(input.dailyRequestLimit, 100),
|
|
23
|
+
dailyTokenLimit: limit(input.dailyTokenLimit, 100_000),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export function isInputPredictionRequest(value) {
|
|
27
|
+
if (!value || typeof value !== 'object')
|
|
28
|
+
return false;
|
|
29
|
+
const row = value;
|
|
30
|
+
const id = (key) => typeof row[key] === 'string' && row[key].length > 0 && row[key].length <= 200;
|
|
31
|
+
return ['requestId', 'workspaceId', 'conversationId', 'composerInstanceId'].every(id)
|
|
32
|
+
&& ['desktop_bot', 'desktop_classic'].includes(String(row.surface))
|
|
33
|
+
&& ['next_turn', 'continuation'].includes(String(row.mode))
|
|
34
|
+
&& Number.isSafeInteger(row.draftVersion) && Number(row.draftVersion) >= 0
|
|
35
|
+
&& typeof row.draftText === 'string' && row.draftText.length <= INPUT_PREDICTION_LIMITS.draftLength
|
|
36
|
+
&& Number.isSafeInteger(row.selectionStart) && Number.isSafeInteger(row.selectionEnd)
|
|
37
|
+
&& Number(row.selectionStart) >= 0 && Number(row.selectionStart) === Number(row.selectionEnd)
|
|
38
|
+
&& Number(row.selectionEnd) === row.draftText.length
|
|
39
|
+
&& (row.mode === 'next_turn' ? row.draftText === '' : row.draftText.length > 0)
|
|
40
|
+
&& (row.quoteMessageId === undefined || id('quoteMessageId'));
|
|
41
|
+
}
|
|
42
|
+
export function isInputPredictionReference(value) {
|
|
43
|
+
if (!value || typeof value !== 'object')
|
|
44
|
+
return false;
|
|
45
|
+
const row = value;
|
|
46
|
+
return ['composerInstanceId', 'requestId'].every(key => typeof row[key] === 'string' && row[key].length > 0 && row[key].length <= 200)
|
|
47
|
+
&& (row.candidateId === undefined || typeof row.candidateId === 'string' && row.candidateId.length > 0 && row.candidateId.length <= 200);
|
|
48
|
+
}
|