sandoichi 0.1.2 → 0.1.3
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 +9 -13
- package/package.json +2 -2
- package/src/session-start.mjs +28 -0
package/README.md
CHANGED
|
@@ -1,25 +1,21 @@
|
|
|
1
1
|
# sandoichi
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Sando's local JavaScript library for reducing repeated tool-output context.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Install
|
|
8
|
-
|
|
9
|
-
```sh
|
|
5
|
+
```bash
|
|
10
6
|
npm install sandoichi
|
|
11
7
|
```
|
|
12
8
|
|
|
13
|
-
Requires Node.js `22.22.x`.
|
|
14
|
-
|
|
15
|
-
## Usage
|
|
16
|
-
|
|
17
9
|
```js
|
|
18
10
|
import { optimizeToolOutput, createProviderProxy } from 'sandoichi';
|
|
19
11
|
```
|
|
20
12
|
|
|
21
|
-
|
|
13
|
+
Telemetry is off by default. The npm install asks once for consent.
|
|
14
|
+
|
|
15
|
+
The Claude Code and Codex plugins are installed from the Yuzushi marketplace:
|
|
22
16
|
|
|
23
|
-
|
|
17
|
+
```text
|
|
18
|
+
/plugin install sando@yuzushi
|
|
19
|
+
```
|
|
24
20
|
|
|
25
|
-
MIT
|
|
21
|
+
MIT.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sandoichi",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "Reduce repeated tool-output context in Claude Code and Codex.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "yuzushi",
|
|
7
7
|
"repository": {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
|
|
3
|
+
import { defaultTelemetryConfigPath, readTelemetryConfig } from './telemetry.mjs';
|
|
4
|
+
|
|
5
|
+
export function runSessionStart({
|
|
6
|
+
env = process.env,
|
|
7
|
+
stdout = process.stdout,
|
|
8
|
+
rootEnv = 'PLUGIN_ROOT',
|
|
9
|
+
} = {}) {
|
|
10
|
+
try {
|
|
11
|
+
const config = readTelemetryConfig(defaultTelemetryConfigPath(env));
|
|
12
|
+
if (config.prompted_consent_version > 0) {
|
|
13
|
+
stdout.write('{}\n');
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const pluginRoot = env[rootEnv] || path.resolve(import.meta.dirname, '..');
|
|
17
|
+
const cli = path.join(pluginRoot, 'lib', 'telemetry-cli.mjs');
|
|
18
|
+
stdout.write(`${JSON.stringify({
|
|
19
|
+
hookSpecificOutput: {
|
|
20
|
+
hookEventName: 'SessionStart',
|
|
21
|
+
systemMessage: 'Sando can send anonymous aggregate telemetry (opt-in, off by default). '
|
|
22
|
+
+ `Run \`node "${cli}" enable\` to turn it on. Details: TELEMETRY.md`,
|
|
23
|
+
},
|
|
24
|
+
})}\n`);
|
|
25
|
+
} catch {
|
|
26
|
+
stdout.write('{}\n');
|
|
27
|
+
}
|
|
28
|
+
}
|