tenjin-cli 0.1.0-alpha.16 → 0.1.0-alpha.17

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.
Files changed (110) hide show
  1. package/README.md +2 -0
  2. package/dist/chunk-2G2WLVHB.js +102 -0
  3. package/dist/chunk-2G2WLVHB.js.map +1 -0
  4. package/dist/chunk-2I4QTOLB.js +11 -0
  5. package/dist/chunk-2I4QTOLB.js.map +1 -0
  6. package/dist/{chunk-HVRC33OL.js → chunk-2JGT3KDW.js} +4 -6
  7. package/dist/{chunk-HVRC33OL.js.map → chunk-2JGT3KDW.js.map} +1 -1
  8. package/dist/chunk-35M3VITA.js +102 -0
  9. package/dist/chunk-35M3VITA.js.map +1 -0
  10. package/dist/{chunk-5X4SZ5BF.js → chunk-5QHHRMRA.js} +4 -4
  11. package/dist/{chunk-BFFM2WFK.js → chunk-5UDD5VSY.js} +2 -2
  12. package/dist/{chunk-BFFM2WFK.js.map → chunk-5UDD5VSY.js.map} +1 -1
  13. package/dist/{chunk-OIM4HLN6.js → chunk-7QKHZQKW.js} +295 -20
  14. package/dist/chunk-7QKHZQKW.js.map +1 -0
  15. package/dist/{chunk-BBVUVBUO.js → chunk-AR7U7BRG.js} +44 -7
  16. package/dist/{chunk-BBVUVBUO.js.map → chunk-AR7U7BRG.js.map} +1 -1
  17. package/dist/{chunk-DMZZLPZN.js → chunk-AUKDYPPX.js} +14 -89
  18. package/dist/chunk-AUKDYPPX.js.map +1 -0
  19. package/dist/{chunk-PZEN5PHN.js → chunk-J5INH7WB.js} +17 -3
  20. package/dist/chunk-J5INH7WB.js.map +1 -0
  21. package/dist/{chunk-7WEQQJLG.js → chunk-JLEF5WHM.js} +66 -2
  22. package/dist/chunk-JLEF5WHM.js.map +1 -0
  23. package/dist/{chunk-GULLJQXA.js → chunk-KK4YGYTV.js} +127 -17
  24. package/dist/chunk-KK4YGYTV.js.map +1 -0
  25. package/dist/{chunk-YEETV6IW.js → chunk-KUBEYXSO.js} +10 -12
  26. package/dist/{chunk-YEETV6IW.js.map → chunk-KUBEYXSO.js.map} +1 -1
  27. package/dist/{chunk-2U5ZVEV3.js → chunk-LJ4DMVFI.js} +5 -5
  28. package/dist/{chunk-3AJS6LLN.js → chunk-MRGADYDD.js} +7 -7
  29. package/dist/{chunk-25TJPVBF.js → chunk-O4ZNKFRU.js} +28 -15
  30. package/dist/chunk-O4ZNKFRU.js.map +1 -0
  31. package/dist/{chunk-OJLYNM4Z.js → chunk-PDA2BVFY.js} +77 -19
  32. package/dist/chunk-PDA2BVFY.js.map +1 -0
  33. package/dist/{chunk-L3PVMIYQ.js → chunk-QDD2RN7G.js} +29 -119
  34. package/dist/chunk-QDD2RN7G.js.map +1 -0
  35. package/dist/chunk-S2NRVRPF.js +171 -0
  36. package/dist/chunk-S2NRVRPF.js.map +1 -0
  37. package/dist/chunk-TGLKKLQG.js +11 -0
  38. package/dist/chunk-TGLKKLQG.js.map +1 -0
  39. package/dist/chunk-TP4D47BY.js +127 -0
  40. package/dist/chunk-TP4D47BY.js.map +1 -0
  41. package/dist/{chunk-WH7OWT6G.js → chunk-U2DZISAH.js} +2 -8
  42. package/dist/chunk-U2DZISAH.js.map +1 -0
  43. package/dist/{chunk-USS336NF.js → chunk-WGQVJM56.js} +5 -5
  44. package/dist/chunk-WGQVJM56.js.map +1 -0
  45. package/dist/{chunk-YJHHCWM3.js → chunk-WLMJE3GJ.js} +3 -3
  46. package/dist/{chunk-U5DXNFJC.js → chunk-WS4JA6TC.js} +3 -3
  47. package/dist/{chunk-SKAHDQH7.js → chunk-XZOEUYMX.js} +6 -7
  48. package/dist/{chunk-SKAHDQH7.js.map → chunk-XZOEUYMX.js.map} +1 -1
  49. package/dist/{cli-M3XCSOU6.js → cli-VHYYYYXM.js} +43 -29
  50. package/dist/{cli-M3XCSOU6.js.map → cli-VHYYYYXM.js.map} +1 -1
  51. package/dist/{config-MXOX7XDR.js → config-5ADBAAXU.js} +11 -10
  52. package/dist/{doctor-LU4YIZWM.js → doctor-Q35VQW3S.js} +108 -21
  53. package/dist/doctor-Q35VQW3S.js.map +1 -0
  54. package/dist/{fund-A54P2QFK.js → fund-GDDPL2BB.js} +11 -10
  55. package/dist/{fund-A54P2QFK.js.map → fund-GDDPL2BB.js.map} +1 -1
  56. package/dist/hook-command-PBERPRE3.js +763 -0
  57. package/dist/hook-command-PBERPRE3.js.map +1 -0
  58. package/dist/index.js +2 -2
  59. package/dist/{install-XUM2XSHW.js → install-OKDKGUXM.js} +21 -14
  60. package/dist/{install-wallet-QIOFORTX.js → install-wallet-SI4LZ73K.js} +10 -9
  61. package/dist/{install-wallet-QIOFORTX.js.map → install-wallet-SI4LZ73K.js.map} +1 -1
  62. package/dist/{mcp-HJC2PLRV.js → mcp-XX3WRQEZ.js} +63 -31
  63. package/dist/{mcp-HJC2PLRV.js.map → mcp-XX3WRQEZ.js.map} +1 -1
  64. package/dist/{pay-SBXZEPEP.js → pay-3SYKHKWJ.js} +15 -13
  65. package/dist/{redact-46ZHF2NH.js → redact-6W23GGJC.js} +4 -6
  66. package/dist/{send-ASD2ZXJD.js → send-LQRKTEJT.js} +10 -9
  67. package/dist/{send-ASD2ZXJD.js.map → send-LQRKTEJT.js.map} +1 -1
  68. package/dist/{skill-placement-NFVHY6A3.js → skill-placement-JMDPSKE6.js} +12 -13
  69. package/dist/{skill-placement-NFVHY6A3.js.map → skill-placement-JMDPSKE6.js.map} +1 -1
  70. package/dist/{status-T2SDB57A.js → status-FFC6FO72.js} +8 -7
  71. package/dist/{status-T2SDB57A.js.map → status-FFC6FO72.js.map} +1 -1
  72. package/dist/{status-line-CGPUSDMC.js → status-line-SAXSU6CR.js} +19 -3
  73. package/dist/status-line-SAXSU6CR.js.map +1 -0
  74. package/dist/{status-line-wiring-BYPHTYZE.js → status-line-wiring-L2WYIYBM.js} +5 -6
  75. package/dist/tenjin-daemon.mjs +384 -23
  76. package/dist/{uninstall-FKYZHAM3.js → uninstall-OACH27UV.js} +18 -15
  77. package/dist/{uninstall-FKYZHAM3.js.map → uninstall-OACH27UV.js.map} +1 -1
  78. package/dist/{update-ANJ2AOTN.js → update-4W6EKLGZ.js} +6 -7
  79. package/dist/{update-ANJ2AOTN.js.map → update-4W6EKLGZ.js.map} +1 -1
  80. package/dist/{wallet-PWAHVKWW.js → wallet-BMEXRR3P.js} +10 -9
  81. package/docs/agent-permissions.md +16 -8
  82. package/docs/safety-model.md +1 -1
  83. package/package.json +1 -1
  84. package/dist/chunk-25TJPVBF.js.map +0 -1
  85. package/dist/chunk-7WEQQJLG.js.map +0 -1
  86. package/dist/chunk-DMZZLPZN.js.map +0 -1
  87. package/dist/chunk-GULLJQXA.js.map +0 -1
  88. package/dist/chunk-L3PVMIYQ.js.map +0 -1
  89. package/dist/chunk-OCBHUHWB.js +0 -69
  90. package/dist/chunk-OCBHUHWB.js.map +0 -1
  91. package/dist/chunk-OIM4HLN6.js.map +0 -1
  92. package/dist/chunk-OJLYNM4Z.js.map +0 -1
  93. package/dist/chunk-PZEN5PHN.js.map +0 -1
  94. package/dist/chunk-USS336NF.js.map +0 -1
  95. package/dist/chunk-WH7OWT6G.js.map +0 -1
  96. package/dist/doctor-LU4YIZWM.js.map +0 -1
  97. package/dist/hook-command-U6KWPEDQ.js +0 -377
  98. package/dist/hook-command-U6KWPEDQ.js.map +0 -1
  99. package/dist/status-line-CGPUSDMC.js.map +0 -1
  100. /package/dist/{chunk-5X4SZ5BF.js.map → chunk-5QHHRMRA.js.map} +0 -0
  101. /package/dist/{chunk-2U5ZVEV3.js.map → chunk-LJ4DMVFI.js.map} +0 -0
  102. /package/dist/{chunk-3AJS6LLN.js.map → chunk-MRGADYDD.js.map} +0 -0
  103. /package/dist/{chunk-YJHHCWM3.js.map → chunk-WLMJE3GJ.js.map} +0 -0
  104. /package/dist/{chunk-U5DXNFJC.js.map → chunk-WS4JA6TC.js.map} +0 -0
  105. /package/dist/{config-MXOX7XDR.js.map → config-5ADBAAXU.js.map} +0 -0
  106. /package/dist/{install-XUM2XSHW.js.map → install-OKDKGUXM.js.map} +0 -0
  107. /package/dist/{pay-SBXZEPEP.js.map → pay-3SYKHKWJ.js.map} +0 -0
  108. /package/dist/{redact-46ZHF2NH.js.map → redact-6W23GGJC.js.map} +0 -0
  109. /package/dist/{status-line-wiring-BYPHTYZE.js.map → status-line-wiring-L2WYIYBM.js.map} +0 -0
  110. /package/dist/{wallet-PWAHVKWW.js.map → wallet-BMEXRR3P.js.map} +0 -0
@@ -1,4 +1,7 @@
1
1
  import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
2
+ import {
3
+ assertPublicDestination
4
+ } from "./chunk-2G2WLVHB.js";
2
5
  import {
3
6
  HTTPFacilitatorClient,
4
7
  SIGN_IN_WITH_X,
@@ -16,7 +19,7 @@ import {
16
19
  import {
17
20
  fetchFailureToCliError,
18
21
  httpRequest
19
- } from "./chunk-5X4SZ5BF.js";
22
+ } from "./chunk-5QHHRMRA.js";
20
23
  import {
21
24
  encodeFunctionData,
22
25
  getAddress as getAddress2,
@@ -35,29 +38,29 @@ import {
35
38
  describeWallet,
36
39
  resolveSpendAuthorizer,
37
40
  resolveWalletProvider
38
- } from "./chunk-YEETV6IW.js";
41
+ } from "./chunk-KUBEYXSO.js";
39
42
  import {
40
43
  getAddress
41
44
  } from "./chunk-EGELTSPU.js";
42
45
  import {
43
46
  mask
44
- } from "./chunk-OIM4HLN6.js";
47
+ } from "./chunk-7QKHZQKW.js";
45
48
  import {
46
49
  sanitizeForTerminal
47
- } from "./chunk-YJHHCWM3.js";
50
+ } from "./chunk-WLMJE3GJ.js";
48
51
  import {
49
52
  resolveContextSettings
50
- } from "./chunk-OJLYNM4Z.js";
53
+ } from "./chunk-PDA2BVFY.js";
51
54
  import {
52
55
  parseUsdToAtomic,
53
56
  toMoney
54
- } from "./chunk-WH7OWT6G.js";
57
+ } from "./chunk-U2DZISAH.js";
55
58
  import {
56
59
  isSameDeployment
57
- } from "./chunk-BBVUVBUO.js";
60
+ } from "./chunk-AR7U7BRG.js";
58
61
  import {
59
62
  CliError
60
- } from "./chunk-OCBHUHWB.js";
63
+ } from "./chunk-JLEF5WHM.js";
61
64
  import {
62
65
  __commonJS,
63
66
  __toESM
@@ -3369,8 +3372,8 @@ var require_utils = __commonJS({
3369
3372
  var HOST_DELIMS = { "@": "%40", "/": "%2F", "?": "%3F", "#": "%23", ":": "%3A" };
3370
3373
  var HOST_DELIM_RE = /[@/?#:]/g;
3371
3374
  var HOST_DELIM_NO_COLON_RE = /[@/?#]/g;
3372
- function reescapeHostDelimiters(host, isIP2) {
3373
- const re = isIP2 ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE;
3375
+ function reescapeHostDelimiters(host, isIP) {
3376
+ const re = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE;
3374
3377
  re.lastIndex = 0;
3375
3378
  return host.replace(re, (ch) => HOST_DELIMS[ch]);
3376
3379
  }
@@ -4052,8 +4055,8 @@ var require_fast_uri = __commonJS({
4052
4055
  const host = matches[4];
4053
4056
  return hasMalformedPercentEncoding(matches[3]) || host !== void 0 && !(host[0] === "[" && host[host.length - 1] === "]") && hasMalformedPercentEncoding(host) || hasMalformedPercentEncoding(matches[6]) || hasMalformedPercentEncoding(matches[7]) || hasMalformedPercentEncoding(matches[8]);
4054
4057
  }
4055
- function canonicalizeHost(parsed, options, schemeHandler, isIP2) {
4056
- if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport) && parsed.host && parsed.host[0] !== "[" && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP2 === false && nonSimpleDomain(parsed.host)) {
4058
+ function canonicalizeHost(parsed, options, schemeHandler, isIP) {
4059
+ if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport) && parsed.host && parsed.host[0] !== "[" && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
4057
4060
  try {
4058
4061
  parsed.host = new URL("http://" + parsed.host).hostname;
4059
4062
  } catch (e) {
@@ -4080,7 +4083,7 @@ var require_fast_uri = __commonJS({
4080
4083
  let malformedHost = false;
4081
4084
  let malformedIPLiteral = false;
4082
4085
  let malformedScheme = false;
4083
- let isIP2 = false;
4086
+ let isIP = false;
4084
4087
  if (options.reference === "suffix") {
4085
4088
  if (options.scheme) {
4086
4089
  uri = options.scheme + ":" + uri;
@@ -4142,15 +4145,15 @@ var require_fast_uri = __commonJS({
4142
4145
  if (ipv4result === false) {
4143
4146
  const bracketedIPLiteral = parsed.host[0] === "[" && parsed.host[parsed.host.length - 1] === "]";
4144
4147
  const ipv6result = normalizeIPv6(parsed.host);
4145
- isIP2 = ipv6result.isIPV6 || ipv6result.isIPVFuture === true;
4148
+ isIP = ipv6result.isIPV6 || ipv6result.isIPVFuture === true;
4146
4149
  malformedIPLiteral = bracketedIPLiteral && ipv6result.error === true;
4147
- parsed.host = isIP2 ? ipv6result.host : ipv6result.host.toLowerCase();
4150
+ parsed.host = isIP ? ipv6result.host : ipv6result.host.toLowerCase();
4148
4151
  if (malformedIPLiteral) {
4149
4152
  parsed.error = parsed.error || "URI host is malformed.";
4150
4153
  malformedAuthorityOrPort = true;
4151
4154
  }
4152
4155
  } else {
4153
- isIP2 = true;
4156
+ isIP = true;
4154
4157
  }
4155
4158
  }
4156
4159
  if (parsed.scheme === void 0 && parsed.userinfo === void 0 && parsed.host === void 0 && parsed.port === void 0 && parsed.query === void 0 && !parsed.path) {
@@ -4166,12 +4169,12 @@ var require_fast_uri = __commonJS({
4166
4169
  parsed.error = parsed.error || "URI is not a " + options.reference + " reference.";
4167
4170
  }
4168
4171
  const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme);
4169
- malformedHost = canonicalizeHost(parsed, options, schemeHandler, isIP2);
4172
+ malformedHost = canonicalizeHost(parsed, options, schemeHandler, isIP);
4170
4173
  if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
4171
4174
  if (uri.indexOf("%") !== -1) {
4172
4175
  if (parsed.host !== void 0 && !malformedIPLiteral) {
4173
- const host = isIP2 ? parsed.host : normalizePercentEncoding(parsed.host, true);
4174
- parsed.host = reescapeHostDelimiters(host, isIP2);
4176
+ const host = isIP ? parsed.host : normalizePercentEncoding(parsed.host, true);
4177
+ parsed.host = reescapeHostDelimiters(host, isIP);
4175
4178
  }
4176
4179
  }
4177
4180
  if (parsed.path) {
@@ -8416,98 +8419,6 @@ function sameAddress(a, b) {
8416
8419
  }
8417
8420
  }
8418
8421
 
8419
- // src/lib/destination.ts
8420
- import { lookup } from "node:dns/promises";
8421
- import { BlockList, isIP } from "node:net";
8422
- var blockedV4 = new BlockList();
8423
- for (const [base, prefix] of [
8424
- ["0.0.0.0", 8],
8425
- ["10.0.0.0", 8],
8426
- ["100.64.0.0", 10],
8427
- ["127.0.0.0", 8],
8428
- ["169.254.0.0", 16],
8429
- ["172.16.0.0", 12],
8430
- ["192.0.0.0", 24],
8431
- ["192.0.2.0", 24],
8432
- ["192.168.0.0", 16],
8433
- ["198.18.0.0", 15],
8434
- ["198.51.100.0", 24],
8435
- ["203.0.113.0", 24],
8436
- ["224.0.0.0", 4],
8437
- ["240.0.0.0", 4]
8438
- ]) {
8439
- blockedV4.addSubnet(base, prefix, "ipv4");
8440
- }
8441
- var blockedV6 = new BlockList();
8442
- for (const [base, prefix] of [
8443
- ["::", 128],
8444
- ["::1", 128],
8445
- ["64:ff9b::", 96],
8446
- ["100::", 64],
8447
- ["2001:db8::", 32],
8448
- ["fc00::", 7],
8449
- ["fe80::", 10],
8450
- ["ff00::", 8]
8451
- ]) {
8452
- blockedV6.addSubnet(base, prefix, "ipv6");
8453
- }
8454
- function isPublicAddress(value) {
8455
- const kind = isIP(value);
8456
- if (kind === 4) return !blockedV4.check(value, "ipv4");
8457
- return kind === 6 && /^[23]/i.test(value) && !blockedV6.check(value, "ipv6");
8458
- }
8459
- var LOCAL_SUFFIX = /(?:^|\.)(?:localhost|local|internal|home|lan)$/i;
8460
- function refuse(message, details) {
8461
- throw new CliError("USAGE", message, {
8462
- fix: "Paid requests go to public HTTPS endpoints only; nothing was signed.",
8463
- ...details !== void 0 ? { details } : {}
8464
- });
8465
- }
8466
- function assertPublicHttpsUrl(raw) {
8467
- let url;
8468
- try {
8469
- url = new URL(raw);
8470
- } catch {
8471
- return refuse(`Invalid URL: ${JSON.stringify(raw.slice(0, 200))}`);
8472
- }
8473
- if (url.protocol !== "https:" || url.username !== "" || url.password !== "" || url.hash !== "" || url.port !== "" && url.port !== "443" || raw.length > 16384) {
8474
- refuse("Only public HTTPS endpoints without credentials, fragments or custom ports are paid.");
8475
- }
8476
- const host = url.hostname.replace(/^\[|\]$/g, "");
8477
- if (!host.includes(".") && isIP(host) === 0) refuse("The endpoint host is not a public name.");
8478
- if (LOCAL_SUFFIX.test(host)) refuse("Private or local destinations are not paid.");
8479
- if (isIP(host) !== 0 && !isPublicAddress(host)) {
8480
- refuse("Private or reserved IP destinations are not paid.");
8481
- }
8482
- return url;
8483
- }
8484
- async function assertPublicDestination(raw, options = {}) {
8485
- const url = assertPublicHttpsUrl(raw);
8486
- const host = url.hostname.replace(/^\[|\]$/g, "");
8487
- if (isIP(host) !== 0) return url;
8488
- const resolve = options.resolveHostname ?? ((name) => lookup(name, { all: true }));
8489
- const signal = AbortSignal.timeout(options.timeoutMs ?? 5e3);
8490
- let addresses;
8491
- try {
8492
- addresses = await Promise.race([
8493
- resolve(host),
8494
- new Promise((_, reject) => {
8495
- signal.addEventListener("abort", () => reject(new Error("DNS lookup timed out.")), {
8496
- once: true
8497
- });
8498
- })
8499
- ]);
8500
- } catch (err) {
8501
- return refuse(`The endpoint host ${host} could not be resolved.`, {
8502
- cause: err instanceof Error ? err.message : String(err)
8503
- });
8504
- }
8505
- if (addresses.length === 0 || addresses.some((entry) => !isPublicAddress(entry.address))) {
8506
- refuse(`The endpoint host ${host} resolves to a private or unsupported network address.`);
8507
- }
8508
- return url;
8509
- }
8510
-
8511
8422
  // src/lib/request-schema.ts
8512
8423
  var import_ajv = __toESM(require_ajv(), 1);
8513
8424
  var import__ = __toESM(require__(), 1);
@@ -9929,10 +9840,9 @@ async function runPay(args, ctx, deps = {}) {
9929
9840
  const host = new URL(url).host;
9930
9841
  let registry;
9931
9842
  let termsLabel;
9932
- if (lane === "bazaar") {
9933
- if (args.terms !== void 0) termsLabel = assertWithinTerms(args.terms, requirement);
9934
- else
9935
- registry = await assertRegistryVerified(settings, url, requirement, ctx.flags.timeout, ctx);
9843
+ if (args.terms !== void 0) termsLabel = assertWithinTerms(args.terms, requirement);
9844
+ else if (lane === "bazaar") {
9845
+ registry = await assertRegistryVerified(settings, url, requirement, ctx.flags.timeout, ctx);
9936
9846
  }
9937
9847
  const provider = resolveWalletProvider(
9938
9848
  ctx,
@@ -9992,9 +9902,9 @@ async function runPay(args, ctx, deps = {}) {
9992
9902
  });
9993
9903
  }
9994
9904
  effectiveRequirement = fresh;
9995
- if (lane === "bazaar") {
9996
- if (args.terms !== void 0) termsLabel = assertWithinTerms(args.terms, fresh);
9997
- else registry = await assertRegistryVerified(settings, url, fresh, ctx.flags.timeout, ctx);
9905
+ if (args.terms !== void 0) termsLabel = assertWithinTerms(args.terms, fresh);
9906
+ else if (lane === "bazaar") {
9907
+ registry = await assertRegistryVerified(settings, url, fresh, ctx.flags.timeout, ctx);
9998
9908
  }
9999
9909
  }
10000
9910
  const amountAtomic = BigInt(effectiveRequirement.amount);
@@ -10325,4 +10235,4 @@ export {
10325
10235
  assertResultSchema,
10326
10236
  runPay
10327
10237
  };
10328
- //# sourceMappingURL=chunk-L3PVMIYQ.js.map
10238
+ //# sourceMappingURL=chunk-QDD2RN7G.js.map