openmates 0.11.0-alpha.32 → 0.11.0-alpha.33
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/dist/{chunk-NI7XPZBV.js → chunk-HHYM6RA6.js} +29 -13
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -5254,6 +5254,9 @@ function printLogo() {
|
|
|
5254
5254
|
|
|
5255
5255
|
// src/cli.ts
|
|
5256
5256
|
import { createInterface as createInterface3 } from "readline/promises";
|
|
5257
|
+
import { realpathSync } from "fs";
|
|
5258
|
+
import { fileURLToPath } from "url";
|
|
5259
|
+
import { basename as basename3, dirname } from "path";
|
|
5257
5260
|
import WebSocket2 from "ws";
|
|
5258
5261
|
|
|
5259
5262
|
// ../secret-scanner/src/registry.ts
|
|
@@ -31042,7 +31045,7 @@ Taking control of a small, self-directed project is often the best antidote to t
|
|
|
31042
31045
|
text: "Use my saved coding setup memory to suggest how I should structure a debugging session tonight."
|
|
31043
31046
|
},
|
|
31044
31047
|
message_2: {
|
|
31045
|
-
text: 'Based on your [coding setup preferences](/#settings/app_store/code/settings_memories/coding_setup) for a keyboard-first, **terminal-based** workflow with **low AI intervention**, here is a structured approach for your debugging session tonight. \n\nSince you prefer **explicit commands** and **small diffs** you can review manually, this workflow focuses on local isolation and CLI-native tools.\n\n### 1. State Isolation & Clean Slate\nBefore changing any code, ensure you are working in a clean environment to make those "small diffs" meaningful.\n* **Create a dedicated branch:** `git checkout -b debug/session-name`\n* **Clear artifacts:** Run your project\'s clean command (e.g., `make clean`, `npm cache clean`, or `cargo clean`) to ensure you aren\'t chasing ghosts in compiled binaries.\n\n### 2. The "Single-Command" Reproduction\nIn line with your shell-first preference, your first goal is to reduce the bug to a single [shell](wiki:Shell_(computing)) command or a minimal script.\n* **Draft a reproduction script:** Create a `repro.sh` that sets up the environment and triggers the failure.\n* **Automate the test:** Use `watch` or a simple loop to run this command as you make changes:\n ```json\n{"type": "code", "embed_id": "2ff43224-0546-4f2f-ba70-3b305c2ed9f8"}\n```\n\n\n\n### 3. Explicit Trace & Observation\nSince you prefer a **low AI level**, rely on explicit [debugging](wiki:Debugging) and tracing tools rather than speculative fixes:\n* **CLI Debuggers:** Use `gdb`, `lldb`, `pdb`, or `node inspect` depending on your language.\n* **System Tracing:** If the bug involves file I/O or networking, use `strace` (Linux) or `dtrace` (macOS) to see exactly what the process is doing at the kernel level.\n* **Grep-driven search:** Use `rg` (ripgrep) to explicitly trace data flow through your codebase from the terminal.\n\n### 4. Incremental Patching & Diff Review\nTo honor your preference for **small, reviewable diffs**:\n* **Atomic Changes:** Make exactly one change at a time.\n* **Review before Commit:** Use `git diff --color-words` to see exactly what changed in the terminal.\n* **The "Check-in" Loop:**\n 1. Modify code in your [text editor](wiki:Text_editor) (likely Vim/Emacs/Nano given your keyboard-first preference).\n 2. Run `./repro.sh`.\n 3. If successful, commit the focused change. If it fails, inspect `git diff`, revert only the specific hunks you decide to abandon, and try a different hypothesis.\n\n### 5. Final Verification\nOnce the bug is squashed, convert your `repro.sh` into a permanent [unit test](wiki:Unit_testing) to prevent [regression](wiki:Software_regression).\n\n***\n\nTo help me give you more specific commands or tool suggestions, tell me what kind of issue you are tackling tonight: logic error, crash, environment/dependency issue, or performance bottleneck
|
|
31048
|
+
text: 'Based on your [coding setup preferences](/#settings/app_store/code/settings_memories/coding_setup) for a keyboard-first, **terminal-based** workflow with **low AI intervention**, here is a structured approach for your debugging session tonight. \n\nSince you prefer **explicit commands** and **small diffs** you can review manually, this workflow focuses on local isolation and CLI-native tools.\n\n### 1. State Isolation & Clean Slate\nBefore changing any code, ensure you are working in a clean environment to make those "small diffs" meaningful.\n* **Create a dedicated branch:** `git checkout -b debug/session-name`\n* **Clear artifacts:** Run your project\'s clean command (e.g., `make clean`, `npm cache clean`, or `cargo clean`) to ensure you aren\'t chasing ghosts in compiled binaries.\n\n### 2. The "Single-Command" Reproduction\nIn line with your shell-first preference, your first goal is to reduce the bug to a single [shell](wiki:Shell_(computing)) command or a minimal script.\n* **Draft a reproduction script:** Create a `repro.sh` that sets up the environment and triggers the failure.\n* **Automate the test:** Use `watch` or a simple loop to run this command as you make changes:\n ```json\n{"type": "code", "embed_id": "2ff43224-0546-4f2f-ba70-3b305c2ed9f8"}\n```\n\n\n\n### 3. Explicit Trace & Observation\nSince you prefer a **low AI level**, rely on explicit [debugging](wiki:Debugging) and tracing tools rather than speculative fixes:\n* **CLI Debuggers:** Use `gdb`, `lldb`, `pdb`, or `node inspect` depending on your language.\n* **System Tracing:** If the bug involves file I/O or networking, use `strace` (Linux) or `dtrace` (macOS) to see exactly what the process is doing at the kernel level.\n* **Grep-driven search:** Use `rg` (ripgrep) to explicitly trace data flow through your codebase from the terminal.\n\n### 4. Incremental Patching & Diff Review\nTo honor your preference for **small, reviewable diffs**:\n* **Atomic Changes:** Make exactly one change at a time.\n* **Review before Commit:** Use `git diff --color-words` to see exactly what changed in the terminal.\n* **The "Check-in" Loop:**\n 1. Modify code in your [text editor](wiki:Text_editor) (likely Vim/Emacs/Nano given your keyboard-first preference).\n 2. Run `./repro.sh`.\n 3. If successful, commit the focused change. If it fails, inspect `git diff`, revert only the specific hunks you decide to abandon, and try a different hypothesis.\n\n### 5. Final Verification\nOnce the bug is squashed, convert your `repro.sh` into a permanent [unit test](wiki:Unit_testing) to prevent [regression](wiki:Software_regression).\n\n***\n\nTo help me give you more specific commands or tool suggestions, tell me what kind of issue you are tackling tonight: logic error, crash, environment/dependency issue, or performance bottleneck.'
|
|
31046
31049
|
}
|
|
31047
31050
|
},
|
|
31048
31051
|
memory_code_preferred_tech: {
|
|
@@ -42632,11 +42635,11 @@ function parseYamlScalar(value) {
|
|
|
42632
42635
|
}
|
|
42633
42636
|
async function saveDownloadedDocument(document, output) {
|
|
42634
42637
|
const { mkdir, writeFile } = await import("fs/promises");
|
|
42635
|
-
const { join: join4, basename:
|
|
42638
|
+
const { join: join4, basename: basename4, dirname: dirname2 } = await import("path");
|
|
42636
42639
|
const target = typeof output === "string" ? output : ".";
|
|
42637
|
-
const filename =
|
|
42640
|
+
const filename = basename4(document.filename || "document.pdf");
|
|
42638
42641
|
const filePath = target.endsWith(".pdf") ? target : join4(target, filename);
|
|
42639
|
-
await mkdir(
|
|
42642
|
+
await mkdir(dirname2(filePath), { recursive: true });
|
|
42640
42643
|
await writeFile(filePath, document.data);
|
|
42641
42644
|
return filePath;
|
|
42642
42645
|
}
|
|
@@ -42715,7 +42718,7 @@ async function promptSecret(question) {
|
|
|
42715
42718
|
}
|
|
42716
42719
|
async function writeSecretFile(filePath, content, force = false) {
|
|
42717
42720
|
const { mkdir, writeFile, stat: stat2 } = await import("fs/promises");
|
|
42718
|
-
const { dirname } = await import("path");
|
|
42721
|
+
const { dirname: dirname2 } = await import("path");
|
|
42719
42722
|
try {
|
|
42720
42723
|
await stat2(filePath);
|
|
42721
42724
|
if (!force) throw new Error(`${filePath} already exists. Use --force to overwrite.`);
|
|
@@ -42725,7 +42728,7 @@ async function writeSecretFile(filePath, content, force = false) {
|
|
|
42725
42728
|
}
|
|
42726
42729
|
if (error instanceof Error && !("code" in error)) throw error;
|
|
42727
42730
|
}
|
|
42728
|
-
await mkdir(
|
|
42731
|
+
await mkdir(dirname2(filePath), { recursive: true });
|
|
42729
42732
|
await writeFile(filePath, content, { mode: 384 });
|
|
42730
42733
|
return filePath;
|
|
42731
42734
|
}
|
|
@@ -45487,7 +45490,7 @@ async function handleDocs(client, subcommand, rest, flags) {
|
|
|
45487
45490
|
}
|
|
45488
45491
|
if (subcommand === "download") {
|
|
45489
45492
|
const { writeFile, mkdir } = await import("fs/promises");
|
|
45490
|
-
const { join: join4, dirname } = await import("path");
|
|
45493
|
+
const { join: join4, dirname: dirname2 } = await import("path");
|
|
45491
45494
|
if (flags.all === true) {
|
|
45492
45495
|
const outputDir = typeof flags.output === "string" ? flags.output : "./openmates-docs";
|
|
45493
45496
|
const tree = await client.listDocs();
|
|
@@ -45497,7 +45500,7 @@ async function handleDocs(client, subcommand, rest, flags) {
|
|
|
45497
45500
|
for (const slug2 of slugs) {
|
|
45498
45501
|
const content2 = await client.getDoc(slug2);
|
|
45499
45502
|
const filePath = join4(outputDir, `${slug2}.md`);
|
|
45500
|
-
await mkdir(
|
|
45503
|
+
await mkdir(dirname2(filePath), { recursive: true });
|
|
45501
45504
|
await writeFile(filePath, content2, "utf-8");
|
|
45502
45505
|
count++;
|
|
45503
45506
|
process.stderr.write(`\r Downloaded ${count}/${slugs.length}`);
|
|
@@ -45564,11 +45567,24 @@ Examples:
|
|
|
45564
45567
|
openmates docs download architecture/core/security
|
|
45565
45568
|
openmates docs download --all --output ./docs`);
|
|
45566
45569
|
}
|
|
45567
|
-
|
|
45568
|
-
const
|
|
45569
|
-
|
|
45570
|
-
|
|
45571
|
-
|
|
45570
|
+
function isCliEntrypoint() {
|
|
45571
|
+
const entrypoint = process.argv[1];
|
|
45572
|
+
if (!entrypoint) return false;
|
|
45573
|
+
try {
|
|
45574
|
+
const invokedPath = realpathSync(entrypoint);
|
|
45575
|
+
const modulePath = realpathSync(fileURLToPath(import.meta.url));
|
|
45576
|
+
return invokedPath === modulePath || basename3(invokedPath) === "cli.js" && dirname(invokedPath) === dirname(modulePath);
|
|
45577
|
+
} catch {
|
|
45578
|
+
return false;
|
|
45579
|
+
}
|
|
45580
|
+
}
|
|
45581
|
+
if (isCliEntrypoint()) {
|
|
45582
|
+
main().catch((error) => {
|
|
45583
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
45584
|
+
console.error(`Error: ${message}`);
|
|
45585
|
+
process.exit(1);
|
|
45586
|
+
});
|
|
45587
|
+
}
|
|
45572
45588
|
|
|
45573
45589
|
export {
|
|
45574
45590
|
MEMORY_TYPE_REGISTRY,
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED