mcp-scraper 0.27.0 → 0.28.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 +1 -1
- package/dist/bin/api-server.cjs +211 -14
- package/dist/bin/api-server.cjs.map +1 -1
- package/dist/bin/api-server.js +1 -1
- package/dist/bin/mcp-scraper-cli.cjs +1 -1
- package/dist/bin/mcp-scraper-cli.cjs.map +1 -1
- package/dist/bin/mcp-scraper-cli.js +1 -1
- package/dist/bin/mcp-scraper-install.cjs +2 -2
- package/dist/bin/mcp-scraper-install.cjs.map +1 -1
- package/dist/bin/mcp-scraper-install.js +2 -2
- package/dist/bin/mcp-stdio-server.cjs +41 -2
- package/dist/bin/mcp-stdio-server.cjs.map +1 -1
- package/dist/bin/mcp-stdio-server.js +3 -3
- package/dist/{chunk-TBRX7VOP.js → chunk-DUS4ENOY.js} +2 -2
- package/dist/{chunk-TBRX7VOP.js.map → chunk-DUS4ENOY.js.map} +1 -1
- package/dist/{chunk-RPR5LDLS.js → chunk-LTT7QX3C.js} +41 -2
- package/dist/{chunk-RPR5LDLS.js.map → chunk-LTT7QX3C.js.map} +1 -1
- package/dist/chunk-QG77M3YJ.js +7 -0
- package/dist/chunk-QG77M3YJ.js.map +1 -0
- package/dist/{server-YXVSZ3T7.js → server-AKAWZICJ.js} +159 -9
- package/dist/server-AKAWZICJ.js.map +1 -0
- package/docs/mcp-tool-manifest.generated.json +93 -3
- package/package.json +2 -2
- package/dist/chunk-O6KFDDRM.js +0 -7
- package/dist/chunk-O6KFDDRM.js.map +0 -1
- package/dist/server-YXVSZ3T7.js.map +0 -1
package/README.md
CHANGED
|
@@ -227,7 +227,7 @@ The `mcp-scraper` server (and the MCPB bundle, which runs it) exposes both secti
|
|
|
227
227
|
|
|
228
228
|
All MCP tools expose output schemas and return `structuredContent` with the IDs, URLs, CSV paths, transcripts, browser session handles, replay paths, artifacts, recipe fields, or blueprint fields needed by the next step. Browser Agent tools keep a JSON text block for older clients, but structured data is the primary contract. All tools carry MCP annotations; file-writing tools such as replay downloads and annotations state their filesystem side effects.
|
|
229
229
|
|
|
230
|
-
The canonical tool inventory is generated at `docs/mcp-tool-manifest.generated.json`. Both the `mcp-scraper` stdio server and the hosted endpoint at `https://mcpscraper.dev/mcp` expose the same
|
|
230
|
+
The canonical tool inventory is generated at `docs/mcp-tool-manifest.generated.json`. Both the `mcp-scraper` stdio server and the hosted endpoint at `https://mcpscraper.dev/mcp` expose the same 165 tools: 76 scraper, browser, workflow, billing, and connected-service tools plus 89 durable-memory tools. Release verification compares the exact local and remote tool-name sets, not only the count.
|
|
231
231
|
|
|
232
232
|
For contract parity, stdio and MCPB memory calls invoke the matching public tool on the hosted MCP Scraper `/mcp` endpoint. The hosted aggregate runtime owns MCP Scraper-specific billing, scheduling, credential, and in-process cutover policy; its internal `/memory/mcp-call` bridge is a fallback to the standalone memory service, not the public stdio execution path. Direct `mcp-memory` OAuth and stdio clients continue to use `memory.mcpscraper.dev` and must be verified as a separate dependent release surface.
|
|
233
233
|
|
package/dist/bin/api-server.cjs
CHANGED
|
@@ -29723,7 +29723,7 @@ var PACKAGE_VERSION;
|
|
|
29723
29723
|
var init_version = __esm({
|
|
29724
29724
|
"src/version.ts"() {
|
|
29725
29725
|
"use strict";
|
|
29726
|
-
PACKAGE_VERSION = "0.
|
|
29726
|
+
PACKAGE_VERSION = "0.28.0";
|
|
29727
29727
|
}
|
|
29728
29728
|
});
|
|
29729
29729
|
|
|
@@ -34370,7 +34370,7 @@ var init_browser_agent_mcp_server = __esm({
|
|
|
34370
34370
|
});
|
|
34371
34371
|
|
|
34372
34372
|
// src/mcp/memory-tool-schemas.ts
|
|
34373
|
-
var import_zod37, AcceptShareSchema, ApproveSenderSchema, DeclineShareSchema, GetChatLinkSchema, InboxSettingsSchema, InviteAccountSchema, issueKeyTool_scopeShape, IssueKeySchema, ListApprovedSendersSchema, ListKeysSchema, NoteInboxSchema, RemoveApprovedSenderSchema, RevokeChatLinkSchema, RevokeKeySchema, RevokeShareSchema, SetAgentIdentitySchema, SetScopeSchema, ShareNoteSchema, ShareVaultSchema, SwapVaultSchema, SwitchAccountSchema, UnlinkShareSchema, memoryCaptureTool_notePropsSchema, MemoryCaptureSchema, MemoryQuestionsSchema, PrepareMemoryWriteSchema, validateMemoryWriteTool_notePropsSchema, ValidateMemoryWriteSchema, CreateChannelSchema, GetMessageNoteSchema, ListChannelMembersSchema, ListChannelMessagesSchema, MyMentionsSchema, PollChannelSchema, PostMessageSchema, ReactMessageSchema, RemoveChannelMemberSchema, ReplyMessageSchema, factHistoryTool_entryShape, FactHistorySchema, recordFactTool_factShape, RecordFactSchema, NoteBacklinksSchema, GraphPathSchema, GraphUniverseSchema, LibraryIngestSchema, bulkDeleteNotesTool_FilterSchema, BulkDeleteNotesSchema, DeleteNoteSchema, ExportSchema, getTool_notePropsSchema, GetSchema, ListSchema, putTool_notePropsSchema, PutSchema, searchTool_primitiveValue, SearchSchema, SuggestSchema, UploadSchema, TemporalRecallSchema, CreateScheduledActionSchema, DeleteScheduledActionSchema, GetScheduleLinkSchema, GetScheduleStatusSchema, ListScheduledActionsSchema, PauseScheduledActionSchema, ProposeScheduledActionSchema, ResumeScheduledActionSchema, RevokeScheduleLinkSchema, SetScheduleDefaultsSchema, SetScheduleEntitlementSchema, CostUsageSchema, StorageUsageSchema, CreateTableSchema, deleteTableRowsTool_FilterSchema, DeleteTableRowsSchema, DescribeTableSchema, DropTableSchema, InsertTableRowsSchema, ListTablesSchema, queryTableTool_FilterSchema, QueryTableSchema, ListTagsSchema, ResolveTagsSchema, UpsertTagSchema, AddVaultSchema, CreateSecureVaultSchema, DeleteVaultSchema, GetVaultContractSchema, ListSharedWithMeSchema, ListVaultsSchema, ProvisionDefaultsSchema, RouteMemorySchema, VideoAnalyzeStartSchema, VideoAnalyzeStatusSchema, CreateWebhookSchema, ListWebhooksSchema, RevokeWebhookSchema, MEMORY_TOOL_SCHEMAS;
|
|
34373
|
+
var import_zod37, AcceptShareSchema, ApproveSenderSchema, DeclineShareSchema, GetChatLinkSchema, GetVaultAppLinkSchema, InboxSettingsSchema, InviteAccountSchema, issueKeyTool_scopeShape, IssueKeySchema, ListApprovedSendersSchema, ListKeysSchema, NoteInboxSchema, RemoveApprovedSenderSchema, RevokeChatLinkSchema, RevokeKeySchema, RevokeShareSchema, RevokeVaultAppLinkSchema, SetAgentIdentitySchema, SetScopeSchema, ShareNoteSchema, ShareVaultSchema, SwapVaultSchema, SwitchAccountSchema, UnlinkShareSchema, memoryCaptureTool_notePropsSchema, MemoryCaptureSchema, MemoryQuestionsSchema, PrepareMemoryWriteSchema, validateMemoryWriteTool_notePropsSchema, ValidateMemoryWriteSchema, CreateChannelSchema, GetMessageNoteSchema, ListChannelMembersSchema, ListChannelMessagesSchema, MyMentionsSchema, PollChannelSchema, PostMessageSchema, ReactMessageSchema, RemoveChannelMemberSchema, ReplyMessageSchema, factHistoryTool_entryShape, FactHistorySchema, recordFactTool_factShape, RecordFactSchema, NoteBacklinksSchema, GraphPathSchema, GraphUniverseSchema, LibraryIngestSchema, bulkDeleteNotesTool_FilterSchema, BulkDeleteNotesSchema, DeleteNoteSchema, ExportSchema, getTool_notePropsSchema, GetSchema, ListSchema, putTool_notePropsSchema, PutSchema, searchTool_primitiveValue, SearchSchema, SuggestSchema, UploadSchema, TemporalRecallSchema, CreateScheduledActionSchema, DeleteScheduledActionSchema, GetScheduleLinkSchema, GetScheduleStatusSchema, ListScheduledActionsSchema, PauseScheduledActionSchema, ProposeScheduledActionSchema, ResumeScheduledActionSchema, RevokeScheduleLinkSchema, SetScheduleDefaultsSchema, SetScheduleEntitlementSchema, CostUsageSchema, StorageUsageSchema, CreateTableSchema, deleteTableRowsTool_FilterSchema, DeleteTableRowsSchema, DescribeTableSchema, DropTableSchema, InsertTableRowsSchema, ListTablesSchema, queryTableTool_FilterSchema, QueryTableSchema, ListTagsSchema, ResolveTagsSchema, UpsertTagSchema, AddVaultSchema, CreateSecureVaultSchema, DeleteVaultSchema, GetVaultContractSchema, ListSharedWithMeSchema, ListVaultsSchema, ProvisionDefaultsSchema, RouteMemorySchema, VideoAnalyzeStartSchema, VideoAnalyzeStatusSchema, CreateWebhookSchema, ListWebhooksSchema, RevokeWebhookSchema, MEMORY_TOOL_SCHEMAS;
|
|
34374
34374
|
var init_memory_tool_schemas = __esm({
|
|
34375
34375
|
"src/mcp/memory-tool-schemas.ts"() {
|
|
34376
34376
|
"use strict";
|
|
@@ -34455,6 +34455,25 @@ var init_memory_tool_schemas = __esm({
|
|
|
34455
34455
|
openWorldHint: false
|
|
34456
34456
|
}
|
|
34457
34457
|
};
|
|
34458
|
+
GetVaultAppLinkSchema = {
|
|
34459
|
+
id: "get-vault-app-link",
|
|
34460
|
+
upstreamName: "getVaultAppLinkTool",
|
|
34461
|
+
description: "Get the durable, bookmarkable link to the mobile-first Vault App for People, Projects, and Tasks. The embedded secret is shown only once; revoke-vault-app-link then call this tool again to replace a link that was shared or leaked. This link is independent from Omni-Chat. Anyone holding it can use the Vault App as this identity.",
|
|
34462
|
+
input: {},
|
|
34463
|
+
output: {
|
|
34464
|
+
ok: import_zod37.z.boolean().describe("True when the request succeeded."),
|
|
34465
|
+
url: import_zod37.z.string().optional().describe("Vault App link. Present only when the secret is first minted; anyone holding it can use the Vault App as this identity."),
|
|
34466
|
+
alreadyExists: import_zod37.z.boolean().optional().describe("True when an active Vault App link exists but its secret cannot be shown again."),
|
|
34467
|
+
error: import_zod37.z.string().optional().describe("Human-readable error when the request cannot be completed.")
|
|
34468
|
+
},
|
|
34469
|
+
annotations: {
|
|
34470
|
+
title: "Get Vault App Link",
|
|
34471
|
+
readOnlyHint: false,
|
|
34472
|
+
destructiveHint: false,
|
|
34473
|
+
idempotentHint: false,
|
|
34474
|
+
openWorldHint: false
|
|
34475
|
+
}
|
|
34476
|
+
};
|
|
34458
34477
|
InboxSettingsSchema = {
|
|
34459
34478
|
id: "access-inbox-settings",
|
|
34460
34479
|
upstreamName: "inboxSettingsTool",
|
|
@@ -34703,6 +34722,24 @@ var init_memory_tool_schemas = __esm({
|
|
|
34703
34722
|
openWorldHint: false
|
|
34704
34723
|
}
|
|
34705
34724
|
};
|
|
34725
|
+
RevokeVaultAppLinkSchema = {
|
|
34726
|
+
id: "revoke-vault-app-link",
|
|
34727
|
+
upstreamName: "revokeVaultAppLinkTool",
|
|
34728
|
+
description: "Immediately revoke the current Vault App link without touching the separate Omni-Chat link. Call get-vault-app-link afterward to mint a replacement.",
|
|
34729
|
+
input: {},
|
|
34730
|
+
output: {
|
|
34731
|
+
ok: import_zod37.z.boolean().describe("True when the request succeeded."),
|
|
34732
|
+
revoked: import_zod37.z.boolean().optional().describe("True when an active Vault App link was revoked."),
|
|
34733
|
+
error: import_zod37.z.string().optional().describe("Human-readable error when the request cannot be completed.")
|
|
34734
|
+
},
|
|
34735
|
+
annotations: {
|
|
34736
|
+
title: "Revoke Vault App Link",
|
|
34737
|
+
readOnlyHint: false,
|
|
34738
|
+
destructiveHint: false,
|
|
34739
|
+
idempotentHint: true,
|
|
34740
|
+
openWorldHint: false
|
|
34741
|
+
}
|
|
34742
|
+
};
|
|
34706
34743
|
SetAgentIdentitySchema = {
|
|
34707
34744
|
id: "set-agent-identity",
|
|
34708
34745
|
upstreamName: "setAgentIdentityTool",
|
|
@@ -36678,6 +36715,7 @@ var init_memory_tool_schemas = __esm({
|
|
|
36678
36715
|
ApproveSenderSchema,
|
|
36679
36716
|
DeclineShareSchema,
|
|
36680
36717
|
GetChatLinkSchema,
|
|
36718
|
+
GetVaultAppLinkSchema,
|
|
36681
36719
|
InboxSettingsSchema,
|
|
36682
36720
|
InviteAccountSchema,
|
|
36683
36721
|
IssueKeySchema,
|
|
@@ -36688,6 +36726,7 @@ var init_memory_tool_schemas = __esm({
|
|
|
36688
36726
|
RevokeChatLinkSchema,
|
|
36689
36727
|
RevokeKeySchema,
|
|
36690
36728
|
RevokeShareSchema,
|
|
36729
|
+
RevokeVaultAppLinkSchema,
|
|
36691
36730
|
SetAgentIdentitySchema,
|
|
36692
36731
|
SetScopeSchema,
|
|
36693
36732
|
ShareNoteSchema,
|
|
@@ -37290,6 +37329,14 @@ function registerBillingCutovers() {
|
|
|
37290
37329
|
const result = await import_revoke_chat_link.revokeChatLinkTool.execute({ ...input, apiKey }, {});
|
|
37291
37330
|
return { content: [{ type: "text", text: JSON.stringify(result ?? {}) }], structuredContent: result ?? {}, isError: false };
|
|
37292
37331
|
});
|
|
37332
|
+
registerCutover("getVaultAppLinkTool", async (input, apiKey) => {
|
|
37333
|
+
const result = await import_get_vault_app_link.getVaultAppLinkTool.execute({ ...input, apiKey }, {});
|
|
37334
|
+
return { content: [{ type: "text", text: JSON.stringify(result ?? {}) }], structuredContent: result ?? {}, isError: false };
|
|
37335
|
+
});
|
|
37336
|
+
registerCutover("revokeVaultAppLinkTool", async (input, apiKey) => {
|
|
37337
|
+
const result = await import_revoke_vault_app_link.revokeVaultAppLinkTool.execute({ ...input, apiKey }, {});
|
|
37338
|
+
return { content: [{ type: "text", text: JSON.stringify(result ?? {}) }], structuredContent: result ?? {}, isError: false };
|
|
37339
|
+
});
|
|
37293
37340
|
registerCutover("provisionDefaultsTool", async (input, apiKey) => {
|
|
37294
37341
|
const result = await import_provision_defaults2.provisionDefaultsTool.execute({ ...input, apiKey }, {});
|
|
37295
37342
|
return { content: [{ type: "text", text: JSON.stringify(result ?? {}) }], structuredContent: result ?? {}, isError: false };
|
|
@@ -37327,7 +37374,7 @@ function registerBillingCutovers() {
|
|
|
37327
37374
|
return { content: [{ type: "text", text: JSON.stringify(result ?? {}) }], structuredContent: result ?? {}, isError: false };
|
|
37328
37375
|
});
|
|
37329
37376
|
}
|
|
37330
|
-
var import_issue_key, import_list_keys, import_revoke_key, import_set_scope, import_invite_account, import_get_chat_link, import_revoke_chat_link, import_provision_defaults2, import_create_secure_vault, import_create_scheduled_action, import_get_schedule_status, import_get_schedule_link, import_revoke_schedule_link, import_set_schedule_entitlement2, import_create_webhook, import_revoke_webhook, registered3;
|
|
37377
|
+
var import_issue_key, import_list_keys, import_revoke_key, import_set_scope, import_invite_account, import_get_chat_link, import_revoke_chat_link, import_get_vault_app_link, import_revoke_vault_app_link, import_provision_defaults2, import_create_secure_vault, import_create_scheduled_action, import_get_schedule_status, import_get_schedule_link, import_revoke_schedule_link, import_set_schedule_entitlement2, import_create_webhook, import_revoke_webhook, registered3;
|
|
37331
37378
|
var init_billing = __esm({
|
|
37332
37379
|
"src/mcp/memory-cutover/billing.ts"() {
|
|
37333
37380
|
"use strict";
|
|
@@ -37339,6 +37386,8 @@ var init_billing = __esm({
|
|
|
37339
37386
|
import_invite_account = require("mcpscraper-memory-tools/tools/access/invite-account");
|
|
37340
37387
|
import_get_chat_link = require("mcpscraper-memory-tools/tools/access/get-chat-link");
|
|
37341
37388
|
import_revoke_chat_link = require("mcpscraper-memory-tools/tools/access/revoke-chat-link");
|
|
37389
|
+
import_get_vault_app_link = require("mcpscraper-memory-tools/tools/access/get-vault-app-link");
|
|
37390
|
+
import_revoke_vault_app_link = require("mcpscraper-memory-tools/tools/access/revoke-vault-app-link");
|
|
37342
37391
|
import_provision_defaults2 = require("mcpscraper-memory-tools/tools/vaults/provision-defaults");
|
|
37343
37392
|
import_create_secure_vault = require("mcpscraper-memory-tools/tools/vaults/create-secure-vault");
|
|
37344
37393
|
import_create_scheduled_action = require("mcpscraper-memory-tools/tools/schedule/create-scheduled-action");
|
|
@@ -41124,6 +41173,152 @@ var init_chat_routes = __esm({
|
|
|
41124
41173
|
}
|
|
41125
41174
|
});
|
|
41126
41175
|
|
|
41176
|
+
// src/api/vault-routes.ts
|
|
41177
|
+
function validToken(token) {
|
|
41178
|
+
return !!token && token.startsWith("mk_") && token.length > 20 && token.length < 256;
|
|
41179
|
+
}
|
|
41180
|
+
function isVault(value) {
|
|
41181
|
+
return typeof value === "string" && VAULTS.includes(value);
|
|
41182
|
+
}
|
|
41183
|
+
function stringValue(value, max = 1e4) {
|
|
41184
|
+
if (typeof value !== "string") return null;
|
|
41185
|
+
const trimmed = value.trim();
|
|
41186
|
+
return trimmed && trimmed.length <= max ? trimmed : null;
|
|
41187
|
+
}
|
|
41188
|
+
function propsValue(value) {
|
|
41189
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
41190
|
+
const entries = Object.entries(value);
|
|
41191
|
+
if (entries.length > 80) return null;
|
|
41192
|
+
return Object.fromEntries(entries.filter(([key]) => key.length <= 96));
|
|
41193
|
+
}
|
|
41194
|
+
function cors(c) {
|
|
41195
|
+
const origin = c.req.header("origin");
|
|
41196
|
+
const configured = (process.env.VAULT_APP_ALLOWED_ORIGINS ?? "https://mcpscraper.dev").split(",").map((value) => value.trim()).filter(Boolean);
|
|
41197
|
+
const local = !!origin && /^http:\/\/localhost(?::\d+)?$/.test(origin);
|
|
41198
|
+
if (origin && (configured.includes(origin) || local)) c.header("Access-Control-Allow-Origin", origin);
|
|
41199
|
+
c.header("Vary", "Origin");
|
|
41200
|
+
c.header("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
|
|
41201
|
+
c.header("Access-Control-Allow-Headers", "content-type");
|
|
41202
|
+
}
|
|
41203
|
+
function workspaceRecord(vault, note) {
|
|
41204
|
+
const props = note.props ?? {};
|
|
41205
|
+
return {
|
|
41206
|
+
id: `${vault}:${note.path}`,
|
|
41207
|
+
vault,
|
|
41208
|
+
path: note.path,
|
|
41209
|
+
title: note.title,
|
|
41210
|
+
content: note.content,
|
|
41211
|
+
type: typeof props.type === "string" ? props.type : defaultType(vault),
|
|
41212
|
+
status: typeof props.status === "string" ? props.status : defaultStatus(vault),
|
|
41213
|
+
props,
|
|
41214
|
+
revision: note.revision,
|
|
41215
|
+
updatedAt: note.updatedAt,
|
|
41216
|
+
capturedAt: note.capturedAt
|
|
41217
|
+
};
|
|
41218
|
+
}
|
|
41219
|
+
function defaultType(vault) {
|
|
41220
|
+
if (vault === "People") return "person";
|
|
41221
|
+
if (vault === "Projects") return "project";
|
|
41222
|
+
if (vault === "Tasks") return "task";
|
|
41223
|
+
return "activity";
|
|
41224
|
+
}
|
|
41225
|
+
function defaultStatus(vault) {
|
|
41226
|
+
if (vault === "People") return "active";
|
|
41227
|
+
if (vault === "Projects") return "active";
|
|
41228
|
+
if (vault === "Tasks") return "to_do";
|
|
41229
|
+
return "triaged";
|
|
41230
|
+
}
|
|
41231
|
+
async function readVault(vault, token) {
|
|
41232
|
+
const list = await memoryCall("listTool", { vault }, token);
|
|
41233
|
+
if (!list.ok) throw new Error(list.error ?? `unable to read ${vault}`);
|
|
41234
|
+
const noteRefs = (list.notes ?? []).slice(0, 200);
|
|
41235
|
+
const notes = await Promise.all(
|
|
41236
|
+
noteRefs.map(async ({ path: path6 }) => memoryCall("getTool", { vault, path: path6 }, token))
|
|
41237
|
+
);
|
|
41238
|
+
return notes.filter((result) => result.ok && !!result.note).map((result) => workspaceRecord(vault, result.note));
|
|
41239
|
+
}
|
|
41240
|
+
var import_hono22, VAULTS, vaultApp;
|
|
41241
|
+
var init_vault_routes = __esm({
|
|
41242
|
+
"src/api/vault-routes.ts"() {
|
|
41243
|
+
"use strict";
|
|
41244
|
+
import_hono22 = require("hono");
|
|
41245
|
+
init_memory();
|
|
41246
|
+
VAULTS = ["People", "Projects", "Tasks", "Communications"];
|
|
41247
|
+
vaultApp = new import_hono22.Hono();
|
|
41248
|
+
vaultApp.use("/api/*", async (c, next) => {
|
|
41249
|
+
cors(c);
|
|
41250
|
+
if (c.req.method === "OPTIONS") return c.body(null, 204);
|
|
41251
|
+
await next();
|
|
41252
|
+
});
|
|
41253
|
+
vaultApp.get("/api/workspace", async (c) => {
|
|
41254
|
+
const token = c.req.query("token");
|
|
41255
|
+
if (!validToken(token)) return c.json({ ok: false, error: "missing or malformed Vault App link" }, 401);
|
|
41256
|
+
try {
|
|
41257
|
+
const requested = c.req.query("vault");
|
|
41258
|
+
const vaults = isVault(requested) ? [requested] : VAULTS;
|
|
41259
|
+
const results = await Promise.all(vaults.map((vault) => readVault(vault, token)));
|
|
41260
|
+
const records = results.flat().sort((a, b) => b.updatedAt.localeCompare(a.updatedAt));
|
|
41261
|
+
return c.json({ ok: true, records, limited: results.some((result) => result.length >= 200) });
|
|
41262
|
+
} catch (error) {
|
|
41263
|
+
return c.json({ ok: false, error: error instanceof Error ? error.message : "unable to load vault workspace" }, 502);
|
|
41264
|
+
}
|
|
41265
|
+
});
|
|
41266
|
+
vaultApp.post("/api/records", async (c) => {
|
|
41267
|
+
const body = await c.req.json().catch(() => ({}));
|
|
41268
|
+
const token = typeof body.token === "string" ? body.token : void 0;
|
|
41269
|
+
if (!validToken(token)) return c.json({ ok: false, error: "missing or malformed Vault App link" }, 401);
|
|
41270
|
+
const vault = body.vault;
|
|
41271
|
+
const path6 = stringValue(body.path, 320);
|
|
41272
|
+
const title = stringValue(body.title, 320);
|
|
41273
|
+
const content = typeof body.content === "string" && body.content.length <= 1e5 ? body.content : "";
|
|
41274
|
+
const props = propsValue(body.props) ?? {};
|
|
41275
|
+
if (!isVault(vault) || !path6 || !title) return c.json({ ok: false, error: "vault, path, and title are required" }, 400);
|
|
41276
|
+
const baseRevision = typeof body.baseRevision === "number" && Number.isInteger(body.baseRevision) ? body.baseRevision : void 0;
|
|
41277
|
+
const result = await memoryCall("putTool", { vault, path: path6, title, content: content || title, props, ...baseRevision === void 0 ? {} : { baseRevision } }, token);
|
|
41278
|
+
return c.json(result, result.ok ? 200 : result.conflict ? 409 : 502);
|
|
41279
|
+
});
|
|
41280
|
+
vaultApp.post("/api/records/transition", async (c) => {
|
|
41281
|
+
const body = await c.req.json().catch(() => ({}));
|
|
41282
|
+
const token = typeof body.token === "string" ? body.token : void 0;
|
|
41283
|
+
if (!validToken(token)) return c.json({ ok: false, error: "missing or malformed Vault App link" }, 401);
|
|
41284
|
+
const vault = typeof body.vault === "string" ? body.vault : "";
|
|
41285
|
+
const path6 = typeof body.path === "string" ? body.path : "";
|
|
41286
|
+
const status = stringValue(body.status, 80);
|
|
41287
|
+
const baseRevision = typeof body.baseRevision === "number" && Number.isInteger(body.baseRevision) ? body.baseRevision : void 0;
|
|
41288
|
+
if (!isVault(vault) || !path6 || !status) return c.json({ ok: false, error: "valid vault, path, and status are required" }, 400);
|
|
41289
|
+
const current = await memoryCall("getTool", { vault, path: path6 }, token);
|
|
41290
|
+
if (!current.ok || !current.note) return c.json(current, current.ok ? 404 : 502);
|
|
41291
|
+
const result = await memoryCall("putTool", {
|
|
41292
|
+
vault,
|
|
41293
|
+
path: path6,
|
|
41294
|
+
title: current.note.title,
|
|
41295
|
+
content: current.note.content,
|
|
41296
|
+
props: { ...current.note.props ?? {}, status },
|
|
41297
|
+
baseRevision: baseRevision ?? current.note.revision
|
|
41298
|
+
}, token);
|
|
41299
|
+
return c.json(result, result.ok ? 200 : result.conflict ? 409 : 502);
|
|
41300
|
+
});
|
|
41301
|
+
vaultApp.post("/api/activity", async (c) => {
|
|
41302
|
+
const body = await c.req.json().catch(() => ({}));
|
|
41303
|
+
const token = typeof body.token === "string" ? body.token : void 0;
|
|
41304
|
+
if (!validToken(token)) return c.json({ ok: false, error: "missing or malformed Vault App link" }, 401);
|
|
41305
|
+
const title = stringValue(body.title, 320);
|
|
41306
|
+
const content = typeof body.content === "string" && body.content.length <= 2e4 ? body.content : "";
|
|
41307
|
+
const props = propsValue(body.props) ?? {};
|
|
41308
|
+
if (!title) return c.json({ ok: false, error: "title is required" }, 400);
|
|
41309
|
+
const stamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
41310
|
+
const result = await memoryCall("putTool", {
|
|
41311
|
+
vault: "Communications",
|
|
41312
|
+
path: `Inbox/activity-${stamp}`,
|
|
41313
|
+
title,
|
|
41314
|
+
content: content || title,
|
|
41315
|
+
props: { status: "triaged", type: "decision", occurred_at: (/* @__PURE__ */ new Date()).toISOString(), ...props }
|
|
41316
|
+
}, token);
|
|
41317
|
+
return c.json(result, result.ok ? 200 : 502);
|
|
41318
|
+
});
|
|
41319
|
+
}
|
|
41320
|
+
});
|
|
41321
|
+
|
|
41127
41322
|
// src/api/schedule-routes.ts
|
|
41128
41323
|
function tokenOk2(token) {
|
|
41129
41324
|
return !!token && token.startsWith("mk_") && token.length > 10;
|
|
@@ -41394,13 +41589,13 @@ loadActions();
|
|
|
41394
41589
|
</body>
|
|
41395
41590
|
</html>`;
|
|
41396
41591
|
}
|
|
41397
|
-
var
|
|
41592
|
+
var import_hono23, scheduleApp;
|
|
41398
41593
|
var init_schedule_routes = __esm({
|
|
41399
41594
|
"src/api/schedule-routes.ts"() {
|
|
41400
41595
|
"use strict";
|
|
41401
|
-
|
|
41596
|
+
import_hono23 = require("hono");
|
|
41402
41597
|
init_memory();
|
|
41403
|
-
scheduleApp = new
|
|
41598
|
+
scheduleApp = new import_hono23.Hono();
|
|
41404
41599
|
scheduleApp.get("/api/status", async (c) => {
|
|
41405
41600
|
const token = c.req.query("token");
|
|
41406
41601
|
if (!tokenOk2(token)) return jsonError2("missing or malformed token", 401);
|
|
@@ -41635,17 +41830,17 @@ async function forwardReceivedEmail(resend, email, destination, label) {
|
|
|
41635
41830
|
if (sent.error) throw new Error(`forward failed: ${sent.error.message}`);
|
|
41636
41831
|
return sent.data.id;
|
|
41637
41832
|
}
|
|
41638
|
-
var
|
|
41833
|
+
var import_hono24, import_resend, SUPPORT_ADDRESS, DMARC_ADDRESS, FORWARD_FROM, resendInboundApp;
|
|
41639
41834
|
var init_resend_inbound_routes = __esm({
|
|
41640
41835
|
"src/api/resend-inbound-routes.ts"() {
|
|
41641
41836
|
"use strict";
|
|
41642
|
-
|
|
41837
|
+
import_hono24 = require("hono");
|
|
41643
41838
|
import_resend = require("resend");
|
|
41644
41839
|
init_memory();
|
|
41645
41840
|
SUPPORT_ADDRESS = "support@mcpscraper.dev";
|
|
41646
41841
|
DMARC_ADDRESS = "dmarc@mcpscraper.dev";
|
|
41647
41842
|
FORWARD_FROM = "MCP Scraper Support <support@updates.mcpscraper.dev>";
|
|
41648
|
-
resendInboundApp = new
|
|
41843
|
+
resendInboundApp = new import_hono24.Hono();
|
|
41649
41844
|
resendInboundApp.post("/webhooks", async (c) => {
|
|
41650
41845
|
const apiKey = process.env.RESEND_API_KEY?.trim();
|
|
41651
41846
|
const webhookSecret = process.env.RESEND_WEBHOOK_SECRET?.trim();
|
|
@@ -45701,7 +45896,7 @@ async function checkHarvestLimits(user, reuseLockId) {
|
|
|
45701
45896
|
}
|
|
45702
45897
|
return null;
|
|
45703
45898
|
}
|
|
45704
|
-
var import_resend2,
|
|
45899
|
+
var import_resend2, import_hono25, import_hono26, import_factory6, import_cookie2, import_stripe3, secureCookies2, isProduction2, sessionCookieOptions2, requireAllowedOrigin, auth2, adminAuth, sessionAuth, requireIntegrationsTier, requirePaidSchedulingTier, app, STRIPE_API_VERSION2, SYNC_HARVEST_TIMEOUT_OVERRIDE_MS;
|
|
45705
45900
|
var init_server = __esm({
|
|
45706
45901
|
"src/api/server.ts"() {
|
|
45707
45902
|
"use strict";
|
|
@@ -45719,8 +45914,8 @@ var init_server = __esm({
|
|
|
45719
45914
|
init_media_extractor();
|
|
45720
45915
|
init_site_mapper();
|
|
45721
45916
|
init_site_extractor();
|
|
45722
|
-
|
|
45723
|
-
|
|
45917
|
+
import_hono25 = require("hono");
|
|
45918
|
+
import_hono26 = require("inngest/hono");
|
|
45724
45919
|
init_client();
|
|
45725
45920
|
init_site_audit();
|
|
45726
45921
|
init_site_extract();
|
|
@@ -45751,6 +45946,7 @@ var init_server = __esm({
|
|
|
45751
45946
|
init_stripe_routes();
|
|
45752
45947
|
init_oauth_routes();
|
|
45753
45948
|
init_chat_routes();
|
|
45949
|
+
init_vault_routes();
|
|
45754
45950
|
init_schedule_routes();
|
|
45755
45951
|
init_resend_inbound_routes();
|
|
45756
45952
|
init_site_audit_worker();
|
|
@@ -45841,7 +46037,7 @@ var init_server = __esm({
|
|
|
45841
46037
|
if (!hasPaidSchedulingAccess(user)) return c.json(paidPlanRequiredPayload(), 403);
|
|
45842
46038
|
return next();
|
|
45843
46039
|
});
|
|
45844
|
-
app = new
|
|
46040
|
+
app = new import_hono25.Hono();
|
|
45845
46041
|
STRIPE_API_VERSION2 = "2026-02-25.clover";
|
|
45846
46042
|
app.use("*", async (c, next) => {
|
|
45847
46043
|
await next();
|
|
@@ -47869,7 +48065,7 @@ var init_server = __esm({
|
|
|
47869
48065
|
const bundle = stored.find((a) => a.key.endsWith("bundle.zip"));
|
|
47870
48066
|
return c.json({ ok: true, jobId, artifacts: stored.length, settlement, bundleUrl: bundle?.url ?? null, bundleBytes: bundle?.bytes ?? null });
|
|
47871
48067
|
});
|
|
47872
|
-
app.on(["GET", "POST", "PUT"], "/api/inngest", (0,
|
|
48068
|
+
app.on(["GET", "POST", "PUT"], "/api/inngest", (0, import_hono26.serve)({ client: inngest, functions: [siteAuditFn, siteExtractFn] }));
|
|
47873
48069
|
app.route("/api/internal/site-architecture-auditor", siteAuditApp);
|
|
47874
48070
|
app.route("/api/internal/memory", internalMemoryApp);
|
|
47875
48071
|
app.route("/api/internal/billing", internalBillingApp);
|
|
@@ -47889,6 +48085,7 @@ var init_server = __esm({
|
|
|
47889
48085
|
app.route("/mcp", mcpApp);
|
|
47890
48086
|
app.route("/agent", buildBrowserAgentRoutes());
|
|
47891
48087
|
app.route("/chat", chatApp);
|
|
48088
|
+
app.route("/vault", vaultApp);
|
|
47892
48089
|
app.route("/schedule", scheduleApp);
|
|
47893
48090
|
app.route("/resend", resendInboundApp);
|
|
47894
48091
|
app.get("/console", (c) => c.html(renderConsoleHtml()));
|