@rolino/cli 0.7.0 → 0.8.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/CHANGELOG.md +18 -0
- package/README.md +8 -4
- package/dist/bin.cjs +30 -34
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +1 -1
- package/dist/{chunk-PEJ2WA66.js → chunk-KR5C3ZU3.js} +13 -17
- package/dist/chunk-KR5C3ZU3.js.map +1 -0
- package/dist/index.cjs +30 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +4 -4
- package/dist/chunk-PEJ2WA66.js.map +0 -1
package/dist/bin.js
CHANGED
|
@@ -143,13 +143,12 @@ function updateCodexConfig(source, server) {
|
|
|
143
143
|
const block = codexBlock(server, newline);
|
|
144
144
|
const begin = source.indexOf(CODEX_BEGIN);
|
|
145
145
|
const end = source.indexOf(CODEX_END);
|
|
146
|
-
if (begin === -1 !== (end === -1) || begin !== -1 && end < begin) {
|
|
147
|
-
throw new TypeError("Codex config contains an incomplete Rolino-managed block.");
|
|
148
|
-
}
|
|
149
146
|
let unmanagedSource = source;
|
|
150
|
-
if (begin !== -1) {
|
|
147
|
+
if (begin !== -1 && end !== -1 && end > begin) {
|
|
151
148
|
const after = end + CODEX_END.length;
|
|
152
149
|
unmanagedSource = `${source.slice(0, begin)}${source.slice(after)}`;
|
|
150
|
+
} else if (begin !== -1 || end !== -1) {
|
|
151
|
+
unmanagedSource = source.split(/\r?\n/).filter((line) => line.trim() !== CODEX_BEGIN && line.trim() !== CODEX_END).join(newline);
|
|
153
152
|
}
|
|
154
153
|
const withoutRolino = removeExistingCodexEntry(unmanagedSource, newline);
|
|
155
154
|
return `${withoutRolino ? `${withoutRolino}${newline}${newline}` : ""}${block}${newline}`;
|
|
@@ -341,7 +340,7 @@ import { Command, CommanderError, InvalidArgumentError } from "commander";
|
|
|
341
340
|
// package.json
|
|
342
341
|
var package_default = {
|
|
343
342
|
name: "@rolino/cli",
|
|
344
|
-
version: "0.
|
|
343
|
+
version: "0.8.0",
|
|
345
344
|
description: "Agent-friendly command-line interface for Rolino",
|
|
346
345
|
type: "module",
|
|
347
346
|
license: "MIT",
|
|
@@ -398,9 +397,9 @@ var package_default = {
|
|
|
398
397
|
dev: "tsx src/bin.ts"
|
|
399
398
|
},
|
|
400
399
|
dependencies: {
|
|
401
|
-
"@rolino/contracts": "0.
|
|
402
|
-
"@rolino/local-auth": "0.
|
|
403
|
-
"@rolino/sdk": "0.
|
|
400
|
+
"@rolino/contracts": "0.8.0",
|
|
401
|
+
"@rolino/local-auth": "0.8.0",
|
|
402
|
+
"@rolino/sdk": "0.8.0",
|
|
404
403
|
commander: "^15.0.0",
|
|
405
404
|
open: "^11.0.0"
|
|
406
405
|
},
|
|
@@ -438,6 +437,7 @@ import {
|
|
|
438
437
|
// src/browser-login.ts
|
|
439
438
|
import { createHash, randomBytes, timingSafeEqual } from "crypto";
|
|
440
439
|
import { createServer } from "http";
|
|
440
|
+
import { AGENT_CAPABILITIES } from "@rolino/contracts";
|
|
441
441
|
import {
|
|
442
442
|
oauthConfiguration
|
|
443
443
|
} from "@rolino/local-auth";
|
|
@@ -445,13 +445,9 @@ import open from "open";
|
|
|
445
445
|
var OAUTH_CALLBACK_PORT = 48391;
|
|
446
446
|
var OAUTH_CALLBACK_PATH = "/oauth/callback";
|
|
447
447
|
var OAUTH_TIMEOUT_MS = 5 * 60 * 1e3;
|
|
448
|
-
var
|
|
448
|
+
var AUTHORIZATION_REQUEST_SCOPES = [
|
|
449
449
|
"offline_access",
|
|
450
|
-
|
|
451
|
-
"projects:read",
|
|
452
|
-
"posts:read",
|
|
453
|
-
"integrations:read",
|
|
454
|
-
"calendar:read"
|
|
450
|
+
...AGENT_CAPABILITIES
|
|
455
451
|
];
|
|
456
452
|
function escapeHtml(value) {
|
|
457
453
|
return value.replace(/[&<>"']/g, (character) => ({
|
|
@@ -491,7 +487,7 @@ function createBrowserAuthorizationRequest(baseUrl) {
|
|
|
491
487
|
url.searchParams.set("response_type", "code");
|
|
492
488
|
url.searchParams.set("client_id", configuration.clientId);
|
|
493
489
|
url.searchParams.set("redirect_uri", redirectUri);
|
|
494
|
-
url.searchParams.set("scope",
|
|
490
|
+
url.searchParams.set("scope", AUTHORIZATION_REQUEST_SCOPES.join(" "));
|
|
495
491
|
url.searchParams.set("resource", configuration.resource);
|
|
496
492
|
url.searchParams.set("state", state);
|
|
497
493
|
url.searchParams.set("code_challenge", codeChallenge);
|
|
@@ -530,7 +526,7 @@ async function exchangeAuthorizationCode(options) {
|
|
|
530
526
|
accessTokenExpiresAt: new Date(Date.now() + expiresIn * 1e3).toISOString(),
|
|
531
527
|
refreshToken: payload.refresh_token,
|
|
532
528
|
refreshTokenExpiresAt: new Date(Date.now() + 30 * 24 * 60 * 60 * 1e3).toISOString(),
|
|
533
|
-
scopes: typeof payload.scope === "string" ? payload.scope.split(/\s+/).filter(Boolean) : [...
|
|
529
|
+
scopes: typeof payload.scope === "string" ? payload.scope.split(/\s+/).filter(Boolean) : [...AUTHORIZATION_REQUEST_SCOPES]
|
|
534
530
|
};
|
|
535
531
|
}
|
|
536
532
|
async function loginWithBrowser(options) {
|
|
@@ -2591,4 +2587,4 @@ export {
|
|
|
2591
2587
|
ROLINO_CLI_VERSION,
|
|
2592
2588
|
runCli
|
|
2593
2589
|
};
|
|
2594
|
-
//# sourceMappingURL=chunk-
|
|
2590
|
+
//# sourceMappingURL=chunk-KR5C3ZU3.js.map
|