mossbear 0.1.0-alpha.114 → 0.1.0-alpha.116

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 (180) hide show
  1. package/README.md +1 -1
  2. package/dist/agent-comment-client.d.ts +1 -37
  3. package/dist/agent-comment-client.d.ts.map +1 -1
  4. package/dist/agent-comment-client.js +0 -50
  5. package/dist/agent-comment-client.js.map +1 -1
  6. package/dist/artifacts/artifact-comments-client.d.ts +3 -77
  7. package/dist/artifacts/artifact-comments-client.d.ts.map +1 -1
  8. package/dist/artifacts/artifact-comments-client.js +3 -103
  9. package/dist/artifacts/artifact-comments-client.js.map +1 -1
  10. package/dist/artifacts/classify.d.ts +2 -29
  11. package/dist/artifacts/classify.d.ts.map +1 -1
  12. package/dist/artifacts/classify.js +2 -27
  13. package/dist/artifacts/classify.js.map +1 -1
  14. package/dist/artifacts/claude-md-import.d.ts +0 -39
  15. package/dist/artifacts/claude-md-import.d.ts.map +1 -1
  16. package/dist/artifacts/claude-md-import.js +0 -40
  17. package/dist/artifacts/claude-md-import.js.map +1 -1
  18. package/dist/artifacts/committed.d.ts +4 -41
  19. package/dist/artifacts/committed.d.ts.map +1 -1
  20. package/dist/artifacts/committed.js +4 -41
  21. package/dist/artifacts/committed.js.map +1 -1
  22. package/dist/artifacts/delivered-skill-twins.d.ts +2 -39
  23. package/dist/artifacts/delivered-skill-twins.d.ts.map +1 -1
  24. package/dist/artifacts/delivered-skill-twins.js +33 -90
  25. package/dist/artifacts/delivered-skill-twins.js.map +1 -1
  26. package/dist/artifacts/promote-plan.d.ts.map +1 -1
  27. package/dist/artifacts/promote-plan.js +2 -24
  28. package/dist/artifacts/promote-plan.js.map +1 -1
  29. package/dist/artifacts/relink-mapping.d.ts +1 -4
  30. package/dist/artifacts/relink-mapping.d.ts.map +1 -1
  31. package/dist/artifacts/relink-mapping.js +3 -10
  32. package/dist/artifacts/relink-mapping.js.map +1 -1
  33. package/dist/artifacts/repo-config.d.ts +0 -13
  34. package/dist/artifacts/repo-config.d.ts.map +1 -1
  35. package/dist/artifacts/repo-config.js +0 -43
  36. package/dist/artifacts/repo-config.js.map +1 -1
  37. package/dist/artifacts/sidecar.d.ts +8 -21
  38. package/dist/artifacts/sidecar.d.ts.map +1 -1
  39. package/dist/artifacts/sidecar.js +35 -24
  40. package/dist/artifacts/sidecar.js.map +1 -1
  41. package/dist/artifacts/sync-acquisition.d.ts +51 -0
  42. package/dist/artifacts/sync-acquisition.d.ts.map +1 -0
  43. package/dist/artifacts/sync-acquisition.js +86 -0
  44. package/dist/artifacts/sync-acquisition.js.map +1 -0
  45. package/dist/artifacts/sync-artifacts.d.ts +11 -243
  46. package/dist/artifacts/sync-artifacts.d.ts.map +1 -1
  47. package/dist/artifacts/sync-artifacts.js +26 -1009
  48. package/dist/artifacts/sync-artifacts.js.map +1 -1
  49. package/dist/artifacts/sync-execution.d.ts +1 -21
  50. package/dist/artifacts/sync-execution.d.ts.map +1 -1
  51. package/dist/artifacts/sync-execution.js +10 -130
  52. package/dist/artifacts/sync-execution.js.map +1 -1
  53. package/dist/artifacts/sync-plan.d.ts +6 -184
  54. package/dist/artifacts/sync-plan.d.ts.map +1 -1
  55. package/dist/artifacts/sync-plan.js +17 -351
  56. package/dist/artifacts/sync-plan.js.map +1 -1
  57. package/dist/artifacts/sync-preparation.d.ts +29 -0
  58. package/dist/artifacts/sync-preparation.d.ts.map +1 -0
  59. package/dist/artifacts/sync-preparation.js +166 -0
  60. package/dist/artifacts/sync-preparation.js.map +1 -0
  61. package/dist/artifacts/sync-report.d.ts +92 -6
  62. package/dist/artifacts/sync-report.d.ts.map +1 -1
  63. package/dist/artifacts/sync-report.js +531 -5
  64. package/dist/artifacts/sync-report.js.map +1 -1
  65. package/dist/artifacts/twin-writer.d.ts +14 -0
  66. package/dist/artifacts/twin-writer.d.ts.map +1 -0
  67. package/dist/artifacts/twin-writer.js +31 -0
  68. package/dist/artifacts/twin-writer.js.map +1 -0
  69. package/dist/artifacts/working-skill-twins.d.ts +7 -0
  70. package/dist/artifacts/working-skill-twins.d.ts.map +1 -0
  71. package/dist/artifacts/working-skill-twins.js +217 -0
  72. package/dist/artifacts/working-skill-twins.js.map +1 -0
  73. package/dist/commands/comment.d.ts +1 -1
  74. package/dist/commands/comment.d.ts.map +1 -1
  75. package/dist/commands/comment.js +7 -10
  76. package/dist/commands/comment.js.map +1 -1
  77. package/dist/commands/comments.d.ts.map +1 -1
  78. package/dist/commands/comments.js +1 -4
  79. package/dist/commands/comments.js.map +1 -1
  80. package/dist/commands/init.d.ts.map +1 -1
  81. package/dist/commands/init.js +1 -11
  82. package/dist/commands/init.js.map +1 -1
  83. package/dist/commands/lifecycle.d.ts +2 -20
  84. package/dist/commands/lifecycle.d.ts.map +1 -1
  85. package/dist/commands/lifecycle.js +10 -52
  86. package/dist/commands/lifecycle.js.map +1 -1
  87. package/dist/commands/link.d.ts +1 -5
  88. package/dist/commands/link.d.ts.map +1 -1
  89. package/dist/commands/link.js +74 -58
  90. package/dist/commands/link.js.map +1 -1
  91. package/dist/commands/mcp.d.ts.map +1 -1
  92. package/dist/commands/mcp.js +2 -4
  93. package/dist/commands/mcp.js.map +1 -1
  94. package/dist/commands/promote.d.ts.map +1 -1
  95. package/dist/commands/promote.js +55 -1
  96. package/dist/commands/promote.js.map +1 -1
  97. package/dist/commands/pull.d.ts.map +1 -1
  98. package/dist/commands/pull.js +0 -1
  99. package/dist/commands/pull.js.map +1 -1
  100. package/dist/commands/recommend-dismissal.d.ts.map +1 -1
  101. package/dist/commands/recommend-dismissal.js +3 -2
  102. package/dist/commands/recommend-dismissal.js.map +1 -1
  103. package/dist/commands/search.d.ts +1 -1
  104. package/dist/commands/search.d.ts.map +1 -1
  105. package/dist/commands/search.js +3 -5
  106. package/dist/commands/search.js.map +1 -1
  107. package/dist/commands/unlink.d.ts.map +1 -1
  108. package/dist/commands/unlink.js +2 -14
  109. package/dist/commands/unlink.js.map +1 -1
  110. package/dist/context/materialize.d.ts +2 -0
  111. package/dist/context/materialize.d.ts.map +1 -1
  112. package/dist/context/materialize.js +4 -2
  113. package/dist/context/materialize.js.map +1 -1
  114. package/dist/guides/adoption-nudge.d.ts.map +1 -1
  115. package/dist/guides/adoption-nudge.js +0 -10
  116. package/dist/guides/adoption-nudge.js.map +1 -1
  117. package/dist/guides/delivered-status.d.ts +1 -3
  118. package/dist/guides/delivered-status.d.ts.map +1 -1
  119. package/dist/guides/delivered-status.js +1 -3
  120. package/dist/guides/delivered-status.js.map +1 -1
  121. package/dist/guides/import-client.d.ts +1 -1
  122. package/dist/http-retry.d.ts.map +1 -1
  123. package/dist/http-retry.js +30 -1
  124. package/dist/http-retry.js.map +1 -1
  125. package/dist/lifecycle/operations.d.ts +1 -18
  126. package/dist/lifecycle/operations.d.ts.map +1 -1
  127. package/dist/lifecycle/operations.js +9 -125
  128. package/dist/lifecycle/operations.js.map +1 -1
  129. package/dist/mcp/client.d.ts +115 -1
  130. package/dist/mcp/client.d.ts.map +1 -1
  131. package/dist/mcp/client.js +222 -1
  132. package/dist/mcp/client.js.map +1 -1
  133. package/dist/mcp/operations.d.ts +2 -25
  134. package/dist/mcp/operations.d.ts.map +1 -1
  135. package/dist/mcp/operations.js +24 -62
  136. package/dist/mcp/operations.js.map +1 -1
  137. package/dist/mcp/server.d.ts.map +1 -1
  138. package/dist/mcp/server.js +12 -11
  139. package/dist/mcp/server.js.map +1 -1
  140. package/dist/mcp/write-items.d.ts +1 -0
  141. package/dist/mcp/write-items.d.ts.map +1 -1
  142. package/dist/mcp/write-items.js.map +1 -1
  143. package/dist/skill-twin-hook.d.ts +4 -21
  144. package/dist/skill-twin-hook.d.ts.map +1 -1
  145. package/dist/skill-twin-hook.js +10 -24
  146. package/dist/skill-twin-hook.js.map +1 -1
  147. package/dist/usage/snapshot-state.d.ts +2 -2
  148. package/package.json +4 -4
  149. package/dist/artifacts/alias-history.d.ts +0 -68
  150. package/dist/artifacts/alias-history.d.ts.map +0 -1
  151. package/dist/artifacts/alias-history.js +0 -125
  152. package/dist/artifacts/alias-history.js.map +0 -1
  153. package/dist/artifacts/alias-mirror.d.ts +0 -69
  154. package/dist/artifacts/alias-mirror.d.ts.map +0 -1
  155. package/dist/artifacts/alias-mirror.js +0 -261
  156. package/dist/artifacts/alias-mirror.js.map +0 -1
  157. package/dist/artifacts/skill-twin-edit.d.ts +0 -109
  158. package/dist/artifacts/skill-twin-edit.d.ts.map +0 -1
  159. package/dist/artifacts/skill-twin-edit.js +0 -331
  160. package/dist/artifacts/skill-twin-edit.js.map +0 -1
  161. package/dist/artifacts/skill-twins.d.ts +0 -130
  162. package/dist/artifacts/skill-twins.d.ts.map +0 -1
  163. package/dist/artifacts/skill-twins.js +0 -381
  164. package/dist/artifacts/skill-twins.js.map +0 -1
  165. package/dist/finding-dismissals-client.d.ts +0 -28
  166. package/dist/finding-dismissals-client.d.ts.map +0 -1
  167. package/dist/finding-dismissals-client.js +0 -25
  168. package/dist/finding-dismissals-client.js.map +0 -1
  169. package/dist/lifecycle/live-sessions.d.ts +0 -90
  170. package/dist/lifecycle/live-sessions.d.ts.map +0 -1
  171. package/dist/lifecycle/live-sessions.js +0 -170
  172. package/dist/lifecycle/live-sessions.js.map +0 -1
  173. package/dist/search-client.d.ts +0 -59
  174. package/dist/search-client.d.ts.map +0 -1
  175. package/dist/search-client.js +0 -130
  176. package/dist/search-client.js.map +0 -1
  177. package/dist/session-digest-client.d.ts +0 -36
  178. package/dist/session-digest-client.d.ts.map +0 -1
  179. package/dist/session-digest-client.js +0 -60
  180. package/dist/session-digest-client.js.map +0 -1
package/README.md CHANGED
@@ -118,7 +118,7 @@ The CLI runs no LLM calls and holds no provider credentials, and produces no ver
118
118
  1. **Action metadata** — tool-call types, one-line summaries, and file *paths*. Shell command text is secret-redacted and length-capped before upload; the local run log keeps the command as typed.
119
119
  2. **Guide-file manifests** — the paths, formats and SHA-256 hashes of the instruction files that were in your agent's context, so a verdict can name which version of a guide it graded against.
120
120
  3. **Token usage**, read out of the transcript locally.
121
- 4. **Selected content**: guidance you link, including skill member files, and context you capture or publish through the MCP server. Two paths upload without a separate command. First, in a repo subscribed to a document bundle, `mossbear complete` at the end of a session pushes back any subscribed document you edited locally, as a new version. It blocks push-back when another session has logged recent activity in that checkout, or the bundle does not allow the repo to write. By default, conflicting server edits are left for you to resolve. Documents you have not edited are not sent. Second, a repo whose `.mossbear/config.json` declares paths in a `published` block publishes those paths automatically, with no per-publish confirmation, from its published branch (`published.branch`, default `main`): the remote-tracking copy of that branch, or the local branch in a repo with no remote. A lifecycle command publishes when that branch has moved since the checkout last published, sending the branch's committed contents, never the working copy or the checkout's own branch, and using the `published` block on that branch. It never fetches: it reads only what the clone already has, so it publishes after a `git pull`, a `git push` from this clone, or in a fresh clone. The declaration does not show that a person reviewed or agreed to it. Other sync uploads are unaffected. Only declared paths are sent, and a path the branch no longer holds is removed from the bundle. These content uploads do not use the transcript excerpt filters.
121
+ 4. **Selected content**: guidance you link, including skill member files, and context you capture or publish through the MCP server. Local edits of delivered copies stay on disk and are reported, never uploaded. A repo whose `.mossbear/config.json` declares paths in a `published` block publishes those paths automatically, with no per-publish confirmation, from its published branch (`published.branch`, default `main`): the remote-tracking copy of that branch, or the local branch in a repo with no remote. A lifecycle command publishes when that branch has moved since the checkout last published, sending the branch's committed contents, never the working copy or the checkout's own branch, and using the `published` block on that branch. It never fetches: it reads only what the clone already has, so it publishes after a `git pull`, a `git push` from this clone, or in a fresh clone. The declaration does not show that a person reviewed or agreed to it. Other sync uploads are unaffected. Only declared paths are sent, and a path the branch no longer holds is removed from the bundle. These content uploads do not use the transcript excerpt filters.
122
122
  5. **Narration**: a short account of what you and the agent said, which the dashboard shows as evidence beside a verdict. It is extracted from the transcript **on your machine**, has code blocks stripped structurally and secrets redacted before upload, and is length-capped on the wire. Recognized fenced and indented code blocks are removed, and tool-result bodies are excluded. Code or diffs copied into ordinary message text can remain in excerpts. Secret redaction uses patterns and is not a guarantee.
123
123
 
124
124
  Narration is a per-repository setting. Turn it off to stop preparing new excerpts, user turns and closing summaries there. Pending user turns from that repository are discarded. Older queued turns without repository identity are also discarded before delivery. Turning narration back on does not restore discarded queue entries. An upload already started cannot be recalled. Update the CLI before relying on queued-turn deletion. Action metadata and selected content uploads are unaffected:
@@ -1,40 +1,4 @@
1
- /**
2
- * The CLI's write of an agent comment: `POST /api/v1/context/comments`.
3
- *
4
- * **One client, two callers** — the MCP `comment` tool and the
5
- * `mossbear comment` verb — for the reason `search-client.ts` gives: two fetch
6
- * calls are two places for the headers, the status handling and the response
7
- * schema to drift. The response goes through the protocol's own parser, so a
8
- * drifting server contract fails here rather than being reported to an agent as
9
- * a comment that was left.
10
- *
11
- * Who the agent is is the caller's to say (`agent`), and the callers read it
12
- * from the harness (`resolveAgentSession`); this module neither reads an
13
- * environment nor makes an id up.
14
- */
15
- import type { AgentCommentRequest, AgentCommentResponse } from '@mossbear/protocol';
16
- export type CreateAgentCommentOptions = {
17
- dashboardUrl: string;
18
- token: string;
19
- target: AgentCommentRequest['target'];
20
- body: string;
21
- /** The exact text of whole lines of the artifact this comment is about. */
22
- passage?: string | undefined;
23
- agent: {
24
- sessionId: string;
25
- harness: AgentCommentRequest['agent']['harness'];
26
- model?: string | undefined;
27
- };
28
- /** This repo's committed `project.id`, so a reply by id prefix finds its repo's findings. */
29
- projectId?: string | null;
30
- /** The bundles this repo's comment read is scoped to, so a reply's id prefix is matched among them. */
31
- bundleIds?: readonly string[] | undefined;
32
- /** Defaults to the running CLI's own version. */
33
- cliVersion?: string;
34
- /** Override fetch for tests. Defaults to globalThis.fetch. */
35
- fetchImpl?: typeof fetch;
36
- };
37
- export declare function createAgentComment(options: CreateAgentCommentOptions): Promise<AgentCommentResponse>;
1
+ import type { AgentCommentResponse } from '@mossbear/protocol';
38
2
  /**
39
3
  * What to tell the caller a create did, in one sentence. The two outcomes read
40
4
  * differently on purpose: an agent that was handed back its earlier comment must
@@ -1 +1 @@
1
- {"version":3,"file":"agent-comment-client.d.ts","sourceRoot":"","sources":["../src/agent-comment-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAQH,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAEnF,MAAM,MAAM,yBAAyB,GAAG;IACtC,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAA;IACrC,IAAI,EAAE,MAAM,CAAA;IACZ,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,KAAK,EAAE;QACL,SAAS,EAAE,MAAM,CAAA;QACjB,OAAO,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAA;QAChD,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAC3B,CAAA;IACD,6FAA6F;IAC7F,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,uGAAuG;IACvG,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAA;IACzC,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,OAAO,KAAK,CAAA;CACzB,CAAA;AAED,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,oBAAoB,CAAC,CAkC/B;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAIzE"}
1
+ {"version":3,"file":"agent-comment-client.d.ts","sourceRoot":"","sources":["../src/agent-comment-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAE9D;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAIzE"}
@@ -1,53 +1,3 @@
1
- /**
2
- * The CLI's write of an agent comment: `POST /api/v1/context/comments`.
3
- *
4
- * **One client, two callers** — the MCP `comment` tool and the
5
- * `mossbear comment` verb — for the reason `search-client.ts` gives: two fetch
6
- * calls are two places for the headers, the status handling and the response
7
- * schema to drift. The response goes through the protocol's own parser, so a
8
- * drifting server contract fails here rather than being reported to an agent as
9
- * a comment that was left.
10
- *
11
- * Who the agent is is the caller's to say (`agent`), and the callers read it
12
- * from the harness (`resolveAgentSession`); this module neither reads an
13
- * environment nor makes an id up.
14
- */
15
- import { parseAgentCommentResponse } from '@mossbear/protocol';
16
- import { dashboardHttpError } from './dashboard-error.js';
17
- import { trimTrailingSlashes } from './url.js';
18
- import { CLI_VERSION } from './version.js';
19
- export async function createAgentComment(options) {
20
- const request = {
21
- target: options.target,
22
- body: options.body,
23
- ...(options.passage !== undefined ? { passage: options.passage } : {}),
24
- agent: {
25
- sessionId: options.agent.sessionId,
26
- harness: options.agent.harness,
27
- ...(options.agent.model ? { model: options.agent.model } : {}),
28
- cliVersion: options.cliVersion ?? CLI_VERSION,
29
- },
30
- ...(options.projectId ? { projectId: options.projectId } : {}),
31
- ...(options.bundleIds && options.bundleIds.length > 0
32
- ? { bundleIds: [...options.bundleIds] }
33
- : {}),
34
- };
35
- const response = await (options.fetchImpl ?? fetch)(`${trimTrailingSlashes(options.dashboardUrl)}/api/v1/context/comments`, {
36
- method: 'POST',
37
- headers: {
38
- Authorization: `Bearer ${options.token}`,
39
- 'Content-Type': 'application/json',
40
- },
41
- body: JSON.stringify(request),
42
- });
43
- if (!response.ok) {
44
- const text = await response.text().catch(() => '');
45
- // The server's own sentence when it sent one ("This agent session has left
46
- // 50 comments here"), the status form when a gateway answered instead.
47
- throw dashboardHttpError('Comment', response.status, text);
48
- }
49
- return parseAgentCommentResponse(await response.json());
50
- }
51
1
  /**
52
2
  * What to tell the caller a create did, in one sentence. The two outcomes read
53
3
  * differently on purpose: an agent that was handed back its earlier comment must
@@ -1 +1 @@
1
- {"version":3,"file":"agent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AAO,CAAC,EAAE,IAAI;QAC7C,CAAC,CAAC,sCAAsC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,KAAK,MAAM,CAAC,OAAO,CAAC,EAAE,qDAAqD,CAAA;AACzL,CAAC"}
@@ -1,26 +1,5 @@
1
- /**
2
- * The CLI's read of the comment channel: `GET /api/v1/context/comments` and
3
- * `POST /api/v1/context/comments/announcements`.
4
- *
5
- * **One client, three callers.** The `comments` verb, the MCP `pull` tool's comment read and
6
- * the session-start hook are three ways into the same two requests, and the
7
- * headers, the status handling and the response validation would otherwise be
8
- * three places to drift. The same reasoning as the guide-history client beside
9
- * it, and it takes its credentials directly for the same reason: this is a
10
- * read of what a person left, not a context-layer mutation, so it is not a
11
- * method on the context client.
12
- *
13
- * **Two requests because they are two acts.** Fetching bodies is a delivery
14
- * and the server counts it as one. Announcing prints a number and no bodies,
15
- * so it delivers nothing and is capped instead — per reader, per repo, on the
16
- * server, because a count kept in the checkout resets with the clone and a
17
- * count kept on the comment is shared by every reader.
18
- *
19
- * Responses go through the protocol's own parsers, so a drifting server
20
- * contract fails here rather than putting an unvalidated payload in front of
21
- * an agent.
22
- */
23
- import { type AnnounceItemCommentsResponse, type CommentEvidenceResponse, type HarnessId, type ItemCommentsResponse, type ResolveItemCommentResponse } from '@mossbear/protocol';
1
+ /** Counted announcements; comment bodies, evidence and other writes live on ContextClient. */
2
+ import { type AnnounceItemCommentsResponse } from '@mossbear/protocol';
24
3
  export type ArtifactCommentsRequestOptions = {
25
4
  dashboardUrl: string;
26
5
  token: string;
@@ -55,59 +34,6 @@ export type AnnounceArtifactCommentsOptions = ArtifactCommentsRequestOptions & {
55
34
  */
56
35
  projectId: string;
57
36
  };
58
- /**
59
- * Every open comment waiting for this reader in this repo.
60
- *
61
- * A deliberate read, so nothing about it is capped — and the server counts it
62
- * as a delivery, which is what lets a comment's author tell an ignored request
63
- * from an undelivered one.
64
- */
65
- export declare function fetchArtifactComments(options: ArtifactCommentsRequestOptions): Promise<ItemCommentsResponse>;
66
- /**
67
- * The evidence behind one Mossbear comment this reader was handed: its claim,
68
- * prediction and cited sessions.
69
- *
70
- * Takes the same bundles the comment read does, because the server finds the
71
- * comment through that read: evidence exists here only for a comment
72
- * `fetchArtifactComments` would return. A read, and not a delivery.
73
- */
74
- export declare function fetchCommentEvidence(options: Pick<ArtifactCommentsRequestOptions, 'dashboardUrl' | 'token' | 'fetchImpl'> & {
75
- id: string;
76
- bundleIds: readonly string[];
77
- /**
78
- * This repo's committed `project.id`, when it has one. An edit drafted
79
- * from one repo's sessions is withheld from a read that declares no repo,
80
- * so without it that edit's evidence could never be read.
81
- */
82
- projectId?: string | null;
83
- /** Defaults to the running CLI's own version. */
84
- cliVersion?: string;
85
- }): Promise<CommentEvidenceResponse>;
86
- /** Resolve one listed comment and leave the agent's account of its change. */
87
- export declare function resolveArtifactComment(options: Pick<ArtifactCommentsRequestOptions, 'dashboardUrl' | 'token' | 'fetchImpl'> & {
88
- id: string;
89
- note: string;
90
- bundleIds: readonly string[];
91
- /**
92
- * The artifact the comment is on. With it, the comment is found among that
93
- * artifact's open comments, as its comments read listed them, and
94
- * `bundleIds` is not consulted.
95
- */
96
- artifactId?: string;
97
- /** This repo's committed `project.id`, so its own repo-scoped comments resolve. */
98
- projectId?: string | null;
99
- /** Defaults to the running CLI's own version, so a listed draft resolves. */
100
- cliVersion?: string;
101
- /**
102
- * The agent session resolving it, so its note is named after that session.
103
- * Left out when the harness did not say which session this is.
104
- */
105
- agent?: {
106
- sessionId: string;
107
- harness: HarnessId;
108
- model?: string;
109
- };
110
- }): Promise<ResolveItemCommentResponse>;
111
37
  /**
112
38
  * Ask how many comments are waiting, and be counted as having said so.
113
39
  *
@@ -115,7 +41,7 @@ export declare function resolveArtifactComment(options: Pick<ArtifactCommentsReq
115
41
  * is how many were still under the per-repo cap, and it is what decides
116
42
  * whether to say anything at all. Zero means this reader has already been told
117
43
  * about every one of them as often as the cap allows — the comments are still
118
- * there, and `fetchArtifactComments` is where they still are.
44
+ * there, and `ContextClient.fetchArtifactComments` is where they still are.
119
45
  */
120
46
  export declare function announceArtifactComments(options: AnnounceArtifactCommentsOptions): Promise<AnnounceItemCommentsResponse>;
121
47
  //# sourceMappingURL=artifact-comments-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"artifact-comments-client.d.ts","sourceRoot":"","sources":["../../src/artifacts/artifact-comments-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAKL,KAAK,4BAA4B,EACjC,KAAK,uBAAuB,EAC5B,KAAK,SAAS,EACd,KAAK,oBAAoB,EAEzB,KAAK,0BAA0B,EAChC,MAAM,oBAAoB,CAAA;AAO3B,MAAM,MAAM,8BAA8B,GAAG;IAC3C,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb;;;;;;;OAOG;IACH,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,OAAO,KAAK,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,+BAA+B,GAAG,8BAA8B,GAAG;IAC7E;;;;;;OAMG;IACH,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,8BAA8B,GACtC,OAAO,CAAC,oBAAoB,CAAC,CAmB/B;AAED;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,IAAI,CACX,8BAA8B,EAC9B,cAAc,GAAG,OAAO,GAAG,WAAW,CACvC,GAAG;IACF,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;IAC5B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,GACA,OAAO,CAAC,uBAAuB,CAAC,CAgBlC;AAED,8EAA8E;AAC9E,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,IAAI,CACX,8BAA8B,EAC9B,cAAc,GAAG,OAAO,GAAG,WAAW,CACvC,GAAG;IACF,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;IAC5B;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,mFAAmF;IACnF,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,SAAS,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAClE,GACA,OAAO,CAAC,0BAA0B,CAAC,CAsBrC;AAED;;;;;;;;GAQG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,+BAA+B,GACvC,OAAO,CAAC,4BAA4B,CAAC,CA2BvC"}
1
+ {"version":3,"file":"artifact-comments-client.d.ts","sourceRoot":"","sources":["../../src/artifacts/artifact-comments-client.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAE9F,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,oBAAoB,CAAA;AAO3B,MAAM,MAAM,8BAA8B,GAAG;IAC3C,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb;;;;;;;OAOG;IACH,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,OAAO,KAAK,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,+BAA+B,GAAG,8BAA8B,GAAG;IAC7E;;;;;;OAMG;IACH,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED;;;;;;;;GAQG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,+BAA+B,GACvC,OAAO,CAAC,4BAA4B,CAAC,CA2BvC"}
@@ -1,109 +1,9 @@
1
- /**
2
- * The CLI's read of the comment channel: `GET /api/v1/context/comments` and
3
- * `POST /api/v1/context/comments/announcements`.
4
- *
5
- * **One client, three callers.** The `comments` verb, the MCP `pull` tool's comment read and
6
- * the session-start hook are three ways into the same two requests, and the
7
- * headers, the status handling and the response validation would otherwise be
8
- * three places to drift. The same reasoning as the guide-history client beside
9
- * it, and it takes its credentials directly for the same reason: this is a
10
- * read of what a person left, not a context-layer mutation, so it is not a
11
- * method on the context client.
12
- *
13
- * **Two requests because they are two acts.** Fetching bodies is a delivery
14
- * and the server counts it as one. Announcing prints a number and no bodies,
15
- * so it delivers nothing and is capped instead — per reader, per repo, on the
16
- * server, because a count kept in the checkout resets with the clone and a
17
- * count kept on the comment is shared by every reader.
18
- *
19
- * Responses go through the protocol's own parsers, so a drifting server
20
- * contract fails here rather than putting an unvalidated payload in front of
21
- * an agent.
22
- */
23
- import { parseAnnounceItemCommentsResponse, parseCommentEvidenceResponse, parseItemCommentsResponse, parseResolveItemCommentResponse, } from '@mossbear/protocol';
1
+ /** Counted announcements; comment bodies, evidence and other writes live on ContextClient. */
2
+ import { parseAnnounceItemCommentsResponse, } from '@mossbear/protocol';
24
3
  import { dashboardHttpError } from '../dashboard-error.js';
25
4
  import { fetchWithRetry } from '../http-retry.js';
26
5
  import { trimTrailingSlashes } from '../url.js';
27
6
  import { CLI_VERSION } from '../version.js';
28
- /**
29
- * Every open comment waiting for this reader in this repo.
30
- *
31
- * A deliberate read, so nothing about it is capped — and the server counts it
32
- * as a delivery, which is what lets a comment's author tell an ignored request
33
- * from an undelivered one.
34
- */
35
- export async function fetchArtifactComments(options) {
36
- // Answered without a round trip rather than as an empty request: a repo that
37
- // subscribes to nothing has no comments about its context, and that is a state
38
- // rather than something the server has to be asked about.
39
- if (options.bundleIds.length === 0)
40
- return { comments: [] };
41
- const params = new URLSearchParams({ bundles: options.bundleIds.join(',') });
42
- if (options.since)
43
- params.set('since', options.since);
44
- if (options.projectId)
45
- params.set('project', options.projectId);
46
- // The server lists Mossbear's findings only to a release that can tell one
47
- // from a person's request, so it must know which release is asking.
48
- params.set('cli', options.cliVersion ?? CLI_VERSION);
49
- const url = `${commentsBase(options.dashboardUrl)}?${params.toString()}`;
50
- const fetchImpl = options.fetchImpl ?? fetch;
51
- const response = await fetchImpl(url, {
52
- headers: { Authorization: `Bearer ${options.token}` },
53
- });
54
- if (!response.ok)
55
- throw await refusal(response);
56
- return parseItemCommentsResponse(await response.json());
57
- }
58
- /**
59
- * The evidence behind one Mossbear comment this reader was handed: its claim,
60
- * prediction and cited sessions.
61
- *
62
- * Takes the same bundles the comment read does, because the server finds the
63
- * comment through that read: evidence exists here only for a comment
64
- * `fetchArtifactComments` would return. A read, and not a delivery.
65
- */
66
- export async function fetchCommentEvidence(options) {
67
- const params = new URLSearchParams({
68
- id: options.id,
69
- bundles: options.bundleIds.join(','),
70
- });
71
- if (options.projectId)
72
- params.set('project', options.projectId);
73
- // The server withholds a citation kind a CLI too old to parse it would reject
74
- // the whole response for, so it must know which release is asking.
75
- params.set('cli', options.cliVersion ?? CLI_VERSION);
76
- const fetchImpl = options.fetchImpl ?? fetch;
77
- const response = await fetchImpl(`${commentsBase(options.dashboardUrl)}/evidence?${params.toString()}`, { headers: { Authorization: `Bearer ${options.token}` } });
78
- if (!response.ok)
79
- throw await refusal(response);
80
- return parseCommentEvidenceResponse(await response.json());
81
- }
82
- /** Resolve one listed comment and leave the agent's account of its change. */
83
- export async function resolveArtifactComment(options) {
84
- const fetchImpl = options.fetchImpl ?? fetch;
85
- const response = await fetchImpl(`${commentsBase(options.dashboardUrl)}/resolve`, {
86
- method: 'POST',
87
- headers: {
88
- Authorization: `Bearer ${options.token}`,
89
- 'Content-Type': 'application/json',
90
- },
91
- body: JSON.stringify({
92
- id: options.id,
93
- note: options.note,
94
- bundleIds: [...options.bundleIds],
95
- ...(options.artifactId ? { artifactId: options.artifactId } : {}),
96
- ...(options.projectId ? { projectId: options.projectId } : {}),
97
- cliVersion: options.cliVersion ?? CLI_VERSION,
98
- ...(options.agent
99
- ? { agent: { ...options.agent, cliVersion: options.cliVersion ?? CLI_VERSION } }
100
- : {}),
101
- }),
102
- });
103
- if (!response.ok)
104
- throw await refusal(response);
105
- return parseResolveItemCommentResponse(await response.json());
106
- }
107
7
  /**
108
8
  * Ask how many comments are waiting, and be counted as having said so.
109
9
  *
@@ -111,7 +11,7 @@ export async function resolveArtifactComment(options) {
111
11
  * is how many were still under the per-repo cap, and it is what decides
112
12
  * whether to say anything at all. Zero means this reader has already been told
113
13
  * about every one of them as often as the cap allows — the comments are still
114
- * there, and `fetchArtifactComments` is where they still are.
14
+ * there, and `ContextClient.fetchArtifactComments` is where they still are.
115
15
  */
116
16
  export async function announceArtifactComments(options) {
117
17
  if (options.bundleIds.length === 0)
@@ -1 +1 @@
1
- {"version":3,"file":"artifact-comments-client.js","sourceRoot":"","sources":["../../src/artifacts/artifact-comments-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EACL,iCAAiC,EACjC,4BAA4B,EAC5B,yBAAyB,EACzB,+BAA+B,GAOhC,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,EAAE,cAA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AQ,GAAG,MAAM,cAAc,CACnC,SAAS,EACT,GAAG,YAAY,CAAC,OAAO,CAAC,YAAY,CAAC,gBAAgB,EACrD;QACE,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,aAAa,EAAE,UAAU,OAAO,CAAC,KAAK,EAAE;YACxC,cAAc,EAAE,kBAAkB;SACnC;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,SAAS,EAAE,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC;YACjC,oEAAoE;YACpE,wBAAwB;YACxB,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,WAAW;SAC9C,CAAC;KACH,EACD,EAAE,WAAW,EAAE,CAAC,EAAE,CACnB,CAAA;IACD,IAAI,CAAC,QAAQ,CAAC,EAAE;QAAE,MAAM,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAA;IAC/C,OAAO,iCAAiC,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;AACjE,CAAC;AAED,SAAS,YAAY,CAAC,YAAoB;IACxC,OAAO,GAAG,mBAAmB,CAAC,YAAY,CAAC,0BAA0B,CAAA;AACvE,CAAC;AAED;;;;;;;GAOG;AACH,KAAK,UAAU,OAAO,CAAC,QAAkB;IACvC,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAA;IAClD,OAAO,kBAAkB,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;AAC9D,CAAC"}
1
+ {"version":3,"file":"artifact-comments-client.js","sourceRoot":"","sources":["../../src/artifacts/artifact-comments-client.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAE9F,OAAO,EACL,iCAAiC,GAElC,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC1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;AACH,KAAK,UAAU,OAAO,CAAC,QAAkB;IACvC,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAA;IAClD,OAAO,kBAAkB,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;AAC9D,CAAC"}
@@ -30,13 +30,8 @@
30
30
  * matches nothing in the history → `edited` — the user's work, never touch
31
31
  * could not be established → `unknown` — assume the user's work
32
32
  *
33
- * **`unknown` is not a failure mode, it is the safe answer**, and no caller may
34
- * overwrite on it. But it comes in two kinds, and they are not equally safe to
35
- * *push*: `unreadable` carries no evidence at all, while `lookback-exhausted`
36
- * carries evidence pointing the wrong way — the file matched none of the
37
- * versions we managed to check, yet older ones went unchecked, so it may be one
38
- * of our own ancient copies. Pushing that republishes stale content as canonical
39
- * for every subscriber. See `blocksPush`.
33
+ * Unknown bytes are preserved: a failed or bounded history read never licenses
34
+ * overwriting a file.
40
35
  *
41
36
  * Kept free of citty/console so it unit-tests against a mocked client.
42
37
  */
@@ -107,26 +102,4 @@ export declare function matchesStoredHash(localBytes: string, contentHash: strin
107
102
  export declare function classifyLocalFile(client: ContextClient, bundleId: string, item: ContextItem, localBytes: string): Promise<LocalClassification>;
108
103
  /** True when a classification means "the user's work — do not overwrite". */
109
104
  export declare function isUserOwned(classification: LocalClassification): boolean;
110
- /**
111
- * True when these bytes must not be sent back to the server.
112
- *
113
- * Only `lookback-exhausted` blocks. It is the one classification carrying
114
- * evidence that points the wrong way: the file matched none of the versions we
115
- * looked at, but older ones went unchecked, so it may well be one of our own
116
- * ancient copies. Pushing it would republish stale content as the newest
117
- * version — for every repo subscribed to that bundle, from an unattended Stop
118
- * hook, with no one watching.
119
- *
120
- * The asymmetry with `isUserOwned` is deliberate. Refusing to *overwrite* on any
121
- * uncertainty protects the user's file; refusing to *push* protects everyone
122
- * else's. Without this the same user action — reverting a doc to an earlier
123
- * version — resolved opposite ways depending only on how long that doc's history
124
- * happened to be: inside the lookback it was recognized and pulled, past it, it
125
- * was pushed over the canonical copy.
126
- */
127
- export declare function blocksPush(classification: LocalClassification): classification is {
128
- state: 'unknown';
129
- cause: 'lookback-exhausted';
130
- reason: string;
131
- };
132
105
  //# sourceMappingURL=classify.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"classify.d.ts","sourceRoot":"","sources":["../../src/artifacts/classify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAErD;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,MAAM,CAAA;AAKvC,MAAM,MAAM,mBAAmB,GAC3B;IAAE,KAAK,EAAE,SAAS,CAAA;CAAE,GACpB;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACnC;IAAE,KAAK,EAAE,QAAQ,CAAA;CAAE;AACrB;;;;;;;;;;GAUG;GACD;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,YAAY,GAAG,oBAAoB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAEpF;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAEpE;AAED,mFAAmF;AACnF,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAIlF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,WAAW,EACjB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,mBAAmB,CAAC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AE,WAAW,EACjB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,mBAAmB,CAAC,CAmD9B;AAED,6EAA6E;AAC7E,wBAAgB,WAAW,CAAC,cAAc,EAAE,mBAAmB,GAAG,OAAO,CAExE"}
@@ -30,13 +30,8 @@
30
30
  * matches nothing in the history → `edited` — the user's work, never touch
31
31
  * could not be established → `unknown` — assume the user's work
32
32
  *
33
- * **`unknown` is not a failure mode, it is the safe answer**, and no caller may
34
- * overwrite on it. But it comes in two kinds, and they are not equally safe to
35
- * *push*: `unreadable` carries no evidence at all, while `lookback-exhausted`
36
- * carries evidence pointing the wrong way — the file matched none of the
37
- * versions we managed to check, yet older ones went unchecked, so it may be one
38
- * of our own ancient copies. Pushing that republishes stale content as canonical
39
- * for every subscriber. See `blocksPush`.
33
+ * Unknown bytes are preserved: a failed or bounded history read never licenses
34
+ * overwriting a file.
40
35
  *
41
36
  * Kept free of citty/console so it unit-tests against a mocked client.
42
37
  */
@@ -142,24 +137,4 @@ export async function classifyLocalFile(client, bundleId, item, localBytes) {
142
137
  export function isUserOwned(classification) {
143
138
  return classification.state === 'edited' || classification.state === 'unknown';
144
139
  }
145
- /**
146
- * True when these bytes must not be sent back to the server.
147
- *
148
- * Only `lookback-exhausted` blocks. It is the one classification carrying
149
- * evidence that points the wrong way: the file matched none of the versions we
150
- * looked at, but older ones went unchecked, so it may well be one of our own
151
- * ancient copies. Pushing it would republish stale content as the newest
152
- * version — for every repo subscribed to that bundle, from an unattended Stop
153
- * hook, with no one watching.
154
- *
155
- * The asymmetry with `isUserOwned` is deliberate. Refusing to *overwrite* on any
156
- * uncertainty protects the user's file; refusing to *push* protects everyone
157
- * else's. Without this the same user action — reverting a doc to an earlier
158
- * version — resolved opposite ways depending only on how long that doc's history
159
- * happened to be: inside the lookback it was recognized and pulled, past it, it
160
- * was pushed over the canonical copy.
161
- */
162
- export function blocksPush(classification) {
163
- return (classification.state === 'unknown' && classification.cause === 'lookback-exhausted');
164
- }
165
140
  //# s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;YACrD,CAAC;QACH,CAAC;QAED,4EAA4E;QAC5E,0DAA0D;QAC1D,IAAI,IAAI,IAAI,oBAAoB;YAAE,MAAK;QACvC,IAAI,IAAI,CAAC,UAAU,KAAK,IAAI;YAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAA;QACxD,MAAM,GAAG,IAAI,CAAC,UAAU,CAAA;IAC1B,CAAC;IAED,OAAO;QACL,KAAK,EAAE,SAAS;QAChB,KAAK,EAAE,oBAAoB;QAC3B,MAAM,EAAE,0BAA0B,oBAAoB,WAAW;KAClE,CAAA;AACH,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,WAAW,CAAC,cAAmC;IAC7D,OAAO,cAAc,CAAC,KAAK,KAAK,QAAQ,IAAI,cAAc,CAAC,KAAK,KAAK,SAAS,CAAA;AAChF,CAAC"}
@@ -18,8 +18,6 @@
18
18
  * Pure functions over strings, plus one write helper with the same gate the
19
19
  * mirror used — so every rule here is testable without a checkout.
20
20
  */
21
- import type { CommittedProbe } from './committed.js';
22
- import type { ConflictResolution } from './sync-plan.js';
23
21
  /** The repo-root file Mossbear delivers into and owns. */
24
22
  export declare const AGENTS_MD = "AGENTS.md";
25
23
  /** The repo-root file Claude Code reads, which belongs to the person who keeps it. */
@@ -82,43 +80,6 @@ export declare function inspectClaudeMd(root: string, deps?: ClaudeMdDeps): Prom
82
80
  agents: string | undefined;
83
81
  claude: string | undefined;
84
82
  }>;
85
- export type ClaudeMdSwapOutcome =
86
- /** Replaced with the one-line import. */
87
- 'swapped'
88
- /** Held: `CLAUDE.md` carries uncommitted changes, or git has no answer for it. */
89
- | 'held-uncommitted'
90
- /** The write failed. */
91
- | 'failed';
92
- export type ClaudeMdSwapResult = {
93
- outcome: ClaudeMdSwapOutcome;
94
- error?: string;
95
- };
96
- /**
97
- * The rollout: swap a `CLAUDE.md` still byte-identical to `AGENTS.md` for the
98
- * one-line import. Returns `null` when there is nothing to swap.
99
- *
100
- * **Why this has to happen, and cannot wait for `doctor`.** In a repo that held
101
- * both files, the mirror was what kept `CLAUDE.md` in step with `AGENTS.md`.
102
- * Without it the next edit to `AGENTS.md` never reaches `CLAUDE.md` — and
103
- * Claude reads that stale `CLAUDE.md` *instead of* `AGENTS.md`, with nothing
104
- * reporting it. An identical file is one nobody put anything of their own into,
105
- * so the swap loses nothing; a divergent one is left for `doctor` to report.
106
- *
107
- * **Only where `AGENTS.md` is delivered here**, which the caller decides: a repo
108
- * whose `AGENTS.md` is not Mossbear's never had the mirror, and a copy the
109
- * person made by hand is theirs to replace (`init` offers to).
110
- *
111
- * **The same gate the mirror used**: written only where git holds exactly the
112
- * bytes on disk, so the swap is a clean diff `git checkout` gives back.
113
- * Modified, untracked and no-answer are held. `conflict: 'remote'` is the
114
- * person saying "overwrite my copy", and it cannot arrive from a hook.
115
- */
116
- export declare function swapIdenticalClaudeMd(input: {
117
- root: string;
118
- committed: CommittedProbe;
119
- conflict: ConflictResolution;
120
- deps?: ClaudeMdDeps;
121
- }): Promise<ClaudeMdSwapResult | null>;
122
83
  /**
123
84
  * True when a placement mapping at the root `CLAUDE.md` should be released
124
85
  * because the server now holds the guide at a different root file.
@@ -1 +1 @@
1
- {"version":3,"file":"claude-md-import.d.ts","sourceRoot":"","sources":["../../src/artifacts/claude-md-import.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAOH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAExD,0DAA0D;AAC1D,eAAO,MAAM,SAAS,cAAc,CAAA;AAEpC,sFAAsF;AACtF,eAAO,MAAM,SAAS,cAAc,CAAA;AAEpC,oDAAoD;AACpD,eAAO,MAAM,kBAAkB,eAAe,CAAA;AAE9C,8EAA8E;AAC9E,eAAO,MAAM,kBAAkB,iBAA4B,CAAA;AAE3D;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAA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AAa,GAAG,MAAM,GAAG,IAAI,CAM1E"}
@@ -122,46 +122,6 @@ export async function inspectClaudeMd(root, deps = {}) {
122
122
  const claude = await readIfPresent(resolve(root, CLAUDE_MD), readFileFn);
123
123
  return { state: classifyClaudeMd({ agents, claude }), agents, claude };
124
124
  }
125
- /**
126
- * The rollout: swap a `CLAUDE.md` still byte-identical to `AGENTS.md` for the
127
- * one-line import. Returns `null` when there is nothing to swap.
128
- *
129
- * **Why this has to happen, and cannot wait for `doctor`.** In a repo that held
130
- * both files, the mirror was what kept `CLAUDE.md` in step with `AGENTS.md`.
131
- * Without it the next edit to `AGENTS.md` never reaches `CLAUDE.md` — and
132
- * Claude reads that stale `CLAUDE.md` *instead of* `AGENTS.md`, with nothing
133
- * reporting it. An identical file is one nobody put anything of their own into,
134
- * so the swap loses nothing; a divergent one is left for `doctor` to report.
135
- *
136
- * **Only where `AGENTS.md` is delivered here**, which the caller decides: a repo
137
- * whose `AGENTS.md` is not Mossbear's never had the mirror, and a copy the
138
- * person made by hand is theirs to replace (`init` offers to).
139
- *
140
- * **The same gate the mirror used**: written only where git holds exactly the
141
- * bytes on disk, so the swap is a clean diff `git checkout` gives back.
142
- * Modified, untracked and no-answer are held. `conflict: 'remote'` is the
143
- * person saying "overwrite my copy", and it cannot arrive from a hook.
144
- */
145
- export async function swapIdenticalClaudeMd(input) {
146
- const { root, committed, conflict, deps = {} } = input;
147
- const writeFileFn = deps.writeFileFn ?? ((path, data) => writeProjectFile(root, path, data));
148
- const { state, claude } = await inspectClaudeMd(root, deps);
149
- if (state !== 'identical' || claude === undefined)
150
- return null;
151
- if (conflict !== 'remote' && committed.state(CLAUDE_MD, claude)?.kind !== 'committed') {
152
- return { outcome: 'held-uncommitted' };
153
- }
154
- try {
155
- await writeFileFn(resolve(root, CLAUDE_MD), AGENTS_IMPORT_FILE);
156
- return { outcome: 'swapped' };
157
- }
158
- catch (err) {
159
- return {
160
- outcome: 'failed',
161
- error: err instanceof Error ? err.message : String(err),
162
- };
163
- }
164
- }
165
125
  /**
166
126
  * True when a placement mapping at the root `CLAUDE.md` should be released
167
127
  * because the server now holds the guide at a different root file.
@@ -1 +1 @@
1
- {"version":3,"file":"claude-md-import.js","sourceRoot":"","sources":["../../src/artifacts/claude-md-import.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAKtD,0DAA0D;AAC1D,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAA;AAEpC,sFAAsF;AACtF,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAA;AAEpC,oDAAoD;AACpD,MAAM,CAAC,MAAM,kBAAkB,GAAG,YAAY,CAAA;AAE9C,8EAA8E;AAC9E,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,kBAAkB,IAAI,CAAA;AAE3D;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,KAAK,WAAW,CAAA;AACtF,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,KAAK,WAAW,CAAA;AACtF,CAAC;AAED;;;GAGG;AACH,MAAM,YAAY,GAAG,kCAAkC,CAAA;AAEvD,qDAAqD;AACrD,MAAM,KAAK,GAAG,eAAe,CAAA;AAE7B;;;;GAIG;AACH,SAAS,eAAe,CAAC,OAAe;IACtC,MAAM,KAAK,GAAa,EAAE,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