nolo-cli 0.14.0-alpha.2 → 0.14.0-alpha.4
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 +5 -2
- package/{_executeModel-KMUDFYY2.js → _executeModel-ERQQ5SO5.js} +9 -9
- package/agentDeleteCommand-AZDVM4HQ.js +1 -1
- package/{agentEmailCommands-AP6MX4XN.js → agentEmailCommands-SBGSPBSS.js} +9 -9
- package/agentGrantCommands-B4MB23VQ.js +239 -0
- package/agentListCommands-OJLOXSKL.js +1 -1
- package/{agentMachineCommands-G4T4GU42.js → agentMachineCommands-Y7RXBTEY.js} +2 -2
- package/{agentRecordCommands-RNENEXQI.js → agentRecordCommands-LFQ3RK24.js} +9 -9
- package/{agentRunCommand-2VTOTQWA.js → agentRunCommand-WARBRXRP.js} +9 -9
- package/{agentSlice-BLHSFM3Q.js → agentSlice-F23RHRVB.js} +1 -1
- package/{authCommand-O7SL3WW5.js → authCommand-66ME4KZX.js} +8 -4
- package/{chunk-XBZL4SGS.js → chunk-4GTGSUMH.js} +2 -2
- package/{chunk-CPGQAMHA.js → chunk-4QUXYE7J.js} +3 -3
- package/{chunk-ONJIZ7UF.js → chunk-7EVWUQJZ.js} +58 -6
- package/{chunk-SE4YDESE.js → chunk-CBLNDNYI.js} +2 -2
- package/{chunk-BMZRD37B.js → chunk-KPUM5RIE.js} +35 -17
- package/{chunk-2Q5FTOQA.js → chunk-LAVVL3GH.js} +116 -8
- package/{chunk-LVJFD5HS.js → chunk-NARL6TJS.js} +8 -8
- package/{chunk-S6V2Y72C.js → chunk-NFRS3JW4.js} +1 -1
- package/{chunk-HJAMZQFI.js → chunk-NVV3ABII.js} +6 -5
- package/{chunk-DQUUZXUZ.js → chunk-PBP4KPF7.js} +5 -5
- package/{chunk-RTHJF57Z.js → chunk-RLOKCZNX.js} +1 -1
- package/{chunk-GGQW6DXG.js → chunk-VIPFEPO4.js} +1 -1
- package/{chunk-VFGBWVXO.js → chunk-X7NITNY4.js} +1 -1
- package/{createAgentAutomationAction-RIOI4YZI.js → createAgentAutomationAction-YCBXLFWW.js} +2 -2
- package/{createDialogAction-QBHFBWM4.js → createDialogAction-LOE4IBWI.js} +3 -3
- package/{createPageAction-GHVLL7YQ.js → createPageAction-MQPKRYSZ.js} +2 -2
- package/dialogCommands-BQDGLVMO.js +1 -1
- package/{dialogSlice-VNKDTTHR.js → dialogSlice-MLJL22KB.js} +2 -2
- package/docCreateCommands-K2MPMXYF.js +1 -1
- package/docDeleteCommands-NBAARB77.js +1 -1
- package/docReadCommands-S3MO5RPS.js +1 -1
- package/{docStore-W4KEEPCW.js → docStore-CRULGCHQ.js} +3 -3
- package/docUpdateCommands-EHEI7FCE.js +1 -1
- package/{handleSendMessageAction-6BFLKGWQ.js → handleSendMessageAction-JSJC7RWU.js} +29 -3
- package/index.js +33 -21
- package/{machineCommands-R27VIC5L.js → machineCommands-7WHQPMXF.js} +9 -9
- package/{machineWsRunDispatch-5JH6QGHK.js → machineWsRunDispatch-EZ2IOYWT.js} +9 -9
- package/package.json +1 -1
- package/{readlineWorkspace-RJ3TDGEK.js → readlineWorkspace-2KIRBLOS.js} +9 -9
- package/{runAgentClientLoop-6D7FP7CK.js → runAgentClientLoop-GFC2XHEC.js} +7 -7
- package/spaceCommands-4R63UST3.js +1 -1
- package/{spaceSlice-6PZEMRZM.js → spaceSlice-IYTGSETI.js} +2 -2
- package/{streamAgentChatTurn-VW7433O6.js → streamAgentChatTurn-42SBHJ6F.js} +13 -13
- package/{tools-MWNK4RKM.js → tools-BBNP7OHL.js} +5 -5
- package/{updateDialogTitleAction-3SKUPJIN.js → updateDialogTitleAction-UOULZ7J2.js} +2 -2
- package/{agentRuntimeLocal-4CM3VHR3.js → agentRuntimeLocal-DSUBT77I.js} +1 -1
package/README.md
CHANGED
|
@@ -231,8 +231,11 @@ nolo table add-column --table meta-0e95801d90-01KWSK4Q4TESXQ06SW39JN2TTJ --schem
|
|
|
231
231
|
- `nolo agent email bind <agent> --email <address>` 将已有地址绑定到 agent。
|
|
232
232
|
- `nolo agent email create-and-provision <slug> --name <display> [--local-part pay] [--copy-provider-from <agent>]` 一步创建 agent 并开通邮箱。
|
|
233
233
|
- `nolo auth cloudflare [--client-id <id>] [--generate-token] [--zone-name <domain>] [--write-to-env [path]]` 通过 Cloudflare 自托管 OAuth 授权并可选生成 `Zone:Email Routing:Edit` 的 API Token,还可直接写入 `.env`。
|
|
234
|
-
- `nolo auth claude [--no-browser] [--sync-to-server]` 通过 PKCE + `localhost:54545` 回调授权 Claude Pro/Max;`--no-browser` 时可粘贴最终回调 URL/授权码。凭据保存到 `~/.nolo/credentials/claude.json
|
|
235
|
-
- `nolo auth cursor [--no-browser] [--sync-to-server]` 通过 poll-based device flow 授权 Cursor Pro(无需回调端口)。打开 `https://cursor.com/loginDeepControl` 并轮询 `api2.cursor.sh/auth/poll` 获取 token。凭据保存到 `~/.nolo/credentials/cursor.json
|
|
234
|
+
- `nolo auth claude [--no-browser] [--sync-to-server|--no-sync-to-server]` 通过 PKCE + `localhost:54545` 回调授权 Claude Pro/Max;`--no-browser` 时可粘贴最终回调 URL/授权码。凭据保存到 `~/.nolo/credentials/claude.json`。若已配置 `NOLO_SERVER`+`AUTH_TOKEN`(或 profile),登录成功后会自动 sync 到 server;可用 `--no-sync-to-server` 或 `NOLO_OAUTH_AUTO_SYNC=0` 关闭。Agent 使用 `provider: "anthropic"`、`apiKeyRef: "claude"`。
|
|
235
|
+
- `nolo auth cursor [--no-browser] [--sync-to-server|--no-sync-to-server]` 通过 poll-based device flow 授权 Cursor Pro(无需回调端口)。打开 `https://cursor.com/loginDeepControl` 并轮询 `api2.cursor.sh/auth/poll` 获取 token。凭据保存到 `~/.nolo/credentials/cursor.json`。同样在 server 配置存在时自动 sync。Agent 使用 `provider: "cursor"`、`apiKeyRef: "cursor"`,模型如 `cursor-grok-4.5-high`(Cursor Models 池;裸 `cursor-grok-4.5` 会由 provider 兼容映射到 high)。
|
|
236
|
+
- `nolo agent grant <agent> --to <userId>` 给对方发点对点额度授权(收藏 ≠ 授权;公共/跨空间需要)。
|
|
237
|
+
- `nolo agent grants <agent>` 列出该 agent 的有效授权。
|
|
238
|
+
- `nolo agent revoke-grant <agent> --from <userId>` 撤销授权。
|
|
236
239
|
|
|
237
240
|
账户所有权对私有 agent 维护很重要。默认的新测试、验证 dialogs、任务板写入、机器绑定的 agent 运行和用户可见的结果应写入当前操作员账户 `0e95801d90`。原有的 `b2e06f801f` / platform-demo 账户已删除,仅在极少数维护旧公开/共享记录场景时保留。使用 `nolo agent read`、`nolo agent update` 和仓库原生助手作为正常入口点;只有明确针对旧记录的所有者专属操作才应使用维护的 platform-demo token(来自 `scripts/testUtils.ts`)或重新生成的 token(来自 `scripts/generateToken.ts`)。不要将 token 字符串复制到文档、日志或提示词中。
|
|
238
241
|
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
fetchAgentContexts
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NFRS3JW4.js";
|
|
4
4
|
import {
|
|
5
5
|
filterAndCleanMessages,
|
|
6
6
|
sendOpenAICompletionsRequest
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-PBP4KPF7.js";
|
|
8
8
|
import "./chunk-JEXVIMYZ.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-RLOKCZNX.js";
|
|
10
10
|
import {
|
|
11
11
|
generateRequestBody,
|
|
12
12
|
mergeReferences,
|
|
13
13
|
performFetchRequest
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-NVV3ABII.js";
|
|
15
15
|
import "./chunk-OIMX7MM4.js";
|
|
16
16
|
import "./chunk-VIDPVFP3.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-LAVVL3GH.js";
|
|
18
18
|
import "./chunk-RQSOAMPJ.js";
|
|
19
19
|
import "./chunk-OOIN7HSO.js";
|
|
20
20
|
import "./chunk-KQHGZWSV.js";
|
|
@@ -23,19 +23,19 @@ import "./chunk-3LY4F7SV.js";
|
|
|
23
23
|
import "./chunk-VP4WJWKW.js";
|
|
24
24
|
import "./chunk-63W5N6P3.js";
|
|
25
25
|
import "./chunk-VF4K2QE6.js";
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-4GTGSUMH.js";
|
|
27
|
+
import "./chunk-X7NITNY4.js";
|
|
28
28
|
import "./chunk-VC6OZXO5.js";
|
|
29
29
|
import {
|
|
30
30
|
selectAllMsgs,
|
|
31
31
|
selectCurrentDialogConfig,
|
|
32
32
|
updateTokensAction
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-NARL6TJS.js";
|
|
34
34
|
import "./chunk-V2J635L5.js";
|
|
35
35
|
import "./chunk-MRC4Q34M.js";
|
|
36
36
|
import "./chunk-MTU75CZ2.js";
|
|
37
37
|
import "./chunk-CWMSB67P.js";
|
|
38
|
-
import "./chunk-
|
|
38
|
+
import "./chunk-4QUXYE7J.js";
|
|
39
39
|
import "./chunk-V6VXDXGY.js";
|
|
40
40
|
import "./chunk-Z4NR32XR.js";
|
|
41
41
|
import "./chunk-M76ECQRD.js";
|
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
} from "./chunk-VHBWHNVT.js";
|
|
14
14
|
import "./chunk-KQHGZWSV.js";
|
|
15
15
|
import "./chunk-33K5FKRL.js";
|
|
16
|
-
import "./chunk-PB2DHBEQ.js";
|
|
17
16
|
import "./chunk-ZNFJWEN4.js";
|
|
17
|
+
import "./chunk-PB2DHBEQ.js";
|
|
18
18
|
import "./chunk-OIQPORYI.js";
|
|
19
19
|
import "./chunk-VQFY3VXW.js";
|
|
20
20
|
import "./chunk-3WGLLTK4.js";
|
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
} from "./chunk-3QAF2LTL.js";
|
|
9
9
|
import {
|
|
10
10
|
runAgentCreateCommand
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-VIPFEPO4.js";
|
|
12
|
+
import "./chunk-KPUM5RIE.js";
|
|
13
13
|
import "./chunk-EHLHSX7R.js";
|
|
14
14
|
import "./chunk-CMKUBIGW.js";
|
|
15
15
|
import "./chunk-JBTJAPUF.js";
|
|
@@ -26,9 +26,9 @@ import {
|
|
|
26
26
|
} from "./chunk-VHBWHNVT.js";
|
|
27
27
|
import "./chunk-T3X232L6.js";
|
|
28
28
|
import "./chunk-ATNTHIZI.js";
|
|
29
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-RLOKCZNX.js";
|
|
30
30
|
import "./chunk-OIMX7MM4.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-LAVVL3GH.js";
|
|
32
32
|
import "./chunk-RQSOAMPJ.js";
|
|
33
33
|
import "./chunk-OOIN7HSO.js";
|
|
34
34
|
import "./chunk-KQHGZWSV.js";
|
|
@@ -37,23 +37,23 @@ import "./chunk-3LY4F7SV.js";
|
|
|
37
37
|
import "./chunk-VP4WJWKW.js";
|
|
38
38
|
import "./chunk-63W5N6P3.js";
|
|
39
39
|
import "./chunk-VF4K2QE6.js";
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-4GTGSUMH.js";
|
|
41
|
+
import "./chunk-X7NITNY4.js";
|
|
42
42
|
import "./chunk-VC6OZXO5.js";
|
|
43
43
|
import "./chunk-OWOHNGCN.js";
|
|
44
|
-
import "./chunk-
|
|
44
|
+
import "./chunk-NARL6TJS.js";
|
|
45
45
|
import "./chunk-V2J635L5.js";
|
|
46
46
|
import "./chunk-MRC4Q34M.js";
|
|
47
47
|
import "./chunk-MTU75CZ2.js";
|
|
48
48
|
import "./chunk-CWMSB67P.js";
|
|
49
|
-
import "./chunk-
|
|
49
|
+
import "./chunk-4QUXYE7J.js";
|
|
50
50
|
import "./chunk-V6VXDXGY.js";
|
|
51
51
|
import "./chunk-Z4NR32XR.js";
|
|
52
52
|
import "./chunk-M76ECQRD.js";
|
|
53
53
|
import "./chunk-WZSRQNQG.js";
|
|
54
54
|
import "./chunk-33K5FKRL.js";
|
|
55
|
-
import "./chunk-PB2DHBEQ.js";
|
|
56
55
|
import "./chunk-ZNFJWEN4.js";
|
|
56
|
+
import "./chunk-PB2DHBEQ.js";
|
|
57
57
|
import "./chunk-OIQPORYI.js";
|
|
58
58
|
import "./chunk-VQFY3VXW.js";
|
|
59
59
|
import "./chunk-3WGLLTK4.js";
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import {
|
|
2
|
+
resolveCliAgentKeyInput
|
|
3
|
+
} from "./chunk-VHBWHNVT.js";
|
|
4
|
+
import {
|
|
5
|
+
toErrorMessage
|
|
6
|
+
} from "./chunk-HNMXYYJR.js";
|
|
7
|
+
import "./chunk-QSJ3HFEF.js";
|
|
8
|
+
import {
|
|
9
|
+
parseUserIdFromAuthToken,
|
|
10
|
+
readOption,
|
|
11
|
+
resolveAuthToken,
|
|
12
|
+
resolveServerUrl
|
|
13
|
+
} from "./chunk-5NBHQD4D.js";
|
|
14
|
+
import "./chunk-OLZBQWZU.js";
|
|
15
|
+
import "./chunk-LCBAMY2M.js";
|
|
16
|
+
import "./chunk-4SN6J65J.js";
|
|
17
|
+
import "./chunk-CF7PE763.js";
|
|
18
|
+
import {
|
|
19
|
+
asOptionalTrimmedString
|
|
20
|
+
} from "./chunk-G3SUCT4W.js";
|
|
21
|
+
import "./chunk-4VNS5WPM.js";
|
|
22
|
+
|
|
23
|
+
// packages/cli/agentGrantCommands.ts
|
|
24
|
+
function wantsHelp(args) {
|
|
25
|
+
return args.includes("--help") || args.includes("-h");
|
|
26
|
+
}
|
|
27
|
+
function wantsJson(args) {
|
|
28
|
+
return args.includes("--json");
|
|
29
|
+
}
|
|
30
|
+
function positionalArgs(args) {
|
|
31
|
+
const values = [];
|
|
32
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
33
|
+
const arg = args[index];
|
|
34
|
+
if (!arg) continue;
|
|
35
|
+
if (arg.startsWith("--")) {
|
|
36
|
+
if (arg.includes("=")) continue;
|
|
37
|
+
if (args[index + 1] && !args[index + 1].startsWith("--")) index += 1;
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
values.push(arg);
|
|
41
|
+
}
|
|
42
|
+
return values;
|
|
43
|
+
}
|
|
44
|
+
function writeGrantHelp(output) {
|
|
45
|
+
output.write(
|
|
46
|
+
"Usage:\n nolo agent grant <agent> --to <userId> [--json]\n nolo agent grants <agent> [--json] [--include-revoked]\n nolo agent revoke-grant <agent> --from <userId> [--json]\n\nGrant lets another user burn this agent's owner OAuth/custom credentials\nvia the server proxy. Favorite is NOT a grant.\nPrivate agents already share OAuth with same-space members; use grants for\npublic agents or cross-space people.\n"
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
async function resolveAgentKeyOrFail(args) {
|
|
50
|
+
const raw = asOptionalTrimmedString(args.raw);
|
|
51
|
+
if (!raw) {
|
|
52
|
+
args.output.write("[nolo] agent key is required.\n");
|
|
53
|
+
writeGrantHelp(args.output);
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
return resolveCliAgentKeyInput(raw);
|
|
57
|
+
}
|
|
58
|
+
async function callGrantApi(args) {
|
|
59
|
+
const url = new URL("/api/agent-grants", args.serverUrl);
|
|
60
|
+
if (args.method === "GET") {
|
|
61
|
+
url.searchParams.set("agentKey", args.agentKey);
|
|
62
|
+
if (args.includeRevoked) url.searchParams.set("includeRevoked", "1");
|
|
63
|
+
}
|
|
64
|
+
const res = await args.fetchImpl(url.toString(), {
|
|
65
|
+
method: args.method,
|
|
66
|
+
headers: {
|
|
67
|
+
Authorization: `Bearer ${args.authToken}`,
|
|
68
|
+
...args.method === "GET" ? {} : { "Content-Type": "application/json" }
|
|
69
|
+
},
|
|
70
|
+
...args.method === "GET" ? {} : {
|
|
71
|
+
body: JSON.stringify({
|
|
72
|
+
agentKey: args.agentKey,
|
|
73
|
+
granteeUserId: args.granteeUserId
|
|
74
|
+
})
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
const body = await res.json().catch(() => ({}));
|
|
78
|
+
if (!res.ok) {
|
|
79
|
+
throw new Error(
|
|
80
|
+
typeof body?.error === "string" ? body.error : `HTTP ${res.status} ${JSON.stringify(body)}`
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
return body;
|
|
84
|
+
}
|
|
85
|
+
async function runAgentGrantCommand(args, deps = {}) {
|
|
86
|
+
const env = deps.env ?? process.env;
|
|
87
|
+
const output = deps.output ?? process.stdout;
|
|
88
|
+
if (wantsHelp(args)) {
|
|
89
|
+
writeGrantHelp(output);
|
|
90
|
+
return 0;
|
|
91
|
+
}
|
|
92
|
+
const authToken = resolveAuthToken(args, env);
|
|
93
|
+
if (!authToken) {
|
|
94
|
+
output.write("[nolo] agent grant requires an auth token. Run `nolo login` or set AUTH_TOKEN.\n");
|
|
95
|
+
return 1;
|
|
96
|
+
}
|
|
97
|
+
if (!parseUserIdFromAuthToken(authToken)) {
|
|
98
|
+
output.write("[nolo] agent grant could not read userId from AUTH_TOKEN.\n");
|
|
99
|
+
return 1;
|
|
100
|
+
}
|
|
101
|
+
const agentKey = await resolveAgentKeyOrFail({
|
|
102
|
+
raw: positionalArgs(args)[0],
|
|
103
|
+
output
|
|
104
|
+
});
|
|
105
|
+
if (!agentKey) return 1;
|
|
106
|
+
const granteeUserId = asOptionalTrimmedString(readOption(args, "--to")) || asOptionalTrimmedString(readOption(args, "--grantee"));
|
|
107
|
+
if (!granteeUserId) {
|
|
108
|
+
output.write("[nolo] --to <userId> is required.\n");
|
|
109
|
+
writeGrantHelp(output);
|
|
110
|
+
return 1;
|
|
111
|
+
}
|
|
112
|
+
try {
|
|
113
|
+
const body = await callGrantApi({
|
|
114
|
+
method: "POST",
|
|
115
|
+
serverUrl: resolveServerUrl(args, env),
|
|
116
|
+
authToken,
|
|
117
|
+
fetchImpl: deps.fetchImpl ?? fetch,
|
|
118
|
+
agentKey,
|
|
119
|
+
granteeUserId
|
|
120
|
+
});
|
|
121
|
+
if (wantsJson(args)) {
|
|
122
|
+
output.write(`${JSON.stringify(body, null, 2)}
|
|
123
|
+
`);
|
|
124
|
+
} else {
|
|
125
|
+
output.write(
|
|
126
|
+
`Granted ${agentKey} \u2192 ${granteeUserId} (owner ${body?.grant?.ownerUserId ?? "?"})
|
|
127
|
+
`
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
return 0;
|
|
131
|
+
} catch (error) {
|
|
132
|
+
output.write(`[nolo] agent grant failed: ${toErrorMessage(error)}
|
|
133
|
+
`);
|
|
134
|
+
return 1;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
async function runAgentGrantsListCommand(args, deps = {}) {
|
|
138
|
+
const env = deps.env ?? process.env;
|
|
139
|
+
const output = deps.output ?? process.stdout;
|
|
140
|
+
if (wantsHelp(args)) {
|
|
141
|
+
writeGrantHelp(output);
|
|
142
|
+
return 0;
|
|
143
|
+
}
|
|
144
|
+
const authToken = resolveAuthToken(args, env);
|
|
145
|
+
if (!authToken) {
|
|
146
|
+
output.write("[nolo] agent grants requires an auth token. Run `nolo login` or set AUTH_TOKEN.\n");
|
|
147
|
+
return 1;
|
|
148
|
+
}
|
|
149
|
+
const agentKey = await resolveAgentKeyOrFail({
|
|
150
|
+
raw: positionalArgs(args)[0],
|
|
151
|
+
output
|
|
152
|
+
});
|
|
153
|
+
if (!agentKey) return 1;
|
|
154
|
+
try {
|
|
155
|
+
const body = await callGrantApi({
|
|
156
|
+
method: "GET",
|
|
157
|
+
serverUrl: resolveServerUrl(args, env),
|
|
158
|
+
authToken,
|
|
159
|
+
fetchImpl: deps.fetchImpl ?? fetch,
|
|
160
|
+
agentKey,
|
|
161
|
+
includeRevoked: args.includes("--include-revoked")
|
|
162
|
+
});
|
|
163
|
+
if (wantsJson(args)) {
|
|
164
|
+
output.write(`${JSON.stringify(body, null, 2)}
|
|
165
|
+
`);
|
|
166
|
+
return 0;
|
|
167
|
+
}
|
|
168
|
+
const grants = Array.isArray(body?.grants) ? body.grants : [];
|
|
169
|
+
if (grants.length === 0) {
|
|
170
|
+
output.write(`No active grants for ${agentKey}.
|
|
171
|
+
`);
|
|
172
|
+
return 0;
|
|
173
|
+
}
|
|
174
|
+
output.write(`Grants for ${agentKey}:
|
|
175
|
+
`);
|
|
176
|
+
for (const grant of grants) {
|
|
177
|
+
output.write(
|
|
178
|
+
` - ${grant.granteeUserId}` + (grant.revokedAt ? ` (revoked ${grant.revokedAt})` : "") + `
|
|
179
|
+
`
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
return 0;
|
|
183
|
+
} catch (error) {
|
|
184
|
+
output.write(`[nolo] agent grants failed: ${toErrorMessage(error)}
|
|
185
|
+
`);
|
|
186
|
+
return 1;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
async function runAgentRevokeGrantCommand(args, deps = {}) {
|
|
190
|
+
const env = deps.env ?? process.env;
|
|
191
|
+
const output = deps.output ?? process.stdout;
|
|
192
|
+
if (wantsHelp(args)) {
|
|
193
|
+
writeGrantHelp(output);
|
|
194
|
+
return 0;
|
|
195
|
+
}
|
|
196
|
+
const authToken = resolveAuthToken(args, env);
|
|
197
|
+
if (!authToken) {
|
|
198
|
+
output.write("[nolo] agent revoke-grant requires an auth token. Run `nolo login` or set AUTH_TOKEN.\n");
|
|
199
|
+
return 1;
|
|
200
|
+
}
|
|
201
|
+
const agentKey = await resolveAgentKeyOrFail({
|
|
202
|
+
raw: positionalArgs(args)[0],
|
|
203
|
+
output
|
|
204
|
+
});
|
|
205
|
+
if (!agentKey) return 1;
|
|
206
|
+
const granteeUserId = asOptionalTrimmedString(readOption(args, "--from")) || asOptionalTrimmedString(readOption(args, "--grantee"));
|
|
207
|
+
if (!granteeUserId) {
|
|
208
|
+
output.write("[nolo] --from <userId> is required.\n");
|
|
209
|
+
writeGrantHelp(output);
|
|
210
|
+
return 1;
|
|
211
|
+
}
|
|
212
|
+
try {
|
|
213
|
+
const body = await callGrantApi({
|
|
214
|
+
method: "DELETE",
|
|
215
|
+
serverUrl: resolveServerUrl(args, env),
|
|
216
|
+
authToken,
|
|
217
|
+
fetchImpl: deps.fetchImpl ?? fetch,
|
|
218
|
+
agentKey,
|
|
219
|
+
granteeUserId
|
|
220
|
+
});
|
|
221
|
+
if (wantsJson(args)) {
|
|
222
|
+
output.write(`${JSON.stringify(body, null, 2)}
|
|
223
|
+
`);
|
|
224
|
+
} else {
|
|
225
|
+
output.write(`Revoked grant ${agentKey} \u2715 ${granteeUserId}
|
|
226
|
+
`);
|
|
227
|
+
}
|
|
228
|
+
return 0;
|
|
229
|
+
} catch (error) {
|
|
230
|
+
output.write(`[nolo] agent revoke-grant failed: ${toErrorMessage(error)}
|
|
231
|
+
`);
|
|
232
|
+
return 1;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
export {
|
|
236
|
+
runAgentGrantCommand,
|
|
237
|
+
runAgentGrantsListCommand,
|
|
238
|
+
runAgentRevokeGrantCommand
|
|
239
|
+
};
|
|
@@ -30,8 +30,8 @@ import {
|
|
|
30
30
|
} from "./chunk-OOIN7HSO.js";
|
|
31
31
|
import "./chunk-KQHGZWSV.js";
|
|
32
32
|
import "./chunk-33K5FKRL.js";
|
|
33
|
-
import "./chunk-PB2DHBEQ.js";
|
|
34
33
|
import "./chunk-ZNFJWEN4.js";
|
|
34
|
+
import "./chunk-PB2DHBEQ.js";
|
|
35
35
|
import "./chunk-OIQPORYI.js";
|
|
36
36
|
import "./chunk-VQFY3VXW.js";
|
|
37
37
|
import "./chunk-3WGLLTK4.js";
|
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
} from "./chunk-VHBWHNVT.js";
|
|
16
16
|
import "./chunk-RQSOAMPJ.js";
|
|
17
17
|
import "./chunk-33K5FKRL.js";
|
|
18
|
-
import "./chunk-PB2DHBEQ.js";
|
|
19
18
|
import "./chunk-ZNFJWEN4.js";
|
|
19
|
+
import "./chunk-PB2DHBEQ.js";
|
|
20
20
|
import "./chunk-OIQPORYI.js";
|
|
21
21
|
import "./chunk-VQFY3VXW.js";
|
|
22
22
|
import "./chunk-3WGLLTK4.js";
|
|
@@ -76,7 +76,7 @@ async function defaultExecuteCli(provider, prompt, options) {
|
|
|
76
76
|
return executeCli(provider, prompt, options);
|
|
77
77
|
}
|
|
78
78
|
async function forwardConnectorRunMessage(machine, message, pushMessage, executeCli, env, fetchImpl) {
|
|
79
|
-
const { handleConnectorRunMessage } = await import("./machineWsRunDispatch-
|
|
79
|
+
const { handleConnectorRunMessage } = await import("./machineWsRunDispatch-EZ2IOYWT.js");
|
|
80
80
|
return handleConnectorRunMessage(message, pushMessage, executeCli, env, fetchImpl);
|
|
81
81
|
}
|
|
82
82
|
async function detectLaunchableMachineInfo() {
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
runAgentCreateCommand,
|
|
3
3
|
runAgentReadCommand,
|
|
4
4
|
runAgentUpdateCommand
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-VIPFEPO4.js";
|
|
6
|
+
import "./chunk-KPUM5RIE.js";
|
|
7
7
|
import "./chunk-EHLHSX7R.js";
|
|
8
8
|
import "./chunk-CMKUBIGW.js";
|
|
9
9
|
import "./chunk-JBTJAPUF.js";
|
|
@@ -13,9 +13,9 @@ import "./chunk-TQCONXQ3.js";
|
|
|
13
13
|
import "./chunk-VHBWHNVT.js";
|
|
14
14
|
import "./chunk-T3X232L6.js";
|
|
15
15
|
import "./chunk-ATNTHIZI.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-RLOKCZNX.js";
|
|
17
17
|
import "./chunk-OIMX7MM4.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-LAVVL3GH.js";
|
|
19
19
|
import "./chunk-RQSOAMPJ.js";
|
|
20
20
|
import "./chunk-OOIN7HSO.js";
|
|
21
21
|
import "./chunk-KQHGZWSV.js";
|
|
@@ -24,23 +24,23 @@ import "./chunk-3LY4F7SV.js";
|
|
|
24
24
|
import "./chunk-VP4WJWKW.js";
|
|
25
25
|
import "./chunk-63W5N6P3.js";
|
|
26
26
|
import "./chunk-VF4K2QE6.js";
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-4GTGSUMH.js";
|
|
28
|
+
import "./chunk-X7NITNY4.js";
|
|
29
29
|
import "./chunk-VC6OZXO5.js";
|
|
30
30
|
import "./chunk-OWOHNGCN.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-NARL6TJS.js";
|
|
32
32
|
import "./chunk-V2J635L5.js";
|
|
33
33
|
import "./chunk-MRC4Q34M.js";
|
|
34
34
|
import "./chunk-MTU75CZ2.js";
|
|
35
35
|
import "./chunk-CWMSB67P.js";
|
|
36
|
-
import "./chunk-
|
|
36
|
+
import "./chunk-4QUXYE7J.js";
|
|
37
37
|
import "./chunk-V6VXDXGY.js";
|
|
38
38
|
import "./chunk-Z4NR32XR.js";
|
|
39
39
|
import "./chunk-M76ECQRD.js";
|
|
40
40
|
import "./chunk-WZSRQNQG.js";
|
|
41
41
|
import "./chunk-33K5FKRL.js";
|
|
42
|
-
import "./chunk-PB2DHBEQ.js";
|
|
43
42
|
import "./chunk-ZNFJWEN4.js";
|
|
43
|
+
import "./chunk-PB2DHBEQ.js";
|
|
44
44
|
import "./chunk-OIQPORYI.js";
|
|
45
45
|
import "./chunk-VQFY3VXW.js";
|
|
46
46
|
import "./chunk-3WGLLTK4.js";
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
prependSubjectDialogMarker,
|
|
7
7
|
resolveWorkflowReference,
|
|
8
8
|
runAgentRunCommand
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-7EVWUQJZ.js";
|
|
10
10
|
import "./chunk-6HYVJV7B.js";
|
|
11
11
|
import {
|
|
12
12
|
parseAgentRunArgs
|
|
13
13
|
} from "./chunk-3QAF2LTL.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-KPUM5RIE.js";
|
|
15
15
|
import "./chunk-EHLHSX7R.js";
|
|
16
16
|
import "./chunk-CMKUBIGW.js";
|
|
17
17
|
import "./chunk-JBTJAPUF.js";
|
|
@@ -23,9 +23,9 @@ import "./chunk-LTRXGFMS.js";
|
|
|
23
23
|
import "./chunk-T3X232L6.js";
|
|
24
24
|
import "./chunk-ATNTHIZI.js";
|
|
25
25
|
import "./chunk-JEXVIMYZ.js";
|
|
26
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-RLOKCZNX.js";
|
|
27
27
|
import "./chunk-OIMX7MM4.js";
|
|
28
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-LAVVL3GH.js";
|
|
29
29
|
import "./chunk-RQSOAMPJ.js";
|
|
30
30
|
import "./chunk-OOIN7HSO.js";
|
|
31
31
|
import "./chunk-KQHGZWSV.js";
|
|
@@ -34,24 +34,24 @@ import "./chunk-3LY4F7SV.js";
|
|
|
34
34
|
import "./chunk-VP4WJWKW.js";
|
|
35
35
|
import "./chunk-63W5N6P3.js";
|
|
36
36
|
import "./chunk-VF4K2QE6.js";
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
37
|
+
import "./chunk-4GTGSUMH.js";
|
|
38
|
+
import "./chunk-X7NITNY4.js";
|
|
39
39
|
import "./chunk-VC6OZXO5.js";
|
|
40
40
|
import "./chunk-OWOHNGCN.js";
|
|
41
|
-
import "./chunk-
|
|
41
|
+
import "./chunk-NARL6TJS.js";
|
|
42
42
|
import "./chunk-V2J635L5.js";
|
|
43
43
|
import "./chunk-MRC4Q34M.js";
|
|
44
44
|
import "./chunk-MTU75CZ2.js";
|
|
45
45
|
import "./chunk-CWMSB67P.js";
|
|
46
|
-
import "./chunk-
|
|
46
|
+
import "./chunk-4QUXYE7J.js";
|
|
47
47
|
import "./chunk-V6VXDXGY.js";
|
|
48
48
|
import "./chunk-Z4NR32XR.js";
|
|
49
49
|
import "./chunk-M76ECQRD.js";
|
|
50
50
|
import "./chunk-AS3ZQ3O2.js";
|
|
51
51
|
import "./chunk-WZSRQNQG.js";
|
|
52
52
|
import "./chunk-33K5FKRL.js";
|
|
53
|
-
import "./chunk-PB2DHBEQ.js";
|
|
54
53
|
import "./chunk-ZNFJWEN4.js";
|
|
54
|
+
import "./chunk-PB2DHBEQ.js";
|
|
55
55
|
import "./chunk-OIQPORYI.js";
|
|
56
56
|
import "./chunk-VQFY3VXW.js";
|
|
57
57
|
import "./chunk-3WGLLTK4.js";
|
|
@@ -213,8 +213,10 @@ async function runAnthropicOAuthLogin(deps = {}) {
|
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
// packages/cli/oauth/authCommand.ts
|
|
216
|
-
var SYNC_HELP_LINE = ` --sync-to-server
|
|
217
|
-
|
|
216
|
+
var SYNC_HELP_LINE = ` --sync-to-server After local save, push the credential to your nolo server
|
|
217
|
+
(default when NOLO_SERVER + AUTH_TOKEN / profile are set).
|
|
218
|
+
--no-sync-to-server Skip server sync even when server config is available.
|
|
219
|
+
--sync-only Push ~/.nolo/credentials/<provider>.json to the server without re-login.`;
|
|
218
220
|
var CHATGPT_HELP_TEXT = `Authorize nolo-cli to call the OpenAI Codex / ChatGPT Plus API on your behalf.
|
|
219
221
|
|
|
220
222
|
This authorizes model API access only. It does NOT log you into the Nolo platform.
|
|
@@ -405,7 +407,7 @@ async function syncCredentialToServer(provider, credential, deps) {
|
|
|
405
407
|
const syncConfig = (deps.resolveServerSyncConfig ?? resolveServerSyncConfig)();
|
|
406
408
|
if (!syncConfig) {
|
|
407
409
|
output.log(
|
|
408
|
-
`[nolo] Warning:
|
|
410
|
+
`[nolo] Warning: server sync requires NOLO_SERVER and AUTH_TOKEN env vars, or a configured profile. Skipping server sync.`
|
|
409
411
|
);
|
|
410
412
|
return;
|
|
411
413
|
}
|
|
@@ -459,7 +461,9 @@ async function runAuthProviderCommand(provider, args, _ctx, deps = {}) {
|
|
|
459
461
|
const useBrowser = args.includes("--browser");
|
|
460
462
|
const noBrowser = args.includes("--no-browser") || deps.noBrowserByDefault;
|
|
461
463
|
const syncOnly = args.includes("--sync-only");
|
|
462
|
-
const
|
|
464
|
+
const syncConfigAvailable = !!(deps.resolveServerSyncConfig ?? resolveServerSyncConfig)();
|
|
465
|
+
const autoSyncDisabled = args.includes("--no-sync-to-server") || process.env.NOLO_OAUTH_AUTO_SYNC === "0";
|
|
466
|
+
const syncToServer = syncOnly || args.includes("--sync-to-server") || syncConfigAvailable && !autoSyncDisabled;
|
|
463
467
|
const generateToken = args.includes("--generate-token");
|
|
464
468
|
const writeToEnvRaw = parseFlagWithOptionalValue(args, "--write-to-env");
|
|
465
469
|
const writeToEnvPath = typeof writeToEnvRaw === "string" ? writeToEnvRaw : writeToEnvRaw === true ? ".env" : void 0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
updateContentTitle
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NARL6TJS.js";
|
|
4
4
|
import {
|
|
5
5
|
require_date_fns
|
|
6
6
|
} from "./chunk-M76ECQRD.js";
|
|
@@ -367,7 +367,7 @@ async function saveDocState(arg, { dispatch, getState }) {
|
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
async function createDocState(args, thunkApi) {
|
|
370
|
-
const { createPageAction } = await import("./createPageAction-
|
|
370
|
+
const { createPageAction } = await import("./createPageAction-MQPKRYSZ.js");
|
|
371
371
|
return createPageAction(args, thunkApi);
|
|
372
372
|
}
|
|
373
373
|
function subscribe(listener) {
|
|
@@ -300,7 +300,7 @@ var slice = createSliceWithThunks({
|
|
|
300
300
|
const overrides = {};
|
|
301
301
|
if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
|
|
302
302
|
if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
|
|
303
|
-
const { _executeModel } = await import("./_executeModel-
|
|
303
|
+
const { _executeModel } = await import("./_executeModel-ERQQ5SO5.js");
|
|
304
304
|
return _executeModel(
|
|
305
305
|
{
|
|
306
306
|
isStreaming: args.isStreaming ?? false,
|
|
@@ -321,7 +321,7 @@ var slice = createSliceWithThunks({
|
|
|
321
321
|
* - 循环直到无工具调用或触发其他运行时停止条件
|
|
322
322
|
*/
|
|
323
323
|
runAgent: create.asyncThunk(async (args, thunkApi) => {
|
|
324
|
-
const { runAgentClientLoop } = await import("./runAgentClientLoop-
|
|
324
|
+
const { runAgentClientLoop } = await import("./runAgentClientLoop-GFC2XHEC.js");
|
|
325
325
|
const { content: loopContent, toolCallCount } = await runAgentClientLoop(
|
|
326
326
|
{
|
|
327
327
|
agentKey: args.agentKey,
|
|
@@ -337,7 +337,7 @@ var slice = createSliceWithThunks({
|
|
|
337
337
|
* 聊天轮次流式 Agent 调用
|
|
338
338
|
*/
|
|
339
339
|
streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
|
|
340
|
-
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-
|
|
340
|
+
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-42SBHJ6F.js");
|
|
341
341
|
return streamAgentChatTurnHandler(args, thunkApi);
|
|
342
342
|
}),
|
|
343
343
|
/**
|