@khanglvm/outline-cli 0.1.6 → 0.1.8

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.
@@ -1,9 +1,9 @@
1
1
  import { CliError } from "./errors.js";
2
2
 
3
- const AI_SKILL_DATA_VERSION = "2026-03-07.1";
3
+ const AI_SKILL_DATA_VERSION = "2026-06-10.1";
4
4
  const AI_HELP_SECTION_ID = "ai-skills";
5
5
  const QUICK_START_HELP_SECTION_ID = "quick-start-agent";
6
- const QUICK_START_HELP_VERSION = "2026-03-07.1";
6
+ const QUICK_START_HELP_VERSION = "2026-06-10.1";
7
7
 
8
8
  const QUICK_START_AGENT_PLAYBOOK = {
9
9
  title: "outline-cli onboarding for non-expert users",
@@ -137,6 +137,7 @@ const QUICK_START_AGENT_PLAYBOOK = {
137
137
  "Create a draft release notes document with today's date.",
138
138
  "Append a short status update to document <document-id>.",
139
139
  "Find documents mentioning incident response in the last month.",
140
+ "Download the embedded images from document <document-url> into ./outline-attachments.",
140
141
  "Show who can access document <document-id>.",
141
142
  "Compare two documents and list key differences.",
142
143
  "Generate a TODO list from document <document-id>.",
@@ -170,8 +171,11 @@ const AI_GLOBAL_GUIDANCE = {
170
171
  "Start with the best-fit task tool first; open help/contracts only after validation fails or capability is unclear.",
171
172
  "Use ids/summary views first, then hydrate only selected records.",
172
173
  "Prefer batch operations (queries, ids, or batch command) before multi-call loops.",
174
+ "Pass documentQuery/refs, collectionQuery/collectionRefs, or userQuery/userRefs directly to documents.answer, documents.answer_batch, documents.search, documents.list, search.expand, search.research, or events.list when filtering by remembered names.",
175
+ "Use documents.resolve or documents.resolve_urls with refresh=false for zero-network remembered title or URL resolution.",
173
176
  "For heavy retrieval, use search.research with precisionMode + perQueryView/perQueryHitLimit to control token cost.",
174
177
  "When outputs offload to tmp files, read the new preview first, then inspect file content only when needed.",
178
+ "For embedded images/files, use documents.attachments or documents.download_attachments; attachments.redirect returns binary bytes and should not go through api.call.",
175
179
  "Keep mutating calls action-gated and explicit with performAction=true only at execute time.",
176
180
  "Capture audit evidence (events/revisions/policies) immediately after high-impact changes.",
177
181
  ],
@@ -190,8 +194,10 @@ const AI_SKILLS = [
190
194
  scenarios: ["UC-04", "UC-15"],
191
195
  objective: "Answer FAQ-style questions with bounded scope and deterministic follow-up.",
192
196
  featureUpdates: [
193
- "documents.answer and documents.answer_batch wrappers for permission-aware AI responses.",
194
- "search.research now supports precisionMode, reranking diversification, and compact per-query response shaping.",
197
+ "documents.answer and documents.answer_batch wrappers for permission-aware AI responses with remembered document/collection/user scopes.",
198
+ "search.research now supports precisionMode, reranking diversification, compact per-query response shaping, and remembered collection/user filters.",
199
+ "documents.search, documents.list, and search.expand can resolve remembered collection/user filters before retrieval.",
200
+ "documents.resolve and documents.resolve_urls can warm candidates from local memory or run memory-only with refresh=false.",
195
201
  ],
196
202
  sequence: [
197
203
  {
@@ -217,6 +223,8 @@ const AI_SKILLS = [
217
223
  ],
218
224
  efficiencyTips: [
219
225
  "Use precisionMode=precision and perQueryView=ids with a small perQueryHitLimit for stable token budgets.",
226
+ "Use documentQuery, collectionQuery, or userQuery filters on documents.answer, documents.answer_batch, documents.search, search.expand, or search.research when the user names a scope but not IDs.",
227
+ "Use documents.resolve_urls refresh=false when the user pasted an Outline URL that was seen in a prior session.",
220
228
  "Enable includeBacklinks only when one-call context gathering is worth extra API work.",
221
229
  "Keep batch concurrency low for stable latency and predictable cost.",
222
230
  ],
@@ -231,37 +239,36 @@ const AI_SKILLS = [
231
239
  scenarios: ["UC-05"],
232
240
  objective: "Create, update, and revoke share links with explicit auditability.",
233
241
  featureUpdates: [
234
- "shares.list/info/create/update/revoke wrappers with deterministic envelopes.",
242
+ "shares.list/info wrappers can resolve remembered document refs before read operations.",
243
+ "shares.create can resolve remembered document refs before creating share links.",
244
+ "shares.update/revoke wrappers retain deterministic envelopes.",
235
245
  "Mutation gating retained across sharing lifecycle operations.",
236
246
  ],
237
247
  sequence: [
238
248
  {
239
249
  step: 1,
240
- tool: "documents.search",
241
- purpose: "Resolve target public-help docs by query.",
242
- },
243
- {
244
- step: 2,
245
250
  tool: "shares.create",
246
- purpose: "Create share artifact only for approved doc targets.",
251
+ purpose: "Create share artifact for an approved exact document ID or remembered document ref.",
247
252
  },
248
253
  {
249
- step: 3,
254
+ step: 2,
250
255
  tool: "shares.update",
251
256
  purpose: "Apply controlled publish/visibility updates.",
252
257
  },
253
258
  {
254
- step: 4,
259
+ step: 3,
255
260
  tool: "shares.info",
256
261
  purpose: "Confirm final share state and metadata.",
257
262
  },
258
263
  {
259
- step: 5,
264
+ step: 4,
260
265
  tool: "shares.revoke",
261
266
  purpose: "Revoke stale or deprecated share links.",
262
267
  },
263
268
  ],
264
269
  efficiencyTips: [
270
+ "Pass documentQuery/refs/url/urlId directly to shares.create when creating a link for a known document by title or URL.",
271
+ "Pass documentQuery/refs/url/urlId directly to shares.list when auditing share links for a known document.",
265
272
  "Persist share ids once discovered to avoid repeated broad list calls.",
266
273
  "Use summary view for routine checks; hydrate full payload only for exceptions.",
267
274
  ],
@@ -277,7 +284,7 @@ const AI_SKILLS = [
277
284
  objective: "Apply least-privilege access controls and verify visibility by group and collection.",
278
285
  featureUpdates: [
279
286
  "groups.memberships wrapper added for group membership reads.",
280
- "documents.users and collection/document membership wrappers available for audits.",
287
+ "documents.users and collection/document membership wrappers can resolve remembered document and collection names before audit reads.",
281
288
  ],
282
289
  sequence: [
283
290
  {
@@ -308,6 +315,8 @@ const AI_SKILLS = [
308
315
  ],
309
316
  efficiencyTips: [
310
317
  "Prefer group grants over per-user grants for lower operational churn.",
318
+ "Pass query/refs/url/urlId directly to document and collection access wrappers to avoid separate resolve calls.",
319
+ "Use documentQuery/refs, collectionQuery/collectionRefs, and userQuery/userRefs directly on events.list for scoped audit evidence.",
311
320
  "Use paginated memberships reads for deterministic audits.",
312
321
  ],
313
322
  safetyChecks: [
@@ -360,6 +369,48 @@ const AI_SKILLS = [
360
369
  "Never apply mutation from synthetic issue refs without doc hydration.",
361
370
  ],
362
371
  },
372
+ {
373
+ id: "embedded_attachment_access",
374
+ title: "Embedded attachment and image access",
375
+ scenarios: ["UC-08", "UC-12"],
376
+ objective: "Extract, download, and hand off files embedded in Outline documents, including markdown images.",
377
+ featureUpdates: [
378
+ "documents.attachments extracts /api/attachments.redirect references from document markdown and can resolve remembered document titles, URLs, URL ids, and share ids directly.",
379
+ "attachments.download and documents.download_attachments save authenticated binary attachment bytes locally with contentType, byte count, and sha256 metadata.",
380
+ ],
381
+ sequence: [
382
+ {
383
+ step: 1,
384
+ tool: "documents.attachments",
385
+ purpose: "List embedded attachment IDs and source URLs without downloading bytes.",
386
+ },
387
+ {
388
+ step: 2,
389
+ tool: "attachments.download",
390
+ purpose: "Save one selected attachment/image to a local file.",
391
+ },
392
+ {
393
+ step: 3,
394
+ tool: "documents.download_attachments",
395
+ purpose: "Save every embedded file from a document into an output directory.",
396
+ },
397
+ {
398
+ step: 4,
399
+ tool: "documents.info",
400
+ purpose: "Re-read the document only when you need surrounding text context for downloaded files.",
401
+ },
402
+ ],
403
+ efficiencyTips: [
404
+ "Pass query, refs, url, urlId, or shareId directly to documents.attachments or documents.download_attachments instead of opening the document first.",
405
+ "Run documents.attachments first when you only need IDs or want to choose a subset.",
406
+ "Use a scratch outputDir plus overwrite=true for repeatable automation.",
407
+ "Keep download concurrency modest for image-heavy documents.",
408
+ ],
409
+ safetyChecks: [
410
+ "Do not use api.call for attachments.redirect; it is a binary endpoint.",
411
+ "Verify returned bytes, contentType, sha256, and filePath before downstream processing.",
412
+ ],
413
+ },
363
414
  {
364
415
  id: "rollback_safe_editing",
365
416
  title: "Rollback-safe postmortem editing",
@@ -367,36 +418,53 @@ const AI_SKILLS = [
367
418
  objective: "Plan and apply edits with revision diff evidence and deterministic rollback paths.",
368
419
  featureUpdates: [
369
420
  "revisions.diff and documents.apply_patch_safe wrappers added.",
421
+ "documents.diff can resolve remembered document titles, URLs, URL ids, and share ids before comparing proposed text.",
422
+ "documents.safe_update, documents.apply_patch, and documents.apply_patch_safe can resolve remembered document titles, URLs, URL ids, and share ids before guarded writes.",
423
+ "documents.safe_update and documents.apply_patch_safe accept expectedRevision='latest' for one-call edits against the current revision read inside the tool.",
424
+ "revisions.list can resolve remembered document titles, URLs, URL ids, and share ids before listing history.",
425
+ "revisions.diff can resolve remembered document refs and compare the latest two revisions without a separate revisions.list call.",
426
+ "documents.archived and documents.deleted can resolve remembered collection names before history/trash listing.",
370
427
  "Revision safety checks included in schema validation and tests.",
371
428
  ],
372
429
  sequence: [
373
430
  {
374
431
  step: 1,
375
- tool: "documents.info",
376
- purpose: "Read target document and revision baseline.",
432
+ tool: "documents.diff",
433
+ purpose: "Resolve target document refs and compare proposed text before planning a write.",
377
434
  },
378
435
  {
379
436
  step: 2,
380
- tool: "revisions.list",
381
- purpose: "Inspect recent revision timeline for concurrent edits.",
437
+ tool: "documents.open",
438
+ purpose: "Read a revision baseline only when the edit needs separate human or agent review before mutation.",
382
439
  },
383
440
  {
384
441
  step: 3,
385
- tool: "revisions.diff",
386
- purpose: "Diff candidate revisions for precise change context.",
442
+ tool: "revisions.list",
443
+ purpose: "Resolve target document refs and inspect recent revision timeline for concurrent edits.",
387
444
  },
388
445
  {
389
446
  step: 4,
390
- tool: "documents.apply_patch_safe",
391
- purpose: "Apply guarded patch with explicit expectedRevision.",
447
+ tool: "revisions.diff",
448
+ purpose: "Diff explicit revision IDs or the latest two revisions for precise change context.",
392
449
  },
393
450
  {
394
451
  step: 5,
452
+ tool: "documents.apply_patch_safe",
453
+ purpose: "Apply guarded patch with a numeric expectedRevision or expectedRevision='latest'.",
454
+ },
455
+ {
456
+ step: 6,
395
457
  tool: "revisions.info",
396
458
  purpose: "Confirm final revision and patch provenance.",
397
459
  },
398
460
  ],
399
461
  efficiencyTips: [
462
+ "Pass query, refs, url, urlId, or shareId directly to documents.diff instead of opening the document first.",
463
+ "Pass query, refs, url, urlId, or shareId directly to documents.safe_update or documents.apply_patch_safe when applying a guarded write.",
464
+ "Use expectedRevision='latest' to avoid a separate read turn when the requested edit should target the current server revision.",
465
+ "Pass query, refs, url, urlId, or shareId directly to revisions.list when the user asks for history by title.",
466
+ "Pass query, refs, url, urlId, or shareId directly to revisions.diff with revisionPair=latest when the user asks what changed recently.",
467
+ "Pass collectionQuery/collectionRefs directly to documents.archived or documents.deleted when reviewing collection-scoped history.",
400
468
  "Prefer small patch hunks over full document rewrite when coordinating multiple agents.",
401
469
  "Use summary views for revision triage, then hydrate final comparison only.",
402
470
  ],
@@ -451,7 +519,8 @@ const AI_SKILLS = [
451
519
  scenarios: ["UC-11"],
452
520
  objective: "Generate consistent documents from templates with strict placeholder enforcement.",
453
521
  featureUpdates: [
454
- "templates.extract_placeholders and documents.create_from_template wrappers added.",
522
+ "templates.list/info observations populate local template memory.",
523
+ "templates.extract_placeholders and documents.create_from_template wrappers resolve remembered template names before acting.",
455
524
  "Strict unresolved placeholder checks to block unsafe publishes.",
456
525
  ],
457
526
  sequence: [
@@ -477,6 +546,8 @@ const AI_SKILLS = [
477
546
  },
478
547
  ],
479
548
  efficiencyTips: [
549
+ "Pass templateQuery/templateRef/refs directly when the user names a template but does not provide an ID.",
550
+ "Use memory.lookup or memory.resolve with type=template when you need to inspect remembered template candidates.",
480
551
  "Reuse extracted placeholder keys to validate payload before creation.",
481
552
  "Use summary view for pipeline loop status checks.",
482
553
  ],
@@ -532,7 +603,9 @@ const AI_SKILLS = [
532
603
  objective: "Automate users/groups/permissions lifecycle changes with explicit verification.",
533
604
  featureUpdates: [
534
605
  "users lifecycle wrappers (invite, update_role, activate, suspend) added.",
535
- "documents.users and membership wrappers improve scoped permission checks.",
606
+ "users.info, groups.info, and groups.memberships can resolve remembered names/emails before read operations.",
607
+ "documents.users and membership wrappers resolve remembered document and collection refs for scoped permission checks.",
608
+ "Permission mutation wrappers can resolve both the target resource and user/group principal before action-gated add/remove calls.",
536
609
  ],
537
610
  sequence: [
538
611
  {
@@ -567,11 +640,13 @@ const AI_SKILLS = [
567
640
  },
568
641
  ],
569
642
  efficiencyTips: [
570
- "Batch read operations (ids/queries) before any mutation stage.",
643
+ "Pass query/refs directly to users.info, groups.info, and groups.memberships when the agent only has a remembered name or email.",
644
+ "Use documentQuery/query plus userQuery or groupQuery on access add/remove tools instead of separate resolve calls when the names are already clear.",
645
+ "Batch broad user/group reads before mutations, then pass document or collection refs directly to access verification wrappers.",
571
646
  "Separate planning output from execution payload for reliable reruns.",
572
647
  ],
573
648
  safetyChecks: [
574
- "Never combine unknown target resolution and mutation in the same step.",
649
+ "Never execute add/remove access calls from weak or ambiguous resolution candidates.",
575
650
  "Use performAction=true only on approved write calls.",
576
651
  ],
577
652
  },
@@ -662,6 +737,8 @@ const AI_SKILLS = [
662
737
  objective: "Build deterministic review queues and close loops with comment evidence.",
663
738
  featureUpdates: [
664
739
  "comments.review_queue wrapper added for scoped editorial queues.",
740
+ "comments.list can resolve remembered document refs for direct thread hydration.",
741
+ "comments.create can resolve remembered document refs before creating comments.",
665
742
  "Thread/reply and anchor metadata can be included for full review context.",
666
743
  ],
667
744
  sequence: [
@@ -677,17 +754,24 @@ const AI_SKILLS = [
677
754
  },
678
755
  {
679
756
  step: 3,
757
+ tool: "comments.create",
758
+ purpose: "Create an approved comment directly against an exact document ID or remembered document ref.",
759
+ },
760
+ {
761
+ step: 4,
680
762
  tool: "documents.info",
681
763
  purpose: "Hydrate only docs requiring editorial action.",
682
764
  },
683
765
  {
684
- step: 4,
766
+ step: 5,
685
767
  tool: "events.list",
686
768
  purpose: "Track review completion and discussion churn.",
687
769
  },
688
770
  ],
689
771
  efficiencyTips: [
690
772
  "Scope review_queue to explicit documentIds whenever possible.",
773
+ "Pass query/refs/url/urlId directly to comments.list when drilling into one remembered document.",
774
+ "Pass query/refs/url/urlId directly to comments.create when adding an approved comment to a remembered document.",
691
775
  "Use limitPerDocument to control queue growth and rerun with cursor-like cadence.",
692
776
  ],
693
777
  safetyChecks: [
@@ -703,6 +787,7 @@ const AI_SKILLS = [
703
787
  featureUpdates: [
704
788
  "documents.plan_terminology_refactor wrapper added for glossary/map-driven planning.",
705
789
  "Plan output is compatible with documents.batch_update execution workflows.",
790
+ "documents.batch_update can resolve per-item document titles, URLs, URL ids, and refs when expectedRevision is supplied.",
706
791
  ],
707
792
  sequence: [
708
793
  {
@@ -733,6 +818,7 @@ const AI_SKILLS = [
733
818
  ],
734
819
  efficiencyTips: [
735
820
  "Use map/glossary inputs with explicit scope filters to bound search space.",
821
+ "For small approved batches, pass query/refs/url directly in updates[] with expectedRevision='latest' to avoid a separate ID resolution turn.",
736
822
  "Review plan hashes and impact counts before any batch apply.",
737
823
  ],
738
824
  safetyChecks: [
package/src/cli.js CHANGED
@@ -187,6 +187,7 @@ async function getRuntime(opts, overrideProfileId, context = {}) {
187
187
  profile,
188
188
  client,
189
189
  profileSelection,
190
+ memory: { enabled: true },
190
191
  };
191
192
  }
192
193
 
@@ -1003,6 +1004,7 @@ export async function run(argv = process.argv) {
1003
1004
  profile: hydrated,
1004
1005
  client: new OutlineClient(hydrated),
1005
1006
  profileSelection,
1007
+ memory: { enabled: true },
1006
1008
  });
1007
1009
  }
1008
1010
  return clientCache.get(storedProfile.id);
@@ -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: "c69d41948b78c8ae35c0223377149ece8df5588863a010adf92a0b6ad11876d3",
7
- generatedAt: "2026-03-08T04:29:38.219Z",
6
+ signature: "8b0e982dd0adc3866dcd8c54cda30fc5b989c45c99763f223499a77291309078",
7
+ generatedAt: "2026-06-11T03:12:54.187Z",
8
8
  files: [
9
9
  {
10
10
  "path": "src/action-gate.js",
@@ -12,11 +12,11 @@ export const ENTRY_INTEGRITY_MANIFEST = Object.freeze({
12
12
  },
13
13
  {
14
14
  "path": "src/agent-skills.js",
15
- "sha256": "d40e94a4b61922d3ee8a43ed89d5e9ce1562a2cdffd37e2f396c2a18b9a481fc"
15
+ "sha256": "2c067431d98a4574fa7155a8d5952660a893f79b944c6e8750730ad109869e00"
16
16
  },
17
17
  {
18
18
  "path": "src/cli.js",
19
- "sha256": "2b6b17a71c15954c2663397d57afde2b8825ed368bb7f71833f6191662eff079"
19
+ "sha256": "ecc007c8935e9c669b4c997fd8c11b25ed8e65830efc3cb3c87ab55efab27160"
20
20
  },
21
21
  {
22
22
  "path": "src/config-store.js",
@@ -30,9 +30,13 @@ export const ENTRY_INTEGRITY_MANIFEST = Object.freeze({
30
30
  "path": "src/errors.js",
31
31
  "sha256": "45d49bbad4aaa5973fa01e176cd4c5efbddaa487692f18de698bdcad16be00a6"
32
32
  },
33
+ {
34
+ "path": "src/memory-store.js",
35
+ "sha256": "1bd1ce5c06d3f7a83c28be4c9fd691a5c92d1267a92d97667e966c30f8055152"
36
+ },
33
37
  {
34
38
  "path": "src/outline-client.js",
35
- "sha256": "2fe343f3cb1773c53fd14fad784d3ef1f5ff0e2c4c43b4a752ca9b7d5421677c"
39
+ "sha256": "457900dfee7c521f0683a0344009621df720e72d8cdcb3b32b4efed1c3fdf9be"
36
40
  },
37
41
  {
38
42
  "path": "src/result-store.js",
@@ -48,23 +52,23 @@ export const ENTRY_INTEGRITY_MANIFEST = Object.freeze({
48
52
  },
49
53
  {
50
54
  "path": "src/tool-arg-schemas.js",
51
- "sha256": "51f8727255e5b2b0a4cce78495cfaed9bb1869a7ef104b22dbc170604f878feb"
55
+ "sha256": "4fe93841790c0a916ff1dcf1b970528afed02ba530b0422560599bb62d575f0e"
52
56
  },
53
57
  {
54
58
  "path": "src/tools.extended.js",
55
- "sha256": "0c5317ca0b28a0b7110d9e6c81d8ca6ccd705e9b303de2f29e03f847b31df310"
59
+ "sha256": "69cdbd8e957a566813f8d97b926e0d764c29ce68187140f65c703467b77e8fe3"
56
60
  },
57
61
  {
58
62
  "path": "src/tools.js",
59
- "sha256": "96cfbb14cac2baa5221dc4e9294a0520f81c3e22a0c69ee648cd6c2354e1512e"
63
+ "sha256": "32ffccc7e6a099fa932a3eb9c026a9ae99cdbeeacd4cd3226e2d3b85c0ee6df2"
60
64
  },
61
65
  {
62
66
  "path": "src/tools.mutation.js",
63
- "sha256": "15fa3d146d99f55bc16d814ffd9360127b99eca2f9271cf751c6e5c7e4234317"
67
+ "sha256": "d7ef4fa419e06ec9ae6d9b994a1638f13b84cbd04455bda49a16952438dc36ae"
64
68
  },
65
69
  {
66
70
  "path": "src/tools.navigation.js",
67
- "sha256": "f7118e91c2edd0e6b57591d41fe7707c68eef51cde77918495bb4ee166139339"
71
+ "sha256": "6c1eb755686580de563b90d82d1a88b768c04d0dbbfddc0368d3708ca97faffd"
68
72
  },
69
73
  {
70
74
  "path": "src/tools.platform.js",