@khanglvm/outline-cli 0.2.3 → 0.2.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/CHANGELOG.md +6 -0
- package/README.md +5 -2
- package/package.json +1 -1
- package/src/entry-integrity-manifest.generated.js +4 -4
- package/src/tool-arg-schemas.js +3 -2
- package/src/tools.js +33 -5
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -43,13 +43,16 @@ outline-cli invoke documents.search \
|
|
|
43
43
|
--args '{"query":"onboarding","limit":5,"view":"summary"}'
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
Read a document using its UUID, slug, or full document URL:
|
|
47
47
|
|
|
48
48
|
```sh
|
|
49
49
|
outline-cli invoke documents.info \
|
|
50
|
-
--args '{"id":"<document-id>","view":"full"}'
|
|
50
|
+
--args '{"id":"<document-id-or-url>","view":"full"}'
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
+
For a pasted `/doc/` URL, `url` is also accepted. Batch reads accept mixed UUIDs,
|
|
54
|
+
slugs, and document URLs in `ids`. URLs use the selected workspace profile.
|
|
55
|
+
|
|
53
56
|
You can also create drafts, edit pages, manage comments, and inspect revision
|
|
54
57
|
history. Writes require `performAction:true`. Deleting a document also requires
|
|
55
58
|
a token from a prior read. See the [usage guide](https://github.com/khanglvm/outline-cli/blob/main/docs/USAGE.md) for examples.
|
package/package.json
CHANGED
|
@@ -3,8 +3,8 @@ export const ENTRY_INTEGRITY_MANIFEST = Object.freeze({
|
|
|
3
3
|
version: 1,
|
|
4
4
|
algorithm: "sha256",
|
|
5
5
|
signatureAlgorithm: "sha256-salted-manifest-v1",
|
|
6
|
-
signature: "
|
|
7
|
-
generatedAt: "2026-
|
|
6
|
+
signature: "473207690cbe47a499645410613964b4fe7a71061f7c032fdfec72c06c4b3145",
|
|
7
|
+
generatedAt: "2026-10-14T00:36:00.966Z",
|
|
8
8
|
files: [
|
|
9
9
|
{
|
|
10
10
|
"path": "src/action-gate.js",
|
|
@@ -52,7 +52,7 @@ export const ENTRY_INTEGRITY_MANIFEST = Object.freeze({
|
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
"path": "src/tool-arg-schemas.js",
|
|
55
|
-
"sha256": "
|
|
55
|
+
"sha256": "609c4cc17d57fae611dd2d59446cee2bb5437794af30151b61e195e720147155"
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
"path": "src/tools.extended.js",
|
|
@@ -60,7 +60,7 @@ export const ENTRY_INTEGRITY_MANIFEST = Object.freeze({
|
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
"path": "src/tools.js",
|
|
63
|
-
"sha256": "
|
|
63
|
+
"sha256": "8fed4d1f1c5e83b4a0e9136d2041b60262e4706426bd8c1c7751cc14dafac41c"
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
66
|
"path": "src/tools.mutation.js",
|
package/src/tool-arg-schemas.js
CHANGED
|
@@ -1384,6 +1384,7 @@ export const TOOL_ARG_SCHEMAS = {
|
|
|
1384
1384
|
"documents.info": {
|
|
1385
1385
|
properties: {
|
|
1386
1386
|
id: { type: "string" },
|
|
1387
|
+
url: { type: "string" },
|
|
1387
1388
|
ids: { type: "string[]" },
|
|
1388
1389
|
shareId: { type: "string" },
|
|
1389
1390
|
includePolicies: { type: "boolean" },
|
|
@@ -1393,8 +1394,8 @@ export const TOOL_ARG_SCHEMAS = {
|
|
|
1393
1394
|
readTokenTtlSeconds: { type: "number", min: 60 },
|
|
1394
1395
|
},
|
|
1395
1396
|
custom(args, issues) {
|
|
1396
|
-
if (!args.id && !args.ids && !args.shareId) {
|
|
1397
|
-
issues.push({ path: "args.id", message: "or args.ids[] or args.shareId is required" });
|
|
1397
|
+
if (!args.id && !args.ids && !args.url && !args.shareId) {
|
|
1398
|
+
issues.push({ path: "args.id", message: "or args.ids[] or args.url or args.shareId is required" });
|
|
1398
1399
|
}
|
|
1399
1400
|
},
|
|
1400
1401
|
},
|
package/src/tools.js
CHANGED
|
@@ -47,6 +47,30 @@ function normalizeIds(args) {
|
|
|
47
47
|
return [...new Set(ids)];
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
function normalizeDocumentReference(value) {
|
|
51
|
+
const reference = String(value).trim();
|
|
52
|
+
if (!reference.includes("://") && !reference.startsWith("/")) {
|
|
53
|
+
return reference;
|
|
54
|
+
}
|
|
55
|
+
let parsed;
|
|
56
|
+
try {
|
|
57
|
+
parsed = new URL(reference, "https://outline.invalid");
|
|
58
|
+
} catch {
|
|
59
|
+
throw new CliError("documents.info requires a document UUID, slug, or /doc/ URL");
|
|
60
|
+
}
|
|
61
|
+
const match = parsed.pathname.match(/^\/doc\/([^/]+)\/?$/);
|
|
62
|
+
if (!["http:", "https:"].includes(parsed.protocol) || !match) {
|
|
63
|
+
throw new CliError("documents.info requires a /doc/ URL; use shareId for shared documents");
|
|
64
|
+
}
|
|
65
|
+
try {
|
|
66
|
+
const slug = decodeURIComponent(match[1]);
|
|
67
|
+
if (!slug || /[/?#\s]/.test(slug)) throw new Error("invalid slug");
|
|
68
|
+
return slug;
|
|
69
|
+
} catch {
|
|
70
|
+
throw new CliError("documents.info URL contains an invalid document slug");
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
50
74
|
function normalizeSearchRow(row, view = "summary", contextChars = 320) {
|
|
51
75
|
if (view === "full") {
|
|
52
76
|
return row;
|
|
@@ -624,14 +648,17 @@ async function documentsListTool(ctx, args) {
|
|
|
624
648
|
}
|
|
625
649
|
|
|
626
650
|
async function documentsInfoTool(ctx, args) {
|
|
627
|
-
|
|
651
|
+
if (args.url && args.id && normalizeDocumentReference(args.url) !== normalizeDocumentReference(args.id)) {
|
|
652
|
+
throw new CliError("documents.info id and url must identify the same document");
|
|
653
|
+
}
|
|
654
|
+
const ids = [...new Set(normalizeIds({ ...args, id: args.id || args.url }).map(normalizeDocumentReference))];
|
|
628
655
|
const view = args.view || "summary";
|
|
629
656
|
const excerptChars = toInteger(args.excerptChars, 280);
|
|
630
657
|
const armDelete = args.armDelete === true;
|
|
631
658
|
const readTokenTtlSeconds = toInteger(args.readTokenTtlSeconds, 900);
|
|
632
659
|
|
|
633
660
|
if (ids.length === 0 && !args.shareId) {
|
|
634
|
-
throw new CliError("documents.info requires args.id, args.ids, or args.shareId");
|
|
661
|
+
throw new CliError("documents.info requires args.id, args.ids, args.url, or args.shareId");
|
|
635
662
|
}
|
|
636
663
|
|
|
637
664
|
const maxAttempts = toInteger(args.maxAttempts, 2);
|
|
@@ -1078,8 +1105,8 @@ export const TOOLS = {
|
|
|
1078
1105
|
},
|
|
1079
1106
|
"documents.info": {
|
|
1080
1107
|
signature:
|
|
1081
|
-
"documents.info(args: { id?: string; ids?: string[]; shareId?: string; view?: 'summary'|'full'; includePolicies?: boolean; concurrency?: number; armDelete?: boolean; readTokenTtlSeconds?: number })",
|
|
1082
|
-
description: "Read one or many documents by
|
|
1108
|
+
"documents.info(args: { id?: string; ids?: string[]; url?: string; shareId?: string; view?: 'summary'|'full'; includePolicies?: boolean; concurrency?: number; armDelete?: boolean; readTokenTtlSeconds?: number })",
|
|
1109
|
+
description: "Read one or many documents by UUID, slug, or document URL.",
|
|
1083
1110
|
usageExample: {
|
|
1084
1111
|
tool: "documents.info",
|
|
1085
1112
|
args: {
|
|
@@ -1089,7 +1116,8 @@ export const TOOLS = {
|
|
|
1089
1116
|
},
|
|
1090
1117
|
},
|
|
1091
1118
|
bestPractices: [
|
|
1092
|
-
"Use `ids[]`
|
|
1119
|
+
"Use `id` or `url` for one document; `ids[]` accepts mixed UUIDs, slugs, and /doc/ URLs.",
|
|
1120
|
+
"Document URLs are resolved within the selected profile; select the matching workspace first.",
|
|
1093
1121
|
"Use summary view first; only request full for final chosen docs.",
|
|
1094
1122
|
"Handle partial failures by checking each item.ok in batched result.",
|
|
1095
1123
|
"Set armDelete=true when you need a short-lived delete read token for a safe delete flow.",
|