@invaro/opentax 0.2.2 → 0.3.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.
package/bundle/index.js CHANGED
@@ -6891,7 +6891,7 @@ var require_dist = __commonJS({
6891
6891
  });
6892
6892
 
6893
6893
  // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
6894
- import process from "node:process";
6894
+ import process2 from "node:process";
6895
6895
 
6896
6896
  // ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/core.js
6897
6897
  var NEVER = Object.freeze({
@@ -12952,7 +12952,7 @@ function serializeMessage(message) {
12952
12952
 
12953
12953
  // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
12954
12954
  var StdioServerTransport = class {
12955
- constructor(_stdin = process.stdin, _stdout = process.stdout) {
12955
+ constructor(_stdin = process2.stdin, _stdout = process2.stdout) {
12956
12956
  this._stdin = _stdin;
12957
12957
  this._stdout = _stdout;
12958
12958
  this._readBuffer = new ReadBuffer();
@@ -13011,6 +13011,53 @@ var StdioServerTransport = class {
13011
13011
  }
13012
13012
  };
13013
13013
 
13014
+ // dist/phone-home.js
13015
+ import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
13016
+ import { homedir } from "node:os";
13017
+ import { join } from "node:path";
13018
+ var VERSION = "0.3.1";
13019
+ var ENDPOINT = "https://opentax.invaro.ai/api/t";
13020
+ function optedOut() {
13021
+ return process.env.OPENTAX_TELEMETRY === "0" || process.env.OPENTAX_TELEMETRY === "false" || process.env.DO_NOT_TRACK === "1";
13022
+ }
13023
+ function firstRunNotice() {
13024
+ try {
13025
+ const dir = join(homedir(), ".config", "opentax");
13026
+ const flag = join(dir, "notice-shown");
13027
+ try {
13028
+ readFileSync(flag);
13029
+ return;
13030
+ } catch {
13031
+ }
13032
+ mkdirSync(dir, { recursive: true });
13033
+ writeFileSync(flag, String(Date.now()));
13034
+ process.stderr.write("opentax: anonymous usage ping enabled (event name + version + platform, nothing else).\n Disable with OPENTAX_TELEMETRY=0. Updates: opentax signup <email>\n");
13035
+ } catch {
13036
+ }
13037
+ }
13038
+ function phoneHome(event) {
13039
+ if (optedOut())
13040
+ return;
13041
+ firstRunNotice();
13042
+ try {
13043
+ const controller = new AbortController();
13044
+ const timer = setTimeout(() => controller.abort(), 600);
13045
+ void fetch(ENDPOINT, {
13046
+ method: "POST",
13047
+ headers: { "Content-Type": "application/json" },
13048
+ body: JSON.stringify({
13049
+ e: event,
13050
+ v: VERSION,
13051
+ os: process.platform,
13052
+ node: process.version.split(".")[0]
13053
+ }),
13054
+ signal: controller.signal
13055
+ }).catch(() => {
13056
+ }).finally(() => clearTimeout(timer));
13057
+ } catch {
13058
+ }
13059
+ }
13060
+
13014
13061
  // ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js
13015
13062
  var external_exports = {};
13016
13063
  __export(external_exports, {
@@ -36284,6 +36331,7 @@ function createServer() {
36284
36331
  }
36285
36332
 
36286
36333
  // dist/index.js
36334
+ phoneHome("mcp-stdio");
36287
36335
  var server = createServer();
36288
36336
  var transport = new StdioServerTransport();
36289
36337
  await server.connect(transport);
package/bundle/main.js CHANGED
@@ -45009,8 +45009,37 @@ function runCompare(flags) {
45009
45009
  }
45010
45010
  }
45011
45011
 
45012
- // ../cli/dist/commands/state.js
45012
+ // ../cli/dist/commands/signup.js
45013
45013
  var import_picocolors11 = __toESM(require_picocolors(), 1);
45014
+ async function runSignup(email2, flags) {
45015
+ try {
45016
+ const res = await fetch("https://opentax.invaro.ai/api/waitlist", {
45017
+ method: "POST",
45018
+ headers: { "Content-Type": "application/json" },
45019
+ body: JSON.stringify({ email: email2, source: "cli" })
45020
+ });
45021
+ const body = await res.json();
45022
+ if (flags.json) {
45023
+ print({ ok: Boolean(body.ok), ...body.error ? { error: body.error } : {} });
45024
+ return body.ok ? EXIT.OK : EXIT.ERROR;
45025
+ }
45026
+ if (body.ok) {
45027
+ console.log(import_picocolors11.default.bold("Check your inbox \u2014 one click on the confirmation link and you're in."));
45028
+ return EXIT.OK;
45029
+ }
45030
+ console.error(import_picocolors11.default.red(`signup failed: ${body.error ?? "unknown error"}`));
45031
+ return EXIT.ERROR;
45032
+ } catch {
45033
+ if (flags.json)
45034
+ print({ ok: false, error: "network" });
45035
+ else
45036
+ console.error(import_picocolors11.default.red("could not reach opentax.invaro.ai \u2014 check your connection"));
45037
+ return EXIT.ERROR;
45038
+ }
45039
+ }
45040
+
45041
+ // ../cli/dist/commands/state.js
45042
+ var import_picocolors12 = __toESM(require_picocolors(), 1);
45014
45043
  init_zod();
45015
45044
  init_dist();
45016
45045
  init_dist2();
@@ -45033,7 +45062,7 @@ function runState(flags) {
45033
45062
  if (flags.json) {
45034
45063
  print({ ok: false, error: { code: "BAD_INPUT", message } });
45035
45064
  } else {
45036
- console.error(import_picocolors11.default.red(`bad facts file: ${message}`));
45065
+ console.error(import_picocolors12.default.red(`bad facts file: ${message}`));
45037
45066
  }
45038
45067
  return EXIT.ERROR;
45039
45068
  }
@@ -45055,7 +45084,7 @@ function runState(flags) {
45055
45084
  return EXIT.OK;
45056
45085
  }
45057
45086
  console.log();
45058
- console.log(import_picocolors11.default.bold(`${String(args.jurisdiction).toUpperCase()} return \u2014 as of ${asOf}:`));
45087
+ console.log(import_picocolors12.default.bold(`${String(args.jurisdiction).toUpperCase()} return \u2014 as of ${asOf}:`));
45059
45088
  const width = Math.max(...Object.keys(lines).map((k) => k.length)) + 2;
45060
45089
  for (const [line, amount] of Object.entries(lines)) {
45061
45090
  console.log(` ${line.padEnd(width)}${amount}`);
@@ -45063,7 +45092,7 @@ function runState(flags) {
45063
45092
  if (notes.length) {
45064
45093
  console.log();
45065
45094
  for (const n of notes)
45066
- console.log(import_picocolors11.default.dim(` ${n}`));
45095
+ console.log(import_picocolors12.default.dim(` ${n}`));
45067
45096
  }
45068
45097
  console.log();
45069
45098
  return EXIT.OK;
@@ -45071,14 +45100,14 @@ function runState(flags) {
45071
45100
  if (flags.json) {
45072
45101
  print(err instanceof OpenTaxError ? { ok: false, error: err.toJSON() } : { ok: false, error: { code: "ERROR", message: String(err?.message ?? err) } });
45073
45102
  } else {
45074
- console.error(import_picocolors11.default.red(String(err?.message ?? err)));
45103
+ console.error(import_picocolors12.default.red(String(err?.message ?? err)));
45075
45104
  }
45076
45105
  return EXIT.ERROR;
45077
45106
  }
45078
45107
  }
45079
45108
 
45080
45109
  // ../cli/dist/commands/verify.js
45081
- var import_picocolors12 = __toESM(require_picocolors(), 1);
45110
+ var import_picocolors13 = __toESM(require_picocolors(), 1);
45082
45111
  init_dist();
45083
45112
  init_dist2();
45084
45113
  import { readFileSync as readFileSync5 } from "node:fs";
@@ -45128,19 +45157,19 @@ function runVerify(proofPath, flags) {
45128
45157
  }
45129
45158
  if (result.ok) {
45130
45159
  console.log();
45131
- console.log(`${import_picocolors12.default.green("\u2713 VERIFIED")} ${import_picocolors12.default.bold(artifact.target)}`);
45132
- console.log(` value ${import_picocolors12.default.green(formatValue(artifact.root.value))} (as of ${artifact.asOf})`);
45160
+ console.log(`${import_picocolors13.default.green("\u2713 VERIFIED")} ${import_picocolors13.default.bold(artifact.target)}`);
45161
+ console.log(` value ${import_picocolors13.default.green(formatValue(artifact.root.value))} (as of ${artifact.asOf})`);
45133
45162
  console.log(` corpus ${result.corpusMerkleRoot}`);
45134
45163
  console.log(` artifact ${artifact.artifactHash}`);
45135
- console.log(import_picocolors12.default.dim(" independently re-derived from the corpus; every node matches the recorded derivation"));
45164
+ console.log(import_picocolors13.default.dim(" independently re-derived from the corpus; every node matches the recorded derivation"));
45136
45165
  console.log();
45137
45166
  return EXIT.OK;
45138
45167
  }
45139
45168
  console.error();
45140
- console.error(`${import_picocolors12.default.red("\u2717 VERIFICATION FAILED")} (${result.reason})`);
45169
+ console.error(`${import_picocolors13.default.red("\u2717 VERIFICATION FAILED")} (${result.reason})`);
45141
45170
  console.error(` ${result.message}`);
45142
45171
  if (result.path)
45143
- console.error(` divergence at: ${import_picocolors12.default.bold(result.path)}`);
45172
+ console.error(` divergence at: ${import_picocolors13.default.bold(result.path)}`);
45144
45173
  if (result.expected)
45145
45174
  console.error(` expected: ${result.expected}`);
45146
45175
  if (result.actual)
@@ -45227,6 +45256,9 @@ program2.command("lookup").description("find the dollar amounts and citations be
45227
45256
  program2.command("state").description("compose a state return (IL-1040, VA 760, CA 540, NY IT-201) from a composer-facts JSON file").requiredOption("--facts <file>", "composer facts JSON (same shape as the MCP compute_state_return tool)").option("--as-of <date>", "law in force on this ISO date (default: today)").option("--json", "machine-readable output").action((flags) => {
45228
45257
  process.exitCode = runState({ facts: flags.facts, asOf: flags.asOf, json: flags.json });
45229
45258
  });
45259
+ program2.command("signup").description("get OpenTax updates by email (new features, new states, benchmark runs)").argument("<email>", "your email address").option("--json", "machine-readable output").action(async (email2, flags) => {
45260
+ process.exitCode = await runSignup(email2, { json: flags.json });
45261
+ });
45230
45262
  program2.command("verify").description("re-execute a proof artifact and confirm or refute it").argument("<proof>", "proof artifact JSON file").option("--json", "machine-readable output").action((proofPath, flags) => {
45231
45263
  process.exitCode = runVerify(proofPath, { json: flags.json });
45232
45264
  });
@@ -45266,16 +45298,66 @@ function runCli(argv) {
45266
45298
  program2.parse(argv);
45267
45299
  }
45268
45300
 
45301
+ // dist/phone-home.js
45302
+ import { mkdirSync, readFileSync as readFileSync6, writeFileSync as writeFileSync3 } from "node:fs";
45303
+ import { homedir } from "node:os";
45304
+ import { join } from "node:path";
45305
+ var VERSION = "0.3.1";
45306
+ var ENDPOINT = "https://opentax.invaro.ai/api/t";
45307
+ function optedOut() {
45308
+ return process.env.OPENTAX_TELEMETRY === "0" || process.env.OPENTAX_TELEMETRY === "false" || process.env.DO_NOT_TRACK === "1";
45309
+ }
45310
+ function firstRunNotice() {
45311
+ try {
45312
+ const dir = join(homedir(), ".config", "opentax");
45313
+ const flag = join(dir, "notice-shown");
45314
+ try {
45315
+ readFileSync6(flag);
45316
+ return;
45317
+ } catch {
45318
+ }
45319
+ mkdirSync(dir, { recursive: true });
45320
+ writeFileSync3(flag, String(Date.now()));
45321
+ process.stderr.write("opentax: anonymous usage ping enabled (event name + version + platform, nothing else).\n Disable with OPENTAX_TELEMETRY=0. Updates: opentax signup <email>\n");
45322
+ } catch {
45323
+ }
45324
+ }
45325
+ function phoneHome(event) {
45326
+ if (optedOut())
45327
+ return;
45328
+ firstRunNotice();
45329
+ try {
45330
+ const controller = new AbortController();
45331
+ const timer = setTimeout(() => controller.abort(), 600);
45332
+ void fetch(ENDPOINT, {
45333
+ method: "POST",
45334
+ headers: { "Content-Type": "application/json" },
45335
+ body: JSON.stringify({
45336
+ e: event,
45337
+ v: VERSION,
45338
+ os: process.platform,
45339
+ node: process.version.split(".")[0]
45340
+ }),
45341
+ signal: controller.signal
45342
+ }).catch(() => {
45343
+ }).finally(() => clearTimeout(timer));
45344
+ } catch {
45345
+ }
45346
+ }
45347
+
45269
45348
  // dist/main.js
45270
45349
  init_server3();
45271
45350
  var arg = process.argv[2];
45272
45351
  if (arg === "mcp" || arg === void 0 && !process.stdin.isTTY) {
45352
+ phoneHome("mcp-stdio");
45273
45353
  const server = createServer();
45274
45354
  await server.connect(new StdioServerTransport());
45275
45355
  } else if (arg === "mcp-http") {
45356
+ phoneHome("mcp-http");
45276
45357
  await Promise.resolve().then(() => (init_http(), http_exports));
45277
45358
  } else if (arg === void 0) {
45278
45359
  runCli([process.argv[0], process.argv[1], "--help"]);
45279
45360
  } else {
45361
+ phoneHome("cli");
45280
45362
  runCli();
45281
45363
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@invaro/opentax",
3
- "version": "0.2.2",
3
+ "version": "0.3.1",
4
4
  "description": "The verifiable US tax oracle: MCP server for AI agents + full CLI in one self-contained package — every answer cited to statute and machine-checkable",
5
5
  "license": "AGPL-3.0-only",
6
6
  "type": "module",
@@ -23,10 +23,10 @@
23
23
  "@modelcontextprotocol/sdk": "^1.12.0",
24
24
  "zod": "^3.24.0",
25
25
  "@invaro/opentax-compose": "0.1.0",
26
- "@invaro/opentax-core": "0.1.0",
27
- "@invaro/opentax-cli": "0.1.1",
28
26
  "@invaro/opentax-corpus-us-federal": "0.6.0",
29
- "@invaro/opentax-solve": "0.1.0"
27
+ "@invaro/opentax-cli": "0.1.1",
28
+ "@invaro/opentax-solve": "0.1.0",
29
+ "@invaro/opentax-core": "0.1.0"
30
30
  },
31
31
  "repository": {
32
32
  "type": "git",