@bendyline/docblocks 2.2.1 → 2.3.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.
@@ -1,4 +1,5 @@
1
1
  // src/host/wire-policy.ts
2
+ var MAX_HOST_PINNED_DOCUMENTS = 50;
2
3
  var HOST_WIRE_LIMITS = Object.freeze({
3
4
  identifierCharacters: 256,
4
5
  labelCharacters: 1024,
@@ -37,6 +38,29 @@ function parseOpenRequest(value) {
37
38
  }
38
39
  return null;
39
40
  }
41
+ function parsePinnedMenuDocuments(value) {
42
+ if (!Array.isArray(value)) return [];
43
+ const documents = [];
44
+ const seen = /* @__PURE__ */ new Set();
45
+ for (const entry of value) {
46
+ if (documents.length >= MAX_HOST_PINNED_DOCUMENTS) break;
47
+ if (typeof entry !== "object" || entry === null || Array.isArray(entry)) continue;
48
+ const record = entry;
49
+ if (!hasExactKeys(record, ["workspaceId", "workspaceName", "path"])) continue;
50
+ if (!isBoundedString(record.workspaceId, HOST_WIRE_LIMITS.identifierCharacters, 1)) continue;
51
+ if (!isBoundedString(record.workspaceName, HOST_WIRE_LIMITS.labelCharacters, 1)) continue;
52
+ if (!isBoundedString(record.path, HOST_WIRE_LIMITS.pathCharacters, 1)) continue;
53
+ const key = `${record.workspaceId}\0${record.path}`;
54
+ if (seen.has(key)) continue;
55
+ seen.add(key);
56
+ documents.push({
57
+ workspaceId: record.workspaceId,
58
+ workspaceName: record.workspaceName,
59
+ path: record.path
60
+ });
61
+ }
62
+ return documents;
63
+ }
40
64
  function parseExternalHttpUrl(value) {
41
65
  if (!isBoundedString(value, HOST_WIRE_LIMITS.urlCharacters, 1)) return null;
42
66
  try {
@@ -65,10 +89,12 @@ function isTrustedRendererUrl(value, developmentOrigin) {
65
89
  }
66
90
 
67
91
  export {
92
+ MAX_HOST_PINNED_DOCUMENTS,
68
93
  HOST_WIRE_LIMITS,
69
94
  isBoundedString,
70
95
  isBoundedBytePayload,
71
96
  parseOpenRequest,
97
+ parsePinnedMenuDocuments,
72
98
  parseExternalHttpUrl,
73
99
  isTrustedRendererUrl
74
100
  };
@@ -11,7 +11,6 @@ var DOCBLOCKS_MCP_TOOL_NAMES = [
11
11
  "create_document_bundle",
12
12
  "save_artifact",
13
13
  "inspect_document",
14
- "validate_document",
15
14
  "preview_document",
16
15
  "compare_documents",
17
16
  "get_authoring_context",
@@ -307,35 +306,6 @@ function parseInspectionResult(value) {
307
306
  diagnostics
308
307
  };
309
308
  }
310
- function parseValidationResult(value) {
311
- if (!isRecord(value) || !hasExactKeys(value, [
312
- "version",
313
- "kind",
314
- "sourceFormat",
315
- "targetFormat",
316
- "valid",
317
- "summary",
318
- "diagnostics"
319
- ]) || value.version !== DOCBLOCKS_MCP_WIRE_VERSION || value.kind !== "validation" || !isFormat(value.sourceFormat) || !(value.targetFormat === null || isFormat(value.targetFormat)) || typeof value.valid !== "boolean") {
320
- return null;
321
- }
322
- const summary = parseValidationSummary(value.summary);
323
- const diagnostics = parseArray(value.diagnostics, parseMcpDiagnostic);
324
- if (summary === null || diagnostics === null) return null;
325
- const actualSummary = summarizeDiagnostics(diagnostics);
326
- if (summary.errorCount !== actualSummary.errorCount || summary.warningCount !== actualSummary.warningCount || summary.infoCount !== actualSummary.infoCount || value.valid !== (summary.errorCount === 0)) {
327
- return null;
328
- }
329
- return {
330
- version: DOCBLOCKS_MCP_WIRE_VERSION,
331
- kind: "validation",
332
- sourceFormat: value.sourceFormat,
333
- targetFormat: value.targetFormat,
334
- valid: value.valid,
335
- summary,
336
- diagnostics
337
- };
338
- }
339
309
  function parsePreviewResult(value) {
340
310
  if (!isRecord(value) || !hasExactKeys(value, [
341
311
  "version",
@@ -595,16 +565,6 @@ function parseThemeSummary(value) {
595
565
  if (layouts === null || new Set(layouts).size !== layouts.length) return null;
596
566
  return { id: value.id, name: value.name, source: value.source, layouts };
597
567
  }
598
- function parseValidationSummary(value) {
599
- if (!isRecord(value) || !hasExactKeys(value, ["errorCount", "warningCount", "infoCount"]) || !isNonNegativeInteger(value.errorCount) || !isNonNegativeInteger(value.warningCount) || !isNonNegativeInteger(value.infoCount)) {
600
- return null;
601
- }
602
- return {
603
- errorCount: value.errorCount,
604
- warningCount: value.warningCount,
605
- infoCount: value.infoCount
606
- };
607
- }
608
568
  function parsePreviewItem(value) {
609
569
  if (!isRecord(value) || !hasExactKeys(value, ["kind", "index", "label", "artifact", "width", "height"]) || !isPreviewItemKind(value.kind) || !isNonNegativeInteger(value.index) || !isNullableBoundedString(value.label, MCP_WIRE_LIMITS.labelCharacters) || !isBoundedInteger(value.width, 1, MCP_WIRE_LIMITS.imageDimension) || !isBoundedInteger(value.height, 1, MCP_WIRE_LIMITS.imageDimension)) {
610
570
  return null;
@@ -642,17 +602,6 @@ function parseComparisonMetric(value) {
642
602
  similarity: value.similarity
643
603
  };
644
604
  }
645
- function summarizeDiagnostics(diagnostics) {
646
- let errorCount = 0;
647
- let warningCount = 0;
648
- let infoCount = 0;
649
- for (const diagnostic of diagnostics) {
650
- if (diagnostic.severity === "error") errorCount += diagnostic.count;
651
- else if (diagnostic.severity === "warning") warningCount += diagnostic.count;
652
- else infoCount += diagnostic.count;
653
- }
654
- return { errorCount, warningCount, infoCount };
655
- }
656
605
  function parseArray(value, parser, maximumEntries = MCP_WIRE_LIMITS.arrayEntries) {
657
606
  if (!Array.isArray(value) || value.length > maximumEntries) return null;
658
607
  const parsed = [];
@@ -729,7 +678,7 @@ function isDiagnosticSeverity(value) {
729
678
  return value === "info" || value === "warning" || value === "error";
730
679
  }
731
680
  function isDiagnosticStage(value) {
732
- return value === "resolve" || value === "import" || value === "parse" || value === "inspect" || value === "validate" || value === "transform" || value === "convert" || value === "render" || value === "export" || value === "materialize" || value === "compare";
681
+ return value === "resolve" || value === "import" || value === "parse" || value === "inspect" || value === "transform" || value === "convert" || value === "render" || value === "export" || value === "materialize" || value === "compare";
733
682
  }
734
683
  function isConversionFidelity(value) {
735
684
  return value === "semantic" || value === "editable-native" || value === "rendered-fidelity" || value === "hybrid";
@@ -804,7 +753,6 @@ export {
804
753
  parseMcpErrorResult,
805
754
  parseConversionResult,
806
755
  parseInspectionResult,
807
- parseValidationResult,
808
756
  parsePreviewResult,
809
757
  parseComparisonResult,
810
758
  parseMaterializationOptions
@@ -834,7 +834,7 @@ var FileSystemContentContainer = class {
834
834
  const childPath = parseWorkspacePath(child.path);
835
835
  const prefixPath = parseWorkspacePath(this.prefix);
836
836
  if (!workspacePathContains(prefixPath, childPath)) continue;
837
- const rel = childPath === prefixPath ? "" : childPath.slice(prefixPath.length + 1);
837
+ const rel = prefixPath ? childPath === prefixPath ? "" : childPath.slice(prefixPath.length + 1) : childPath;
838
838
  if (prefix && !rel.startsWith(prefix)) continue;
839
839
  const size = child.size ?? (await this.provider.stat(child.path))?.size ?? 0;
840
840
  entries.push({
@@ -1,4 +1,4 @@
1
- import { q as FileSystemProvider } from '../types-BEg5SQ1_.js';
1
+ import { q as FileSystemProvider } from '../types-Bb3yccTH.js';
2
2
  import '../workspace-path-CWVrcuPL.js';
3
3
 
4
4
  /**
@@ -1,7 +1,7 @@
1
- import { s as FileSystemProviderV2, r as FileSystemProviderCapabilities, k as FileSystemEntrySnapshot, m as FileSystemFileRead, K as FileSystemWriteOptions, n as FileSystemFileSnapshot, g as FileSystemCreateDirectoryOptions, h as FileSystemDirectorySnapshot, u as FileSystemRemoveOptions, v as FileSystemRemoveResult, o as FileSystemMoveOptions, w as FileSystemSnapshot, C as FileSystemWatchEvent, H as FileSystemWatchOptions, I as FileSystemWatchSubscription, q as FileSystemProvider, F as FileCommitResult, j as FileSystemEntry, b as FileMeta } from '../types-BEg5SQ1_.js';
1
+ import { s as FileSystemProviderV2, r as FileSystemProviderCapabilities, k as FileSystemEntrySnapshot, m as FileSystemFileRead, K as FileSystemWriteOptions, n as FileSystemFileSnapshot, g as FileSystemCreateDirectoryOptions, h as FileSystemDirectorySnapshot, u as FileSystemRemoveOptions, v as FileSystemRemoveResult, o as FileSystemMoveOptions, w as FileSystemSnapshot, C as FileSystemWatchEvent, H as FileSystemWatchOptions, I as FileSystemWatchSubscription, q as FileSystemProvider, F as FileCommitResult, j as FileSystemEntry, b as FileMeta } from '../types-Bb3yccTH.js';
2
2
  import { a as WorkspacePath } from '../workspace-path-CWVrcuPL.js';
3
3
  export { isElectronHost } from '../host/index.js';
4
- import '../types-Cv4uiosG.js';
4
+ import '../types-CREx02sE.js';
5
5
 
6
6
  /** Pure renderer-side client for the typed Electron filesystem v2 transport. */
7
7
  declare class ElectronFileSystemProviderV2 implements FileSystemProviderV2 {
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  isElectronHost
7
7
  } from "../chunk-6XHOOBYF.js";
8
- import "../chunk-M2PUNKHS.js";
8
+ import "../chunk-2WDJ27EH.js";
9
9
  import "../chunk-73OOROXH.js";
10
10
  import "../chunk-M62ZGJ5I.js";
11
11
  import "../chunk-AYWKIZLD.js";
@@ -1,5 +1,5 @@
1
- import { P as FsOperation, s as FileSystemProviderV2, r as FileSystemProviderCapabilities, q as FileSystemProvider, c as FileSystemAtomicity, d as FileSystemCaseSensitivity, z as FileSystemSymlinkPolicy, i as FileSystemDurability, k as FileSystemEntrySnapshot, m as FileSystemFileRead, K as FileSystemWriteOptions, n as FileSystemFileSnapshot, g as FileSystemCreateDirectoryOptions, h as FileSystemDirectorySnapshot, u as FileSystemRemoveOptions, v as FileSystemRemoveResult, o as FileSystemMoveOptions, w as FileSystemSnapshot, G as FileSystemWatchListener, H as FileSystemWatchOptions, I as FileSystemWatchSubscription } from '../types-BEg5SQ1_.js';
2
- export { F as FileCommitResult, a as FileEntry, b as FileMeta, e as FileSystemConditionalWriteStrength, f as FileSystemCreateDirectoryMode, j as FileSystemEntry, l as FileSystemEntryWatchEvent, p as FileSystemOverflowWatchEvent, t as FileSystemProviderWithV2, x as FileSystemSnapshotEntry, y as FileSystemSnapshotFile, A as FileSystemVersion, B as FileSystemWatchErrorListener, C as FileSystemWatchEvent, D as FileSystemWatchEventOrigin, E as FileSystemWatchEventType, J as FileSystemWriteMode, L as FolderEntry, M as FsError, N as FsErrorCode, O as FsErrorContext, S as SerializedFsError, Q as deserializeFsError, R as fsErrorFromUnknown, T as getFileSystemProviderV2, U as hasFileSystemProviderV2, V as isQuotaExceededError, W as isSerializedFsError, X as mapDomExceptionToFsErrorCode, Y as mapNodeErrorCodeToFsErrorCode, Z as parseFileSystemVersion, _ as serializeFsError, $ as tryParseFileSystemVersion } from '../types-BEg5SQ1_.js';
1
+ import { P as FsOperation, s as FileSystemProviderV2, r as FileSystemProviderCapabilities, q as FileSystemProvider, c as FileSystemAtomicity, d as FileSystemCaseSensitivity, z as FileSystemSymlinkPolicy, i as FileSystemDurability, k as FileSystemEntrySnapshot, m as FileSystemFileRead, K as FileSystemWriteOptions, n as FileSystemFileSnapshot, g as FileSystemCreateDirectoryOptions, h as FileSystemDirectorySnapshot, u as FileSystemRemoveOptions, v as FileSystemRemoveResult, o as FileSystemMoveOptions, w as FileSystemSnapshot, G as FileSystemWatchListener, H as FileSystemWatchOptions, I as FileSystemWatchSubscription } from '../types-Bb3yccTH.js';
2
+ export { F as FileCommitResult, a as FileEntry, b as FileMeta, e as FileSystemConditionalWriteStrength, f as FileSystemCreateDirectoryMode, j as FileSystemEntry, l as FileSystemEntryWatchEvent, p as FileSystemOverflowWatchEvent, t as FileSystemProviderWithV2, x as FileSystemSnapshotEntry, y as FileSystemSnapshotFile, A as FileSystemVersion, B as FileSystemWatchErrorListener, C as FileSystemWatchEvent, D as FileSystemWatchEventOrigin, E as FileSystemWatchEventType, J as FileSystemWriteMode, L as FolderEntry, M as FsError, N as FsErrorCode, O as FsErrorContext, S as SerializedFsError, Q as deserializeFsError, R as fsErrorFromUnknown, T as getFileSystemProviderV2, U as hasFileSystemProviderV2, V as isQuotaExceededError, W as isSerializedFsError, X as mapDomExceptionToFsErrorCode, Y as mapNodeErrorCodeToFsErrorCode, Z as parseFileSystemVersion, _ as serializeFsError, $ as tryParseFileSystemVersion } from '../types-Bb3yccTH.js';
3
3
  import { a as WorkspacePath } from '../workspace-path-CWVrcuPL.js';
4
4
  export { W as WORKSPACE_ROOT, p as parseWorkspacePath, t as tryParseWorkspacePath, w as workspacePathBasename, b as workspacePathContains, c as workspacePathDirname, d as workspacePathJoin, e as workspacePathToLegacy } from '../workspace-path-CWVrcuPL.js';
5
5
  import { MemoryFileSystemSnapshot, MemoryFileSystemProvider } from './memory.js';
@@ -10,7 +10,7 @@ import { MediaProvider } from '@bendyline/squisq/schemas';
10
10
  export { NativeFileSystemMovePathState, NativeFileSystemMoveRecoveryError, NativeFileSystemMoveRecoveryState, NativeFileSystemProvider, NativeFileSystemProviderV2, isNativeFileSystemSupported, loadDirectoryHandle, openNativeFolder, removeDirectoryHandle, restoreNativeFolder, storeDirectoryHandle } from './native.js';
11
11
  export { ElectronFileSystemProvider, ElectronFileSystemProviderV2 } from './electron.js';
12
12
  export { isElectronHost } from '../host/index.js';
13
- import '../types-Cv4uiosG.js';
13
+ import '../types-CREx02sE.js';
14
14
 
15
15
  interface DecodeUtf8TextOptions {
16
16
  /** User-facing description of the payload being decoded. */
@@ -6,7 +6,7 @@ import {
6
6
  documentCompanionPath,
7
7
  moveFileSystemEntry,
8
8
  replaceMemoryWorkspaceFromDbk
9
- } from "../chunk-45T5AFCN.js";
9
+ } from "../chunk-MO2VYEZQ.js";
10
10
  import {
11
11
  IndexedDBContentContainer,
12
12
  IndexedDBFileSystemProvider,
@@ -36,7 +36,7 @@ import {
36
36
  import {
37
37
  isElectronHost
38
38
  } from "../chunk-6XHOOBYF.js";
39
- import "../chunk-M2PUNKHS.js";
39
+ import "../chunk-2WDJ27EH.js";
40
40
  import "../chunk-73OOROXH.js";
41
41
  import {
42
42
  parseFileSystemVersion,
@@ -1,4 +1,4 @@
1
- import { s as FileSystemProviderV2, r as FileSystemProviderCapabilities, k as FileSystemEntrySnapshot, m as FileSystemFileRead, K as FileSystemWriteOptions, n as FileSystemFileSnapshot, g as FileSystemCreateDirectoryOptions, h as FileSystemDirectorySnapshot, u as FileSystemRemoveOptions, v as FileSystemRemoveResult, o as FileSystemMoveOptions, w as FileSystemSnapshot, G as FileSystemWatchListener, H as FileSystemWatchOptions, I as FileSystemWatchSubscription, b as FileMeta, q as FileSystemProvider, F as FileCommitResult, j as FileSystemEntry } from '../types-BEg5SQ1_.js';
1
+ import { s as FileSystemProviderV2, r as FileSystemProviderCapabilities, k as FileSystemEntrySnapshot, m as FileSystemFileRead, K as FileSystemWriteOptions, n as FileSystemFileSnapshot, g as FileSystemCreateDirectoryOptions, h as FileSystemDirectorySnapshot, u as FileSystemRemoveOptions, v as FileSystemRemoveResult, o as FileSystemMoveOptions, w as FileSystemSnapshot, G as FileSystemWatchListener, H as FileSystemWatchOptions, I as FileSystemWatchSubscription, b as FileMeta, q as FileSystemProvider, F as FileCommitResult, j as FileSystemEntry } from '../types-Bb3yccTH.js';
2
2
  import { a as WorkspacePath } from '../workspace-path-CWVrcuPL.js';
3
3
  import { ContentContainer, ContentEntry } from '@bendyline/squisq/storage';
4
4
 
@@ -1,4 +1,4 @@
1
- import { s as FileSystemProviderV2, r as FileSystemProviderCapabilities, K as FileSystemWriteOptions, n as FileSystemFileSnapshot, F as FileCommitResult, k as FileSystemEntrySnapshot, m as FileSystemFileRead, g as FileSystemCreateDirectoryOptions, h as FileSystemDirectorySnapshot, u as FileSystemRemoveOptions, v as FileSystemRemoveResult, o as FileSystemMoveOptions, w as FileSystemSnapshot, G as FileSystemWatchListener, H as FileSystemWatchOptions, I as FileSystemWatchSubscription, q as FileSystemProvider, j as FileSystemEntry, b as FileMeta } from '../types-BEg5SQ1_.js';
1
+ import { s as FileSystemProviderV2, r as FileSystemProviderCapabilities, K as FileSystemWriteOptions, n as FileSystemFileSnapshot, F as FileCommitResult, k as FileSystemEntrySnapshot, m as FileSystemFileRead, g as FileSystemCreateDirectoryOptions, h as FileSystemDirectorySnapshot, u as FileSystemRemoveOptions, v as FileSystemRemoveResult, o as FileSystemMoveOptions, w as FileSystemSnapshot, G as FileSystemWatchListener, H as FileSystemWatchOptions, I as FileSystemWatchSubscription, q as FileSystemProvider, j as FileSystemEntry, b as FileMeta } from '../types-Bb3yccTH.js';
2
2
  import { a as WorkspacePath } from '../workspace-path-CWVrcuPL.js';
3
3
 
4
4
  type MemoryFilePayloadKind = 'text' | 'binary';
@@ -1,4 +1,4 @@
1
- import { M as FsError, s as FileSystemProviderV2, r as FileSystemProviderCapabilities, k as FileSystemEntrySnapshot, m as FileSystemFileRead, K as FileSystemWriteOptions, n as FileSystemFileSnapshot, g as FileSystemCreateDirectoryOptions, h as FileSystemDirectorySnapshot, u as FileSystemRemoveOptions, v as FileSystemRemoveResult, o as FileSystemMoveOptions, w as FileSystemSnapshot, G as FileSystemWatchListener, H as FileSystemWatchOptions, I as FileSystemWatchSubscription, q as FileSystemProvider, F as FileCommitResult, j as FileSystemEntry, b as FileMeta } from '../types-BEg5SQ1_.js';
1
+ import { M as FsError, s as FileSystemProviderV2, r as FileSystemProviderCapabilities, k as FileSystemEntrySnapshot, m as FileSystemFileRead, K as FileSystemWriteOptions, n as FileSystemFileSnapshot, g as FileSystemCreateDirectoryOptions, h as FileSystemDirectorySnapshot, u as FileSystemRemoveOptions, v as FileSystemRemoveResult, o as FileSystemMoveOptions, w as FileSystemSnapshot, G as FileSystemWatchListener, H as FileSystemWatchOptions, I as FileSystemWatchSubscription, q as FileSystemProvider, F as FileCommitResult, j as FileSystemEntry, b as FileMeta } from '../types-Bb3yccTH.js';
2
2
  import { a as WorkspacePath } from '../workspace-path-CWVrcuPL.js';
3
3
 
4
4
  type NativeFileSystemMovePathState = 'present' | 'missing' | 'unknown';
@@ -1,8 +1,10 @@
1
- import { O as OpenRequest, D as DocBlocksHostAPI } from '../types-Cv4uiosG.js';
2
- export { a as DocBlocksHostExportAPI, b as DocBlocksHostExternalAPI, c as DocBlocksHostFfmpegAPI, d as DocBlocksHostFsAPI, e as DocBlocksHostFsV2API, f as DocBlocksHostGitAPI, g as DocBlocksHostLifecycleAPI, h as DocBlocksHostShellAPI, i as DocBlocksHostUpdaterAPI, j as DocBlocksHostWorkspacesAPI, E as ELECTRON_FILE_SYSTEM_V2_CAPABILITIES, k as ElectronWorkspaceInfo, l as ExternalBinaryCommitResult, G as GitBranchInfo, m as GitCapabilities, n as GitCloneHandle, o as GitCloneProgress, p as GitError, q as GitErrorCode, r as GitFileAtRevision, s as GitFileChange, t as GitFileStatusCode, u as GitLogEntry, v as GitLogOptions, w as GitRemoteInfo, x as GitRepoDetection, y as GitResult, z as GitRevision, A as GitStatus, H as HostCloseReason, B as HostEnvironment, C as HostExportTargetGrant, F as HostFileSystemV2OpenRequest, I as HostFileSystemV2Result, J as HostFileSystemV2WatchMessage, K as HostPrepareCloseRequest, L as HostPrepareCloseResult, M as MenuCommand, U as UpdateCheckResult, N as UpdateInstallResult, P as UpdaterStatus } from '../types-Cv4uiosG.js';
3
- import '../types-BEg5SQ1_.js';
1
+ import { P as OpenRequest, L as HostPinnedDocument, D as DocBlocksHostAPI } from '../types-CREx02sE.js';
2
+ export { a as DocBlocksHostExportAPI, b as DocBlocksHostExternalAPI, c as DocBlocksHostFfmpegAPI, d as DocBlocksHostFsAPI, e as DocBlocksHostFsV2API, f as DocBlocksHostGitAPI, g as DocBlocksHostLifecycleAPI, h as DocBlocksHostMenuAPI, i as DocBlocksHostShellAPI, j as DocBlocksHostUpdaterAPI, k as DocBlocksHostWorkspacesAPI, E as ELECTRON_FILE_SYSTEM_V2_CAPABILITIES, l as ElectronWorkspaceInfo, m as ExternalBinaryCommitResult, G as GitBranchInfo, n as GitCapabilities, o as GitCloneHandle, p as GitCloneProgress, q as GitError, r as GitErrorCode, s as GitFileAtRevision, t as GitFileChange, u as GitFileStatusCode, v as GitLogEntry, w as GitLogOptions, x as GitRemoteInfo, y as GitRepoDetection, z as GitResult, A as GitRevision, B as GitStatus, H as HostCloseReason, C as HostEnvironment, F as HostExportTargetGrant, I as HostFileSystemV2OpenRequest, J as HostFileSystemV2Result, K as HostFileSystemV2WatchMessage, M as HostPrepareCloseRequest, N as HostPrepareCloseResult, O as MenuCommand, U as UpdateCheckResult, Q as UpdateInstallResult, R as UpdaterStatus } from '../types-CREx02sE.js';
3
+ import '../types-Bb3yccTH.js';
4
4
  import '../workspace-path-CWVrcuPL.js';
5
5
 
6
+ /** Upper bound on shortcuts mirrored into the native menu, to keep it usable. */
7
+ declare const MAX_HOST_PINNED_DOCUMENTS = 50;
6
8
  /** Quantitative limits shared by privileged host boundaries. */
7
9
  declare const HOST_WIRE_LIMITS: Readonly<{
8
10
  identifierCharacters: 256;
@@ -19,6 +21,12 @@ declare function isBoundedString(value: unknown, maximumCharacters: number, mini
19
21
  declare function isBoundedBytePayload(value: unknown, maximumBytes?: number): value is ArrayBuffer | Uint8Array;
20
22
  /** Parse one exact, bounded main-to-renderer open request. */
21
23
  declare function parseOpenRequest(value: unknown): OpenRequest | null;
24
+ /**
25
+ * Validate a renderer-published pinned-document list before the main process
26
+ * builds native menu items from it. Renderer input is untrusted: drop any
27
+ * malformed, oversized, or duplicate entries and cap the total.
28
+ */
29
+ declare function parsePinnedMenuDocuments(value: unknown): HostPinnedDocument[];
22
30
  /** Return one canonical HTTP(S) URL, or null when external navigation is unsafe. */
23
31
  declare function parseExternalHttpUrl(value: unknown): string | null;
24
32
  /** True only for the packaged renderer origin or the exact configured dev origin. */
@@ -37,4 +45,4 @@ declare function getDocBlocksHost(): DocBlocksHostAPI;
37
45
  /** Return the host API, or null if not running under Electron. */
38
46
  declare function maybeGetDocBlocksHost(): DocBlocksHostAPI | null;
39
47
 
40
- export { DocBlocksHostAPI, HOST_WIRE_LIMITS, OpenRequest, getDocBlocksHost, isBoundedBytePayload, isBoundedString, isElectronHost, isTrustedRendererUrl, maybeGetDocBlocksHost, parseExternalHttpUrl, parseOpenRequest };
48
+ export { DocBlocksHostAPI, HOST_WIRE_LIMITS, HostPinnedDocument, MAX_HOST_PINNED_DOCUMENTS, OpenRequest, getDocBlocksHost, isBoundedBytePayload, isBoundedString, isElectronHost, isTrustedRendererUrl, maybeGetDocBlocksHost, parseExternalHttpUrl, parseOpenRequest, parsePinnedMenuDocuments };
@@ -6,15 +6,18 @@ import {
6
6
  } from "../chunk-6XHOOBYF.js";
7
7
  import {
8
8
  HOST_WIRE_LIMITS,
9
+ MAX_HOST_PINNED_DOCUMENTS,
9
10
  isBoundedBytePayload,
10
11
  isBoundedString,
11
12
  isTrustedRendererUrl,
12
13
  parseExternalHttpUrl,
13
- parseOpenRequest
14
- } from "../chunk-M2PUNKHS.js";
14
+ parseOpenRequest,
15
+ parsePinnedMenuDocuments
16
+ } from "../chunk-2WDJ27EH.js";
15
17
  export {
16
18
  ELECTRON_FILE_SYSTEM_V2_CAPABILITIES,
17
19
  HOST_WIRE_LIMITS,
20
+ MAX_HOST_PINNED_DOCUMENTS,
18
21
  getDocBlocksHost,
19
22
  isBoundedBytePayload,
20
23
  isBoundedString,
@@ -22,5 +25,6 @@ export {
22
25
  isTrustedRendererUrl,
23
26
  maybeGetDocBlocksHost,
24
27
  parseExternalHttpUrl,
25
- parseOpenRequest
28
+ parseOpenRequest,
29
+ parsePinnedMenuDocuments
26
30
  };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { F as FileCommitResult, a as FileEntry, b as FileMeta, c as FileSystemAtomicity, d as FileSystemCaseSensitivity, e as FileSystemConditionalWriteStrength, f as FileSystemCreateDirectoryMode, g as FileSystemCreateDirectoryOptions, h as FileSystemDirectorySnapshot, i as FileSystemDurability, j as FileSystemEntry, k as FileSystemEntrySnapshot, l as FileSystemEntryWatchEvent, m as FileSystemFileRead, n as FileSystemFileSnapshot, o as FileSystemMoveOptions, p as FileSystemOverflowWatchEvent, q as FileSystemProvider, r as FileSystemProviderCapabilities, s as FileSystemProviderV2, t as FileSystemProviderWithV2, u as FileSystemRemoveOptions, v as FileSystemRemoveResult, w as FileSystemSnapshot, x as FileSystemSnapshotEntry, y as FileSystemSnapshotFile, z as FileSystemSymlinkPolicy, A as FileSystemVersion, B as FileSystemWatchErrorListener, C as FileSystemWatchEvent, D as FileSystemWatchEventOrigin, E as FileSystemWatchEventType, G as FileSystemWatchListener, H as FileSystemWatchOptions, I as FileSystemWatchSubscription, J as FileSystemWriteMode, K as FileSystemWriteOptions, L as FolderEntry, M as FsError, N as FsErrorCode, O as FsErrorContext, P as FsOperation, S as SerializedFsError, Q as deserializeFsError, R as fsErrorFromUnknown, T as getFileSystemProviderV2, U as hasFileSystemProviderV2, V as isQuotaExceededError, W as isSerializedFsError, X as mapDomExceptionToFsErrorCode, Y as mapNodeErrorCodeToFsErrorCode, Z as parseFileSystemVersion, _ as serializeFsError, $ as tryParseFileSystemVersion } from './types-BEg5SQ1_.js';
1
+ export { F as FileCommitResult, a as FileEntry, b as FileMeta, c as FileSystemAtomicity, d as FileSystemCaseSensitivity, e as FileSystemConditionalWriteStrength, f as FileSystemCreateDirectoryMode, g as FileSystemCreateDirectoryOptions, h as FileSystemDirectorySnapshot, i as FileSystemDurability, j as FileSystemEntry, k as FileSystemEntrySnapshot, l as FileSystemEntryWatchEvent, m as FileSystemFileRead, n as FileSystemFileSnapshot, o as FileSystemMoveOptions, p as FileSystemOverflowWatchEvent, q as FileSystemProvider, r as FileSystemProviderCapabilities, s as FileSystemProviderV2, t as FileSystemProviderWithV2, u as FileSystemRemoveOptions, v as FileSystemRemoveResult, w as FileSystemSnapshot, x as FileSystemSnapshotEntry, y as FileSystemSnapshotFile, z as FileSystemSymlinkPolicy, A as FileSystemVersion, B as FileSystemWatchErrorListener, C as FileSystemWatchEvent, D as FileSystemWatchEventOrigin, E as FileSystemWatchEventType, G as FileSystemWatchListener, H as FileSystemWatchOptions, I as FileSystemWatchSubscription, J as FileSystemWriteMode, K as FileSystemWriteOptions, L as FolderEntry, M as FsError, N as FsErrorCode, O as FsErrorContext, P as FsOperation, S as SerializedFsError, Q as deserializeFsError, R as fsErrorFromUnknown, T as getFileSystemProviderV2, U as hasFileSystemProviderV2, V as isQuotaExceededError, W as isSerializedFsError, X as mapDomExceptionToFsErrorCode, Y as mapNodeErrorCodeToFsErrorCode, Z as parseFileSystemVersion, _ as serializeFsError, $ as tryParseFileSystemVersion } from './types-Bb3yccTH.js';
2
2
  export { W as WORKSPACE_ROOT, a as WorkspacePath, p as parseWorkspacePath, t as tryParseWorkspacePath, w as workspacePathBasename, b as workspacePathContains, c as workspacePathDirname, d as workspacePathJoin, e as workspacePathToLegacy } from './workspace-path-CWVrcuPL.js';
3
3
  export { DbkWorkspaceAssetLayout, DbkWorkspaceSnapshot, DbkWorkspaceSnapshotOptions, DecodeUtf8TextOptions, FileSystemContentContainer, FileSystemEntryMoveState, FileSystemMoveLocation, FileSystemMoveRecoveryError, FileSystemPartialMoveError, FileSystemPartialMoveState, FileSystemPathPresence, LegacyFilePayloadModel, LegacyFileSystemProviderV2Adapter, LegacyFileSystemProviderV2AdapterOptions, createDbkWorkspaceSnapshot, createFileMediaProvider, decodeUtf8Text, describeEntryMove, describePartialMove, documentCompanionPath, isFileSystemMoveRecoveryError, isFileSystemMoveStateError, isFileSystemPartialMoveError, moveFileSystemEntry, replaceMemoryWorkspaceFromDbk } from './filesystem/index.js';
4
4
  export { MemoryFilePayloadKind, MemoryFileSystemProvider, MemoryFileSystemProviderV2, MemoryFileSystemSnapshot, MemoryFileSystemSnapshotFile, MemoryFileSystemV2CompatibilityFile, MemoryFileSystemV2Replacement, MemoryFileSystemV2ReplacementFile, MemoryFileSystemV2State, MemoryFileSystemV2StateFile } from './filesystem/memory.js';
@@ -7,8 +7,8 @@ export { NativeFileSystemMovePathState, NativeFileSystemMoveRecoveryError, Nativ
7
7
  export { ElectronFileSystemProvider, ElectronFileSystemProviderV2 } from './filesystem/electron.js';
8
8
  export { DOCUMENT_RECOVERY_JOURNAL_SCHEMA_VERSION, DOCUMENT_RECOVERY_JOURNAL_STORAGE_KEY, DocumentCommitConflictError, DocumentCommitRequest, DocumentCommitResult, DocumentCommitTarget, DocumentConflictStrategy, DocumentExternalChangeResult, DocumentExternalSnapshot, DocumentExternalVersion, DocumentRecoveryAcknowledgement, DocumentRecoveryJournal, DocumentRecoveryJournalOptions, DocumentRecoveryRecord, DocumentRecoveryStorage, DocumentRecoveryWrite, DocumentRecoveryWriteFailure, DocumentRecoveryWriteResult, DocumentSaveReason, DocumentSession, DocumentSessionConflict, DocumentSessionConflictError, DocumentSessionEditScope, DocumentSessionLifecycle, DocumentSessionOptions, DocumentSessionSnapshot, DocumentSessionStatus, DocumentSessionTransition, FileSystemDocumentTargetOptions, createFileSystemDocumentTarget, getDefaultDocumentRecoveryStorage } from './document/index.js';
9
9
  export { ElectronWorkspaceReconciliation, TransientOrigin, WorkspaceDescriptor, ensureDefaultWorkspace, getTransientWorkspace, getWorkspace, listWorkspaces, parsePersistedWorkspaceList, reconcileElectronWorkspaceDescriptors, registerTransientWorkspace, removeWorkspace, saveWorkspace, touchWorkspace, unregisterTransientWorkspace } from './workspace/index.js';
10
- export { HOST_WIRE_LIMITS, getDocBlocksHost, isBoundedBytePayload, isBoundedString, isElectronHost, isTrustedRendererUrl, maybeGetDocBlocksHost, parseExternalHttpUrl, parseOpenRequest } from './host/index.js';
10
+ export { HOST_WIRE_LIMITS, MAX_HOST_PINNED_DOCUMENTS, getDocBlocksHost, isBoundedBytePayload, isBoundedString, isElectronHost, isTrustedRendererUrl, maybeGetDocBlocksHost, parseExternalHttpUrl, parseOpenRequest, parsePinnedMenuDocuments } from './host/index.js';
11
11
  export { SHARED_DOCUMENT_LIMITS, SharedDocumentHashParseResult, SharedDocumentMode, SharedDocumentPayload, createSharedDocumentHash, createSharedDocumentUrl, parseSharedDocumentHash } from './share/index.js';
12
- export { D as DocBlocksHostAPI, a as DocBlocksHostExportAPI, b as DocBlocksHostExternalAPI, c as DocBlocksHostFfmpegAPI, d as DocBlocksHostFsAPI, e as DocBlocksHostFsV2API, f as DocBlocksHostGitAPI, g as DocBlocksHostLifecycleAPI, h as DocBlocksHostShellAPI, i as DocBlocksHostUpdaterAPI, j as DocBlocksHostWorkspacesAPI, E as ELECTRON_FILE_SYSTEM_V2_CAPABILITIES, k as ElectronWorkspaceInfo, l as ExternalBinaryCommitResult, G as GitBranchInfo, m as GitCapabilities, n as GitCloneHandle, o as GitCloneProgress, p as GitError, q as GitErrorCode, r as GitFileAtRevision, s as GitFileChange, t as GitFileStatusCode, u as GitLogEntry, v as GitLogOptions, w as GitRemoteInfo, x as GitRepoDetection, y as GitResult, z as GitRevision, A as GitStatus, H as HostCloseReason, B as HostEnvironment, C as HostExportTargetGrant, F as HostFileSystemV2OpenRequest, I as HostFileSystemV2Result, J as HostFileSystemV2WatchMessage, K as HostPrepareCloseRequest, L as HostPrepareCloseResult, M as MenuCommand, O as OpenRequest, U as UpdateCheckResult, N as UpdateInstallResult, P as UpdaterStatus } from './types-Cv4uiosG.js';
12
+ export { D as DocBlocksHostAPI, a as DocBlocksHostExportAPI, b as DocBlocksHostExternalAPI, c as DocBlocksHostFfmpegAPI, d as DocBlocksHostFsAPI, e as DocBlocksHostFsV2API, f as DocBlocksHostGitAPI, g as DocBlocksHostLifecycleAPI, h as DocBlocksHostMenuAPI, i as DocBlocksHostShellAPI, j as DocBlocksHostUpdaterAPI, k as DocBlocksHostWorkspacesAPI, E as ELECTRON_FILE_SYSTEM_V2_CAPABILITIES, l as ElectronWorkspaceInfo, m as ExternalBinaryCommitResult, G as GitBranchInfo, n as GitCapabilities, o as GitCloneHandle, p as GitCloneProgress, q as GitError, r as GitErrorCode, s as GitFileAtRevision, t as GitFileChange, u as GitFileStatusCode, v as GitLogEntry, w as GitLogOptions, x as GitRemoteInfo, y as GitRepoDetection, z as GitResult, A as GitRevision, B as GitStatus, H as HostCloseReason, C as HostEnvironment, F as HostExportTargetGrant, I as HostFileSystemV2OpenRequest, J as HostFileSystemV2Result, K as HostFileSystemV2WatchMessage, L as HostPinnedDocument, M as HostPrepareCloseRequest, N as HostPrepareCloseResult, O as MenuCommand, P as OpenRequest, U as UpdateCheckResult, Q as UpdateInstallResult, R as UpdaterStatus } from './types-CREx02sE.js';
13
13
  import '@bendyline/squisq/storage';
14
14
  import '@bendyline/squisq/schemas';
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  documentCompanionPath,
13
13
  moveFileSystemEntry,
14
14
  replaceMemoryWorkspaceFromDbk
15
- } from "./chunk-45T5AFCN.js";
15
+ } from "./chunk-MO2VYEZQ.js";
16
16
  import {
17
17
  IndexedDBContentContainer,
18
18
  IndexedDBFileSystemProvider,
@@ -47,12 +47,14 @@ import {
47
47
  } from "./chunk-6XHOOBYF.js";
48
48
  import {
49
49
  HOST_WIRE_LIMITS,
50
+ MAX_HOST_PINNED_DOCUMENTS,
50
51
  isBoundedBytePayload,
51
52
  isBoundedString,
52
53
  isTrustedRendererUrl,
53
54
  parseExternalHttpUrl,
54
- parseOpenRequest
55
- } from "./chunk-M2PUNKHS.js";
55
+ parseOpenRequest,
56
+ parsePinnedMenuDocuments
57
+ } from "./chunk-2WDJ27EH.js";
56
58
  import "./chunk-73OOROXH.js";
57
59
  import {
58
60
  parseFileSystemVersion,
@@ -135,6 +137,7 @@ export {
135
137
  IndexedDBFileSystemProvider,
136
138
  IndexedDBFileSystemProviderV2,
137
139
  LegacyFileSystemProviderV2Adapter,
140
+ MAX_HOST_PINNED_DOCUMENTS,
138
141
  MemoryFileSystemProvider,
139
142
  MemoryFileSystemProviderV2,
140
143
  NativeFileSystemMoveRecoveryError,
@@ -181,6 +184,7 @@ export {
181
184
  parseFileSystemVersion,
182
185
  parseOpenRequest,
183
186
  parsePersistedWorkspaceList,
187
+ parsePinnedMenuDocuments,
184
188
  parseSharedDocumentHash,
185
189
  parseWorkspacePath,
186
190
  reconcileElectronWorkspaceDescriptors,
@@ -1,5 +1,5 @@
1
- import { A as ArtifactRef, C as ComparisonResult, a as ConversionResult, D as DocumentSource, I as InspectionResult, M as MaterializationOptions, b as McpDiagnostic, c as McpErrorResult, P as PreviewResult, V as ValidationResult } from '../types-DkvEkg0I.js';
2
- export { d as AppliedOption, e as AppliedOptionValue, f as ApplyInferredThemeResult, g as ArtifactDocumentSource, h as AssetSummary, i as AuthoringContextResult, j as AuthoringGoal, k as AuthoringSyntaxSummary, l as AuthoringTemplateSummary, B as BlockSummary, m as BundleAssetContentSource, n as BundleAssetRef, o as BundleDocumentSource, p as ComparisonCategory, q as ComparisonChange, r as ComparisonMetric, s as ComparisonStatus, t as ConversionFidelity, u as ConvertDocumentResult, v as DOCBLOCKS_MCP_TOOL_NAMES, w as DOCBLOCKS_MCP_WIRE_VERSION, x as DescribeTemplateResult, y as DescribeThemeResult, z as DescribedTemplate, E as DiagnosticLocation, F as DiagnosticSeverity, G as DiagnosticStage, H as DocBlocksMcpToolName, J as DocBlocksMcpWireVersion, K as DocumentItemSummary, L as DocumentMetadataSummary, N as DocumentStatistics, O as EngineVersion, Q as FileDocumentSource, R as FormatCapabilitySummary, S as FormatDirectionCapability, T as InferThemeResult, U as InferredLayoutSummary, W as InspectPptxLayoutsResult, X as LinkSummary, Y as ListFormatsResult, Z as ListRootsResult, _ as ListTemplatesResult, $ as ListThemesResult, a0 as ListTransformStylesResult, a1 as MarkdownDocumentSource, a2 as McpErrorDetail, a3 as McpSuccessResult, a4 as OutlineEntry, a5 as PptxLayoutSummary, a6 as PptxSlideSize, a7 as PreviewItem, a8 as PreviewItemKind, a9 as RecommendTemplatesResult, aa as RootGrantSummary, ab as SaveArtifactResult, ac as SavedArtifactDestination, ad as SourceRange, ae as TableSummary, af as TemplateAuthoringRole, ag as TemplateBodyPolicy, ah as TemplateContentProfile, ai as TemplateInputSummary, aj as TemplateRecommendation, ak as TemplateSummary, al as ThemeCatalogEntry, am as ThemeDescription, an as ThemeDescriptionColors, ao as ThemeSummary, ap as TransformStyleSummary, aq as ValidationSummary } from '../types-DkvEkg0I.js';
1
+ import { A as ArtifactRef, C as ComparisonResult, a as ConversionResult, D as DocumentSource, I as InspectionResult, M as MaterializationOptions, b as McpDiagnostic, c as McpErrorResult, P as PreviewResult } from '../types-DapJIsC2.js';
2
+ export { d as AppliedOption, e as AppliedOptionValue, f as ApplyInferredThemeResult, g as ArtifactDocumentSource, h as AssetSummary, i as AuthoringContextResult, j as AuthoringGoal, k as AuthoringSyntaxSummary, l as AuthoringTemplateSummary, B as BlockSummary, m as BundleAssetContentSource, n as BundleAssetRef, o as BundleDocumentSource, p as ComparisonCategory, q as ComparisonChange, r as ComparisonMetric, s as ComparisonStatus, t as ConversionFidelity, u as ConvertDocumentResult, v as DOCBLOCKS_MCP_TOOL_NAMES, w as DOCBLOCKS_MCP_WIRE_VERSION, x as DescribeTemplateResult, y as DescribeThemeResult, z as DescribedTemplate, E as DiagnosticLocation, F as DiagnosticSeverity, G as DiagnosticStage, H as DocBlocksMcpToolName, J as DocBlocksMcpWireVersion, K as DocumentItemSummary, L as DocumentMetadataSummary, N as DocumentStatistics, O as EngineVersion, Q as FileDocumentSource, R as FormatCapabilitySummary, S as FormatDirectionCapability, T as InferThemeResult, U as InferredLayoutSummary, V as InspectPptxLayoutsResult, W as LinkSummary, X as ListFormatsResult, Y as ListRootsResult, Z as ListTemplatesResult, _ as ListThemesResult, $ as ListTransformStylesResult, a0 as MarkdownDocumentSource, a1 as McpErrorDetail, a2 as McpSuccessResult, a3 as OutlineEntry, a4 as PptxLayoutSummary, a5 as PptxSlideSize, a6 as PreviewItem, a7 as PreviewItemKind, a8 as RecommendTemplatesResult, a9 as RootGrantSummary, aa as SaveArtifactResult, ab as SavedArtifactDestination, ac as SourceRange, ad as TableSummary, ae as TemplateAuthoringRole, af as TemplateBodyPolicy, ag as TemplateContentProfile, ah as TemplateInputSummary, ai as TemplateRecommendation, aj as TemplateSummary, ak as ThemeCatalogEntry, al as ThemeDescription, am as ThemeDescriptionColors, an as ThemeSummary, ao as TransformStyleSummary } from '../types-DapJIsC2.js';
3
3
  import '../workspace-path-CWVrcuPL.js';
4
4
 
5
5
  /** Quantitative limits for untrusted MCP payloads. */
@@ -25,9 +25,8 @@ declare function parseMcpDiagnostic(value: unknown): McpDiagnostic | null;
25
25
  declare function parseMcpErrorResult(value: unknown): McpErrorResult | null;
26
26
  declare function parseConversionResult(value: unknown): ConversionResult | null;
27
27
  declare function parseInspectionResult(value: unknown): InspectionResult | null;
28
- declare function parseValidationResult(value: unknown): ValidationResult | null;
29
28
  declare function parsePreviewResult(value: unknown): PreviewResult | null;
30
29
  declare function parseComparisonResult(value: unknown): ComparisonResult | null;
31
30
  declare function parseMaterializationOptions(value: unknown): MaterializationOptions | null;
32
31
 
33
- export { ArtifactRef, ComparisonResult, ConversionResult, DocumentSource, InspectionResult, MCP_WIRE_LIMITS, MaterializationOptions, McpDiagnostic, McpErrorResult, PreviewResult, ValidationResult, parseArtifactRef, parseComparisonResult, parseConversionResult, parseDocumentSource, parseInspectionResult, parseMaterializationOptions, parseMcpDiagnostic, parseMcpErrorResult, parsePreviewResult, parseValidationResult };
32
+ export { ArtifactRef, ComparisonResult, ConversionResult, DocumentSource, InspectionResult, MCP_WIRE_LIMITS, MaterializationOptions, McpDiagnostic, McpErrorResult, PreviewResult, parseArtifactRef, parseComparisonResult, parseConversionResult, parseDocumentSource, parseInspectionResult, parseMaterializationOptions, parseMcpDiagnostic, parseMcpErrorResult, parsePreviewResult };
package/dist/mcp/index.js CHANGED
@@ -10,9 +10,8 @@ import {
10
10
  parseMaterializationOptions,
11
11
  parseMcpDiagnostic,
12
12
  parseMcpErrorResult,
13
- parsePreviewResult,
14
- parseValidationResult
15
- } from "../chunk-DBJW7BZI.js";
13
+ parsePreviewResult
14
+ } from "../chunk-EG3WGSZH.js";
16
15
  import "../chunk-AYWKIZLD.js";
17
16
  export {
18
17
  DOCBLOCKS_MCP_TOOL_NAMES,
@@ -26,6 +25,5 @@ export {
26
25
  parseMaterializationOptions,
27
26
  parseMcpDiagnostic,
28
27
  parseMcpErrorResult,
29
- parsePreviewResult,
30
- parseValidationResult
28
+ parsePreviewResult
31
29
  };