@webskill/sdk 0.6.0 → 0.8.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/dist/agent.d.ts +2 -2
- package/dist/agent.js +218 -28
- package/dist/browser.d.ts +177 -4
- package/dist/browser.js +444 -35
- package/dist/{catalogComponents-Dr5dFMAb-Dacibl1e.js → catalogComponents-DfxxfUvn-D55Gbb2l.js} +4016 -1226
- package/dist/{dist-8oQRa8Xz.js → dist-59XlqDuv.js} +93 -6
- package/dist/{dist-DnYG2-eY.js → dist-CJqQsIm9.js} +498 -118
- package/dist/{dist-DusANsrn.js → dist-DmI5SBBF.js} +437 -55
- package/dist/eventTypes-g1BXL6x5-CibcOftR.js +37 -0
- package/dist/governance.d.ts +91 -11
- package/dist/governance.js +194 -52
- package/dist/{index-C-KFAZoF.d.ts → index-K-eewlGL.d.ts} +176 -75
- package/dist/{index-BMocOEi0.d.ts → index-P9J2LTfU.d.ts} +163 -6
- package/dist/{index-BuTpBMzr.d.ts → index-fLskQfAS.d.ts} +156 -5
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -4
- package/dist/mcp.d.ts +129 -6
- package/dist/mcp.js +235 -28
- package/dist/{memoryArtifactStore-52Zn9npI-BMPYwvoy.js → memoryArtifactStore-52Zn9npI-upv5OWYf.js} +1 -1
- package/dist/node.d.ts +3 -3
- package/dist/node.js +4 -3
- package/dist/{openUiLibrary-Bdrji9qK-DzAxRlTY.js → openUiLibrary-DURlAxjk-CU6AzfSW.js} +3 -3
- package/dist/{skillVersionStore-BzLbzFOL-CxdAFWO2.d.ts → skillVersionStore-Bl-ElD45-gRfSaAby.d.ts} +8 -2
- package/dist/{testing-CYTFqkDm.js → testing-BCUO5gZR.js} +2 -2
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +2 -2
- package/dist/{types-4pg-qp_I-Gq63X8Oa.d.ts → types-B3n0cMZu-BdcqQ35O.d.ts} +74 -7
- package/dist/ui-react.d.ts +16 -7
- package/dist/ui-react.js +159 -108
- package/dist/ui-vue.d.ts +1 -1
- package/dist/ui-vue.js +2 -2
- package/dist/ui.d.ts +4 -4
- package/dist/ui.js +3 -3
- package/dist/{webskillLitCatalog-_mugzRHx-B_54vxum.js → webskillLitCatalog-DwTwSBFt-DiXXpNZA.js} +22 -3
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as InteractionOrigin,
|
|
2
|
-
import {
|
|
1
|
+
import { a as InteractionOrigin, c as InteractionResponse, s as InteractionRequest, x as UiBridge } from "./types-B3n0cMZu-BdcqQ35O.js";
|
|
2
|
+
import { k as ExternalToolSource } from "./index-K-eewlGL.js";
|
|
3
3
|
//#region ../agent/dist/index.d.ts
|
|
4
4
|
//#region src/todo/types.d.ts
|
|
5
5
|
/** 待办条目状态:未开始 / 进行中 / 已完成(FR-3.1) */
|
|
@@ -319,6 +319,12 @@ interface PerceivedNode {
|
|
|
319
319
|
imageId?: string;
|
|
320
320
|
/** 取像失败的降级说明(英文);不得静默丢弃(FR-12.1) */
|
|
321
321
|
imageNote?: string;
|
|
322
|
+
/**
|
|
323
|
+
* 不透明元素句柄(S10)。**仅当该节点可被操作时出现**:
|
|
324
|
+
* 它落在宿主声明的操作范围内、且是可交互角色。
|
|
325
|
+
* 由 reader 生成,只在产生它的那次感知内有效;模型不得构造或推断。
|
|
326
|
+
*/
|
|
327
|
+
ref?: string;
|
|
322
328
|
children?: readonly PerceivedNode[];
|
|
323
329
|
}
|
|
324
330
|
/** 随感知一起下发的一张图像(FR-12.1) @experimental */
|
|
@@ -384,17 +390,23 @@ interface PerceptionRecord {
|
|
|
384
390
|
imageFailures?: number;
|
|
385
391
|
}
|
|
386
392
|
/**
|
|
387
|
-
*
|
|
393
|
+
* 页面侧留痕的统一出口(感知与操作共用)。
|
|
394
|
+
* 刻意只声明 `append` 的结构化子集,`FsAuditLog` 直接满足——
|
|
388
395
|
* agent 包不能依赖 governance,但审计不能因此变成「记在内存里」。
|
|
389
396
|
* @experimental
|
|
390
397
|
*/
|
|
391
|
-
interface
|
|
398
|
+
interface PageAuditSink {
|
|
392
399
|
append(event: {
|
|
393
400
|
type: string;
|
|
394
401
|
target: string;
|
|
395
402
|
data?: Record<string, unknown>;
|
|
396
403
|
}): Promise<unknown>;
|
|
397
404
|
}
|
|
405
|
+
/**
|
|
406
|
+
* @deprecated 改用 `PageAuditSink`。保留以兼容 0.5.0 的注入代码。
|
|
407
|
+
* @experimental
|
|
408
|
+
*/
|
|
409
|
+
type PerceptionAuditSink = PageAuditSink;
|
|
398
410
|
//#endregion
|
|
399
411
|
//#region src/perception/policy.d.ts
|
|
400
412
|
interface PagePerceptionPolicyOptions {
|
|
@@ -471,4 +483,143 @@ declare function createPagePerceptionToolSource(options: PagePerceptionToolSourc
|
|
|
471
483
|
*/
|
|
472
484
|
declare const PERCEPTION_SYSTEM_PROMPT: string;
|
|
473
485
|
//#endregion
|
|
474
|
-
|
|
486
|
+
//#region src/pageAction/types.d.ts
|
|
487
|
+
/**
|
|
488
|
+
* 页面操作的策略层类型(需求 23)。
|
|
489
|
+
*
|
|
490
|
+
* 与感知层同一条规矩:这一层不含任何 DOM 概念——执行落在 `@webskill/browser`,
|
|
491
|
+
* 本包只定义「什么允许被操作」以及一次操作长什么样。
|
|
492
|
+
*/
|
|
493
|
+
/**
|
|
494
|
+
* 可操作范围白名单(FR-23.1,硬约束)。
|
|
495
|
+
*
|
|
496
|
+
* **没有默认值,空 `include` 就是任何操作都不可执行。**
|
|
497
|
+
* 与 `PerceptionScope` 同构但**独立声明**:写成类型别名会让「感知与操作共用一份配置」
|
|
498
|
+
* 在类型层面合法,而 FR-23.1 写死了那是不可接受的——可读不等于可操作。
|
|
499
|
+
* @experimental
|
|
500
|
+
*/
|
|
501
|
+
interface PageActionScope {
|
|
502
|
+
/** 可操作的根节点选择器;未声明即不可操作 */
|
|
503
|
+
include: readonly string[];
|
|
504
|
+
/** 从 include 子树中剪除的危险控件(支付、删除、权限变更等) */
|
|
505
|
+
exclude?: readonly string[];
|
|
506
|
+
}
|
|
507
|
+
/** 本版的最小操作集(FR-23.4)。导航、拖拽、滚动均不在内。 @experimental */
|
|
508
|
+
type PageActionKind = 'click' | 'fill' | 'submit';
|
|
509
|
+
/** @experimental */
|
|
510
|
+
interface PageActionRequest {
|
|
511
|
+
/** 感知产出的不透明句柄;不接受选择器(FR-23.4) */
|
|
512
|
+
ref: string;
|
|
513
|
+
action: PageActionKind;
|
|
514
|
+
/** `action === 'fill'` 时必填 */
|
|
515
|
+
value?: string;
|
|
516
|
+
}
|
|
517
|
+
/** @experimental */
|
|
518
|
+
interface PageActionOutcome {
|
|
519
|
+
ok: boolean;
|
|
520
|
+
/**
|
|
521
|
+
* 实际操作到的元素的角色与可访问名称。
|
|
522
|
+
* 由**执行器**回填而不是调用方从感知结果里查:执行的那一刻元素可能已经变了,
|
|
523
|
+
* 留痕必须记实际操作到的东西(FR-23.3)。
|
|
524
|
+
*/
|
|
525
|
+
target: {
|
|
526
|
+
role: string;
|
|
527
|
+
name?: string;
|
|
528
|
+
};
|
|
529
|
+
/** 目标是密码类控件:确认卡与留痕据此隐去值(FR-23.3) */
|
|
530
|
+
secret?: boolean;
|
|
531
|
+
/** 失败原因(英文) */
|
|
532
|
+
reason?: string;
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* 页面操作执行器。与 `PagePerceptionReader` 对称,同样不含 DOM 概念。
|
|
536
|
+
* 实现方负责校验句柄有效性、元素可交互性,以及目标是否仍在操作范围内。
|
|
537
|
+
* @experimental
|
|
538
|
+
*/
|
|
539
|
+
interface PageActionExecutor {
|
|
540
|
+
execute(request: PageActionRequest): Promise<PageActionOutcome> | PageActionOutcome;
|
|
541
|
+
/** 目标的角色与可访问名称,供确认卡在**执行前**说清将要做什么(FR-23.2) */
|
|
542
|
+
describe(ref: string): {
|
|
543
|
+
role: string;
|
|
544
|
+
name?: string;
|
|
545
|
+
secret?: boolean;
|
|
546
|
+
} | undefined;
|
|
547
|
+
}
|
|
548
|
+
/** 一次页面操作的留痕(FR-23.3 的五项字段) @experimental */
|
|
549
|
+
interface PageActionRecord {
|
|
550
|
+
/** ISO 8601 */
|
|
551
|
+
at: string;
|
|
552
|
+
action: PageActionKind;
|
|
553
|
+
role: string;
|
|
554
|
+
name?: string;
|
|
555
|
+
/** 是否经用户确认;宿主预授权的操作记 `'preauthorized'` */
|
|
556
|
+
approved: boolean | 'preauthorized';
|
|
557
|
+
ok: boolean;
|
|
558
|
+
/** 非密码类控件填入的值;密码类控件**整个字段不存在** */
|
|
559
|
+
value?: string;
|
|
560
|
+
reason?: string;
|
|
561
|
+
}
|
|
562
|
+
//#endregion
|
|
563
|
+
//#region src/pageAction/policy.d.ts
|
|
564
|
+
/** 授权卡的最小出口;`UiBridge` 直接满足(与技能生成用的是同一个端口) */
|
|
565
|
+
interface PageActionUi {
|
|
566
|
+
request(input: InteractionRequest): Promise<InteractionResponse>;
|
|
567
|
+
}
|
|
568
|
+
interface PageActionPolicyOptions {
|
|
569
|
+
/** 宿主声明的可操作范围;`include` 为空即整个能力不可用 */
|
|
570
|
+
scope: PageActionScope;
|
|
571
|
+
executor: PageActionExecutor;
|
|
572
|
+
ui: PageActionUi;
|
|
573
|
+
/** FR-23.3:每次操作写审计。不注入即不留痕,装配方要自己承担这个选择 */
|
|
574
|
+
audit?: PageAuditSink;
|
|
575
|
+
/** 审计事件的 target(缺省 `page`) */
|
|
576
|
+
auditTarget?: string;
|
|
577
|
+
/**
|
|
578
|
+
* 免确认的操作类型。**缺省即每一次操作都要确认**(AC-23.4)。
|
|
579
|
+
* 只有宿主显式配置才生效,SDK 不提供任何缺省放行项。
|
|
580
|
+
*/
|
|
581
|
+
preauthorized?: readonly PageActionKind[];
|
|
582
|
+
now?(): string;
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* 页面操作策略(需求 23)。
|
|
586
|
+
*
|
|
587
|
+
* 三道闸门依次是:宿主有没有声明范围、用户认不认、执行器认不认。
|
|
588
|
+
* 模型能表达的只有「在哪个句柄上做哪个动作」——它没有任何影响范围的入口(AC-23.2)。
|
|
589
|
+
* @experimental
|
|
590
|
+
*/
|
|
591
|
+
declare class PageActionPolicy {
|
|
592
|
+
#private;
|
|
593
|
+
constructor(options: PageActionPolicyOptions);
|
|
594
|
+
/** 白名单为空即不可用(FR-23.1):宿主没声明范围就没有这个能力 */
|
|
595
|
+
get enabled(): boolean;
|
|
596
|
+
get scope(): PageActionScope;
|
|
597
|
+
/** 最近的操作记录(只读展示用),新的在前 */
|
|
598
|
+
get records(): readonly PageActionRecord[];
|
|
599
|
+
act(request: PageActionRequest): Promise<PageActionOutcome>;
|
|
600
|
+
}
|
|
601
|
+
//#endregion
|
|
602
|
+
//#region src/pageAction/toolSource.d.ts
|
|
603
|
+
declare const PAGE_ACTION_TOOL = "act_on_page";
|
|
604
|
+
interface PageActionToolSourceOptions {
|
|
605
|
+
policy: PageActionPolicy;
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* 把页面操作接到既有工具协议上。
|
|
609
|
+
*
|
|
610
|
+
* 策略未注入或宿主没声明可操作区域时 `listToolSpecs()` 返回空数组——
|
|
611
|
+
* 模型连这个工具的存在都看不到,而不是看得到再被拒(FR-23.5 / AC-23.8)。
|
|
612
|
+
* @experimental
|
|
613
|
+
*/
|
|
614
|
+
declare function createPageActionToolSource(options: PageActionToolSourceOptions): ExternalToolSource;
|
|
615
|
+
//#endregion
|
|
616
|
+
//#region src/prompts/pageAction.d.ts
|
|
617
|
+
/**
|
|
618
|
+
* 页面操作的系统提示词(需求 23)。
|
|
619
|
+
*
|
|
620
|
+
* 措辞刻意保守:提示词里的鼓励性表述会直接抬高模型尝试操作的频率,
|
|
621
|
+
* 而每一次尝试都要打断用户去点确认。
|
|
622
|
+
*/
|
|
623
|
+
declare const PAGE_ACTION_SYSTEM_PROMPT: string;
|
|
624
|
+
//#endregion
|
|
625
|
+
export { TodoListener as $, PagePerceptionReader as A, SKILL_GENERATION_SYSTEM_PROMPT as B, PageActionRequest as C, PageAuditSink as D, PageActionUi as E, PerceptionAuditSink as F, SkillGenerator as G, SkillGenerationOutcome as H, PerceptionCaptureOptions as I, SubAgentRunner as J, SkillGeneratorOptions as K, PerceptionRecord as L, ParentBudget as M, PerceivedImage as N, PagePerceptionPolicy as O, PerceivedNode as P, TodoList as Q, PerceptionResult as R, PageActionRecord as S, PageActionToolSourceOptions as T, SkillGenerationPolicy as U, SkillCandidateSink as V, SkillGenerationToolSourceOptions as W, TodoEvent as X, TODO_SYSTEM_PROMPT as Y, TodoItem as Z, PageActionExecutor as _, DelegationOrchestratorOptions as a, createPagePerceptionToolSource as at, PageActionPolicy as b, DelegationToolSourceOptions as c, withDelegationOrigin as ct, ImageCaptureBudget as d, TodoStatus as et, MANAGE_TODO_TOOL as f, PERCEPTION_SYSTEM_PROMPT as g, PERCEIVE_PAGE_TOOL as h, DelegationOrchestrator as i, createPageActionToolSource as it, PagePerceptionToolSourceOptions as j, PagePerceptionPolicyOptions as k, GENERATE_SKILL_TOOL as l, PAGE_ACTION_TOOL as m, DELEGATION_SYSTEM_PROMPT as n, TodoToolSourceOptions as nt, DelegationRequest as o, createSkillGenerationToolSource as ot, PAGE_ACTION_SYSTEM_PROMPT as p, SubAgentRunInput as q, DelegationBudget as r, createDelegationToolSource as rt, DelegationResult as s, createTodoToolSource as st, DELEGATE_TASK_TOOL as t, TodoStore as tt, GeneratedSkillDraft as u, PageActionKind as v, PageActionScope as w, PageActionPolicyOptions as x, PageActionOutcome as y, PerceptionScope as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { $ as
|
|
3
|
-
export { ALLOWED_TOOLS_EXCLUSION_REASON, ASK_USER_INPUT_SCHEMA, ASK_USER_TOOL, ASK_USER_TOOL_NAME, type ActivateLifecycleData, AgentLoop, type AgentLoopConfig, type AgentLoopDeps, AnthropicClient, type AnthropicClientConfig, type ApprovalDecision, type ApprovalScope, type ArchiveLimits, type Artifact, type ArtifactStore, BEHAVIOR_RECORDS_KEY, type BehaviorRecord, type BehaviorRecordKind, type BehaviorScene, type BridgeCapabilities, type BridgeCapability, type BridgeRequest, type BridgeResponse, CapabilityApproval, type CapabilityMode, type CatalogRenderer, type ChartSpec, type CryptoKeyLike, DEFAULT_ARCHIVE_LIMITS, DEFAULT_USER_PROFILE_LIMITS, type DiscoveryResult, EMPTY_USER_PROFILE, EventBus, type ExecuteLifecycleData, type ExternalSkillProvider, type ExternalToolSource, FS_SESSION_PAGE_SIZE, type FileStat, type FileSystemProvider, type FormField, FsArtifactStore, FsMemoryStore, FsRunSnapshotStore, FsRunTraceStore, FsSessionStore, FsTrustedKeyStore, FullDisclosureRouter, GoogleGenAiClient, type GoogleGenAiClientConfig, HookRunner, type HookRunnerOptions, type InstalledSkillManifest, type IntegrityVerdict, type InteractLifecycleData, type InteractionOrigin, type InteractionPolicy, type InteractionRequest, type InteractionResponse, type JsonSchema, type LifecycleEvent, type LifecycleEventInit, type LifecycleHook, type LifecycleHookContext, type LifecycleListener, type LlmClient, type LlmCompleteInput, type LlmContentPart, type LlmMessage, type LlmResponse, type LlmStreamEvent, type LlmToolCall, type LlmToolSpec, MANIFEST_EXCLUDED_FILES, MemoryFS, type MemoryStore, type NetworkPolicy, OpenAiCompatibleClient, type OpenAiCompatibleClientConfig, type Page, type PageQuery, ProgressiveRouter, READ_SKILL_FILE_INPUT_SCHEMA, READ_SKILL_FILE_TOOL, READ_SKILL_FILE_TOOL_NAME, RUN_SNAPSHOT_SCHEMA_VERSION, RUN_TRACE_SCHEMA_VERSION, type RefineUserProfileInput, type RemoteUrlPolicy, type RenderBlock, type RenderResultRequest, type RouteLifecycleData, type RouteResult, type RunResult, type RunSnapshot, type RunSnapshotListEntry, type RunSnapshotStore, type RunTerminationReason, type RunToolCall, type RunTraceFile, type RunTraceFilter, type RunTraceMetrics, type RunTraceStore, type RunTraceSummary, type RuntimePhase, type RuntimeRun, type RuntimeSession, type RuntimeSessionHandle, SESSION_SCHEMA_VERSION, SIGNATURE_SCHEMA_VERSION, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, SKILL_NAME_MAX_LENGTH, SKILL_NAME_PATTERN, SKILL_PACK_FILE, SKILL_SIGNATURE_FILE, type SchemaInferer, type ScriptExecutionContext, type ScriptExecutor, SerializingMemoryStore, type SessionListPage, type SessionMeta, type SessionRecord, type SessionStore, type SignatureAuditSink, type SignatureVerdict, type SkillCatalog, type SkillCatalogEntry, SkillDiscovery, type SkillDocument, type SkillFailureReport, type SkillInstallSource, type SkillIntegrityGuard, type SkillIssue, type SkillLocation, type SkillManagerPort, type SkillManifest, type SkillMetadata, type SkillOutcomeReporter, type SkillPackManifest, SkillReader, type SkillRouter, type SkillScriptDescriptor, type SkillScriptSchemaSource, type SkillSignature, type SkillSource, type SkillStateGuard, type SkillsLockfile, type TerminalLifecycleData, type TextualToolContent, type TodoTraceEvent, type ToolContent, type ToolDefinition, type ToolResolution, type ToolResult, type TraceClock, type TraceEvent, type TraceEventType, TraceRecorder, type TrustedKey, type TrustedKeyStore, USER_PROFILE_EXPORT_VERSION, USER_PROFILE_KEY, USER_PROFILE_NO_INVENTION_RULE, USER_PROFILE_PROMPT_HEADER, USER_PROFILE_REFINE_PROMPT, type UiBridge, type UiSpecActionCapability, type UiSpecDrafts, type UiSpecEvent, type UiSpecNode, type UiSpecPatch, type UiSpecSnapshot, type UiSurfaceActionRequest, type UiSurfaceActionResponse, type UnsignedPolicy, type UnsupportedRunSnapshot, type UserProfile, type UserProfileEntry, type UserProfileExport, type UserProfileLimits, type ValidationReport, type VercelToolSpec, type VerifyResult, type WebSkillApi, WebSkillError, type WebSkillErrorCode, WebSkillRuntime, type WebSkillRuntimeDeps, appendBehaviorRecords, applyUserProfileImport, assertRemoteUrlAllowed, assertSafePathSegment, atomicWriteText, bridgeError, buildCatalog, buildManifest, buildRenderResult, checkDependencyCycles, checkSkillRules, computeDigest, createScriptContext, createWebSkillApi, diffUserProfile, escapeXml, exportSkills, exportUserProfile, extractChartSpec, extractTodoTraceEvents, extractUiSpecEvents, formatSkillScriptManifest, fromVercelResult, fromVercelStreamPart, isNetworkAllowed, isUnsupportedRunSnapshot, isValidSkillName, jsonRenderer, keyIdOf, listSkillScripts, mergeCatalogEntries, mergeProfileEntries, messageOf, networkPolicyLibSource, networkUrlHost, normalizeErrorCode, normalizePath, normalizeToolContent, normalizeToolError, parseBridgeRequest, parseSkillMarkdown, parseSkillPackManifest, parseUserProfileExport, partsToText, readBehaviorRecords, readProfileEntries, readResponseWithLimit, readSkillSignature, readUserProfile, refineUserProfile, renderAvailableSkillsXml, renderCatalogJson, renderUserProfileContext, resolveArchiveLimits, resolveInsideRoot, resolveToolName, sampleBehaviorRecords, schemaSourceLabel, schemaToForm, scriptToolName, signSkill, signaturePayloadBytes, summarizeToolCalls, textParts, toLlmToolSpec, toRecordDigests, toVercelToolSpecs, unzipWithLimits, validateSkills, validateUiSpecEvent, validateUiSpecNode, verifyManifest, verifySkillSignature, xmlRenderer };
|
|
1
|
+
import { $ as SkillArchiveDetection, $t as validateSkills, A as ArchiveLimits, At as checkSkillRules, B as MemoryFS, Bt as normalizePath, C as UiSpecDrafts, Ct as WebSkillErrorCode, D as UiSurfaceActionRequest, Dt as buildCatalog, E as UiSpecSnapshot, Et as atomicWriteText, F as FileStat, Ft as exportSkills, G as SKILLS_LOCKFILE, Gt as renderAvailableSkillsXml, H as PageQuery, Ht as parseSkillPackManifest, I as FileSystemProvider, It as isValidSkillName, J as SKILL_NAME_PATTERN, Jt as resolveInsideRoot, K as SKILL_MANIFEST_FILE, Kt as renderCatalogJson, L as FsTrustedKeyStore, Lt as jsonRenderer, M as CryptoKeyLike, Mt as detectSkillArchiveShape, N as DEFAULT_ARCHIVE_LIMITS, Nt as detectSkillArchiveShapeFromFs, O as UiSurfaceActionResponse, Ot as buildManifest, P as DiscoveryResult, Pt as escapeXml, Q as SignatureVerdict, Qt as unzipWithLimits, R as JsonSchema, Rt as keyIdOf, S as UiSpecActionCapability, St as WebSkillError, T as UiSpecPatch, Tt as assertSafePathSegment, U as RemoteUrlPolicy, Ut as readResponseWithLimit, V as Page, Vt as parseSkillMarkdown, W as SIGNATURE_SCHEMA_VERSION, Wt as readSkillSignature, X as SKILL_SIGNATURE_FILE, Xt as signaturePayloadBytes, Y as SKILL_PACK_FILE, Yt as signSkill, Z as SignatureAuditSink, Zt as stripArchiveRoot, _ as MemoryStore, _t as TrustedKeyStore, a as InteractionOrigin, at as SkillInstallSource, b as SkillCandidateMarker, bt as ValidationReport, c as InteractionResponse, ct as SkillManagerPort, d as LlmContentPart, dt as SkillPackManifest, en as verifyManifest, et as SkillArchiveShape, f as LlmMessage, ft as SkillReader, g as LlmToolSpec, gt as TrustedKey, h as LlmToolCall, ht as SkillsLockfile, i as FormField, it as SkillDocument, j as CatalogRenderer, jt as computeDigest, k as extractSkillCandidate, kt as checkDependencyCycles, l as LlmClient, lt as SkillManifest, m as LlmStreamEvent, mt as SkillSource, n as ArtifactStore, nn as xmlRenderer, nt as SkillCatalogEntry, o as InteractionPolicy, ot as SkillIssue, p as LlmResponse, pt as SkillSignature, q as SKILL_NAME_MAX_LENGTH, qt as resolveArchiveLimits, r as ChartSpec, rt as SkillDiscovery, s as InteractionRequest, st as SkillLocation, t as Artifact, tn as verifySkillSignature, tt as SkillCatalog, u as LlmCompleteInput, ut as SkillMetadata, v as RenderBlock, vt as UiSpecNode, w as UiSpecEvent, wt as assertRemoteUrlAllowed, x as UiBridge, xt as VerifyResult, y as RenderResultRequest, yt as UnsignedPolicy, z as MANIFEST_EXCLUDED_FILES, zt as messageOf } from "./types-B3n0cMZu-BdcqQ35O.js";
|
|
2
|
+
import { $ as READ_SKILL_FILE_INPUT_SCHEMA, $n as scriptToolName, $t as TraceRecorder, A as FS_SESSION_PAGE_SIZE, An as interruptedToolResult, At as SerializingMemoryStore, B as HookRunnerOptions, Bn as normalizeToolError, Bt as SkillScriptSchemaSource, C as DEFAULT_LOOP_LIMITS, Cn as extractChartSpec, Ct as SESSION_SCHEMA_VERSION, D as ExecuteLifecycleData, Dn as formatSkillScriptManifest, Dt as SealOptions, E as EventBus, En as findUnpairedToolCalls, Et as ScriptExecutor, F as FsSessionStore, Fn as mergeProfileEntries, Ft as SkillFailureReport, G as LifecycleEventInit, Gn as readProfileEntries, Gt as TodoTraceEvent, H as IntegrityVerdict, Hn as parseUserProfileExport, Ht as SkillSuccessReport, I as FullDisclosureRouter, In as networkPolicyLibSource, It as SkillIntegrityGuard, J as LifecycleListener, Jn as renderUserProfileContext, Jt as ToolResolution, K as LifecycleHook, Kn as readUserProfile, Kt as ToolContent, L as GoogleGenAiClient, Ln as networkUrlHost, Lt as SkillOutcomeReporter, M as FsMemoryStore, Mn as isUnsupportedRunSnapshot, Mt as SessionMeta, N as FsRunSnapshotStore, Nn as listSkillScripts, Nt as SessionRecord, O as ExternalSkillProvider, On as fromVercelResult, Ot as SealRecord, P as FsRunTraceStore, Pn as mergeCatalogEntries, Pt as SessionStore, Q as ProgressiveRouter, Qn as schemaToForm, Qt as TraceEventType, R as GoogleGenAiClientConfig, Rn as normalizeErrorCode, Rt as SkillRouter, S as CapabilityMode, Sn as exportUserProfile, St as RuntimeSessionHandle, T as EMPTY_USER_PROFILE, Tn as extractUiSpecEvents, Tt as ScriptExecutionContext, U as InteractLifecycleData, Un as partsToText, Ut as TerminalLifecycleData, V as InstalledSkillManifest, Vn as parseBridgeRequest, Vt as SkillStateGuard, W as LifecycleEvent, Wn as readBehaviorRecords, Wt as TextualToolContent, X as OpenAiCompatibleClient, Xn as sampleBehaviorRecords, Xt as TraceClock, Y as NetworkPolicy, Yn as resolveToolName, Yt as ToolResult, Z as OpenAiCompatibleClientConfig, Zn as schemaSourceLabel, Zt as TraceEvent, _ as BridgeCapabilities, _n as bridgeError, _t as RunTraceStore, a as ActivateLifecycleData, an as UnsupportedRunSnapshot, ar as toVercelToolSpecs, at as RouteLifecycleData, b as BridgeResponse, bn as createWebSkillApi, bt as RuntimeRun, c as AgentLoopDeps, cn as UserProfileExport, ct as RunResult, d as ApprovalDecision, dn as VercelToolSpec, dt as RunSnapshotStore, en as USER_PROFILE_EXPORT_VERSION, er as sealToolCallPairs, et as READ_SKILL_FILE_TOOL, f as ApprovalScope, fn as WebSkillApi, ft as RunTerminationReason, g as BehaviorScene, gn as applyUserProfileImport, gt as RunTraceMetrics, h as BehaviorRecordKind, hn as appendBehaviorRecords, ht as RunTraceFilter, i as ASK_USER_TOOL_NAME, in as USER_PROFILE_REFINE_PROMPT, ir as toRecordDigests, it as RefineUserProfileInput, j as FsArtifactStore, jn as isNetworkAllowed, jt as SessionListPage, k as ExternalToolSource, kn as fromVercelStreamPart, kt as SealResult, l as AnthropicClient, ln as UserProfileImportDiff, lt as RunSnapshot, m as BehaviorRecord, mn as WebSkillRuntimeDeps, mt as RunTraceFile, n as ASK_USER_INPUT_SCHEMA, nn as USER_PROFILE_NO_INVENTION_RULE, nr as textParts, nt as RUN_SNAPSHOT_SCHEMA_VERSION, o as AgentLoop, on as UserProfile, or as validateUiSpecEvent, ot as RouteResult, p as BEHAVIOR_RECORDS_KEY, pn as WebSkillRuntime, pt as RunToolCall, q as LifecycleHookContext, qn as refineUserProfile, qt as ToolDefinition, r as ASK_USER_TOOL, rn as USER_PROFILE_PROMPT_HEADER, rr as toLlmToolSpec, rt as RUN_TRACE_SCHEMA_VERSION, s as AgentLoopConfig, sn as UserProfileEntry, sr as validateUiSpecNode, st as RunLimitErrorDetails, t as ALLOWED_TOOLS_EXCLUSION_REASON, tn as USER_PROFILE_KEY, tr as summarizeToolCalls, tt as READ_SKILL_FILE_TOOL_NAME, u as AnthropicClientConfig, un as UserProfileLimits, ut as RunSnapshotListEntry, v as BridgeCapability, vn as buildRenderResult, vt as RunTraceSummary, w as DEFAULT_USER_PROFILE_LIMITS, wn as extractTodoTraceEvents, wt as SchemaInferer, x as CapabilityApproval, xn as diffUserProfile, xt as RuntimeSession, y as BridgeRequest, yn as createScriptContext, yt as RuntimePhase, z as HookRunner, zn as normalizeToolContent, zt as SkillScriptDescriptor } from "./index-K-eewlGL.js";
|
|
3
|
+
export { ALLOWED_TOOLS_EXCLUSION_REASON, ASK_USER_INPUT_SCHEMA, ASK_USER_TOOL, ASK_USER_TOOL_NAME, type ActivateLifecycleData, AgentLoop, type AgentLoopConfig, type AgentLoopDeps, AnthropicClient, type AnthropicClientConfig, type ApprovalDecision, type ApprovalScope, type ArchiveLimits, type Artifact, type ArtifactStore, BEHAVIOR_RECORDS_KEY, type BehaviorRecord, type BehaviorRecordKind, type BehaviorScene, type BridgeCapabilities, type BridgeCapability, type BridgeRequest, type BridgeResponse, CapabilityApproval, type CapabilityMode, type CatalogRenderer, type ChartSpec, type CryptoKeyLike, DEFAULT_ARCHIVE_LIMITS, DEFAULT_LOOP_LIMITS, DEFAULT_USER_PROFILE_LIMITS, type DiscoveryResult, EMPTY_USER_PROFILE, EventBus, type ExecuteLifecycleData, type ExternalSkillProvider, type ExternalToolSource, FS_SESSION_PAGE_SIZE, type FileStat, type FileSystemProvider, type FormField, FsArtifactStore, FsMemoryStore, FsRunSnapshotStore, FsRunTraceStore, FsSessionStore, FsTrustedKeyStore, FullDisclosureRouter, GoogleGenAiClient, type GoogleGenAiClientConfig, HookRunner, type HookRunnerOptions, type InstalledSkillManifest, type IntegrityVerdict, type InteractLifecycleData, type InteractionOrigin, type InteractionPolicy, type InteractionRequest, type InteractionResponse, type JsonSchema, type LifecycleEvent, type LifecycleEventInit, type LifecycleHook, type LifecycleHookContext, type LifecycleListener, type LlmClient, type LlmCompleteInput, type LlmContentPart, type LlmMessage, type LlmResponse, type LlmStreamEvent, type LlmToolCall, type LlmToolSpec, MANIFEST_EXCLUDED_FILES, MemoryFS, type MemoryStore, type NetworkPolicy, OpenAiCompatibleClient, type OpenAiCompatibleClientConfig, type Page, type PageQuery, ProgressiveRouter, READ_SKILL_FILE_INPUT_SCHEMA, READ_SKILL_FILE_TOOL, READ_SKILL_FILE_TOOL_NAME, RUN_SNAPSHOT_SCHEMA_VERSION, RUN_TRACE_SCHEMA_VERSION, type RefineUserProfileInput, type RemoteUrlPolicy, type RenderBlock, type RenderResultRequest, type RouteLifecycleData, type RouteResult, type RunLimitErrorDetails, type RunResult, type RunSnapshot, type RunSnapshotListEntry, type RunSnapshotStore, type RunTerminationReason, type RunToolCall, type RunTraceFile, type RunTraceFilter, type RunTraceMetrics, type RunTraceStore, type RunTraceSummary, type RuntimePhase, type RuntimeRun, type RuntimeSession, type RuntimeSessionHandle, SESSION_SCHEMA_VERSION, SIGNATURE_SCHEMA_VERSION, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, SKILL_NAME_MAX_LENGTH, SKILL_NAME_PATTERN, SKILL_PACK_FILE, SKILL_SIGNATURE_FILE, type SchemaInferer, type ScriptExecutionContext, type ScriptExecutor, type SealOptions, type SealRecord, type SealResult, SerializingMemoryStore, type SessionListPage, type SessionMeta, type SessionRecord, type SessionStore, type SignatureAuditSink, type SignatureVerdict, type SkillArchiveDetection, type SkillArchiveShape, type SkillCandidateMarker, type SkillCatalog, type SkillCatalogEntry, SkillDiscovery, type SkillDocument, type SkillFailureReport, type SkillInstallSource, type SkillIntegrityGuard, type SkillIssue, type SkillLocation, type SkillManagerPort, type SkillManifest, type SkillMetadata, type SkillOutcomeReporter, type SkillPackManifest, SkillReader, type SkillRouter, type SkillScriptDescriptor, type SkillScriptSchemaSource, type SkillSignature, type SkillSource, type SkillStateGuard, type SkillSuccessReport, type SkillsLockfile, type TerminalLifecycleData, type TextualToolContent, type TodoTraceEvent, type ToolContent, type ToolDefinition, type ToolResolution, type ToolResult, type TraceClock, type TraceEvent, type TraceEventType, TraceRecorder, type TrustedKey, type TrustedKeyStore, USER_PROFILE_EXPORT_VERSION, USER_PROFILE_KEY, USER_PROFILE_NO_INVENTION_RULE, USER_PROFILE_PROMPT_HEADER, USER_PROFILE_REFINE_PROMPT, type UiBridge, type UiSpecActionCapability, type UiSpecDrafts, type UiSpecEvent, type UiSpecNode, type UiSpecPatch, type UiSpecSnapshot, type UiSurfaceActionRequest, type UiSurfaceActionResponse, type UnsignedPolicy, type UnsupportedRunSnapshot, type UserProfile, type UserProfileEntry, type UserProfileExport, type UserProfileImportDiff, type UserProfileLimits, type ValidationReport, type VercelToolSpec, type VerifyResult, type WebSkillApi, WebSkillError, type WebSkillErrorCode, WebSkillRuntime, type WebSkillRuntimeDeps, appendBehaviorRecords, applyUserProfileImport, assertRemoteUrlAllowed, assertSafePathSegment, atomicWriteText, bridgeError, buildCatalog, buildManifest, buildRenderResult, checkDependencyCycles, checkSkillRules, computeDigest, createScriptContext, createWebSkillApi, detectSkillArchiveShape, detectSkillArchiveShapeFromFs, diffUserProfile, escapeXml, exportSkills, exportUserProfile, extractChartSpec, extractSkillCandidate, extractTodoTraceEvents, extractUiSpecEvents, findUnpairedToolCalls, formatSkillScriptManifest, fromVercelResult, fromVercelStreamPart, interruptedToolResult, isNetworkAllowed, isUnsupportedRunSnapshot, isValidSkillName, jsonRenderer, keyIdOf, listSkillScripts, mergeCatalogEntries, mergeProfileEntries, messageOf, networkPolicyLibSource, networkUrlHost, normalizeErrorCode, normalizePath, normalizeToolContent, normalizeToolError, parseBridgeRequest, parseSkillMarkdown, parseSkillPackManifest, parseUserProfileExport, partsToText, readBehaviorRecords, readProfileEntries, readResponseWithLimit, readSkillSignature, readUserProfile, refineUserProfile, renderAvailableSkillsXml, renderCatalogJson, renderUserProfileContext, resolveArchiveLimits, resolveInsideRoot, resolveToolName, sampleBehaviorRecords, schemaSourceLabel, schemaToForm, scriptToolName, sealToolCallPairs, signSkill, signaturePayloadBytes, stripArchiveRoot, summarizeToolCalls, textParts, toLlmToolSpec, toRecordDigests, toVercelToolSpecs, unzipWithLimits, validateSkills, validateUiSpecEvent, validateUiSpecNode, verifyManifest, verifySkillSignature, xmlRenderer };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { a as textParts, n as partsToText } from "./memoryArtifactStore-52Zn9npI-
|
|
3
|
-
import { $ as
|
|
1
|
+
import { A as messageOf, B as signSkill, C as detectSkillArchiveShape, D as isValidSkillName, E as exportSkills, F as readSkillSignature, G as verifyManifest, H as stripArchiveRoot, I as renderAvailableSkillsXml, K as verifySkillSignature, L as renderCatalogJson, M as parseSkillMarkdown, N as parseSkillPackManifest, O as jsonRenderer, P as readResponseWithLimit, R as resolveArchiveLimits, S as computeDigest, T as escapeXml, U as unzipWithLimits, V as signaturePayloadBytes, W as validateSkills, _ as atomicWriteText, a as SIGNATURE_SCHEMA_VERSION, b as checkDependencyCycles, c as SKILL_NAME_MAX_LENGTH, d as SKILL_SIGNATURE_FILE, f as SkillDiscovery, g as assertSafePathSegment, h as assertRemoteUrlAllowed, i as MemoryFS, j as normalizePath, k as keyIdOf, l as SKILL_NAME_PATTERN, m as WebSkillError, n as FsTrustedKeyStore, o as SKILLS_LOCKFILE, p as SkillReader, q as xmlRenderer, r as MANIFEST_EXCLUDED_FILES, s as SKILL_MANIFEST_FILE, t as DEFAULT_ARCHIVE_LIMITS, u as SKILL_PACK_FILE, v as buildCatalog, w as detectSkillArchiveShapeFromFs, x as checkSkillRules, y as buildManifest, z as resolveInsideRoot } from "./dist-59XlqDuv.js";
|
|
2
|
+
import { a as textParts, n as partsToText } from "./memoryArtifactStore-52Zn9npI-upv5OWYf.js";
|
|
3
|
+
import { $ as fromVercelStreamPart, A as SerializingMemoryStore, B as bridgeError, C as ProgressiveRouter, Ct as sealToolCallPairs, D as RUN_SNAPSHOT_SCHEMA_VERSION, Dt as toVercelToolSpecs, E as READ_SKILL_FILE_TOOL_NAME, Et as toRecordDigests, F as USER_PROFILE_PROMPT_HEADER, G as exportUserProfile, H as createScriptContext, I as USER_PROFILE_REFINE_PROMPT, J as extractTodoTraceEvents, K as extractChartSpec, L as WebSkillRuntime, M as USER_PROFILE_EXPORT_VERSION, N as USER_PROFILE_KEY, O as RUN_TRACE_SCHEMA_VERSION, Ot as validateUiSpecEvent, P as USER_PROFILE_NO_INVENTION_RULE, Q as fromVercelResult, R as appendBehaviorRecords, S as OpenAiCompatibleClient, St as scriptToolName, T as READ_SKILL_FILE_TOOL, Tt as toLlmToolSpec, U as createWebSkillApi, V as buildRenderResult, W as diffUserProfile, X as findUnpairedToolCalls, Y as extractUiSpecEvents, Z as formatSkillScriptManifest, _ as FsRunTraceStore, _t as renderUserProfileContext, a as AgentLoop, at as mergeProfileEntries, b as GoogleGenAiClient, bt as schemaSourceLabel, c as CapabilityApproval, ct as normalizeErrorCode, d as EMPTY_USER_PROFILE, dt as parseBridgeRequest, et as interruptedToolResult, f as EventBus, ft as parseUserProfileExport, g as FsRunSnapshotStore, gt as refineUserProfile, h as FsMemoryStore, ht as readUserProfile, i as ASK_USER_TOOL_NAME, it as mergeCatalogEntries, j as TraceRecorder, k as SESSION_SCHEMA_VERSION, kt as validateUiSpecNode, l as DEFAULT_LOOP_LIMITS, lt as normalizeToolContent, m as FsArtifactStore, mt as readProfileEntries, n as ASK_USER_INPUT_SCHEMA, nt as isUnsupportedRunSnapshot, o as AnthropicClient, ot as networkPolicyLibSource, p as FS_SESSION_PAGE_SIZE, pt as readBehaviorRecords, q as extractSkillCandidate, r as ASK_USER_TOOL, rt as listSkillScripts, s as BEHAVIOR_RECORDS_KEY, st as networkUrlHost, t as ALLOWED_TOOLS_EXCLUSION_REASON, tt as isNetworkAllowed, u as DEFAULT_USER_PROFILE_LIMITS, ut as normalizeToolError, v as FsSessionStore, vt as resolveToolName, w as READ_SKILL_FILE_INPUT_SCHEMA, wt as summarizeToolCalls, x as HookRunner, xt as schemaToForm, y as FullDisclosureRouter, yt as sampleBehaviorRecords, z as applyUserProfileImport } from "./dist-DmI5SBBF.js";
|
|
4
4
|
|
|
5
|
-
export { ALLOWED_TOOLS_EXCLUSION_REASON, ASK_USER_INPUT_SCHEMA, ASK_USER_TOOL, ASK_USER_TOOL_NAME, AgentLoop, AnthropicClient, BEHAVIOR_RECORDS_KEY, CapabilityApproval, DEFAULT_ARCHIVE_LIMITS, DEFAULT_USER_PROFILE_LIMITS, EMPTY_USER_PROFILE, EventBus, FS_SESSION_PAGE_SIZE, FsArtifactStore, FsMemoryStore, FsRunSnapshotStore, FsRunTraceStore, FsSessionStore, FsTrustedKeyStore, FullDisclosureRouter, GoogleGenAiClient, HookRunner, MANIFEST_EXCLUDED_FILES, MemoryFS, OpenAiCompatibleClient, ProgressiveRouter, READ_SKILL_FILE_INPUT_SCHEMA, READ_SKILL_FILE_TOOL, READ_SKILL_FILE_TOOL_NAME, RUN_SNAPSHOT_SCHEMA_VERSION, RUN_TRACE_SCHEMA_VERSION, SESSION_SCHEMA_VERSION, SIGNATURE_SCHEMA_VERSION, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, SKILL_NAME_MAX_LENGTH, SKILL_NAME_PATTERN, SKILL_PACK_FILE, SKILL_SIGNATURE_FILE, SerializingMemoryStore, SkillDiscovery, SkillReader, TraceRecorder, USER_PROFILE_EXPORT_VERSION, USER_PROFILE_KEY, USER_PROFILE_NO_INVENTION_RULE, USER_PROFILE_PROMPT_HEADER, USER_PROFILE_REFINE_PROMPT, WebSkillError, WebSkillRuntime, appendBehaviorRecords, applyUserProfileImport, assertRemoteUrlAllowed, assertSafePathSegment, atomicWriteText, bridgeError, buildCatalog, buildManifest, buildRenderResult, checkDependencyCycles, checkSkillRules, computeDigest, createScriptContext, createWebSkillApi, diffUserProfile, escapeXml, exportSkills, exportUserProfile, extractChartSpec, extractTodoTraceEvents, extractUiSpecEvents, formatSkillScriptManifest, fromVercelResult, fromVercelStreamPart, isNetworkAllowed, isUnsupportedRunSnapshot, isValidSkillName, jsonRenderer, keyIdOf, listSkillScripts, mergeCatalogEntries, mergeProfileEntries, messageOf, networkPolicyLibSource, networkUrlHost, normalizeErrorCode, normalizePath, normalizeToolContent, normalizeToolError, parseBridgeRequest, parseSkillMarkdown, parseSkillPackManifest, parseUserProfileExport, partsToText, readBehaviorRecords, readProfileEntries, readResponseWithLimit, readSkillSignature, readUserProfile, refineUserProfile, renderAvailableSkillsXml, renderCatalogJson, renderUserProfileContext, resolveArchiveLimits, resolveInsideRoot, resolveToolName, sampleBehaviorRecords, schemaSourceLabel, schemaToForm, scriptToolName, signSkill, signaturePayloadBytes, summarizeToolCalls, textParts, toLlmToolSpec, toRecordDigests, toVercelToolSpecs, unzipWithLimits, validateSkills, validateUiSpecEvent, validateUiSpecNode, verifyManifest, verifySkillSignature, xmlRenderer };
|
|
5
|
+
export { ALLOWED_TOOLS_EXCLUSION_REASON, ASK_USER_INPUT_SCHEMA, ASK_USER_TOOL, ASK_USER_TOOL_NAME, AgentLoop, AnthropicClient, BEHAVIOR_RECORDS_KEY, CapabilityApproval, DEFAULT_ARCHIVE_LIMITS, DEFAULT_LOOP_LIMITS, DEFAULT_USER_PROFILE_LIMITS, EMPTY_USER_PROFILE, EventBus, FS_SESSION_PAGE_SIZE, FsArtifactStore, FsMemoryStore, FsRunSnapshotStore, FsRunTraceStore, FsSessionStore, FsTrustedKeyStore, FullDisclosureRouter, GoogleGenAiClient, HookRunner, MANIFEST_EXCLUDED_FILES, MemoryFS, OpenAiCompatibleClient, ProgressiveRouter, READ_SKILL_FILE_INPUT_SCHEMA, READ_SKILL_FILE_TOOL, READ_SKILL_FILE_TOOL_NAME, RUN_SNAPSHOT_SCHEMA_VERSION, RUN_TRACE_SCHEMA_VERSION, SESSION_SCHEMA_VERSION, SIGNATURE_SCHEMA_VERSION, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, SKILL_NAME_MAX_LENGTH, SKILL_NAME_PATTERN, SKILL_PACK_FILE, SKILL_SIGNATURE_FILE, SerializingMemoryStore, SkillDiscovery, SkillReader, TraceRecorder, USER_PROFILE_EXPORT_VERSION, USER_PROFILE_KEY, USER_PROFILE_NO_INVENTION_RULE, USER_PROFILE_PROMPT_HEADER, USER_PROFILE_REFINE_PROMPT, WebSkillError, WebSkillRuntime, appendBehaviorRecords, applyUserProfileImport, assertRemoteUrlAllowed, assertSafePathSegment, atomicWriteText, bridgeError, buildCatalog, buildManifest, buildRenderResult, checkDependencyCycles, checkSkillRules, computeDigest, createScriptContext, createWebSkillApi, detectSkillArchiveShape, detectSkillArchiveShapeFromFs, diffUserProfile, escapeXml, exportSkills, exportUserProfile, extractChartSpec, extractSkillCandidate, extractTodoTraceEvents, extractUiSpecEvents, findUnpairedToolCalls, formatSkillScriptManifest, fromVercelResult, fromVercelStreamPart, interruptedToolResult, isNetworkAllowed, isUnsupportedRunSnapshot, isValidSkillName, jsonRenderer, keyIdOf, listSkillScripts, mergeCatalogEntries, mergeProfileEntries, messageOf, networkPolicyLibSource, networkUrlHost, normalizeErrorCode, normalizePath, normalizeToolContent, normalizeToolError, parseBridgeRequest, parseSkillMarkdown, parseSkillPackManifest, parseUserProfileExport, partsToText, readBehaviorRecords, readProfileEntries, readResponseWithLimit, readSkillSignature, readUserProfile, refineUserProfile, renderAvailableSkillsXml, renderCatalogJson, renderUserProfileContext, resolveArchiveLimits, resolveInsideRoot, resolveToolName, sampleBehaviorRecords, schemaSourceLabel, schemaToForm, scriptToolName, sealToolCallPairs, signSkill, signaturePayloadBytes, stripArchiveRoot, summarizeToolCalls, textParts, toLlmToolSpec, toRecordDigests, toVercelToolSpecs, unzipWithLimits, validateSkills, validateUiSpecEvent, validateUiSpecNode, verifyManifest, verifySkillSignature, xmlRenderer };
|
package/dist/mcp.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { R as JsonSchema, g as LlmToolSpec, it as SkillDocument, nt as SkillCatalogEntry } from "./types-B3n0cMZu-BdcqQ35O.js";
|
|
2
|
+
import { O as ExternalSkillProvider, Pn as mergeCatalogEntries, Yt as ToolResult, k as ExternalToolSource } from "./index-K-eewlGL.js";
|
|
3
3
|
import { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
|
|
4
4
|
import { JSONRPCMessage } from "@modelcontextprotocol/sdk/types.js";
|
|
5
5
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
@@ -245,6 +245,12 @@ declare class ExperimentalWebMcpAdapter {
|
|
|
245
245
|
enabled?: boolean;
|
|
246
246
|
});
|
|
247
247
|
isAvailable(): boolean;
|
|
248
|
+
isEnabled(): boolean;
|
|
249
|
+
/**
|
|
250
|
+
* 宿主把开关交给用户时必须走这里:适配器是工具是否对 LLM 可见的**唯一闸门**。
|
|
251
|
+
* 宿主自己另存一份开关态而不同步到这里,会出现「界面上关了、模型照样能调」。
|
|
252
|
+
*/
|
|
253
|
+
setEnabled(on: boolean): void;
|
|
248
254
|
/** 工具清单(getTools 缺失时返回 undefined;调用失败时告警后返回 undefined) */
|
|
249
255
|
listTools(): Promise<WebMcpToolDescriptor[] | undefined>;
|
|
250
256
|
/** 工具名清单(getTools 缺失/失败时返回 undefined) */
|
|
@@ -274,6 +280,108 @@ declare class McpRuntimePlugin implements ExternalToolSource {
|
|
|
274
280
|
call(llmToolName: string, args: Record<string, unknown>): Promise<ToolResult>;
|
|
275
281
|
}
|
|
276
282
|
//#endregion
|
|
283
|
+
//#region src/remote/oauth.d.ts
|
|
284
|
+
/**
|
|
285
|
+
* S9 · MCP 授权注入协议(0.7.0 FR-22.1 ~ FR-22.3)。
|
|
286
|
+
*
|
|
287
|
+
* 本文件**不实现 OAuth**:发现、PKCE、`code` 交换、刷新全部由 `@modelcontextprotocol/sdk` 承担。
|
|
288
|
+
* 这里只提供 SDK 替我们决定不了的三样:宿主的 client 信息、令牌存储、把用户送到授权页。
|
|
289
|
+
*/
|
|
290
|
+
/** 宿主预注册的 OAuth 客户端信息。不做动态注册(RFC 7591),因此此项必填。 @experimental */
|
|
291
|
+
interface McpOAuthClient {
|
|
292
|
+
clientId: string;
|
|
293
|
+
/** 机密客户端才有;浏览器端应留空 */
|
|
294
|
+
clientSecret?: string;
|
|
295
|
+
/** 授权服务器回跳地址,必须与预注册值一致 */
|
|
296
|
+
redirectUri: string;
|
|
297
|
+
scopes?: string[];
|
|
298
|
+
}
|
|
299
|
+
/** 令牌集合。access 与 refresh 分开传递,宿主可对二者采用不同存储策略。 @experimental */
|
|
300
|
+
interface McpOAuthTokens {
|
|
301
|
+
accessToken: string;
|
|
302
|
+
/** epoch ms;缺省表示不过期 */
|
|
303
|
+
expiresAt?: number;
|
|
304
|
+
refreshToken?: string;
|
|
305
|
+
tokenType?: string;
|
|
306
|
+
scope?: string;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* 令牌存储。SDK 不提供默认实现(AC-22.7)——写不写盘、写到哪里由宿主决定。
|
|
310
|
+
* key 为端点名(`RemoteEndpointConfig.endpoint`),宿主据此隔离多端点。
|
|
311
|
+
* @experimental
|
|
312
|
+
*/
|
|
313
|
+
interface McpOAuthTokenStore {
|
|
314
|
+
load(endpoint: string): Promise<McpOAuthTokens | undefined>;
|
|
315
|
+
save(endpoint: string, tokens: McpOAuthTokens): Promise<void>;
|
|
316
|
+
clear(endpoint: string): Promise<void>;
|
|
317
|
+
}
|
|
318
|
+
/** 一次授权握手的暂存内容:PKCE verifier 与 state 需要跨页面重定向存活。 @experimental */
|
|
319
|
+
interface McpOAuthHandshake {
|
|
320
|
+
codeVerifier: string;
|
|
321
|
+
state: string;
|
|
322
|
+
}
|
|
323
|
+
/** 握手暂存端口。与长期令牌的存储策略不同,因此独立成一个端口。 @experimental */
|
|
324
|
+
interface McpOAuthHandshakeStore {
|
|
325
|
+
save(endpoint: string, handshake: McpOAuthHandshake): Promise<void>;
|
|
326
|
+
load(endpoint: string): Promise<McpOAuthHandshake | undefined>;
|
|
327
|
+
clear(endpoint: string): Promise<void>;
|
|
328
|
+
}
|
|
329
|
+
/** 授权流程所处的阶段;进错误 `details`,不含任何凭据。 @experimental */
|
|
330
|
+
type McpOAuthStage = 'discover' | 'authorize' | 'exchange' | 'refresh';
|
|
331
|
+
/** @experimental */
|
|
332
|
+
interface McpOAuthConfig {
|
|
333
|
+
client: McpOAuthClient;
|
|
334
|
+
tokens: McpOAuthTokenStore;
|
|
335
|
+
handshake: McpOAuthHandshakeStore;
|
|
336
|
+
/**
|
|
337
|
+
* 把用户送到授权页。宿主决定形态(新窗口 / 系统浏览器)。
|
|
338
|
+
* 返回后流程挂起,等待宿主拿到 `code` 再调 `finishAuthorization`。
|
|
339
|
+
*/
|
|
340
|
+
openAuthorization(url: URL): Promise<void> | void;
|
|
341
|
+
}
|
|
342
|
+
/** 显式的内存存储,供 examples 与测试使用。**不是缺省行为**——是宿主主动选的(AC-22.7)。 @experimental */
|
|
343
|
+
declare function createMemoryOAuthStores(): {
|
|
344
|
+
tokens: McpOAuthTokenStore;
|
|
345
|
+
handshake: McpOAuthHandshakeStore;
|
|
346
|
+
};
|
|
347
|
+
/** SDK 的 `OAuthTokens` 形状(结构化引用,避免在模块顶层 import 可选 peer 的类型) */
|
|
348
|
+
interface SdkTokens {
|
|
349
|
+
access_token: string;
|
|
350
|
+
token_type: string;
|
|
351
|
+
expires_in?: number;
|
|
352
|
+
refresh_token?: string;
|
|
353
|
+
scope?: string;
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* SDK `OAuthClientProvider` 的结构化对应物。
|
|
357
|
+
* 刻意不 implements SDK 接口:适配层只提供我们认可的成员,
|
|
358
|
+
* 尤其**不提供** `saveClientInformation`——那是动态客户端注册的入口(需求 §5)。
|
|
359
|
+
* @experimental
|
|
360
|
+
*/
|
|
361
|
+
interface McpOAuthProvider {
|
|
362
|
+
readonly redirectUrl: string;
|
|
363
|
+
readonly clientMetadata: Record<string, unknown>;
|
|
364
|
+
state(): Promise<string>;
|
|
365
|
+
clientInformation(): Promise<{
|
|
366
|
+
client_id: string;
|
|
367
|
+
client_secret?: string;
|
|
368
|
+
}>;
|
|
369
|
+
tokens(): Promise<SdkTokens | undefined>;
|
|
370
|
+
saveTokens(tokens: SdkTokens): Promise<void>;
|
|
371
|
+
redirectToAuthorization(url: URL): Promise<void>;
|
|
372
|
+
saveCodeVerifier(codeVerifier: string): Promise<void>;
|
|
373
|
+
codeVerifier(): Promise<string>;
|
|
374
|
+
invalidateCredentials(scope: 'all' | 'client' | 'tokens' | 'verifier' | 'discovery'): Promise<void>;
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* `McpOAuthConfig` → SDK `OAuthClientProvider` 适配器。
|
|
378
|
+
*
|
|
379
|
+
* `state()` 与 `saveCodeVerifier()` 由 SDK 分两次调用(顺序上前者在先),
|
|
380
|
+
* 两者合成一条握手记录:谁先到都把当前已知部分写进去,回程时两项都在。
|
|
381
|
+
* @experimental
|
|
382
|
+
*/
|
|
383
|
+
declare function createOAuthProvider(endpoint: string, config: McpOAuthConfig): McpOAuthProvider;
|
|
384
|
+
//#endregion
|
|
277
385
|
//#region src/remote/connectRemoteEndpoint.d.ts
|
|
278
386
|
interface RemoteEndpointConfig {
|
|
279
387
|
/** registry 中的名字(endpoint:tool 引用) */
|
|
@@ -289,6 +397,23 @@ interface RemoteEndpointConfig {
|
|
|
289
397
|
allowHttp?: boolean;
|
|
290
398
|
/** 显式允许私有/环回/链路本地地址(SSRF 防护默认拒绝) */
|
|
291
399
|
allowPrivateHosts?: boolean;
|
|
400
|
+
/**
|
|
401
|
+
* 使用 OAuth 2.1 授权码 + PKCE(0.7.0 FR-22.1)。
|
|
402
|
+
* 与 `headers` 可共存,但**不要**在 `headers` 里再手填 `Authorization`,会被覆盖。
|
|
403
|
+
* @experimental
|
|
404
|
+
*/
|
|
405
|
+
oauth?: McpOAuthConfig;
|
|
406
|
+
}
|
|
407
|
+
/** 远程 endpoint 句柄 @experimental */
|
|
408
|
+
interface RemoteEndpointHandle {
|
|
409
|
+
close(): Promise<void>;
|
|
410
|
+
/**
|
|
411
|
+
* OAuth 回程:宿主拿到 authorization code 后调用,成功后 endpoint 才被注册。
|
|
412
|
+
* 未配置 `oauth` 时不挂载。
|
|
413
|
+
*/
|
|
414
|
+
finishAuthorization?(code: string, state: string): Promise<void>;
|
|
415
|
+
/** 建连因需要用户授权而未完成:endpoint 未注册,等 `finishAuthorization` */
|
|
416
|
+
authorizationRequired?: true;
|
|
292
417
|
}
|
|
293
418
|
/**
|
|
294
419
|
* 远程 MCP endpoint 装配:SDK 官方 StreamableHTTPClientTransport(默认)/
|
|
@@ -296,8 +421,6 @@ interface RemoteEndpointConfig {
|
|
|
296
421
|
* endpoint:tool 解析、TTL+版本缓存、临时技能消费自动生效。
|
|
297
422
|
* 返回 close 句柄:断开后 unregister(临时技能随既有生命周期自然消失)。
|
|
298
423
|
*/
|
|
299
|
-
declare function connectRemoteEndpoint(registry: EndpointRegistry<McpClientLike>, config: RemoteEndpointConfig): Promise<
|
|
300
|
-
close(): Promise<void>;
|
|
301
|
-
}>;
|
|
424
|
+
declare function connectRemoteEndpoint(registry: EndpointRegistry<McpClientLike>, config: RemoteEndpointConfig): Promise<RemoteEndpointHandle>;
|
|
302
425
|
//#endregion
|
|
303
|
-
export { type BrowserModelContextLike, EndpointRegistry, ExperimentalWebMcpAdapter, type McpClientLike, McpRuntimePlugin, McpToolResolver, MessageChannelTransport, type MessageChannelTransportOptions, type MessagePortLike, type RemoteEndpointConfig, type ServedSkill, TemporarySkillProvider, type TransportState, type WebMcpToolDescriptor, type WebMcpToolLike, catalogMerge, connectRemoteEndpoint, endpointToolLlmName, parseEndpointToolLlmName, parseWebMcpToolLlmName, serveSkillAsMcp, validateJsonRpcMessage, webMcpToolLlmName };
|
|
426
|
+
export { type BrowserModelContextLike, EndpointRegistry, ExperimentalWebMcpAdapter, type McpClientLike, type McpOAuthClient, type McpOAuthConfig, type McpOAuthHandshake, type McpOAuthHandshakeStore, type McpOAuthProvider, type McpOAuthStage, type McpOAuthTokenStore, type McpOAuthTokens, McpRuntimePlugin, McpToolResolver, MessageChannelTransport, type MessageChannelTransportOptions, type MessagePortLike, type RemoteEndpointConfig, type RemoteEndpointHandle, type ServedSkill, TemporarySkillProvider, type TransportState, type WebMcpToolDescriptor, type WebMcpToolLike, catalogMerge, connectRemoteEndpoint, createMemoryOAuthStores, createOAuthProvider, endpointToolLlmName, parseEndpointToolLlmName, parseWebMcpToolLlmName, serveSkillAsMcp, validateJsonRpcMessage, webMcpToolLlmName };
|