workspace_helpers.ts

view source

Declarations
#

3 declarations

ERROR_WORKSPACE_NOT_OPEN
#

workspace_helpers.ts view source

"workspace_not_open" import {ERROR_WORKSPACE_NOT_OPEN} from '@fuzdev/zzz/workspace_helpers.js';

data.reason of the invalid_params error workspace_close returns for a path that isn't an open workspace — e.g. one a daemon restart forgot.

parse_workspace_path
#

workspace_helpers.ts view source

(raw: string): Result<{ path: string & $brand<"DiskfilePath"> & $brand<"DiskfileDirectoryPath">; }, { message: string; }> import {parse_workspace_path} from '@fuzdev/zzz/workspace_helpers.js';

Parse user input (the open-workspace form or the ?workspace= URL param) into a workspace directory path, without throwing.

The input is trimmed and must be absolute. A leading ~ is rejected rather than expanded — the frontend can't know the daemon's home directory. The result is not canonical (/a/./b/ and symlinked paths pass through as given); the daemon canonicalizes on workspace_open, so callers should activate by the path in its output, not by this one.

raw

the path as typed or passed in the URL

type string

returns

Result

the path with a trailing slash, or a user-facing error message

WORKSPACE_DEGRADED_NOTICE
#

workspace_helpers.ts view source

"Not every directory has a file watch (likely the system's watch limit) — changes in some show up after a few seconds." import {WORKSPACE_DEGRADED_NOTICE} from '@fuzdev/zzz/workspace_helpers.js';

What to tell the user about a workspace whose watch_status is degraded: some of its directories have no file watch, so the daemon rescans them every few seconds instead.

Depends on
#

Imported by
#