@koda-sl/baker-bridge 0.44.0-dev.62be5b016 → 0.44.2
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 +36 -24
- package/dist/cli.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/hono/agent-session.d.ts +3 -1
- package/dist/hono/agent-session.d.ts.map +1 -1
- package/dist/hono/agent-session.js +15 -0
- package/dist/hono/agent-session.js.map +1 -1
- package/dist/hono/agent.d.ts +4 -3
- package/dist/hono/agent.d.ts.map +1 -1
- package/dist/hono/agent.js +17 -15
- package/dist/hono/agent.js.map +1 -1
- package/dist/hono/agent.test.js +31 -1
- package/dist/hono/agent.test.js.map +1 -1
- package/dist/hono/bridge-job.d.ts +23 -1
- package/dist/hono/bridge-job.d.ts.map +1 -1
- package/dist/hono/bridge-job.js +66 -2
- package/dist/hono/bridge-job.js.map +1 -1
- package/dist/hono/bridge-job.test.js +36 -1
- package/dist/hono/bridge-job.test.js.map +1 -1
- package/dist/hono/callback.js +2 -2
- package/dist/hono/callback.js.map +1 -1
- package/dist/hono/convex.d.ts +2 -4
- package/dist/hono/convex.d.ts.map +1 -1
- package/dist/hono/convex.js +8 -6
- package/dist/hono/convex.js.map +1 -1
- package/dist/hono/plugins.d.ts +3 -0
- package/dist/hono/plugins.d.ts.map +1 -0
- package/dist/hono/plugins.js +7 -0
- package/dist/hono/plugins.js.map +1 -0
- package/dist/hono/plugins.test.d.ts +2 -0
- package/dist/hono/plugins.test.d.ts.map +1 -0
- package/dist/hono/plugins.test.js +98 -0
- package/dist/hono/plugins.test.js.map +1 -0
- package/dist/hono/relay.d.ts +7 -1
- package/dist/hono/relay.d.ts.map +1 -1
- package/dist/hono/relay.js +12 -1
- package/dist/hono/relay.js.map +1 -1
- package/dist/hono/relay.test.js +27 -0
- package/dist/hono/relay.test.js.map +1 -1
- package/dist/hono/runtime-files.d.ts +0 -1
- package/dist/hono/runtime-files.d.ts.map +1 -1
- package/dist/hono/runtime-files.js +0 -1
- package/dist/hono/runtime-files.js.map +1 -1
- package/dist/hono/sandbox-content.d.ts +0 -7
- package/dist/hono/sandbox-content.d.ts.map +1 -1
- package/dist/hono/sandbox-content.js +1 -80
- package/dist/hono/sandbox-content.js.map +1 -1
- package/dist/hono/sandbox-content.test.js +0 -24
- package/dist/hono/sandbox-content.test.js.map +1 -1
- package/dist/hono/server.d.ts.map +1 -1
- package/dist/hono/server.js +20 -23
- package/dist/hono/server.js.map +1 -1
- package/dist/hono/session-continuity.d.ts +9 -1
- package/dist/hono/session-continuity.d.ts.map +1 -1
- package/dist/hono/session-continuity.js +27 -0
- package/dist/hono/session-continuity.js.map +1 -1
- package/dist/hono/session-continuity.test.d.ts +2 -0
- package/dist/hono/session-continuity.test.d.ts.map +1 -0
- package/dist/hono/session-continuity.test.js +35 -0
- package/dist/hono/session-continuity.test.js.map +1 -0
- package/dist/hono/types.d.ts +11 -0
- package/dist/hono/types.d.ts.map +1 -1
- package/package.json +8 -6
- package/plugins/reports/.claude-plugin/plugin.json +7 -0
- package/plugins/reports/skills/build/SKILL.md +73 -0
- package/plugins/reports/skills/build/references/report-contracts.md +103 -0
- package/plugins/reports/skills/build/scripts/report-paths.mjs +19 -0
- package/plugins/reports/skills/build/scripts/scaffold-report.mjs +108 -0
- package/plugins/reports/skills/build/templates/report-definition.md +22 -0
- package/plugins/reports/skills/build/templates/report-index.html +20 -0
- package/dist/hono/memory-files.d.ts +0 -7
- package/dist/hono/memory-files.d.ts.map +0 -1
- package/dist/hono/memory-files.js +0 -29
- package/dist/hono/memory-files.js.map +0 -1
- package/dist/hono/memory-files.test.d.ts +0 -2
- package/dist/hono/memory-files.test.d.ts.map +0 -1
- package/dist/hono/memory-files.test.js +0 -28
- package/dist/hono/memory-files.test.js.map +0 -1
- package/dist/hono/memory-sync.d.ts +0 -2
- package/dist/hono/memory-sync.d.ts.map +0 -1
- package/dist/hono/memory-sync.js +0 -14
- package/dist/hono/memory-sync.js.map +0 -1
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join, resolve } from "node:path";
|
|
3
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
4
|
+
import { ReportFileContract } from "./report-paths.mjs";
|
|
5
|
+
|
|
6
|
+
function endpointTemplate() {
|
|
7
|
+
return `import { defineHandler } from "nitro";
|
|
8
|
+
import { runReportBaker } from "../../../utils/baker.ts";
|
|
9
|
+
|
|
10
|
+
export default defineHandler(async (event) => {
|
|
11
|
+
const start = Date.now();
|
|
12
|
+
|
|
13
|
+
// TODO: replace with the Baker command for this report.
|
|
14
|
+
// runReportBaker maps ?fresh=true to Baker --no-cache for commands that support it.
|
|
15
|
+
const result = await runReportBaker(event, ["TODO", "replace", "with", "baker", "args"]);
|
|
16
|
+
|
|
17
|
+
if (!result.ok) {
|
|
18
|
+
return { ok: false, error: result.error };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return {
|
|
22
|
+
ok: true,
|
|
23
|
+
data: result.data,
|
|
24
|
+
meta: {
|
|
25
|
+
durationMs: Date.now() - start,
|
|
26
|
+
cached: result.cached ?? false,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
});
|
|
30
|
+
`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const scriptDir = dirname(fileURLToPath(import.meta.url));
|
|
34
|
+
|
|
35
|
+
function readTemplate(name) {
|
|
36
|
+
return readFileSync(resolve(scriptDir, "..", "templates", name), "utf8");
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const TEMPLATE_TOKEN_RE = /__[A-Z0-9_]+__/g;
|
|
40
|
+
|
|
41
|
+
function renderTemplate(template, values) {
|
|
42
|
+
let rendered = template;
|
|
43
|
+
for (const [key, value] of Object.entries(values)) {
|
|
44
|
+
rendered = rendered.replaceAll(`__${key.toUpperCase()}__`, value);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const unresolved = rendered.match(TEMPLATE_TOKEN_RE);
|
|
48
|
+
if (unresolved) {
|
|
49
|
+
throw new Error(`Unresolved template token(s): ${[...new Set(unresolved)].join(", ")}`);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return rendered;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function pageTemplate(slug, title) {
|
|
56
|
+
return renderTemplate(readTemplate("report-index.html"), { slug, title });
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function definitionTemplate(slug, title, today = new Date().toISOString().slice(0, 10)) {
|
|
60
|
+
return renderTemplate(readTemplate("report-definition.md"), { slug, title, today });
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function createReportFiles(slug, projectRoot = process.cwd()) {
|
|
64
|
+
if (!ReportFileContract.isValidSlug(slug)) {
|
|
65
|
+
throw new Error(`Invalid slug "${slug}". Must match /^[a-z0-9]+(-[a-z0-9]+)*$/`);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const paths = ReportFileContract.paths(slug);
|
|
69
|
+
const pageDir = join(projectRoot, "reports", "public", slug);
|
|
70
|
+
const dashboardPath = join(pageDir, "index.html");
|
|
71
|
+
const endpointPath = resolve(projectRoot, paths.endpoint);
|
|
72
|
+
const definitionPath = resolve(projectRoot, paths.definition);
|
|
73
|
+
|
|
74
|
+
if (existsSync(pageDir)) {
|
|
75
|
+
throw new Error(`Dashboard page already exists: ${pageDir}`);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (existsSync(endpointPath)) {
|
|
79
|
+
throw new Error(`Endpoint already exists: ${endpointPath}`);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const title = ReportFileContract.titleFromSlug(slug);
|
|
83
|
+
|
|
84
|
+
mkdirSync(pageDir, { recursive: true });
|
|
85
|
+
mkdirSync(dirname(endpointPath), { recursive: true });
|
|
86
|
+
writeFileSync(dashboardPath, pageTemplate(slug, title));
|
|
87
|
+
writeFileSync(definitionPath, definitionTemplate(slug, title));
|
|
88
|
+
writeFileSync(endpointPath, endpointTemplate());
|
|
89
|
+
|
|
90
|
+
return { slug, files: [endpointPath, dashboardPath, definitionPath] };
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const isDirectRun = process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href;
|
|
94
|
+
if (isDirectRun) {
|
|
95
|
+
const slug = process.argv[2];
|
|
96
|
+
|
|
97
|
+
if (!slug) {
|
|
98
|
+
console.error("Usage: node scaffold-report.mjs <slug>");
|
|
99
|
+
process.exit(1);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
try {
|
|
103
|
+
process.stdout.write(`${JSON.stringify(createReportFiles(slug), null, 2)}\n`);
|
|
104
|
+
} catch (error) {
|
|
105
|
+
process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
|
|
106
|
+
process.exit(1);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "__TITLE__"
|
|
3
|
+
description: ""
|
|
4
|
+
status: draft
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Why This Report Exists
|
|
8
|
+
|
|
9
|
+
TODO: describe the question this report answers and the decision it supports.
|
|
10
|
+
|
|
11
|
+
## Data and Refresh
|
|
12
|
+
|
|
13
|
+
- **Data endpoint**: TODO: list the Baker commands or local data sources used by `/reports/data/__SLUG__`.
|
|
14
|
+
- **Refresh policy**: manual via the injected Refresh control using `?fresh=true`; smoke with the built Reports runtime before marking active.
|
|
15
|
+
|
|
16
|
+
## Evolution
|
|
17
|
+
|
|
18
|
+
- __TODAY__: created
|
|
19
|
+
|
|
20
|
+
## Sources
|
|
21
|
+
|
|
22
|
+
- TODO: link to personas, campaigns, audits, competitors, or docs that motivated this report.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>__TITLE__</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<main>
|
|
10
|
+
<h1>__TITLE__</h1>
|
|
11
|
+
<p>
|
|
12
|
+
TODO: replace this placeholder with the real Report Dashboard authored for this company.
|
|
13
|
+
</p>
|
|
14
|
+
<p>
|
|
15
|
+
Fetch report data from <code>/reports/data/__SLUG__</code>. The reports runtime serves this file at
|
|
16
|
+
<code>/reports/__SLUG__/</code> and injects the refresh control.
|
|
17
|
+
</p>
|
|
18
|
+
</main>
|
|
19
|
+
</body>
|
|
20
|
+
</html>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory-files.d.ts","sourceRoot":"","sources":["../../src/hono/memory-files.ts"],"names":[],"mappings":"AAIA,KAAK,UAAU,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAwBpD,wBAAgB,kBAAkB,CAAC,IAAI,GAAE,MAAuC,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAEvG"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { readdir, readFile } from "node:fs/promises";
|
|
2
|
-
import { join, relative, sep } from "node:path";
|
|
3
|
-
import { bridgeRuntimeFiles } from "./runtime-files.js";
|
|
4
|
-
async function collectFiles(dir, root) {
|
|
5
|
-
// null on a missing directory → nothing to sync.
|
|
6
|
-
const entries = await readdir(dir, { withFileTypes: true }).catch(() => null);
|
|
7
|
-
if (!entries)
|
|
8
|
-
return [];
|
|
9
|
-
const files = [];
|
|
10
|
-
for (const entry of entries) {
|
|
11
|
-
const abs = join(dir, entry.name);
|
|
12
|
-
if (entry.isDirectory()) {
|
|
13
|
-
files.push(...(await collectFiles(abs, root)));
|
|
14
|
-
}
|
|
15
|
-
else if (entry.isFile()) {
|
|
16
|
-
const content = await readFile(abs, "utf-8");
|
|
17
|
-
// Normalize to forward-slash, repo-relative paths so the backend can write
|
|
18
|
-
// them back under `.claude/memory/` on any platform.
|
|
19
|
-
files.push({ path: relative(root, abs).split(sep).join("/"), content });
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return files;
|
|
23
|
-
}
|
|
24
|
-
// Read the agent's `.claude/memory/` directory into a flat file list. `root`
|
|
25
|
-
// defaults to the sandbox memory dir; it is a parameter for testability.
|
|
26
|
-
export function collectMemoryFiles(root = bridgeRuntimeFiles.memoryDir()) {
|
|
27
|
-
return collectFiles(root, root);
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=memory-files.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory-files.js","sourceRoot":"","sources":["../../src/hono/memory-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAIxD,KAAK,UAAU,YAAY,CAAC,GAAW,EAAE,IAAY;IACnD,iDAAiD;IACjD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IAC9E,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IAExB,MAAM,KAAK,GAAiB,EAAE,CAAC;IAC/B,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;QACjD,CAAC;aAAM,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;YAC1B,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;YAC7C,2EAA2E;YAC3E,qDAAqD;YACrD,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,6EAA6E;AAC7E,yEAAyE;AACzE,MAAM,UAAU,kBAAkB,CAAC,OAAe,kBAAkB,CAAC,SAAS,EAAE;IAC9E,OAAO,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory-files.test.d.ts","sourceRoot":"","sources":["../../src/hono/memory-files.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
2
|
-
import { tmpdir } from "node:os";
|
|
3
|
-
import { join } from "node:path";
|
|
4
|
-
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
5
|
-
import { collectMemoryFiles } from "./memory-files.js";
|
|
6
|
-
let dir;
|
|
7
|
-
beforeEach(async () => {
|
|
8
|
-
dir = await mkdtemp(join(tmpdir(), "baker-memory-"));
|
|
9
|
-
});
|
|
10
|
-
afterEach(async () => {
|
|
11
|
-
await rm(dir, { recursive: true, force: true });
|
|
12
|
-
});
|
|
13
|
-
describe("collectMemoryFiles", () => {
|
|
14
|
-
it("returns an empty list when the directory does not exist", async () => {
|
|
15
|
-
await expect(collectMemoryFiles(join(dir, "missing"))).resolves.toEqual([]);
|
|
16
|
-
});
|
|
17
|
-
it("collects files recursively with forward-slash relative paths", async () => {
|
|
18
|
-
await writeFile(join(dir, "MEMORY.md"), "index");
|
|
19
|
-
await mkdir(join(dir, "topics"), { recursive: true });
|
|
20
|
-
await writeFile(join(dir, "topics", "debugging.md"), "notes");
|
|
21
|
-
const files = await collectMemoryFiles(dir);
|
|
22
|
-
expect(files.sort((a, b) => a.path.localeCompare(b.path))).toEqual([
|
|
23
|
-
{ path: "MEMORY.md", content: "index" },
|
|
24
|
-
{ path: "topics/debugging.md", content: "notes" },
|
|
25
|
-
]);
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
//# sourceMappingURL=memory-files.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory-files.test.js","sourceRoot":"","sources":["../../src/hono/memory-files.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,IAAI,GAAW,CAAC;AAEhB,UAAU,CAAC,KAAK,IAAI,EAAE;IACpB,GAAG,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC;AACvD,CAAC,CAAC,CAAC;AAEH,SAAS,CAAC,KAAK,IAAI,EAAE;IACnB,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAClD,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,yDAAyD,EAAE,KAAK,IAAI,EAAE;QACvE,MAAM,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8DAA8D,EAAE,KAAK,IAAI,EAAE;QAC5E,MAAM,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,EAAE,OAAO,CAAC,CAAC;QACjD,MAAM,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACtD,MAAM,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,cAAc,CAAC,EAAE,OAAO,CAAC,CAAC;QAE9D,MAAM,KAAK,GAAG,MAAM,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAE5C,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;YACjE,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE;YACvC,EAAE,IAAI,EAAE,qBAAqB,EAAE,OAAO,EAAE,OAAO,EAAE;SAClD,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory-sync.d.ts","sourceRoot":"","sources":["../../src/hono/memory-sync.ts"],"names":[],"mappings":"AAKA,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAMpD"}
|
package/dist/hono/memory-sync.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { postMemory } from "./convex.js";
|
|
2
|
-
import { collectMemoryFiles } from "./memory-files.js";
|
|
3
|
-
// Stage this chat's memory to the backend. No-op outside a sandbox (no
|
|
4
|
-
// BAKER_CHAT_ID) or when there is nothing to sync.
|
|
5
|
-
export async function syncChatMemory() {
|
|
6
|
-
const chatId = process.env.BAKER_CHAT_ID;
|
|
7
|
-
if (!chatId)
|
|
8
|
-
return;
|
|
9
|
-
const files = await collectMemoryFiles();
|
|
10
|
-
if (files.length === 0)
|
|
11
|
-
return;
|
|
12
|
-
await postMemory(chatId, files);
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=memory-sync.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory-sync.js","sourceRoot":"","sources":["../../src/hono/memory-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,uEAAuE;AACvE,mDAAmD;AACnD,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;IACzC,IAAI,CAAC,MAAM;QAAE,OAAO;IACpB,MAAM,KAAK,GAAG,MAAM,kBAAkB,EAAE,CAAC;IACzC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAC/B,MAAM,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAClC,CAAC"}
|