dotmem 0.2.6 → 0.2.7

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/bin/cli.cjs CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';var n=require('process'),url=require('url');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var n__default=/*#__PURE__*/_interopDefault(n);var l=console.warn;console.warn=(...o)=>{typeof o[0]=="string"&&o[0].includes("Memorio IDB: IndexedDB is not available")||l(...o);};var e=n__default.default.argv.slice(2),r=e.indexOf("--storage-root"),s=r!==-1,a=s?e[r+1]:void 0;s&&(a===void 0||a.startsWith("--"))&&(console.error("Usage: npx dotmem <command> --storage-root <absolute-directory>"),n__default.default.exit(1));var i=s?e.filter((o,t)=>t!==r&&t!==r+1):e,d=i[0],g=i.slice(1);(async()=>{let o=await import('../cli.js');if(s)try{o.noteDotMemPackageInstallPath(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.cjs', document.baseURI).href)))),o.setDotMemStorageRootOverride(a);}catch(t){console.error(`Invalid --storage-root: ${t instanceof Error?t.message:String(t)}`),n__default.default.exit(1);}o.dispatch(d,g);})();
2
+ 'use strict';var c=require('process'),url=require('url'),j=require('fs'),i=require('path'),child_process=require('child_process');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var c__default=/*#__PURE__*/_interopDefault(c);var j__default=/*#__PURE__*/_interopDefault(j);var i__default=/*#__PURE__*/_interopDefault(i);var S=Object.defineProperty;var a=(n,t)=>S(n,"name",{value:t,configurable:true});var O=console.warn;console.warn=(...n)=>{typeof n[0]=="string"&&n[0].includes("Memorio IDB: IndexedDB is not available")||O(...n);};var d=c__default.default.argv.slice(2),f=d.indexOf("--storage-root"),p=f!==-1,m=p?d[f+1]:void 0;p&&(m===void 0||m.startsWith("--"))&&(console.error("Usage: npx dotmem <command> --storage-root <absolute-directory>"),c__default.default.exit(1));var y=p?d.filter((n,t)=>t!==f&&t!==f+1):d,R=y[0],F=y.slice(1),I=a(n=>n.split(".").map(t=>{let o=parseInt(t,10);return Number.isNaN(o)?0:o}),"parseVersion"),M=a((n,t)=>{let o=I(n),e=I(t),r=Math.max(o.length,e.length);for(let s=0;s<r;s++){let h=o[s]??0,v=e[s]??0;if(h>v)return true;if(h<v)return false}return false},"versionGt"),x=a(n=>{try{return {version:JSON.parse(j__default.default.readFileSync(n,"utf8")).version??"unknown",dir:i__default.default.dirname(n)}}catch{return null}},"readPackageJson"),b=a(n=>{let t=c__default.default.cwd();if(t===n||t.startsWith(n+i__default.default.sep))return "app";try{let o=child_process.execSync("npm config get prefix",{encoding:"utf8",stdio:["pipe","pipe","ignore"]}).trim(),e=i__default.default.join(o,"node_modules");if(n===e||n.startsWith(e+i__default.default.sep))return "global"}catch{}return "npm"},"detectOrigin"),w=url.fileURLToPath(new URL("../cli.js",(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.cjs', document.baseURI).href)))),g=x(url.fileURLToPath(new URL("../../package.json",(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.cjs', document.baseURI).href))))),N=a(()=>{let n={origin:g?b(g.dir):"app",version:g?.version??"unknown",dir:g?.dir??"",cliPath:w},t=null;try{let o=child_process.execSync("npm config get prefix",{encoding:"utf8",stdio:["pipe","pipe","ignore"]}).trim(),e=i__default.default.join(o,"node_modules","dotmem","package.json"),r=x(e);if(r){let s=i__default.default.join(i__default.default.dirname(e),"dist","bin","cli.js");t={origin:b(r.dir),version:r.version,dir:r.dir,cliPath:s};}}catch{}return t&&g&&M(t.version,n.version)?{...t,origin:"global"}:n},"resolveEffectiveInstallation"),l=N();console.info(`dotmem v${l.version} (${l.origin})`);if(l.origin==="global"&&l.cliPath&&l.cliPath!==w){let n=child_process.spawnSync(c__default.default.execPath,[l.cliPath,...d],{stdio:"inherit",encoding:"utf8"});c__default.default.exit(n.status??0);}(async()=>{let n=await import('../cli.js');if(p)try{n.noteDotMemPackageInstallPath(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.cjs', document.baseURI).href)))),n.setDotMemStorageRootOverride(m);}catch(t){console.error(`Invalid --storage-root: ${t instanceof Error?t.message:String(t)}`),c__default.default.exit(1);}try{let t=await n.loadSession();(t.doing||t.changedFiles.length>0||t.waitingForUser.length>0||t.doNotYet.length>0)&&(console.info(""),console.info(n.formatSessionState(t)));}catch{}n.dispatch(R,F);})();
package/bin/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import n from'process';import {fileURLToPath}from'url';var l=console.warn;console.warn=(...o)=>{typeof o[0]=="string"&&o[0].includes("Memorio IDB: IndexedDB is not available")||l(...o);};var e=n.argv.slice(2),r=e.indexOf("--storage-root"),s=r!==-1,a=s?e[r+1]:void 0;s&&(a===void 0||a.startsWith("--"))&&(console.error("Usage: npx dotmem <command> --storage-root <absolute-directory>"),n.exit(1));var i=s?e.filter((o,t)=>t!==r&&t!==r+1):e,d=i[0],g=i.slice(1);(async()=>{let o=await import('../cli.js');if(s)try{o.noteDotMemPackageInstallPath(fileURLToPath(import.meta.url)),o.setDotMemStorageRootOverride(a);}catch(t){console.error(`Invalid --storage-root: ${t instanceof Error?t.message:String(t)}`),n.exit(1);}o.dispatch(d,g);})();
2
+ import c from'process';import {fileURLToPath}from'url';import j from'fs';import i from'path';import {spawnSync,execSync}from'child_process';var S=Object.defineProperty;var a=(n,t)=>S(n,"name",{value:t,configurable:true});var O=console.warn;console.warn=(...n)=>{typeof n[0]=="string"&&n[0].includes("Memorio IDB: IndexedDB is not available")||O(...n);};var d=c.argv.slice(2),f=d.indexOf("--storage-root"),p=f!==-1,m=p?d[f+1]:void 0;p&&(m===void 0||m.startsWith("--"))&&(console.error("Usage: npx dotmem <command> --storage-root <absolute-directory>"),c.exit(1));var y=p?d.filter((n,t)=>t!==f&&t!==f+1):d,R=y[0],F=y.slice(1),I=a(n=>n.split(".").map(t=>{let o=parseInt(t,10);return Number.isNaN(o)?0:o}),"parseVersion"),M=a((n,t)=>{let o=I(n),e=I(t),r=Math.max(o.length,e.length);for(let s=0;s<r;s++){let h=o[s]??0,v=e[s]??0;if(h>v)return true;if(h<v)return false}return false},"versionGt"),x=a(n=>{try{return {version:JSON.parse(j.readFileSync(n,"utf8")).version??"unknown",dir:i.dirname(n)}}catch{return null}},"readPackageJson"),b=a(n=>{let t=c.cwd();if(t===n||t.startsWith(n+i.sep))return "app";try{let o=execSync("npm config get prefix",{encoding:"utf8",stdio:["pipe","pipe","ignore"]}).trim(),e=i.join(o,"node_modules");if(n===e||n.startsWith(e+i.sep))return "global"}catch{}return "npm"},"detectOrigin"),w=fileURLToPath(new URL("../cli.js",import.meta.url)),g=x(fileURLToPath(new URL("../../package.json",import.meta.url))),N=a(()=>{let n={origin:g?b(g.dir):"app",version:g?.version??"unknown",dir:g?.dir??"",cliPath:w},t=null;try{let o=execSync("npm config get prefix",{encoding:"utf8",stdio:["pipe","pipe","ignore"]}).trim(),e=i.join(o,"node_modules","dotmem","package.json"),r=x(e);if(r){let s=i.join(i.dirname(e),"dist","bin","cli.js");t={origin:b(r.dir),version:r.version,dir:r.dir,cliPath:s};}}catch{}return t&&g&&M(t.version,n.version)?{...t,origin:"global"}:n},"resolveEffectiveInstallation"),l=N();console.info(`dotmem v${l.version} (${l.origin})`);if(l.origin==="global"&&l.cliPath&&l.cliPath!==w){let n=spawnSync(c.execPath,[l.cliPath,...d],{stdio:"inherit",encoding:"utf8"});c.exit(n.status??0);}(async()=>{let n=await import('../cli.js');if(p)try{n.noteDotMemPackageInstallPath(fileURLToPath(import.meta.url)),n.setDotMemStorageRootOverride(m);}catch(t){console.error(`Invalid --storage-root: ${t instanceof Error?t.message:String(t)}`),c.exit(1);}try{let t=await n.loadSession();(t.doing||t.changedFiles.length>0||t.waitingForUser.length>0||t.doNotYet.length>0)&&(console.info(""),console.info(n.formatSessionState(t)));}catch{}n.dispatch(R,F);})();
@@ -1,9 +1,18 @@
1
1
  {
2
2
  "format": "dotmem.built-in-context",
3
3
  "formatVersion": 1,
4
- "sourceVersion": "0.2.6",
4
+ "sourceVersion": "0.2.7",
5
5
  "buildFormatVersion": 1,
6
6
  "documents": [
7
+ {
8
+ "id": "ADR",
9
+ "file": "ADR.md",
10
+ "path": "ADR.md",
11
+ "content": "# ADR\n\nAn **Architecture Decision Record (ADR)** is a concise document that captures and explains a single architectural decision relevant to a product or digital ecosystem. Ideally kept to one or two pages, it covers three core elements: **the context**, **the decision made**, and **its significant consequences**. A foundational rule is immutability: once accepted, an ADR is never modified if the decision changes—instead, a new ADR is created to supersede it, with a clear link connecting the two.\n\n---\n\n## Why Write ADRs?\n\nWriting ADRs serves two complementary purposes:\n\n* **Institutional Memory:** It allows engineers joining months or years later to understand *why* the system was built a certain way, preventing teams from repeating past mistakes or revisiting settled debates without context.\n* **Clarity and Alignment:** The act of writing forces structured thinking. Putting a consequential decision on paper surfaces conflicting perspectives early, encouraging constructive debate and alignment before a single line of code is written.\n\n---\n\n## Structure and Writing Style\n\nTo ensure ADRs are actually read and remain useful over time, follow a few proven practices:\n\n* **Inverted Pyramid Style:** Borrowing from journalism, put the most critical information (the problem and the decision) right at the top, pushing deep technical details and supporting analysis further down.\n* **Radical Brevity:** Keep it sharp and to the point—ideally within a single page. Link out to benchmarks, complex diagrams, or lengthy discussions rather than bloating the record.\n* **Rationale, Forces, and Alternatives:** Summarize the problem, the underlying constraints (\"forces\"), and the trade-offs evaluated. Explicitly list the serious alternatives considered alongside their pros and cons.\n* **Consequences and Confidence Level:** Spell out the real-world impact of the choice (costs, technical debt, operational overhead). Because decisions are made under uncertainty, it is good practice to record a **confidence level** and specify which changes in product or technical context should trigger a re-evaluation.\n\n---\n\n## Lifecycle and Statuses\n\nEvery record moves through a clear, auditable lifecycle:\n\n| Status | Meaning |\n| --- | --- |\n| **Proposed** | The decision is currently under discussion and open for feedback. |\n| **Accepted** | The team has approved the decision, and it is actively governing work. |\n| **Superseded** | The decision has been replaced by a newer one. The original file remains untouched, linking to the new ADR. |\n| **Deprecated** | The decision is no longer applicable (e.g., the system was retired) without being replaced. |\n\n---\n\n## Storage and Organization\n\n* **Repository and Format:** Standard practice is to store ADRs directly in the codebase repository (e.g., `docs/adr/`), written in **Markdown**. This allows teams to review them via Pull Requests, track history in Git, and automatically publish them to internal developer portals (such as Backstage, Docusaurus, or MkDocs).\n* **Naming Convention:** Each decision lives in its own file, numbered sequentially with a descriptive slug (e.g., `0001-use-htmx-for-active-web-pages.md`).\n* **Beyond a Single Repository:** For decisions spanning a broader ecosystem—or when non-engineers like Product Managers and business stakeholders need to collaborate—a single service repository can create friction. In those cases, teams often use a centralized architecture repository or sync Markdown files with more accessible documentation tools.\n\n---\n\n## ADRs in Modern Decision-Making\n\nIn modern engineering organizations, ADRs are a cornerstone of the **Advice Process**: anyone can make a decision, provided they first seek input from domain experts and the people who will be affected by it. In this model, an ADR is not just a passive log—it is the active vehicle used to gather, synthesize, and document advice before finalizing a choice.\n\nWhile rooted in software architecture, the broader concept of lightweight **Decision Records** works equally well across product, design, and organizational domains, building a transparent historical log of how and why things evolved.\n",
12
+ "digest": "sha256:1d10b9632e52a9278ebf707ef626a2478de1773090ae90b608a044c95fabbe00",
13
+ "size": 4171,
14
+ "classification": "reference"
15
+ },
7
16
  {
8
17
  "id": "ARCHITECTURE",
9
18
  "file": "ARCHITECTURE.md",
@@ -149,7 +158,7 @@
149
158
  "classification": "normative"
150
159
  }
151
160
  ],
152
- "manifestDigest": "sha256:62af95466ac47bb3457db82c07d8deef561dd5b1697f38be381a3ee41a01be9b",
153
- "aggregateDigest": "sha256:f141b030468c692098a671fe62f99e3f7e873598bad79bfd05875fc7636e4e72",
154
- "documentCount": 16
161
+ "manifestDigest": "sha256:aa03eb768b57d3c64b65095ebcc7c9bce4270eccb3b64dab7395b2934233d461",
162
+ "aggregateDigest": "sha256:7d64d0a1e65306057c910fad65fb7017f66cda3c7b7fb8a98d4bf7e2175f113b",
163
+ "documentCount": 17
155
164
  }