sandoichi 0.1.3 → 0.1.4
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 +4 -6
- package/package.json +1 -1
- package/src/postinstall.mjs +4 -2
- package/src/session-start.mjs +2 -2
- package/src/statusline.mjs +2 -2
- package/src/telemetry-cli.mjs +2 -2
- package/src/telemetry.mjs +1 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# sandoichi
|
|
2
2
|
|
|
3
|
-
Sando's
|
|
3
|
+
`sandoichi` is Sando's optional JavaScript library. The full Sando plugin is the main product. Install it through the Claude Code or Codex marketplace.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
npm install sandoichi
|
|
@@ -10,12 +10,10 @@ npm install sandoichi
|
|
|
10
10
|
import { optimizeToolOutput, createProviderProxy } from 'sandoichi';
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
The library requires Node.js `>=22.22.0 <23` and has no runtime dependencies. Installing it does not install or enable the plugin.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
For plugin installation, see the [main project README](https://github.com/yuzushi-dev/Sando#readme).
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
/plugin install sando@yuzushi
|
|
19
|
-
```
|
|
17
|
+
Telemetry is off by default. An interactive npm install asks once for consent; see the [full disclosure](https://github.com/yuzushi-dev/Sando/blob/main/TELEMETRY.md).
|
|
20
18
|
|
|
21
19
|
MIT.
|
package/package.json
CHANGED
package/src/postinstall.mjs
CHANGED
|
@@ -7,9 +7,11 @@ import path from 'node:path';
|
|
|
7
7
|
import readline from 'node:readline/promises';
|
|
8
8
|
import { pathToFileURL } from 'node:url';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
CONSENT_VERSION, defaultTelemetryConfigPath, enableTelemetry, readTelemetryConfig, TELEMETRY_DETAILS_URL,
|
|
12
|
+
} from './telemetry.mjs';
|
|
11
13
|
|
|
12
|
-
const CONSENT_PROMPT =
|
|
14
|
+
const CONSENT_PROMPT = `Enable anonymous telemetry? Full details at: ${TELEMETRY_DETAILS_URL} [y/N] `;
|
|
13
15
|
|
|
14
16
|
export async function runPostinstall({
|
|
15
17
|
env = process.env, stdin = process.stdin, stdout = process.stdout,
|
package/src/session-start.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
|
|
3
|
-
import { defaultTelemetryConfigPath, readTelemetryConfig } from './telemetry.mjs';
|
|
3
|
+
import { defaultTelemetryConfigPath, readTelemetryConfig, TELEMETRY_DETAILS_URL } from './telemetry.mjs';
|
|
4
4
|
|
|
5
5
|
export function runSessionStart({
|
|
6
6
|
env = process.env,
|
|
@@ -19,7 +19,7 @@ export function runSessionStart({
|
|
|
19
19
|
hookSpecificOutput: {
|
|
20
20
|
hookEventName: 'SessionStart',
|
|
21
21
|
systemMessage: 'Sando can send anonymous aggregate telemetry (opt-in, off by default). '
|
|
22
|
-
+ `Run \`node "${cli}" enable\` to turn it on. Details:
|
|
22
|
+
+ `Run \`node "${cli}" enable\` to turn it on. Details: ${TELEMETRY_DETAILS_URL}`,
|
|
23
23
|
},
|
|
24
24
|
})}\n`);
|
|
25
25
|
} catch {
|
package/src/statusline.mjs
CHANGED
|
@@ -95,6 +95,6 @@ export function renderStatusLine({ metrics, providerUsage, totalCostUsd } = {},
|
|
|
95
95
|
const effectiveRate = Number.isFinite(totalCostUsd) && totalCostUsd > 0
|
|
96
96
|
&& Number.isSafeInteger(providerUsage?.totalTokens) && providerUsage.totalTokens > 0
|
|
97
97
|
? totalCostUsd / providerUsage.totalTokens : undefined;
|
|
98
|
-
|
|
99
|
-
return `🥪 ${
|
|
98
|
+
void effectiveRate; // computed for downstream cost tracking, intentionally not shown in the status bar
|
|
99
|
+
return `🥪 ${savings}`;
|
|
100
100
|
}
|
package/src/telemetry-cli.mjs
CHANGED
|
@@ -6,11 +6,11 @@ import { pathToFileURL } from 'node:url';
|
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
8
|
defaultTelemetryConfigPath, defaultTelemetryStatePaths,
|
|
9
|
-
disableTelemetry, enableTelemetry, flushQueue, previewNextUpload, statusTelemetry,
|
|
9
|
+
disableTelemetry, enableTelemetry, flushQueue, previewNextUpload, statusTelemetry, TELEMETRY_DETAILS_URL,
|
|
10
10
|
} from './telemetry.mjs';
|
|
11
11
|
|
|
12
12
|
const USAGE = 'Usage: sando telemetry <status|enable|disable [--purge]|preview|flush>\n';
|
|
13
|
-
const CONSENT_PROMPT =
|
|
13
|
+
const CONSENT_PROMPT = `Enable anonymous telemetry? Full details at: ${TELEMETRY_DETAILS_URL} [y/N] `;
|
|
14
14
|
|
|
15
15
|
async function defaultPrompt(message) {
|
|
16
16
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
package/src/telemetry.mjs
CHANGED
|
@@ -84,6 +84,7 @@ export function serializeEvent(payload) {
|
|
|
84
84
|
|
|
85
85
|
export const TELEMETRY_CONFIG_VERSION = 1;
|
|
86
86
|
export const CONSENT_VERSION = 1;
|
|
87
|
+
export const TELEMETRY_DETAILS_URL = 'https://github.com/yuzushi-dev/Sando/blob/main/TELEMETRY.md';
|
|
87
88
|
// Canary phase: shared backend, fronted by a Cloudflare Tunnel so it's
|
|
88
89
|
// reachable from any of the owner's machines (see
|
|
89
90
|
// session-handoff/deploy/telemetry/). Rate-limited at nginx (30 req/min/IP).
|