mossbear 0.1.0-alpha.115 → 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.
- package/README.md +1 -1
- package/dist/artifacts/classify.d.ts +2 -29
- package/dist/artifacts/classify.d.ts.map +1 -1
- package/dist/artifacts/classify.js +2 -27
- package/dist/artifacts/classify.js.map +1 -1
- package/dist/artifacts/claude-md-import.d.ts +0 -39
- package/dist/artifacts/claude-md-import.d.ts.map +1 -1
- package/dist/artifacts/claude-md-import.js +0 -40
- package/dist/artifacts/claude-md-import.js.map +1 -1
- package/dist/artifacts/committed.d.ts +4 -41
- package/dist/artifacts/committed.d.ts.map +1 -1
- package/dist/artifacts/committed.js +4 -41
- package/dist/artifacts/committed.js.map +1 -1
- package/dist/artifacts/delivered-skill-twins.d.ts +2 -39
- package/dist/artifacts/delivered-skill-twins.d.ts.map +1 -1
- package/dist/artifacts/delivered-skill-twins.js +33 -90
- package/dist/artifacts/delivered-skill-twins.js.map +1 -1
- package/dist/artifacts/promote-plan.d.ts.map +1 -1
- package/dist/artifacts/promote-plan.js +2 -24
- package/dist/artifacts/promote-plan.js.map +1 -1
- package/dist/artifacts/relink-mapping.d.ts +1 -4
- package/dist/artifacts/relink-mapping.d.ts.map +1 -1
- package/dist/artifacts/relink-mapping.js +3 -10
- package/dist/artifacts/relink-mapping.js.map +1 -1
- package/dist/artifacts/repo-config.d.ts +0 -13
- package/dist/artifacts/repo-config.d.ts.map +1 -1
- package/dist/artifacts/repo-config.js +0 -43
- package/dist/artifacts/repo-config.js.map +1 -1
- package/dist/artifacts/sidecar.d.ts +8 -21
- package/dist/artifacts/sidecar.d.ts.map +1 -1
- package/dist/artifacts/sidecar.js +35 -24
- package/dist/artifacts/sidecar.js.map +1 -1
- package/dist/artifacts/sync-acquisition.d.ts.map +1 -1
- package/dist/artifacts/sync-acquisition.js +2 -0
- package/dist/artifacts/sync-acquisition.js.map +1 -1
- package/dist/artifacts/sync-artifacts.d.ts +9 -199
- package/dist/artifacts/sync-artifacts.d.ts.map +1 -1
- package/dist/artifacts/sync-artifacts.js +19 -239
- package/dist/artifacts/sync-artifacts.js.map +1 -1
- package/dist/artifacts/sync-execution.d.ts +1 -21
- package/dist/artifacts/sync-execution.d.ts.map +1 -1
- package/dist/artifacts/sync-execution.js +10 -130
- package/dist/artifacts/sync-execution.js.map +1 -1
- package/dist/artifacts/sync-plan.d.ts +6 -184
- package/dist/artifacts/sync-plan.d.ts.map +1 -1
- package/dist/artifacts/sync-plan.js +17 -351
- package/dist/artifacts/sync-plan.js.map +1 -1
- package/dist/artifacts/sync-preparation.d.ts +29 -0
- package/dist/artifacts/sync-preparation.d.ts.map +1 -0
- package/dist/artifacts/sync-preparation.js +166 -0
- package/dist/artifacts/sync-preparation.js.map +1 -0
- package/dist/artifacts/sync-report.d.ts +1 -5
- package/dist/artifacts/sync-report.d.ts.map +1 -1
- package/dist/artifacts/sync-report.js +9 -144
- package/dist/artifacts/sync-report.js.map +1 -1
- package/dist/artifacts/twin-writer.d.ts +14 -0
- package/dist/artifacts/twin-writer.d.ts.map +1 -0
- package/dist/artifacts/twin-writer.js +31 -0
- package/dist/artifacts/twin-writer.js.map +1 -0
- package/dist/artifacts/working-skill-twins.d.ts +7 -0
- package/dist/artifacts/working-skill-twins.d.ts.map +1 -0
- package/dist/artifacts/working-skill-twins.js +217 -0
- package/dist/artifacts/working-skill-twins.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +1 -11
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/lifecycle.d.ts +2 -20
- package/dist/commands/lifecycle.d.ts.map +1 -1
- package/dist/commands/lifecycle.js +10 -52
- package/dist/commands/lifecycle.js.map +1 -1
- package/dist/commands/link.d.ts +1 -5
- package/dist/commands/link.d.ts.map +1 -1
- package/dist/commands/link.js +74 -58
- package/dist/commands/link.js.map +1 -1
- package/dist/commands/promote.d.ts.map +1 -1
- package/dist/commands/promote.js +55 -1
- package/dist/commands/promote.js.map +1 -1
- package/dist/commands/pull.d.ts.map +1 -1
- package/dist/commands/pull.js +0 -1
- package/dist/commands/pull.js.map +1 -1
- package/dist/commands/unlink.d.ts.map +1 -1
- package/dist/commands/unlink.js +2 -14
- package/dist/commands/unlink.js.map +1 -1
- package/dist/context/materialize.d.ts +2 -0
- package/dist/context/materialize.d.ts.map +1 -1
- package/dist/context/materialize.js +1 -1
- package/dist/context/materialize.js.map +1 -1
- package/dist/guides/adoption-nudge.d.ts.map +1 -1
- package/dist/guides/adoption-nudge.js +0 -10
- package/dist/guides/adoption-nudge.js.map +1 -1
- package/dist/guides/delivered-status.d.ts +1 -3
- package/dist/guides/delivered-status.d.ts.map +1 -1
- package/dist/guides/delivered-status.js +1 -3
- package/dist/guides/delivered-status.js.map +1 -1
- package/dist/guides/import-client.d.ts +1 -1
- package/dist/lifecycle/operations.d.ts +1 -18
- package/dist/lifecycle/operations.d.ts.map +1 -1
- package/dist/lifecycle/operations.js +9 -125
- package/dist/lifecycle/operations.js.map +1 -1
- package/dist/mcp/client.d.ts +2 -0
- package/dist/mcp/client.d.ts.map +1 -1
- package/dist/mcp/client.js +2 -0
- package/dist/mcp/client.js.map +1 -1
- package/dist/mcp/write-items.d.ts +1 -0
- package/dist/mcp/write-items.d.ts.map +1 -1
- package/dist/mcp/write-items.js.map +1 -1
- package/dist/skill-twin-hook.d.ts +4 -21
- package/dist/skill-twin-hook.d.ts.map +1 -1
- package/dist/skill-twin-hook.js +10 -24
- package/dist/skill-twin-hook.js.map +1 -1
- package/package.json +4 -4
- package/dist/artifacts/alias-history.d.ts +0 -68
- package/dist/artifacts/alias-history.d.ts.map +0 -1
- package/dist/artifacts/alias-history.js +0 -125
- package/dist/artifacts/alias-history.js.map +0 -1
- package/dist/artifacts/alias-mirror.d.ts +0 -69
- package/dist/artifacts/alias-mirror.d.ts.map +0 -1
- package/dist/artifacts/alias-mirror.js +0 -261
- package/dist/artifacts/alias-mirror.js.map +0 -1
- package/dist/artifacts/skill-twin-edit.d.ts +0 -109
- package/dist/artifacts/skill-twin-edit.d.ts.map +0 -1
- package/dist/artifacts/skill-twin-edit.js +0 -331
- package/dist/artifacts/skill-twin-edit.js.map +0 -1
- package/dist/artifacts/skill-twins.d.ts +0 -130
- package/dist/artifacts/skill-twins.d.ts.map +0 -1
- package/dist/artifacts/skill-twins.js +0 -381
- package/dist/artifacts/skill-twins.js.map +0 -1
- package/dist/lifecycle/live-sessions.d.ts +0 -90
- package/dist/lifecycle/live-sessions.d.ts.map +0 -1
- package/dist/lifecycle/live-sessions.js +0 -170
- package/dist/lifecycle/live-sessions.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.
|
|
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:
|
|
@@ -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
|
-
*
|
|
34
|
-
*
|
|
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
|
|
1
|
+
{"version":3,"file":"classify.d.ts","sourceRoot":"","sources":["../../src/artifacts/classify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;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,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
|
-
*
|
|
34
|
-
*
|
|
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
|
//# sourceMappingURL=classify.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"classify.js","sourceRoot":"","sources":["../../src/artifacts/classify.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"classify.js","sourceRoot":"","sources":["../../src/artifacts/classify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAK1C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAA;AAEvC,qEAAqE;AACrE,MAAM,iBAAiB,GAAG,EAAE,CAAA;AAmB5B;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,uBAAuB,CAAC,UAAkB;IACxD,OAAO,UAAU,C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AAE,YAAY;gBACnB,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC;aACrB,CAAA;QACH,CAAC;QAED,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACpC,uEAAuE;YACvE,0EAA0E;YAC1E,sEAAsE;YACtE,0EAA0E;YAC1E,IAAI,IAAI,IAAI,oBAAoB;gBAAE,MAAK;YACvC,IAAI,IAAI,CAAC,CAAA;YACT,IAAI,iBAAiB,CAAC,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;gBACvD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAA;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,
|
|
1
|
+
{"version":3,"file":"claude-md-import.d.ts","sourceRoot":"","sources":["../../src/artifacts/claude-md-import.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAOH,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,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,kFAAkF;AAClF,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEpD;AA6BD,6DAA6D;AAC7D,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAQ7D;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;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AK,EAAE;IAC/C,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,OAAO,CAAA;IACpB,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;IAC7C,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC3B,IAAI,CAAC,EAAE,YAAY,CAAA;CACpB,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,mBAAmB,CAAC;IAAC,KAAK,EAAE,aAAa,CAAA;CAAE,CAAC,CAGlE;AA+DD;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,aAAa,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;
|
|
1
|
+
{"version":3,"file":"claude-md-import.js","sourceRoot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KAAoB;IACzD,IAAI,KAAK,KAAK,WAAW,IAAI,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAA;IAC5D,IAAI,KAAK,KAAK,WAAW,EAAE,CAAC;QAC1B,OAAO,oFAAoF,CAAA;IAC7F,CAAC;IACD,OAAO,iGAAiG,CAAA;AAC1G,CAAC"}
|
|
@@ -1,45 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* remote version (`sync-docs.ts:9-13`). None of them is git, so a file an agent
|
|
7
|
-
* half-wrote this turn is indistinguishable from one its author settled and
|
|
8
|
-
* committed. This module adds the missing one and states a single rule for both
|
|
9
|
-
* directions (`sync-committed-bytes-plan.md`):
|
|
10
|
-
*
|
|
11
|
-
* > Mossbear exchanges committed content. It never pushes what git has not
|
|
12
|
-
* > recorded, and never overwrites what git has not recorded.
|
|
13
|
-
*
|
|
14
|
-
* **`HEAD` is the meaning of "committed" here**, deliberately and for now. The
|
|
15
|
-
* merge-base with the default branch is closer to "accepted", but it needs
|
|
16
|
-
* default-branch discovery, which `push-only-accepted-edits-plan.md` → Option B
|
|
17
|
-
* already rejected as silently degrading inside a container. `HEAD` is cheap,
|
|
18
|
-
* local, and always answerable.
|
|
19
|
-
*
|
|
20
|
-
* **One spawn per sync, not one per mapped file.** `git cat-file --batch` reads
|
|
21
|
-
* a request per line and answers each in order, so every mapped path is resolved
|
|
22
|
-
* by a single process. That matters because the Stop hook runs `mossbear refresh`
|
|
23
|
-
* after every assistant turn (`init.ts:259`), and because the same call returns
|
|
24
|
-
* the committed *bytes* the push side needs — the predicate and the payload come
|
|
25
|
-
* from one place rather than two that can disagree.
|
|
26
|
-
*
|
|
27
|
-
* **It compares content, never the index.** `git diff-index HEAD` would have
|
|
28
|
-
* been the obvious probe and is the wrong one: it reports a stat-dirty entry as
|
|
29
|
-
* modified without reading it, so a file touched but not changed would be
|
|
30
|
-
* suppressed and reported as an uncommitted edit the user cannot find. Reading
|
|
31
|
-
* the blob and comparing bytes has no such failure mode, and it is the same read
|
|
32
|
-
* the push side needs anyway.
|
|
33
|
-
*
|
|
34
|
-
* **Never the reason a sync fails.** Every failure — no work tree, git missing,
|
|
35
|
-
* a non-zero exit, a timeout, output this parser does not recognize — resolves
|
|
36
|
-
* to `null`, which callers read as "git has nothing to say" and fall back to
|
|
37
|
-
* today's behaviour. `relink.ts` sets that precedent (`readGitChangeReport`
|
|
38
|
-
* returns `null` rather than throwing, `relink.ts:126-129`); this module keeps
|
|
39
|
-
* it, and adds a bound on the work: a fixed timeout, a capped buffer, and a
|
|
40
|
-
* request list no longer than the mapped paths themselves.
|
|
41
|
-
*
|
|
42
|
-
* Kept free of citty/console so it unit-tests against a fake spawn.
|
|
2
|
+
* Read git's recorded bytes and tracked paths for delivery safeguards.
|
|
3
|
+
* `createCommittedProbe` recognizes in-progress edits so delivery can preserve
|
|
4
|
+
* them; `readTrackedPaths` supplies the write gate. Automatic artifact delivery
|
|
5
|
+
* never uploads a local copy.
|
|
43
6
|
*/
|
|
44
7
|
/**
|
|
45
8
|
* What git recorded for one path, relative to `HEAD`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"committed.d.ts","sourceRoot":"","sources":["../../src/artifacts/committed.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"committed.d.ts","sourceRoot":"","sources":["../../src/artifacts/committed.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;;;;;;GAQG;AACH,MAAM,MAAM,cAAc;AACxB;;;;;;GAMG;AACD;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE;AACrD,mEAAmE;GACjE;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE;AACpC,kFAAkF;GAChF;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,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CAAA;IAChF,kEAAkE;IAClE,SAAS,EAAE,MAAM,OAAO,CAAA;CACzB,CAAA;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,QAAQ,GAAE,eAAiC,GAC1C,cAAc,CAiChB"}
|
|
@@ -1,45 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* remote version (`sync-docs.ts:9-13`). None of them is git, so a file an agent
|
|
7
|
-
* half-wrote this turn is indistinguishable from one its author settled and
|
|
8
|
-
* committed. This module adds the missing one and states a single rule for both
|
|
9
|
-
* directions (`sync-committed-bytes-plan.md`):
|
|
10
|
-
*
|
|
11
|
-
* > Mossbear exchanges committed content. It never pushes what git has not
|
|
12
|
-
* > recorded, and never overwrites what git has not recorded.
|
|
13
|
-
*
|
|
14
|
-
* **`HEAD` is the meaning of "committed" here**, deliberately and for now. The
|
|
15
|
-
* merge-base with the default branch is closer to "accepted", but it needs
|
|
16
|
-
* default-branch discovery, which `push-only-accepted-edits-plan.md` → Option B
|
|
17
|
-
* already rejected as silently degrading inside a container. `HEAD` is cheap,
|
|
18
|
-
* local, and always answerable.
|
|
19
|
-
*
|
|
20
|
-
* **One spawn per sync, not one per mapped file.** `git cat-file --batch` reads
|
|
21
|
-
* a request per line and answers each in order, so every mapped path is resolved
|
|
22
|
-
* by a single process. That matters because the Stop hook runs `mossbear refresh`
|
|
23
|
-
* after every assistant turn (`init.ts:259`), and because the same call returns
|
|
24
|
-
* the committed *bytes* the push side needs — the predicate and the payload come
|
|
25
|
-
* from one place rather than two that can disagree.
|
|
26
|
-
*
|
|
27
|
-
* **It compares content, never the index.** `git diff-index HEAD` would have
|
|
28
|
-
* been the obvious probe and is the wrong one: it reports a stat-dirty entry as
|
|
29
|
-
* modified without reading it, so a file touched but not changed would be
|
|
30
|
-
* suppressed and reported as an uncommitted edit the user cannot find. Reading
|
|
31
|
-
* the blob and comparing bytes has no such failure mode, and it is the same read
|
|
32
|
-
* the push side needs anyway.
|
|
33
|
-
*
|
|
34
|
-
* **Never the reason a sync fails.** Every failure — no work tree, git missing,
|
|
35
|
-
* a non-zero exit, a timeout, output this parser does not recognize — resolves
|
|
36
|
-
* to `null`, which callers read as "git has nothing to say" and fall back to
|
|
37
|
-
* today's behaviour. `relink.ts` sets that precedent (`readGitChangeReport`
|
|
38
|
-
* returns `null` rather than throwing, `relink.ts:126-129`); this module keeps
|
|
39
|
-
* it, and adds a bound on the work: a fixed timeout, a capped buffer, and a
|
|
40
|
-
* request list no longer than the mapped paths themselves.
|
|
41
|
-
*
|
|
42
|
-
* Kept free of citty/console so it unit-tests against a fake spawn.
|
|
2
|
+
* Read git's recorded bytes and tracked paths for delivery safeguards.
|
|
3
|
+
* `createCommittedProbe` recognizes in-progress edits so delivery can preserve
|
|
4
|
+
* them; `readTrackedPaths` supplies the write gate. Automatic artifact delivery
|
|
5
|
+
* never uploads a local copy.
|
|
43
6
|
*/
|
|
44
7
|
import { spawnSync } from 'node:child_process';
|
|
45
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"committed.js","sourceRoot":"","sources":["../../src/artifacts/committed.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"committed.js","sourceRoot":"","sources":["../../src/artifacts/committed.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AA+B9C;;;;;;;GAOG;AACH,SAAS,SAAS,CAAC,IAAY;IAC7B,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;AACxE,CAAC;AAED,SAAS,eAAe,CAAC,IAAuB,EAAE,GAAW,EAAE,KAAa;IAC1E,MAAM,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W;gBAAE,OAAO,SAAS,CAAA;YACjC,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,OAAO,GAAG,IAAI,CAAA;gBACd,KAAK,CAAC,IAAI,CAAC,CAAA;gBACX,IAAI,WAAW;oBAAE,OAAO,SAAS,CAAA;YACnC,CAAC;YACD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBACrB,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;gBACb,IAAI,WAAW;oBAAE,OAAO,SAAS,CAAA;YACnC,CAAC;YACD,OAAO,cAAc,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;QAC7C,CAAC;QACD,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,WAAW;KAC9B,CAAA;AACH,CAAC"}
|
|
@@ -1,40 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* **A published skill lands in every skills folder this checkout's harnesses
|
|
3
|
-
* read.**
|
|
4
|
-
*
|
|
5
|
-
* A published bundle (Mossbear's guides is the first) files each skill once, at
|
|
6
|
-
* its `.claude/skills/<name>/SKILL.md` path. Delivery writes an item at its own
|
|
7
|
-
* path and nowhere else, so a checkout wired only for Codex, Antigravity or
|
|
8
|
-
* OpenCode, which read `.agents/skills/`, would receive a skill none of its
|
|
9
|
-
* harnesses reads. This step writes the other folder's copy, the *twin*, for
|
|
10
|
-
* exactly those folders a wired harness reads (`bundledSkillFoldersFor`).
|
|
11
|
-
*
|
|
12
|
-
* **Why this may create a file when the alias mirror may not.** The mirror and
|
|
13
|
-
* `mossbear link --copy-skills` leave creation to a person, because a skill the
|
|
14
|
-
* reader authored is theirs to place. A subscribed skill was placed by the
|
|
15
|
-
* subscription: the reader chose to receive it, and receiving it in a folder no
|
|
16
|
-
* harness of theirs reads is not receiving it. So the creation is scoped to a
|
|
17
|
-
* guide from a **published** bundle, at a skill-folder `SKILL.md`, into a folder
|
|
18
|
-
* a wired harness reads, and to nothing else. A checkout with no detectable
|
|
19
|
-
* wiring gets only the item's own path, as before.
|
|
20
|
-
*
|
|
21
|
-
* **A skill's reference files travel with it.** The files a published skill
|
|
22
|
-
* delivers beside its `SKILL.md` (`isDeliverableSkillMember`: `references/` and
|
|
23
|
-
* `assets/`) are twinned by the same rules, file by file, and only into a twin
|
|
24
|
-
* folder whose `SKILL.md` is this delivery's. A `SKILL.md` alone used to be the
|
|
25
|
-
* whole twin, so a harness reading the other folder got a skill naming files
|
|
26
|
-
* that were not there.
|
|
27
|
-
*
|
|
28
|
-
* **The record is the placement's hash.** A twin is this delivery's when its
|
|
29
|
-
* bytes are the primary's bytes now, or the bytes the primary was last
|
|
30
|
-
* delivered at (its placement hash before this pass). Only such a twin is kept
|
|
31
|
-
* in step through the delivery writer and its tracked-path gate, and only such a twin is
|
|
32
|
-
* removed when the primary is retired. A twin path holding anything else is the
|
|
33
|
-
* reader's file: it is named and left alone, never overwritten.
|
|
34
|
-
*/
|
|
35
1
|
import { type SkillFolder } from '../skill-folders.js';
|
|
36
2
|
import { type TrackedPaths } from './tracked-paths.js';
|
|
37
|
-
import type { AliasMirrorGuide } from './alias-mirror.js';
|
|
38
3
|
/** The folder and skill name of a repo-relative skill-folder `SKILL.md` path, or null. */
|
|
39
4
|
export declare function parseSkillFolderPath(path: string): {
|
|
40
5
|
folder: SkillFolder;
|
|
@@ -65,7 +30,7 @@ export type DeliveredSkill = {
|
|
|
65
30
|
export type DeliveredSkillTwinOutcome =
|
|
66
31
|
/** The twin folder did not exist and was written. */
|
|
67
32
|
'created'
|
|
68
|
-
/** The twin holds this delivery's bytes; the
|
|
33
|
+
/** The twin holds this delivery's bytes; the delivery writer keeps it in step. */
|
|
69
34
|
| 'kept-in-step'
|
|
70
35
|
/** The twin path holds a file this delivery did not write; left alone. */
|
|
71
36
|
| 'diverged' | 'unsafe-path' | 'failed';
|
|
@@ -90,8 +55,7 @@ export type SkillTwinWriteDeps = {
|
|
|
90
55
|
};
|
|
91
56
|
/**
|
|
92
57
|
* Write the missing twins of the skills delivered this pass, into `wanted`
|
|
93
|
-
* folders only. Returns the outcome per twin considered,
|
|
94
|
-
* mirror should keep together. Never throws.
|
|
58
|
+
* folders only. Returns the outcome per twin considered, . Never throws.
|
|
95
59
|
*/
|
|
96
60
|
export declare function deliverSkillTwins(input: {
|
|
97
61
|
root: string;
|
|
@@ -108,7 +72,6 @@ export declare function deliverSkillTwins(input: {
|
|
|
108
72
|
deps?: SkillTwinWriteDeps;
|
|
109
73
|
}): Promise<{
|
|
110
74
|
results: DeliveredSkillTwinResult[];
|
|
111
|
-
mirrorSets: AliasMirrorGuide[];
|
|
112
75
|
}>;
|
|
113
76
|
/**
|
|
114
77
|
* Remove the twins of primaries this pass retired and removed, when a twin still
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delivered-skill-twins.d.ts","sourceRoot":"","sources":["../../src/artifacts/delivered-skill-twins.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"delivered-skill-twins.d.ts","sourceRoot":"","sources":["../../src/artifacts/delivered-skill-twins.ts"],"names":[],"mappings":"AAaA,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAGrE,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAK1E,0FAA0F;AAC1F,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,GACX;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAI9C;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,GACX;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAQ5D;AAID;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAS5E;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