@skillstate/claude 2.2.1 → 3.0.0
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 +30 -14
- package/dist/claude-adapter.d.ts +47 -22
- package/dist/claude-adapter.d.ts.map +1 -1
- package/dist/claude-adapter.js +69 -36
- package/dist/claude-adapter.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -46,10 +46,18 @@ host-side trimming, which Claude Code does not expose.**
|
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
48
|
npm i @skillstate/core @skillstate/claude
|
|
49
|
-
# or wire
|
|
50
|
-
skillstate init # writes scripts, merges
|
|
49
|
+
# or wire every detected host at once, project-locally:
|
|
50
|
+
skillstate init # writes .claude/hooks/skillstate/ scripts, merges the project
|
|
51
|
+
# .claude/settings.json, adds the project .mcp.json entry, and
|
|
52
|
+
# writes the shared .claude/skills/skillstate/SKILL.md
|
|
51
53
|
```
|
|
52
54
|
|
|
55
|
+
All Claude glue is PROJECT-LOCAL and committed: the hook scripts live in
|
|
56
|
+
`<project>/.claude/hooks/skillstate/`, the hook groups in the project
|
|
57
|
+
`.claude/settings.json` (commands anchored at `$CLAUDE_PROJECT_DIR`), and
|
|
58
|
+
the MCP entry in the project `.mcp.json`. Nothing is written into
|
|
59
|
+
`~/.claude` — a fresh clone works for the whole team.
|
|
60
|
+
|
|
53
61
|
Requires Node.js >= 20. TypeScript types are bundled.
|
|
54
62
|
|
|
55
63
|
## Quick start
|
|
@@ -61,22 +69,24 @@ import { INTERCODE_CTF_SPEC } from '@skillstate/core/schemas';
|
|
|
61
69
|
const adapter = new ClaudeAdapter();
|
|
62
70
|
|
|
63
71
|
// Self-contained hook scripts (Node builtins only). Each resolves the
|
|
64
|
-
// per-project state from input.cwd at runtime
|
|
65
|
-
//
|
|
72
|
+
// per-project state from input.cwd at runtime and is INERT when the
|
|
73
|
+
// project has no skillstate state (hooks never create state files):
|
|
66
74
|
const inject = adapter.generateHookScript('user-prompt-submit');
|
|
67
75
|
const survive = adapter.generateHookScript('session-start-compact');
|
|
68
76
|
const persist = adapter.generateHookScript('post-tool-use');
|
|
69
77
|
|
|
70
|
-
// The hooks section for
|
|
78
|
+
// The hooks section for the PROJECT .claude/settings.json (2.1.260 schema:
|
|
71
79
|
// { hooks: { Event: [ { matcher?, hooks: [ { type: "command", command, timeout } ] } ] } }):
|
|
72
80
|
const hooksJson = adapter.generateHooksConfig('./.skillstate/skillstate.json', {
|
|
73
|
-
scriptDir: '
|
|
81
|
+
scriptDir: '.claude/hooks/skillstate',
|
|
82
|
+
commandFor: (event) => `node "$CLAUDE_PROJECT_DIR/.claude/hooks/skillstate/${event}.cjs" ${event}`,
|
|
74
83
|
});
|
|
75
84
|
|
|
76
85
|
// Merge into a live settings.json — preserves env/permissions/model and
|
|
77
86
|
// every foreign hook; byte-identical (no-op) when already wired:
|
|
78
87
|
const merged = adapter.mergeHooksConfig(existingSettingsText, {
|
|
79
|
-
scriptDir: '
|
|
88
|
+
scriptDir: '.claude/hooks/skillstate',
|
|
89
|
+
commandFor: (event) => `node "$CLAUDE_PROJECT_DIR/.claude/hooks/skillstate/${event}.cjs" ${event}`,
|
|
80
90
|
});
|
|
81
91
|
|
|
82
92
|
// Uninstall surgery: remove exactly the skillstate groups/handlers from a
|
|
@@ -84,8 +94,7 @@ const merged = adapter.mergeHooksConfig(existingSettingsText, {
|
|
|
84
94
|
const { text, changed } = removeSkillstateHookGroups(liveSettingsText);
|
|
85
95
|
|
|
86
96
|
// Atomic persistence helpers (tmp + fsync + rename):
|
|
87
|
-
await adapter.saveHookScript('post-tool-use', '/
|
|
88
|
-
await adapter.saveSkillMd('/home/me/.claude/skills/skillstate/SKILL.md', spec);
|
|
97
|
+
await adapter.saveHookScript('post-tool-use', '.claude/hooks/skillstate/post-tool-use.cjs');
|
|
89
98
|
```
|
|
90
99
|
|
|
91
100
|
## API / Exports
|
|
@@ -100,17 +109,19 @@ Root path `@skillstate/claude` exports:
|
|
|
100
109
|
`resolveStatePath` (`..` escapes throw). The path only documents the
|
|
101
110
|
header — the script resolves the state from the session cwd.
|
|
102
111
|
- `generateHooksConfig(statePath?, options?): string` — JSON with ONLY the
|
|
103
|
-
`hooks` section. Options: `scriptDir`, `command`, `
|
|
104
|
-
|
|
112
|
+
`hooks` section. Options: `scriptDir`, `command`, `commandFor` (per-event
|
|
113
|
+
override — the CLI passes a `$CLAUDE_PROJECT_DIR`-anchored template to
|
|
114
|
+
make the installed hooks PROJECT-LOCAL), `timeoutSeconds` (default 30).
|
|
105
115
|
- `mergeHooksConfig(existingJson, options?): string` — idempotent merge into
|
|
106
116
|
a live settings.json; preserves every other key.
|
|
107
117
|
- `removeSkillstateHookGroups(existingJson): { text, changed }` — surgical
|
|
108
118
|
uninstall (pure groups dropped, mixed groups trimmed, empty events
|
|
109
119
|
removed).
|
|
110
120
|
- `claudeHookScriptPath(scriptDir, event): string`.
|
|
111
|
-
- `
|
|
112
|
-
|
|
113
|
-
|
|
121
|
+
- `saveHookScript(event, target, statePath?)`, `saveHooksConfig(target,
|
|
122
|
+
statePath?, options?)` — atomic writes. (SKILL.md generation is
|
|
123
|
+
host-neutral and lives in the CLI: `skillstate init` writes the shared
|
|
124
|
+
`.claude/skills/skillstate/SKILL.md`.)
|
|
114
125
|
- `generateAppendPrompt(): string` — mode-switch prompt boilerplate.
|
|
115
126
|
- `CLAUDE_HOOK_EVENTS`, `CLAUDE_SESSION_START_MATCHER` (`^compact$`),
|
|
116
127
|
`CLAUDE_POST_TOOL_USE_MATCHER` (`^Bash$`), `CLAUDE_HOOK_TIMEOUT_SECONDS`.
|
|
@@ -123,6 +134,11 @@ Root path `@skillstate/claude` exports:
|
|
|
123
134
|
- **Honest limitation.** Claude Code hooks cannot trim history and cannot
|
|
124
135
|
inject context at compaction time, so prompts are O(T) with fresh state
|
|
125
136
|
per turn. The injected state is authoritative — history is not.
|
|
137
|
+
- **Inert without state.** The generated scripts resolve the per-project
|
|
138
|
+
state path first and emit `{}` (nothing added to context, nothing
|
|
139
|
+
written) when the session cwd has no skillstate state — hooks NEVER
|
|
140
|
+
create state files, so a fresh clone behaves like a vanilla Claude Code
|
|
141
|
+
install.
|
|
126
142
|
- The generated scripts are self-contained CommonJS. Malformed patches are
|
|
127
143
|
never persisted — the ⊕ merge either fully applies or the hook reports a
|
|
128
144
|
`systemMessage` and leaves the state file untouched.
|
package/dist/claude-adapter.d.ts
CHANGED
|
@@ -25,6 +25,14 @@ export interface ClaudeHooksConfigOptions {
|
|
|
25
25
|
scriptDir?: string;
|
|
26
26
|
/** Full command override for every event (defaults to `node <script> <event>`). */
|
|
27
27
|
command?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Per-event command override — takes precedence over {@link command}.
|
|
30
|
+
* The CLI passes e.g. `(event) => \`node "$CLAUDE_PROJECT_DIR"/...\`` to
|
|
31
|
+
* make the hook commands PROJECT-LOCAL. When it returns a command for
|
|
32
|
+
* `event`, that exact string is written; events not covered fall back to
|
|
33
|
+
* {@link command} / the default form.
|
|
34
|
+
*/
|
|
35
|
+
commandFor?: (event: ClaudeHookEvent) => string;
|
|
28
36
|
/** Hook `timeout` in seconds (default {@link CLAUDE_HOOK_TIMEOUT_SECONDS}). */
|
|
29
37
|
timeoutSeconds?: number;
|
|
30
38
|
}
|
|
@@ -51,7 +59,17 @@ export declare class ClaudeAdapter implements PlatformAdapter {
|
|
|
51
59
|
*/
|
|
52
60
|
claudeHookScriptPath(scriptDir: string, event: ClaudeHookEvent): string;
|
|
53
61
|
/**
|
|
54
|
-
*
|
|
62
|
+
* Resolve the settings.json command for `event` — the shared precedence
|
|
63
|
+
* used by BOTH {@link generateHooksConfig} and {@link mergeHooksConfig}
|
|
64
|
+
* (so the `commandsOf` idempotency set always matches what was written):
|
|
65
|
+
* `options.commandFor(event)` → `options.command` → the default
|
|
66
|
+
* `node "<script>" <event>` form. The `commandFor` hook is how the CLI
|
|
67
|
+
* installs PROJECT-LOCAL commands (e.g. a `$CLAUDE_PROJECT_DIR`-anchored
|
|
68
|
+
* per-event template).
|
|
69
|
+
*/
|
|
70
|
+
private commandOf;
|
|
71
|
+
/**
|
|
72
|
+
* Generate the hooks section for the (project) `settings.json` (2.1.260
|
|
55
73
|
* schema: `{ hooks: { Event: [ { matcher?, hooks: [ { type: "command",
|
|
56
74
|
* command, timeout } ] } ] } }`). The document carries ONLY the
|
|
57
75
|
* `hooks` key — {@link mergeHooksConfig} is what splices these groups
|
|
@@ -62,11 +80,13 @@ export declare class ClaudeAdapter implements PlatformAdapter {
|
|
|
62
80
|
* - `PostToolUse` (matcher `^Bash$`) → persist `state_patch` blocks from
|
|
63
81
|
* Bash tool outputs.
|
|
64
82
|
*
|
|
65
|
-
* Commands
|
|
66
|
-
* generated `.cjs` scripts in `options.scriptDir` (default: the state
|
|
67
|
-
* file's directory, else a `<stateDir>/hooks` placeholder).
|
|
68
|
-
*
|
|
69
|
-
*
|
|
83
|
+
* Commands default to absolute `node <script> <event>` lines pointing at
|
|
84
|
+
* the generated `.cjs` scripts in `options.scriptDir` (default: the state
|
|
85
|
+
* file's directory, else a `<stateDir>/hooks` placeholder). A per-event
|
|
86
|
+
* `options.commandFor` override wins over the global `options.command`;
|
|
87
|
+
* the CLI passes a `$CLAUDE_PROJECT_DIR`-anchored template there to make
|
|
88
|
+
* the installed hooks PROJECT-LOCAL. No matcher on UserPromptSubmit —
|
|
89
|
+
* the event has no matcher support and fires on every prompt.
|
|
70
90
|
*/
|
|
71
91
|
generateHooksConfig(statePath?: string | StatePathRef, options?: ClaudeHooksConfigOptions): string;
|
|
72
92
|
/**
|
|
@@ -86,6 +106,12 @@ export declare class ClaudeAdapter implements PlatformAdapter {
|
|
|
86
106
|
* and writes the state file (under the built-in cross-process lock);
|
|
87
107
|
* stdout is `{}` or a `systemMessage` when the patch is invalid.
|
|
88
108
|
*
|
|
109
|
+
* INERT WITHOUT STATE: all three scripts resolve the per-project state
|
|
110
|
+
* path first and, when the state FILE does not exist, are no-ops — the
|
|
111
|
+
* inject scripts emit `{}` (no `hookSpecificOutput`, the interrupted-
|
|
112
|
+
* session meta check is skipped since it implies state) and
|
|
113
|
+
* `post-tool-use` writes nothing. Hooks NEVER create state files.
|
|
114
|
+
*
|
|
89
115
|
* AGENT-SCOPED STATE: the hook stdin's `session_id` scopes the state to
|
|
90
116
|
* `<cwd>/.skillstate/agents/<session-prefix>/skillstate.json`, so
|
|
91
117
|
* parallel Claude Code sessions never last-writer-win over each other.
|
|
@@ -95,15 +121,6 @@ export declare class ClaudeAdapter implements PlatformAdapter {
|
|
|
95
121
|
* cwd-resolving and never bakes an absolute state path in.
|
|
96
122
|
*/
|
|
97
123
|
generateHookScript(event: ClaudeHookEvent, statePath?: string | StatePathRef): string;
|
|
98
|
-
/**
|
|
99
|
-
* Generate a SKILL.md for Claude Code's skill directory
|
|
100
|
-
* (`~/.claude/skills/<name>/SKILL.md`). The body instructs the agent to
|
|
101
|
-
* treat the hook-injected state as authoritative (history is not
|
|
102
|
-
* reliable), to orient via `state.summary` (full dump via `state.get`),
|
|
103
|
-
* and to persist via `state.patch` — the PostToolUse hook also merges any
|
|
104
|
-
* fenced ```json `state_patch` block printed by a Bash tool call.
|
|
105
|
-
*/
|
|
106
|
-
generateSkillMd(spec: ProceduralSpec, statePath?: string): string;
|
|
107
124
|
/**
|
|
108
125
|
* Merge the skillstate hook groups into an existing `settings.json`
|
|
109
126
|
* text. Preserves every other top-level key (env, permissions, model,
|
|
@@ -114,7 +131,10 @@ export declare class ClaudeAdapter implements PlatformAdapter {
|
|
|
114
131
|
*
|
|
115
132
|
* The mechanics live in the shared {@link mergeHookGroups}; this method
|
|
116
133
|
* supplies only the format specifics (generated settings.json groups and
|
|
117
|
-
* the `
|
|
134
|
+
* the skillstate commands — `commandFor`/`command` overrides and the
|
|
135
|
+
* `node <script> <event>` default, resolved IDENTICALLY to
|
|
136
|
+
* {@link generateHooksConfig} so idempotency detection matches what was
|
|
137
|
+
* written).
|
|
118
138
|
*/
|
|
119
139
|
mergeHooksConfig(existingJson: string, options?: ClaudeHooksConfigOptions): string;
|
|
120
140
|
/**
|
|
@@ -131,11 +151,6 @@ export declare class ClaudeAdapter implements PlatformAdapter {
|
|
|
131
151
|
* `resolveStatePath`. Returns the absolute destination path.
|
|
132
152
|
*/
|
|
133
153
|
saveHooksConfig(target: string | StatePathRef, statePath?: string | StatePathRef, options?: ClaudeHooksConfigOptions): Promise<string>;
|
|
134
|
-
/**
|
|
135
|
-
* Generate a SKILL.md and persist it via the shared `saveGenerated`.
|
|
136
|
-
* Returns the absolute destination path.
|
|
137
|
-
*/
|
|
138
|
-
saveSkillMd(target: string | StatePathRef, spec: ProceduralSpec, statePath?: string): Promise<string>;
|
|
139
154
|
generateAppendPrompt(): string;
|
|
140
155
|
/**
|
|
141
156
|
* Inject-script template (`UserPromptSubmit` / `SessionStart`): brand
|
|
@@ -145,9 +160,19 @@ export declare class ClaudeAdapter implements PlatformAdapter {
|
|
|
145
160
|
* current state JSON read from the SESSION cwd. Brand specifics stay in
|
|
146
161
|
* the adapter (comment lines only); the `contextSuffix` is the shared
|
|
147
162
|
* {@link HISTORY_UNRELIABLE_NOTE} from `@skillstate/core`.
|
|
163
|
+
*
|
|
164
|
+
* INERT WITHOUT STATE: after resolving `statePath` the script emits `{}`
|
|
165
|
+
* (no `hookSpecificOutput`, nothing added to context) when the state
|
|
166
|
+
* FILE does not exist — the interrupted-session meta check is skipped
|
|
167
|
+
* too, since a session-meta sidecar implies state.
|
|
148
168
|
*/
|
|
149
169
|
private buildInjectScriptTemplate;
|
|
150
|
-
/**
|
|
170
|
+
/**
|
|
171
|
+
* PostToolUse script: extract state_patch, ⊕ merge, persist.
|
|
172
|
+
*
|
|
173
|
+
* INERT WITHOUT STATE: when the state file does not exist the hook
|
|
174
|
+
* writes nothing and emits `{}` — hooks NEVER create state files.
|
|
175
|
+
*/
|
|
151
176
|
private buildPostToolUseScript;
|
|
152
177
|
}
|
|
153
178
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-adapter.d.ts","sourceRoot":"","sources":["../src/claude-adapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"claude-adapter.d.ts","sourceRoot":"","sources":["../src/claude-adapter.ts"],"names":[],"mappings":"AAgDA,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,cAAc,EACd,WAAW,EACX,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAc1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,sBAAsB,IAAI,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEhF,qFAAqF;AACrF,MAAM,MAAM,eAAe,GACvB,oBAAoB,GACpB,uBAAuB,GACvB,eAAe,CAAC;AAEpB,8DAA8D;AAC9D,eAAO,MAAM,kBAAkB,2EAIgB,CAAC;AAEhD,mFAAmF;AACnF,eAAO,MAAM,4BAA4B,cAAc,CAAC;AAExD,2DAA2D;AAC3D,eAAO,MAAM,4BAA4B,WAAW,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAE9C,qEAAqE;AACrE,MAAM,WAAW,wBAAwB;IACvC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mFAAmF;IACnF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,MAAM,CAAC;IAChD,+EAA+E;IAC/E,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,qBAAa,aAAc,YAAW,eAAe;IACnD,QAAQ,CAAC,IAAI,YAAY;IAEzB,OAAO,CAAC,WAAW,CAAiD;IAEpE,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,cAAc,GAAG,MAAM,CAqB3D;IAED,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAEhD;IA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wBAAgB,0BAA0B,CACxC,YAAY,EAAE,MAAM,GACnB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAiDpC"}
|
package/dist/claude-adapter.js
CHANGED
|
@@ -34,11 +34,20 @@
|
|
|
34
34
|
* state from `input.cwd` at runtime — one global `settings.json` hooks
|
|
35
35
|
* section + one script directory serve every project.
|
|
36
36
|
*
|
|
37
|
+
* PROJECT-LOCAL / INERT WITHOUT STATE: the scripts are INERT when the
|
|
38
|
+
* session cwd has no skillstate state file — inject hooks emit `{}` (no
|
|
39
|
+
* `hookSpecificOutput`, nothing added to context) and `post-tool-use`
|
|
40
|
+
* writes nothing (hooks NEVER create state files). A fresh clone behaves
|
|
41
|
+
* like a vanilla Claude Code install. The CLI install is project-local:
|
|
42
|
+
* project `.claude/settings.json` hooks whose commands are passed
|
|
43
|
+
* per-event via {@link ClaudeHooksConfigOptions.commandFor} (typically
|
|
44
|
+
* `$CLAUDE_PROJECT_DIR`-anchored).
|
|
45
|
+
*
|
|
37
46
|
* @non-paper — no adapters exist in arXiv 2608.26263v3.
|
|
38
47
|
*/
|
|
39
48
|
import * as path from 'node:path';
|
|
40
49
|
import { PromptTransformer } from '@skillstate/core';
|
|
41
|
-
import { describeSchema, HISTORY_UNRELIABLE_NOTE, hookRuntimeSnippet, INTERRUPTED_SESSION_NOTE, isPlainObject, mergeHookGroups, resolveTarget, saveGenerated,
|
|
50
|
+
import { describeSchema, HISTORY_UNRELIABLE_NOTE, hookRuntimeSnippet, INTERRUPTED_SESSION_NOTE, isPlainObject, mergeHookGroups, resolveTarget, saveGenerated, STATE_PATCH_CONTRACT, } from '@skillstate/core';
|
|
42
51
|
export { resolveHostStateForCwd as resolveStateForCwd } from '@skillstate/core';
|
|
43
52
|
/** All {@link ClaudeHookEvent} values in generation order. */
|
|
44
53
|
export const CLAUDE_HOOK_EVENTS = [
|
|
@@ -106,7 +115,21 @@ ${STATE_PATCH_CONTRACT}`;
|
|
|
106
115
|
return path.join(scriptDir, `${event}.cjs`);
|
|
107
116
|
}
|
|
108
117
|
/**
|
|
109
|
-
*
|
|
118
|
+
* Resolve the settings.json command for `event` — the shared precedence
|
|
119
|
+
* used by BOTH {@link generateHooksConfig} and {@link mergeHooksConfig}
|
|
120
|
+
* (so the `commandsOf` idempotency set always matches what was written):
|
|
121
|
+
* `options.commandFor(event)` → `options.command` → the default
|
|
122
|
+
* `node "<script>" <event>` form. The `commandFor` hook is how the CLI
|
|
123
|
+
* installs PROJECT-LOCAL commands (e.g. a `$CLAUDE_PROJECT_DIR`-anchored
|
|
124
|
+
* per-event template).
|
|
125
|
+
*/
|
|
126
|
+
commandOf(scriptDir, options) {
|
|
127
|
+
return (event) => options?.commandFor?.(event) ??
|
|
128
|
+
options?.command ??
|
|
129
|
+
`node ${JSON.stringify(this.claudeHookScriptPath(scriptDir, event))} ${event}`;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Generate the hooks section for the (project) `settings.json` (2.1.260
|
|
110
133
|
* schema: `{ hooks: { Event: [ { matcher?, hooks: [ { type: "command",
|
|
111
134
|
* command, timeout } ] } ] } }`). The document carries ONLY the
|
|
112
135
|
* `hooks` key — {@link mergeHooksConfig} is what splices these groups
|
|
@@ -117,16 +140,18 @@ ${STATE_PATCH_CONTRACT}`;
|
|
|
117
140
|
* - `PostToolUse` (matcher `^Bash$`) → persist `state_patch` blocks from
|
|
118
141
|
* Bash tool outputs.
|
|
119
142
|
*
|
|
120
|
-
* Commands
|
|
121
|
-
* generated `.cjs` scripts in `options.scriptDir` (default: the state
|
|
122
|
-
* file's directory, else a `<stateDir>/hooks` placeholder).
|
|
123
|
-
*
|
|
124
|
-
*
|
|
143
|
+
* Commands default to absolute `node <script> <event>` lines pointing at
|
|
144
|
+
* the generated `.cjs` scripts in `options.scriptDir` (default: the state
|
|
145
|
+
* file's directory, else a `<stateDir>/hooks` placeholder). A per-event
|
|
146
|
+
* `options.commandFor` override wins over the global `options.command`;
|
|
147
|
+
* the CLI passes a `$CLAUDE_PROJECT_DIR`-anchored template there to make
|
|
148
|
+
* the installed hooks PROJECT-LOCAL. No matcher on UserPromptSubmit —
|
|
149
|
+
* the event has no matcher support and fires on every prompt.
|
|
125
150
|
*/
|
|
126
151
|
generateHooksConfig(statePath, options) {
|
|
127
152
|
const scriptDir = options?.scriptDir ??
|
|
128
153
|
(statePath === undefined ? '<stateDir>/hooks' : path.dirname(resolveTarget(statePath)));
|
|
129
|
-
const command =
|
|
154
|
+
const command = this.commandOf(scriptDir, options);
|
|
130
155
|
const timeout = options?.timeoutSeconds ?? CLAUDE_HOOK_TIMEOUT_SECONDS;
|
|
131
156
|
const entry = (event) => ({
|
|
132
157
|
type: 'command',
|
|
@@ -175,6 +200,12 @@ ${STATE_PATCH_CONTRACT}`;
|
|
|
175
200
|
* and writes the state file (under the built-in cross-process lock);
|
|
176
201
|
* stdout is `{}` or a `systemMessage` when the patch is invalid.
|
|
177
202
|
*
|
|
203
|
+
* INERT WITHOUT STATE: all three scripts resolve the per-project state
|
|
204
|
+
* path first and, when the state FILE does not exist, are no-ops — the
|
|
205
|
+
* inject scripts emit `{}` (no `hookSpecificOutput`, the interrupted-
|
|
206
|
+
* session meta check is skipped since it implies state) and
|
|
207
|
+
* `post-tool-use` writes nothing. Hooks NEVER create state files.
|
|
208
|
+
*
|
|
178
209
|
* AGENT-SCOPED STATE: the hook stdin's `session_id` scopes the state to
|
|
179
210
|
* `<cwd>/.skillstate/agents/<session-prefix>/skillstate.json`, so
|
|
180
211
|
* parallel Claude Code sessions never last-writer-win over each other.
|
|
@@ -198,23 +229,6 @@ ${STATE_PATCH_CONTRACT}`;
|
|
|
198
229
|
contextSuffix: HISTORY_UNRELIABLE_NOTE,
|
|
199
230
|
});
|
|
200
231
|
}
|
|
201
|
-
/**
|
|
202
|
-
* Generate a SKILL.md for Claude Code's skill directory
|
|
203
|
-
* (`~/.claude/skills/<name>/SKILL.md`). The body instructs the agent to
|
|
204
|
-
* treat the hook-injected state as authoritative (history is not
|
|
205
|
-
* reliable), to orient via `state.summary` (full dump via `state.get`),
|
|
206
|
-
* and to persist via `state.patch` — the PostToolUse hook also merges any
|
|
207
|
-
* fenced ```json `state_patch` block printed by a Bash tool call.
|
|
208
|
-
*/
|
|
209
|
-
generateSkillMd(spec, statePath) {
|
|
210
|
-
return skillMdBody({
|
|
211
|
-
hostLabel: 'Claude Code',
|
|
212
|
-
injectionPhrase: 'injected into your context via hooks',
|
|
213
|
-
hooks: { inject: 'UserPromptSubmit', reInject: 'SessionStart', patchHook: 'PostToolUse' },
|
|
214
|
-
spec,
|
|
215
|
-
statePath,
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
232
|
/**
|
|
219
233
|
* Merge the skillstate hook groups into an existing `settings.json`
|
|
220
234
|
* text. Preserves every other top-level key (env, permissions, model,
|
|
@@ -225,11 +239,14 @@ ${STATE_PATCH_CONTRACT}`;
|
|
|
225
239
|
*
|
|
226
240
|
* The mechanics live in the shared {@link mergeHookGroups}; this method
|
|
227
241
|
* supplies only the format specifics (generated settings.json groups and
|
|
228
|
-
* the `
|
|
242
|
+
* the skillstate commands — `commandFor`/`command` overrides and the
|
|
243
|
+
* `node <script> <event>` default, resolved IDENTICALLY to
|
|
244
|
+
* {@link generateHooksConfig} so idempotency detection matches what was
|
|
245
|
+
* written).
|
|
229
246
|
*/
|
|
230
247
|
mergeHooksConfig(existingJson, options) {
|
|
231
248
|
const scriptDir = options?.scriptDir ?? '<stateDir>/hooks';
|
|
232
|
-
const command =
|
|
249
|
+
const command = this.commandOf(scriptDir, options);
|
|
233
250
|
const generated = JSON.parse(this.generateHooksConfig(undefined, { ...options, scriptDir }));
|
|
234
251
|
return mergeHookGroups({
|
|
235
252
|
existingJson,
|
|
@@ -255,13 +272,6 @@ ${STATE_PATCH_CONTRACT}`;
|
|
|
255
272
|
async saveHooksConfig(target, statePath, options) {
|
|
256
273
|
return saveGenerated(target, this.generateHooksConfig(statePath, options));
|
|
257
274
|
}
|
|
258
|
-
/**
|
|
259
|
-
* Generate a SKILL.md and persist it via the shared `saveGenerated`.
|
|
260
|
-
* Returns the absolute destination path.
|
|
261
|
-
*/
|
|
262
|
-
async saveSkillMd(target, spec, statePath) {
|
|
263
|
-
return saveGenerated(target, this.generateSkillMd(spec, statePath));
|
|
264
|
-
}
|
|
265
275
|
generateAppendPrompt() {
|
|
266
276
|
return `You are operating in state-based execution mode. Your state is maintained across steps.
|
|
267
277
|
|
|
@@ -283,6 +293,11 @@ ${STATE_PATCH_CONTRACT}
|
|
|
283
293
|
* current state JSON read from the SESSION cwd. Brand specifics stay in
|
|
284
294
|
* the adapter (comment lines only); the `contextSuffix` is the shared
|
|
285
295
|
* {@link HISTORY_UNRELIABLE_NOTE} from `@skillstate/core`.
|
|
296
|
+
*
|
|
297
|
+
* INERT WITHOUT STATE: after resolving `statePath` the script emits `{}`
|
|
298
|
+
* (no `hookSpecificOutput`, nothing added to context) when the state
|
|
299
|
+
* FILE does not exist — the interrupted-session meta check is skipped
|
|
300
|
+
* too, since a session-meta sidecar implies state.
|
|
286
301
|
*/
|
|
287
302
|
buildInjectScriptTemplate(options) {
|
|
288
303
|
// SessionStart is a real session boundary: when the session-meta
|
|
@@ -290,7 +305,8 @@ ${STATE_PATCH_CONTRACT}
|
|
|
290
305
|
// this session was killed before it could finalize), the hook appends
|
|
291
306
|
// the shared INTERRUPTED_SESSION_NOTE — with the preserved state path
|
|
292
307
|
// substituted — so the model reviews progress/blockers first. A fresh
|
|
293
|
-
// MCP launch overwrites the status back to `running`.
|
|
308
|
+
// MCP launch overwrites the status back to `running`. The check only
|
|
309
|
+
// runs when state exists (no state → inert, no sidecar read).
|
|
294
310
|
const interruptedCheck = options.hookEventName === 'SessionStart';
|
|
295
311
|
return [
|
|
296
312
|
'#!/usr/bin/env node',
|
|
@@ -298,6 +314,8 @@ ${STATE_PATCH_CONTRACT}
|
|
|
298
314
|
'// Self-contained CommonJS: reads one hook JSON document on stdin,',
|
|
299
315
|
'// resolves the state from the SESSION cwd, and emits',
|
|
300
316
|
'// { hookSpecificOutput: { hookEventName, additionalContext } }.',
|
|
317
|
+
'// INERT without state: no state file → stdout is "{}" (no context',
|
|
318
|
+
'// is added; hooks never create state files).',
|
|
301
319
|
options.header,
|
|
302
320
|
"'use strict';",
|
|
303
321
|
'const fs = require("fs");',
|
|
@@ -327,6 +345,10 @@ ${STATE_PATCH_CONTRACT}
|
|
|
327
345
|
' path.resolve(os.homedir()),',
|
|
328
346
|
' agentId,',
|
|
329
347
|
' );',
|
|
348
|
+
' if (!stateFileExists(statePath, fs)) {',
|
|
349
|
+
' process.stdout.write("{}");',
|
|
350
|
+
' return;',
|
|
351
|
+
' }',
|
|
330
352
|
' const state = readStateEnvelope(statePath, (p) => fs.readFileSync(p, "utf-8"));',
|
|
331
353
|
' let contextSuffix = ' + JSON.stringify(options.contextSuffix) + ';',
|
|
332
354
|
...(interruptedCheck
|
|
@@ -354,7 +376,12 @@ ${STATE_PATCH_CONTRACT}
|
|
|
354
376
|
'',
|
|
355
377
|
].join('\n');
|
|
356
378
|
}
|
|
357
|
-
/**
|
|
379
|
+
/**
|
|
380
|
+
* PostToolUse script: extract state_patch, ⊕ merge, persist.
|
|
381
|
+
*
|
|
382
|
+
* INERT WITHOUT STATE: when the state file does not exist the hook
|
|
383
|
+
* writes nothing and emits `{}` — hooks NEVER create state files.
|
|
384
|
+
*/
|
|
358
385
|
buildPostToolUseScript(header) {
|
|
359
386
|
const fence = '```';
|
|
360
387
|
return [
|
|
@@ -364,6 +391,8 @@ ${STATE_PATCH_CONTRACT}
|
|
|
364
391
|
'// extracts state_patch from the tool_response (fenced ```json block or',
|
|
365
392
|
'// raw JSON), applies the null-deletion merge and writes the state file.',
|
|
366
393
|
'// stdout is "{}" or a systemMessage when the patch is invalid.',
|
|
394
|
+
'// INERT without state: no state file → stdout is "{}", nothing is',
|
|
395
|
+
'// written (hooks never create state files).',
|
|
367
396
|
header,
|
|
368
397
|
"'use strict';",
|
|
369
398
|
'const fs = require("fs");',
|
|
@@ -390,6 +419,10 @@ ${STATE_PATCH_CONTRACT}
|
|
|
390
419
|
' path.resolve(os.homedir()),',
|
|
391
420
|
' resolveAgentIdFromSession(input.session_id),',
|
|
392
421
|
' );',
|
|
422
|
+
' if (!stateFileExists(statePath, fs)) {',
|
|
423
|
+
' process.stdout.write(JSON.stringify(output));',
|
|
424
|
+
' return;',
|
|
425
|
+
' }',
|
|
393
426
|
' const response = input.tool_response;',
|
|
394
427
|
' let result;',
|
|
395
428
|
' if (isPlainObject(response) && isPlainObject(response.state_patch)) {',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-adapter.js","sourceRoot":"","sources":["../src/claude-adapter.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"claude-adapter.js","sourceRoot":"","sources":["../src/claude-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAQlC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EACL,cAAc,EACd,uBAAuB,EACvB,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,eAAe,EAEf,aAAa,EACb,aAAa,EACb,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,sBAAsB,IAAI,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAQhF,8DAA8D;AAC9D,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,oBAAoB;IACpB,uBAAuB;IACvB,eAAe;CAC8B,CAAC;AAEhD,mFAAmF;AACnF,MAAM,CAAC,MAAM,4BAA4B,GAAG,WAAW,CAAC;AAExD,2DAA2D;AAC3D,MAAM,CAAC,MAAM,4BAA4B,GAAG,QAAQ,CAAC;AAErD;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,EAAE,C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QACH,CAAC;QACD,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC5B,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;aAAM,IAAI,YAAY,EAAE,CAAC;YACxB,KAAK,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC;QAC5B,CAAC;QACD,OAAO,GAAG,OAAO,IAAI,YAAY,CAAC;IACpC,CAAC;IACD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAChD,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACtE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skillstate/claude",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Claude Code platform adapter for the skillstate runtime.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -21,6 +21,6 @@
|
|
|
21
21
|
},
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@skillstate/core": "^
|
|
24
|
+
"@skillstate/core": "^3.0.0"
|
|
25
25
|
}
|
|
26
26
|
}
|