diff --git a/changes/release-1.0.md b/changes/release-1.0.md new file mode 100644 index 0000000..e9ee846 --- /dev/null +++ b/changes/release-1.0.md @@ -0,0 +1,12 @@ +### Changed — may break callers + +- **Built on cli-core 1.0.0 and cli-base 1.0.0.** The generated API files read their types from + `@wirecat/cli-base/codegen/runtime`. Store version 73 comes with cli-core 1.0: once a 1.0 tool opens the store, a 0.x + tool refuses it, so upgrade every WireCat CLI together. + +### Fixed + +- **Over MCP, a Disk path stays a Disk path.** `files` paths and `--folder`, `mirrors add`'s Disk folder, `--ignore` + and `mirrors versions`' path are marked as not local, so the server no longer makes them absolute against the + client's folder or checks them as files on this computer. A local file, like `files upload ` or + `files download --output`, is still checked. diff --git a/package.json b/package.json index 312894d..c61c0bf 100644 --- a/package.json +++ b/package.json @@ -61,8 +61,8 @@ "spec:sync": "node --experimental-strip-types scripts/sync-spec.ts" }, "dependencies": { - "@wirecat/cli-base": "0.132.0", - "@wirecat/cli-core": "0.750.0", + "@wirecat/cli-base": "1.0.0", + "@wirecat/cli-core": "1.0.0", "commander": "15.0.0", "valibot": "1.5.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 87c96e0..f0c390d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,11 +13,11 @@ importers: .: dependencies: '@wirecat/cli-base': - specifier: 0.132.0 - version: 0.132.0(@scalar/openapi-upgrader@0.4.6)(commander@15.0.0)(esbuild@0.28.2)(swagger-converter@2.1.0)(typescript@7.0.2)(vitest@5.0.5) + specifier: 1.0.0 + version: 1.0.0(@scalar/openapi-upgrader@0.4.6)(commander@15.0.0)(esbuild@0.28.2)(swagger-converter@2.1.0)(typescript@7.0.2)(vitest@5.0.5) '@wirecat/cli-core': - specifier: 0.750.0 - version: 0.750.0(@wirecat/cli-base@0.132.0(@scalar/openapi-upgrader@0.4.6)(commander@15.0.0)(esbuild@0.28.2)(swagger-converter@2.1.0)(typescript@7.0.2)(vitest@5.0.5))(commander@15.0.0)(typescript@7.0.2)(zod@4.6.7) + specifier: 1.0.0 + version: 1.0.0(@wirecat/cli-base@1.0.0(@scalar/openapi-upgrader@0.4.6)(commander@15.0.0)(esbuild@0.28.2)(swagger-converter@2.1.0)(typescript@7.0.2)(vitest@5.0.5))(commander@15.0.0)(typescript@7.0.2)(zod@4.6.7) commander: specifier: 15.0.0 version: 15.0.0 @@ -1203,16 +1203,16 @@ packages: '@wasm-audio-decoders/opus-ml@0.0.3': resolution: {integrity: sha512-SEeTmk0eb3q5etJA/NHCRWW6BivTx9tqvNTmG0kg2ynuATEQRUZnwQE6Ibvl1BBvqIGHqI57+qyJMWmJBwb5XQ==} - '@wirecat/cli-base@0.132.0': - resolution: {integrity: sha512-y43hIGVFDUgVFTksTFnlK0KdLuROBDcv0smqme4/WSjkUS3PaGQnuAvu09G2VvW0zmvM2+OHFuQaZEN3Hir8nQ==} - engines: {node: '>=22'} + '@wirecat/cli-base@1.0.0': + resolution: {integrity: sha512-PJ61d6z0CsWOmoWgf7uvlEo3EstpL2DplXiORPIqgmh0bn/ZGMOhRpDqN43Kh7WickaFSmeX74YQigHXkRO6rA==} + engines: {node: ^22.16.0 || >=24} hasBin: true peerDependencies: '@scalar/openapi-upgrader': ^0.4.6 - commander: '>=15' + commander: ^15.0.0 esbuild: ^0.28.0 swagger-converter: ^2.1.0 - vitest: '>=5' + vitest: ^5.0.0 peerDependenciesMeta: '@scalar/openapi-upgrader': optional: true @@ -1231,14 +1231,14 @@ packages: '@wirecat/cli-core-sqlite@1.1.0': resolution: {integrity: sha512-GpGlh/dAIX/nblBYCdT6DfWSLFxav9mxxeELQAfEuw+QZdT9unKxbi5xa02s/s4JS1P7n0PQx2sCABj4FlMRNw==} - '@wirecat/cli-core@0.750.0': - resolution: {integrity: sha512-9xUOyRg8cAmb64EJ37thM6AbNNy3xbgVRMhCjTjKU9xN0osUWO1euXB8IN+qmgn1W7aQU2tuXP4XcsuJUY2Evw==} + '@wirecat/cli-core@1.0.0': + resolution: {integrity: sha512-0avQTqu3FAFKE0s+8Pz1Up/TMHTYqCdDn37lcZmkH30sMCMrgJwHzoG4Q0fjVzPsB85u+zBVHHhtQjF/eSTpuw==} engines: {node: ^22.16.0 || >=24} hasBin: true peerDependencies: '@napi-rs/canvas': '>=0.1.69 <2' - '@wirecat/cli-base': '>=0.125.0 <1.0.0' - commander: '>=15' + '@wirecat/cli-base': ^1.0.0-0 + commander: ^15.0.0 mysql2: ^3.24.6 pg: ^8.23.1 ssh2: ^1.17.0 @@ -3377,7 +3377,7 @@ snapshots: dependencies: '@wasm-audio-decoders/common': 9.0.7 - '@wirecat/cli-base@0.132.0(@scalar/openapi-upgrader@0.4.6)(commander@15.0.0)(esbuild@0.28.2)(swagger-converter@2.1.0)(typescript@7.0.2)(vitest@5.0.5)': + '@wirecat/cli-base@1.0.0(@scalar/openapi-upgrader@0.4.6)(commander@15.0.0)(esbuild@0.28.2)(swagger-converter@2.1.0)(typescript@7.0.2)(vitest@5.0.5)': dependencies: '@valibot/to-json-schema': 1.8.0(valibot@1.5.0(typescript@7.0.2)) cli-table3: 0.6.5 @@ -3400,7 +3400,7 @@ snapshots: '@wirecat/cli-core-sqlite@1.1.0': {} - '@wirecat/cli-core@0.750.0(@wirecat/cli-base@0.132.0(@scalar/openapi-upgrader@0.4.6)(commander@15.0.0)(esbuild@0.28.2)(swagger-converter@2.1.0)(typescript@7.0.2)(vitest@5.0.5))(commander@15.0.0)(typescript@7.0.2)(zod@4.6.7)': + '@wirecat/cli-core@1.0.0(@wirecat/cli-base@1.0.0(@scalar/openapi-upgrader@0.4.6)(commander@15.0.0)(esbuild@0.28.2)(swagger-converter@2.1.0)(typescript@7.0.2)(vitest@5.0.5))(commander@15.0.0)(typescript@7.0.2)(zod@4.6.7)': dependencies: '@anthropic-ai/sdk': 1.3.0(zod@4.6.7) '@bomb.sh/tab': 0.0.22(commander@15.0.0) @@ -3410,7 +3410,7 @@ snapshots: '@valibot/to-json-schema': 1.8.0(valibot@1.5.0(typescript@7.0.2)) '@wasm-audio-decoders/flac': 0.2.11 '@wasm-audio-decoders/ogg-vorbis': 0.1.20 - '@wirecat/cli-base': 0.132.0(@scalar/openapi-upgrader@0.4.6)(commander@15.0.0)(esbuild@0.28.2)(swagger-converter@2.1.0)(typescript@7.0.2)(vitest@5.0.5) + '@wirecat/cli-base': 1.0.0(@scalar/openapi-upgrader@0.4.6)(commander@15.0.0)(esbuild@0.28.2)(swagger-converter@2.1.0)(typescript@7.0.2)(vitest@5.0.5) '@wirecat/cli-core-onnx': 1.2.0 '@wirecat/cli-core-sqlite': 1.1.0 '@xmldom/xmldom': 0.9.12 diff --git a/src/commands/files.ts b/src/commands/files.ts index 16e3c34..df79d8b 100644 --- a/src/commands/files.ts +++ b/src/commands/files.ts @@ -12,6 +12,7 @@ import { itemOf, listOf, nextUsually, + notLocalPaths, outputFor, ownerOnlyOption, REMOTE_READ, @@ -407,5 +408,6 @@ export const filesCommand = (): Command => { ) .addCommand(serveCommand()) addFileEditCommands(files, editHelpers(files)) - return files + // A and --folder here name the Disk, so serve must not make them absolute on this computer. + return notLocalPaths(files, "path", "folder") } diff --git a/src/commands/mirrors.ts b/src/commands/mirrors.ts index 0c586a4..4ffbfc8 100644 --- a/src/commands/mirrors.ts +++ b/src/commands/mirrors.ts @@ -12,6 +12,7 @@ import { LOCAL_READ, LOCAL_WRITE, listOf, + notLocalPaths, outputFor, ownerOnlyOption, parseDuration, @@ -869,7 +870,7 @@ const insideOf = (root: string, input: string) => { } const versionsCommand = () => - annotate(new Command("versions"), { effects: LOCAL_READ, mcp: false }) + notLocalPaths(annotate(new Command("versions"), { effects: LOCAL_READ, mcp: false }), "path") .summary("versions of mirrored files that syncs replaced or deleted") .description("the versions of a mirrored file that syncs replaced or deleted, kept on this computer") .addCommand( @@ -946,8 +947,9 @@ const conflictsCommand = () => }, }) +// Not against the working folder: --ignore and versions' are inside the mirror, add's is on Disk. export const mirrorsCommand = (): Command => - annotate(new Command("mirrors"), { effects: LOCAL_READ }) + notLocalPaths(annotate(new Command("mirrors"), { effects: LOCAL_READ }), "ignore", "folder") .description(`keep local folders and ${SERVICE} folders the same, both ways, file by file`) .addCommand(addCommand()) .addCommand(listCommand()) diff --git a/src/generated/definitions.ts b/src/generated/definitions.ts index 1c01ca3..75f1555 100644 --- a/src/generated/definitions.ts +++ b/src/generated/definitions.ts @@ -2,7 +2,7 @@ // Source: spec/ydisk/, checked against provenance.json // Run: pnpm generate -import type { SchemaNode } from "@wirecat/cli-base/codegen" +import type { SchemaNode } from "@wirecat/cli-base/codegen/runtime" export const definitions: Readonly> = { AiPhotoEditorCounter: { diff --git a/src/generated/manifest.ts b/src/generated/manifest.ts index 3782ecb..51abce3 100644 --- a/src/generated/manifest.ts +++ b/src/generated/manifest.ts @@ -2,7 +2,12 @@ // Source: spec/ydisk/, checked against provenance.json // Run: pnpm generate -import type { ApiServer, ManifestOperation, SecurityRequirement, SecurityScheme } from "@wirecat/cli-base/codegen" +import type { + ApiServer, + ManifestOperation, + SecurityRequirement, + SecurityScheme, +} from "@wirecat/cli-base/codegen/runtime" export const operations: readonly ManifestOperation[] = [ { diff --git a/src/ingestion.ts b/src/ingestion.ts index 9daff9d..522b6ce 100644 --- a/src/ingestion.ts +++ b/src/ingestion.ts @@ -13,7 +13,9 @@ export const PROVIDER = { const external = (id: string) => `${id}.md` /** How the Disk's files are filed in the shared store; the documents commands and a replace's rekey share it. */ -export const diskIngestion = (store: Parameters[0]) => +export const diskIngestion = ( + store: Parameters[0], +): ReturnType> => documentIngestion(store, { provider: PROVIDER.name, externalId: external,