claude-terminal-prism 0.1.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.
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @prism/sdk/auto — Zero-code auto-detection mode
3
+ *
4
+ * When loaded via `--require @prism/sdk/auto` or `node -r @prism/sdk/auto`,
5
+ * this module automatically intercepts the Anthropic SDK by patching its
6
+ * module exports before the user's code loads.
7
+ *
8
+ * Activation requires `PRISM_ENABLED=true` environment variable to prevent
9
+ * accidental activation in production environments.
10
+ *
11
+ * Usage:
12
+ * PRISM_ENABLED=true node --require @prism/sdk/auto your-agent.js
13
+ * PRISM_ENABLED=true claude-code "build a REST API"
14
+ *
15
+ * This module:
16
+ * 1. Checks PRISM_ENABLED — exits silently if not set to 'true'
17
+ * 2. Patches Module._resolveFilename to intercept @anthropic-ai/sdk loads
18
+ * 3. Wraps the Anthropic constructor so every new Anthropic() is auto-wrapped
19
+ * 4. Sets up graceful cleanup on process exit
20
+ */
21
+ declare const isEnabled: boolean;
22
+ /**
23
+ * Patch the Node.js module system to auto-wrap the Anthropic SDK constructor.
24
+ * Uses Module._extensions and require cache manipulation — safe for dev tooling.
25
+ */
26
+ declare function activateAutoMode(): void;
27
+
28
+ export { activateAutoMode, isEnabled };
package/dist/auto.d.ts ADDED
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @prism/sdk/auto — Zero-code auto-detection mode
3
+ *
4
+ * When loaded via `--require @prism/sdk/auto` or `node -r @prism/sdk/auto`,
5
+ * this module automatically intercepts the Anthropic SDK by patching its
6
+ * module exports before the user's code loads.
7
+ *
8
+ * Activation requires `PRISM_ENABLED=true` environment variable to prevent
9
+ * accidental activation in production environments.
10
+ *
11
+ * Usage:
12
+ * PRISM_ENABLED=true node --require @prism/sdk/auto your-agent.js
13
+ * PRISM_ENABLED=true claude-code "build a REST API"
14
+ *
15
+ * This module:
16
+ * 1. Checks PRISM_ENABLED — exits silently if not set to 'true'
17
+ * 2. Patches Module._resolveFilename to intercept @anthropic-ai/sdk loads
18
+ * 3. Wraps the Anthropic constructor so every new Anthropic() is auto-wrapped
19
+ * 4. Sets up graceful cleanup on process exit
20
+ */
21
+ declare const isEnabled: boolean;
22
+ /**
23
+ * Patch the Node.js module system to auto-wrap the Anthropic SDK constructor.
24
+ * Uses Module._extensions and require cache manipulation — safe for dev tooling.
25
+ */
26
+ declare function activateAutoMode(): void;
27
+
28
+ export { activateAutoMode, isEnabled };