Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions internal/agent/prompts/phase_instrument_sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ IMPORTANT: All code files must end with a trailing newline.

NOTE: This is LOCAL setup - do NOT use any API keys. Leave apiKey undefined for local mode.

**For CommonJS (module_system = "cjs"):**
The init file is the same for both CommonJS and ESM projects. The SDK automatically registers ESM loader hooks when needed.

```typescript
import { TuskDrift } from "@use-tusk/drift-node-sdk";
Expand All @@ -115,25 +115,6 @@ TuskDrift.initialize({
export { TuskDrift };
```

**For ESM (module_system = "esm"):**

```typescript
import { register } from "node:module";
import { pathToFileURL } from "node:url";

// Register the ESM loader - MUST be before importing the SDK
register("@use-tusk/drift-node-sdk/hook.mjs", pathToFileURL("./"));

import { TuskDrift } from "@use-tusk/drift-node-sdk";

TuskDrift.initialize({
env: process.env.NODE_ENV,
logLevel: "debug",
});

export { TuskDrift };
```

#### Step 3: Import SDK at Entry Point

**For CommonJS:** Add as the FIRST import in the entry file:
Expand Down
Loading