@ghostpaw/questlog 0.1.0 → 0.2.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.
package/README.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @ghostpaw/questlog
2
2
 
3
+ [![npm](https://img.shields.io/npm/v/@ghostpaw/questlog)](https://www.npmjs.com/package/@ghostpaw/questlog)
4
+ [![node](https://img.shields.io/node/v/@ghostpaw/questlog)](https://nodejs.org)
5
+ [![license](https://img.shields.io/npm/l/@ghostpaw/questlog)](LICENSE)
6
+ [![dependencies](https://img.shields.io/badge/dependencies-0-brightgreen)](package.json)
7
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.9-blue?logo=typescript&logoColor=white)](https://www.typescriptlang.org)
8
+ [![Live Demo](https://img.shields.io/badge/demo-live-06d6a0?style=flat&logo=github)](https://ghostpawjs.github.io/questlog)
9
+
3
10
  A unified task and calendar model for Node.js, built on SQLite.
4
11
 
5
12
  Questlog treats tasks, events, deadlines, recurring commitments, and loose intake as one coherent data model instead of separate systems. It ships as a single prebundled blob with zero runtime dependencies, designed for two audiences at once: human developers working directly in code, and LLM agents operating through a structured tool facade.
package/dist/index.cjs CHANGED
@@ -3754,6 +3754,7 @@ var manageRepeatableTool = defineQuestlogTool({
3754
3754
  },
3755
3755
  outputDescription: "Returns the changed repeatable quest, due anchor preview items, or spawned quest details for the selected recurrence action. Empty previews and empty spawns return structured success or no-op results, and repeatable hiding is now intentionally routed through `retire_work`.",
3756
3756
  inputSchema: {
3757
+ type: "object",
3757
3758
  oneOf: [
3758
3759
  objectSchema(
3759
3760
  {
@@ -4021,6 +4022,7 @@ var organizeWorkTool = defineQuestlogTool({
4021
4022
  },
4022
4023
  outputDescription: "Returns the updated questline detail or target quest detail after grouping or dependency changes. Repeated equivalent changes return structured no-op results.",
4023
4024
  inputSchema: {
4025
+ type: "object",
4024
4026
  oneOf: [
4025
4027
  objectSchema(
4026
4028
  {
@@ -4163,6 +4165,7 @@ var planQuestTool = defineQuestlogTool({
4163
4165
  },
4164
4166
  outputDescription: "Returns the updated quest detail after objective or planning changes. If the requested planning state is already present, the tool returns a structured no-op result.",
4165
4167
  inputSchema: {
4168
+ type: "object",
4166
4169
  oneOf: [
4167
4170
  objectSchema(
4168
4171
  {
@@ -4746,6 +4749,7 @@ var rewardWorkTool = defineQuestlogTool({
4746
4749
  },
4747
4750
  outputDescription: "Returns the updated or claimed reward when one concrete reward changes, or a structured success result for repeatable future template replacement. Already-claimed rewards return a structured no-op for claim and an error for invalid update or remove attempts.",
4748
4751
  inputSchema: {
4752
+ type: "object",
4749
4753
  oneOf: [
4750
4754
  objectSchema(
4751
4755
  {
@@ -4999,6 +5003,7 @@ var runQuestTool = defineQuestlogTool({
4999
5003
  },
5000
5004
  outputDescription: "Returns the updated quest detail after the selected lifecycle action, plus purpose-shaped primary, updated, and created refs when follow-up work is spawned. Safe repeated starts return structured no-op results.",
5001
5005
  inputSchema: {
5006
+ type: "object",
5002
5007
  oneOf: [
5003
5008
  objectSchema(
5004
5009
  {
@@ -5409,6 +5414,7 @@ var shapeWorkTool = defineQuestlogTool({
5409
5414
  },
5410
5415
  outputDescription: "Returns the changed or created rumor, quest, questline, or created quest set for the selected shape-work action, plus purpose-shaped primary and created or updated refs. Repeated safe actions return structured no-op results, and rumor settlement can ask for missing structure instead of failing.",
5411
5416
  inputSchema: {
5417
+ type: "object",
5412
5418
  oneOf: [
5413
5419
  objectSchema(
5414
5420
  {
@@ -5695,6 +5701,7 @@ var tagWorkTool = defineQuestlogTool({
5695
5701
  },
5696
5702
  outputDescription: "Returns the normalized final tag set for the target after the selected tag action. Repeated equivalent changes return structured no-op results.",
5697
5703
  inputSchema: {
5704
+ type: "object",
5698
5705
  oneOf: [
5699
5706
  objectSchema(
5700
5707
  {
package/dist/index.d.cts CHANGED
@@ -1,9 +1,21 @@
1
- import { DatabaseSync } from 'node:sqlite';
2
-
1
+ interface QuestlogRunResult {
2
+ lastInsertRowid: number | bigint;
3
+ changes?: number | bigint | undefined;
4
+ }
5
+ interface QuestlogStatement {
6
+ run(...params: unknown[]): QuestlogRunResult;
7
+ get<TRecord = Record<string, unknown>>(...params: unknown[]): TRecord | undefined;
8
+ all<TRecord = Record<string, unknown>>(...params: unknown[]): TRecord[];
9
+ }
3
10
  /**
4
11
  * SQLite dependency injected into every questlog operation.
12
+ * Node.js `DatabaseSync` satisfies this interface directly.
5
13
  */
6
- type QuestlogDb = DatabaseSync;
14
+ type QuestlogDb = {
15
+ exec(sql: string): void;
16
+ prepare(sql: string): QuestlogStatement;
17
+ close(): void;
18
+ };
7
19
 
8
20
  /**
9
21
  * Creates the full standalone questlog schema, including FTS and indexing.
package/dist/index.d.ts CHANGED
@@ -1,9 +1,21 @@
1
- import { DatabaseSync } from 'node:sqlite';
2
-
1
+ interface QuestlogRunResult {
2
+ lastInsertRowid: number | bigint;
3
+ changes?: number | bigint | undefined;
4
+ }
5
+ interface QuestlogStatement {
6
+ run(...params: unknown[]): QuestlogRunResult;
7
+ get<TRecord = Record<string, unknown>>(...params: unknown[]): TRecord | undefined;
8
+ all<TRecord = Record<string, unknown>>(...params: unknown[]): TRecord[];
9
+ }
3
10
  /**
4
11
  * SQLite dependency injected into every questlog operation.
12
+ * Node.js `DatabaseSync` satisfies this interface directly.
5
13
  */
6
- type QuestlogDb = DatabaseSync;
14
+ type QuestlogDb = {
15
+ exec(sql: string): void;
16
+ prepare(sql: string): QuestlogStatement;
17
+ close(): void;
18
+ };
7
19
 
8
20
  /**
9
21
  * Creates the full standalone questlog schema, including FTS and indexing.
package/dist/index.js CHANGED
@@ -3752,6 +3752,7 @@ var manageRepeatableTool = defineQuestlogTool({
3752
3752
  },
3753
3753
  outputDescription: "Returns the changed repeatable quest, due anchor preview items, or spawned quest details for the selected recurrence action. Empty previews and empty spawns return structured success or no-op results, and repeatable hiding is now intentionally routed through `retire_work`.",
3754
3754
  inputSchema: {
3755
+ type: "object",
3755
3756
  oneOf: [
3756
3757
  objectSchema(
3757
3758
  {
@@ -4019,6 +4020,7 @@ var organizeWorkTool = defineQuestlogTool({
4019
4020
  },
4020
4021
  outputDescription: "Returns the updated questline detail or target quest detail after grouping or dependency changes. Repeated equivalent changes return structured no-op results.",
4021
4022
  inputSchema: {
4023
+ type: "object",
4022
4024
  oneOf: [
4023
4025
  objectSchema(
4024
4026
  {
@@ -4161,6 +4163,7 @@ var planQuestTool = defineQuestlogTool({
4161
4163
  },
4162
4164
  outputDescription: "Returns the updated quest detail after objective or planning changes. If the requested planning state is already present, the tool returns a structured no-op result.",
4163
4165
  inputSchema: {
4166
+ type: "object",
4164
4167
  oneOf: [
4165
4168
  objectSchema(
4166
4169
  {
@@ -4744,6 +4747,7 @@ var rewardWorkTool = defineQuestlogTool({
4744
4747
  },
4745
4748
  outputDescription: "Returns the updated or claimed reward when one concrete reward changes, or a structured success result for repeatable future template replacement. Already-claimed rewards return a structured no-op for claim and an error for invalid update or remove attempts.",
4746
4749
  inputSchema: {
4750
+ type: "object",
4747
4751
  oneOf: [
4748
4752
  objectSchema(
4749
4753
  {
@@ -4997,6 +5001,7 @@ var runQuestTool = defineQuestlogTool({
4997
5001
  },
4998
5002
  outputDescription: "Returns the updated quest detail after the selected lifecycle action, plus purpose-shaped primary, updated, and created refs when follow-up work is spawned. Safe repeated starts return structured no-op results.",
4999
5003
  inputSchema: {
5004
+ type: "object",
5000
5005
  oneOf: [
5001
5006
  objectSchema(
5002
5007
  {
@@ -5407,6 +5412,7 @@ var shapeWorkTool = defineQuestlogTool({
5407
5412
  },
5408
5413
  outputDescription: "Returns the changed or created rumor, quest, questline, or created quest set for the selected shape-work action, plus purpose-shaped primary and created or updated refs. Repeated safe actions return structured no-op results, and rumor settlement can ask for missing structure instead of failing.",
5409
5414
  inputSchema: {
5415
+ type: "object",
5410
5416
  oneOf: [
5411
5417
  objectSchema(
5412
5418
  {
@@ -5693,6 +5699,7 @@ var tagWorkTool = defineQuestlogTool({
5693
5699
  },
5694
5700
  outputDescription: "Returns the normalized final tag set for the target after the selected tag action. Repeated equivalent changes return structured no-op results.",
5695
5701
  inputSchema: {
5702
+ type: "object",
5696
5703
  oneOf: [
5697
5704
  objectSchema(
5698
5705
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ghostpaw/questlog",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Unified task and calendar model for Node.js — SQLite, zero dependencies, with a built-in LLM tool facade",
5
5
  "type": "module",
6
6
  "exports": {
@@ -32,6 +32,9 @@
32
32
  "typecheck": "tsc --noEmit",
33
33
  "check": "biome check && tsc --noEmit",
34
34
  "clean": "rm -rf dist",
35
+ "demo:build": "node scripts/build_demo.mjs",
36
+ "demo:watch": "node scripts/build_demo.mjs --watch",
37
+ "demo:serve": "npm run demo:build && node scripts/serve_demo.mjs",
35
38
  "prepublishOnly": "npm run check && npm run build",
36
39
  "release:patch": "npm version patch && git push && git push --tags",
37
40
  "release:minor": "npm version minor && git push && git push --tags",
@@ -84,6 +87,9 @@
84
87
  "devDependencies": {
85
88
  "@biomejs/biome": "2.4.4",
86
89
  "@types/node": "^25.3.0",
90
+ "esbuild": "^0.27.4",
91
+ "preact": "^10.29.0",
92
+ "sql.js-fts5": "^1.4.0",
87
93
  "tsup": "^8.0.0",
88
94
  "typescript": "^5.9.3"
89
95
  }