teleton 0.1.13 → 0.1.15

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/dist/cli/index.js CHANGED
@@ -17,8 +17,7 @@ import {
17
17
  saveWallet,
18
18
  validateApiKeyFormat,
19
19
  walletExists
20
- } from "../chunk-TQBJNXWV.js";
21
- import "../chunk-B2PRMXOH.js";
20
+ } from "../chunk-ZZ4LJDVS.js";
22
21
  import {
23
22
  fetchWithTimeout
24
23
  } from "../chunk-PMX75DTX.js";
@@ -33,6 +32,9 @@ import {
33
32
  import {
34
33
  ONBOARDING_PROMPT_TIMEOUT_MS
35
34
  } from "../chunk-LJXYESJJ.js";
35
+ import "../chunk-B2PRMXOH.js";
36
+ import "../chunk-U7FQYCBQ.js";
37
+ import "../chunk-QGM4M3NI.js";
36
38
 
37
39
  // src/cli/index.ts
38
40
  import { Command } from "commander";
@@ -2,6 +2,7 @@ import {
2
2
  telegramGetMyGiftsExecutor,
3
3
  telegramGetMyGiftsTool
4
4
  } from "./chunk-B2PRMXOH.js";
5
+ import "./chunk-QGM4M3NI.js";
5
6
  export {
6
7
  telegramGetMyGiftsExecutor,
7
8
  telegramGetMyGiftsTool
package/dist/index.js CHANGED
@@ -1,14 +1,16 @@
1
1
  import {
2
2
  TonnetApp,
3
3
  main
4
- } from "./chunk-TQBJNXWV.js";
5
- import "./chunk-B2PRMXOH.js";
4
+ } from "./chunk-ZZ4LJDVS.js";
6
5
  import "./chunk-PMX75DTX.js";
7
6
  import "./chunk-E2NXSWOS.js";
8
7
  import "./chunk-WQ5TFRTG.js";
9
8
  import "./chunk-ST5CO7TV.js";
10
9
  import "./chunk-QMN6ZOA5.js";
11
10
  import "./chunk-LJXYESJJ.js";
11
+ import "./chunk-B2PRMXOH.js";
12
+ import "./chunk-U7FQYCBQ.js";
13
+ import "./chunk-QGM4M3NI.js";
12
14
  export {
13
15
  TonnetApp,
14
16
  main
@@ -32,6 +32,7 @@ import {
32
32
  import "./chunk-ST5CO7TV.js";
33
33
  import "./chunk-QMN6ZOA5.js";
34
34
  import "./chunk-LJXYESJJ.js";
35
+ import "./chunk-QGM4M3NI.js";
35
36
  export {
36
37
  AnthropicEmbeddingProvider,
37
38
  CURRENT_SCHEMA_VERSION,
@@ -8,6 +8,7 @@ import {
8
8
  import "./chunk-ST5CO7TV.js";
9
9
  import "./chunk-QMN6ZOA5.js";
10
10
  import "./chunk-LJXYESJJ.js";
11
+ import "./chunk-QGM4M3NI.js";
11
12
 
12
13
  // src/session/migrate.ts
13
14
  import { readFileSync, existsSync, renameSync } from "fs";
@@ -0,0 +1,180 @@
1
+ import {
2
+ br,
3
+ qn
4
+ } from "./chunk-U7FQYCBQ.js";
5
+ import "./chunk-QGM4M3NI.js";
6
+
7
+ // node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs
8
+ import "http";
9
+ import "https";
10
+ import "zlib";
11
+ import "stream";
12
+ import "buffer";
13
+ import "util";
14
+ import "url";
15
+ import "net";
16
+ import "fs";
17
+ import "path";
18
+ var B = Object.defineProperty;
19
+ var E = (u, a) => B(u, "name", { value: a, configurable: true });
20
+ var D = 0;
21
+ var t = { START_BOUNDARY: D++, HEADER_FIELD_START: D++, HEADER_FIELD: D++, HEADER_VALUE_START: D++, HEADER_VALUE: D++, HEADER_VALUE_ALMOST_DONE: D++, HEADERS_ALMOST_DONE: D++, PART_DATA_START: D++, PART_DATA: D++, END: D++ };
22
+ var w = 1;
23
+ var R = { PART_BOUNDARY: w, LAST_BOUNDARY: w *= 2 };
24
+ var g = 10;
25
+ var N = 13;
26
+ var x = 32;
27
+ var P = 45;
28
+ var C = 58;
29
+ var I = 97;
30
+ var M = 122;
31
+ var $ = E((u) => u | 32, "lower");
32
+ var m = E(() => {
33
+ }, "noop");
34
+ var F = class F2 {
35
+ constructor(a) {
36
+ this.index = 0, this.flags = 0, this.onHeaderEnd = m, this.onHeaderField = m, this.onHeadersEnd = m, this.onHeaderValue = m, this.onPartBegin = m, this.onPartData = m, this.onPartEnd = m, this.boundaryChars = {}, a = `\r
37
+ --` + a;
38
+ const n = new Uint8Array(a.length);
39
+ for (let r = 0; r < a.length; r++) n[r] = a.charCodeAt(r), this.boundaryChars[n[r]] = true;
40
+ this.boundary = n, this.lookbehind = new Uint8Array(this.boundary.length + 8), this.state = t.START_BOUNDARY;
41
+ }
42
+ write(a) {
43
+ let n = 0;
44
+ const r = a.length;
45
+ let d = this.index, { lookbehind: l, boundary: c, boundaryChars: p, index: e, state: i, flags: A } = this;
46
+ const H = this.boundary.length, O = H - 1, y = a.length;
47
+ let o, L;
48
+ const f = E((h) => {
49
+ this[h + "Mark"] = n;
50
+ }, "mark"), s = E((h) => {
51
+ delete this[h + "Mark"];
52
+ }, "clear"), T = E((h, S, _, U) => {
53
+ (S === void 0 || S !== _) && this[h](U && U.subarray(S, _));
54
+ }, "callback"), b = E((h, S) => {
55
+ const _ = h + "Mark";
56
+ _ in this && (S ? (T(h, this[_], n, a), delete this[_]) : (T(h, this[_], a.length, a), this[_] = 0));
57
+ }, "dataCallback");
58
+ for (n = 0; n < r; n++) switch (o = a[n], i) {
59
+ case t.START_BOUNDARY:
60
+ if (e === c.length - 2) {
61
+ if (o === P) A |= R.LAST_BOUNDARY;
62
+ else if (o !== N) return;
63
+ e++;
64
+ break;
65
+ } else if (e - 1 === c.length - 2) {
66
+ if (A & R.LAST_BOUNDARY && o === P) i = t.END, A = 0;
67
+ else if (!(A & R.LAST_BOUNDARY) && o === g) e = 0, T("onPartBegin"), i = t.HEADER_FIELD_START;
68
+ else return;
69
+ break;
70
+ }
71
+ o !== c[e + 2] && (e = -2), o === c[e + 2] && e++;
72
+ break;
73
+ case t.HEADER_FIELD_START:
74
+ i = t.HEADER_FIELD, f("onHeaderField"), e = 0;
75
+ case t.HEADER_FIELD:
76
+ if (o === N) {
77
+ s("onHeaderField"), i = t.HEADERS_ALMOST_DONE;
78
+ break;
79
+ }
80
+ if (e++, o === P) break;
81
+ if (o === C) {
82
+ if (e === 1) return;
83
+ b("onHeaderField", true), i = t.HEADER_VALUE_START;
84
+ break;
85
+ }
86
+ if (L = $(o), L < I || L > M) return;
87
+ break;
88
+ case t.HEADER_VALUE_START:
89
+ if (o === x) break;
90
+ f("onHeaderValue"), i = t.HEADER_VALUE;
91
+ case t.HEADER_VALUE:
92
+ o === N && (b("onHeaderValue", true), T("onHeaderEnd"), i = t.HEADER_VALUE_ALMOST_DONE);
93
+ break;
94
+ case t.HEADER_VALUE_ALMOST_DONE:
95
+ if (o !== g) return;
96
+ i = t.HEADER_FIELD_START;
97
+ break;
98
+ case t.HEADERS_ALMOST_DONE:
99
+ if (o !== g) return;
100
+ T("onHeadersEnd"), i = t.PART_DATA_START;
101
+ break;
102
+ case t.PART_DATA_START:
103
+ i = t.PART_DATA, f("onPartData");
104
+ case t.PART_DATA:
105
+ if (d = e, e === 0) {
106
+ for (n += O; n < y && !(a[n] in p); ) n += H;
107
+ n -= O, o = a[n];
108
+ }
109
+ if (e < c.length) c[e] === o ? (e === 0 && b("onPartData", true), e++) : e = 0;
110
+ else if (e === c.length) e++, o === N ? A |= R.PART_BOUNDARY : o === P ? A |= R.LAST_BOUNDARY : e = 0;
111
+ else if (e - 1 === c.length) if (A & R.PART_BOUNDARY) {
112
+ if (e = 0, o === g) {
113
+ A &= ~R.PART_BOUNDARY, T("onPartEnd"), T("onPartBegin"), i = t.HEADER_FIELD_START;
114
+ break;
115
+ }
116
+ } else A & R.LAST_BOUNDARY && o === P ? (T("onPartEnd"), i = t.END, A = 0) : e = 0;
117
+ if (e > 0) l[e - 1] = o;
118
+ else if (d > 0) {
119
+ const h = new Uint8Array(l.buffer, l.byteOffset, l.byteLength);
120
+ T("onPartData", 0, d, h), d = 0, f("onPartData"), n--;
121
+ }
122
+ break;
123
+ case t.END:
124
+ break;
125
+ default:
126
+ throw new Error(`Unexpected state entered: ${i}`);
127
+ }
128
+ b("onHeaderField"), b("onHeaderValue"), b("onPartData"), this.index = e, this.state = i, this.flags = A;
129
+ }
130
+ end() {
131
+ if (this.state === t.HEADER_FIELD_START && this.index === 0 || this.state === t.PART_DATA && this.index === this.boundary.length) this.onPartEnd();
132
+ else if (this.state !== t.END) throw new Error("MultipartParser.end(): stream ended unexpectedly");
133
+ }
134
+ };
135
+ E(F, "MultipartParser");
136
+ var k = F;
137
+ function v(u) {
138
+ const a = u.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);
139
+ if (!a) return;
140
+ const n = a[2] || a[3] || "";
141
+ let r = n.slice(n.lastIndexOf("\\") + 1);
142
+ return r = r.replace(/%22/g, '"'), r = r.replace(/&#(\d{4});/g, (d, l) => String.fromCharCode(l)), r;
143
+ }
144
+ E(v, "_fileName");
145
+ async function Z(u, a) {
146
+ if (!/multipart/i.test(a)) throw new TypeError("Failed to fetch");
147
+ const n = a.match(/boundary=(?:"([^"]+)"|([^;]+))/i);
148
+ if (!n) throw new TypeError("no or bad content-type header, no multipart boundary");
149
+ const r = new k(n[1] || n[2]);
150
+ let d, l, c, p, e, i;
151
+ const A = [], H = new br(), O = E((s) => {
152
+ c += f.decode(s, { stream: true });
153
+ }, "onPartData"), y = E((s) => {
154
+ A.push(s);
155
+ }, "appendToFile"), o = E(() => {
156
+ const s = new qn(A, i, { type: e });
157
+ H.append(p, s);
158
+ }, "appendFileToFormData"), L = E(() => {
159
+ H.append(p, c);
160
+ }, "appendEntryToFormData"), f = new TextDecoder("utf-8");
161
+ f.decode(), r.onPartBegin = function() {
162
+ r.onPartData = O, r.onPartEnd = L, d = "", l = "", c = "", p = "", e = "", i = null, A.length = 0;
163
+ }, r.onHeaderField = function(s) {
164
+ d += f.decode(s, { stream: true });
165
+ }, r.onHeaderValue = function(s) {
166
+ l += f.decode(s, { stream: true });
167
+ }, r.onHeaderEnd = function() {
168
+ if (l += f.decode(), d = d.toLowerCase(), d === "content-disposition") {
169
+ const s = l.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);
170
+ s && (p = s[2] || s[3] || ""), i = v(l), i && (r.onPartData = y, r.onPartEnd = o);
171
+ } else d === "content-type" && (e = l);
172
+ l = "", d = "";
173
+ };
174
+ for await (const s of u) r.write(s);
175
+ return r.end(), H;
176
+ }
177
+ E(Z, "toFormData");
178
+ export {
179
+ Z as toFormData
180
+ };
@@ -5,6 +5,7 @@ import {
5
5
  WORKSPACE_PATHS,
6
6
  WORKSPACE_ROOT
7
7
  } from "./chunk-WQ5TFRTG.js";
8
+ import "./chunk-QGM4M3NI.js";
8
9
  export {
9
10
  ALLOWED_EXTENSIONS,
10
11
  MAX_FILE_SIZES,
@@ -22,6 +22,7 @@ import {
22
22
  SCRAPER_SCROLL_PADDING_PX,
23
23
  SCRAPER_SCROLL_STEP_MS
24
24
  } from "./chunk-LJXYESJJ.js";
25
+ import "./chunk-QGM4M3NI.js";
25
26
 
26
27
  // src/market/scraper.ts
27
28
  import { chromium } from "playwright";
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  BATCH_TRIGGER_DELAY_MS
3
3
  } from "./chunk-LJXYESJJ.js";
4
+ import "./chunk-QGM4M3NI.js";
4
5
 
5
6
  // src/telegram/task-dependency-resolver.ts
6
7
  var MAX_DEPENDENTS_PER_TASK = 10;
@@ -4,6 +4,7 @@ import {
4
4
  SECONDS_PER_DAY,
5
5
  SECONDS_PER_HOUR
6
6
  } from "./chunk-QMN6ZOA5.js";
7
+ import "./chunk-QGM4M3NI.js";
7
8
 
8
9
  // src/telegram/task-executor.ts
9
10
  function truncateJson(data, maxChars = MAX_JSON_FIELD_CHARS) {
@@ -2,6 +2,7 @@ import {
2
2
  TaskStore,
3
3
  getTaskStore
4
4
  } from "./chunk-E2NXSWOS.js";
5
+ import "./chunk-QGM4M3NI.js";
5
6
  export {
6
7
  TaskStore,
7
8
  getTaskStore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teleton",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "Personal AI Agent for Telegram",
5
5
  "author": "ZKProof (https://t.me/zkproof)",
6
6
  "license": "MIT",
@@ -45,7 +45,6 @@
45
45
  "format:check": "prettier --check \"src/**/*.ts\"",
46
46
  "typecheck": "tsc --noEmit",
47
47
  "prepublishOnly": "npm run build",
48
- "postinstall": "node scripts/postinstall.mjs",
49
48
  "prepare": "husky"
50
49
  },
51
50
  "dependencies": {
@@ -54,8 +53,6 @@
54
53
  "@mariozechner/pi-ai": "^0.50.9",
55
54
  "@orbs-network/ton-access": "^2.3.3",
56
55
  "@sinclair/typebox": "^0.34.48",
57
- "@ston-fi/api": "^0.30.0",
58
- "@ston-fi/sdk": "^2.7.0",
59
56
  "@ton/core": "^0.63.0",
60
57
  "@ton/crypto": "^3.3.0",
61
58
  "@ton/ton": "^16.1.0",
@@ -70,6 +67,8 @@
70
67
  "zod": "^3.24.0"
71
68
  },
72
69
  "devDependencies": {
70
+ "@ston-fi/api": "^0.30.0",
71
+ "@ston-fi/sdk": "^2.7.0",
73
72
  "@types/better-sqlite3": "^7.6.11",
74
73
  "@types/node": "^22.0.0",
75
74
  "@typescript-eslint/eslint-plugin": "^8.54.0",