@ambasada/village 0.8.0 → 0.8.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/dist/cli.mjs +11 -11
- package/dist/index.js +6 -6
- package/package.json +3 -3
package/dist/cli.mjs
CHANGED
|
@@ -150,7 +150,7 @@ export default async function receipt(req: Request, env: Env): Promise<Response>
|
|
|
150
150
|
</html>
|
|
151
151
|
` } };
|
|
152
152
|
|
|
153
|
-
//
|
|
153
|
+
// src/cli.ts
|
|
154
154
|
import { existsSync as existsSync2 } from "node:fs";
|
|
155
155
|
import { readFile } from "node:fs/promises";
|
|
156
156
|
import { join as join2 } from "node:path";
|
|
@@ -2200,7 +2200,7 @@ function getHeader(headers, name) {
|
|
|
2200
2200
|
// ../sdk/src/platform.ts
|
|
2201
2201
|
var ambasada = new Ambasada();
|
|
2202
2202
|
|
|
2203
|
-
//
|
|
2203
|
+
// src/errors.ts
|
|
2204
2204
|
var isVillageError = isAmbasadaError;
|
|
2205
2205
|
var ReceiptInvalidError = class extends AmbasadaError {
|
|
2206
2206
|
reason;
|
|
@@ -2211,7 +2211,7 @@ var ReceiptInvalidError = class extends AmbasadaError {
|
|
|
2211
2211
|
}
|
|
2212
2212
|
};
|
|
2213
2213
|
|
|
2214
|
-
//
|
|
2214
|
+
// src/receipt.ts
|
|
2215
2215
|
var RECEIPT_HEADER2 = "x-village-receipt";
|
|
2216
2216
|
async function readIncoming(req) {
|
|
2217
2217
|
if (typeof req.clone === "function" && typeof req.arrayBuffer === "function") {
|
|
@@ -2296,7 +2296,7 @@ function concat(chunks) {
|
|
|
2296
2296
|
return out;
|
|
2297
2297
|
}
|
|
2298
2298
|
|
|
2299
|
-
//
|
|
2299
|
+
// src/webhook.ts
|
|
2300
2300
|
var { WebhookError: WebhookError2, verifyWebhook: verifyProtocolWebhook } = src_exports;
|
|
2301
2301
|
var generateWebhookSecret2 = generateWebhookSecret;
|
|
2302
2302
|
var webhookHeaders2 = webhookHeaders;
|
|
@@ -2323,7 +2323,7 @@ async function verifyWebhookPayload(secret, headers, body, options = {}) {
|
|
|
2323
2323
|
return { id: plain["webhook-id"], type: String(parsed.type), timestamp: String(parsed.timestamp ?? ""), data: parsed.data };
|
|
2324
2324
|
}
|
|
2325
2325
|
|
|
2326
|
-
//
|
|
2326
|
+
// src/client.ts
|
|
2327
2327
|
var DEFAULT_VILLAGE_API_URL = "https://hackaton.ambasada.id";
|
|
2328
2328
|
var DEFAULT_MODEL = "deepseek-v4.1-flash";
|
|
2329
2329
|
function randomKey() {
|
|
@@ -2596,10 +2596,10 @@ function createVillage(options = {}) {
|
|
|
2596
2596
|
return new Village(options);
|
|
2597
2597
|
}
|
|
2598
2598
|
|
|
2599
|
-
//
|
|
2599
|
+
// src/index.ts
|
|
2600
2600
|
var village = new Village();
|
|
2601
2601
|
|
|
2602
|
-
//
|
|
2602
|
+
// src/mock/pages.ts
|
|
2603
2603
|
var esc = (v) => String(v ?? "").replace(/[&<>"']/g, (ch) => `&#${ch.charCodeAt(0)};`);
|
|
2604
2604
|
var STYLE = `<style>
|
|
2605
2605
|
body{font-family:system-ui,sans-serif;max-width:56rem;margin:2rem auto;padding:0 1rem;color:#111;background:#fafaf7}
|
|
@@ -2648,7 +2648,7 @@ function popupResult(origin, message, fallback) {
|
|
|
2648
2648
|
</script>`;
|
|
2649
2649
|
}
|
|
2650
2650
|
|
|
2651
|
-
//
|
|
2651
|
+
// src/mock/pay-js.ts
|
|
2652
2652
|
import { readFileSync } from "node:fs";
|
|
2653
2653
|
import { fileURLToPath } from "node:url";
|
|
2654
2654
|
var cached;
|
|
@@ -2658,7 +2658,7 @@ function payJs() {
|
|
|
2658
2658
|
return cached;
|
|
2659
2659
|
}
|
|
2660
2660
|
|
|
2661
|
-
//
|
|
2661
|
+
// src/mock/bank.ts
|
|
2662
2662
|
var DEV_KEY = "sk_test_dev";
|
|
2663
2663
|
var AGENT_KEY = "sk_test_agent";
|
|
2664
2664
|
var FAKE_AGENT = "fake-agent";
|
|
@@ -3362,7 +3362,7 @@ ${key}`, s.id);
|
|
|
3362
3362
|
};
|
|
3363
3363
|
}
|
|
3364
3364
|
|
|
3365
|
-
//
|
|
3365
|
+
// src/overlay.ts
|
|
3366
3366
|
import { existsSync, readdirSync, readFileSync as readFileSync2, statSync } from "node:fs";
|
|
3367
3367
|
import { join, relative } from "node:path";
|
|
3368
3368
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
@@ -3418,7 +3418,7 @@ ${head}`;
|
|
|
3418
3418
|
`;
|
|
3419
3419
|
}
|
|
3420
3420
|
|
|
3421
|
-
//
|
|
3421
|
+
// src/cli.ts
|
|
3422
3422
|
var OLD_NAMES = ["wallet", "ledger", "offerings", "market", "steer", "webhook", "links"];
|
|
3423
3423
|
var HELP = ` wallet | ledger [--since N] your company's TON
|
|
3424
3424
|
offerings sync | list offerings.ts \u2192 the market
|
package/dist/index.js
CHANGED
|
@@ -2055,7 +2055,7 @@ function defineApp(config) {
|
|
|
2055
2055
|
// ../sdk/src/platform.ts
|
|
2056
2056
|
var ambasada = new Ambasada();
|
|
2057
2057
|
|
|
2058
|
-
//
|
|
2058
|
+
// src/errors.ts
|
|
2059
2059
|
var VillageError2 = AmbasadaError;
|
|
2060
2060
|
var isVillageError = isAmbasadaError;
|
|
2061
2061
|
var ReceiptInvalidError = class extends AmbasadaError {
|
|
@@ -2067,7 +2067,7 @@ var ReceiptInvalidError = class extends AmbasadaError {
|
|
|
2067
2067
|
}
|
|
2068
2068
|
};
|
|
2069
2069
|
|
|
2070
|
-
//
|
|
2070
|
+
// src/receipt.ts
|
|
2071
2071
|
var RECEIPT_HEADER2 = "x-village-receipt";
|
|
2072
2072
|
async function readIncoming(req) {
|
|
2073
2073
|
if (typeof req.clone === "function" && typeof req.arrayBuffer === "function") {
|
|
@@ -2152,7 +2152,7 @@ function concat(chunks) {
|
|
|
2152
2152
|
return out;
|
|
2153
2153
|
}
|
|
2154
2154
|
|
|
2155
|
-
//
|
|
2155
|
+
// src/webhook.ts
|
|
2156
2156
|
var { WebhookError: WebhookError2, verifyWebhook: verifyProtocolWebhook } = src_exports;
|
|
2157
2157
|
var WEBHOOK_HEADERS2 = WEBHOOK_HEADERS;
|
|
2158
2158
|
var generateWebhookSecret2 = generateWebhookSecret;
|
|
@@ -2180,7 +2180,7 @@ async function verifyWebhookPayload(secret, headers, body, options = {}) {
|
|
|
2180
2180
|
return { id: plain["webhook-id"], type: String(parsed.type), timestamp: String(parsed.timestamp ?? ""), data: parsed.data };
|
|
2181
2181
|
}
|
|
2182
2182
|
|
|
2183
|
-
//
|
|
2183
|
+
// src/client.ts
|
|
2184
2184
|
var DEFAULT_VILLAGE_API_URL = "https://hackaton.ambasada.id";
|
|
2185
2185
|
var DEFAULT_MODEL = "deepseek-v4.1-flash";
|
|
2186
2186
|
function randomKey() {
|
|
@@ -2453,7 +2453,7 @@ function createVillage(options = {}) {
|
|
|
2453
2453
|
return new Village(options);
|
|
2454
2454
|
}
|
|
2455
2455
|
|
|
2456
|
-
//
|
|
2456
|
+
// src/define.ts
|
|
2457
2457
|
function defineCompany(app, village2) {
|
|
2458
2458
|
const config = { ...app, ...village2 };
|
|
2459
2459
|
if (!config.idea || typeof config.idea.title !== "string") throw new Error(`${config.id}: the village needs idea: { title }`);
|
|
@@ -2465,7 +2465,7 @@ function offering(def) {
|
|
|
2465
2465
|
return def;
|
|
2466
2466
|
}
|
|
2467
2467
|
|
|
2468
|
-
//
|
|
2468
|
+
// src/index.ts
|
|
2469
2469
|
var village = new Village();
|
|
2470
2470
|
var index_default = village;
|
|
2471
2471
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ambasada/village",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "The Hack A Ton add-on for Ambasada apps: TON checkout, receipts, offerings, LLM, the agent, the market; CLI commands and the local bank.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"typescript": "~5.9.3",
|
|
33
33
|
"vitest": "^4.1.12",
|
|
34
34
|
"@ambasada/protocol": "0.1.0",
|
|
35
|
-
"@ambasada/sdk": "0.8.
|
|
36
|
-
"@ambasada/cli": "0.8.
|
|
35
|
+
"@ambasada/sdk": "0.8.1",
|
|
36
|
+
"@ambasada/cli": "0.8.1"
|
|
37
37
|
},
|
|
38
38
|
"author": "CENTYSO (https://centyso.com)",
|
|
39
39
|
"homepage": "https://ambasada.id",
|