@posthog/wizard 1.21.0 → 1.21.1

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.
@@ -3,12 +3,34 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.LOG_FILE_PATH = void 0;
7
+ exports.initLogFile = initLogFile;
8
+ exports.logToFile = logToFile;
6
9
  exports.debug = debug;
7
10
  exports.enableDebugLogs = enableDebugLogs;
8
11
  const chalk_1 = __importDefault(require("chalk"));
12
+ const fs_1 = require("fs");
9
13
  const logging_1 = require("./logging");
10
14
  const clack_1 = __importDefault(require("./clack"));
11
15
  let debugEnabled = false;
16
+ exports.LOG_FILE_PATH = '/tmp/posthog-wizard.log';
17
+ /**
18
+ * Initialize the log file with a run header.
19
+ * Call this at the start of each wizard run.
20
+ */
21
+ function initLogFile() {
22
+ const header = `\n${'='.repeat(60)}\nPostHog Wizard Run: ${new Date().toISOString()}\n${'='.repeat(60)}\n`;
23
+ (0, fs_1.appendFileSync)(exports.LOG_FILE_PATH, header);
24
+ }
25
+ /**
26
+ * Log a message to the file at /tmp/posthog-wizard.log.
27
+ * Always writes regardless of debug flag.
28
+ */
29
+ function logToFile(...args) {
30
+ const timestamp = new Date().toISOString();
31
+ const msg = args.map((a) => (0, logging_1.prepareMessage)(a)).join(' ');
32
+ (0, fs_1.appendFileSync)(exports.LOG_FILE_PATH, `[${timestamp}] ${msg}\n`);
33
+ }
12
34
  function debug(...args) {
13
35
  if (!debugEnabled) {
14
36
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"debug.js","sourceRoot":"","sources":["../../../src/utils/debug.ts"],"names":[],"mappings":";;;;;AAMA,sBAQC;AAED,0CAEC;AAlBD,kDAA0B;AAC1B,uCAA2C;AAC3C,oDAA4B;AAE5B,IAAI,YAAY,GAAG,KAAK,CAAC;AAEzB,SAAgB,KAAK,CAAC,GAAG,IAAe;IACtC,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO;IACT,CAAC;IAED,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,wBAAc,EAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEzD,eAAK,CAAC,GAAG,CAAC,IAAI,CAAC,eAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AACjC,CAAC;AAED,SAAgB,eAAe;IAC7B,YAAY,GAAG,IAAI,CAAC;AACtB,CAAC","sourcesContent":["import chalk from 'chalk';\nimport { prepareMessage } from './logging';\nimport clack from './clack';\n\nlet debugEnabled = false;\n\nexport function debug(...args: unknown[]) {\n if (!debugEnabled) {\n return;\n }\n\n const msg = args.map((a) => prepareMessage(a)).join(' ');\n\n clack.log.info(chalk.dim(msg));\n}\n\nexport function enableDebugLogs() {\n debugEnabled = true;\n}\n"]}
1
+ {"version":3,"file":"debug.js","sourceRoot":"","sources":["../../../src/utils/debug.ts"],"names":[],"mappings":";;;;;;AAaA,kCAKC;AAMD,8BAIC;AAED,sBAQC;AAED,0CAEC;AA1CD,kDAA0B;AAC1B,2BAAoC;AACpC,uCAA2C;AAC3C,oDAA4B;AAE5B,IAAI,YAAY,GAAG,KAAK,CAAC;AAEZ,QAAA,aAAa,GAAG,yBAAyB,CAAC;AAEvD;;;GAGG;AACH,SAAgB,WAAW;IACzB,MAAM,MAAM,GAAG,KAAK,GAAG,CAAC,MAAM,CAC5B,EAAE,CACH,yBAAyB,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC;IAC1E,IAAA,mBAAc,EAAC,qBAAa,EAAE,MAAM,CAAC,CAAC;AACxC,CAAC;AAED;;;GAGG;AACH,SAAgB,SAAS,CAAC,GAAG,IAAe;IAC1C,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC3C,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,wBAAc,EAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzD,IAAA,mBAAc,EAAC,qBAAa,EAAE,IAAI,SAAS,KAAK,GAAG,IAAI,CAAC,CAAC;AAC3D,CAAC;AAED,SAAgB,KAAK,CAAC,GAAG,IAAe;IACtC,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO;IACT,CAAC;IAED,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,wBAAc,EAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEzD,eAAK,CAAC,GAAG,CAAC,IAAI,CAAC,eAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AACjC,CAAC;AAED,SAAgB,eAAe;IAC7B,YAAY,GAAG,IAAI,CAAC;AACtB,CAAC","sourcesContent":["import chalk from 'chalk';\nimport { appendFileSync } from 'fs';\nimport { prepareMessage } from './logging';\nimport clack from './clack';\n\nlet debugEnabled = false;\n\nexport const LOG_FILE_PATH = '/tmp/posthog-wizard.log';\n\n/**\n * Initialize the log file with a run header.\n * Call this at the start of each wizard run.\n */\nexport function initLogFile() {\n const header = `\\n${'='.repeat(\n 60,\n )}\\nPostHog Wizard Run: ${new Date().toISOString()}\\n${'='.repeat(60)}\\n`;\n appendFileSync(LOG_FILE_PATH, header);\n}\n\n/**\n * Log a message to the file at /tmp/posthog-wizard.log.\n * Always writes regardless of debug flag.\n */\nexport function logToFile(...args: unknown[]) {\n const timestamp = new Date().toISOString();\n const msg = args.map((a) => prepareMessage(a)).join(' ');\n appendFileSync(LOG_FILE_PATH, `[${timestamp}] ${msg}\\n`);\n}\n\nexport function debug(...args: unknown[]) {\n if (!debugEnabled) {\n return;\n }\n\n const msg = args.map((a) => prepareMessage(a)).join(' ');\n\n clack.log.info(chalk.dim(msg));\n}\n\nexport function enableDebugLogs() {\n debugEnabled = true;\n}\n"]}
@@ -33,6 +33,10 @@ export type WizardOptions = {
33
33
  * Whether to create a new PostHog account during setup.
34
34
  */
35
35
  signup: boolean;
36
+ /**
37
+ * Whether to use the local MCP server at http://localhost:8787/mcp
38
+ */
39
+ localMcp: boolean;
36
40
  };
37
41
  export interface Feature {
38
42
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/utils/types.ts"],"names":[],"mappings":"","sourcesContent":["export type PostHogProjectData = Record<string, unknown>;\n\nexport type PreselectedProject = {\n project: PostHogProjectData;\n authToken: string;\n};\n\nexport type WizardOptions = {\n /**\n * Whether to enable debug mode.\n */\n debug: boolean;\n\n /**\n * Whether to force install the SDK package to continue with the installation in case\n * any package manager checks are failing (e.g. peer dependency versions).\n *\n * Use with caution and only if you know what you're doing.\n *\n * Does not apply to all wizard flows (currently NPM only)\n */\n forceInstall: boolean;\n\n /**\n * The directory to run the wizard in.\n */\n installDir: string;\n\n /**\n * The cloud region to use.\n */\n cloudRegion?: CloudRegion;\n\n /**\n * Whether to select the default option for all questions automatically.\n */\n default: boolean;\n\n /**\n * Whether to create a new PostHog account during setup.\n */\n signup: boolean;\n};\n\nexport interface Feature {\n id: string;\n prompt: string;\n enabledHint?: string;\n disabledHint?: string;\n}\n\nexport type FileChange = {\n filePath: string;\n oldContent?: string;\n newContent: string;\n};\n\nexport type CloudRegion = 'us' | 'eu';\n\nexport type AIModel =\n | 'gpt-5-mini'\n | 'o4-mini'\n | 'gemini-2.5-flash'\n | 'gemini-2.5-pro';\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/utils/types.ts"],"names":[],"mappings":"","sourcesContent":["export type PostHogProjectData = Record<string, unknown>;\n\nexport type PreselectedProject = {\n project: PostHogProjectData;\n authToken: string;\n};\n\nexport type WizardOptions = {\n /**\n * Whether to enable debug mode.\n */\n debug: boolean;\n\n /**\n * Whether to force install the SDK package to continue with the installation in case\n * any package manager checks are failing (e.g. peer dependency versions).\n *\n * Use with caution and only if you know what you're doing.\n *\n * Does not apply to all wizard flows (currently NPM only)\n */\n forceInstall: boolean;\n\n /**\n * The directory to run the wizard in.\n */\n installDir: string;\n\n /**\n * The cloud region to use.\n */\n cloudRegion?: CloudRegion;\n\n /**\n * Whether to select the default option for all questions automatically.\n */\n default: boolean;\n\n /**\n * Whether to create a new PostHog account during setup.\n */\n signup: boolean;\n\n /**\n * Whether to use the local MCP server at http://localhost:8787/mcp\n */\n localMcp: boolean;\n};\n\nexport interface Feature {\n id: string;\n prompt: string;\n enabledHint?: string;\n disabledHint?: string;\n}\n\nexport type FileChange = {\n filePath: string;\n oldContent?: string;\n newContent: string;\n};\n\nexport type CloudRegion = 'us' | 'eu';\n\nexport type AIModel =\n | 'gpt-5-mini'\n | 'o4-mini'\n | 'gemini-2.5-flash'\n | 'gemini-2.5-pro';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posthog/wizard",
3
- "version": "1.21.0",
3
+ "version": "1.21.1",
4
4
  "homepage": "https://github.com/PostHog/wizard",
5
5
  "repository": "https://github.com/PostHog/wizard",
6
6
  "description": "The PostHog wizard helps you to configure your project",
@@ -32,10 +32,10 @@
32
32
  "definition": "dist/index.d.ts"
33
33
  },
34
34
  "dependencies": {
35
+ "@anthropic-ai/claude-agent-sdk": "~0.1.65",
35
36
  "@clack/core": "^0.3.4",
36
37
  "@clack/prompts": "0.7.0",
37
38
  "@langchain/core": "^0.3.40",
38
- "@posthog/agent": "1.24.2",
39
39
  "axios": "1.7.4",
40
40
  "chalk": "^2.4.1",
41
41
  "fast-glob": "^3.3.3",
@@ -45,7 +45,7 @@
45
45
  "lodash": "^4.17.21",
46
46
  "magicast": "^0.2.10",
47
47
  "opn": "^5.4.0",
48
- "posthog-node": "^4.9.0",
48
+ "posthog-node": "^4.18.0",
49
49
  "read-env": "^1.3.0",
50
50
  "recast": "^0.23.3",
51
51
  "semver": "^7.5.3",
@@ -117,7 +117,7 @@
117
117
  ],
118
118
  "testEnvironment": "node",
119
119
  "moduleNameMapper": {
120
- "^@posthog/agent$": "<rootDir>/__mocks__/@posthog/agent.ts"
120
+ "^@anthropic-ai/claude-agent-sdk$": "<rootDir>/__mocks__/@anthropic-ai/claude-agent-sdk.ts"
121
121
  }
122
122
  },
123
123
  "lint-staged": {
@@ -146,6 +146,7 @@
146
146
  "test:e2e": "pnpm build && ./e2e-tests/run.sh",
147
147
  "test:e2e-record": "export RECORD_FIXTURES=true && pnpm build && ./e2e-tests/run.sh",
148
148
  "try": "tsx bin.ts",
149
+ "dev": "pnpm build && pnpm link --global && pnpm build:watch",
149
150
  "test:watch": "jest --watch"
150
151
  }
151
152
  }