@ghostpaw/questlog 0.9.2 → 0.11.0

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.
Files changed (33) hide show
  1. package/README.md +144 -4
  2. package/SKILL.md +95 -40
  3. package/dist/chunk-7KTRNXTU.js +21 -0
  4. package/dist/chunk-D6EGZCT7.js +23 -0
  5. package/dist/chunk-GVD6A3RR.js +108 -0
  6. package/dist/{chunk-6KTQK3ZE.js → chunk-I2AMIXGP.js} +8 -0
  7. package/dist/{chunk-3B6FMHZU.js → chunk-IA2GVCZS.js} +35 -2
  8. package/dist/{chunk-DKH623HU.js → chunk-IL2QRKZL.js} +1 -4
  9. package/dist/{chunk-UTUQPSGO.js → chunk-KOWIVBG6.js} +68 -588
  10. package/dist/chunk-NBCCA6AX.js +31 -0
  11. package/dist/chunk-QK3H2AL5.js +36 -0
  12. package/dist/chunk-RBGQK5WP.js +949 -0
  13. package/dist/cli.js +1 -1
  14. package/dist/{cli_main-XNZP4TY2.js → cli_main-TEG3QTDP.js} +147 -128
  15. package/dist/index.cjs +1152 -627
  16. package/dist/index.d.cts +142 -11
  17. package/dist/index.d.ts +142 -11
  18. package/dist/index.js +1152 -628
  19. package/dist/list_deliveries-WJEJUZIQ.js +2 -0
  20. package/dist/list_hooks-C5CAA2C7.js +2 -0
  21. package/dist/mcp-server.js +840 -389
  22. package/dist/mcp.cjs +709 -322
  23. package/dist/mcp.js +711 -324
  24. package/dist/open_questlog_db-6NS6BVBC.js +2 -0
  25. package/dist/{questlog_skill_spec-EM6DGGVN.js → questlog_skill_spec-ILTCTRYS.js} +16 -8
  26. package/dist/run_hook_command-BOENYNDT.js +155 -0
  27. package/dist/{serve_questlog_mcp-KFUYJB2P.js → serve_questlog_mcp-X524X34F.js} +6 -3
  28. package/dist/{skill_markdown-HXYQ3K6U.js → skill_markdown-EGKYZ3W2.js} +4 -20
  29. package/dist/text_output-X7F3K23Q.js +2 -0
  30. package/package.json +1 -1
  31. package/skills/questlog/SKILL.md +95 -40
  32. package/skills/questlog/references/webhooks.md +94 -0
  33. package/dist/open_questlog_db-SH3DAU4C.js +0 -2
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env node
2
+ // src/hooks/list_hooks.ts
3
+ function listHooks(db) {
4
+ return db.prepare(`SELECT id, url, headers, tag, events, min_gap, created_at, last_wake,
5
+ (SELECT COUNT(*) FROM hook_assignments a LEFT JOIN hook_deliveries d ON d.id = a.delivery_id WHERE a.target_id = t.id AND (a.delivery_id IS NULL OR d.status = 'pending')) AS pending,
6
+ (SELECT COUNT(*) FROM hook_deliveries d WHERE d.target_id = t.id AND d.status = 'failed') AS failed
7
+ FROM hook_targets t ORDER BY id`).all().map((row) => {
8
+ const url = new URL(String(row.url));
9
+ url.username = "";
10
+ url.password = "";
11
+ url.search = "";
12
+ url.hash = "";
13
+ return {
14
+ id: Number(row.id),
15
+ headers: Object.fromEntries(
16
+ Object.keys(JSON.parse(String(row.headers))).map((name) => [name, "***"])
17
+ ),
18
+ scope: row.tag == null ? "database" : "tag",
19
+ url: url.href,
20
+ tag: row.tag == null ? null : String(row.tag),
21
+ events: JSON.parse(String(row.events)),
22
+ minGap: Number(row.min_gap),
23
+ createdAt: Number(row.created_at),
24
+ lastWake: row.last_wake == null ? null : Number(row.last_wake),
25
+ pending: Number(row.pending),
26
+ failed: Number(row.failed)
27
+ };
28
+ });
29
+ }
30
+
31
+ export { listHooks };
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env node
2
+ // src/surfaces/text_output.ts
3
+ var isTime = (key, value) => typeof value === "number" && value > 1e12 && /(At|Wake)$/.test(key);
4
+ function scalar(key, value) {
5
+ if (value == null || value === "") return "-";
6
+ if (isTime(key, value)) return new Date(value).toISOString();
7
+ return String(value).replace(/[\r\n]+/g, " ");
8
+ }
9
+ function lines(value, indent, key = "") {
10
+ if (Array.isArray(value)) {
11
+ if (!value.length) return [`${indent}none`];
12
+ if (value.every((item) => item === null || typeof item !== "object"))
13
+ return [`${indent}${value.map((item) => scalar(key, item)).join(", ")}`];
14
+ return value.flatMap((item, index) => [...index ? [""] : [], ...lines(item, indent, key)]);
15
+ }
16
+ if (value !== null && typeof value === "object") {
17
+ const out = [];
18
+ for (const [name, item] of Object.entries(value)) {
19
+ if (item !== null && typeof item === "object") {
20
+ const nested = lines(item, `${indent} `, name);
21
+ if (Array.isArray(item) && nested.length === 1)
22
+ out.push(`${indent}${name}: ${nested[0]?.trim()}`);
23
+ else out.push(`${indent}${name}:`, ...nested);
24
+ } else out.push(`${indent}${name}: ${scalar(name, item)}`);
25
+ }
26
+ return out.length ? out : [`${indent}-`];
27
+ }
28
+ return [`${indent}${scalar(key, value)}`];
29
+ }
30
+ function textOutput(value) {
31
+ if (value == null) return "-";
32
+ if (Array.isArray(value) && !value.length) return "None";
33
+ return lines(value, "").join("\n");
34
+ }
35
+
36
+ export { textOutput };