Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions changes/release-1.0.md
Original file line number Diff line number Diff line change
@@ -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 <file>` or
`files download --output`, is still checked.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
32 changes: 16 additions & 16 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/commands/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
itemOf,
listOf,
nextUsually,
notLocalPaths,
outputFor,
ownerOnlyOption,
REMOTE_READ,
Expand Down Expand Up @@ -407,5 +408,6 @@ export const filesCommand = (): Command => {
)
.addCommand(serveCommand())
addFileEditCommands(files, editHelpers(files))
return files
// A <path> and --folder here name the Disk, so serve must not make them absolute on this computer.
return notLocalPaths(files, "path", "folder")
}
6 changes: 4 additions & 2 deletions src/commands/mirrors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
LOCAL_READ,
LOCAL_WRITE,
listOf,
notLocalPaths,
outputFor,
ownerOnlyOption,
parseDuration,
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -946,8 +947,9 @@ const conflictsCommand = () =>
},
})

// Not against the working folder: --ignore and versions' <path> are inside the mirror, add's <folder> 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())
Expand Down
2 changes: 1 addition & 1 deletion src/generated/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Record<string, SchemaNode>> = {
AiPhotoEditorCounter: {
Expand Down
7 changes: 6 additions & 1 deletion src/generated/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [
{
Expand Down
4 changes: 3 additions & 1 deletion src/ingestion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof documentIngestion>[0]) =>
export const diskIngestion = (
store: Parameters<typeof documentIngestion>[0],
): ReturnType<typeof documentIngestion<DiskFile>> =>
documentIngestion<DiskFile>(store, {
provider: PROVIDER.name,
externalId: external,
Expand Down
Loading