@foleo/cli 0.1.48 → 0.1.53
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/README.md +150 -0
- package/dist/edit-context.d.ts +15 -0
- package/dist/edit-context.d.ts.map +1 -0
- package/dist/edit-context.js +83 -0
- package/dist/edit-context.js.map +1 -0
- package/dist/index.d.ts +11 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +487 -36
- package/dist/index.js.map +1 -1
- package/dist/members.d.ts +10 -0
- package/dist/members.d.ts.map +1 -0
- package/dist/members.js +129 -0
- package/dist/members.js.map +1 -0
- package/dist/move.d.ts +11 -0
- package/dist/move.d.ts.map +1 -0
- package/dist/move.js +149 -0
- package/dist/move.js.map +1 -0
- package/dist/path-workspace.d.ts +12 -0
- package/dist/path-workspace.d.ts.map +1 -0
- package/dist/path-workspace.js +278 -0
- package/dist/path-workspace.js.map +1 -0
- package/dist/shared.d.ts +6 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +44 -0
- package/dist/shared.js.map +1 -0
- package/dist/workspace-binding.d.ts +3 -0
- package/dist/workspace-binding.d.ts.map +1 -0
- package/dist/workspace-binding.js +37 -0
- package/dist/workspace-binding.js.map +1 -0
- package/dist/workspace-default.d.ts +4 -0
- package/dist/workspace-default.d.ts.map +1 -0
- package/dist/workspace-default.js +32 -0
- package/dist/workspace-default.js.map +1 -0
- package/dist/workspaces.d.ts +7 -1
- package/dist/workspaces.d.ts.map +1 -1
- package/dist/workspaces.js +10 -6
- package/dist/workspaces.js.map +1 -1
- package/package.json +1 -1
- package/skills/foleo/SKILL.md +236 -12
package/README.md
CHANGED
|
@@ -16,6 +16,11 @@ npx -y @foleo/cli whoami
|
|
|
16
16
|
npx -y @foleo/cli doctor
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
+
Login always prints `Open this link to sign in: <url>` to stderr and tries to
|
|
20
|
+
open the browser. Use `foleo login --no-browser` to skip opening it. The approving
|
|
21
|
+
browser must be on this computer because the callback is local (over SSH, use a
|
|
22
|
+
browser on the CLI host or forward the localhost callback port).
|
|
23
|
+
|
|
19
24
|
The default key can read, publish, unpublish, and delete or restore artifacts —
|
|
20
25
|
delete is reversible, holding the bytes for a 30-day restore window. Only
|
|
21
26
|
irreversible purge uses incremental authority: add `--allow-purge` at login when
|
|
@@ -106,3 +111,148 @@ bundle or keep more files unchanged. `foleo limits --json` reports
|
|
|
106
111
|
`service.contentSizeLimits.htmlArtifact` (`maxNewFiles`, `maxLegacyFiles`,
|
|
107
112
|
`maxFiles`). Runtime inspection covers at most 200 HTML/CSS/JS files: `auto`
|
|
108
113
|
selects `open` beyond that budget; explicit `contained` refuses.
|
|
114
|
+
|
|
115
|
+
## Named workspaces
|
|
116
|
+
|
|
117
|
+
```sh
|
|
118
|
+
foleo workspaces # alias: foleo workspaces ls
|
|
119
|
+
foleo workspaces --json
|
|
120
|
+
foleo workspaces create "Longboi" --address longboi
|
|
121
|
+
foleo login --workspace longboi --allow-workspaces
|
|
122
|
+
foleo whoami --json
|
|
123
|
+
foleo doctor --json
|
|
124
|
+
foleo save notes.md --file ./notes.md --workspace longboi
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
`workspaces` lists handles, names and roles; `*` marks the workspace this login
|
|
128
|
+
is bound to. JSON includes `boundWorkspaceHandle` and a `bound` flag per row.
|
|
129
|
+
Creation prints `{handle}.foleo.site`; without `--address`, the name becomes a
|
|
130
|
+
lowercase, hyphenated address. Use `--mutation-id <stable-id>` to replay the same
|
|
131
|
+
create after a lost response. Creating a workspace keeps this login in its
|
|
132
|
+
current workspace. Run `foleo login --workspace <new-handle>` to use the new one.
|
|
133
|
+
|
|
134
|
+
Each CLI credential is bound to one workspace. The browser confirms that choice;
|
|
135
|
+
login records the returned handle in local CLI configuration, separate from the
|
|
136
|
+
credential in macOS Keychain. `whoami` and `doctor` show it. Logging in again
|
|
137
|
+
replaces only the selected workspace's credential; other saved logins stay available.
|
|
138
|
+
`foleo use <handle>` chooses the default for this API. `FOLEO_TOKEN` still overrides Keychain credentials.
|
|
139
|
+
|
|
140
|
+
Global `--workspace <handle>` sends `Foleo-Workspace` on authenticated API calls.
|
|
141
|
+
It confirms the login's workspace; it cannot switch a credential to another one.
|
|
142
|
+
A mismatch fails before the requested API call with, for example:
|
|
143
|
+
“This login is for josh. Run foleo login --workspace longboi.” Older credentials
|
|
144
|
+
without recorded metadata first read `/me` to learn their binding. On cloud-file
|
|
145
|
+
commands (`save`, `read`, `share`, `ls`, and path `list`), `--workspace` also keeps
|
|
146
|
+
accepting a UUID tree ID; that UUID stays a tree selector, not a workspace header.
|
|
147
|
+
|
|
148
|
+
Workspace discovery needs read scope and creation additionally needs write scope.
|
|
149
|
+
A login that returns a different workspace than requested fails
|
|
150
|
+
before replacing the saved credential; confirm the requested workspace in the
|
|
151
|
+
browser picker. Neither operation silently switches workspace authority.
|
|
152
|
+
|
|
153
|
+
## Workspace membership (CLI 0.1.53)
|
|
154
|
+
|
|
155
|
+
Sign in with `foleo login --workspace longboi --allow-workspaces` and select
|
|
156
|
+
read + write on the browser consent form. `--workspace` selects the matching stored login and checks its binding. Each
|
|
157
|
+
credential stays bound to one handle. Use `foleo use longboi` to set the default
|
|
158
|
+
for this API, then `foleo save notes.md` writes there.
|
|
159
|
+
`foleo workspaces --json` lists all your memberships (handle, name, role and
|
|
160
|
+
`boundWorkspaceHandle`, `defaultWorkspaceHandle`, and per-workspace `storedLogin` /
|
|
161
|
+
`default` flags); `foleo workspaces create "Team" --address team`
|
|
162
|
+
creates a shared workspace and explicitly keeps the existing login bound.
|
|
163
|
+
|
|
164
|
+
```sh
|
|
165
|
+
foleo members [ls] --workspace longboi --json
|
|
166
|
+
foleo members invite alice@example.com bob@example.com --role edit --workspace longboi --json
|
|
167
|
+
foleo members role alice@example.com owner --workspace longboi --yes --json
|
|
168
|
+
foleo members remove alice@example.com --workspace longboi --yes --json
|
|
169
|
+
foleo members leave --workspace longboi --yes --json
|
|
170
|
+
foleo invites [ls] --workspace longboi --json
|
|
171
|
+
foleo invites resend <invite-id> --workspace longboi --yes --json
|
|
172
|
+
foleo invites revoke <invite-id> --workspace longboi --yes --json
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Omit `[ls]` or use `ls` literally. Invite roles are `edit` (Can edit) or `view`
|
|
176
|
+
(Can view, the default); role changes also accept `owner`. All members can list
|
|
177
|
+
members and leave. Only Owners can manage people and invitations. Personal
|
|
178
|
+
cannot have other members or be left; the last Owner cannot leave or demote.
|
|
179
|
+
Role changes, removal, leave, resend and revoke prompt in a terminal; automation
|
|
180
|
+
requires explicit `--yes`. Confirm consequential actions with the human before
|
|
181
|
+
using it. Role changes and removal revoke the affected member's bound sessions
|
|
182
|
+
and connections immediately; their files stay. `--json` returns only JSON.
|
|
183
|
+
|
|
184
|
+
An agent invite returns `status:approval_required`, `draftId`, `approvalUrl`
|
|
185
|
+
and the exact normalized recipients/role. Give that link to the Owner, who
|
|
186
|
+
confirms in Foleo before email is sent. Do not approve a draft with CLI/MCP.
|
|
187
|
+
Resend only sends an already approved invitation, rotates its token, and is
|
|
188
|
+
limited to once per 24 hours. Non-beta recipients need staff approval. No tool
|
|
189
|
+
returns invite tokens. Member email lookup follows every indexed member page.
|
|
190
|
+
|
|
191
|
+
REST: `GET/POST /v1/me/workspaces` accepts scoped bearer credentials; list
|
|
192
|
+
returns `{workspaces,boundWorkspaceHandle}` (browser picker clients retain their
|
|
193
|
+
array). Create needs `workspaces:read` + `workspaces:write` and returns
|
|
194
|
+
`connectionWorkspaceUnchanged:true`. Reads of members/invites and leaving your own membership need
|
|
195
|
+
`workspaces:read`; other mutations additionally need `workspaces:write`, with the
|
|
196
|
+
same role checks as Web. Discover endpoint schemas in `/openapi.json` and `/v1/capabilities`.
|
|
197
|
+
|
|
198
|
+
MCP tools: `list_foleo_my_workspaces`, `create_foleo_workspace`,
|
|
199
|
+
`list_foleo_workspace_members`, `invite_foleo_workspace_members`,
|
|
200
|
+
`change_foleo_workspace_member_role`, `remove_foleo_workspace_member`,
|
|
201
|
+
`leave_foleo_workspace`, `list_foleo_workspace_invites`,
|
|
202
|
+
`resend_foleo_workspace_invite`, `revoke_foleo_workspace_invite`.
|
|
203
|
+
Member mutations use `userId` from the member list; invite mutations use
|
|
204
|
+
`inviteId`. List members accepts `cursor`. Roles use `owner|publisher|viewer`.
|
|
205
|
+
`list_foleo_workspaces` still lists the bound workspace's file tree;
|
|
206
|
+
`list_foleo_my_workspaces` discovers all memberships without granting access to
|
|
207
|
+
another workspace. Create reports: “Claude is still connected to {bound};
|
|
208
|
+
reconnect and choose {new} to work there.” No multi-workspace connection or
|
|
209
|
+
`foleo use` is implemented here (spec 121 P4).
|
|
210
|
+
|
|
211
|
+
The unified Shared list is available with `foleo shared [--filter link|public|restricted] [--json]`, MCP `list_foleo_shared` (optional `filter`, `cursor`, `limit`), and `GET /v1/shared`. Link includes password links; restricted selects private publications. CLI follows every page; MCP callers follow `nextCursor` to null. API keys, bound app sessions and MCP OAuth can read it: `artifacts:read` is required and `workspaces:read` with a current grant adds workspace shares (`workspacesIncluded` reports this). Read-only workspace credentials receive metadata without recipient URLs.
|
|
212
|
+
|
|
213
|
+
CLI invitations accept `--role owner|edit|view` (default view). Members own their CLI credentials, bounded by their current role; viewers receive only read scopes. Members can revoke their own credentials; only Owners administer other people's keys. Reconnect or sign in again to choose another workspace.
|
|
214
|
+
|
|
215
|
+
## Move between workspaces (CLI 0.1.53)
|
|
216
|
+
|
|
217
|
+
`foleo mv "/Longboi US Warehouse Plan.md" --to-workspace longboi --to /`
|
|
218
|
+
|
|
219
|
+
Sign in to the source with workspace read + write consent. The person must be
|
|
220
|
+
Owner or Can edit in both workspaces. Confirm before using `--yes` in automation.
|
|
221
|
+
Files and folders (including descendants) are copied into destination storage,
|
|
222
|
+
charged to its quota, then the source goes to Trash. A move holds at most 200
|
|
223
|
+
items and 256 MiB. Name collisions are refused; rename first. Share IDs,
|
|
224
|
+
passwords and audience survive. Old hosts forward only while the destination
|
|
225
|
+
is link, password or public; Restricted does not disclose the destination.
|
|
226
|
+
The login remains bound to the source workspace.
|
|
227
|
+
|
|
228
|
+
Use `--mutation-id <stable-id>` for retries, `--json` for a single JSON result.
|
|
229
|
+
The retry key and resume command are printed to stderr before copying so an
|
|
230
|
+
interrupted process leaves recovery instructions.
|
|
231
|
+
If interrupted, use the reported `foleo mv --resume <move-id> --yes`; do not
|
|
232
|
+
start another move. The CLI advances bounded batches until completion and finishes pending cleanup. Content becomes ready through one atomic marker; physical source trash and alias cleanup follow in bounded batches. Agents
|
|
233
|
+
must ask the person before moving content across workspace membership boundaries.
|
|
234
|
+
MCP equivalents: `move_foleo_item_to_workspace`, `get_foleo_workspace_move`,
|
|
235
|
+
`continue_foleo_workspace_move`, `cancel_foleo_workspace_move`; poll with GET and advance with continue.
|
|
236
|
+
|
|
237
|
+
Cancel a pre-handoff move with `foleo mv --cancel <moveId> --yes` after confirming with the person. A current Owner/admin of either workspace can cancel; after copying, a destination Owner/admin can resume. The login stays bound to its workspace; use `--source-tree <originalSourceTreeId>` for destination-bound CLI recovery, or the original source workspace ID for REST/MCP.
|
|
238
|
+
|
|
239
|
+
## Separate workspace logins (CLI 0.1.53)
|
|
240
|
+
|
|
241
|
+
```sh
|
|
242
|
+
foleo login --workspace josh --allow-workspaces
|
|
243
|
+
foleo login --workspace longboi --allow-workspaces
|
|
244
|
+
foleo workspaces --json
|
|
245
|
+
foleo use longboi
|
|
246
|
+
foleo save notes.md --file ./notes.md
|
|
247
|
+
foleo read notes.md --workspace josh
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
Keychain credentials are separate for each API base and handle. The existing
|
|
251
|
+
unsuffixed Personal login still works; no migration or new sign-in is required.
|
|
252
|
+
`use` verifies a live stored login before saving a non-secret default preference.
|
|
253
|
+
`--workspace <handle>` overrides it for one command; `--workspace <UUID>` remains
|
|
254
|
+
a tree selector on path commands. `FOLEO_TOKEN` always wins over Keychain and must
|
|
255
|
+
match the requested handle; `workspace_mismatch` never silently switches it.
|
|
256
|
+
`logout --workspace <handle>` revokes and removes only that workspace's login.
|
|
257
|
+
The login indicators describe local stored credentials; the server rechecks
|
|
258
|
+
membership, role and expiry whenever they are used.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Outside user files. A named session is one serialized editing lane. No bearer, text or password is persisted. */
|
|
2
|
+
export declare class CliEditContext {
|
|
3
|
+
readonly root: string;
|
|
4
|
+
readonly binding: string;
|
|
5
|
+
constructor(root: string, binding: string);
|
|
6
|
+
private path;
|
|
7
|
+
private load;
|
|
8
|
+
private write;
|
|
9
|
+
context(create: () => Promise<string>): Promise<string>;
|
|
10
|
+
reset(): Promise<void>;
|
|
11
|
+
intent(hash: string): Promise<string>;
|
|
12
|
+
forgetIntent(hash: string): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export declare function cliStateRoot(env: NodeJS.ProcessEnv): string;
|
|
15
|
+
//# sourceMappingURL=edit-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit-context.d.ts","sourceRoot":"","sources":["../src/edit-context.ts"],"names":[],"mappings":"AAKA,oHAAoH;AACpH,qBAAa,cAAc;IAEvB,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM;gBADf,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM;IAE1B,OAAO,CAAC,IAAI;YAME,IAAI;YAmBJ,KAAK;IAYb,OAAO,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC;IAOrC,KAAK;IAKL,MAAM,CAAC,IAAI,EAAE,MAAM;IAQnB,YAAY,CAAC,IAAI,EAAE,MAAM;CAKhC;AACD,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,UASlD"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
2
|
+
import { constants } from "node:fs";
|
|
3
|
+
import { mkdir, open, rename, unlink } from "node:fs/promises";
|
|
4
|
+
import { homedir } from "node:os";
|
|
5
|
+
import { join } from "node:path";
|
|
6
|
+
/** Outside user files. A named session is one serialized editing lane. No bearer, text or password is persisted. */
|
|
7
|
+
export class CliEditContext {
|
|
8
|
+
root;
|
|
9
|
+
binding;
|
|
10
|
+
constructor(root, binding) {
|
|
11
|
+
this.root = root;
|
|
12
|
+
this.binding = binding;
|
|
13
|
+
}
|
|
14
|
+
path(suffix) {
|
|
15
|
+
return join(this.root, createHash("sha256").update(this.binding).digest("hex") + suffix);
|
|
16
|
+
}
|
|
17
|
+
async load(suffix) {
|
|
18
|
+
try {
|
|
19
|
+
const f = await open(this.path(suffix), constants.O_RDONLY | constants.O_NOFOLLOW);
|
|
20
|
+
try {
|
|
21
|
+
const st = await f.stat();
|
|
22
|
+
if ((st.mode & 0o077) !== 0 || !st.isFile())
|
|
23
|
+
throw new Error("Edit state must be a private regular file (0600).");
|
|
24
|
+
return await f.readFile("utf8");
|
|
25
|
+
}
|
|
26
|
+
finally {
|
|
27
|
+
await f.close();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch (e) {
|
|
31
|
+
if (e.code === "ENOENT")
|
|
32
|
+
return null;
|
|
33
|
+
throw e;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
async write(suffix, value) {
|
|
37
|
+
await mkdir(this.root, { recursive: true, mode: 0o700 });
|
|
38
|
+
const path = this.path(suffix), temp = path + "." + randomUUID();
|
|
39
|
+
const f = await open(temp, "wx", 0o600);
|
|
40
|
+
try {
|
|
41
|
+
await f.writeFile(value);
|
|
42
|
+
}
|
|
43
|
+
finally {
|
|
44
|
+
await f.close();
|
|
45
|
+
}
|
|
46
|
+
await rename(temp, path);
|
|
47
|
+
}
|
|
48
|
+
async context(create) {
|
|
49
|
+
const old = await this.load(".context");
|
|
50
|
+
if (old)
|
|
51
|
+
return old;
|
|
52
|
+
const ref = await create();
|
|
53
|
+
if (ref)
|
|
54
|
+
await this.write(".context", ref);
|
|
55
|
+
return ref;
|
|
56
|
+
}
|
|
57
|
+
async reset() {
|
|
58
|
+
await unlink(this.path(".context")).catch((e) => {
|
|
59
|
+
if (e.code !== "ENOENT")
|
|
60
|
+
throw e;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
async intent(hash) {
|
|
64
|
+
const suffix = "." + hash + ".intent";
|
|
65
|
+
const old = await this.load(suffix);
|
|
66
|
+
if (old)
|
|
67
|
+
return old;
|
|
68
|
+
const id = randomUUID();
|
|
69
|
+
await this.write(suffix, id);
|
|
70
|
+
return id;
|
|
71
|
+
}
|
|
72
|
+
async forgetIntent(hash) {
|
|
73
|
+
await unlink(this.path("." + hash + ".intent")).catch((e) => {
|
|
74
|
+
if (e.code !== "ENOENT")
|
|
75
|
+
throw e;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
export function cliStateRoot(env) {
|
|
80
|
+
return (env.FOLEO_STATE_DIR ??
|
|
81
|
+
join(env.XDG_STATE_HOME ?? join(env.HOME ?? homedir(), ".local", "state"), "foleo", "edit-contexts"));
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=edit-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit-context.js","sourceRoot":"","sources":["../src/edit-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,oHAAoH;AACpH,MAAM,OAAO,cAAc;IAEd;IACA;IAFX,YACW,IAAY,EACZ,OAAe;QADf,SAAI,GAAJ,I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IACZ,CAAC;IACD,KAAK,CAAC,YAAY,CAAC,IAAY;QAC7B,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;YAC1D,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ;gBAAE,MAAM,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AACD,MAAM,UAAU,YAAY,CAAC,GAAsB;IACjD,OAAO,CACL,GAAG,CAAC,eAAe;QACnB,IAAI,CACF,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,EACpE,OAAO,EACP,eAAe,CAChB,CACF,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,9 @@ export declare const FOLEO_LOGIN_SUCCESS_URL = "https://foleo.app/cli/authorized
|
|
|
7
7
|
export declare const SETTINGS_SURFACE_FIELD_IDS: readonly ["name", "title", "titleUserSet", "slug", "slugUserSet", "frontmatterDisplay", "foleoBarDisplay", "visibility", "password", "customDomain"];
|
|
8
8
|
export interface CliDeps {
|
|
9
9
|
fetch: typeof fetch;
|
|
10
|
+
confirm?(message: string): Promise<boolean>;
|
|
11
|
+
loadWorkspaceBinding?(api: string, token: string): Promise<string | null>;
|
|
12
|
+
saveWorkspaceBinding?(api: string, token: string, handle: string): Promise<void>;
|
|
10
13
|
imageProcessRunner?: ImageProcessRunner;
|
|
11
14
|
readFile(path: string, encoding: BufferEncoding): Promise<string>;
|
|
12
15
|
readFileBytes?(path: string): Promise<Uint8Array>;
|
|
@@ -27,9 +30,13 @@ export interface CliDeps {
|
|
|
27
30
|
stderr(message: string): void;
|
|
28
31
|
createBrowserCallback?(nonce: string): Promise<BrowserCallback>;
|
|
29
32
|
openUrl?(url: string): Promise<void>;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
loadDefaultWorkspace?(apiBase: string): Promise<string | null>;
|
|
34
|
+
saveDefaultWorkspace?(apiBase: string, handle: string): Promise<void>;
|
|
35
|
+
/** Internal command selection; never authority to rebind a credential. */
|
|
36
|
+
credentialWorkspace?: string;
|
|
37
|
+
loadCredential?(apiBase: string, handle?: string): Promise<string | null>;
|
|
38
|
+
saveCredential?(apiBase: string, token: string, handle?: string): Promise<void>;
|
|
39
|
+
deleteCredential?(apiBase: string, handle?: string): Promise<void>;
|
|
33
40
|
verifyCredentialStore?(apiBase: string): Promise<void>;
|
|
34
41
|
platform?: NodeJS.Platform;
|
|
35
42
|
nodeVersion?: string;
|
|
@@ -113,6 +120,7 @@ type LiveDocAssetFile = {
|
|
|
113
120
|
* assets manifest (spec 065). Absolute http(s) / data: / rooted paths skipped.
|
|
114
121
|
*/
|
|
115
122
|
export declare function scanMarkdownAssets(markdownPath: string, markdown: string, deps: CliDeps): Promise<LiveDocAssetFile[]>;
|
|
123
|
+
export declare function keychainAccount(apiBaseUrl: string, handle?: string): string;
|
|
116
124
|
export declare function createLoopbackCallback(nonce: string, timeoutMs?: number): Promise<BrowserCallback>;
|
|
117
125
|
/** SHA-256 of UTF-8 JSON ["html-v1", sorted [path, sha256, byteSize] triples].
|
|
118
126
|
* Paths are the upload scanner's root-relative POSIX paths, with leading slash.
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AA0CA,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACvB,MAAM,oBAAoB,CAAC;AAuC5B,iGAAiG;AACjG,eAAO,MAAM,uBAAuB,qCAAqC,C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