@c4a/context-cli 0.7.30 → 0.7.35

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.
Files changed (88) hide show
  1. package/cli.js +2491 -645
  2. package/indexers/bundles/context-code-indexer/references/indexer.md +17 -0
  3. package/indexers/bundles/context-code-indexer/templates/articles/c01.md +1 -1
  4. package/indexers/bundles/context-code-indexer/templates/articles/c07.md +1 -1
  5. package/indexers/bundles/context-code-indexer/templates/articles/l02.md +1 -1
  6. package/indexers/bundles/context-markdown-indexer/references/indexer.md +17 -0
  7. package/indexers/bundles/context-markdown-indexer/templates/articles/c01.md +1 -1
  8. package/indexers/bundles/context-markdown-indexer/templates/articles/c07.md +1 -1
  9. package/indexers/bundles/context-markdown-indexer/templates/articles/l02.md +1 -1
  10. package/indexers/bundles/context-note-indexer/references/writing.md +17 -0
  11. package/indexers/bundles/context-note-indexer/templates/articles/c01.md +1 -1
  12. package/indexers/bundles/context-note-indexer/templates/articles/c07.md +1 -1
  13. package/indexers/bundles/context-note-indexer/templates/articles/l02.md +1 -1
  14. package/indexers/bundles/context-sessions-indexer/references/writing.md +17 -0
  15. package/indexers/bundles/context-sessions-indexer/templates/articles/c01.md +1 -1
  16. package/indexers/bundles/context-sessions-indexer/templates/articles/c07.md +1 -1
  17. package/indexers/bundles/context-sessions-indexer/templates/articles/l02.md +1 -1
  18. package/indexers/contracts/profile-contract.json +245 -245
  19. package/indexers/release-manifest.json +21 -21
  20. package/package.json +12 -12
  21. package/plugins/README.md +45 -2
  22. package/plugins/README_CN.md +33 -2
  23. package/plugins/VERSION +1 -1
  24. package/plugins/claude/.claude-plugin/plugin.json +3 -2
  25. package/plugins/claude/commands/context-inspect-search.md +18 -0
  26. package/plugins/claude/commands/context-plan.md +12 -0
  27. package/plugins/claude/commands/context.md +125 -9
  28. package/plugins/claude/skills/context-inspect-search/SKILL.md +18 -0
  29. package/plugins/claude/skills/context-plan/SKILL.md +110 -0
  30. package/plugins/claude/skills/context-plan/agents/openai.yaml +2 -0
  31. package/plugins/claude/skills/context-plan/references/project-planning.md +250 -0
  32. package/plugins/claude/skills/context-plan/references/resource-tools.md +100 -0
  33. package/plugins/claude/skills/context-plan/templates/PLAN.md +113 -0
  34. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  35. package/plugins/codex/skills/context/SKILL.md +125 -9
  36. package/plugins/codex/skills/context-inspect-search/SKILL.md +18 -0
  37. package/plugins/codex/skills/context-plan/SKILL.md +109 -0
  38. package/plugins/codex/skills/context-plan/agents/openai.yaml +2 -0
  39. package/plugins/codex/skills/context-plan/references/project-planning.md +250 -0
  40. package/plugins/codex/skills/context-plan/references/resource-tools.md +100 -0
  41. package/plugins/codex/skills/context-plan/templates/PLAN.md +113 -0
  42. package/plugins/cursor/.cursor-plugin/plugin.json +3 -2
  43. package/plugins/cursor/commands/c4a-context-inspect-search.md +18 -0
  44. package/plugins/cursor/commands/c4a-context-plan.md +9 -0
  45. package/plugins/cursor/commands/c4a-context.md +125 -9
  46. package/plugins/cursor/skills/context-inspect-search/SKILL.md +18 -0
  47. package/plugins/cursor/skills/context-plan/SKILL.md +110 -0
  48. package/plugins/cursor/skills/context-plan/agents/openai.yaml +2 -0
  49. package/plugins/cursor/skills/context-plan/references/project-planning.md +250 -0
  50. package/plugins/cursor/skills/context-plan/references/resource-tools.md +100 -0
  51. package/plugins/cursor/skills/context-plan/templates/PLAN.md +113 -0
  52. package/plugins/skills/context/SKILL.md +125 -9
  53. package/plugins/skills/context-code-indexer/references/indexer.md +17 -0
  54. package/plugins/skills/context-code-indexer/templates/articles/c01.md +1 -1
  55. package/plugins/skills/context-code-indexer/templates/articles/c07.md +1 -1
  56. package/plugins/skills/context-code-indexer/templates/articles/l02.md +1 -1
  57. package/plugins/skills/context-inspect-search/SKILL.md +18 -0
  58. package/plugins/skills/context-markdown-indexer/references/indexer.md +17 -0
  59. package/plugins/skills/context-markdown-indexer/templates/articles/c01.md +1 -1
  60. package/plugins/skills/context-markdown-indexer/templates/articles/c07.md +1 -1
  61. package/plugins/skills/context-markdown-indexer/templates/articles/l02.md +1 -1
  62. package/plugins/skills/context-note-indexer/references/writing.md +17 -0
  63. package/plugins/skills/context-note-indexer/templates/articles/c01.md +1 -1
  64. package/plugins/skills/context-note-indexer/templates/articles/c07.md +1 -1
  65. package/plugins/skills/context-note-indexer/templates/articles/l02.md +1 -1
  66. package/plugins/skills/context-plan/SKILL.md +109 -0
  67. package/plugins/skills/context-plan/agents/openai.yaml +2 -0
  68. package/plugins/skills/context-plan/references/project-planning.md +250 -0
  69. package/plugins/skills/context-plan/references/resource-tools.md +100 -0
  70. package/plugins/skills/context-plan/templates/PLAN.md +113 -0
  71. package/plugins/skills/context-sessions-indexer/references/writing.md +17 -0
  72. package/plugins/skills/context-sessions-indexer/templates/articles/c01.md +1 -1
  73. package/plugins/skills/context-sessions-indexer/templates/articles/c07.md +1 -1
  74. package/plugins/skills/context-sessions-indexer/templates/articles/l02.md +1 -1
  75. package/providers/context/actions/repair-project-entry.yaml +1 -0
  76. package/providers/context/graphs/workspace.yaml +1 -1
  77. package/providers/context/manifest.json +27 -23
  78. package/providers/context/provider.yaml +1 -1
  79. package/providers/context/resources/manuals/guides/knowledge-updates.md +6 -0
  80. package/providers/context/resources/manuals/guides/lark-resources.md +94 -11
  81. package/providers/context/resources/manuals/guides/source-batches.md +89 -0
  82. package/providers/context/resources/manuals/guides/workspace-prepare.md +12 -0
  83. package/providers/context/resources/manuals/reference/project-api.md +4 -0
  84. package/providers/context/resources/procedures/document-capture.md +31 -11
  85. package/providers/context/resources/procedures/knowledge-review.md +13 -0
  86. package/providers/context/resources/procedures/knowledge-updates.md +6 -0
  87. package/providers/context/resources/procedures/source-capture-detailed.md +40 -8
  88. package/providers/context/resources/procedures/workspace-prepare.md +12 -0
@@ -43,10 +43,21 @@ discussion, or register-only request is not permission, and an explicit refusal
43
43
  always wins.
44
44
  Register several file/Lark/repo sources with `context source add batch [date]
45
45
  --input <yaml|json|->`; do not launch multiple `source add` processes in
46
- parallel. Repo batch items require `module`; file/Lark items may omit it and use
46
+ parallel. Long authorized batches can add `--checkpoint --progress`; use the
47
+ returned status and resume commands after interruption instead of rebuilding
48
+ the input. The checkpoint is advisory; resume revalidates the original input
49
+ against current sources. Repo batch items require `module`; file/Lark items may omit it and use
47
50
  the module returned by the CLI. A write-lock error means another Context mutation is active: wait for
48
51
  it to finish and retry rather than editing registry files.
49
52
 
53
+ Register a supplied Lark document or Wiki URL directly. `title` and `module` are
54
+ optional: the CLI derives a stable module locally, and capture obtains the title
55
+ with the document body. Do not call Wiki metadata, resolve a document token, or
56
+ fetch a title separately just to prepare registration. Keep an already known
57
+ title when useful; otherwise omit it instead of delaying capture to discover it.
58
+ For several URLs, one batch payload can contain only `type: lark` and `url` for
59
+ each source. Registration itself does not fetch remote content or grant access.
60
+
50
61
 
51
62
  ## Repository boundaries before bulk work
52
63
 
@@ -89,14 +100,22 @@ separate artifacts: XML audit evidence and a deterministic readable Markdown
89
100
  projection. Do not treat raw XML as Markdown and do not rewrite it yourself.
90
101
  The CLI also materializes supported embedded resources and returns a closed
91
102
  `resource_materialization` report. Required images, attachments, Sheets, Bases,
92
- whiteboards, diagrams, and synced blocks must be materialized before downstream
93
- Review. Polls and navigation references remain explicit non-interactive
103
+ whiteboards, diagrams, and synced blocks are processed under the source's
104
+ effective resource policy. Polls and navigation references remain explicit non-interactive
94
105
  projections; video is reference-only unless the project SDK opts into bundling.
95
106
  If the remote API explicitly confirms that a referenced whiteboard or diagram
96
107
  no longer exists, preserve the unresolved placeholder and the structured
97
108
  `document.resource.source-missing` warning, then continue through the Route.
98
- This is an audited source-side deletion, not successful materialization. Access,
99
- network, parameter, and unknown resource failures still block downstream work.
109
+ This is an audited source-side deletion, not successful materialization.
110
+ For an explicitly recognized permission denial, the CLI tries a supported
111
+ same-identity fallback. A preview is retained as a preview; a resource that
112
+ remains inaccessible stays unavailable with its reference and reason. These
113
+ warnings do not block the preserved body or trigger resource-level identity
114
+ switching, authorization prompts, or requests to change application permissions.
115
+ Do not use unavailable resources as content evidence or claim that previews
116
+ contain the original's complete data. Network, parameter, and unknown failures
117
+ retain the CLI's failure classification; a generic HTTP 400 is not proof of a
118
+ permission error.
100
119
  Do not manually download resources or patch links. Approved resources move to
101
120
  `knowledge/assets/`, and package build projects selected resources to
102
121
  `others/assets/`.
@@ -219,9 +238,10 @@ Preserve commands, reason codes, ids, and diagnostics exactly; summarize
219
238
  successful capture results for the user instead of dumping raw JSON. After any
220
239
  capture result:
221
240
 
222
- - Run `context status --format json` and treat `workflow.current` as the
223
- current-step authority; if the route returns `configuration`, perform only
224
- that declared project edit and rerun status.
241
+ - Consume a fresh `workflow.current` returned with the command result as the
242
+ current-step authority. If no fresh workspace Route was returned, run
243
+ `context status --format json` once. If the route returns `configuration`,
244
+ perform only that declared project edit and rerun status.
225
245
  - If `workflow.current.commands` contains another capture command for the
226
246
  confirmed batch, execute it before asking another naming, collection, or
227
247
  read-permission question.
@@ -250,6 +270,18 @@ retrying capture.
250
270
 
251
271
  Report in the user's conversation language. Translate section headings into the user's language instead of copying the English labels below verbatim. Optimize for human readability: use document titles instead of source ids, package names instead of internal source id strings, and human-readable kind labels ("local markdown", "Feishu doc", "code package") instead of internal tokens. Do not surface content hashes, snapshot digests, internal payload identifiers, or absolute file paths.
252
272
 
273
+ Use the capture command's returned `source`, `documents`, `snapshot`, `fidelity`,
274
+ and `resource_materialization` for the completion summary. They already contain
275
+ the title, body line count, change flag, resource counts, and per-resource reasons;
276
+ `access_identity` records the identity actually used. Reuse `source.url` when
277
+ present, or the user's original URL; do not construct a host URL from an opaque
278
+ token. Count `document.resource.preview` items separately from original downloads,
279
+ and distinguish reference-only or unavailable resources from acquired evidence.
280
+ Do not reopen the manifest/report, inspect Git changes, or perform a separate
281
+ link lookup solely to repeat fields already returned. Open detailed evidence only
282
+ for a concrete missing fact, failure investigation, or requested audit. The
283
+ workspace Route, not a successful resource count, determines workflow readiness.
284
+
253
285
  Stable structure:
254
286
 
255
287
  1. Completion headline. Single line with the action verb plus core counts: how
@@ -6,6 +6,18 @@ mediaType: text/markdown
6
6
 
7
7
  # Prepare a workspace for the next task
8
8
 
9
+ ## Capture-only requests in an existing workspace
10
+
11
+ An explicit request to capture named documents and pause does not start article
12
+ production. Register those sources first using the source-registration contract,
13
+ then reevaluate status for the capture Route. Capture precedes the cleared-task
14
+ resumption gate, so `task resume` is unnecessary for this request. Do not create
15
+ a production stage and then clear it to return to capture. Retain existing tasks,
16
+ drafts, approved content and source registrations. Stop after reporting the
17
+ selected capture results; resumption requires a request to produce knowledge.
18
+ The preparation and cleanup procedure below applies only when cleanup itself
19
+ is requested, not merely because the workspace previously completed a task.
20
+
9
21
  Agent policy: `context.gate.workspace_reset_restore`. A clear request to
10
22
  prepare this workspace authorizes the described task-state cleanup; clarify
11
23
  only an unresolved target or loss.