@dreamlake/dreamlake-cli 0.107.0 → 0.107.2
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/dist/api/bindrs.d.ts +76 -0
- package/dist/api/bindrs.js +83 -0
- package/dist/api/client.d.ts +3 -0
- package/dist/api/client.js +4 -1
- package/dist/api/common.js +2 -2
- package/dist/api/execution.js +4 -4
- package/dist/api/host-moves.js +2 -2
- package/dist/api/index.d.ts +126 -14
- package/dist/api/memo-facade.d.ts +1 -1
- package/dist/api/memo-facade.js +2 -2
- package/dist/api/memo-reading.js +2 -2
- package/dist/api/memos.d.ts +2 -2
- package/dist/api/memos.js +3 -3
- package/dist/api/native-experiments.js +2 -2
- package/dist/api/platform.js +6 -6
- package/dist/api/sessions.js +5 -5
- package/dist/api/workspace.d.ts +66 -8
- package/dist/api/workspace.js +4 -10
- package/dist/cli/create/index.d.ts +1 -0
- package/dist/cli/create/index.js +23 -9
- package/dist/cli/delete/index.js +13 -4
- package/dist/cli/help-examples.generated.js +3 -1
- package/dist/cli/list/index.js +5 -7
- package/dist/cli/memos/index.d.ts +1 -0
- package/dist/cli/memos/index.js +11 -2
- package/dist/cli/resources.d.ts +2 -0
- package/dist/cli/resources.js +17 -3
- package/dist/cli/self-update/index.js +6 -4
- package/dist/cli/self-update/install.d.ts +5 -1
- package/dist/cli/self-update/install.js +28 -86
- package/dist/cli/self-update/shell-path.d.ts +4 -0
- package/dist/cli/self-update/shell-path.js +135 -0
- package/dist/cli/share.js +3 -3
- package/dist/cli/update/index.js +29 -65
- package/dist/cli/version.d.ts +1 -1
- package/dist/cli/version.js +1 -1
- package/package.json +9 -9
package/dist/api/workspace.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from "./bindrs.js";
|
|
1
2
|
/** Workspace resource APIs. Authentication/ACLs stay in the existing service routes. */
|
|
2
3
|
import { type Transport } from "./client.js";
|
|
3
4
|
import { type JsonObject, type Query, type Resource } from "./common.js";
|
|
@@ -35,6 +36,39 @@ export declare function projectsApi(t: Transport, namespace: string): {
|
|
|
35
36
|
totalPages: number;
|
|
36
37
|
}>;
|
|
37
38
|
resources: (project: string, kind: "bindrs" | "datasets" | "episodes") => {
|
|
39
|
+
list: (query?: Query) => Promise<{
|
|
40
|
+
bindrs: import("./bindrs.js").Bindr[];
|
|
41
|
+
}>;
|
|
42
|
+
create: (input: import("./bindrs.js").BindrInput) => Promise<{
|
|
43
|
+
bindr: import("./bindrs.js").Bindr;
|
|
44
|
+
}>;
|
|
45
|
+
get: (nameOrId: string, query?: Query) => Promise<import("./bindrs.js").BindrDetail>;
|
|
46
|
+
summary: (nameOrId: string) => Promise<{
|
|
47
|
+
bindr: import("./bindrs.js").Bindr;
|
|
48
|
+
}>;
|
|
49
|
+
update: (nameOrId: string, input: Partial<Omit<import("./bindrs.js").BindrInput, "member" | "members">>) => Promise<{
|
|
50
|
+
bindr: import("./bindrs.js").Bindr;
|
|
51
|
+
}>;
|
|
52
|
+
delete: (nameOrId: string) => Promise<{
|
|
53
|
+
deleted: boolean;
|
|
54
|
+
}>;
|
|
55
|
+
addMember: (nameOrId: string, nodeId: string) => Promise<{
|
|
56
|
+
added: boolean;
|
|
57
|
+
memberCount: number;
|
|
58
|
+
}>;
|
|
59
|
+
removeMember: (nameOrId: string, nodeId: string) => Promise<{
|
|
60
|
+
removed: boolean;
|
|
61
|
+
memberCount: number;
|
|
62
|
+
}>;
|
|
63
|
+
addMembers: (nameOrId: string, nodeIds: string[]) => Promise<{
|
|
64
|
+
completedNodeIds: string[];
|
|
65
|
+
memberCount: number | undefined;
|
|
66
|
+
}>;
|
|
67
|
+
removeMembers: (nameOrId: string, nodeIds: string[]) => Promise<{
|
|
68
|
+
completedNodeIds: string[];
|
|
69
|
+
memberCount: number | undefined;
|
|
70
|
+
}>;
|
|
71
|
+
} | {
|
|
38
72
|
list: (query?: Query) => Promise<{
|
|
39
73
|
[key: string]: unknown;
|
|
40
74
|
}>;
|
|
@@ -44,15 +78,38 @@ export declare function projectsApi(t: Transport, namespace: string): {
|
|
|
44
78
|
delete: (id: string) => Promise<unknown>;
|
|
45
79
|
};
|
|
46
80
|
bindrs: (project: string) => {
|
|
47
|
-
addMembers: (name: string, add: string[]) => Promise<unknown>;
|
|
48
|
-
removeMembers: (name: string, remove: string[]) => Promise<unknown>;
|
|
49
81
|
list: (query?: Query) => Promise<{
|
|
50
|
-
|
|
82
|
+
bindrs: import("./bindrs.js").Bindr[];
|
|
83
|
+
}>;
|
|
84
|
+
create: (input: import("./bindrs.js").BindrInput) => Promise<{
|
|
85
|
+
bindr: import("./bindrs.js").Bindr;
|
|
86
|
+
}>;
|
|
87
|
+
get: (nameOrId: string, query?: Query) => Promise<import("./bindrs.js").BindrDetail>;
|
|
88
|
+
summary: (nameOrId: string) => Promise<{
|
|
89
|
+
bindr: import("./bindrs.js").Bindr;
|
|
90
|
+
}>;
|
|
91
|
+
update: (nameOrId: string, input: Partial<Omit<import("./bindrs.js").BindrInput, "member" | "members">>) => Promise<{
|
|
92
|
+
bindr: import("./bindrs.js").Bindr;
|
|
93
|
+
}>;
|
|
94
|
+
delete: (nameOrId: string) => Promise<{
|
|
95
|
+
deleted: boolean;
|
|
96
|
+
}>;
|
|
97
|
+
addMember: (nameOrId: string, nodeId: string) => Promise<{
|
|
98
|
+
added: boolean;
|
|
99
|
+
memberCount: number;
|
|
100
|
+
}>;
|
|
101
|
+
removeMember: (nameOrId: string, nodeId: string) => Promise<{
|
|
102
|
+
removed: boolean;
|
|
103
|
+
memberCount: number;
|
|
104
|
+
}>;
|
|
105
|
+
addMembers: (nameOrId: string, nodeIds: string[]) => Promise<{
|
|
106
|
+
completedNodeIds: string[];
|
|
107
|
+
memberCount: number | undefined;
|
|
108
|
+
}>;
|
|
109
|
+
removeMembers: (nameOrId: string, nodeIds: string[]) => Promise<{
|
|
110
|
+
completedNodeIds: string[];
|
|
111
|
+
memberCount: number | undefined;
|
|
51
112
|
}>;
|
|
52
|
-
get: (id: string) => Promise<Resource>;
|
|
53
|
-
create: (input: JsonObject) => Promise<Resource>;
|
|
54
|
-
update: (id: string, input: Partial<JsonObject>) => Promise<Resource>;
|
|
55
|
-
delete: (id: string) => Promise<unknown>;
|
|
56
113
|
};
|
|
57
114
|
datasets: (project: string) => {
|
|
58
115
|
addBindrs: (name: string, add: string[]) => Promise<unknown>;
|
|
@@ -210,11 +267,12 @@ export declare function connectionsApi(t: Transport, namespace: string): {
|
|
|
210
267
|
delete: (id: string, expectedSettingsRevision: number, key: string) => Promise<unknown>;
|
|
211
268
|
};
|
|
212
269
|
export type ArtifactVisibility = "private" | "public" | "unlisted";
|
|
270
|
+
export type MemoVisibility = "private" | "public" | "unlisted";
|
|
213
271
|
export declare function sharingApi<K extends "notes" | "artifacts">(t: Transport, namespace: string, kind: K, id: string): {
|
|
214
272
|
get: () => Promise<Record<string, unknown>>;
|
|
215
273
|
create: (role?: "read" | "write") => Promise<unknown>;
|
|
216
274
|
revoke: (revokeAccepted?: boolean) => Promise<unknown>;
|
|
217
|
-
visibility: (visibility: K extends "artifacts" ? ArtifactVisibility :
|
|
275
|
+
visibility: (visibility: K extends "artifacts" ? ArtifactVisibility : MemoVisibility) => Promise<unknown>;
|
|
218
276
|
access: () => Promise<unknown>;
|
|
219
277
|
remove: (userId: string) => Promise<unknown>;
|
|
220
278
|
};
|
package/dist/api/workspace.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { bindrsApi } from "./bindrs.js";
|
|
2
|
+
export * from "./bindrs.js";
|
|
1
3
|
/** Workspace resource APIs. Authentication/ACLs stay in the existing service routes. */
|
|
2
4
|
import { seg } from "./client.js";
|
|
3
5
|
import { namespacePath, resourceApi, call, } from "./common.js";
|
|
@@ -46,16 +48,8 @@ export function projectsApi(t, namespace) {
|
|
|
46
48
|
},
|
|
47
49
|
/** Mixed project resources, or one bindr's members via the bindr filter. */
|
|
48
50
|
resourceList: (project, query = {}) => call(t, "GET", path(project) + "/resources", undefined, query),
|
|
49
|
-
resources: (project, kind) => resourceApi(t, path(project) + "/" + kind),
|
|
50
|
-
bindrs: (project) => (
|
|
51
|
-
...resourceApi(t, path(project) + "/bindrs"),
|
|
52
|
-
addMembers: (name, add) => call(t, "POST", path(project) + "/bindrs/" + seg(name) + "/members", {
|
|
53
|
-
add,
|
|
54
|
-
}),
|
|
55
|
-
removeMembers: (name, remove) => call(t, "DELETE", path(project) + "/bindrs/" + seg(name) + "/members", {
|
|
56
|
-
remove,
|
|
57
|
-
}),
|
|
58
|
-
}),
|
|
51
|
+
resources: (project, kind) => kind === "bindrs" ? bindrsApi(t, namespace, project) : resourceApi(t, path(project) + "/" + kind),
|
|
52
|
+
bindrs: (project) => bindrsApi(t, namespace, project),
|
|
59
53
|
datasets: (project) => ({
|
|
60
54
|
...resourceApi(t, path(project) + "/datasets"),
|
|
61
55
|
addBindrs: (name, add) => call(t, "POST", path(project) + "/datasets/" + seg(name) + "/bindrs", {
|
|
@@ -4,6 +4,7 @@ interface CreateOpts {
|
|
|
4
4
|
episode?: string;
|
|
5
5
|
description?: string;
|
|
6
6
|
tags?: string;
|
|
7
|
+
yes?: boolean;
|
|
7
8
|
}
|
|
8
9
|
export declare function runCreateBindr(name: string, opts: CreateOpts): Promise<number>;
|
|
9
10
|
export declare function runCreateDataset(name: string, opts: CreateOpts): Promise<number>;
|
package/dist/cli/create/index.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
//
|
|
4
|
-
// bindr — members are EPISODES matched by `--episode <glob>` (node path)
|
|
5
|
-
// dataset — created empty; add bindrs later via `update dataset`
|
|
1
|
+
import { bindrsApi, BindrMembersError } from "../../api/bindrs.js";
|
|
2
|
+
import { createTransport, namespaceSeg, seg } from "../../api/client.js";
|
|
6
3
|
import { HttpError, requestJson } from "../client.js";
|
|
7
4
|
import { resolveNamespace, resolveRemote, resolveToken } from "../config.js";
|
|
8
5
|
import { fail, ok, splitCsv } from "../helpers.js";
|
|
@@ -18,7 +15,7 @@ export async function runCreateBindr(name, opts) {
|
|
|
18
15
|
if (!ctx)
|
|
19
16
|
return 1;
|
|
20
17
|
const { s, token, remote } = ctx;
|
|
21
|
-
const base = `/namespaces/${s.namespace}/projects/${s.project}/bindrs`;
|
|
18
|
+
const base = `/namespaces/${namespaceSeg(s.namespace)}/projects/${seg(s.project)}/bindrs`;
|
|
22
19
|
let members = [];
|
|
23
20
|
if (opts.episode) {
|
|
24
21
|
const episodes = await fetchAllEpisodes(remote, s.namespace, s.project, token, { includeArchived: true });
|
|
@@ -30,21 +27,27 @@ export async function runCreateBindr(name, opts) {
|
|
|
30
27
|
process.stdout.write(`Matched ${matched.length} episode(s):\n`);
|
|
31
28
|
for (const ep of matched)
|
|
32
29
|
process.stdout.write(` ${ep.nodePath ?? ep.name ?? ""}\n`);
|
|
33
|
-
const proceed = await confirm(`Create bindr '${name}' with ${matched.length} episodes?`, false);
|
|
30
|
+
const proceed = opts.yes || await confirm(`Create bindr '${name}' with ${matched.length} episodes?`, false);
|
|
34
31
|
if (!proceed) {
|
|
35
32
|
process.stdout.write("Cancelled.\n");
|
|
36
33
|
return 0;
|
|
37
34
|
}
|
|
38
35
|
members = matched.map((ep) => ep.id);
|
|
39
36
|
}
|
|
40
|
-
const body = { name
|
|
37
|
+
const body = { name };
|
|
41
38
|
if (opts.description)
|
|
42
39
|
body.description = opts.description;
|
|
43
40
|
const tags = splitCsv(opts.tags);
|
|
44
41
|
if (tags.length)
|
|
45
42
|
body.tags = tags;
|
|
43
|
+
let bindrId;
|
|
46
44
|
try {
|
|
47
|
-
await requestJson(remote, base, { method: "POST", token, json: body });
|
|
45
|
+
const created = await requestJson(remote, base, { method: "POST", token, json: body });
|
|
46
|
+
if (!created?.bindr || typeof created.bindr.id !== "string" || !created.bindr.id.trim()) {
|
|
47
|
+
fail(`Bindr creation returned success without a usable Bindr ID. '${name}' may have been created in ${formatProject(s)}; inspect the project before retrying. No episode tagging requests were sent.`);
|
|
48
|
+
return 1;
|
|
49
|
+
}
|
|
50
|
+
bindrId = created.bindr.id;
|
|
48
51
|
}
|
|
49
52
|
catch (err) {
|
|
50
53
|
if (err instanceof HttpError && err.status === 409) {
|
|
@@ -58,7 +61,17 @@ export async function runCreateBindr(name, opts) {
|
|
|
58
61
|
fail(err.message);
|
|
59
62
|
return 1;
|
|
60
63
|
}
|
|
64
|
+
if (members.length) {
|
|
65
|
+
try {
|
|
66
|
+
await bindrsApi(createTransport({ remote, token }), s.namespace, s.project).addMembers(bindrId, members);
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
fail(`Created bindr '${name}' (${bindrId}), but episode tagging did not complete. ${err instanceof BindrMembersError ? err.message : String(err)}. Inspect this bindr before retrying; it was not deleted.`);
|
|
70
|
+
return 1;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
61
73
|
ok(`Created bindr: ${name} in ${formatProject(s)}`);
|
|
74
|
+
process.stdout.write(` id: ${bindrId}\n`);
|
|
62
75
|
if (members.length)
|
|
63
76
|
process.stdout.write(` episodes: ${members.length}\n`);
|
|
64
77
|
if (opts.description)
|
|
@@ -191,6 +204,7 @@ export function registerCreateCommand(program) {
|
|
|
191
204
|
.argument("<name>", "bindr name")
|
|
192
205
|
.requiredOption("--project <target>", "project scope: space[@namespace]")
|
|
193
206
|
.option("--episode <glob>", "glob to match episodes by node path")
|
|
207
|
+
.option("--yes", "skip the confirmation prompt")
|
|
194
208
|
.option("--description <text>", "description")
|
|
195
209
|
.option("--tags <list>", "comma-separated tags")
|
|
196
210
|
.action(async (name, opts) => {
|
package/dist/cli/delete/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
// Port of dreamlake-py's cli/commands/delete.py.
|
|
1
|
+
import { seg } from "../../api/client.js";
|
|
3
2
|
import { HttpError, requestJson } from "../client.js";
|
|
4
3
|
import { resolveNamespace, resolveRemote, resolveToken } from "../config.js";
|
|
5
4
|
import { fail, ok } from "../helpers.js";
|
|
6
5
|
import { confirm } from "../prompt.js";
|
|
7
|
-
import { fetchAllEpisodes, fetchProjects, lookupNode, resolveProjectCtx, } from "../resources.js";
|
|
6
|
+
import { fetchAllEpisodes, fetchProjects, lookupNode, resolveProjectCtx, resolveBindr, } from "../resources.js";
|
|
8
7
|
import { formatProject, parseTarget } from "../target.js";
|
|
9
8
|
async function runDelete(kind, name, opts) {
|
|
10
9
|
if (!opts.project) {
|
|
@@ -16,6 +15,16 @@ async function runDelete(kind, name, opts) {
|
|
|
16
15
|
return 1;
|
|
17
16
|
const { s, token, remote } = ctx;
|
|
18
17
|
const proj = formatProject(s);
|
|
18
|
+
let bindrId;
|
|
19
|
+
if (kind === "bindr") {
|
|
20
|
+
try {
|
|
21
|
+
bindrId = (await resolveBindr(ctx, name)).id;
|
|
22
|
+
}
|
|
23
|
+
catch (err) {
|
|
24
|
+
fail(err.message);
|
|
25
|
+
return 1;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
19
28
|
if (!opts.yes) {
|
|
20
29
|
const proceed = await confirm(`Delete ${kind} '${name}' from ${proj}?`, false);
|
|
21
30
|
if (!proceed) {
|
|
@@ -25,7 +34,7 @@ async function runDelete(kind, name, opts) {
|
|
|
25
34
|
}
|
|
26
35
|
const collection = kind === "bindr" ? "bindrs" : "datasets";
|
|
27
36
|
try {
|
|
28
|
-
await requestJson(remote, `/namespaces/${s.namespace}/projects/${s.project}/${collection}/${name}`, { method: "DELETE", token });
|
|
37
|
+
await requestJson(remote, bindrId ? `/bindrs/${seg(bindrId)}` : `/namespaces/${seg(s.namespace)}/projects/${seg(s.project)}/${collection}/${seg(name)}`, { method: "DELETE", token });
|
|
29
38
|
}
|
|
30
39
|
catch (err) {
|
|
31
40
|
if (err instanceof HttpError && err.status === 404) {
|
|
@@ -80,6 +80,7 @@ export const helpExamples = {
|
|
|
80
80
|
"infra transfer create": "dreamlake infra transfer create 616658fd-531c-4bb9-8f52-7ebcbaa350b9 \\\n --request-file stack-transfer.json --confirm --accept-if-authorized",
|
|
81
81
|
"infra transfer status": "dreamlake infra transfer status 616658fd-531c-4bb9-8f52-7ebcbaa350b1 \\\n --out stack-transfer-acceptance.json",
|
|
82
82
|
"infra transfer accept": "dreamlake infra transfer accept 616658fd-531c-4bb9-8f52-7ebcbaa350b1 \\\n --request-file stack-transfer-acceptance.json --confirm",
|
|
83
|
+
"install": "# Reinstall and configure the shell selected by SHELL.\ndreamlake install\n# Install a channel without editing shell startup files or user PATH.\ndreamlake install stable --no-modify-path",
|
|
83
84
|
"jobs register": "dreamlake jobs register --namespace geyang --name train-baseline \\\n --host 0123456789abcdef01234567 --request-id train-baseline-01",
|
|
84
85
|
"jobs report": "dreamlake jobs report 89abcdef0123456789abcdef --namespace geyang --state running\ndreamlake jobs report 89abcdef0123456789abcdef --namespace geyang \\\n --state succeeded --exit-code 0\ndreamlake jobs report fedcba9876543210fedcba98 --namespace geyang \\\n --state failed --exit-code 7 --message 'Training process exited with an error'",
|
|
85
86
|
"jobs list": "dreamlake jobs list --namespace geyang\ndreamlake jobs list --namespace geyang --host 0123456789abcdef01234567 --state running\ndreamlake jobs list --namespace geyang --page 2 --page-size 50 --json",
|
|
@@ -125,7 +126,7 @@ export const helpExamples = {
|
|
|
125
126
|
"memos diff": "MEMO_ID=release-plan\ndreamlake memos read \"$MEMO_ID\" --json > baseline.json\nHASH=$(jq -er .hash baseline.json)\ndreamlake memos diff \"$MEMO_ID\" --since \"$HASH\" --format diff",
|
|
126
127
|
"memos sections": "dreamlake memos sections release-plan\ndreamlake memos sections release-plan --json",
|
|
127
128
|
"memos share": "# Find the release plan and inspect its source and current sharing.\ndreamlake memos search \"release plan\"\nMEMO=\"release-plan\" # Replace with the id or slug from search.\ndreamlake memos read \"$MEMO\"\ndreamlake memos share get \"$MEMO\"\n\n# Give signed-in recipients read access, then verify the returned link.\ndreamlake memos share create \"$MEMO\" --role read\ndreamlake memos share get \"$MEMO\"\n\n# When link access is no longer needed, revoke it and verify.\ndreamlake memos share revoke \"$MEMO\"\ndreamlake memos share get \"$MEMO\"",
|
|
128
|
-
"memos visibility": "MEMO=\"release-plan\" # Your existing memo id or slug.\ndreamlake memos visibility \"$MEMO\" public\ndreamlake memos visibility \"$MEMO\" private",
|
|
129
|
+
"memos visibility": "MEMO=\"release-plan\" # Your existing memo id or slug.\ndreamlake memos visibility \"$MEMO\" unlisted\ndreamlake memos visibility \"$MEMO\" public\ndreamlake memos visibility \"$MEMO\" private",
|
|
129
130
|
"memos share revoke": "MEMO=\"release-plan\" # Your existing memo id or slug.\ndreamlake memos share revoke \"$MEMO\" --revoke-accepted",
|
|
130
131
|
"memos share access": "MEMO=\"release-plan\" # Your existing memo id or slug.\n# List acceptance records and stored roles as a readable table.\ndreamlake memos share access \"$MEMO\"",
|
|
131
132
|
"memos share remove": "MEMO=\"release-plan\" # Your existing memo id or slug.\nUSER_ID=\"user-id-from-access-list\"\ndreamlake memos share remove \"$MEMO\" \"$USER_ID\"",
|
|
@@ -149,6 +150,7 @@ export const helpExamples = {
|
|
|
149
150
|
"ownership snapshot": "dreamlake ownership snapshot 000000000000000000000001 --namespace acme",
|
|
150
151
|
"ownership snapshot-cleanup": "# Inspect eligibility without deleting anything (the default).\ndreamlake ownership snapshot-cleanup 000000000000000000000001 --namespace acme\n# Delete only after server retention and recovery checks pass.\ndreamlake ownership snapshot-cleanup 000000000000000000000001 --namespace acme --execute",
|
|
151
152
|
"project move": "# Save a read-only streaming review with its stable request/key.\ndreamlake project move research --namespace personal --to acme --dry-run --out project-move-review.json\n# Confirm that exact saved review; the recipient must accept separately.\ndreamlake project move research --namespace personal --to acme --confirm --request-file project-move-review.json\n# Accept only with verified destination namespace authority, then wait a bounded time.\ndreamlake project move research --namespace personal --to acme --confirm --request-file project-move-review.json --accept-if-authorized --wait",
|
|
153
|
+
"create bindr": "# Seed a Bindr with matching episodes without an interactive prompt.\ndreamlake create bindr front-cam --project my-robots --episode \"camera/front/*\" --yes",
|
|
152
154
|
"project inspect": "dreamlake project inspect research --namespace acme",
|
|
153
155
|
"project grants": "dreamlake project grants research --namespace acme",
|
|
154
156
|
"project grant": "dreamlake project grant research --namespace acme --user teammate --role WRITE\ndreamlake project grant research --namespace acme --team TEAM_ID --role READ",
|
package/dist/cli/list/index.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
// Port of dreamlake-py's cli/commands/list.py. Where the Python CLI used
|
|
3
|
-
// an interactive 20-per-page pager, we fetch all pages and render one
|
|
4
|
-
// table (more script-friendly); `--json` emits raw JSON.
|
|
1
|
+
import { seg } from "../../api/client.js";
|
|
5
2
|
import { resolveNamespace, resolveRemote, resolveToken } from "../config.js";
|
|
6
3
|
import { emitJson, fail, humanSize, renderTable } from "../helpers.js";
|
|
7
4
|
import { fetchAllContents, fetchAllEpisodes, fetchAllPages, fetchProjects, nodePathToCommaPrefix, relPathUnder, resolveProjectCtx, } from "../resources.js";
|
|
@@ -126,7 +123,7 @@ export async function runListBindrs(opts) {
|
|
|
126
123
|
if (!ctx)
|
|
127
124
|
return 1;
|
|
128
125
|
const { s, token, remote } = ctx;
|
|
129
|
-
const result = await fetchAllPages(remote, `/namespaces/${s.namespace}/projects/${s.project}/bindrs`, token, "bindrs");
|
|
126
|
+
const result = await fetchAllPages(remote, `/namespaces/${seg(s.namespace)}/projects/${seg(s.project)}/bindrs`, token, "bindrs");
|
|
130
127
|
if (result === "not-found") {
|
|
131
128
|
process.stdout.write(" (project not found)\n");
|
|
132
129
|
return 0;
|
|
@@ -138,12 +135,13 @@ export async function runListBindrs(opts) {
|
|
|
138
135
|
process.stdout.write(`Listing bindrs in ${formatProject(s)}\n\n`);
|
|
139
136
|
const rows = result.items.map((d) => ({
|
|
140
137
|
name: String(d.name ?? ""),
|
|
141
|
-
|
|
138
|
+
id: String(d.id ?? ""),
|
|
139
|
+
members: typeof d.memberCount === "number" ? d.memberCount : "?",
|
|
142
140
|
tags: Array.isArray(d.tags) ? d.tags.join(", ") : "",
|
|
143
141
|
description: String(d.description ?? "").slice(0, 40),
|
|
144
142
|
created: String(d.createdAt ?? "").slice(0, 10),
|
|
145
143
|
}));
|
|
146
|
-
process.stdout.write(renderTable(rows, ["name", "
|
|
144
|
+
process.stdout.write(renderTable(rows, ["name", "id", "members", "tags", "description", "created"]));
|
|
147
145
|
process.stdout.write(`\n ${result.total} bindr(s)\n`);
|
|
148
146
|
return 0;
|
|
149
147
|
}
|
package/dist/cli/memos/index.js
CHANGED
|
@@ -237,7 +237,8 @@ export function registerMemosCommand(program) {
|
|
|
237
237
|
.option("--project <slug>", "file the new Memo in this same-namespace project (repeatable)", (value, previous) => [...previous, value], [])
|
|
238
238
|
.option("--file <path>", "initial body from a file ('-' for stdin)")
|
|
239
239
|
.option("--text <string>", "initial body, inline")
|
|
240
|
-
.option("--public", "anyone can read it
|
|
240
|
+
.option("--public", "anyone can read it and see it on the public profile")
|
|
241
|
+
.option("--visibility <visibility>", "private, unlisted or public (default: private)")
|
|
241
242
|
.option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
|
|
242
243
|
.option("--json", "emit JSON")
|
|
243
244
|
.action(async (name, opts) => { process.exitCode = await runMemosCreate(name, opts); });
|
|
@@ -1139,6 +1140,14 @@ async function runLegacyNotesAppend(ref, opts) {
|
|
|
1139
1140
|
}
|
|
1140
1141
|
}
|
|
1141
1142
|
export async function runMemosCreate(name, opts) {
|
|
1143
|
+
if (opts.visibility !== undefined && !["private", "unlisted", "public"].includes(opts.visibility)) {
|
|
1144
|
+
fail("--visibility must be private, unlisted or public");
|
|
1145
|
+
return 1;
|
|
1146
|
+
}
|
|
1147
|
+
if (opts.public && opts.visibility !== undefined && opts.visibility !== "public") {
|
|
1148
|
+
fail("--public conflicts with --visibility");
|
|
1149
|
+
return 1;
|
|
1150
|
+
}
|
|
1142
1151
|
// Notes API contract: the title is optional and an omitted one displays as Untitled.
|
|
1143
1152
|
name ??= "Untitled";
|
|
1144
1153
|
const c = await ctx(opts);
|
|
@@ -1153,7 +1162,7 @@ export async function runMemosCreate(name, opts) {
|
|
|
1153
1162
|
try {
|
|
1154
1163
|
const created = await requestJson(c.remote, `/namespaces/${seg(c.ns)}/notes`, {
|
|
1155
1164
|
method: "POST",
|
|
1156
|
-
json: { name, visibility: opts.public ? "public" : "private", ...(opts.project?.length ? { projects: [...new Set(opts.project)] } : {}) },
|
|
1165
|
+
json: { name, visibility: opts.visibility ?? (opts.public ? "public" : "private"), ...(opts.project?.length ? { projects: [...new Set(opts.project)] } : {}) },
|
|
1157
1166
|
token: c.token,
|
|
1158
1167
|
});
|
|
1159
1168
|
const id = created.note.id;
|
package/dist/cli/resources.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ export declare function fetchAllEpisodes(remote: string, namespace: string, proj
|
|
|
26
26
|
}): Promise<EpisodeRec[]>;
|
|
27
27
|
/** Fetch all bindrs in a project (throws on error). */
|
|
28
28
|
export declare function fetchAllBindrs(remote: string, namespace: string, project: string, token: string): Promise<BindrRec[]>;
|
|
29
|
+
/** Resolve once before a mutation or confirmation; never silently pick a duplicate name. */
|
|
30
|
+
export declare function resolveBindr(ctx: ProjectCtx, nameOrId: string): Promise<BindrRec>;
|
|
29
31
|
/** Match episodes by glob against their name OR node path (leading "/" stripped). */
|
|
30
32
|
export declare function matchEpisodes(episodes: EpisodeRec[], pattern: string): EpisodeRec[];
|
|
31
33
|
/** Match bindrs by glob against their name. */
|
package/dist/cli/resources.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { seg } from "../api/client.js";
|
|
1
2
|
// Shared helpers for project-scoped resource commands (list / create /
|
|
2
3
|
// update / delete of bindrs and datasets). Centralizes project-context
|
|
3
4
|
// resolution, paginated fetches, and glob matching.
|
|
@@ -64,13 +65,26 @@ async function fetchEveryPage(remote, path, token, key) {
|
|
|
64
65
|
}
|
|
65
66
|
/** Fetch all episodes in a project (throws on error). */
|
|
66
67
|
export async function fetchAllEpisodes(remote, namespace, project, token, options = {}) {
|
|
67
|
-
const r = await fetchAllPages(remote, `/namespaces/${namespace}/projects/${project}/episodes${options.includeArchived ? "?includeArchived=true" : ""}`, token, "episodes");
|
|
68
|
+
const r = await fetchAllPages(remote, `/namespaces/${seg(namespace)}/projects/${seg(project)}/episodes${options.includeArchived ? "?includeArchived=true" : ""}`, token, "episodes");
|
|
68
69
|
return r === "not-found" ? [] : r.items;
|
|
69
70
|
}
|
|
70
71
|
/** Fetch all bindrs in a project (throws on error). */
|
|
71
72
|
export async function fetchAllBindrs(remote, namespace, project, token) {
|
|
72
|
-
const
|
|
73
|
-
return
|
|
73
|
+
const result = await requestJson(remote, `/namespaces/${seg(namespace)}/projects/${seg(project)}/bindrs`, { token });
|
|
74
|
+
return result.bindrs;
|
|
75
|
+
}
|
|
76
|
+
/** Resolve once before a mutation or confirmation; never silently pick a duplicate name. */
|
|
77
|
+
export async function resolveBindr(ctx, nameOrId) {
|
|
78
|
+
const rows = await fetchAllBindrs(ctx.remote, ctx.s.namespace, ctx.s.project, ctx.token);
|
|
79
|
+
const byId = rows.find(row => row.id === nameOrId);
|
|
80
|
+
if (byId)
|
|
81
|
+
return byId;
|
|
82
|
+
const matches = rows.filter(row => row.name === nameOrId);
|
|
83
|
+
if (!matches.length)
|
|
84
|
+
throw new Error(`bindr '${nameOrId}' not found in ${ctx.s.project}`);
|
|
85
|
+
if (matches.length > 1)
|
|
86
|
+
throw new Error(`bindr '${nameOrId}' is ambiguous; use its ID (${matches.map(row => row.id).join(", ")})`);
|
|
87
|
+
return matches[0];
|
|
74
88
|
}
|
|
75
89
|
/** Match episodes by glob against their name OR node path (leading "/" stripped). */
|
|
76
90
|
export function matchEpisodes(episodes, pattern) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Commander wiring for the self-updating native install.
|
|
2
|
-
import { installedVersion, installWarnings, performInstall, shadowingBinary } from "./install.js";
|
|
2
|
+
import { binaryOnPath, installedVersion, installWarnings, performInstall, shadowingBinary } from "./install.js";
|
|
3
3
|
import { binDir, isNativeInstall, launcherPath, versionsDir } from "./paths.js";
|
|
4
4
|
import { CHANNELS, isChannel } from "./releases.js";
|
|
5
5
|
import { activeChannel, pinnedVersion, writeSettings } from "./settings.js";
|
|
@@ -12,13 +12,14 @@ export function registerInstallCommand(program) {
|
|
|
12
12
|
.command("install")
|
|
13
13
|
.description("install or re-install the native binary under ~/.local")
|
|
14
14
|
.argument("[target]", `${CHANNELS.join(" | ")} | version (default: saved channel)`)
|
|
15
|
-
.
|
|
15
|
+
.option("--no-modify-path", "leave shell startup files and user PATH unchanged")
|
|
16
|
+
.action(async (target, opts) => {
|
|
16
17
|
try {
|
|
17
18
|
// install.sh always runs us from a throwaway download, so "you are
|
|
18
19
|
// now a native install" is only news when the user invoked this
|
|
19
20
|
// themselves from an npm or from-source copy.
|
|
20
21
|
const converting = !isNativeInstall() && process.env.DREAMLAKE_BOOTSTRAP !== "1";
|
|
21
|
-
const result = await performInstall(target);
|
|
22
|
+
const result = await performInstall(target, { modifyPath: opts.modifyPath });
|
|
22
23
|
process.stdout.write(`Installed dreamlake ${result.version} → ${result.launcher}\n`);
|
|
23
24
|
if (converting) {
|
|
24
25
|
process.stdout.write("This is now a native install under ~/.local; the copy you ran this from is untouched.\n");
|
|
@@ -87,6 +88,7 @@ export function registerDoctorCommand(program) {
|
|
|
87
88
|
.description("print install and auto-update diagnostics")
|
|
88
89
|
.action(() => {
|
|
89
90
|
const shadow = shadowingBinary();
|
|
91
|
+
const found = binaryOnPath();
|
|
90
92
|
const lines = [
|
|
91
93
|
`dreamlake ${VERSION}`,
|
|
92
94
|
`executable: ${process.execPath}`,
|
|
@@ -94,7 +96,7 @@ export function registerDoctorCommand(program) {
|
|
|
94
96
|
`versions: ${versionsDir()}`,
|
|
95
97
|
`linked: ${installedVersion() ?? "(none — the launcher is not ours; `dreamlake` may resolve elsewhere)"}`,
|
|
96
98
|
`native: ${isNativeInstall() ? "yes" : "no"}`,
|
|
97
|
-
`on PATH: ${shadow ?? `${
|
|
99
|
+
`on PATH: ${shadow ?? (found ? `${found} (ours)` : "launcher is not available on the current PATH")}`,
|
|
98
100
|
"",
|
|
99
101
|
updateStatus(),
|
|
100
102
|
];
|
|
@@ -4,7 +4,7 @@ export interface InstallResult {
|
|
|
4
4
|
/** Previous version the launcher pointed at, if any. */
|
|
5
5
|
previous: string | null;
|
|
6
6
|
launcher: string;
|
|
7
|
-
/**
|
|
7
|
+
/** Shell edits, skipped setup, and instructions for the calling shell. */
|
|
8
8
|
pathAdvice: string | null;
|
|
9
9
|
/** Set when the version is frozen rather than following a channel. */
|
|
10
10
|
pinned: string | null;
|
|
@@ -43,11 +43,15 @@ export declare function installedVersion(): string | null;
|
|
|
43
43
|
* failure mode tells you nothing at all.
|
|
44
44
|
*/
|
|
45
45
|
export declare function shadowingBinary(): string | null;
|
|
46
|
+
/** First executable on PATH, including user-created aliases to our launcher. */
|
|
47
|
+
export declare function binaryOnPath(): string | null;
|
|
46
48
|
export interface InstallOptions {
|
|
47
49
|
/** Unattended run by the detached auto-updater: no progress output (it
|
|
48
50
|
* has no terminal of its own to draw on), and yield to anything the
|
|
49
51
|
* user did explicitly while the download was in flight. */
|
|
50
52
|
background?: boolean;
|
|
53
|
+
/** Explicit install only; updates must not edit shell configuration. */
|
|
54
|
+
modifyPath?: boolean;
|
|
51
55
|
}
|
|
52
56
|
export declare function performInstall(target?: string, opts?: InstallOptions): Promise<InstallResult>;
|
|
53
57
|
/**
|
|
@@ -8,8 +8,9 @@
|
|
|
8
8
|
// instead of requiring every user to re-curl a new script.
|
|
9
9
|
import { spawnSync } from "node:child_process";
|
|
10
10
|
import { createHash } from "node:crypto";
|
|
11
|
-
import { chmodSync, copyFileSync, existsSync, lstatSync, mkdirSync, readdirSync, readFileSync, readlinkSync, renameSync, rmSync, symlinkSync, writeFileSync, } from "node:fs";
|
|
11
|
+
import { accessSync, constants, statSync, chmodSync, copyFileSync, existsSync, lstatSync, mkdirSync, readdirSync, readFileSync, readlinkSync, renameSync, rmSync, symlinkSync, writeFileSync, } from "node:fs";
|
|
12
12
|
import { homedir } from "node:os";
|
|
13
|
+
import { binOnPath, configureShellPath } from "./shell-path.js";
|
|
13
14
|
import path from "node:path";
|
|
14
15
|
import { binDir, canonical, isWindows, launcherPath, versionFromEntry, versionPath, versionsDir, } from "./paths.js";
|
|
15
16
|
import { compareVersions, detectPlatform, downloadBinary, fetchManifest, isChannel, resolveChannel, VERSION_RE, } from "./releases.js";
|
|
@@ -217,48 +218,6 @@ function prune(keep) {
|
|
|
217
218
|
}
|
|
218
219
|
}
|
|
219
220
|
// ─── PATH setup ──────────────────────────────────────────────────────
|
|
220
|
-
const PATH_MARKER = "# added by the dreamlake installer";
|
|
221
|
-
function onPath(dir) {
|
|
222
|
-
const entries = (process.env.PATH ?? "").split(path.delimiter).filter(Boolean);
|
|
223
|
-
return entries.some((e) => path.resolve(e) === path.resolve(dir));
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* Config file for the user's login shell, plus the syntax to extend PATH in
|
|
227
|
-
* it. Only the active shell is touched: appending to every rc we can find
|
|
228
|
-
* means fish users get a line in ~/.bashrc that fish never reads, and
|
|
229
|
-
* everyone gets four blocks to clean up at uninstall time for one install.
|
|
230
|
-
*/
|
|
231
|
-
function shellRc() {
|
|
232
|
-
const home = homedir();
|
|
233
|
-
const shell = path.basename(process.env.SHELL ?? "");
|
|
234
|
-
if (shell === "fish") {
|
|
235
|
-
return {
|
|
236
|
-
file: path.join(home, ".config", "fish", "config.fish"),
|
|
237
|
-
// fish_add_path is already a no-op when the entry is present.
|
|
238
|
-
line: `\n${PATH_MARKER}\nfish_add_path "$HOME/.local/bin"\n`,
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
// Guarded, so re-sourcing the rc in a live shell does not prepend a
|
|
242
|
-
// second copy. An unguarded `export PATH=...:$PATH` grows PATH every
|
|
243
|
-
// time the file is sourced, and `where dreamlake` starts listing the
|
|
244
|
-
// same binary twice. Same shape uv uses in ~/.local/bin/env.
|
|
245
|
-
const posixLine = `\n${PATH_MARKER}\n` +
|
|
246
|
-
`case ":$PATH:" in\n` +
|
|
247
|
-
` *":$HOME/.local/bin:"*) ;;\n` +
|
|
248
|
-
` *) export PATH="$HOME/.local/bin:$PATH" ;;\n` +
|
|
249
|
-
`esac\n`;
|
|
250
|
-
if (shell === "zsh")
|
|
251
|
-
return { file: path.join(home, ".zshrc"), line: posixLine };
|
|
252
|
-
if (shell === "bash") {
|
|
253
|
-
// bash reads .bash_profile for login shells and .bashrc otherwise;
|
|
254
|
-
// prefer whichever already exists so we extend the user's setup
|
|
255
|
-
// instead of creating a second file that shadows it.
|
|
256
|
-
const profile = path.join(home, ".bash_profile");
|
|
257
|
-
const rc = path.join(home, ".bashrc");
|
|
258
|
-
return { file: existsSync(rc) || !existsSync(profile) ? rc : profile, line: posixLine };
|
|
259
|
-
}
|
|
260
|
-
return { file: path.join(home, ".profile"), line: posixLine };
|
|
261
|
-
}
|
|
262
221
|
/**
|
|
263
222
|
* Add binDir() to the user's persistent PATH on Windows, via the registry
|
|
264
223
|
* environment block that PowerShell exposes.
|
|
@@ -285,39 +244,6 @@ function ensureOnPathWindows() {
|
|
|
285
244
|
return [];
|
|
286
245
|
return res.stdout?.includes("added") ? ["your user PATH"] : [];
|
|
287
246
|
}
|
|
288
|
-
/**
|
|
289
|
-
* Put ~/.local/bin on PATH for the next login shell. Returns the files
|
|
290
|
-
* touched (at most one). Idempotent via PATH_MARKER — re-running the
|
|
291
|
-
* installer does not stack up duplicate exports.
|
|
292
|
-
*/
|
|
293
|
-
function ensureOnPath() {
|
|
294
|
-
if (isWindows)
|
|
295
|
-
return onPath(binDir()) ? [] : ensureOnPathWindows();
|
|
296
|
-
const { file, line } = shellRc();
|
|
297
|
-
let current = "";
|
|
298
|
-
try {
|
|
299
|
-
current = readFileSync(file, "utf8");
|
|
300
|
-
}
|
|
301
|
-
catch {
|
|
302
|
-
/* new file */
|
|
303
|
-
}
|
|
304
|
-
if (current.includes(PATH_MARKER)) {
|
|
305
|
-
// Earlier versions wrote an unguarded export, which prepends again on
|
|
306
|
-
// every `source ~/.zshrc`. Upgrade our own block in place; leaving it
|
|
307
|
-
// means the duplicate never goes away for anyone already installed.
|
|
308
|
-
const legacy = `${PATH_MARKER}\nexport PATH="$HOME/.local/bin:$PATH"\n`;
|
|
309
|
-
if (current.includes(legacy)) {
|
|
310
|
-
writeFileSync(file, current.replace(legacy, line.replace(/^\n/, "")));
|
|
311
|
-
return [file];
|
|
312
|
-
}
|
|
313
|
-
return [];
|
|
314
|
-
}
|
|
315
|
-
if (onPath(binDir()))
|
|
316
|
-
return [];
|
|
317
|
-
mkdirSync(path.dirname(file), { recursive: true });
|
|
318
|
-
writeFileSync(file, current + line);
|
|
319
|
-
return [file];
|
|
320
|
-
}
|
|
321
247
|
/**
|
|
322
248
|
* The `dreamlake` the user's current PATH would actually run, when that is
|
|
323
249
|
* something other than the launcher we manage.
|
|
@@ -329,15 +255,23 @@ function ensureOnPath() {
|
|
|
329
255
|
* failure mode tells you nothing at all.
|
|
330
256
|
*/
|
|
331
257
|
export function shadowingBinary() {
|
|
258
|
+
const candidate = binaryOnPath();
|
|
259
|
+
return candidate && canonical(candidate) !== canonical(launcherPath()) ? candidate : null;
|
|
260
|
+
}
|
|
261
|
+
/** First executable on PATH, including user-created aliases to our launcher. */
|
|
262
|
+
export function binaryOnPath() {
|
|
332
263
|
const exe = isWindows ? "dreamlake.exe" : "dreamlake";
|
|
333
|
-
const ours = canonical(launcherPath());
|
|
334
264
|
for (const dir of (process.env.PATH ?? "").split(path.delimiter)) {
|
|
335
265
|
if (!dir)
|
|
336
266
|
continue;
|
|
337
267
|
const candidate = path.join(dir, exe);
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
268
|
+
try {
|
|
269
|
+
if (!statSync(candidate).isFile())
|
|
270
|
+
continue;
|
|
271
|
+
accessSync(candidate, constants.X_OK);
|
|
272
|
+
return candidate;
|
|
273
|
+
}
|
|
274
|
+
catch { /* absent or not executable */ }
|
|
341
275
|
}
|
|
342
276
|
return null;
|
|
343
277
|
}
|
|
@@ -372,7 +306,19 @@ export async function performInstall(target, opts = {}) {
|
|
|
372
306
|
// a long-lived session does not lose its own executable mid-run.
|
|
373
307
|
const running = installedVersion();
|
|
374
308
|
prune([version, ...(running ? [running] : []), ...(previous ? [previous] : [])].filter(Boolean));
|
|
375
|
-
|
|
309
|
+
let pathAdvice = null;
|
|
310
|
+
if (!opts.background && opts.modifyPath !== undefined && !conflict) {
|
|
311
|
+
const modify = opts.modifyPath && process.env.DREAMLAKE_INSTALL_NO_MODIFY_PATH !== "1";
|
|
312
|
+
if (isWindows) {
|
|
313
|
+
const touched = modify ? ensureOnPathWindows() : [];
|
|
314
|
+
pathAdvice = !modify ? "User PATH setup skipped (--no-modify-path or DREAMLAKE_INSTALL_NO_MODIFY_PATH=1)."
|
|
315
|
+
: touched.length ? "Added ~/.local/bin to your user PATH. Open a new terminal to use it."
|
|
316
|
+
: binOnPath() ? null : "Could not confirm user PATH setup. Add ~/.local/bin to your user PATH and open a new terminal.";
|
|
317
|
+
}
|
|
318
|
+
else {
|
|
319
|
+
pathAdvice = configureShellPath(modify);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
376
322
|
// Only meaningful once the launcher is really ours; a conflict there is
|
|
377
323
|
// reported on its own and would otherwise produce two warnings for one
|
|
378
324
|
// problem.
|
|
@@ -384,11 +330,7 @@ export async function performInstall(target, opts = {}) {
|
|
|
384
330
|
pinned: channel ? null : version,
|
|
385
331
|
launcherConflict: conflict,
|
|
386
332
|
shadowedBy,
|
|
387
|
-
pathAdvice
|
|
388
|
-
? `Added ~/.local/bin to PATH in ${touched.map((f) => f.replace(homedir(), "~")).join(", ")} — open a new shell or run: export PATH="$HOME/.local/bin:$PATH"`
|
|
389
|
-
: onPath(binDir())
|
|
390
|
-
? null
|
|
391
|
-
: `~/.local/bin is not on your PATH — add it with: export PATH="$HOME/.local/bin:$PATH"`,
|
|
333
|
+
pathAdvice,
|
|
392
334
|
};
|
|
393
335
|
}
|
|
394
336
|
/**
|