@agentmark-ai/cli 0.10.0 → 0.10.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/README.md +143 -1
- package/dist/.next/BUILD_ID +1 -1
- package/dist/.next/app-build-manifest.json +3 -3
- package/dist/.next/build-manifest.json +2 -2
- package/dist/.next/cache/.previewinfo +1 -1
- package/dist/.next/cache/.rscinfo +1 -1
- package/dist/.next/cache/.tsbuildinfo +1 -1
- package/dist/.next/cache/config.json +3 -3
- package/dist/.next/cache/webpack/client-production/0.pack +0 -0
- package/dist/.next/cache/webpack/client-production/index.pack +0 -0
- package/dist/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/dist/.next/cache/webpack/server-production/0.pack +0 -0
- package/dist/.next/cache/webpack/server-production/index.pack +0 -0
- package/dist/.next/prerender-manifest.json +10 -10
- package/dist/.next/server/app/_not-found.html +1 -1
- package/dist/.next/server/app/_not-found.rsc +1 -1
- package/dist/.next/server/app/experiments/compare.html +1 -1
- package/dist/.next/server/app/experiments/compare.rsc +1 -1
- package/dist/.next/server/app/experiments.html +1 -1
- package/dist/.next/server/app/experiments.rsc +1 -1
- package/dist/.next/server/app/index.html +1 -1
- package/dist/.next/server/app/index.rsc +1 -1
- package/dist/.next/server/app/requests/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/requests.html +1 -1
- package/dist/.next/server/app/requests.rsc +2 -2
- package/dist/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/sessions.html +1 -1
- package/dist/.next/server/app/sessions.rsc +2 -2
- package/dist/.next/server/app/traces/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/traces.html +1 -1
- package/dist/.next/server/app/traces.rsc +2 -2
- package/dist/.next/server/chunks/478.js +2 -2
- package/dist/.next/server/pages/404.html +1 -1
- package/dist/.next/server/pages/500.html +1 -1
- package/dist/.next/server/server-reference-manifest.json +1 -1
- package/dist/.next/static/chunks/{41-8ba62a009d80b6dc.js → 41-f512c46d7ea943f6.js} +1 -1
- package/dist/.next/trace +56 -56
- package/dist/api-server.js +0 -1
- package/dist/api-server.js.map +1 -1
- package/dist/commands/deploy.d.ts +27 -0
- package/dist/commands/deploy.js +223 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/dev.d.ts +0 -1
- package/dist/commands/dev.js +79 -66
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/run-experiment.js +7 -28
- package/dist/commands/run-experiment.js.map +1 -1
- package/dist/commands/run-prompt.js +6 -27
- package/dist/commands/run-prompt.js.map +1 -1
- package/dist/config.d.ts +2 -12
- package/dist/config.js +4 -44
- package/dist/config.js.map +1 -1
- package/dist/connect/job-handler.d.ts +23 -0
- package/dist/connect/job-handler.js +187 -0
- package/dist/connect/job-handler.js.map +1 -0
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/runner-server.d.ts +0 -6
- package/dist/runner-server.js +3 -39
- package/dist/runner-server.js.map +1 -1
- package/package.json +3 -2
- package/dist/cloudflared/download.d.ts +0 -12
- package/dist/cloudflared/download.js +0 -130
- package/dist/cloudflared/download.js.map +0 -1
- package/dist/cloudflared/index.d.ts +0 -9
- package/dist/cloudflared/index.js +0 -20
- package/dist/cloudflared/index.js.map +0 -1
- package/dist/cloudflared/platform.d.ts +0 -20
- package/dist/cloudflared/platform.js +0 -79
- package/dist/cloudflared/platform.js.map +0 -1
- package/dist/cloudflared/tunnel.d.ts +0 -16
- package/dist/cloudflared/tunnel.js +0 -129
- package/dist/cloudflared/tunnel.js.map +0 -1
- package/dist/cloudflared/types.d.ts +0 -53
- package/dist/cloudflared/types.js +0 -8
- package/dist/cloudflared/types.js.map +0 -1
- package/dist/runner-server/middleware/signature-verification.d.ts +0 -37
- package/dist/runner-server/middleware/signature-verification.js +0 -55
- package/dist/runner-server/middleware/signature-verification.js.map +0 -1
- package/dist/tunnel.d.ts +0 -6
- package/dist/tunnel.js +0 -11
- package/dist/tunnel.js.map +0 -1
- /package/dist/.next/static/{p7ZqHwMUDueov4RV9Be-X → 2NZm040KzCzDPOX6MqoKG}/_buildManifest.js +0 -0
- /package/dist/.next/static/{p7ZqHwMUDueov4RV9Be-X → 2NZm040KzCzDPOX6MqoKG}/_ssgManifest.js +0 -0
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Platform Detection Module
|
|
4
|
-
*
|
|
5
|
-
* Handles OS and architecture detection for cloudflared binary selection.
|
|
6
|
-
*/
|
|
7
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
8
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
9
|
-
};
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.getPlatformInfo = getPlatformInfo;
|
|
12
|
-
exports.getCacheDir = getCacheDir;
|
|
13
|
-
exports.getBinaryPath = getBinaryPath;
|
|
14
|
-
const os_1 = __importDefault(require("os"));
|
|
15
|
-
const path_1 = __importDefault(require("path"));
|
|
16
|
-
/**
|
|
17
|
-
* Binary name mapping by platform and architecture.
|
|
18
|
-
*/
|
|
19
|
-
const BINARY_MAP = {
|
|
20
|
-
win32: {
|
|
21
|
-
x64: { name: 'cloudflared-windows-amd64.exe', archive: false },
|
|
22
|
-
ia32: { name: 'cloudflared-windows-386.exe', archive: false }
|
|
23
|
-
},
|
|
24
|
-
darwin: {
|
|
25
|
-
x64: { name: 'cloudflared-darwin-amd64.tgz', archive: true },
|
|
26
|
-
arm64: { name: 'cloudflared-darwin-arm64.tgz', archive: true }
|
|
27
|
-
},
|
|
28
|
-
linux: {
|
|
29
|
-
x64: { name: 'cloudflared-linux-amd64', archive: false },
|
|
30
|
-
arm64: { name: 'cloudflared-linux-arm64', archive: false },
|
|
31
|
-
arm: { name: 'cloudflared-linux-arm', archive: false }
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Detects the current platform and returns binary information.
|
|
36
|
-
* @throws Error if the platform/architecture combination is not supported
|
|
37
|
-
*/
|
|
38
|
-
function getPlatformInfo() {
|
|
39
|
-
const platform = os_1.default.platform();
|
|
40
|
-
const arch = os_1.default.arch();
|
|
41
|
-
const platformBinaries = BINARY_MAP[platform];
|
|
42
|
-
if (!platformBinaries) {
|
|
43
|
-
throw new Error(`Unsupported platform: ${platform}`);
|
|
44
|
-
}
|
|
45
|
-
const info = platformBinaries[arch];
|
|
46
|
-
if (!info) {
|
|
47
|
-
throw new Error(`Unsupported architecture: ${arch} on ${platform}`);
|
|
48
|
-
}
|
|
49
|
-
return {
|
|
50
|
-
os: platform,
|
|
51
|
-
arch: arch,
|
|
52
|
-
binaryName: info.name,
|
|
53
|
-
isArchive: info.archive
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Returns the cache directory for cloudflared binaries.
|
|
58
|
-
* Can be overridden with CLOUDFLARED_CACHE_DIR environment variable.
|
|
59
|
-
*/
|
|
60
|
-
function getCacheDir() {
|
|
61
|
-
if (process.env.CLOUDFLARED_CACHE_DIR) {
|
|
62
|
-
return process.env.CLOUDFLARED_CACHE_DIR;
|
|
63
|
-
}
|
|
64
|
-
return path_1.default.join(os_1.default.homedir(), '.cache', 'agentmark-cloudflared');
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Returns the full path to the cloudflared binary.
|
|
68
|
-
*/
|
|
69
|
-
function getBinaryPath() {
|
|
70
|
-
const cacheDir = getCacheDir();
|
|
71
|
-
const { binaryName, isArchive } = getPlatformInfo();
|
|
72
|
-
// For archives (macOS .tgz), the extracted binary is named 'cloudflared'
|
|
73
|
-
// For direct downloads (Windows .exe, Linux), use the original name
|
|
74
|
-
if (isArchive) {
|
|
75
|
-
return path_1.default.join(cacheDir, 'cloudflared');
|
|
76
|
-
}
|
|
77
|
-
return path_1.default.join(cacheDir, binaryName);
|
|
78
|
-
}
|
|
79
|
-
//# sourceMappingURL=platform.js.map
|
|
@@ -1 +0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E,CAAC;QACV,MAAM,IAAI,KAAK,CAAC,6BAA6B,IAAI,OAAO,QAAQ,EAAE,CAAC,CAAC;IACtE,CAAC;IAED,OAAO;QACL,EAAE,EAAE,QAA8B;QAClC,IAAI,EAAE,IAA4B;QAClC,UAAU,EAAE,IAAI,CAAC,IAAI;QACrB,SAAS,EAAE,IAAI,CAAC,OAAO;KACxB,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAgB,WAAW;IACzB,IAAI,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC;QACtC,OAAO,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC;IAC3C,CAAC;IACD,OAAO,cAAI,CAAC,IAAI,CAAC,YAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,uBAAuB,CAAC,CAAC;AACpE,CAAC;AAED;;GAEG;AACH,SAAgB,aAAa;IAC3B,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,eAAe,EAAE,CAAC;IAEpD,yEAAyE;IACzE,oEAAoE;IACpE,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,cAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;IAC5C,CAAC;IAED,OAAO,cAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cloudflared Tunnel Management Module
|
|
3
|
-
*
|
|
4
|
-
* Handles creating and managing cloudflared tunnel connections with retry logic.
|
|
5
|
-
*/
|
|
6
|
-
import type { TunnelInfo } from './types';
|
|
7
|
-
/**
|
|
8
|
-
* Creates a cloudflared tunnel to the specified local port.
|
|
9
|
-
* Includes retry logic for connection failures (FR-007).
|
|
10
|
-
*
|
|
11
|
-
* @param port Local port to tunnel to
|
|
12
|
-
* @param subdomain Optional subdomain (not used for trycloudflare.com, kept for API compatibility)
|
|
13
|
-
* @returns TunnelInfo with URL and disconnect function
|
|
14
|
-
* @throws Error if tunnel cannot be established after retries
|
|
15
|
-
*/
|
|
16
|
-
export declare function createTunnel(port: number, _subdomain?: string): Promise<TunnelInfo>;
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Cloudflared Tunnel Management Module
|
|
4
|
-
*
|
|
5
|
-
* Handles creating and managing cloudflared tunnel connections with retry logic.
|
|
6
|
-
*/
|
|
7
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
9
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
11
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
13
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.createTunnel = createTunnel;
|
|
18
|
-
const child_process_1 = require("child_process");
|
|
19
|
-
const download_1 = require("./download");
|
|
20
|
-
/** Maximum time to wait for tunnel URL (milliseconds) */
|
|
21
|
-
const TUNNEL_TIMEOUT = 30000;
|
|
22
|
-
/** Number of retry attempts for connection failures */
|
|
23
|
-
const MAX_RETRIES = 3;
|
|
24
|
-
/** Delay between retry attempts (milliseconds) */
|
|
25
|
-
const RETRY_DELAY = 2000;
|
|
26
|
-
/**
|
|
27
|
-
* Regex pattern to extract tunnel URL from cloudflared output.
|
|
28
|
-
* Matches URLs like: https://random-words.trycloudflare.com
|
|
29
|
-
*/
|
|
30
|
-
const URL_REGEX = /https:\/\/([\w-]+)\.trycloudflare\.com/;
|
|
31
|
-
/**
|
|
32
|
-
* Creates a cloudflared tunnel to the specified local port.
|
|
33
|
-
* Includes retry logic for connection failures (FR-007).
|
|
34
|
-
*
|
|
35
|
-
* @param port Local port to tunnel to
|
|
36
|
-
* @param subdomain Optional subdomain (not used for trycloudflare.com, kept for API compatibility)
|
|
37
|
-
* @returns TunnelInfo with URL and disconnect function
|
|
38
|
-
* @throws Error if tunnel cannot be established after retries
|
|
39
|
-
*/
|
|
40
|
-
function createTunnel(port, _subdomain) {
|
|
41
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
let lastError = null;
|
|
43
|
-
for (let attempt = 1; attempt <= MAX_RETRIES; attempt++) {
|
|
44
|
-
try {
|
|
45
|
-
return yield attemptTunnel(port);
|
|
46
|
-
}
|
|
47
|
-
catch (error) {
|
|
48
|
-
lastError = error;
|
|
49
|
-
if (attempt < MAX_RETRIES) {
|
|
50
|
-
console.log(`Tunnel connection failed (attempt ${attempt}/${MAX_RETRIES}). Retrying in ${RETRY_DELAY / 1000}s...`);
|
|
51
|
-
yield delay(RETRY_DELAY);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
throw new Error(`Failed to establish tunnel after ${MAX_RETRIES} attempts: ${lastError === null || lastError === void 0 ? void 0 : lastError.message}`);
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Single attempt to create a tunnel connection.
|
|
60
|
-
*/
|
|
61
|
-
function attemptTunnel(port) {
|
|
62
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
-
const binaryPath = yield (0, download_1.ensureCloudflared)();
|
|
64
|
-
return new Promise((resolve, reject) => {
|
|
65
|
-
var _a, _b;
|
|
66
|
-
const tunnel = (0, child_process_1.spawn)(binaryPath, ['tunnel', '--url', `http://localhost:${port}`], {
|
|
67
|
-
stdio: ['ignore', 'pipe', 'pipe']
|
|
68
|
-
});
|
|
69
|
-
let urlFound = false;
|
|
70
|
-
const tunnelProcess = tunnel;
|
|
71
|
-
const handleOutput = (data) => {
|
|
72
|
-
const output = data.toString();
|
|
73
|
-
const match = output.match(URL_REGEX);
|
|
74
|
-
if (match && !urlFound) {
|
|
75
|
-
urlFound = true;
|
|
76
|
-
resolve({
|
|
77
|
-
url: match[0],
|
|
78
|
-
provider: 'cloudflared',
|
|
79
|
-
disconnect: () => __awaiter(this, void 0, void 0, function* () {
|
|
80
|
-
return new Promise((res) => {
|
|
81
|
-
if (tunnelProcess.killed) {
|
|
82
|
-
res();
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
tunnelProcess.on('close', () => res());
|
|
86
|
-
// Use SIGTERM for graceful shutdown
|
|
87
|
-
tunnelProcess.kill('SIGTERM');
|
|
88
|
-
// Force kill after 5 seconds if still running
|
|
89
|
-
setTimeout(() => {
|
|
90
|
-
if (!tunnelProcess.killed) {
|
|
91
|
-
tunnelProcess.kill('SIGKILL');
|
|
92
|
-
}
|
|
93
|
-
res();
|
|
94
|
-
}, 5000);
|
|
95
|
-
});
|
|
96
|
-
})
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
// URL may appear in stdout or stderr depending on cloudflared version
|
|
101
|
-
(_a = tunnel.stdout) === null || _a === void 0 ? void 0 : _a.on('data', handleOutput);
|
|
102
|
-
(_b = tunnel.stderr) === null || _b === void 0 ? void 0 : _b.on('data', handleOutput);
|
|
103
|
-
tunnel.on('error', (error) => {
|
|
104
|
-
if (!urlFound) {
|
|
105
|
-
reject(new Error(`Failed to start cloudflared: ${error.message}`));
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
tunnel.on('close', (code) => {
|
|
109
|
-
if (!urlFound) {
|
|
110
|
-
reject(new Error(`Cloudflared exited with code ${code} before establishing tunnel`));
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
// Timeout if URL not found within time limit
|
|
114
|
-
setTimeout(() => {
|
|
115
|
-
if (!urlFound) {
|
|
116
|
-
tunnel.kill('SIGTERM');
|
|
117
|
-
reject(new Error('Tunnel connection timeout - no URL received within 30 seconds'));
|
|
118
|
-
}
|
|
119
|
-
}, TUNNEL_TIMEOUT);
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Utility function for delays.
|
|
125
|
-
*/
|
|
126
|
-
function delay(ms) {
|
|
127
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
128
|
-
}
|
|
129
|
-
//# sourceMappingURL=tunnel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tunnel.js","sourceRoot":"","sources":["../../cli-src/cloudflared/tunnel.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;AA8BH,oCAgBC;AA5CD,iDAAoD;AACpD,yCAA+C;AAG/C,yDAAyD;AACzD,MAAM,cAAc,GAAG,KAAK,CAAC;AAE7B,uDAAuD;AACvD,MAAM,WAAW,GAAG,CAAC,CAAC;AAEtB,kDAAkD;AAClD,MAAM,WAAW,GAAG,IAAI,CAAC;AAEzB;;;GAGG;AACH,MAAM,SAAS,GAAG,wCAAwC,CAAC;AAE3D;;;;;;;;GAQG;AACH,SAAsB,YAAY,CAAC,IAAY,EAAE,UAAmB;;QAClE,IAAI,SAAS,GAAiB,IAAI,CAAC;QAEnC,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,IAAI,WAAW,EAAE,OAAO,EAAE,EAAE,CAAC;YACxD,IAAI,CAAC;gBACH,OAAO,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;YACnC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,SAAS,GAAG,KAAc,CAAC;gBAC3B,IAAI,OAAO,GAAG,WAAW,EAAE,CAAC;oBAC1B,OAAO,CAAC,GAAG,CAAC,qCAAqC,OAAO,IAAI,WAAW,kBAAkB,WAAW,GAAG,IAAI,MAAM,CAAC,CAAC;oBACnH,MAAM,KAAK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cAAc,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;IACL,CAAC;CAAA;AAED;;GAEG;AACH,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cloudflared Tunneling Types
|
|
3
|
-
*
|
|
4
|
-
* TypeScript interfaces for cloudflared binary management and tunnel operations.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Information about an active tunnel connection.
|
|
8
|
-
*/
|
|
9
|
-
export interface TunnelInfo {
|
|
10
|
-
/** Public tunnel URL (e.g., https://xyz.trycloudflare.com) */
|
|
11
|
-
url: string;
|
|
12
|
-
/** Tunnel provider identifier */
|
|
13
|
-
provider: 'cloudflared';
|
|
14
|
-
/** Cleanup function to disconnect the tunnel */
|
|
15
|
-
disconnect: () => Promise<void>;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Configuration for cloudflared binary management.
|
|
19
|
-
*/
|
|
20
|
-
export interface CloudflaredConfig {
|
|
21
|
-
/** Binary cache directory */
|
|
22
|
-
cacheDir: string;
|
|
23
|
-
/** Version to use ('latest' or specific version) */
|
|
24
|
-
version: string;
|
|
25
|
-
/** Resolved binary path (null if not downloaded) */
|
|
26
|
-
binaryPath: string | null;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Platform detection information for binary selection.
|
|
30
|
-
*/
|
|
31
|
-
export interface PlatformInfo {
|
|
32
|
-
/** Operating system */
|
|
33
|
-
os: 'win32' | 'darwin' | 'linux';
|
|
34
|
-
/** CPU architecture */
|
|
35
|
-
arch: 'x64' | 'arm64' | 'arm' | 'ia32';
|
|
36
|
-
/** Platform-specific binary filename */
|
|
37
|
-
binaryName: string;
|
|
38
|
-
/** True for .tgz files (macOS) */
|
|
39
|
-
isArchive: boolean;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Progress reporting during binary download.
|
|
43
|
-
*/
|
|
44
|
-
export interface DownloadProgress {
|
|
45
|
-
/** Current download phase */
|
|
46
|
-
phase: 'checking' | 'downloading' | 'extracting' | 'ready';
|
|
47
|
-
/** Bytes downloaded so far */
|
|
48
|
-
bytesDownloaded?: number;
|
|
49
|
-
/** Total bytes to download */
|
|
50
|
-
totalBytes?: number;
|
|
51
|
-
/** Human-readable status message */
|
|
52
|
-
message: string;
|
|
53
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../cli-src/cloudflared/types.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Webhook signature verification middleware for securing webhook endpoints.
|
|
3
|
-
* Uses HMAC-SHA256 signatures to verify requests are from trusted sources.
|
|
4
|
-
*/
|
|
5
|
-
export interface SignatureVerificationOptions {
|
|
6
|
-
/**
|
|
7
|
-
* The secret key used to verify webhook signatures.
|
|
8
|
-
* Should match the secret used by the sender to create the signature.
|
|
9
|
-
*/
|
|
10
|
-
secret: string;
|
|
11
|
-
/**
|
|
12
|
-
* The name of the header containing the signature.
|
|
13
|
-
* Defaults to 'x-agentmark-signature-256'
|
|
14
|
-
*/
|
|
15
|
-
headerName?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Whether to skip verification (useful for local development).
|
|
18
|
-
* Defaults to false.
|
|
19
|
-
*/
|
|
20
|
-
skipVerification?: boolean;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Verifies the webhook signature from the request.
|
|
24
|
-
*
|
|
25
|
-
* @param body - The request body as a string
|
|
26
|
-
* @param signature - The signature from the request header
|
|
27
|
-
* @param secret - The webhook secret
|
|
28
|
-
* @returns True if signature is valid, false otherwise
|
|
29
|
-
*/
|
|
30
|
-
export declare function verifyWebhookSignature(body: string, signature: string, secret: string): Promise<boolean>;
|
|
31
|
-
/**
|
|
32
|
-
* Checks if signature verification should be enforced based on environment.
|
|
33
|
-
*
|
|
34
|
-
* @param options - Signature verification options
|
|
35
|
-
* @returns True if verification should be skipped
|
|
36
|
-
*/
|
|
37
|
-
export declare function shouldSkipVerification(options: SignatureVerificationOptions): boolean;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Webhook signature verification middleware for securing webhook endpoints.
|
|
4
|
-
* Uses HMAC-SHA256 signatures to verify requests are from trusted sources.
|
|
5
|
-
*/
|
|
6
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
7
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
8
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
9
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
10
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
11
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
12
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.verifyWebhookSignature = verifyWebhookSignature;
|
|
17
|
-
exports.shouldSkipVerification = shouldSkipVerification;
|
|
18
|
-
const shared_utils_1 = require("@agentmark-ai/shared-utils");
|
|
19
|
-
/**
|
|
20
|
-
* Verifies the webhook signature from the request.
|
|
21
|
-
*
|
|
22
|
-
* @param body - The request body as a string
|
|
23
|
-
* @param signature - The signature from the request header
|
|
24
|
-
* @param secret - The webhook secret
|
|
25
|
-
* @returns True if signature is valid, false otherwise
|
|
26
|
-
*/
|
|
27
|
-
function verifyWebhookSignature(body, signature, secret) {
|
|
28
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
try {
|
|
30
|
-
return yield (0, shared_utils_1.verifySignature)(secret, signature, body);
|
|
31
|
-
}
|
|
32
|
-
catch (error) {
|
|
33
|
-
console.error('Signature verification error:', error);
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Checks if signature verification should be enforced based on environment.
|
|
40
|
-
*
|
|
41
|
-
* @param options - Signature verification options
|
|
42
|
-
* @returns True if verification should be skipped
|
|
43
|
-
*/
|
|
44
|
-
function shouldSkipVerification(options) {
|
|
45
|
-
// Skip if explicitly disabled
|
|
46
|
-
if (options.skipVerification) {
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
// Skip if no secret is provided (local dev without secret)
|
|
50
|
-
if (!options.secret || options.secret === 'DEFAULT') {
|
|
51
|
-
return true;
|
|
52
|
-
}
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=signature-verification.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"signature-verification.js","sourceRoot":"","sources":["../../../cli-src/runner-server/middleware/signature-verification.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;AAgCH,wDAWC;AAQD,wDAYC;AA7DD,6DAA6D;AAsB7D;;;;;;;GAOG;AACH,SAAsB,sBAAsB,CAC1C,IAAY,EACZ,SAAiB,EACjB,MAAc;;QAEd,IAAI,CAAC;YACH,OAAO,MAAM,IAAA,8BAAe,EAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;QACxD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAAC;YACtD,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CAAA;AAED;;;;;GAKG;AACH,SAAgB,sBAAsB,CAAC,OAAqC;IAC1E,8BAA8B;IAC9B,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,2DAA2D;IAC3D,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QACpD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/tunnel.d.ts
DELETED
package/dist/tunnel.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Tunnel management for exposing local development servers publicly.
|
|
4
|
-
* Uses cloudflared for reliable, no-auth public access via trycloudflare.com.
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.createTunnel = void 0;
|
|
8
|
-
// Re-export from cloudflared module for backward compatibility
|
|
9
|
-
var cloudflared_1 = require("./cloudflared");
|
|
10
|
-
Object.defineProperty(exports, "createTunnel", { enumerable: true, get: function () { return cloudflared_1.createTunnel; } });
|
|
11
|
-
//# sourceMappingURL=tunnel.js.map
|
package/dist/tunnel.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tunnel.js","sourceRoot":"","sources":["../cli-src/tunnel.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA+D;AAC/D,6CAA6C;AAApC,2GAAA,YAAY,OAAA"}
|
/package/dist/.next/static/{p7ZqHwMUDueov4RV9Be-X → 2NZm040KzCzDPOX6MqoKG}/_buildManifest.js
RENAMED
|
File without changes
|
|
File without changes
|