@skillstate/claude 2.0.5 → 2.0.7

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 CHANGED
@@ -2,11 +2,10 @@
2
2
 
3
3
  # @skillstate/claude
4
4
 
5
- **Claude Code platform adapter for the @skillstate/core runtime — state injection and persistence via hook scripts.**
5
+ **Claude Code platform adapter for the @skillstate/core runtime — state injection and patch persistence via hook scripts (2.1.260 hooks contract).**
6
6
 
7
7
  [![npm version](https://img.shields.io/npm/v/@skillstate/claude)](https://www.npmjs.com/package/@skillstate/claude)
8
8
  [![node](https://img.shields.io/node/v/@skillstate/claude)](https://www.npmjs.com/package/@skillstate/claude)
9
- [![Tests](https://img.shields.io/badge/tests-873%20passing-brightgreen)](https://github.com/vitalykuzyaev/skillstate)
10
9
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue)](https://github.com/vitalykuzyaev/skillstate/blob/main/LICENSE)
11
10
 
12
11
  </div>
@@ -15,16 +14,40 @@
15
14
 
16
15
  `@skillstate/claude` bridges the paper-exact core ([`@skillstate/core`](../core))
17
16
  into **Claude Code** sessions. It emits self-contained CommonJS hook scripts
18
- (run via `node script.cjs`) that inject the persisted skill state into tool
19
- context and extract a validated `state_patch` from the model's response.
17
+ (run via `node script.cjs`) that inject the persisted skill state into every
18
+ turn, re-inject it after compaction, and merge a validated `state_patch` from
19
+ Bash tool responses back into the state file.
20
20
 
21
21
  > **@non-paper** — no adapters exist in arXiv 2608.26263v3. This adapter is an
22
22
  > additive integration, not part of the paper.
23
23
 
24
+ ## The honest architecture (Claude Code 2.1.260)
25
+
26
+ **History trimming from hooks is impossible.** The compaction-time hook cannot
27
+ inject context (its only decision is `decision: "block"` — forbid compaction),
28
+ and the post-compaction hook has no decision control at all (its
29
+ `systemMessage` is discarded). So this adapter implements the state-injection
30
+ model, not a trim model:
31
+
32
+ | Event | Matcher | What the script does |
33
+ | --- | --- | --- |
34
+ | `UserPromptSubmit` | — (no matcher support) | Injects `Current skill state (JSON): {...}` as `additionalContext` — the model gets the authoritative state at every turn. |
35
+ | `SessionStart` | `^compact$` | Re-injects the state right after auto/manual compaction — state SURVIVES compaction even though history was compressed. |
36
+ | `PostToolUse` | `^Bash$` | Extracts a fenced ```json `state_patch` from the tool response (or a raw JSON / object `tool_response.state_patch`), applies the paper's ⊕ null-deletion merge, and writes `{ version: 1, state }`. stdout is `{}` or a `systemMessage` when the patch is invalid. |
37
+
38
+ Reading and writing the full state is available at any time through the
39
+ skillstate MCP server (`state.get` / `state.patch` — schema-validated) that
40
+ `skillstate init` registers in the project's `.mcp.json`.
41
+
42
+ Prompts stay O(T) with a fresh state at every turn. **True O(1) requires
43
+ host-side trimming, which Claude Code does not expose.**
44
+
24
45
  ## Installation
25
46
 
26
47
  ```bash
27
48
  npm i @skillstate/core @skillstate/claude
49
+ # or wire everything into a live host at once:
50
+ skillstate init # writes scripts, merges ~/.claude/settings.json, adds .mcp.json + SKILL.md
28
51
  ```
29
52
 
30
53
  Requires Node.js >= 20. TypeScript types are bundled.
@@ -37,66 +60,75 @@ import { INTERCODE_CTF_SPEC } from '@skillstate/core/schemas';
37
60
 
38
61
  const adapter = new ClaudeAdapter();
39
62
 
40
- // System-prompt boilerplate that turns any Claude Code session into
41
- // state-based execution mode:
42
- const modePrompt = adapter.generateAppendPrompt();
43
-
44
- // PreToolUse: injects the persisted state into the tool call's additionalContext.
45
- const pre = adapter.generateHookScript('PreToolUse', './.skillstate.json');
46
-
47
- // PostToolUse: extracts state_patch from the response, validates it against the
48
- // embedded schema, applies the null-deletion ⊕ merge, and saves the state file.
49
- const post = adapter.generateHookScript(
50
- 'PostToolUse',
51
- './.skillstate.json',
52
- INTERCODE_CTF_SPEC.schema,
53
- );
54
-
55
- // PreCompact + SessionStart(compact): the best available O(1)-friendly pair.
56
- const hooks = adapter.generateAllHooksScripts('./.skillstate.json', INTERCODE_CTF_SPEC.schema);
57
- // hooks.preCompact -> injects state + diff into compaction summary
58
- // hooks.sessionStartCompact -> re-injects state after compaction
59
-
60
- // Persist a hook script to disk (atomic tmp + fsync + rename), returns path:
61
- const saved = await adapter.saveHookScript(
62
- './hooks/post-tool-use.cjs',
63
- 'PostToolUse',
64
- './.skillstate.json',
65
- INTERCODE_CTF_SPEC.schema,
66
- );
63
+ // Self-contained hook scripts (Node builtins only). Each resolves the
64
+ // per-project state from input.cwd at runtime — one global script dir
65
+ // serves every project:
66
+ const inject = adapter.generateHookScript('user-prompt-submit');
67
+ const survive = adapter.generateHookScript('session-start-compact');
68
+ const persist = adapter.generateHookScript('post-tool-use');
69
+
70
+ // The hooks section for ~/.claude/settings.json (2.1.260 schema:
71
+ // { hooks: { Event: [ { matcher?, hooks: [ { type: "command", command, timeout } ] } ] } }):
72
+ const hooksJson = adapter.generateHooksConfig('./.skillstate/skillstate.json', {
73
+ scriptDir: '/home/me/.claude/hooks/skillstate',
74
+ });
75
+
76
+ // Merge into a live settings.json — preserves env/permissions/model and
77
+ // every foreign hook; byte-identical (no-op) when already wired:
78
+ const merged = adapter.mergeHooksConfig(existingSettingsText, {
79
+ scriptDir: '/home/me/.claude/hooks/skillstate',
80
+ });
81
+
82
+ // Uninstall surgery: remove exactly the skillstate groups/handlers from a
83
+ // live settings.json (mixed groups keep their foreign handlers):
84
+ const { text, changed } = removeSkillstateHookGroups(liveSettingsText);
85
+
86
+ // Atomic persistence helpers (tmp + fsync + rename):
87
+ await adapter.saveHookScript('post-tool-use', '/h/skillstate/post-tool-use.cjs');
88
+ await adapter.saveSkillMd('/home/me/.claude/skills/skillstate/SKILL.md', spec);
67
89
  ```
68
90
 
69
91
  ## API / Exports
70
92
 
71
- Root path `@skillstate/claude` exports one thing: `ClaudeAdapter`.
72
-
73
- - `new ClaudeAdapter()` — implements `PlatformAdapter` (`name = 'claude'`).
74
- - `generateHookScript(eventType, statePath, schema?): string` — where
75
- `eventType` is `'PreToolUse' | 'PostToolUse'`. Accepts a raw path or a
76
- `{ root, name }` ref confined by `resolveStatePath` (`..` escapes throw).
77
- - `generateCompactHookScript(statePath, schema?): string` — PreCompact script
78
- injecting the current state + a diff since the last compact snapshot.
79
- - `generateSessionStartHookScript(statePath): string` — SessionStart hook with
80
- a `source: "compact"` matcher.
81
- - `generateAllHooksScripts(statePath, schema?): { preCompact; sessionStartCompact }`.
93
+ Root path `@skillstate/claude` exports:
94
+
95
+ - `new ClaudeAdapter()` — implements `PlatformAdapter` (`name = 'claude'`):
96
+ `injectState`, `extractPatch`, `extractAction`, `formatPrompt`.
97
+ - `generateHookScript(event, statePath?): string` — `event` is
98
+ `'user-prompt-submit' | 'session-start-compact' | 'post-tool-use'`.
99
+ Accepts a raw path or a `{ root, name }` ref confined by
100
+ `resolveStatePath` (`..` escapes throw). The path only documents the
101
+ header — the script resolves the state from the session cwd.
102
+ - `generateHooksConfig(statePath?, options?): string` — JSON with ONLY the
103
+ `hooks` section. Options: `scriptDir`, `command`, `timeoutSeconds`
104
+ (default 30).
105
+ - `mergeHooksConfig(existingJson, options?): string` — idempotent merge into
106
+ a live settings.json; preserves every other key.
107
+ - `removeSkillstateHookGroups(existingJson): { text, changed }` — surgical
108
+ uninstall (pure groups dropped, mixed groups trimmed, empty events
109
+ removed).
110
+ - `claudeHookScriptPath(scriptDir, event): string`.
111
+ - `generateSkillMd(spec, statePath?): string` + `saveSkillMd`,
112
+ `saveHookScript(event, target, statePath?)`, `saveHooksConfig(target,
113
+ statePath?, options?)` — atomic writes.
82
114
  - `generateAppendPrompt(): string` — mode-switch prompt boilerplate.
83
- - `injectState(state, spec): string` / `formatPrompt(state, observation, spec): string`.
84
- - `extractPatch(response): StatePatch | null` / `extractAction(response): string | null`.
85
- - `saveHookScript(target, eventType, statePath, schema?): Promise<string>` —
86
- generates a hook script and persists it atomically; returns the destination.
115
+ - `CLAUDE_HOOK_EVENTS`, `CLAUDE_SESSION_START_MATCHER` (`^compact$`),
116
+ `CLAUDE_POST_TOOL_USE_MATCHER` (`^Bash$`), `CLAUDE_HOOK_TIMEOUT_SECONDS`.
117
+ - `resolveStateForCwd(cwd, home?)` — re-export of the core
118
+ `resolveHostStateForCwd` (single source of truth for the per-project
119
+ resolver).
87
120
 
88
121
  ## Notes
89
122
 
90
- - **Honest limitation.** Claude Code hooks are **append-only** — history cannot
91
- be trimmed from hooks, so true O(1) is not possible. The hooks inject state
92
- into the compaction summary (PreCompact) and re-inject it after compaction
93
- (SessionStart), but the conversation history keeps growing until the host
94
- trims it.
95
- - The generated scripts are self-contained CommonJS and embed the schema, so
96
- unknown keys / wrong types are rejected and **malformed outputs are never
97
- persisted** — state corruption by a bad patch is impossible.
98
- - Depends on [`@skillstate/core`](../core) for the ⊕ merge semantics
99
- (`mergeState`), `PromptTransformer`, `atomicWriteFile`, and `resolveStatePath`.
123
+ - **Honest limitation.** Claude Code hooks cannot trim history and cannot
124
+ inject context at compaction time, so prompts are O(T) with fresh state
125
+ per turn. The injected state is authoritative — history is not.
126
+ - The generated scripts are self-contained CommonJS. Malformed patches are
127
+ never persisted — the ⊕ merge either fully applies or the hook reports a
128
+ `systemMessage` and leaves the state file untouched.
129
+ - Depends on [`@skillstate/core`](../core) for `PromptTransformer`,
130
+ `atomicWriteFile`, `resolveStatePath`, and the shared
131
+ `resolveHostStateForCwd`.
100
132
 
101
133
  ## Related
102
134
 
@@ -1,17 +1,37 @@
1
- /**
2
- * @non-paper adapter — no adapters exist in arXiv 2608.26263v3.
3
- *
4
- * This file bridges the paper-exact core (Algorithm 1 prompt, ⊕ merge,
5
- * §7 rollback-retry rejection) into Claude Code sessions via hook scripts
6
- * and prompt boilerplate.
7
- *
8
- * LIMITATION: Claude Code hooks are append-only — history cannot be trimmed
9
- * from hooks. The best strategy is: PreCompact injects state into the
10
- * compaction summary, SessionStart(source:compact) re-injects state after
11
- * compaction. True O(1) is not possible without host-side trimming.
12
- */
13
1
  import type { SkillState, StatePatch, ProceduralSpec, Observation, PlatformAdapter } from '@skillstate/core';
14
2
  import type { StatePathRef } from '@skillstate/core';
3
+ export { resolveHostStateForCwd as resolveStateForCwd } from '@skillstate/core';
4
+ /** Claude Code hook events this adapter generates scripts for (script/CLI names). */
5
+ export type ClaudeHookEvent = 'user-prompt-submit' | 'session-start-compact' | 'post-tool-use';
6
+ /** All {@link ClaudeHookEvent} values in generation order. */
7
+ export declare const CLAUDE_HOOK_EVENTS: readonly ["user-prompt-submit", "session-start-compact", "post-tool-use"];
8
+ /** SessionStart matcher that fires after Claude Code compacts the conversation. */
9
+ export declare const CLAUDE_SESSION_START_MATCHER = "^compact$";
10
+ /** PostToolUse matcher restricted to Bash tool results. */
11
+ export declare const CLAUDE_POST_TOOL_USE_MATCHER = "^Bash$";
12
+ /**
13
+ * Hook `timeout` in seconds written into every generated hook entry — the
14
+ * UserPromptSubmit default, spelled out so the budget is explicit.
15
+ */
16
+ export declare const CLAUDE_HOOK_TIMEOUT_SECONDS = 30;
17
+ /** Options for {@link ClaudeAdapter.generateHooksConfig} / merge. */
18
+ export interface ClaudeHooksConfigOptions {
19
+ /**
20
+ * Directory holding the generated `.cjs` hook scripts. Defaults to the
21
+ * state file's directory when a `statePath` is given, else a
22
+ * `<stateDir>/hooks` placeholder; the CLI install passes
23
+ * `~/.claude/hooks/skillstate`.
24
+ */
25
+ scriptDir?: string;
26
+ /** Full command override for every event (defaults to `node <script> <event>`). */
27
+ command?: string;
28
+ /** Hook `timeout` in seconds (default {@link CLAUDE_HOOK_TIMEOUT_SECONDS}). */
29
+ timeoutSeconds?: number;
30
+ }
31
+ /**
32
+ * Claude Code platform adapter (@non-paper; see module doc for the 2.1.260
33
+ * hooks contract and the honest O(T) limitation).
34
+ */
15
35
  export declare class ClaudeAdapter implements PlatformAdapter {
16
36
  readonly name = "claude";
17
37
  private transformer;
@@ -19,59 +39,120 @@ export declare class ClaudeAdapter implements PlatformAdapter {
19
39
  extractPatch(response: string): StatePatch | null;
20
40
  extractAction(response: string): string | null;
21
41
  /**
22
- * @non-paper — adapter convenience (delegates to the transformer).
42
+ * @non-paper adapter convenience (delegates to the transformer).
23
43
  * Paper-exact callers use `PromptTransformer.formatPaper` (Appendix A.4).
24
44
  */
25
45
  formatPrompt(state: SkillState, observation: Observation, spec: ProceduralSpec): string;
26
- generateHookScript(eventType: 'PreToolUse' | 'PostToolUse', statePath: string, schema?: ProceduralSpec['schema']): string;
27
46
  /**
28
- * @non-paper additive overload: accept a `{ root, name }` ref confined
29
- * via `resolveStatePath` — `..` escapes throw instead of embedding an
30
- * unsafe path into the generated script. The string overload above is
31
- * byte-identical to the pre-wave-2 codegen.
47
+ * Canonical absolute path of the hook script for `event` inside
48
+ * `scriptDir` (e.g. `~/.claude/hooks/skillstate/user-prompt-submit.cjs`).
49
+ * {@link generateHooksConfig} and {@link saveHookScript} share this
50
+ * convention so the settings.json commands and the on-disk scripts agree.
32
51
  */
33
- generateHookScript(eventType: 'PreToolUse' | 'PostToolUse', stateRef: StatePathRef, schema?: ProceduralSpec['schema']): string;
52
+ claudeHookScriptPath(scriptDir: string, event: ClaudeHookEvent): string;
34
53
  /**
35
- * @non-paper additive helper: generate a hook script and persist it via
36
- * `atomicWriteFile` (tmp + fsync + rename). Both the destination and the
37
- * embedded state path accept raw strings or
38
- * `{ root, name }` refs confined by `resolveStatePath`. Returns the
39
- * absolute destination path.
54
+ * Generate the hooks section for `~/.claude/settings.json` (2.1.260
55
+ * schema: `{ hooks: { Event: [ { matcher?, hooks: [ { type: "command",
56
+ * command, timeout } ] } ] } }`). The document carries ONLY the
57
+ * `hooks` key — {@link mergeHooksConfig} is what splices these groups
58
+ * into a live settings.json while preserving every other key:
59
+ *
60
+ * - `UserPromptSubmit` → inject the current state as additionalContext;
61
+ * - `SessionStart` (matcher `^compact$`) → re-inject after compaction;
62
+ * - `PostToolUse` (matcher `^Bash$`) → persist `state_patch` blocks from
63
+ * Bash tool outputs.
64
+ *
65
+ * Commands are absolute `node <script> <event>` lines pointing at the
66
+ * generated `.cjs` scripts in `options.scriptDir` (default: the state
67
+ * file's directory, else a `<stateDir>/hooks` placeholder). No matcher
68
+ * on UserPromptSubmit — the event has no matcher support and fires on
69
+ * every prompt.
40
70
  */
41
- saveHookScript(target: string | StatePathRef, eventType: 'PreToolUse' | 'PostToolUse', statePath: string | StatePathRef, schema?: ProceduralSpec['schema']): Promise<string>;
71
+ generateHooksConfig(statePath?: string | StatePathRef, options?: ClaudeHooksConfigOptions): string;
42
72
  /**
43
- * Generate a PreCompact hook script that injects the current skill state
44
- * into the compaction summary. Also tracks what changed since the last
45
- * compact to provide a diff in additionalContext.
73
+ * Generate a self-contained CommonJS hook script for a Claude Code
74
+ * lifecycle event. The script reads ONE hook JSON document from stdin,
75
+ * resolves the state file from `input.cwd` (the session cwd) via the
76
+ * {@link resolveStateForCwd} semantics, and:
77
+ *
78
+ * - `user-prompt-submit`: emits
79
+ * `{ hookSpecificOutput: { hookEventName: "UserPromptSubmit",
80
+ * additionalContext } }` carrying the current state JSON;
81
+ * - `session-start-compact`: the same injection with
82
+ * `hookEventName: "SessionStart"` (state survives compaction; wire
83
+ * with the `^compact$` matcher);
84
+ * - `post-tool-use`: extracts a `state_patch` from the tool_response
85
+ * (fenced ```json block or raw JSON), applies the ⊕ null-deletion merge
86
+ * and writes the state file; stdout is `{}` or a `systemMessage` when
87
+ * the patch is invalid.
46
88
  *
47
- * The script reads `.skillstate.json`, reads the previous compact snapshot
48
- * from `.skillstate.last-compact.json` (if it exists), computes a diff,
49
- * and injects the current state + diff into additionalContext. After
50
- * injection it saves the current state as the new compact snapshot.
89
+ * `statePath` is accepted for `{ root, name }` confinement (traversal
90
+ * refs throw) and documented in the script header; the content itself is
91
+ * cwd-resolving and never bakes an absolute state path in.
92
+ */
93
+ generateHookScript(event: ClaudeHookEvent, statePath?: string | StatePathRef): string;
94
+ /**
95
+ * Generate a SKILL.md for Claude Code's skill directory
96
+ * (`~/.claude/skills/<name>/SKILL.md`). The body instructs the agent to
97
+ * treat the hook-injected state as authoritative (history is not
98
+ * reliable), to read state via the skillstate MCP tool `state.get`, and
99
+ * to persist via `state.patch` — the PostToolUse hook also merges any
100
+ * fenced ```json `state_patch` block printed by a Bash tool call.
51
101
  */
52
- generateCompactHookScript(statePath: string, schema?: ProceduralSpec['schema']): string;
53
- generateCompactHookScript(stateRef: StatePathRef, schema?: ProceduralSpec['schema']): string;
102
+ generateSkillMd(spec: ProceduralSpec, statePath?: string): string;
54
103
  /**
55
- * Generate a SessionStart hook script that re-injects state after
56
- * compaction. The hook uses a matcher for `source: "compact"` so it
57
- * only fires when the session was resumed from a compacted state.
104
+ * Merge the skillstate hook groups into an existing `settings.json`
105
+ * text. Preserves every other top-level key (env, permissions, model,
106
+ * …) and every existing (non-skillstate) hook. Idempotent: if any
107
+ * skillstate command is already wired, the ORIGINAL text is returned
108
+ * byte-unchanged. Malformed/empty input starts from a fresh hooks-only
109
+ * document (the CLI guards a live settings.json before calling).
58
110
  */
59
- generateSessionStartHookScript(statePath: string): string;
60
- generateSessionStartHookScript(stateRef: StatePathRef): string;
111
+ mergeHooksConfig(existingJson: string, options?: ClaudeHooksConfigOptions): string;
61
112
  /**
62
- * Convenience: generate both compact-related hooks at once.
63
- * Returns `{ preCompact, sessionStartCompact }` — write each to a
64
- * `.cjs` file and register in Claude Code settings.
113
+ * Generate a hook script and persist it via `atomicWriteFile`. `target`
114
+ * is the script destination (usually
115
+ * {@link ClaudeAdapter.claudeHookScriptPath}); `statePath` is forwarded
116
+ * to {@link generateHookScript}. Returns the absolute destination path.
65
117
  */
66
- generateAllHooksScripts(statePath: string, schema?: ProceduralSpec['schema']): {
67
- preCompact: string;
68
- sessionStartCompact: string;
69
- };
70
- generateAllHooksScripts(stateRef: StatePathRef, schema?: ProceduralSpec['schema']): {
71
- preCompact: string;
72
- sessionStartCompact: string;
73
- };
118
+ saveHookScript(event: ClaudeHookEvent, target: string | StatePathRef, statePath?: string | StatePathRef): Promise<string>;
119
+ /**
120
+ * Generate the hooks config document and persist it via
121
+ * `atomicWriteFile`. Both the destination and the embedded state path
122
+ * accept raw strings or `{ root, name }` refs confined by
123
+ * `resolveStatePath`. Returns the absolute destination path.
124
+ */
125
+ saveHooksConfig(target: string | StatePathRef, statePath?: string | StatePathRef, options?: ClaudeHooksConfigOptions): Promise<string>;
126
+ /**
127
+ * Generate a SKILL.md and persist it via `atomicWriteFile`. Returns the
128
+ * absolute destination path.
129
+ */
130
+ saveSkillMd(target: string | StatePathRef, spec: ProceduralSpec, statePath?: string): Promise<string>;
74
131
  generateAppendPrompt(): string;
132
+ /** Resolve a `string | StatePathRef` via `resolveStatePath` (throws on `..`). */
133
+ private resolve;
134
+ /** PostToolUse script: extract state_patch, ⊕ merge, persist. */
135
+ private buildPostToolUseScript;
75
136
  private describeSchema;
76
137
  }
138
+ /**
139
+ * Surgically remove every skillstate hook handler from an existing
140
+ * `settings.json` text (the uninstall path — restoring a backup would
141
+ * lose live settings, so groups are edited in place):
142
+ *
143
+ * - a handler is skillstate when its command points at a generated
144
+ * `<event>.cjs` script (matched by basename, independent of where the
145
+ * script dir lived);
146
+ * - groups whose handlers are ALL skillstate are dropped; MIXED groups
147
+ * keep their foreign handlers and lose only the skillstate ones;
148
+ * - event arrays left empty are removed from the `hooks` object;
149
+ * - every other top-level key (env, permissions, model, …) survives.
150
+ *
151
+ * Returns the original text untouched (`changed: false`) when it is
152
+ * malformed, has no hooks object, or carries no skillstate handlers.
153
+ */
154
+ export declare function removeSkillstateHookGroups(existingJson: string): {
155
+ text: string;
156
+ changed: boolean;
157
+ };
77
158
  //# sourceMappingURL=claude-adapter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"claude-adapter.d.ts","sourceRoot":"","sources":["../src/claude-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,cAAc,EACd,WAAW,EACX,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAM1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,qBAAa,aAAc,YAAW,eAAe;IACnD,QAAQ,CAAC,IAAI,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