@webskill/sdk 0.8.0 → 0.10.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 +6 -2
- package/dist/browser.d.ts +5 -3
- package/dist/browser.js +35 -13
- package/dist/{catalogComponents-DfxxfUvn-D55Gbb2l.js → catalogComponents-DTcYfpLQ-CcoOaz-Z.js} +1946 -976
- package/dist/{dist-CJqQsIm9.js → dist-1OFC-zax.js} +7 -5
- package/dist/{dist-DmI5SBBF.js → dist-BViUeszk.js} +393 -44
- package/dist/{dist-59XlqDuv.js → dist-Bev6i6Ip.js} +10 -2
- package/dist/{eventTypes-g1BXL6x5-CibcOftR.js → eventTypes-s2uwAcLG-Go3l_dUe.js} +13 -2
- package/dist/governance.d.ts +37 -6
- package/dist/governance.js +53 -15
- package/dist/{index-P9J2LTfU.d.ts → index-B0QPLWPZ.d.ts} +6 -2
- package/dist/{index-fLskQfAS.d.ts → index-BF4E1a9j.d.ts} +10 -3
- package/dist/{index-K-eewlGL.d.ts → index-DtFdMKBX.d.ts} +69 -7
- package/dist/index.d.ts +11 -3
- package/dist/index.js +13 -4
- package/dist/mcp.d.ts +23 -3
- package/dist/mcp.js +70 -25
- package/dist/{memoryArtifactStore-52Zn9npI-upv5OWYf.js → memoryArtifactStore-52Zn9npI-LbCQaqyx.js} +1 -1
- package/dist/node.d.ts +3 -3
- package/dist/node.js +6 -6
- package/dist/{openUiLibrary-DURlAxjk-CU6AzfSW.js → openUiLibrary-CIrV--Ad-B8zG_91e.js} +3 -3
- package/dist/{skillVersionStore-Bl-ElD45-gRfSaAby.d.ts → skillVersionStore-D-qHk9ZE-DBsYYCWn.d.ts} +13 -5
- package/dist/{testing-BCUO5gZR.js → testing-WPTyXQYt.js} +28 -5
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +2 -2
- package/dist/{types-B3n0cMZu-BdcqQ35O.d.ts → types-CrRcT-LM-DZAp8sWv.d.ts} +44 -3
- package/dist/ui-react.d.ts +17 -2
- package/dist/ui-react.js +123 -39
- package/dist/ui-vue.d.ts +1 -1
- package/dist/ui-vue.js +1 -1
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +2 -2
- package/dist/{webskillLitCatalog-DwTwSBFt-DiXXpNZA.js → webskillLitCatalog-BJrphK0y-SGmRXaaO.js} +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { $ as READ_SKILL_FILE_INPUT_SCHEMA, $n as
|
|
3
|
-
|
|
1
|
+
import { $ as SignatureAuditSink, $t as signaturePayloadBytes, A as extractSkillCandidate, At as buildManifest, B as JsonSchema, Bt as jsonRenderer, C as UiSpecActionCapability, Ct as VerifyResult, D as UiSpecSnapshot, Dt as assertSafePathSegment, E as UiSpecPatch, Et as assertRemoteUrlAllowed, F as DEFAULT_ARCHIVE_LIMITS, Ft as detectSkillArchiveShapeFromFs, G as RemoteUrlPolicy, Gt as parseSkillPackManifest, H as MemoryFS, Ht as messageOf, I as DiscoveryResult, It as escapeXml, J as SKILL_MANIFEST_FILE, Jt as renderAvailableSkillsXml, K as SIGNATURE_SCHEMA_VERSION, Kt as readResponseWithLimit, L as FileStat, Lt as exportSkills, M as ArchiveLimits, Mt as checkSkillRules, N as CatalogRenderer, Nt as computeDigest, O as UiSurfaceActionRequest, Ot as atomicWriteText, P as CryptoKeyLike, Pt as detectSkillArchiveShape, Q as SKILL_SIGNATURE_FILE, Qt as signSkill, R as FileSystemProvider, Rt as isAtomicTempPath, S as UiBridge, St as ValidationReport, T as UiSpecEvent, Tt as WebSkillErrorCode, U as Page, Ut as normalizePath, V as MANIFEST_EXCLUDED_FILES, Vt as keyIdOf, W as PageQuery, Wt as parseSkillMarkdown, X as SKILL_NAME_PATTERN, Xt as resolveArchiveLimits, Y as SKILL_NAME_MAX_LENGTH, Yt as renderCatalogJson, Z as SKILL_PACK_FILE, Zt as resolveInsideRoot, _ as LlmToolSpec, _t as SkillsLockfile, a as InteractionOrigin, an as xmlRenderer, at as SkillDiscovery, b as RenderResultRequest, bt as UiSpecNode, c as InteractionResponse, ct as SkillIssue, d as LlmContentPart, dt as SkillManifest, en as stripArchiveRoot, et as SignatureVerdict, f as LlmMessage, ft as SkillMetadata, g as LlmToolCall, gt as SkillSource, h as LlmTokenUsage, ht as SkillSignature, i as FormField, in as verifySkillSignature, it as SkillCatalogEntry, j as ATOMIC_TMP_SUFFIX_PATTERN, jt as checkDependencyCycles, k as UiSurfaceActionResponse, kt as buildCatalog, l as LlmClient, lt as SkillLocation, m as LlmStreamEvent, mt as SkillReader, n as ArtifactStore, nn as validateSkills, nt as SkillArchiveShape, o as InteractionPolicy, ot as SkillDocument, p as LlmResponse, pt as SkillPackManifest, q as SKILLS_LOCKFILE, qt as readSkillSignature, r as ChartSpec, rn as verifyManifest, rt as SkillCatalog, s as InteractionRequest, st as SkillInstallSource, t as Artifact, tn as unzipWithLimits, tt as SkillArchiveDetection, u as LlmCompleteInput, ut as SkillManagerPort, v as MemoryStore, vt as TrustedKey, w as UiSpecDrafts, wt as WebSkillError, x as SkillCandidateMarker, xt as UnsignedPolicy, y as RenderBlock, yt as TrustedKeyStore, z as FsTrustedKeyStore, zt as isValidSkillName } from "./types-CrRcT-LM-DZAp8sWv.js";
|
|
2
|
+
import { $ as READ_SKILL_FILE_INPUT_SCHEMA, $n as schemaToForm, $t as TraceEventType, A as FS_SESSION_PAGE_SIZE, An as fromVercelStreamPart, At as SealResult, B as HookRunnerOptions, Bn as normalizeToolContent, Bt as SkillScriptDescriptor, C as DEFAULT_LOOP_LIMITS, Cn as exportUserProfile, Ct as RuntimeSessionHandle, D as ExecuteLifecycleData, Dn as findUnpairedToolCalls, Dt as ScriptExecutor, E as EventBus, En as extractUiSpecEvents, Et as ScriptExecutionContext, F as FsSessionStore, Fn as mergeCatalogEntries, Ft as SessionStore, G as LifecycleEventInit, Gn as readBehaviorRecords, Gt as TextualToolContent, H as IntegrityVerdict, Hn as parseBridgeRequest, Ht as SkillStateGuard, I as FullDisclosureRouter, In as mergeProfileEntries, It as SkillFailureReport, J as LifecycleListener, Jn as refineUserProfile, Jt as ToolDefinition, K as LifecycleHook, Kn as readProfileEntries, Kt as TodoTraceEvent, L as GoogleGenAiClient, Ln as networkPolicyLibSource, Lt as SkillIntegrityGuard, M as FsMemoryStore, Mn as isNetworkAllowed, Mt as SessionListPage, N as FsRunSnapshotStore, Nn as isUnsupportedRunSnapshot, Nt as SessionMeta, O as ExternalSkillProvider, On as formatSkillScriptManifest, Ot as SealOptions, P as FsRunTraceStore, Pn as listSkillScripts, Pt as SessionRecord, Q as ProgressiveRouter, Qn as schemaSourceLabel, Qt as TraceEvent, R as GoogleGenAiClientConfig, Rn as networkUrlHost, Rt as SkillOutcomeReporter, S as CapabilityMode, Sn as diffUserProfile, St as RuntimeSession, T as EMPTY_USER_PROFILE, Tn as extractTodoTraceEvents, Tt as SchemaInferer, U as InteractLifecycleData, Un as parseUserProfileExport, Ut as SkillSuccessReport, V as InstalledSkillManifest, Vn as normalizeToolError, Vt as SkillScriptSchemaSource, W as LifecycleEvent, Wn as partsToText, Wt as TerminalLifecycleData, X as OpenAiCompatibleClient, Xn as resolveToolName, Xt as ToolResult, Y as NetworkPolicy, Yn as renderUserProfileContext, Yt as ToolResolution, Z as OpenAiCompatibleClientConfig, Zn as sampleBehaviorRecords, Zt as TraceClock, _ as BridgeCapabilities, _n as applyUserProfileImport, _t as RunTraceStore, a as ActivateLifecycleData, an as USER_PROFILE_REFINE_PROMPT, ar as toLlmToolSpec, at as RouteLifecycleData, b as BridgeResponse, bn as createScriptContext, bt as RuntimePhase, c as AgentLoopDeps, cn as UserProfileEntry, cr as validateUiSpecEvent, ct as RunResult, d as ApprovalDecision, dn as UserProfileLimits, dt as RunSnapshotStore, en as TraceRecorder, er as scriptToolName, et as READ_SKILL_FILE_TOOL, f as ApprovalScope, fn as VercelToolSpec, ft as RunTerminationReason, g as BehaviorScene, gn as appendBehaviorRecords, gt as RunTraceMetrics, h as BehaviorRecordKind, hn as WebSkillRuntimeDeps, ht as RunTraceFilter, i as ASK_USER_TOOL_NAME, in as USER_PROFILE_PROMPT_HEADER, ir as textParts, it as RefineUserProfileInput, j as FsArtifactStore, jn as interruptedToolResult, jt as SerializingMemoryStore, k as ExternalToolSource, kn as fromVercelResult, kt as SealRecord, l as AnthropicClient, ln as UserProfileExport, lr as validateUiSpecNode, lt as RunSnapshot, m as BehaviorRecord, mn as WebSkillRuntime, mt as RunTraceFile, n as ASK_USER_INPUT_SCHEMA, nn as USER_PROFILE_KEY, nr as summarizeRunUsage, nt as RUN_SNAPSHOT_SCHEMA_VERSION, o as AgentLoop, on as UnsupportedRunSnapshot, or as toRecordDigests, ot as RouteResult, p as BEHAVIOR_RECORDS_KEY, pn as WebSkillApi, pt as RunToolCall, q as LifecycleHookContext, qn as readUserProfile, qt as ToolContent, r as ASK_USER_TOOL, rn as USER_PROFILE_NO_INVENTION_RULE, rr as summarizeToolCalls, rt as RUN_TRACE_SCHEMA_VERSION, s as AgentLoopConfig, sn as UserProfile, sr as toVercelToolSpecs, st as RunLimitErrorDetails, t as ALLOWED_TOOLS_EXCLUSION_REASON, tn as USER_PROFILE_EXPORT_VERSION, tr as sealToolCallPairs, tt as READ_SKILL_FILE_TOOL_NAME, u as AnthropicClientConfig, un as UserProfileImportDiff, ut as RunSnapshotListEntry, v as BridgeCapability, vn as bridgeError, vt as RunTraceSummary, w as DEFAULT_USER_PROFILE_LIMITS, wn as extractChartSpec, wt as SESSION_SCHEMA_VERSION, x as CapabilityApproval, xn as createWebSkillApi, xt as RuntimeRun, y as BridgeRequest, yn as buildRenderResult, yt as RunUsageSummary, z as HookRunner, zn as normalizeErrorCode, zt as SkillRouter } from "./index-DtFdMKBX.js";
|
|
3
|
+
//#region src/version.d.ts
|
|
4
|
+
/** Generated by scripts/syncVersionConstant.mjs from packages/sdk/package.json. Do not edit by hand. */
|
|
5
|
+
/**
|
|
6
|
+
* Version of the published `@webskill/sdk` package, injected at build time.
|
|
7
|
+
* @stable
|
|
8
|
+
*/
|
|
9
|
+
declare const SDK_VERSION = "0.10.0";
|
|
10
|
+
//#endregion
|
|
11
|
+
export { ALLOWED_TOOLS_EXCLUSION_REASON, ASK_USER_INPUT_SCHEMA, ASK_USER_TOOL, ASK_USER_TOOL_NAME, ATOMIC_TMP_SUFFIX_PATTERN, 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 LlmTokenUsage, 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 RunUsageSummary, type RuntimePhase, type RuntimeRun, type RuntimeSession, type RuntimeSessionHandle, SDK_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, 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, isAtomicTempPath, 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, summarizeRunUsage, summarizeToolCalls, textParts, toLlmToolSpec, toRecordDigests, toVercelToolSpecs, unzipWithLimits, validateSkills, validateUiSpecEvent, validateUiSpecNode, verifyManifest, verifySkillSignature, xmlRenderer };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { a as textParts, n as partsToText } from "./memoryArtifactStore-52Zn9npI-
|
|
3
|
-
import { $ as fromVercelStreamPart, A as SerializingMemoryStore, B as bridgeError, C as ProgressiveRouter, Ct as sealToolCallPairs, D as RUN_SNAPSHOT_SCHEMA_VERSION, Dt as
|
|
1
|
+
import { A as jsonRenderer, B as resolveArchiveLimits, C as computeDigest, D as exportSkills, E as escapeXml, F as parseSkillPackManifest, G as unzipWithLimits, H as signSkill, I as readResponseWithLimit, J as verifySkillSignature, K as validateSkills, L as readSkillSignature, M as messageOf, N as normalizePath, O as isAtomicTempPath, P as parseSkillMarkdown, R as renderAvailableSkillsXml, S as checkSkillRules, T as detectSkillArchiveShapeFromFs, U as signaturePayloadBytes, V as resolveInsideRoot, W as stripArchiveRoot, Y as xmlRenderer, _ as assertSafePathSegment, a as MemoryFS, b as buildManifest, c as SKILL_MANIFEST_FILE, d as SKILL_PACK_FILE, f as SKILL_SIGNATURE_FILE, g as assertRemoteUrlAllowed, h as WebSkillError, i as MANIFEST_EXCLUDED_FILES, j as keyIdOf, k as isValidSkillName, l as SKILL_NAME_MAX_LENGTH, m as SkillReader, n as DEFAULT_ARCHIVE_LIMITS, o as SIGNATURE_SCHEMA_VERSION, p as SkillDiscovery, q as verifyManifest, r as FsTrustedKeyStore, s as SKILLS_LOCKFILE, t as ATOMIC_TMP_SUFFIX_PATTERN, u as SKILL_NAME_PATTERN, v as atomicWriteText, w as detectSkillArchiveShape, x as checkDependencyCycles, y as buildCatalog, z as renderCatalogJson } from "./dist-Bev6i6Ip.js";
|
|
2
|
+
import { a as textParts, n as partsToText } from "./memoryArtifactStore-52Zn9npI-LbCQaqyx.js";
|
|
3
|
+
import { $ as fromVercelStreamPart, A as SerializingMemoryStore, At as validateUiSpecNode, B as bridgeError, C as ProgressiveRouter, Ct as sealToolCallPairs, D as RUN_SNAPSHOT_SCHEMA_VERSION, Dt as toRecordDigests, E as READ_SKILL_FILE_TOOL_NAME, Et as toLlmToolSpec, 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 toVercelToolSpecs, 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 summarizeToolCalls, 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 validateUiSpecEvent, 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 summarizeRunUsage, x as HookRunner, xt as schemaToForm, y as FullDisclosureRouter, yt as sampleBehaviorRecords, z as applyUserProfileImport } from "./dist-BViUeszk.js";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
//#region src/version.ts
|
|
6
|
+
/** Generated by scripts/syncVersionConstant.mjs from packages/sdk/package.json. Do not edit by hand. */
|
|
7
|
+
/**
|
|
8
|
+
* Version of the published `@webskill/sdk` package, injected at build time.
|
|
9
|
+
* @stable
|
|
10
|
+
*/
|
|
11
|
+
const SDK_VERSION = "0.10.0";
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { ALLOWED_TOOLS_EXCLUSION_REASON, ASK_USER_INPUT_SCHEMA, ASK_USER_TOOL, ASK_USER_TOOL_NAME, ATOMIC_TMP_SUFFIX_PATTERN, 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, SDK_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, isAtomicTempPath, 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, summarizeRunUsage, 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 { B as JsonSchema, _ as LlmToolSpec, it as SkillCatalogEntry, ot as SkillDocument } from "./types-CrRcT-LM-DZAp8sWv.js";
|
|
2
|
+
import { Fn as mergeCatalogEntries, O as ExternalSkillProvider, Xt as ToolResult, k as ExternalToolSource } from "./index-DtFdMKBX.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";
|
|
@@ -244,6 +244,11 @@ declare class ExperimentalWebMcpAdapter {
|
|
|
244
244
|
constructor(api?: BrowserModelContextLike | (() => BrowserModelContextLike | undefined), options?: {
|
|
245
245
|
enabled?: boolean;
|
|
246
246
|
});
|
|
247
|
+
/**
|
|
248
|
+
* 宿主能力检测(FR-19.2/19.4):**只**看 `document.modelContext.executeTool` 是否存在,
|
|
249
|
+
* 不含 `enabled` 状态——「未启用」不等于「浏览器不支持」,两者必须可区分。
|
|
250
|
+
* 是否对 LLM 列出工具由 `isEnabled()` 单独把关(McpRuntimePlugin 读它,见测试)。
|
|
251
|
+
*/
|
|
247
252
|
isAvailable(): boolean;
|
|
248
253
|
isEnabled(): boolean;
|
|
249
254
|
/**
|
|
@@ -259,6 +264,19 @@ declare class ExperimentalWebMcpAdapter {
|
|
|
259
264
|
}
|
|
260
265
|
//#endregion
|
|
261
266
|
//#region src/plugin/mcpRuntimePlugin.d.ts
|
|
267
|
+
/**
|
|
268
|
+
* 工具可见性策略(0.10.0 UI-UX5 #50.3):端点禁用 ∨ 工具禁用 ⇒ 不进 LLM tool spec,
|
|
269
|
+
* 调用侧同样拦截(模型找不到这些工具)。各判定缺省视为启用。
|
|
270
|
+
* 回调每次 listToolSpecs/call 实时求值,宿主改状态不需要重建插件。
|
|
271
|
+
*/
|
|
272
|
+
interface McpToolVisibility {
|
|
273
|
+
/** 端点级开关;返回 false 时该端点所有工具对大模型不可见 */
|
|
274
|
+
isEndpointEnabled?(endpoint: string): boolean;
|
|
275
|
+
/** 端点工具级开关;返回 false 时该工具对大模型不可见 */
|
|
276
|
+
isEndpointToolEnabled?(endpoint: string, tool: string): boolean;
|
|
277
|
+
/** WebMCP 工具级开关;返回 false 时该工具对大模型不可见 */
|
|
278
|
+
isWebMcpToolEnabled?(tool: string): boolean;
|
|
279
|
+
}
|
|
262
280
|
/**
|
|
263
281
|
* runtime 扩展点实现:endpoint 注册表 + WebMCP adapter 一处装配。
|
|
264
282
|
* LLM 可见名:endpoint__tool / mcp__tool;call 时反向映射。
|
|
@@ -270,6 +288,8 @@ declare class McpRuntimePlugin implements ExternalToolSource {
|
|
|
270
288
|
registry: EndpointRegistry<McpClientLike>;
|
|
271
289
|
webMcp?: ExperimentalWebMcpAdapter;
|
|
272
290
|
resolver?: McpToolResolver;
|
|
291
|
+
/** 工具可见性策略(端点/工具级启停);缺省全部可见 */
|
|
292
|
+
visibility?: McpToolVisibility;
|
|
273
293
|
/** 已知的 endpoint 名(注销后仍按 MCP_ENDPOINT_UNAVAILABLE 响应,而非 TOOL_NOT_FOUND) */
|
|
274
294
|
endpoints?: string[];
|
|
275
295
|
/** endpoint 不可用时的告警出口(默认 console.warn) */
|
|
@@ -423,4 +443,4 @@ interface RemoteEndpointHandle {
|
|
|
423
443
|
*/
|
|
424
444
|
declare function connectRemoteEndpoint(registry: EndpointRegistry<McpClientLike>, config: RemoteEndpointConfig): Promise<RemoteEndpointHandle>;
|
|
425
445
|
//#endregion
|
|
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 };
|
|
446
|
+
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, type McpToolVisibility, 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 };
|
package/dist/mcp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { it as mergeCatalogEntries, lt as normalizeToolContent } from "./dist-
|
|
1
|
+
import { M as messageOf, g as assertRemoteUrlAllowed, h as WebSkillError } from "./dist-Bev6i6Ip.js";
|
|
2
|
+
import { it as mergeCatalogEntries, lt as normalizeToolContent } from "./dist-BViUeszk.js";
|
|
3
3
|
|
|
4
4
|
//#region ../mcp/dist/index.js
|
|
5
5
|
/**
|
|
@@ -441,9 +441,13 @@ var ExperimentalWebMcpAdapter = class {
|
|
|
441
441
|
this.#resolveApi = typeof api === "function" ? api : () => api;
|
|
442
442
|
this.#enabled = options?.enabled ?? false;
|
|
443
443
|
}
|
|
444
|
+
/**
|
|
445
|
+
* 宿主能力检测(FR-19.2/19.4):**只**看 `document.modelContext.executeTool` 是否存在,
|
|
446
|
+
* 不含 `enabled` 状态——「未启用」不等于「浏览器不支持」,两者必须可区分。
|
|
447
|
+
* 是否对 LLM 列出工具由 `isEnabled()` 单独把关(McpRuntimePlugin 读它,见测试)。
|
|
448
|
+
*/
|
|
444
449
|
isAvailable() {
|
|
445
|
-
|
|
446
|
-
return this.#enabled && typeof api?.executeTool === "function";
|
|
450
|
+
return typeof this.#resolveApi()?.executeTool === "function";
|
|
447
451
|
}
|
|
448
452
|
isEnabled() {
|
|
449
453
|
return this.#enabled;
|
|
@@ -497,6 +501,14 @@ var ExperimentalWebMcpAdapter = class {
|
|
|
497
501
|
}
|
|
498
502
|
}
|
|
499
503
|
};
|
|
504
|
+
const disabledResult = (llmToolName) => ({
|
|
505
|
+
ok: false,
|
|
506
|
+
content: [],
|
|
507
|
+
error: {
|
|
508
|
+
code: "MCP_TOOL_DISABLED",
|
|
509
|
+
message: `Tool "${llmToolName}" is disabled`
|
|
510
|
+
}
|
|
511
|
+
});
|
|
500
512
|
/**
|
|
501
513
|
* runtime 扩展点实现:endpoint 注册表 + WebMCP adapter 一处装配。
|
|
502
514
|
* LLM 可见名:endpoint__tool / mcp__tool;call 时反向映射。
|
|
@@ -506,43 +518,71 @@ var McpRuntimePlugin = class {
|
|
|
506
518
|
#registry;
|
|
507
519
|
#resolver;
|
|
508
520
|
#webMcp;
|
|
521
|
+
#visibility;
|
|
509
522
|
#configuredEndpoints;
|
|
510
523
|
#onWarning;
|
|
511
524
|
constructor(deps) {
|
|
512
525
|
this.#registry = deps.registry;
|
|
513
526
|
this.#resolver = deps.resolver ?? new McpToolResolver(deps.registry);
|
|
514
527
|
this.#webMcp = deps.webMcp;
|
|
528
|
+
this.#visibility = deps.visibility;
|
|
515
529
|
this.#configuredEndpoints = deps.endpoints ?? [];
|
|
516
530
|
this.#onWarning = deps.onWarning ?? ((message) => console.warn(message));
|
|
517
531
|
}
|
|
518
532
|
#endpoints() {
|
|
519
533
|
return [.../* @__PURE__ */ new Set([...this.#configuredEndpoints, ...this.#registry.endpoints()])];
|
|
520
534
|
}
|
|
535
|
+
/** 端点级可见性:未接策略或判定非 false 即启用 */
|
|
536
|
+
#endpointEnabled(endpoint) {
|
|
537
|
+
return this.#visible(() => this.#visibility?.isEndpointEnabled?.(endpoint));
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* 可见性回调统一求值:宿主注入的回调抛异常时按「放行 + 告警」处理。
|
|
541
|
+
* 可见性不是安全闸门(安全由审批链兜底),异常关闭会让整轮工具集消失、
|
|
542
|
+
* 模型转而幻觉;放行代价更小,但必须走 onWarning,否则宿主回调 bug 被静默吞掉。
|
|
543
|
+
*/
|
|
544
|
+
#visible(probe) {
|
|
545
|
+
try {
|
|
546
|
+
return probe() !== false;
|
|
547
|
+
} catch (e) {
|
|
548
|
+
this.#onWarning(`[webskill] MCP visibility callback failed; treating as enabled: ${e instanceof Error ? e.message : String(e)}`);
|
|
549
|
+
return true;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
521
552
|
async listToolSpecs() {
|
|
522
553
|
const specs = [];
|
|
523
|
-
for (const endpoint of this.#endpoints())
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
554
|
+
for (const endpoint of this.#endpoints()) {
|
|
555
|
+
if (!this.#endpointEnabled(endpoint)) continue;
|
|
556
|
+
try {
|
|
557
|
+
const { tools } = await this.#registry.get(endpoint).listTools();
|
|
558
|
+
for (const tool of tools) {
|
|
559
|
+
if (!this.#visible(() => this.#visibility?.isEndpointToolEnabled?.(endpoint, tool.name))) continue;
|
|
560
|
+
specs.push({
|
|
561
|
+
name: endpointToolLlmName(endpoint, tool.name),
|
|
562
|
+
...tool.description ? { description: `[${endpoint}] ${tool.description}` } : {},
|
|
563
|
+
inputSchema: typeof tool.inputSchema === "object" && tool.inputSchema !== null ? tool.inputSchema : {
|
|
564
|
+
type: "object",
|
|
565
|
+
properties: {}
|
|
566
|
+
}
|
|
567
|
+
});
|
|
531
568
|
}
|
|
532
|
-
})
|
|
533
|
-
|
|
534
|
-
|
|
569
|
+
} catch (e) {
|
|
570
|
+
this.#onWarning(`[webskill] MCP endpoint "${endpoint}" is unavailable; its tools are omitted from this turn: ${e instanceof Error ? e.message : String(e)}`);
|
|
571
|
+
}
|
|
535
572
|
}
|
|
536
|
-
if (this.#webMcp?.
|
|
573
|
+
if (this.#webMcp?.isEnabled()) {
|
|
537
574
|
const tools = await this.#webMcp.listTools();
|
|
538
|
-
for (const tool of tools ?? [])
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
575
|
+
for (const tool of tools ?? []) {
|
|
576
|
+
if (!this.#visible(() => this.#visibility?.isWebMcpToolEnabled?.(tool.name))) continue;
|
|
577
|
+
specs.push({
|
|
578
|
+
name: webMcpToolLlmName(tool.name),
|
|
579
|
+
description: tool.description ?? `[webmcp] ${tool.name}`,
|
|
580
|
+
inputSchema: typeof tool.inputSchema === "object" && tool.inputSchema !== null ? tool.inputSchema : {
|
|
581
|
+
type: "object",
|
|
582
|
+
properties: {}
|
|
583
|
+
}
|
|
584
|
+
});
|
|
585
|
+
}
|
|
546
586
|
}
|
|
547
587
|
return specs;
|
|
548
588
|
}
|
|
@@ -561,11 +601,16 @@ var McpRuntimePlugin = class {
|
|
|
561
601
|
message: "WebMCP adapter is not configured"
|
|
562
602
|
}
|
|
563
603
|
};
|
|
604
|
+
if (!this.#visible(() => this.#visibility?.isWebMcpToolEnabled?.(webMcpTool))) return disabledResult(llmToolName);
|
|
564
605
|
return this.#webMcp.call(webMcpTool, args);
|
|
565
606
|
}
|
|
566
607
|
for (const endpoint of this.#endpoints()) {
|
|
567
608
|
const toolName = parseEndpointToolLlmName(endpoint, llmToolName);
|
|
568
|
-
if (toolName !== void 0)
|
|
609
|
+
if (toolName !== void 0) {
|
|
610
|
+
if (!this.#endpointEnabled(endpoint)) return disabledResult(llmToolName);
|
|
611
|
+
if (!this.#visible(() => this.#visibility?.isEndpointToolEnabled?.(endpoint, toolName))) return disabledResult(llmToolName);
|
|
612
|
+
return this.#resolver.call(endpoint, toolName, args);
|
|
613
|
+
}
|
|
569
614
|
}
|
|
570
615
|
return {
|
|
571
616
|
ok: false,
|
package/dist/node.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { a as AuditLog,
|
|
1
|
+
import { $ as SignatureAuditSink, B as JsonSchema, Ct as VerifyResult, J as SKILL_MANIFEST_FILE, L as FileStat, M as ArchiveLimits, R as FileSystemProvider, S as UiBridge, _t as SkillsLockfile, b as RenderResultRequest, c as InteractionResponse, dt as SkillManifest, q as SKILLS_LOCKFILE, s as InteractionRequest, st as SkillInstallSource, ut as SkillManagerPort, xt as UnsignedPolicy, yt as TrustedKeyStore } from "./types-CrRcT-LM-DZAp8sWv.js";
|
|
2
|
+
import { Dt as ScriptExecutor, Et as ScriptExecutionContext, Jt as ToolDefinition, M as FsMemoryStore, Tt as SchemaInferer, Xt as ToolResult, Y as NetworkPolicy, _ as BridgeCapabilities, bn as createScriptContext, f as ApprovalScope, hn as WebSkillRuntimeDeps, j as FsArtifactStore, mn as WebSkillRuntime } from "./index-DtFdMKBX.js";
|
|
3
|
+
import { a as AuditLog, b as SkillVersionStore, d as CandidateSkill, m as CandidateStore, r as ApprovalPolicy } from "./skillVersionStore-D-qHk9ZE-DBsYYCWn.js";
|
|
4
4
|
import { n as LlmEnvConfig, s as probeLlmCapabilities, t as LlmCapabilities } from "./env-AK3cSMEA-Dli6QU5E.js";
|
|
5
5
|
import { Readable, Writable } from "node:stream";
|
|
6
6
|
//#region ../node/dist/index.d.ts
|
package/dist/node.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { B as bridgeError, H as createScriptContext, L as WebSkillRuntime, c as CapabilityApproval, dt as parseBridgeRequest, h as FsMemoryStore, lt as normalizeToolContent, m as FsArtifactStore, ot as networkPolicyLibSource, ut as normalizeToolError } from "./dist-
|
|
1
|
+
import { B as resolveArchiveLimits, D as exportSkills, F as parseSkillPackManifest, G as unzipWithLimits, I as readResponseWithLimit, J as verifySkillSignature, K as validateSkills, L as readSkillSignature, M as messageOf, O as isAtomicTempPath, P as parseSkillMarkdown, V as resolveInsideRoot, _ as assertSafePathSegment, b as buildManifest, c as SKILL_MANIFEST_FILE, d as SKILL_PACK_FILE, g as assertRemoteUrlAllowed, h as WebSkillError, i as MANIFEST_EXCLUDED_FILES, k as isValidSkillName, q as verifyManifest, s as SKILLS_LOCKFILE, v as atomicWriteText } from "./dist-Bev6i6Ip.js";
|
|
2
|
+
import { B as bridgeError, H as createScriptContext, L as WebSkillRuntime, c as CapabilityApproval, dt as parseBridgeRequest, h as FsMemoryStore, lt as normalizeToolContent, m as FsArtifactStore, ot as networkPolicyLibSource, ut as normalizeToolError } from "./dist-BViUeszk.js";
|
|
3
3
|
import { i as probeLlmCapabilities } from "./env-8cY40DXB-CGnEVZby.js";
|
|
4
|
-
import { t as AUDIT_EVENT_TYPES } from "./eventTypes-
|
|
4
|
+
import { t as AUDIT_EVENT_TYPES } from "./eventTypes-s2uwAcLG-Go3l_dUe.js";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import { unzipSync, zipSync } from "fflate";
|
|
7
7
|
import { existsSync, promises, realpathSync } from "node:fs";
|
|
@@ -1274,14 +1274,14 @@ async function extractTarFile(archivePath, destRoot, limits) {
|
|
|
1274
1274
|
throw new WebSkillError("INSTALL_FAILED", `Failed to extract tar archive: ${messageOf(e)}`, e);
|
|
1275
1275
|
}
|
|
1276
1276
|
}
|
|
1277
|
-
/** 递归列出目录内全部文件(相对路径,posix
|
|
1277
|
+
/** 递归列出目录内全部文件(相对路径,posix 分隔,不含目录条目;原子写中断残留的 `.tmp-*` 不计入) */
|
|
1278
1278
|
async function listFiles(fs, root, prefix = "") {
|
|
1279
1279
|
const out = [];
|
|
1280
1280
|
for (const entry of await fs.list(root)) {
|
|
1281
1281
|
const name = entry.path.split("/").pop() ?? "";
|
|
1282
1282
|
const rel = prefix === "" ? name : `${prefix}/${name}`;
|
|
1283
1283
|
if (entry.type === "directory") out.push(...await listFiles(fs, entry.path, rel));
|
|
1284
|
-
else out.push(rel);
|
|
1284
|
+
else if (!isAtomicTempPath(name)) out.push(rel);
|
|
1285
1285
|
}
|
|
1286
1286
|
return out;
|
|
1287
1287
|
}
|
|
@@ -2238,7 +2238,7 @@ var ApprovalWorkflow = class {
|
|
|
2238
2238
|
const stagingRoot = (await mkdtemp(path.join(tmpdir(), "webskill-candidate-"))).split(path.sep).join("/");
|
|
2239
2239
|
try {
|
|
2240
2240
|
const skillDir = `${stagingRoot}/${candidate.name}`;
|
|
2241
|
-
for (const file of candidate.files) await this.#fs
|
|
2241
|
+
for (const file of candidate.files) await atomicWriteText(this.#fs, resolveInsideRoot(skillDir, file.path), file.content);
|
|
2242
2242
|
const report = await validateSkills(this.#fs, [stagingRoot]);
|
|
2243
2243
|
if (!report.ok) {
|
|
2244
2244
|
const errors = report.issues.filter((i) => i.severity === "error");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ft as uiCatalog } from "./dist-
|
|
2
|
-
import { t as CatalogNode } from "./catalogComponents-
|
|
1
|
+
import { ft as uiCatalog } from "./dist-1OFC-zax.js";
|
|
2
|
+
import { t as CatalogNode } from "./catalogComponents-DTcYfpLQ-CcoOaz-Z.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { Component, Fragment, createContext, useCallback, useContext, useEffect, useInsertionEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -3761,7 +3761,7 @@ function Renderer({ response, library, isStreaming = false, onAction, onStateUpd
|
|
|
3761
3761
|
const FormValidationContext = createContext(null);
|
|
3762
3762
|
|
|
3763
3763
|
//#endregion
|
|
3764
|
-
//#region ../ui-react/dist/openUiLibrary-
|
|
3764
|
+
//#region ../ui-react/dist/openUiLibrary-CIrV--Ad.js
|
|
3765
3765
|
const propsFor = (props, container) => container ? props.extend({ children: z.array(z.any()).optional() }) : props;
|
|
3766
3766
|
/**
|
|
3767
3767
|
* catalog 的 OpenUI 投影:`defineComponent` 复用同一份 zod schema 与描述,
|
package/dist/{skillVersionStore-Bl-ElD45-gRfSaAby.d.ts → skillVersionStore-D-qHk9ZE-DBsYYCWn.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
//#region ../governance/dist/skillVersionStore-
|
|
1
|
+
import { R as FileSystemProvider, U as Page, W as PageQuery, dt as SkillManifest, it as SkillCatalogEntry } from "./types-CrRcT-LM-DZAp8sWv.js";
|
|
2
|
+
//#region ../governance/dist/skillVersionStore-D-qHk9ZE.d.ts
|
|
3
3
|
//#region src/types.d.ts
|
|
4
4
|
type CandidateStatus = 'draft' | 'pending-review' | 'approved' | 'published' | 'rejected';
|
|
5
5
|
/** `generated` 是 0.5.0 的技能自动生成来源(需求 12 号 AC-9.1) */
|
|
@@ -84,6 +84,10 @@ type SkillState = 'active' | 'quarantined' | 'deprecated' | 'disabled';
|
|
|
84
84
|
//#region src/candidate/candidateStore.d.ts
|
|
85
85
|
/** 候选列表的缺省页长。缺省属于实现,不属于调用方 */
|
|
86
86
|
declare const CANDIDATE_PAGE_SIZE = 50;
|
|
87
|
+
/** 候选分页结果:`total` 为筛选后匹配总数(0.10.0 UI-UX5 #40.12,页码分页的总页数依据) @stable */
|
|
88
|
+
interface CandidatePage extends Page<CandidateSkill> {
|
|
89
|
+
total: number;
|
|
90
|
+
}
|
|
87
91
|
/** 逐文件持久化的候选存储:<managedRoot>/.webskill/candidates/<id>.json */
|
|
88
92
|
declare class CandidateStore {
|
|
89
93
|
#private;
|
|
@@ -100,7 +104,7 @@ declare class CandidateStore {
|
|
|
100
104
|
*/
|
|
101
105
|
list(options?: {
|
|
102
106
|
status?: CandidateStatus;
|
|
103
|
-
} & PageQuery): Promise<
|
|
107
|
+
} & PageQuery): Promise<CandidatePage>;
|
|
104
108
|
updateStatus(id: string, status: CandidateStatus, now?: string): Promise<CandidateSkill>;
|
|
105
109
|
}
|
|
106
110
|
/** 硬门禁:仅 published 可转换为 Catalog 条目,否则 APPROVAL_REQUIRED */
|
|
@@ -128,6 +132,10 @@ declare class CompositeApprovalPolicy implements ApprovalPolicy {
|
|
|
128
132
|
//#region src/versioning/skillVersionStore.d.ts
|
|
129
133
|
/** 版本列表的缺省页长。缺省属于实现,不属于调用方 */
|
|
130
134
|
declare const SKILL_VERSION_PAGE_SIZE = 20;
|
|
135
|
+
/** 版本分页结果:`total` 为该技能版本总数(0.10.0 UI-UX5 #40.12,页码分页的总页数依据) @stable */
|
|
136
|
+
interface SkillVersionPage extends Page<SkillVersion> {
|
|
137
|
+
total: number;
|
|
138
|
+
}
|
|
131
139
|
/** 版本存储:manifest 快照 + parentVersionId 链;回滚 = 追加新版本(谱系不断)。
|
|
132
140
|
* 保留策略:maxArchivesPerSkill(默认 5)超出时清理最旧版本(json + zip 归档一并删除)。 */
|
|
133
141
|
declare class SkillVersionStore {
|
|
@@ -153,7 +161,7 @@ declare class SkillVersionStore {
|
|
|
153
161
|
* 版本列表分页(方向同 C1:无游标给**最新**一页)。
|
|
154
162
|
* 保留策略与谱系构建走 `#readAll`:它们必须看到全量,不能被分页截断。
|
|
155
163
|
*/
|
|
156
|
-
list(skillName: string, options?: PageQuery): Promise<
|
|
164
|
+
list(skillName: string, options?: PageQuery): Promise<SkillVersionPage>;
|
|
157
165
|
get(skillName: string, versionId: string): Promise<SkillVersion>;
|
|
158
166
|
/** 回滚:基于旧 manifest 追加新版本 + skill.rolled_back 审计 */
|
|
159
167
|
rollback(skillName: string, targetVersionId: string, input: {
|
|
@@ -162,4 +170,4 @@ declare class SkillVersionStore {
|
|
|
162
170
|
}): Promise<SkillVersion>;
|
|
163
171
|
}
|
|
164
172
|
//#endregion
|
|
165
|
-
export {
|
|
173
|
+
export { SkillState as _, AuditLog as a, SkillVersionStore as b, CandidateFile as c, CandidateSkill as d, CandidateSource as f, SKILL_VERSION_PAGE_SIZE as g, CompositeApprovalPolicy as h, AuditEvent as i, CandidatePage as l, CandidateStore as m, ApprovalDecision as n, AuditQueryFilter as o, CandidateStatus as p, ApprovalPolicy as r, CANDIDATE_PAGE_SIZE as s, AlwaysHumanApprovalPolicy as t, CandidateRisk as u, SkillVersion as v, candidateToCatalogEntry as x, SkillVersionPage as y };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as textParts, n as partsToText } from "./memoryArtifactStore-52Zn9npI-
|
|
1
|
+
import { h as WebSkillError } from "./dist-Bev6i6Ip.js";
|
|
2
|
+
import { a as textParts, n as partsToText } from "./memoryArtifactStore-52Zn9npI-LbCQaqyx.js";
|
|
3
3
|
|
|
4
4
|
//#region ../runtime/dist/testing.js
|
|
5
5
|
/**
|
|
@@ -23,13 +23,21 @@ var MockLlmClient = class {
|
|
|
23
23
|
if ("stream" in next) {
|
|
24
24
|
const events = typeof next.stream === "function" ? next.stream(input) : next.stream;
|
|
25
25
|
let content = "";
|
|
26
|
+
let thinking = "";
|
|
26
27
|
let toolCalls;
|
|
28
|
+
let usage;
|
|
27
29
|
for (const event of events) if (event.type === "text-delta") content += event.delta;
|
|
30
|
+
else if (event.type === "thinking-delta") thinking += event.delta;
|
|
28
31
|
else if (event.type === "tool-calls") toolCalls = event.toolCalls;
|
|
29
|
-
else if (event.type === "done"
|
|
32
|
+
else if (event.type === "done") {
|
|
33
|
+
if (event.content !== void 0) content = event.content;
|
|
34
|
+
if (event.usage !== void 0) usage = event.usage;
|
|
35
|
+
}
|
|
30
36
|
return {
|
|
31
37
|
content: content === "" ? void 0 : textParts(content),
|
|
32
|
-
toolCalls
|
|
38
|
+
toolCalls,
|
|
39
|
+
...thinking === "" ? {} : { thinking },
|
|
40
|
+
...usage ? { usage } : {}
|
|
33
41
|
};
|
|
34
42
|
}
|
|
35
43
|
return next;
|
|
@@ -44,6 +52,18 @@ var MockLlmClient = class {
|
|
|
44
52
|
return;
|
|
45
53
|
}
|
|
46
54
|
const response = typeof next === "function" ? await next(input) : next;
|
|
55
|
+
if (response.thinking !== void 0 && response.thinking !== "") {
|
|
56
|
+
const half = Math.ceil(response.thinking.length / 2);
|
|
57
|
+
yield {
|
|
58
|
+
type: "thinking-delta",
|
|
59
|
+
delta: response.thinking.slice(0, half)
|
|
60
|
+
};
|
|
61
|
+
const rest = response.thinking.slice(half);
|
|
62
|
+
if (rest !== "") yield {
|
|
63
|
+
type: "thinking-delta",
|
|
64
|
+
delta: rest
|
|
65
|
+
};
|
|
66
|
+
}
|
|
47
67
|
const text = partsToText(response.content);
|
|
48
68
|
if (text !== "") {
|
|
49
69
|
const chunkSize = Math.max(1, Math.ceil(text.length / 3));
|
|
@@ -56,7 +76,10 @@ var MockLlmClient = class {
|
|
|
56
76
|
type: "tool-calls",
|
|
57
77
|
toolCalls: response.toolCalls
|
|
58
78
|
};
|
|
59
|
-
yield {
|
|
79
|
+
yield {
|
|
80
|
+
type: "done",
|
|
81
|
+
...response.usage ? { usage: response.usage } : {}
|
|
82
|
+
};
|
|
60
83
|
}
|
|
61
84
|
};
|
|
62
85
|
/**
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as UiBridge, c as InteractionResponse, l as LlmClient, m as LlmStreamEvent, n as ArtifactStore, p as LlmResponse, s as InteractionRequest, t as Artifact, u as LlmCompleteInput, v as MemoryStore } from "./types-CrRcT-LM-DZAp8sWv.js";
|
|
2
2
|
import { a as loadGoogleConfigFromEnv, i as loadAnthropicConfigFromEnv, n as LlmEnvConfig, o as loadLlmConfigFromEnv, r as ProviderEnvConfig } from "./env-AK3cSMEA-Dli6QU5E.js";
|
|
3
3
|
//#region ../runtime/dist/testing.d.ts
|
|
4
4
|
//#region src/llm/mockLlmClient.d.ts
|
package/dist/testing.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as MemoryArtifactStore } from "./memoryArtifactStore-52Zn9npI-
|
|
1
|
+
import { t as MemoryArtifactStore } from "./memoryArtifactStore-52Zn9npI-LbCQaqyx.js";
|
|
2
2
|
import { n as loadGoogleConfigFromEnv, r as loadLlmConfigFromEnv, t as loadAnthropicConfigFromEnv } from "./env-8cY40DXB-CGnEVZby.js";
|
|
3
|
-
import { n as MockLlmClient, r as MockUiBridge, t as InMemoryStore } from "./testing-
|
|
3
|
+
import { n as MockLlmClient, r as MockUiBridge, t as InMemoryStore } from "./testing-WPTyXQYt.js";
|
|
4
4
|
|
|
5
5
|
export { InMemoryStore, MemoryArtifactStore, MockLlmClient, MockUiBridge, loadAnthropicConfigFromEnv, loadGoogleConfigFromEnv, loadLlmConfigFromEnv };
|