@bendyline/docblocks 2.4.0 → 2.6.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/THIRD_PARTY_NOTICES.txt +4 -4
- package/dist/{chunk-LMMOFRGQ.js → chunk-FBCGLK6N.js} +2 -0
- package/dist/{chunk-6L3JRDE7.js → chunk-KLQKU74Q.js} +20 -7
- package/dist/{chunk-EG3WGSZH.js → chunk-YWYT6K6J.js} +17 -3
- package/dist/document/index.d.ts +1 -0
- package/dist/document/index.js +1 -1
- package/dist/filesystem/electron.d.ts +1 -1
- package/dist/filesystem/index.d.ts +1 -1
- package/dist/host/index.d.ts +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/mcp/index.d.ts +2 -2
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/zod.d.ts +52 -6
- package/dist/mcp/zod.js +21 -3
- package/dist/share/index.d.ts +2 -0
- package/dist/share/index.js +1 -1
- package/dist/{types-D2CRLJB6.d.ts → types-DBYraXxE.d.ts} +26 -2
- package/dist/{types-DapJIsC2.d.ts → types-Oy9U5FST.d.ts} +9 -2
- package/dist/vscode/index.d.ts +52 -1
- package/dist/vscode/index.js +55 -2
- package/dist/workspace/index.d.ts +1 -1
- package/package.json +3 -3
package/THIRD_PARTY_NOTICES.txt
CHANGED
|
@@ -14,7 +14,7 @@ This notice is included in the published npm tarball. Transitive packages instal
|
|
|
14
14
|
|
|
15
15
|
| Package | Version | License | Source |
|
|
16
16
|
| --- | --- | --- | --- |
|
|
17
|
-
| @bendyline/squisq | 2.
|
|
17
|
+
| @bendyline/squisq | 2.11.1 | MIT | https://github.com/bendyline/squisq |
|
|
18
18
|
| @types/debug | 4.1.12 | MIT | https://github.com/DefinitelyTyped/DefinitelyTyped |
|
|
19
19
|
| @types/hast | 3.0.4 | MIT | https://github.com/DefinitelyTyped/DefinitelyTyped |
|
|
20
20
|
| @types/katex | 0.16.8 | MIT | https://github.com/DefinitelyTyped/DefinitelyTyped |
|
|
@@ -132,7 +132,7 @@ This notice is included in the published npm tarball. Transitive packages instal
|
|
|
132
132
|
Package-local license, copying, and notice files are reproduced below. Where a published package omits its repository license, the reviewed aggregate or README identified in `Source files` supplies the retained material.
|
|
133
133
|
|
|
134
134
|
==============================================================================
|
|
135
|
-
Components: @bendyline/squisq@2.
|
|
135
|
+
Components: @bendyline/squisq@2.11.1
|
|
136
136
|
Source files: node_modules/@bendyline/squisq/LICENSE
|
|
137
137
|
==============================================================================
|
|
138
138
|
MIT License
|
|
@@ -158,7 +158,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
158
158
|
SOFTWARE.
|
|
159
159
|
|
|
160
160
|
==============================================================================
|
|
161
|
-
Components: @bendyline/squisq@2.
|
|
161
|
+
Components: @bendyline/squisq@2.11.1
|
|
162
162
|
Source files: node_modules/@bendyline/squisq/NOTICE.md
|
|
163
163
|
==============================================================================
|
|
164
164
|
# Third-Party Notices for @bendyline/squisq
|
|
@@ -189,7 +189,7 @@ third-party license texts for bundled code and data are shipped in
|
|
|
189
189
|
THIRD_PARTY_LICENSES.txt.
|
|
190
190
|
|
|
191
191
|
==============================================================================
|
|
192
|
-
Components: @bendyline/squisq@2.
|
|
192
|
+
Components: @bendyline/squisq@2.11.1
|
|
193
193
|
Source files: node_modules/@bendyline/squisq/THIRD_PARTY_LICENSES.txt
|
|
194
194
|
==============================================================================
|
|
195
195
|
THIRD-PARTY LICENSES FOR @bendyline/squisq
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// src/share/index.ts
|
|
2
2
|
var SHARED_DOCUMENT_LIMITS = Object.freeze({
|
|
3
|
+
/** Conservative ceiling for a locally rendered, medium-correction QR code. */
|
|
4
|
+
qrUrlCharacters: 2048,
|
|
3
5
|
/** A conservative interoperability threshold, not a universal browser limit. */
|
|
4
6
|
portableUrlCharacters: 4096,
|
|
5
7
|
/** Hard cap applied before a hash is copied or decoded. */
|
|
@@ -273,6 +273,11 @@ var DocumentSession = class {
|
|
|
273
273
|
if (this.conflict.localContent === this.content && this.conflict.localRevision === this.revision && this.conflict.externalContent === change.content && this.conflict.externalVersion === externalVersion) {
|
|
274
274
|
return "ignored";
|
|
275
275
|
}
|
|
276
|
+
const localBranchIsStillClean = this.savingRevision === null && this.lifecycle === "open" && this.persistedRevision === this.revision && this.persistedContent === this.content && this.conflict.localRevision === this.revision && this.conflict.localContent === this.content;
|
|
277
|
+
if (localBranchIsStillClean && change.content !== null) {
|
|
278
|
+
this.adoptExternalContent(change.content);
|
|
279
|
+
return "applied";
|
|
280
|
+
}
|
|
276
281
|
this.clearAutoSaveTimer();
|
|
277
282
|
this.haltDrain = true;
|
|
278
283
|
this.conflict = {
|
|
@@ -292,13 +297,7 @@ var DocumentSession = class {
|
|
|
292
297
|
}
|
|
293
298
|
const isClean = this.persistedRevision === this.revision && this.savingRevision === null && this.error === null && this.conflict === null;
|
|
294
299
|
if (isClean && change.content !== null) {
|
|
295
|
-
this.
|
|
296
|
-
this.revision += 1;
|
|
297
|
-
this.persistedRevision = this.revision;
|
|
298
|
-
this.persistedContent = change.content;
|
|
299
|
-
this.generation += 1;
|
|
300
|
-
this.discardRecoverySnapshot();
|
|
301
|
-
this.emit();
|
|
300
|
+
this.adoptExternalContent(change.content);
|
|
302
301
|
return "applied";
|
|
303
302
|
}
|
|
304
303
|
this.clearAutoSaveTimer();
|
|
@@ -315,6 +314,20 @@ var DocumentSession = class {
|
|
|
315
314
|
this.emit();
|
|
316
315
|
return "conflict";
|
|
317
316
|
}
|
|
317
|
+
adoptExternalContent(content) {
|
|
318
|
+
this.clearAutoSaveTimer();
|
|
319
|
+
this.autoSaveRetryAttempt = 0;
|
|
320
|
+
this.content = content;
|
|
321
|
+
this.revision += 1;
|
|
322
|
+
this.persistedRevision = this.revision;
|
|
323
|
+
this.persistedContent = content;
|
|
324
|
+
this.generation += 1;
|
|
325
|
+
this.haltDrain = false;
|
|
326
|
+
this.error = null;
|
|
327
|
+
this.conflict = null;
|
|
328
|
+
this.discardRecoverySnapshot();
|
|
329
|
+
this.emit();
|
|
330
|
+
}
|
|
318
331
|
resolveConflict(strategy) {
|
|
319
332
|
return this.enqueueOperation(async () => {
|
|
320
333
|
if (!this.conflict) return this.snapshot;
|
|
@@ -102,6 +102,19 @@ function parseArtifactRef(value) {
|
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
104
|
function parseDocumentSource(value) {
|
|
105
|
+
if (typeof value === "string") {
|
|
106
|
+
const text = value.trim();
|
|
107
|
+
if (text.startsWith("{")) {
|
|
108
|
+
try {
|
|
109
|
+
return parseDocumentSource(JSON.parse(text));
|
|
110
|
+
} catch {
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (isArtifactUri(text)) return { kind: "artifact", uri: text };
|
|
115
|
+
const parsedPath = parseNonRootWorkspacePath(text);
|
|
116
|
+
return parsedPath === null ? null : { kind: "file", rootId: null, path: parsedPath, format: null };
|
|
117
|
+
}
|
|
105
118
|
if (!isRecord(value) || typeof value.kind !== "string") return null;
|
|
106
119
|
switch (value.kind) {
|
|
107
120
|
case "markdown": {
|
|
@@ -116,13 +129,14 @@ function parseDocumentSource(value) {
|
|
|
116
129
|
return { kind: "markdown", markdown, name };
|
|
117
130
|
}
|
|
118
131
|
case "file": {
|
|
119
|
-
if (!hasExactKeys(value, ["kind", "rootId", "path"]) && !hasExactKeys(value, ["kind", "rootId", "path", "format"])) {
|
|
132
|
+
if (!hasExactKeys(value, ["kind", "rootId", "path"]) && !hasExactKeys(value, ["kind", "rootId", "path", "format"]) && !hasExactKeys(value, ["kind", "path"]) && !hasExactKeys(value, ["kind", "path", "format"])) {
|
|
120
133
|
return null;
|
|
121
134
|
}
|
|
122
|
-
const
|
|
135
|
+
const path = value.path;
|
|
136
|
+
const rootId = Object.prototype.hasOwnProperty.call(value, "rootId") ? value.rootId : null;
|
|
123
137
|
const format = Object.prototype.hasOwnProperty.call(value, "format") ? value.format : null;
|
|
124
138
|
const parsedPath = parseNonRootWorkspacePath(path);
|
|
125
|
-
if (!isIdentifier(rootId) || parsedPath === null || !(format === null || isFormat(format))) {
|
|
139
|
+
if (!(rootId === null || isIdentifier(rootId)) || parsedPath === null || !(format === null || isFormat(format))) {
|
|
126
140
|
return null;
|
|
127
141
|
}
|
|
128
142
|
return { kind: "file", rootId, path: parsedPath, format };
|
package/dist/document/index.d.ts
CHANGED
|
@@ -310,6 +310,7 @@ declare class DocumentSession {
|
|
|
310
310
|
* adopt it. Dirty or saving sessions preserve local text and enter conflict.
|
|
311
311
|
*/
|
|
312
312
|
observeExternal(change: DocumentExternalSnapshot): DocumentExternalChangeResult;
|
|
313
|
+
private adoptExternalContent;
|
|
313
314
|
resolveConflict(strategy: DocumentConflictStrategy): Promise<DocumentSessionSnapshot>;
|
|
314
315
|
/**
|
|
315
316
|
* Freeze edits and flush through the latest revision. A successful call
|
package/dist/document/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
DocumentSessionConflictError,
|
|
8
8
|
createFileSystemDocumentTarget,
|
|
9
9
|
getDefaultDocumentRecoveryStorage
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-KLQKU74Q.js";
|
|
11
11
|
import "../chunk-QI6YKTQV.js";
|
|
12
12
|
import "../chunk-M5ZNQGR5.js";
|
|
13
13
|
import "../chunk-AYWKIZLD.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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-
|
|
4
|
+
import '../types-DBYraXxE.js';
|
|
5
5
|
|
|
6
6
|
/** Pure renderer-side client for the typed Electron filesystem v2 transport. */
|
|
7
7
|
declare class ElectronFileSystemProviderV2 implements FileSystemProviderV2 {
|
|
@@ -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-
|
|
13
|
+
import '../types-DBYraXxE.js';
|
|
14
14
|
|
|
15
15
|
interface DecodeUtf8TextOptions {
|
|
16
16
|
/** User-facing description of the payload being decoded. */
|
package/dist/host/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Q as OpenRequest, M as HostPinnedDocument, D as DocBlocksHostAPI } from '../types-
|
|
2
|
-
export { a as DocBlocksHostClipboardAPI, b as DocBlocksHostExportAPI, c as DocBlocksHostExternalAPI, d as DocBlocksHostFfmpegAPI, e as DocBlocksHostFsAPI, f as DocBlocksHostFsV2API, g as DocBlocksHostGitAPI, h as DocBlocksHostLifecycleAPI, i as DocBlocksHostMenuAPI, j as DocBlocksHostShellAPI, k as DocBlocksHostUpdaterAPI, l as DocBlocksHostWorkspacesAPI, E as ELECTRON_FILE_SYSTEM_V2_CAPABILITIES, m as ElectronWorkspaceInfo, n as ExternalBinaryCommitResult, G as GitBranchInfo, o as GitCapabilities, p as GitCloneHandle, q as GitCloneProgress, r as GitError, s as GitErrorCode, t as GitFileAtRevision, u as GitFileChange, v as GitFileStatusCode, w as GitLogEntry, x as GitLogOptions, y as GitRemoteInfo, z as GitRepoDetection, A as GitResult, B as GitRevision, C as GitStatus, H as HostCloseReason, F as HostEnvironment, I as HostExportTargetGrant, J as HostFileSystemV2OpenRequest, K as HostFileSystemV2Result, L as HostFileSystemV2WatchMessage, N as HostPrepareCloseRequest, O as HostPrepareCloseResult, P as MenuCommand, U as UpdateCheckResult, R as UpdateInstallResult, S as UpdaterStatus } from '../types-
|
|
1
|
+
import { Q as OpenRequest, M as HostPinnedDocument, D as DocBlocksHostAPI } from '../types-DBYraXxE.js';
|
|
2
|
+
export { a as DocBlocksHostClipboardAPI, b as DocBlocksHostExportAPI, c as DocBlocksHostExternalAPI, d as DocBlocksHostFfmpegAPI, e as DocBlocksHostFsAPI, f as DocBlocksHostFsV2API, g as DocBlocksHostGitAPI, h as DocBlocksHostLifecycleAPI, i as DocBlocksHostMenuAPI, j as DocBlocksHostShellAPI, k as DocBlocksHostUpdaterAPI, l as DocBlocksHostWorkspacesAPI, E as ELECTRON_FILE_SYSTEM_V2_CAPABILITIES, m as ElectronWorkspaceInfo, n as ExternalBinaryCommitResult, G as GitBranchInfo, o as GitCapabilities, p as GitCloneHandle, q as GitCloneProgress, r as GitError, s as GitErrorCode, t as GitFileAtRevision, u as GitFileChange, v as GitFileStatusCode, w as GitLogEntry, x as GitLogOptions, y as GitRemoteInfo, z as GitRepoDetection, A as GitResult, B as GitRevision, C as GitStatus, H as HostCloseReason, F as HostEnvironment, I as HostExportTargetGrant, J as HostFileSystemV2OpenRequest, K as HostFileSystemV2Result, L as HostFileSystemV2WatchMessage, N as HostPrepareCloseRequest, O as HostPrepareCloseResult, P as MenuCommand, U as UpdateCheckResult, R as UpdateInstallResult, S as UpdaterStatus } from '../types-DBYraXxE.js';
|
|
3
3
|
import '../types-Bb3yccTH.js';
|
|
4
4
|
import '../workspace-path-CWVrcuPL.js';
|
|
5
5
|
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,6 @@ export { DOCUMENT_RECOVERY_JOURNAL_SCHEMA_VERSION, DOCUMENT_RECOVERY_JOURNAL_STO
|
|
|
9
9
|
export { ElectronWorkspaceReconciliation, TransientOrigin, WorkspaceDescriptor, ensureDefaultWorkspace, getTransientWorkspace, getWorkspace, listWorkspaces, parsePersistedWorkspaceList, reconcileElectronWorkspaceDescriptors, registerTransientWorkspace, removeWorkspace, saveWorkspace, touchWorkspace, unregisterTransientWorkspace } from './workspace/index.js';
|
|
10
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 DocBlocksHostClipboardAPI, b as DocBlocksHostExportAPI, c as DocBlocksHostExternalAPI, d as DocBlocksHostFfmpegAPI, e as DocBlocksHostFsAPI, f as DocBlocksHostFsV2API, g as DocBlocksHostGitAPI, h as DocBlocksHostLifecycleAPI, i as DocBlocksHostMenuAPI, j as DocBlocksHostShellAPI, k as DocBlocksHostUpdaterAPI, l as DocBlocksHostWorkspacesAPI, E as ELECTRON_FILE_SYSTEM_V2_CAPABILITIES, m as ElectronWorkspaceInfo, n as ExternalBinaryCommitResult, G as GitBranchInfo, o as GitCapabilities, p as GitCloneHandle, q as GitCloneProgress, r as GitError, s as GitErrorCode, t as GitFileAtRevision, u as GitFileChange, v as GitFileStatusCode, w as GitLogEntry, x as GitLogOptions, y as GitRemoteInfo, z as GitRepoDetection, A as GitResult, B as GitRevision, C as GitStatus, H as HostCloseReason, F as HostEnvironment, I as HostExportTargetGrant, J as HostFileSystemV2OpenRequest, K as HostFileSystemV2Result, L as HostFileSystemV2WatchMessage, M as HostPinnedDocument, N as HostPrepareCloseRequest, O as HostPrepareCloseResult, P as MenuCommand, Q as OpenRequest, U as UpdateCheckResult, R as UpdateInstallResult, S as UpdaterStatus } from './types-
|
|
12
|
+
export { D as DocBlocksHostAPI, a as DocBlocksHostClipboardAPI, b as DocBlocksHostExportAPI, c as DocBlocksHostExternalAPI, d as DocBlocksHostFfmpegAPI, e as DocBlocksHostFsAPI, f as DocBlocksHostFsV2API, g as DocBlocksHostGitAPI, h as DocBlocksHostLifecycleAPI, i as DocBlocksHostMenuAPI, j as DocBlocksHostShellAPI, k as DocBlocksHostUpdaterAPI, l as DocBlocksHostWorkspacesAPI, E as ELECTRON_FILE_SYSTEM_V2_CAPABILITIES, m as ElectronWorkspaceInfo, n as ExternalBinaryCommitResult, G as GitBranchInfo, o as GitCapabilities, p as GitCloneHandle, q as GitCloneProgress, r as GitError, s as GitErrorCode, t as GitFileAtRevision, u as GitFileChange, v as GitFileStatusCode, w as GitLogEntry, x as GitLogOptions, y as GitRemoteInfo, z as GitRepoDetection, A as GitResult, B as GitRevision, C as GitStatus, H as HostCloseReason, F as HostEnvironment, I as HostExportTargetGrant, J as HostFileSystemV2OpenRequest, K as HostFileSystemV2Result, L as HostFileSystemV2WatchMessage, M as HostPinnedDocument, N as HostPrepareCloseRequest, O as HostPrepareCloseResult, P as MenuCommand, Q as OpenRequest, U as UpdateCheckResult, R as UpdateInstallResult, S as UpdaterStatus } from './types-DBYraXxE.js';
|
|
13
13
|
import '@bendyline/squisq/storage';
|
|
14
14
|
import '@bendyline/squisq/schemas';
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
createSharedDocumentHash,
|
|
4
4
|
createSharedDocumentUrl,
|
|
5
5
|
parseSharedDocumentHash
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FBCGLK6N.js";
|
|
7
7
|
import {
|
|
8
8
|
FileSystemContentContainer,
|
|
9
9
|
LegacyFileSystemProviderV2Adapter,
|
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
DocumentSessionConflictError,
|
|
70
70
|
createFileSystemDocumentTarget,
|
|
71
71
|
getDefaultDocumentRecoveryStorage
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-KLQKU74Q.js";
|
|
73
73
|
import {
|
|
74
74
|
FileSystemMoveRecoveryError,
|
|
75
75
|
FileSystemPartialMoveError,
|
package/dist/mcp/index.d.ts
CHANGED
|
@@ -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 } from '../types-
|
|
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-
|
|
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-Oy9U5FST.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-Oy9U5FST.js';
|
|
3
3
|
import '../workspace-path-CWVrcuPL.js';
|
|
4
4
|
|
|
5
5
|
/** Quantitative limits for untrusted MCP payloads. */
|
package/dist/mcp/index.js
CHANGED
package/dist/mcp/zod.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { z as z$1 } from 'zod/v4';
|
|
3
|
-
import { H as DocBlocksMcpToolName } from '../types-
|
|
3
|
+
import { H as DocBlocksMcpToolName } from '../types-Oy9U5FST.js';
|
|
4
4
|
import '../workspace-path-CWVrcuPL.js';
|
|
5
5
|
|
|
6
6
|
/** Canonical Zod projection of the exact MCP wire contract for protocol SDKs. */
|
|
@@ -167,7 +167,22 @@ declare const bundleDocumentSourceSchema: z.ZodObject<{
|
|
|
167
167
|
}[];
|
|
168
168
|
name?: string | null | undefined;
|
|
169
169
|
}>;
|
|
170
|
-
|
|
170
|
+
/**
|
|
171
|
+
* Document source, with a flat-string convenience form.
|
|
172
|
+
*
|
|
173
|
+
* Small local models emitting tool calls through textual salvage produce
|
|
174
|
+
* flat KEY→string argument maps, so a structured `source` object arrives
|
|
175
|
+
* as a plain string — historically an instant .strict() rejection, and
|
|
176
|
+
* the first structural-args toolset turned that into unbreakable retry
|
|
177
|
+
* loops for every sub-frontier model (gezel's 2026-08-22 scorecard:
|
|
178
|
+
* PPTX production 0/33 across 11 local models). Accept the string
|
|
179
|
+
* spelling at the schema boundary instead: an artifact URI string is an
|
|
180
|
+
* artifact source, anything else is a root-relative file path. Inline
|
|
181
|
+
* markdown must still use the structured `{kind:"markdown"}` form — a
|
|
182
|
+
* bare string is far more often a path, and silently turning a mistyped
|
|
183
|
+
* path into a one-line document would be worse than rejecting it.
|
|
184
|
+
*/
|
|
185
|
+
declare const documentSourceSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
171
186
|
kind: z.ZodLiteral<"markdown">;
|
|
172
187
|
markdown: z.ZodString;
|
|
173
188
|
name: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
@@ -181,19 +196,19 @@ declare const documentSourceSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject
|
|
|
181
196
|
name?: string | null | undefined;
|
|
182
197
|
}>, z.ZodObject<{
|
|
183
198
|
kind: z.ZodLiteral<"file">;
|
|
184
|
-
rootId: z.ZodString
|
|
199
|
+
rootId: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
185
200
|
path: z.ZodEffects<z.ZodString, string, string>;
|
|
186
201
|
format: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
187
202
|
}, "strict", z.ZodTypeAny, {
|
|
188
203
|
path: string;
|
|
189
204
|
format: string | null;
|
|
190
205
|
kind: "file";
|
|
191
|
-
rootId: string;
|
|
206
|
+
rootId: string | null;
|
|
192
207
|
}, {
|
|
193
208
|
path: string;
|
|
194
209
|
kind: "file";
|
|
195
|
-
rootId: string;
|
|
196
210
|
format?: string | null | undefined;
|
|
211
|
+
rootId?: string | null | undefined;
|
|
197
212
|
}>, z.ZodObject<{
|
|
198
213
|
kind: z.ZodLiteral<"artifact">;
|
|
199
214
|
uri: z.ZodString;
|
|
@@ -302,7 +317,38 @@ declare const documentSourceSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject
|
|
|
302
317
|
license: string | null;
|
|
303
318
|
}[];
|
|
304
319
|
name?: string | null | undefined;
|
|
305
|
-
}>]
|
|
320
|
+
}>]>, {
|
|
321
|
+
name: string | null;
|
|
322
|
+
markdown: string;
|
|
323
|
+
kind: "bundle";
|
|
324
|
+
assets: {
|
|
325
|
+
path: string;
|
|
326
|
+
source: {
|
|
327
|
+
path: string;
|
|
328
|
+
kind: "file";
|
|
329
|
+
rootId: string;
|
|
330
|
+
} | {
|
|
331
|
+
uri: string;
|
|
332
|
+
kind: "artifact";
|
|
333
|
+
};
|
|
334
|
+
mimeType: string | null;
|
|
335
|
+
altText: string | null;
|
|
336
|
+
credit: string | null;
|
|
337
|
+
license: string | null;
|
|
338
|
+
}[];
|
|
339
|
+
} | {
|
|
340
|
+
name: string | null;
|
|
341
|
+
markdown: string;
|
|
342
|
+
kind: "markdown";
|
|
343
|
+
} | {
|
|
344
|
+
path: string;
|
|
345
|
+
format: string | null;
|
|
346
|
+
kind: "file";
|
|
347
|
+
rootId: string | null;
|
|
348
|
+
} | {
|
|
349
|
+
uri: string;
|
|
350
|
+
kind: "artifact";
|
|
351
|
+
}, unknown>;
|
|
306
352
|
declare const artifactRefSchema: z.ZodEffects<z.ZodObject<{
|
|
307
353
|
id: z.ZodString;
|
|
308
354
|
uri: z.ZodString;
|
package/dist/mcp/zod.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
parseConversionResult,
|
|
6
6
|
parseInspectionResult,
|
|
7
7
|
parsePreviewResult
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-YWYT6K6J.js";
|
|
9
9
|
import "../chunk-AYWKIZLD.js";
|
|
10
10
|
|
|
11
11
|
// src/mcp/zod.ts
|
|
@@ -70,7 +70,7 @@ var bundleDocumentSourceSchema = z.object({
|
|
|
70
70
|
assets: z.array(bundleAssetSchema).max(MCP_WIRE_LIMITS.bundleAssets),
|
|
71
71
|
name: labelSchema.nullable().optional().default(null)
|
|
72
72
|
}).strict();
|
|
73
|
-
var
|
|
73
|
+
var structuredDocumentSourceSchema = z.discriminatedUnion("kind", [
|
|
74
74
|
z.object({
|
|
75
75
|
kind: z.literal("markdown"),
|
|
76
76
|
markdown: z.string().max(MAX_MARKDOWN_CHARACTERS).regex(WIRE_STRING_PATTERN, "NUL and DEL are not permitted on the MCP wire"),
|
|
@@ -78,13 +78,31 @@ var documentSourceSchema = z.discriminatedUnion("kind", [
|
|
|
78
78
|
}).strict(),
|
|
79
79
|
z.object({
|
|
80
80
|
kind: z.literal("file"),
|
|
81
|
-
|
|
81
|
+
// Nullable-with-default: a null rootId means "the server's sole
|
|
82
|
+
// read-enabled root". Agents on a one-root server (the common MCP
|
|
83
|
+
// setup) no longer round-trip list_roots before every conversion;
|
|
84
|
+
// multi-root servers still get an actionable error naming the
|
|
85
|
+
// candidates. See McpFileAuthority.authorizeRootRead.
|
|
86
|
+
rootId: idSchema.nullable().optional().default(null),
|
|
82
87
|
path: workspacePathSchema,
|
|
83
88
|
format: formatSchema.nullable().optional().default(null)
|
|
84
89
|
}).strict(),
|
|
85
90
|
z.object({ kind: z.literal("artifact"), uri: artifactUriSchema }).strict(),
|
|
86
91
|
bundleDocumentSourceSchema
|
|
87
92
|
]);
|
|
93
|
+
var documentSourceSchema = z.preprocess((value) => {
|
|
94
|
+
if (typeof value !== "string") return value;
|
|
95
|
+
const text = value.trim();
|
|
96
|
+
if (text.startsWith("{")) {
|
|
97
|
+
try {
|
|
98
|
+
return JSON.parse(text);
|
|
99
|
+
} catch {
|
|
100
|
+
return value;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (ARTIFACT_URI_PATTERN.test(text)) return { kind: "artifact", uri: text };
|
|
104
|
+
return { kind: "file", path: text };
|
|
105
|
+
}, structuredDocumentSourceSchema);
|
|
88
106
|
var appliedOptionSchema = z.object({
|
|
89
107
|
name: idSchema,
|
|
90
108
|
value: z.union([boundedString, z.number().finite(), z.boolean(), z.null()])
|
package/dist/share/index.d.ts
CHANGED
|
@@ -24,6 +24,8 @@ type SharedDocumentHashParseResult = {
|
|
|
24
24
|
readonly message: string;
|
|
25
25
|
};
|
|
26
26
|
declare const SHARED_DOCUMENT_LIMITS: Readonly<{
|
|
27
|
+
/** Conservative ceiling for a locally rendered, medium-correction QR code. */
|
|
28
|
+
qrUrlCharacters: 2048;
|
|
27
29
|
/** A conservative interoperability threshold, not a universal browser limit. */
|
|
28
30
|
portableUrlCharacters: 4096;
|
|
29
31
|
/** Hard cap applied before a hash is copied or decoded. */
|
package/dist/share/index.js
CHANGED
|
@@ -87,10 +87,16 @@ interface GitRepoDetection {
|
|
|
87
87
|
isRepo: boolean;
|
|
88
88
|
/** False when the workspace root is a subdirectory of a larger repo. */
|
|
89
89
|
rootIsToplevel?: boolean;
|
|
90
|
-
/** Main-owned repository authority; absent
|
|
90
|
+
/** Main-owned repository authority; absent while expanded access is ungranted. */
|
|
91
91
|
repositoryId?: string;
|
|
92
92
|
/** True when Git metadata or the work tree extends beyond the workspace grant. */
|
|
93
93
|
requiresExpandedGrant?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Display path of the enclosing repository root. Present only alongside
|
|
96
|
+
* `requiresExpandedGrant` so the in-app consent surface can name what the
|
|
97
|
+
* user would be granting access to.
|
|
98
|
+
*/
|
|
99
|
+
repositoryRoot?: string;
|
|
94
100
|
}
|
|
95
101
|
type GitFileStatusCode = 'added' | 'modified' | 'deleted' | 'renamed' | 'copied' | 'type-changed' | 'untracked' | 'ignored' | 'unmerged';
|
|
96
102
|
interface GitFileChange {
|
|
@@ -198,8 +204,22 @@ interface GitCloneHandle {
|
|
|
198
204
|
}
|
|
199
205
|
interface DocBlocksHostGitAPI {
|
|
200
206
|
capabilities(): Promise<GitCapabilities>;
|
|
201
|
-
/**
|
|
207
|
+
/**
|
|
208
|
+
* Detect a persisted workspace by opaque workspace id and mint repository
|
|
209
|
+
* authority. Never prompts: a workspace inside a larger repository comes
|
|
210
|
+
* back with `requiresExpandedGrant` and no `repositoryId` until the user
|
|
211
|
+
* opts in through `grantExpandedRepo`.
|
|
212
|
+
*/
|
|
202
213
|
detectRepo(workspaceId: string): Promise<GitResult<GitRepoDetection>>;
|
|
214
|
+
/**
|
|
215
|
+
* Grant expanded access to the repository enclosing the workspace and mint
|
|
216
|
+
* repository authority. Must be called from an explicit user gesture. The
|
|
217
|
+
* choice is remembered for that repository; `always` remembers it for every
|
|
218
|
+
* repository opened from a subfolder.
|
|
219
|
+
*/
|
|
220
|
+
grantExpandedRepo(workspaceId: string, opts?: {
|
|
221
|
+
always?: boolean;
|
|
222
|
+
}): Promise<GitResult<GitRepoDetection>>;
|
|
203
223
|
init(workspaceId: string): Promise<GitResult<void>>;
|
|
204
224
|
status(repositoryId: string): Promise<GitResult<GitStatus>>;
|
|
205
225
|
stage(repositoryId: string, paths: string[]): Promise<GitResult<void>>;
|
|
@@ -306,6 +326,8 @@ interface DocBlocksHostWorkspacesAPI {
|
|
|
306
326
|
interface DocBlocksHostShellAPI {
|
|
307
327
|
/** Reveal a registered workspace root or one root-relative entry. */
|
|
308
328
|
revealInFolder(workspaceId: string, workspacePath?: string): Promise<void>;
|
|
329
|
+
/** Open a registered workspace root in Finder or the platform file manager. */
|
|
330
|
+
openWorkspaceFolder(workspaceId: string): Promise<void>;
|
|
309
331
|
/** Open a URL in the default browser. */
|
|
310
332
|
openExternal(url: string): Promise<void>;
|
|
311
333
|
}
|
|
@@ -313,6 +335,8 @@ interface DocBlocksHostShellAPI {
|
|
|
313
335
|
interface DocBlocksHostClipboardAPI {
|
|
314
336
|
/** Replace the system clipboard's plain-text contents. */
|
|
315
337
|
writeText(text: string): Promise<void>;
|
|
338
|
+
/** Resolve a registered workspace entry in main and copy its absolute path. */
|
|
339
|
+
writeWorkspacePath(workspaceId: string, workspacePath: string): Promise<void>;
|
|
316
340
|
}
|
|
317
341
|
/** Exact, main-owned export authority. The display path is never authority. */
|
|
318
342
|
interface HostExportTargetGrant {
|
|
@@ -55,10 +55,17 @@ interface MarkdownDocumentSource {
|
|
|
55
55
|
readonly markdown: string;
|
|
56
56
|
readonly name: string | null;
|
|
57
57
|
}
|
|
58
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* A file selected from a server-configured, authority-scoped root.
|
|
60
|
+
*
|
|
61
|
+
* A null rootId means "the server's sole read-enabled root": callers on
|
|
62
|
+
* a one-root server may omit it, and the authority resolves or rejects
|
|
63
|
+
* with the candidate ids. It never grants new authority — resolution
|
|
64
|
+
* still goes through the same root allow-list.
|
|
65
|
+
*/
|
|
59
66
|
interface FileDocumentSource {
|
|
60
67
|
readonly kind: 'file';
|
|
61
|
-
readonly rootId: string;
|
|
68
|
+
readonly rootId: string | null;
|
|
62
69
|
readonly path: WorkspacePath;
|
|
63
70
|
readonly format: string | null;
|
|
64
71
|
}
|
package/dist/vscode/index.d.ts
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Typed message protocol between the extension host and webview.
|
|
3
3
|
*/
|
|
4
|
+
/**
|
|
5
|
+
* Bounds for host-persisted proofing state.
|
|
6
|
+
*
|
|
7
|
+
* Both payloads are written by the webview and stored in extension-host state,
|
|
8
|
+
* which is memory-resident and serialized on every VS Code shutdown, so neither
|
|
9
|
+
* may grow without limit. The ignore payload is the engine's opaque export —
|
|
10
|
+
* a list of context hashes — and grows only with dismissals in one document.
|
|
11
|
+
*/
|
|
12
|
+
declare const PROOF_STATE_LIMITS: Readonly<{
|
|
13
|
+
dictionaryWords: 5000;
|
|
14
|
+
wordCharacters: 128;
|
|
15
|
+
ignoredJsonCharacters: number;
|
|
16
|
+
}>;
|
|
4
17
|
type DocumentSessionMessageStatus = 'idle' | 'saved' | 'dirty' | 'saving' | 'error' | 'conflict' | 'closed';
|
|
5
18
|
type DocumentConflictChoice = 'use-local' | 'use-external';
|
|
6
19
|
/** Host-observed details that help a user distinguish two text branches. */
|
|
@@ -40,10 +53,21 @@ interface VscodeWriteCanvasSettings {
|
|
|
40
53
|
fontScheme: DocBlocksWriteCanvasFontScheme;
|
|
41
54
|
}
|
|
42
55
|
declare const DEFAULT_VSCODE_WRITE_CANVAS_SETTINGS: Readonly<VscodeWriteCanvasSettings>;
|
|
56
|
+
/**
|
|
57
|
+
* Which inline proofing squiggles the editor draws. Two switches, not
|
|
58
|
+
* one: harper's grammar rules are English-only, so a writer working in
|
|
59
|
+
* another language wants spelling alone. Both off means no engine loads.
|
|
60
|
+
*/
|
|
61
|
+
interface VscodeProofingSettings {
|
|
62
|
+
spelling: boolean;
|
|
63
|
+
grammar: boolean;
|
|
64
|
+
}
|
|
65
|
+
declare const DEFAULT_VSCODE_PROOFING_SETTINGS: Readonly<VscodeProofingSettings>;
|
|
43
66
|
interface VscodeEditorSettings {
|
|
44
67
|
autoSave: boolean;
|
|
45
68
|
accentColor: DocBlocksAccentColor;
|
|
46
69
|
writeCanvasSettings: VscodeWriteCanvasSettings;
|
|
70
|
+
proofingSettings: VscodeProofingSettings;
|
|
47
71
|
}
|
|
48
72
|
/**
|
|
49
73
|
* An opaque, one-shot authority to write one host-owned export target.
|
|
@@ -144,6 +168,18 @@ type ExtensionToWebviewMessage = {
|
|
|
144
168
|
type: 'workspaceFileError';
|
|
145
169
|
requestId: number;
|
|
146
170
|
message: string;
|
|
171
|
+
} | {
|
|
172
|
+
type: 'proofDictionaryLoaded';
|
|
173
|
+
requestId: number;
|
|
174
|
+
words: string[];
|
|
175
|
+
} | {
|
|
176
|
+
type: 'proofIgnoresLoaded';
|
|
177
|
+
requestId: number;
|
|
178
|
+
ignoredJson: string | null;
|
|
179
|
+
} | {
|
|
180
|
+
type: 'proofStateError';
|
|
181
|
+
requestId: number;
|
|
182
|
+
message: string;
|
|
147
183
|
};
|
|
148
184
|
/** Messages sent from the webview to the extension host. */
|
|
149
185
|
type WebviewToExtensionMessage = {
|
|
@@ -157,6 +193,9 @@ type WebviewToExtensionMessage = {
|
|
|
157
193
|
} | {
|
|
158
194
|
type: 'setWriteCanvasSettings';
|
|
159
195
|
settings: VscodeWriteCanvasSettings;
|
|
196
|
+
} | {
|
|
197
|
+
type: 'setProofingSettings';
|
|
198
|
+
settings: VscodeProofingSettings;
|
|
160
199
|
} | {
|
|
161
200
|
type: 'openLink';
|
|
162
201
|
href: string;
|
|
@@ -219,6 +258,18 @@ type WebviewToExtensionMessage = {
|
|
|
219
258
|
type: 'readWorkspaceFile';
|
|
220
259
|
requestId: number;
|
|
221
260
|
path: string;
|
|
261
|
+
} | {
|
|
262
|
+
type: 'loadProofDictionary';
|
|
263
|
+
requestId: number;
|
|
264
|
+
} | {
|
|
265
|
+
type: 'addProofDictionaryWord';
|
|
266
|
+
word: string;
|
|
267
|
+
} | {
|
|
268
|
+
type: 'loadProofIgnores';
|
|
269
|
+
requestId: number;
|
|
270
|
+
} | {
|
|
271
|
+
type: 'saveProofIgnores';
|
|
272
|
+
ignoredJson: string;
|
|
222
273
|
};
|
|
223
274
|
interface MediaEntryMessage {
|
|
224
275
|
name: string;
|
|
@@ -255,4 +306,4 @@ declare function isSafeMimeType(value: unknown): value is string;
|
|
|
255
306
|
*/
|
|
256
307
|
declare function hasSubstantiveTextChange(baseline: string, candidate: string): boolean;
|
|
257
308
|
|
|
258
|
-
export { DEFAULT_VSCODE_WRITE_CANVAS_SETTINGS, DOCBLOCKS_ACCENT_COLORS, DOCBLOCKS_WRITE_CANVAS_FONT_SCHEMES, DOCBLOCKS_WRITE_CANVAS_LINE_SPACING_MAX, DOCBLOCKS_WRITE_CANVAS_LINE_SPACING_MIN, DOCBLOCKS_WRITE_CANVAS_TEXT_SIZE_MAX, DOCBLOCKS_WRITE_CANVAS_TEXT_SIZE_MIN, type DocBlocksAccentColor, type DocBlocksWriteCanvasFontScheme, type DocumentConflictChoice, type DocumentConflictDetailsMessage, type DocumentSessionMessageStatus, type ExportTargetGrantMessage, type ExtensionToWebviewMessage, type MediaEntryMessage, type VscodeEditorSettings, type VscodeWriteCanvasSettings, type WebviewToExtensionMessage, hasSubstantiveTextChange, isDocBlocksAccentColor, isDocBlocksWriteCanvasFontScheme, isDocBlocksWriteCanvasLineSpacing, isDocBlocksWriteCanvasTextSize, isSafeExportFilename, isSafeMimeType, parseExtensionToWebviewMessage, parseWebviewToExtensionMessage };
|
|
309
|
+
export { DEFAULT_VSCODE_PROOFING_SETTINGS, DEFAULT_VSCODE_WRITE_CANVAS_SETTINGS, DOCBLOCKS_ACCENT_COLORS, DOCBLOCKS_WRITE_CANVAS_FONT_SCHEMES, DOCBLOCKS_WRITE_CANVAS_LINE_SPACING_MAX, DOCBLOCKS_WRITE_CANVAS_LINE_SPACING_MIN, DOCBLOCKS_WRITE_CANVAS_TEXT_SIZE_MAX, DOCBLOCKS_WRITE_CANVAS_TEXT_SIZE_MIN, type DocBlocksAccentColor, type DocBlocksWriteCanvasFontScheme, type DocumentConflictChoice, type DocumentConflictDetailsMessage, type DocumentSessionMessageStatus, type ExportTargetGrantMessage, type ExtensionToWebviewMessage, type MediaEntryMessage, PROOF_STATE_LIMITS, type VscodeEditorSettings, type VscodeProofingSettings, type VscodeWriteCanvasSettings, type WebviewToExtensionMessage, hasSubstantiveTextChange, isDocBlocksAccentColor, isDocBlocksWriteCanvasFontScheme, isDocBlocksWriteCanvasLineSpacing, isDocBlocksWriteCanvasTextSize, isSafeExportFilename, isSafeMimeType, parseExtensionToWebviewMessage, parseWebviewToExtensionMessage };
|
package/dist/vscode/index.js
CHANGED
|
@@ -5,6 +5,11 @@ import {
|
|
|
5
5
|
|
|
6
6
|
// src/vscode/messages.ts
|
|
7
7
|
var MAX_REQUEST_ID = 2147483647;
|
|
8
|
+
var PROOF_STATE_LIMITS = Object.freeze({
|
|
9
|
+
dictionaryWords: 5e3,
|
|
10
|
+
wordCharacters: 128,
|
|
11
|
+
ignoredJsonCharacters: 64 * 1024
|
|
12
|
+
});
|
|
8
13
|
var DOCBLOCKS_ACCENT_COLORS = [
|
|
9
14
|
"brown",
|
|
10
15
|
"green",
|
|
@@ -35,6 +40,10 @@ var DEFAULT_VSCODE_WRITE_CANVAS_SETTINGS = {
|
|
|
35
40
|
lineSpacing: 1.7,
|
|
36
41
|
fontScheme: "theme"
|
|
37
42
|
};
|
|
43
|
+
var DEFAULT_VSCODE_PROOFING_SETTINGS = {
|
|
44
|
+
spelling: true,
|
|
45
|
+
grammar: true
|
|
46
|
+
};
|
|
38
47
|
function parseWebviewToExtensionMessage(value) {
|
|
39
48
|
if (!isRecord(value) || typeof value.type !== "string") return null;
|
|
40
49
|
switch (value.type) {
|
|
@@ -49,6 +58,11 @@ function parseWebviewToExtensionMessage(value) {
|
|
|
49
58
|
const settings = parseVscodeWriteCanvasSettings(value.settings);
|
|
50
59
|
return settings ? { type: "setWriteCanvasSettings", settings } : null;
|
|
51
60
|
}
|
|
61
|
+
case "setProofingSettings": {
|
|
62
|
+
if (!hasOnlyKeys(value, ["type", "settings"])) return null;
|
|
63
|
+
const settings = parseVscodeProofingSettings(value.settings);
|
|
64
|
+
return settings ? { type: "setProofingSettings", settings } : null;
|
|
65
|
+
}
|
|
52
66
|
case "openLink":
|
|
53
67
|
return hasOnlyKeys(value, ["type", "href"]) && hasBoundedString(value, "href", HOST_WIRE_LIMITS.urlCharacters, 1) ? { type: "openLink", href: value.href } : null;
|
|
54
68
|
case "copyCode":
|
|
@@ -126,6 +140,13 @@ function parseWebviewToExtensionMessage(value) {
|
|
|
126
140
|
} : null;
|
|
127
141
|
case "readWorkspaceFile":
|
|
128
142
|
return hasOnlyKeys(value, ["type", "requestId", "path"]) && hasRequestId(value) && hasBoundedString(value, "path", HOST_WIRE_LIMITS.pathCharacters, 1) ? { type: "readWorkspaceFile", requestId: value.requestId, path: value.path } : null;
|
|
143
|
+
case "loadProofDictionary":
|
|
144
|
+
case "loadProofIgnores":
|
|
145
|
+
return hasOnlyKeys(value, ["type", "requestId"]) && hasRequestId(value) ? { type: value.type, requestId: value.requestId } : null;
|
|
146
|
+
case "addProofDictionaryWord":
|
|
147
|
+
return hasOnlyKeys(value, ["type", "word"]) && hasBoundedString(value, "word", PROOF_STATE_LIMITS.wordCharacters, 1) ? { type: "addProofDictionaryWord", word: value.word } : null;
|
|
148
|
+
case "saveProofIgnores":
|
|
149
|
+
return hasOnlyKeys(value, ["type", "ignoredJson"]) && hasBoundedString(value, "ignoredJson", PROOF_STATE_LIMITS.ignoredJsonCharacters) ? { type: "saveProofIgnores", ignoredJson: value.ignoredJson } : null;
|
|
129
150
|
default:
|
|
130
151
|
return null;
|
|
131
152
|
}
|
|
@@ -241,8 +262,20 @@ function parseExtensionToWebviewMessage(value) {
|
|
|
241
262
|
return hasOnlyKeys(value, ["type", "requestId", "path"]) && hasRequestId(value) && hasBoundedString(value, "path", HOST_WIRE_LIMITS.pathCharacters, 1) ? { type: "mediaAdded", requestId: value.requestId, path: value.path } : null;
|
|
242
263
|
case "mediaRemoved":
|
|
243
264
|
return hasOnlyKeys(value, ["type", "requestId"]) && hasRequestId(value) ? { type: "mediaRemoved", requestId: value.requestId } : null;
|
|
265
|
+
case "proofDictionaryLoaded": {
|
|
266
|
+
if (!hasOnlyKeys(value, ["type", "requestId", "words"]) || !hasRequestId(value)) return null;
|
|
267
|
+
const words = parseProofDictionaryWords(value.words);
|
|
268
|
+
return words ? { type: "proofDictionaryLoaded", requestId: value.requestId, words } : null;
|
|
269
|
+
}
|
|
270
|
+
case "proofIgnoresLoaded":
|
|
271
|
+
return hasOnlyKeys(value, ["type", "requestId", "ignoredJson"]) && hasRequestId(value) && hasNullableBoundedString(value, "ignoredJson", PROOF_STATE_LIMITS.ignoredJsonCharacters) ? {
|
|
272
|
+
type: "proofIgnoresLoaded",
|
|
273
|
+
requestId: value.requestId,
|
|
274
|
+
ignoredJson: value.ignoredJson
|
|
275
|
+
} : null;
|
|
244
276
|
case "mediaError":
|
|
245
277
|
case "exportError":
|
|
278
|
+
case "proofStateError":
|
|
246
279
|
case "workspaceFileError":
|
|
247
280
|
return hasOnlyKeys(value, ["type", "requestId", "message"]) && hasRequestId(value) && hasBoundedString(value, "message", HOST_WIRE_LIMITS.messageCharacters, 1) ? { type: value.type, requestId: value.requestId, message: value.message } : null;
|
|
248
281
|
case "exportSaved":
|
|
@@ -260,6 +293,15 @@ function parseExtensionToWebviewMessage(value) {
|
|
|
260
293
|
return null;
|
|
261
294
|
}
|
|
262
295
|
}
|
|
296
|
+
function parseProofDictionaryWords(value) {
|
|
297
|
+
if (!Array.isArray(value) || value.length > PROOF_STATE_LIMITS.dictionaryWords) return null;
|
|
298
|
+
const words = [];
|
|
299
|
+
for (const entry of value) {
|
|
300
|
+
if (!isBoundedString(entry, PROOF_STATE_LIMITS.wordCharacters, 1)) return null;
|
|
301
|
+
words.push(entry);
|
|
302
|
+
}
|
|
303
|
+
return words;
|
|
304
|
+
}
|
|
263
305
|
function parseExportTargetGrant(value) {
|
|
264
306
|
if (value === null) return null;
|
|
265
307
|
if (!isRecord(value) || !hasOnlyKeys(value, ["grantId", "displayLabel"]) || !hasBoundedString(value, "grantId", HOST_WIRE_LIMITS.identifierCharacters, 1) || !hasBoundedString(value, "displayLabel", HOST_WIRE_LIMITS.pathCharacters, 1)) {
|
|
@@ -291,11 +333,20 @@ function parseDocumentConflictDetails(value) {
|
|
|
291
333
|
};
|
|
292
334
|
}
|
|
293
335
|
function parseVscodeEditorSettings(value) {
|
|
294
|
-
if (!isRecord(value) || !hasOnlyKeys(value, ["autoSave", "accentColor", "writeCanvasSettings"]) || typeof value.autoSave !== "boolean" || !isDocBlocksAccentColor(value.accentColor)) {
|
|
336
|
+
if (!isRecord(value) || !hasOnlyKeys(value, ["autoSave", "accentColor", "writeCanvasSettings", "proofingSettings"]) || typeof value.autoSave !== "boolean" || !isDocBlocksAccentColor(value.accentColor)) {
|
|
295
337
|
return null;
|
|
296
338
|
}
|
|
297
339
|
const writeCanvasSettings = parseVscodeWriteCanvasSettings(value.writeCanvasSettings);
|
|
298
|
-
|
|
340
|
+
const proofingSettings = parseVscodeProofingSettings(value.proofingSettings);
|
|
341
|
+
return writeCanvasSettings && proofingSettings ? {
|
|
342
|
+
autoSave: value.autoSave,
|
|
343
|
+
accentColor: value.accentColor,
|
|
344
|
+
writeCanvasSettings,
|
|
345
|
+
proofingSettings
|
|
346
|
+
} : null;
|
|
347
|
+
}
|
|
348
|
+
function parseVscodeProofingSettings(value) {
|
|
349
|
+
return isRecord(value) && hasOnlyKeys(value, ["spelling", "grammar"]) && typeof value.spelling === "boolean" && typeof value.grammar === "boolean" ? { spelling: value.spelling, grammar: value.grammar } : null;
|
|
299
350
|
}
|
|
300
351
|
function isDocBlocksAccentColor(value) {
|
|
301
352
|
return DOCBLOCKS_ACCENT_COLORS.some((color) => color === value);
|
|
@@ -417,6 +468,7 @@ function skipWhitespace(value, start) {
|
|
|
417
468
|
return index;
|
|
418
469
|
}
|
|
419
470
|
export {
|
|
471
|
+
DEFAULT_VSCODE_PROOFING_SETTINGS,
|
|
420
472
|
DEFAULT_VSCODE_WRITE_CANVAS_SETTINGS,
|
|
421
473
|
DOCBLOCKS_ACCENT_COLORS,
|
|
422
474
|
DOCBLOCKS_WRITE_CANVAS_FONT_SCHEMES,
|
|
@@ -424,6 +476,7 @@ export {
|
|
|
424
476
|
DOCBLOCKS_WRITE_CANVAS_LINE_SPACING_MIN,
|
|
425
477
|
DOCBLOCKS_WRITE_CANVAS_TEXT_SIZE_MAX,
|
|
426
478
|
DOCBLOCKS_WRITE_CANVAS_TEXT_SIZE_MIN,
|
|
479
|
+
PROOF_STATE_LIMITS,
|
|
427
480
|
hasSubstantiveTextChange,
|
|
428
481
|
isDocBlocksAccentColor,
|
|
429
482
|
isDocBlocksWriteCanvasFontScheme,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { q as FileSystemProvider } from '../types-Bb3yccTH.js';
|
|
2
|
-
import { m as ElectronWorkspaceInfo, F as HostEnvironment } from '../types-
|
|
2
|
+
import { m as ElectronWorkspaceInfo, F as HostEnvironment } from '../types-DBYraXxE.js';
|
|
3
3
|
import '../workspace-path-CWVrcuPL.js';
|
|
4
4
|
|
|
5
5
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bendyline/docblocks",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Core data structures and filesystem abstractions for DocBlocks",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Bendyline",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
22
|
"engines": {
|
|
23
|
-
"node": "^
|
|
23
|
+
"node": "^24.18.0 || >=26.0.0"
|
|
24
24
|
},
|
|
25
25
|
"type": "module",
|
|
26
26
|
"main": "./dist/index.js",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"typecheck": "tsc --noEmit"
|
|
107
107
|
},
|
|
108
108
|
"dependencies": {
|
|
109
|
-
"@bendyline/squisq": "2.
|
|
109
|
+
"@bendyline/squisq": "2.11.1",
|
|
110
110
|
"zod": "3.25.76"
|
|
111
111
|
}
|
|
112
112
|
}
|