@dreamlake/dreamlake-cli 0.107.2 → 0.108.0
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/apps.d.ts +56 -0
- package/dist/api/apps.js +23 -0
- package/dist/api/index.d.ts +31 -0
- package/dist/api/index.js +3 -0
- package/dist/cli/apps/index.d.ts +14 -0
- package/dist/cli/apps/index.js +205 -0
- package/dist/cli/connection/oauth.d.ts +2 -0
- package/dist/cli/connection/oauth.js +4 -2
- package/dist/cli/help-examples.generated.js +10 -0
- package/dist/cli/index.js +2 -0
- package/dist/cli/version.d.ts +1 -1
- package/dist/cli/version.js +1 -1
- package/package.json +9 -9
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Transport } from "./client.js";
|
|
2
|
+
export interface AppConnection {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
provider: string;
|
|
6
|
+
accountLabel: string;
|
|
7
|
+
lifecycle: string;
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
writeEnabled: boolean;
|
|
10
|
+
grantRevision: number;
|
|
11
|
+
settingsRevision: number;
|
|
12
|
+
}
|
|
13
|
+
export interface AppAction {
|
|
14
|
+
actionId: string;
|
|
15
|
+
connectionId: string;
|
|
16
|
+
label: string;
|
|
17
|
+
accountLabel: string;
|
|
18
|
+
tool: string;
|
|
19
|
+
arguments: Record<string, unknown>;
|
|
20
|
+
payloadHash: string;
|
|
21
|
+
expiresAt: string;
|
|
22
|
+
state: string;
|
|
23
|
+
error: string | null;
|
|
24
|
+
result: unknown;
|
|
25
|
+
}
|
|
26
|
+
export interface AppCatalog {
|
|
27
|
+
providers: Array<{
|
|
28
|
+
kind: string;
|
|
29
|
+
label: string;
|
|
30
|
+
ready: boolean;
|
|
31
|
+
supportsWrite: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
connections: AppConnection[];
|
|
34
|
+
actions: Array<{
|
|
35
|
+
id: string;
|
|
36
|
+
state: string;
|
|
37
|
+
tool: string;
|
|
38
|
+
}>;
|
|
39
|
+
truncated: boolean;
|
|
40
|
+
}
|
|
41
|
+
/** Explicit human authorization remains the caller's responsibility. Never expose confirm as a model tool. */
|
|
42
|
+
export declare function appsApi(t: Transport, namespace: string): {
|
|
43
|
+
list: () => Promise<AppCatalog>;
|
|
44
|
+
grant: (id: string, input: {
|
|
45
|
+
enabled: boolean;
|
|
46
|
+
writeEnabled: boolean;
|
|
47
|
+
expectedRevision: number;
|
|
48
|
+
}) => Promise<unknown>;
|
|
49
|
+
tools: (id: string) => Promise<unknown>;
|
|
50
|
+
check: (id: string) => Promise<unknown>;
|
|
51
|
+
read: (id: string, tool: string, args: Record<string, unknown>) => Promise<unknown>;
|
|
52
|
+
prepare: (id: string, tool: string, args: Record<string, unknown>) => Promise<unknown>;
|
|
53
|
+
receipt: (id: string) => Promise<AppAction>;
|
|
54
|
+
confirm: (id: string, payloadHash: string, confirmation: "send-exact-action") => Promise<AppAction>;
|
|
55
|
+
cancel: (id: string) => Promise<AppAction>;
|
|
56
|
+
};
|
package/dist/api/apps.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** Explicit human authorization remains the caller's responsibility. Never expose confirm as a model tool. */
|
|
2
|
+
export function appsApi(t, namespace) {
|
|
3
|
+
const base = `/agent/apps/${encodeURIComponent(namespace)}`;
|
|
4
|
+
const connection = (id) => `${base}/connections/${encodeURIComponent(id)}`;
|
|
5
|
+
const action = (id) => `${base}/actions/${encodeURIComponent(id)}`;
|
|
6
|
+
return {
|
|
7
|
+
list: () => t.request("GET", base),
|
|
8
|
+
grant: (id, input) => t.request("PUT", `${connection(id)}/grant`, { json: input }),
|
|
9
|
+
tools: (id) => t.request("GET", `${connection(id)}/tools`),
|
|
10
|
+
check: (id) => t.request("GET", `${connection(id)}/check`),
|
|
11
|
+
read: (id, tool, args) => t.request("POST", `${connection(id)}/read`, {
|
|
12
|
+
json: { tool, arguments: args },
|
|
13
|
+
}),
|
|
14
|
+
prepare: (id, tool, args) => t.request("POST", `${connection(id)}/prepare`, {
|
|
15
|
+
json: { tool, arguments: args },
|
|
16
|
+
}),
|
|
17
|
+
receipt: (id) => t.request("GET", action(id)),
|
|
18
|
+
confirm: (id, payloadHash, confirmation) => t.request("POST", `${action(id)}/confirm`, {
|
|
19
|
+
json: { payloadHash, confirmation },
|
|
20
|
+
}),
|
|
21
|
+
cancel: (id) => t.request("POST", `${action(id)}/cancel`, { json: {} }),
|
|
22
|
+
};
|
|
23
|
+
}
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './apps.js';
|
|
1
2
|
export * from './lakeshore-connections.js';
|
|
2
3
|
export * from "./open-resources.js";
|
|
3
4
|
export * from "./library-manifest.js";
|
|
@@ -32,6 +33,21 @@ export * from "./skills.js";
|
|
|
32
33
|
/** TypeScript operations use an explicit transport; importing does not execute CLI startup. */
|
|
33
34
|
export declare function createApi(transport: Transport): {
|
|
34
35
|
transport: Transport;
|
|
36
|
+
apps: (namespace: string) => {
|
|
37
|
+
list: () => Promise<import("./apps.js").AppCatalog>;
|
|
38
|
+
grant: (id: string, input: {
|
|
39
|
+
enabled: boolean;
|
|
40
|
+
writeEnabled: boolean;
|
|
41
|
+
expectedRevision: number;
|
|
42
|
+
}) => Promise<unknown>;
|
|
43
|
+
tools: (id: string) => Promise<unknown>;
|
|
44
|
+
check: (id: string) => Promise<unknown>;
|
|
45
|
+
read: (id: string, tool: string, args: Record<string, unknown>) => Promise<unknown>;
|
|
46
|
+
prepare: (id: string, tool: string, args: Record<string, unknown>) => Promise<unknown>;
|
|
47
|
+
receipt: (id: string) => Promise<import("./apps.js").AppAction>;
|
|
48
|
+
confirm: (id: string, payloadHash: string, confirmation: "send-exact-action") => Promise<import("./apps.js").AppAction>;
|
|
49
|
+
cancel: (id: string) => Promise<import("./apps.js").AppAction>;
|
|
50
|
+
};
|
|
35
51
|
openResources: {
|
|
36
52
|
find(resources: readonly import("./open-resources.js").OpenResource[], input: {
|
|
37
53
|
query: string;
|
|
@@ -1301,6 +1317,21 @@ export declare function createClient(options: ClientOptions): {
|
|
|
1301
1317
|
jobs: (namespace: string) => JobsApi;
|
|
1302
1318
|
infra: InfraApi;
|
|
1303
1319
|
transport: Transport;
|
|
1320
|
+
apps: (namespace: string) => {
|
|
1321
|
+
list: () => Promise<import("./apps.js").AppCatalog>;
|
|
1322
|
+
grant: (id: string, input: {
|
|
1323
|
+
enabled: boolean;
|
|
1324
|
+
writeEnabled: boolean;
|
|
1325
|
+
expectedRevision: number;
|
|
1326
|
+
}) => Promise<unknown>;
|
|
1327
|
+
tools: (id: string) => Promise<unknown>;
|
|
1328
|
+
check: (id: string) => Promise<unknown>;
|
|
1329
|
+
read: (id: string, tool: string, args: Record<string, unknown>) => Promise<unknown>;
|
|
1330
|
+
prepare: (id: string, tool: string, args: Record<string, unknown>) => Promise<unknown>;
|
|
1331
|
+
receipt: (id: string) => Promise<import("./apps.js").AppAction>;
|
|
1332
|
+
confirm: (id: string, payloadHash: string, confirmation: "send-exact-action") => Promise<import("./apps.js").AppAction>;
|
|
1333
|
+
cancel: (id: string) => Promise<import("./apps.js").AppAction>;
|
|
1334
|
+
};
|
|
1304
1335
|
openResources: {
|
|
1305
1336
|
find(resources: readonly import("./open-resources.js").OpenResource[], input: {
|
|
1306
1337
|
query: string;
|
package/dist/api/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { appsApi } from './apps.js';
|
|
2
|
+
export * from './apps.js';
|
|
1
3
|
import { lakeshoreConnectionsApi } from './lakeshore-connections.js';
|
|
2
4
|
export * from './lakeshore-connections.js';
|
|
3
5
|
import { openResourcesApi } from "./open-resources.js";
|
|
@@ -63,6 +65,7 @@ export function createApi(transport) {
|
|
|
63
65
|
const memos = memosFacade(transport);
|
|
64
66
|
return {
|
|
65
67
|
transport,
|
|
68
|
+
apps: (namespace) => appsApi(transport, namespace),
|
|
66
69
|
openResources: openResourcesApi(transport),
|
|
67
70
|
browser,
|
|
68
71
|
profile: () => transport.request("GET", "/auth/me"),
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import { type AppAction } from "../../api/apps.js";
|
|
3
|
+
interface Options {
|
|
4
|
+
namespace?: string;
|
|
5
|
+
json?: boolean;
|
|
6
|
+
inputFile?: string;
|
|
7
|
+
send?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function validAction(value: unknown): asserts value is AppAction;
|
|
10
|
+
export declare function appInput(path?: string): Promise<Record<string, unknown>>;
|
|
11
|
+
export declare const display: (value: unknown) => string;
|
|
12
|
+
export declare function runApps(operation: string, id: string | undefined, tool: string | undefined, opts: Options): Promise<number>;
|
|
13
|
+
export declare function registerAppsCommand(program: Command): void;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { readFile, stat } from "node:fs/promises";
|
|
2
|
+
import { confirm } from "@inquirer/prompts";
|
|
3
|
+
import { appsApi } from "../../api/apps.js";
|
|
4
|
+
import { requestJson } from "../client.js";
|
|
5
|
+
import { ctx, strictArgs } from "../connection/index.js";
|
|
6
|
+
import { emitJson, fail } from "../helpers.js";
|
|
7
|
+
export function validAction(value) {
|
|
8
|
+
const a = value;
|
|
9
|
+
if (!a ||
|
|
10
|
+
typeof a.actionId !== "string" ||
|
|
11
|
+
!/^[a-f0-9]{24}$/.test(a.actionId) ||
|
|
12
|
+
typeof a.payloadHash !== "string" ||
|
|
13
|
+
!/^[a-f0-9]{64}$/.test(a.payloadHash) ||
|
|
14
|
+
!a.arguments ||
|
|
15
|
+
typeof a.arguments !== "object" ||
|
|
16
|
+
Array.isArray(a.arguments) ||
|
|
17
|
+
typeof a.label !== "string" ||
|
|
18
|
+
typeof a.accountLabel !== "string" ||
|
|
19
|
+
typeof a.tool !== "string" ||
|
|
20
|
+
![
|
|
21
|
+
"prepared",
|
|
22
|
+
"sending",
|
|
23
|
+
"completed",
|
|
24
|
+
"failed",
|
|
25
|
+
"cancelled",
|
|
26
|
+
"uncertain",
|
|
27
|
+
].includes(a.state) ||
|
|
28
|
+
!Number.isFinite(Date.parse(a.expiresAt)))
|
|
29
|
+
throw new Error("Invalid app action response; nothing was confirmed.");
|
|
30
|
+
}
|
|
31
|
+
export async function appInput(path) {
|
|
32
|
+
if (!path)
|
|
33
|
+
throw new Error("--input-file is required");
|
|
34
|
+
const info = await stat(path);
|
|
35
|
+
if (!info.isFile() || info.size > 16_384)
|
|
36
|
+
throw new Error("Input must be a JSON file of at most 16 KiB.");
|
|
37
|
+
const raw = await readFile(path, "utf8");
|
|
38
|
+
if (Buffer.byteLength(raw) > 16_384)
|
|
39
|
+
throw new Error("Input exceeds 16 KiB.");
|
|
40
|
+
const args = JSON.parse(raw);
|
|
41
|
+
if (!args || typeof args !== "object" || Array.isArray(args))
|
|
42
|
+
throw new Error("Input must be a JSON object.");
|
|
43
|
+
return args;
|
|
44
|
+
}
|
|
45
|
+
// JSON escaping also makes terminal control characters and bidirectional overrides visible.
|
|
46
|
+
export const display = (value) => JSON.stringify(value, null, 2).replace(/[\u007f-\u009f\u202a-\u202e\u2066-\u2069]/g, (c) => `\\u${c.charCodeAt(0).toString(16).padStart(4, "0")}`);
|
|
47
|
+
export async function runApps(operation, id, tool, opts) {
|
|
48
|
+
// Neither a pipe nor --json is a way to bypass human review.
|
|
49
|
+
if (operation === "confirm" &&
|
|
50
|
+
(!process.stdin.isTTY || !process.stdout.isTTY || opts.json)) {
|
|
51
|
+
fail("Confirmation requires an interactive terminal. Review the action in Assistant connections → Apps for your agent (/go My connections), or run this command interactively.");
|
|
52
|
+
return 1;
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
const args = ["read", "prepare"].includes(operation)
|
|
56
|
+
? await appInput(opts.inputFile)
|
|
57
|
+
: undefined;
|
|
58
|
+
const c = await ctx(opts.namespace);
|
|
59
|
+
if (!c)
|
|
60
|
+
return 1;
|
|
61
|
+
const api = appsApi({
|
|
62
|
+
request: (method, path, options) => requestJson(c.remote, path, {
|
|
63
|
+
method: method === "HEAD" ? "GET" : method,
|
|
64
|
+
json: options?.json,
|
|
65
|
+
signal: options?.signal,
|
|
66
|
+
token: c.token,
|
|
67
|
+
}),
|
|
68
|
+
}, c.ns);
|
|
69
|
+
let result;
|
|
70
|
+
switch (operation) {
|
|
71
|
+
case "list":
|
|
72
|
+
result = await api.list();
|
|
73
|
+
break;
|
|
74
|
+
case "tools":
|
|
75
|
+
result = await api.tools(id);
|
|
76
|
+
break;
|
|
77
|
+
case "check":
|
|
78
|
+
result = await api.check(id);
|
|
79
|
+
break;
|
|
80
|
+
case "read":
|
|
81
|
+
result = await api.read(id, tool, args);
|
|
82
|
+
break;
|
|
83
|
+
case "prepare":
|
|
84
|
+
result = await api.prepare(id, tool, args);
|
|
85
|
+
break;
|
|
86
|
+
case "receipt":
|
|
87
|
+
result = await api.receipt(id);
|
|
88
|
+
validAction(result);
|
|
89
|
+
break;
|
|
90
|
+
case "cancel":
|
|
91
|
+
result = await api.cancel(id);
|
|
92
|
+
validAction(result);
|
|
93
|
+
break;
|
|
94
|
+
case "grant":
|
|
95
|
+
case "revoke": {
|
|
96
|
+
const catalog = await api.list();
|
|
97
|
+
const row = catalog.connections.find((x) => x.id === id);
|
|
98
|
+
if (!row ||
|
|
99
|
+
!Number.isSafeInteger(row.grantRevision) ||
|
|
100
|
+
row.grantRevision < 0)
|
|
101
|
+
throw new Error("Connection not found or invalid grant revision.");
|
|
102
|
+
result = await api.grant(id, {
|
|
103
|
+
enabled: operation === "grant",
|
|
104
|
+
writeEnabled: operation === "grant" && !!opts.send,
|
|
105
|
+
expectedRevision: row.grantRevision,
|
|
106
|
+
});
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
case "confirm": {
|
|
110
|
+
const action = await api.receipt(id);
|
|
111
|
+
validAction(action);
|
|
112
|
+
if (action.actionId !== id)
|
|
113
|
+
throw new Error("Action identity changed; nothing was confirmed.");
|
|
114
|
+
if (action.state !== "prepared") {
|
|
115
|
+
result = action;
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
if (Date.parse(action.expiresAt) <= Date.now())
|
|
119
|
+
throw new Error("This proposal expired. Prepare a new action.");
|
|
120
|
+
process.stdout.write(display({
|
|
121
|
+
account: action.accountLabel,
|
|
122
|
+
connection: action.label,
|
|
123
|
+
tool: action.tool,
|
|
124
|
+
arguments: action.arguments,
|
|
125
|
+
}) + "\n");
|
|
126
|
+
if (!(await confirm({
|
|
127
|
+
message: "Send this exact Slack message?",
|
|
128
|
+
default: false,
|
|
129
|
+
})))
|
|
130
|
+
return 0;
|
|
131
|
+
result = await api.confirm(id, action.payloadHash, "send-exact-action");
|
|
132
|
+
validAction(result);
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
default:
|
|
136
|
+
throw new Error("Unknown app operation");
|
|
137
|
+
}
|
|
138
|
+
if (opts.json)
|
|
139
|
+
emitJson(result);
|
|
140
|
+
else
|
|
141
|
+
process.stdout.write(display(result) + "\n");
|
|
142
|
+
if (operation === "confirm" &&
|
|
143
|
+
result.state !== "completed") {
|
|
144
|
+
fail("Sending is not confirmed. Check the receipt and Slack before preparing another action.");
|
|
145
|
+
return 1;
|
|
146
|
+
}
|
|
147
|
+
return 0;
|
|
148
|
+
}
|
|
149
|
+
catch (e) {
|
|
150
|
+
// Do not print request bodies or raw provider errors.
|
|
151
|
+
fail(e instanceof Error ? e.message : "App request failed");
|
|
152
|
+
if (operation === "confirm")
|
|
153
|
+
fail("Do not retry the send blindly. Read the action receipt and check Slack.");
|
|
154
|
+
return 1;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
export function registerAppsCommand(program) {
|
|
158
|
+
const apps = program
|
|
159
|
+
.command("apps")
|
|
160
|
+
.description("connect personal apps to the built-in agent; review external actions");
|
|
161
|
+
for (const operation of [
|
|
162
|
+
"list",
|
|
163
|
+
"grant",
|
|
164
|
+
"revoke",
|
|
165
|
+
"tools",
|
|
166
|
+
"check",
|
|
167
|
+
"read",
|
|
168
|
+
"prepare",
|
|
169
|
+
"receipt",
|
|
170
|
+
"confirm",
|
|
171
|
+
"cancel",
|
|
172
|
+
]) {
|
|
173
|
+
let cmd = strictArgs(apps.command(operation)).description({
|
|
174
|
+
list: "list app connections and recent actions",
|
|
175
|
+
grant: "allow built-in agent reads (optionally reviewed sends)",
|
|
176
|
+
revoke: "remove built-in agent access",
|
|
177
|
+
tools: "discover allowed tools",
|
|
178
|
+
check: "verify sign-in and tool discovery without reading content",
|
|
179
|
+
read: "call an allowed read tool",
|
|
180
|
+
prepare: "prepare a Slack message for review without sending",
|
|
181
|
+
receipt: "review an action and its saved outcome",
|
|
182
|
+
confirm: "interactively review and send one exact action",
|
|
183
|
+
cancel: "cancel a prepared action",
|
|
184
|
+
}[operation]);
|
|
185
|
+
if (operation !== "list")
|
|
186
|
+
cmd = cmd.argument("<id>", ["receipt", "confirm", "cancel"].includes(operation)
|
|
187
|
+
? "action id"
|
|
188
|
+
: "connection id");
|
|
189
|
+
if (["read", "prepare"].includes(operation))
|
|
190
|
+
cmd = cmd
|
|
191
|
+
.argument("<tool>", "discovered tool name")
|
|
192
|
+
.requiredOption("--input-file <path>", "JSON argument object (16 KiB maximum)");
|
|
193
|
+
if (operation === "grant")
|
|
194
|
+
cmd.option("--send", "also allow preparing reviewed sends; requires Slack send consent");
|
|
195
|
+
cmd
|
|
196
|
+
.option("--namespace <slug>", "personal namespace (default: active login)")
|
|
197
|
+
.option("--json", "emit JSON (unavailable for confirm)");
|
|
198
|
+
cmd.action(async (...args) => {
|
|
199
|
+
const opts = args[args.length - 2];
|
|
200
|
+
process.exitCode = await runApps(operation, operation === "list" ? undefined : args[0], ["read", "prepare"].includes(operation)
|
|
201
|
+
? args[1]
|
|
202
|
+
: undefined, opts);
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}
|
|
@@ -11,6 +11,7 @@ export declare function runOAuthCreate(opts: {
|
|
|
11
11
|
wait?: boolean;
|
|
12
12
|
json?: boolean;
|
|
13
13
|
timeoutMs?: number;
|
|
14
|
+
access?: string;
|
|
14
15
|
}): Promise<number>;
|
|
15
16
|
export declare function runOAuthReconnect(id: string, opts: {
|
|
16
17
|
connector: string;
|
|
@@ -19,5 +20,6 @@ export declare function runOAuthReconnect(id: string, opts: {
|
|
|
19
20
|
wait?: boolean;
|
|
20
21
|
json?: boolean;
|
|
21
22
|
timeoutMs?: number;
|
|
23
|
+
access?: string;
|
|
22
24
|
}): Promise<number>;
|
|
23
25
|
export declare function registerConnectionOAuthCommands(connection: Command): void;
|
|
@@ -72,7 +72,7 @@ async function begin(c, body) {
|
|
|
72
72
|
const res = await requestJson(c.remote, operationsPath(c), {
|
|
73
73
|
method: "POST",
|
|
74
74
|
token: c.token,
|
|
75
|
-
json: { ...body, returnTo: RETURN_TO },
|
|
75
|
+
json: { ...body, returnTo: ["slack-mcp", "plaud-mcp"].includes(String(body.connectorKind)) ? `/${seg(c.ns)}/settings?apps=1` : RETURN_TO },
|
|
76
76
|
});
|
|
77
77
|
return parseBegin(res, "begin");
|
|
78
78
|
}
|
|
@@ -235,7 +235,7 @@ export async function runOAuthCreate(opts) {
|
|
|
235
235
|
const c = await ctx(opts.namespace);
|
|
236
236
|
if (!c)
|
|
237
237
|
return 1;
|
|
238
|
-
return flow(c, { intent: "create", connectorKind: opts.connector, label: opts.label }, opts);
|
|
238
|
+
return flow(c, { intent: "create", connectorKind: opts.connector, label: opts.label, ...(opts.access ? { oauthProfile: opts.access } : {}) }, opts);
|
|
239
239
|
}
|
|
240
240
|
export async function runOAuthReconnect(id, opts) {
|
|
241
241
|
const c = await ctx(opts.namespace);
|
|
@@ -258,6 +258,7 @@ export async function runOAuthReconnect(id, opts) {
|
|
|
258
258
|
return 1;
|
|
259
259
|
return flow(c, {
|
|
260
260
|
intent: "reconnect",
|
|
261
|
+
...(opts.access ? { oauthProfile: opts.access } : {}),
|
|
261
262
|
connectorKind: opts.connector,
|
|
262
263
|
connectionId: id,
|
|
263
264
|
expectedSettingsRevision: one.settingsRevision,
|
|
@@ -269,6 +270,7 @@ export function registerConnectionOAuthCommands(connection) {
|
|
|
269
270
|
.command("oauth")
|
|
270
271
|
.description("authorize a connection through a provider's browser flow");
|
|
271
272
|
const shared = (cmd) => cmd
|
|
273
|
+
.option("--access <profile>", "provider access profile (app providers: read or read-write)")
|
|
272
274
|
.option("--no-browser", "print the URL instead of opening a browser")
|
|
273
275
|
.option("--no-wait", "print the operation id and exit without watching")
|
|
274
276
|
.option("--namespace <slug>", "namespace slug (default: active login)")
|
|
@@ -5,6 +5,16 @@ export const helpExamples = {
|
|
|
5
5
|
"agents show": "dreamlake agents show my_repo.tri --namespace my-workspace",
|
|
6
6
|
"agents edit": "dreamlake agents edit my_repo.tri --namespace my-workspace\n# Browser form: follow the localhost URL printed by the command.\ndreamlake agents edit my_repo.tri --namespace my-workspace --web",
|
|
7
7
|
"telemetry": "dreamlake telemetry disable --quiet\ndreamlake telemetry status\ndreamlake telemetry enable --quiet",
|
|
8
|
+
"apps": "dreamlake apps list --json\ndreamlake connection oauth create --connector slack-mcp --label \"Work Slack\" --access read\ndreamlake connection oauth create --connector plaud-mcp --label \"My Plaud\" --access read",
|
|
9
|
+
"apps grant": "dreamlake apps grant <connection-id>",
|
|
10
|
+
"apps check": "dreamlake apps check <connection-id> --json",
|
|
11
|
+
"apps tools": "dreamlake apps tools <connection-id> --json",
|
|
12
|
+
"apps read": "dreamlake apps read <connection-id> <read-tool> --input-file query.json --json",
|
|
13
|
+
"apps prepare": "dreamlake apps prepare <connection-id> slack_send_message --input-file message.json --json",
|
|
14
|
+
"apps receipt": "dreamlake apps receipt <action-id> --json",
|
|
15
|
+
"apps confirm": "dreamlake apps confirm <action-id>",
|
|
16
|
+
"apps cancel": "dreamlake apps cancel <action-id> --json",
|
|
17
|
+
"apps revoke": "dreamlake apps revoke <connection-id>",
|
|
8
18
|
"artifact push": "dreamlake artifact push ./dashboard.html --id q1-dashboard\n# Edit the file, then repeat the same command to upload only new chunks.\n\n# Static build with on-demand assets (CLI 0.101.0+; requires site hosting):\ndreamlake artifact push ./dist/client --site --id simulation\n\n# Compatibility with older self-hosted viewers:\ndreamlake artifact push ./dashboard.html --id q1-dashboard --full\n\n# Multiple self-contained HTML pages (requires an updated viewer):\ndreamlake artifact push ./report --entry index.html --id quarterly-report",
|
|
9
19
|
"artifact meta set": "# At push time:\ndreamlake artifact push ./report.html --id q1-dashboard \\\n --description \"Revenue, churn and pipeline for the quarter\" \\\n --cover ./cover.png\n\n# Or after the fact, for an artifact that already exists:\ndreamlake artifact meta set q1-dashboard --description \"Revenue, churn and pipeline\"\ndreamlake artifact meta set q1-dashboard --cover ./cover.png\ndreamlake artifact meta show q1-dashboard\n\n# Back to the automatic description / the generated cover:\ndreamlake artifact meta set q1-dashboard --clear-description --clear-cover",
|
|
10
20
|
"artifact share": "# Find the dashboard you already uploaded; no new version is needed.\ndreamlake artifact list\nARTIFACT=\"q1-dashboard\" # Replace with the id from list.\ndreamlake artifact share get \"$ARTIFACT\"\n\n# Give signed-in recipients read access, then verify the returned link.\ndreamlake artifact share create \"$ARTIFACT\"\ndreamlake artifact share get \"$ARTIFACT\"\n\n# When link access is no longer needed, revoke it and verify.\ndreamlake artifact share revoke \"$ARTIFACT\"\ndreamlake artifact share get \"$ARTIFACT\"",
|
package/dist/cli/index.js
CHANGED
|
@@ -33,6 +33,7 @@ import { registerTeamCommand } from "./team/index.js";
|
|
|
33
33
|
import { registerPipelineCommand } from "./pipeline/index.js";
|
|
34
34
|
import { registerWorkflowCommand } from "./workflow/index.js";
|
|
35
35
|
import { registerPageCommand } from "./page/index.js";
|
|
36
|
+
import { registerAppsCommand } from "./apps/index.js";
|
|
36
37
|
import { registerConnectionCommand } from "./connection/index.js";
|
|
37
38
|
import { registerSourceCommand } from "./source/index.js";
|
|
38
39
|
import { registerTasksCommand } from "./tasks/index.js";
|
|
@@ -205,6 +206,7 @@ async function main(argv) {
|
|
|
205
206
|
registerProjectCommand(program);
|
|
206
207
|
registerTasksCommand(program);
|
|
207
208
|
registerConnectionCommand(program);
|
|
209
|
+
registerAppsCommand(program);
|
|
208
210
|
// ─── declaration collections ─────────────────────────────────────
|
|
209
211
|
//
|
|
210
212
|
// `declare` writes the five head collections; `runnable` and
|
package/dist/cli/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.108.0";
|
package/dist/cli/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dreamlake/dreamlake-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.108.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dreamlake-ai/dreamlake-cli.git"
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
"node": ">=18"
|
|
37
37
|
},
|
|
38
38
|
"optionalDependencies": {
|
|
39
|
-
"@dreamlake/dreamlake-cli-darwin-arm64": "0.
|
|
40
|
-
"@dreamlake/dreamlake-cli-darwin-x64": "0.
|
|
41
|
-
"@dreamlake/dreamlake-cli-linux-x64": "0.
|
|
42
|
-
"@dreamlake/dreamlake-cli-linux-arm64": "0.
|
|
43
|
-
"@dreamlake/dreamlake-cli-linux-x64-musl": "0.
|
|
44
|
-
"@dreamlake/dreamlake-cli-linux-arm64-musl": "0.
|
|
45
|
-
"@dreamlake/dreamlake-cli-win32-x64": "0.
|
|
46
|
-
"@dreamlake/dreamlake-cli-win32-arm64": "0.
|
|
39
|
+
"@dreamlake/dreamlake-cli-darwin-arm64": "0.108.0",
|
|
40
|
+
"@dreamlake/dreamlake-cli-darwin-x64": "0.108.0",
|
|
41
|
+
"@dreamlake/dreamlake-cli-linux-x64": "0.108.0",
|
|
42
|
+
"@dreamlake/dreamlake-cli-linux-arm64": "0.108.0",
|
|
43
|
+
"@dreamlake/dreamlake-cli-linux-x64-musl": "0.108.0",
|
|
44
|
+
"@dreamlake/dreamlake-cli-linux-arm64-musl": "0.108.0",
|
|
45
|
+
"@dreamlake/dreamlake-cli-win32-x64": "0.108.0",
|
|
46
|
+
"@dreamlake/dreamlake-cli-win32-arm64": "0.108.0"
|
|
47
47
|
}
|
|
48
48
|
}
|