internalcot
Advanced tools
| /** Parsed options accepted after `internalcot note`. */ | ||
| export interface NoteOptions { | ||
| readonly notes: string | undefined; | ||
| readonly receipt: boolean; | ||
| readonly paced: boolean; | ||
| readonly help: boolean; | ||
| } | ||
| /** Parse transcript-oriented note options without interpreting note contents. */ | ||
| export declare function parseNoteOptions(args: ReadonlyArray<string>): NoteOptions; |
| /** Parse transcript-oriented note options without interpreting note contents. */ | ||
| export function parseNoteOptions(args) { | ||
| const noteParts = []; | ||
| let receipt = false; | ||
| let paced = true; | ||
| let help = false; | ||
| let optionsEnded = false; | ||
| for (const argument of args) { | ||
| if (optionsEnded) { | ||
| noteParts.push(argument); | ||
| continue; | ||
| } | ||
| if (argument === "--") { | ||
| optionsEnded = true; | ||
| continue; | ||
| } | ||
| if (argument === "--receipt") { | ||
| receipt = true; | ||
| continue; | ||
| } | ||
| if (argument === "--no-pace") { | ||
| paced = false; | ||
| continue; | ||
| } | ||
| if (argument === "--help" || argument === "-h") { | ||
| help = true; | ||
| continue; | ||
| } | ||
| if (argument.startsWith("-")) { | ||
| throw new Error(`Unknown note option "${argument}". Run "internalcot note --help" for supported options.`); | ||
| } | ||
| noteParts.push(argument); | ||
| } | ||
| return { | ||
| notes: noteParts.length === 0 ? undefined : noteParts.join(" "), | ||
| receipt, | ||
| paced, | ||
| help, | ||
| }; | ||
| } | ||
| //# sourceMappingURL=note-options.js.map |
| {"version":3,"file":"note-options.js","sourceRoot":"","sources":["../src/note-options.ts"],"names":[],"mappings":"AAQA,iFAAiF;AACjF,MAAM,UAAU,gBAAgB,CAAC,IAA2B;IAC1D,MAAM,SAAS,GAAkB,EAAE,CAAC;IACpC,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,IAAI,KAAK,GAAG,IAAI,CAAC;IACjB,IAAI,IAAI,GAAG,KAAK,CAAC;IACjB,IAAI,YAAY,GAAG,KAAK,CAAC;IAEzB,KAAK,MAAM,QAAQ,IAAI,IAAI,EAAE,CAAC;QAC5B,IAAI,YAAY,EAAE,CAAC;YACjB,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACzB,SAAS;QACX,CAAC;QACD,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;YACtB,YAAY,GAAG,IAAI,CAAC;YACpB,SAAS;QACX,CAAC;QACD,IAAI,QAAQ,KAAK,WAAW,EAAE,CAAC;YAC7B,OAAO,GAAG,IAAI,CAAC;YACf,SAAS;QACX,CAAC;QACD,IAAI,QAAQ,KAAK,WAAW,EAAE,CAAC;YAC7B,KAAK,GAAG,KAAK,CAAC;YACd,SAAS;QACX,CAAC;QACD,IAAI,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;YAC/C,IAAI,GAAG,IAAI,CAAC;YACZ,SAAS;QACX,CAAC;QACD,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CACb,wBAAwB,QAAQ,yDAAyD,CAC1F,CAAC;QACJ,CAAC;QACD,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;IAED,OAAO;QACL,KAAK,EAAE,SAAS,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC;QAC/D,OAAO;QACP,KAAK;QACL,IAAI;KACL,CAAC;AACJ,CAAC"} |
| declare const COMMAND_BY_RUNNER: { | ||
| readonly installed: "internalcot"; | ||
| readonly npx: "npx --yes internalcot@latest"; | ||
| }; | ||
| /** Supported command runners for the rendered workflow. */ | ||
| export type RuntimeSkillRunner = keyof typeof COMMAND_BY_RUNNER; | ||
| /** Read the workflow instructions bundled with the running CLI version. */ | ||
| export declare function readRuntimeSkill(runner?: RuntimeSkillRunner): Promise<string>; | ||
| export {}; |
| import { readFile } from "node:fs/promises"; | ||
| const RUNTIME_SKILL_URL = new URL("../skill-data/internalcot/SKILL.md", import.meta.url); | ||
| const COMMAND_BY_RUNNER = { | ||
| installed: "internalcot", | ||
| npx: "npx --yes internalcot@latest", | ||
| }; | ||
| /** Read the workflow instructions bundled with the running CLI version. */ | ||
| export async function readRuntimeSkill(runner = "installed") { | ||
| try { | ||
| const source = await readFile(RUNTIME_SKILL_URL, "utf8"); | ||
| return source.replaceAll("{{internalcot}}", COMMAND_BY_RUNNER[runner]); | ||
| } | ||
| catch (cause) { | ||
| throw new Error("Runtime skill instructions are unavailable. Reinstall with: npx internalcot@latest setup", { cause }); | ||
| } | ||
| } | ||
| //# sourceMappingURL=runtime-skill.js.map |
| {"version":3,"file":"runtime-skill.js","sourceRoot":"","sources":["../src/runtime-skill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC,oCAAoC,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AACzF,MAAM,iBAAiB,GAAG;IACxB,SAAS,EAAE,aAAa;IACxB,GAAG,EAAE,8BAA8B;CAC3B,CAAC;AAKX,2EAA2E;AAC3E,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAAM,GAAuB,WAAW;IAExC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;QACzD,OAAO,MAAM,CAAC,UAAU,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;IACzE,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CACb,0FAA0F,EAC1F,EAAE,KAAK,EAAE,CACV,CAAC;IACJ,CAAC;AACH,CAAC"} |
| /** Parsed options accepted after `internalcot skill`. */ | ||
| export interface SkillOptions { | ||
| readonly runner: "installed" | "npx"; | ||
| readonly help: boolean; | ||
| } | ||
| /** Parse runtime-skill rendering options. */ | ||
| export declare function parseSkillOptions(args: ReadonlyArray<string>): SkillOptions; |
| /** Parse runtime-skill rendering options. */ | ||
| export function parseSkillOptions(args) { | ||
| let runner = "installed"; | ||
| let help = false; | ||
| for (const argument of args) { | ||
| if (argument === "--npx") { | ||
| runner = "npx"; | ||
| continue; | ||
| } | ||
| if (argument === "--help" || argument === "-h") { | ||
| help = true; | ||
| continue; | ||
| } | ||
| throw new Error(`Unknown skill option "${argument}". Run "internalcot skill --help" for supported options.`); | ||
| } | ||
| return { runner, help }; | ||
| } | ||
| //# sourceMappingURL=skill-options.js.map |
| {"version":3,"file":"skill-options.js","sourceRoot":"","sources":["../src/skill-options.ts"],"names":[],"mappings":"AAMA,6CAA6C;AAC7C,MAAM,UAAU,iBAAiB,CAAC,IAA2B;IAC3D,IAAI,MAAM,GAA2B,WAAW,CAAC;IACjD,IAAI,IAAI,GAAG,KAAK,CAAC;IAEjB,KAAK,MAAM,QAAQ,IAAI,IAAI,EAAE,CAAC;QAC5B,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;YACzB,MAAM,GAAG,KAAK,CAAC;YACf,SAAS;QACX,CAAC;QACD,IAAI,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;YAC/C,IAAI,GAAG,IAAI,CAAC;YACZ,SAAS;QACX,CAAC;QACD,MAAM,IAAI,KAAK,CACb,yBAAyB,QAAQ,0DAA0D,CAC5F,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AAC1B,CAAC"} |
| --- | ||
| name: internalcot | ||
| description: Activate a persistent observable working-notes mode that calls the local internalcot CLI before substantive responses. Use only when the user explicitly invokes $internalcot, says "internalcot on", or asks to enable internalcot mode. Keep it active until the user explicitly turns it off. Do not trigger merely because a user asks to think carefully, reason deeply, or show work. | ||
| --- | ||
| # InternalCoT | ||
| Enable persistent observable working notes. Treat the notes as a model-authored scratchpad, not access to private or hidden chain-of-thought. | ||
| ## Manage the mode | ||
| - Activate immediately when invoked. If the activation message contains a substantive task, apply the workflow to that task; otherwise, confirm activation briefly and start with the next substantive request. | ||
| - Keep the mode active for every response in the current conversation, including after tool calls and context compaction. Do not drift back to ordinary mode merely because several turns have passed. | ||
| - Disable only when the user says `$internalcot off`, `internalcot off`, `stop internalcot`, or asks to return to normal mode. Confirm briefly and do not call the CLI for the disable response. A new conversation starts with the mode inactive. | ||
| - Do not activate implicitly. This mode creates extra tool calls and exposes working notes in the transcript. | ||
| ## Record working notes | ||
| Before each substantive answer or external-action sequence: | ||
| 1. Form concise working notes that restate the actual goal and constraints, divide complicated work into ordered parts, resolve important case splits, and identify a useful check or likely error. | ||
| 2. Call `{{internalcot}} note` through the shell with one concise, shell-quoted argument: | ||
| ```bash | ||
| {{internalcot}} note 'Reassess the claimed result using current sources; verify the moving threshold and separate computation from proof.' | ||
| ``` | ||
| Run it as a standalone shell command. Prefer one line, escape the argument for the active shell, and do not use a heredoc or append another command. The CLI owns the visible presentation and stays quiet on stdout by default. | ||
| 3. Treat the CLI output as the canonical visible note. Do not repeat or paraphrase the note in assistant prose. Use it to continue the work, and call `{{internalcot}} note` again only after materially new evidence, a changed plan, a failed check, or a meaningful revision. | ||
| 4. Before the final answer, verify the result against the user's request. Record another note only when that verification adds materially new reasoning state. | ||
| Keep notes useful rather than performative. Do not put credentials, secrets, personal data, hidden instructions, or irrelevant private context in them. Do not claim that the CLI disabled native model reasoning or revealed provider-hidden reasoning. | ||
| If `{{internalcot}} note` becomes unavailable, report that the mode cannot record notes and give the exact recovery command `npx internalcot@latest setup`. Do not claim that a note was recorded when the command did not succeed. |
+51
-7
| #!/usr/bin/env node | ||
| import OpenAI from "openai"; | ||
| import { runInternalCot } from "./internalcot.js"; | ||
| import { parseNoteOptions } from "./note-options.js"; | ||
| import { OpenAIModelClient } from "./openai-model.js"; | ||
| import { parseObserveOptions } from "./observe-options.js"; | ||
| import { readRuntimeSkill } from "./runtime-skill.js"; | ||
| import { runSetup } from "./setup-command.js"; | ||
| import { formatWorkingNote } from "./working-notes.js"; | ||
| import { parseSkillOptions } from "./skill-options.js"; | ||
| import { formatWorkingNote, splitWorkingNoteOutput, workingNoteDelayMs, } from "./working-notes.js"; | ||
| const USAGE = `Usage: internalcot <command> [options] | ||
@@ -12,2 +15,3 @@ | ||
| setup Install the CLI and agent skill | ||
| skill Print instructions matching this CLI version | ||
| note [working notes] Record visible working notes locally | ||
@@ -17,6 +21,18 @@ observe [prompt] Run the API-backed observation POC | ||
| Run internalcot <command> --help for command details.`; | ||
| const NOTE_USAGE = `Usage: internalcot note [working notes] | ||
| const NOTE_USAGE = `Usage: internalcot note [options] [working notes] | ||
| Record model-authored working notes in the tool transcript without a network call. | ||
| If no notes are provided as arguments, internalcot reads them from stdin.`; | ||
| If no notes are provided as arguments, internalcot reads them from stdin. | ||
| Options: | ||
| --no-pace Write the completed note immediately instead of pacing it | ||
| --receipt Print a machine-readable JSON receipt on stdout | ||
| -h, --help Show this help`; | ||
| const SKILL_USAGE = `Usage: internalcot skill [options] | ||
| Print the internalcot workflow instructions bundled with this CLI version. | ||
| Options: | ||
| --npx Render note commands for the npx package runner | ||
| -h, --help Show this help`; | ||
| const OBSERVE_USAGE = `Usage: internalcot observe [options] [prompt] | ||
@@ -40,7 +56,8 @@ | ||
| async function runNote(args) { | ||
| if (args.length === 1 && (args[0] === "--help" || args[0] === "-h")) { | ||
| const options = parseNoteOptions(args); | ||
| if (options.help) { | ||
| process.stdout.write(`${NOTE_USAGE}\n`); | ||
| return; | ||
| } | ||
| const notes = args.length > 0 ? args.join(" ") : process.stdin.isTTY ? "" : await readStdin(); | ||
| const notes = options.notes ?? (process.stdin.isTTY ? "" : await readStdin()); | ||
| const result = formatWorkingNote(notes, process.stderr.isTTY); | ||
@@ -50,5 +67,28 @@ if (!result.ok) { | ||
| } | ||
| process.stderr.write(result.output.stderr); | ||
| process.stdout.write(result.output.stdout); | ||
| if (options.paced) { | ||
| const chunks = splitWorkingNoteOutput(result.output.stderr); | ||
| const delayMs = workingNoteDelayMs(chunks.length); | ||
| for (const [index, chunk] of chunks.entries()) { | ||
| process.stderr.write(chunk); | ||
| if (index < chunks.length - 1 && delayMs > 0) { | ||
| await new Promise((resolve) => setTimeout(resolve, delayMs)); | ||
| } | ||
| } | ||
| } | ||
| else { | ||
| process.stderr.write(result.output.stderr); | ||
| } | ||
| if (options.receipt) { | ||
| process.stdout.write(result.output.stdout); | ||
| } | ||
| } | ||
| async function runSkill(args) { | ||
| const options = parseSkillOptions(args); | ||
| if (options.help) { | ||
| process.stdout.write(`${SKILL_USAGE}\n`); | ||
| return; | ||
| } | ||
| const instructions = await readRuntimeSkill(options.runner); | ||
| process.stdout.write(instructions.endsWith("\n") ? instructions : `${instructions}\n`); | ||
| } | ||
| async function runObserve(args) { | ||
@@ -111,2 +151,6 @@ const options = parseObserveOptions(args); | ||
| } | ||
| if (command === "skill") { | ||
| await runSkill(args); | ||
| return; | ||
| } | ||
| if (command === "observe") { | ||
@@ -113,0 +157,0 @@ await runObserve(args); |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,KAAK,GAAG;;;;;;;sDAOwC,CAAC;AAEvD,MAAM,UAAU,GAAG;;;0EAGuD,CAAC;AAE3E,MAAM,aAAa,GAAG;;;;;;;;;2CASqB,CAAC;AAE5C,KAAK,UAAU,SAAS;IACtB,MAAM,MAAM,GAAkB,EAAE,CAAC;IACjC,IAAI,KAAK,EAAE,MAA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AAM,UAAU,CAAC,IAAI,CAAC,CAAC;QACvB,OAAO;IACT,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,oBAAoB,OAAO,EAAE,CAAC,CAAC;AACjD,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC9B,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;QAC/D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC;QACzE,OAAO,CAAC,QAAQ,GAAG,GAAG,CAAC;QACvB,OAAO;IACT,CAAC;IACD,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,OAAO,IAAI,CAAC,CAAC;IAClD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC"} |
@@ -1,2 +0,2 @@ | ||
| export declare const SETUP_USAGE = "Usage: internalcot setup [options]\n\nInstall the internalcot CLI and skill for your coding agent.\n\nOptions:\n --codex Install the skill for Codex\n --claude Install the skill for Claude Code\n --cli-only Install only the persistent CLI command\n --skill-only Install only the skill (requires an existing CLI)\n -p, --project Install skills in the current project instead of globally\n -y, --yes Accept the displayed plan without prompting\n --dry-run Display the plan without changing anything\n -h, --help Show this help\n\nNon-interactive example:\n npx internalcot@latest setup --codex --yes"; | ||
| export declare const SETUP_USAGE = "Usage: internalcot setup [options]\n\nInstall the internalcot CLI and skill for your coding agent.\n\nOptions:\n --codex Install the skill for Codex\n --claude Install the skill for Claude Code\n -p, --project Install skills in the current project instead of globally\n -y, --yes Accept the displayed plan without prompting\n --dry-run Display the plan without changing anything\n -h, --help Show this help\n\nNon-interactive example:\n npx internalcot@latest setup --codex --yes"; | ||
| export declare function runSetup(args: ReadonlyArray<string>): Promise<void>; |
+10
-40
@@ -1,2 +0,2 @@ | ||
| import { checkbox, confirm, select } from "@inquirer/prompts"; | ||
| import { checkbox, confirm } from "@inquirer/prompts"; | ||
| import { access } from "node:fs/promises"; | ||
@@ -14,4 +14,2 @@ import { homedir } from "node:os"; | ||
| --claude Install the skill for Claude Code | ||
| --cli-only Install only the persistent CLI command | ||
| --skill-only Install only the skill (requires an existing CLI) | ||
| -p, --project Install skills in the current project instead of globally | ||
@@ -32,11 +30,8 @@ -y, --yes Accept the displayed plan without prompting | ||
| const interactive = process.stdin.isTTY && process.stderr.isTTY && !options.yes; | ||
| const mode = options.mode ?? (interactive ? await promptForMode() : "bundle"); | ||
| const targets = mode === "cli-only" | ||
| ? [] | ||
| : options.targets.length > 0 | ||
| ? options.targets | ||
| : interactive | ||
| ? await promptForTargets() | ||
| : nonInteractiveTargetsRequired(); | ||
| const plan = await planSetup({ mode, targets, project: options.project }); | ||
| const targets = options.targets.length > 0 | ||
| ? options.targets | ||
| : interactive | ||
| ? await promptForTargets() | ||
| : nonInteractiveTargetsRequired(); | ||
| const plan = await planSetup({ targets, project: options.project }); | ||
| process.stderr.write(formatSetupPlan(plan)); | ||
@@ -55,26 +50,4 @@ if (options.dryRun) { | ||
| const result = await applySetup(plan); | ||
| process.stdout.write(formatResult(result.cliInstalled, result.skillDirectories)); | ||
| process.stdout.write(formatResult(result.skillDirectories)); | ||
| } | ||
| async function promptForMode() { | ||
| return select({ | ||
| message: "What should internalcot install?", | ||
| choices: [ | ||
| { | ||
| name: "CLI + skill (recommended)", | ||
| value: "bundle", | ||
| description: "Install the persistent command and agent instructions.", | ||
| }, | ||
| { | ||
| name: "Skill only", | ||
| value: "skill-only", | ||
| description: "Use this when the internalcot command is already installed.", | ||
| }, | ||
| { | ||
| name: "CLI only", | ||
| value: "cli-only", | ||
| description: "Install the command without agent instructions.", | ||
| }, | ||
| ], | ||
| }, promptContext); | ||
| } | ||
| async function promptForTargets() { | ||
@@ -106,7 +79,4 @@ const home = homedir(); | ||
| } | ||
| function formatResult(cliInstalled, directories) { | ||
| const lines = ["internalcot setup complete."]; | ||
| if (cliInstalled) { | ||
| lines.push("CLI: installed"); | ||
| } | ||
| function formatResult(directories) { | ||
| const lines = ["internalcot setup complete.", "CLI: installed"]; | ||
| for (const directory of directories) { | ||
@@ -113,0 +83,0 @@ lines.push(`Skill: ${directory}`); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"setup-command.js","sourceRoot":"","sources":["../src/setup-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,iBAAiB,EAAoC,MAAM,oBAAoB,CAAC;AACzF,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEpE,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;6CAekB,CAAC;AAE9C,MAAM,aAAa,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAW,CAAC;AAE1D,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,IAA2B;IACxD,MAAM,OAAO,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACxC,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,WAAW,IAAI,CAAC,CAAC;QACzC,OAAO;IACT,CAAC;IAED,MAAM,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC;IAChF,MAAM,IAAI,GAAG,OA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AO,CAAC,MAAM,CAAC,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAClF,CAAC;AACH,CAAC;AAED,SAAS,6BAA6B;IACpC,MAAM,IAAI,KAAK,CACb,yEAAyE,CAC1E,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,KAAa,EAAE,QAAiB;IACrD,OAAO,QAAQ,CAAC,CAAC,CAAC,GAAG,KAAK,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC;AAClD,CAAC;AAED,SAAS,YAAY,CAAC,WAAkC;IACtD,MAAM,KAAK,GAAG,CAAC,6BAA6B,EAAE,gBAAgB,CAAC,CAAC;IAChE,KAAK,MAAM,SAAS,IAAI,WAAW,EAAE,CAAC;QACpC,KAAK,CAAC,IAAI,CAAC,UAAU,SAAS,EAAE,CAAC,CAAC;IACpC,CAAC;IACD,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,+EAA+E,CAAC,CAAC;IAC9F,CAAC;IACD,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AACjC,CAAC;AAED,KAAK,UAAU,UAAU,CAAC,IAAY;IACpC,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,IAAI,KAAK,YAAY,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACzE,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"} |
@@ -1,5 +0,3 @@ | ||
| export type SetupMode = "bundle" | "cli-only" | "skill-only"; | ||
| export type SetupTarget = "codex" | "claude"; | ||
| export interface SetupOptions { | ||
| readonly mode: SetupMode | undefined; | ||
| readonly targets: ReadonlyArray<SetupTarget>; | ||
@@ -6,0 +4,0 @@ readonly project: boolean; |
| export function parseSetupOptions(args) { | ||
| let mode; | ||
| const targets = []; | ||
@@ -16,8 +15,2 @@ let project = false; | ||
| break; | ||
| case "--cli-only": | ||
| mode = setMode(mode, "cli-only"); | ||
| break; | ||
| case "--skill-only": | ||
| mode = setMode(mode, "skill-only"); | ||
| break; | ||
| case "--project": | ||
@@ -42,9 +35,3 @@ case "-p": | ||
| } | ||
| if (mode === "cli-only" && targets.length > 0) { | ||
| throw new Error("--cli-only cannot be combined with --codex or --claude"); | ||
| } | ||
| if (mode === "cli-only" && project) { | ||
| throw new Error("--project has no effect with --cli-only"); | ||
| } | ||
| return { mode, targets, project, yes, dryRun, help }; | ||
| return { targets, project, yes, dryRun, help }; | ||
| } | ||
@@ -56,8 +43,2 @@ function addTarget(targets, target) { | ||
| } | ||
| function setMode(current, next) { | ||
| if (current !== undefined && current !== next) { | ||
| throw new Error("Choose only one of --cli-only or --skill-only"); | ||
| } | ||
| return next; | ||
| } | ||
| //# sourceMappingURL=setup-options.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"setup-options.js","sourceRoot":"","sources":["../src/setup-options.ts"],"names":[],"mappings":"AAaA,MAAM,UAAU,iBAAiB,CAAC,IAA2B;IAC3D,IAAI,IAA2B,CAAC;IAChC,MAAM,OAAO,GAAuB,EAAE,CAAC;IACvC,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,IAAI,GAAG,GAAG,KAAK,CAAC;IAChB,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,IAAI,IAAI,GAAG,KAAK,CAAC;IAEjB,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,QAAQ,GAAG,EAAE,CAAC;YACZ,KAAK,SAAS;gBACZ,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;gBAC5B,MAAM;YACR,KAAK,UAAU;gBACb,SAAS,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;gBAC7B,MAAM;YACR,KAAK,YA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AC9B,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"} |
+1
-6
@@ -1,2 +0,2 @@ | ||
| import type { SetupMode, SetupTarget } from "./setup-options.js"; | ||
| import type { SetupTarget } from "./setup-options.js"; | ||
| export type InstallStatus = "create" | "update" | "unchanged"; | ||
@@ -10,5 +10,2 @@ export interface SkillInstall { | ||
| export interface SetupPlan { | ||
| readonly mode: SetupMode; | ||
| readonly scope: "global" | "project"; | ||
| readonly installCli: boolean; | ||
| readonly packageSpec: string; | ||
@@ -18,3 +15,2 @@ readonly skills: ReadonlyArray<SkillInstall>; | ||
| export interface PlanSetupInput { | ||
| readonly mode: SetupMode; | ||
| readonly targets: ReadonlyArray<SetupTarget>; | ||
@@ -27,3 +23,2 @@ readonly project: boolean; | ||
| export interface ApplySetupResult { | ||
| readonly cliInstalled: boolean; | ||
| readonly skillDirectories: ReadonlyArray<string>; | ||
@@ -30,0 +25,0 @@ } |
+15
-22
@@ -9,18 +9,16 @@ import { constants } from "node:fs"; | ||
| export async function planSetup(input) { | ||
| if (input.targets.length === 0) { | ||
| throw new Error("Setup requires at least one skill target"); | ||
| } | ||
| const root = input.project ? (input.cwd ?? process.cwd()) : (input.home ?? homedir()); | ||
| const skills = input.mode === "cli-only" | ||
| ? [] | ||
| : await Promise.all(input.targets.map(async (target) => { | ||
| const directory = skillDirectory(target, input.project, root); | ||
| return { | ||
| target, | ||
| label: target === "codex" ? "Codex" : "Claude Code", | ||
| directory, | ||
| status: await inspectSkill(directory), | ||
| }; | ||
| })); | ||
| const skills = await Promise.all(input.targets.map(async (target) => { | ||
| const directory = skillDirectory(target, input.project, root); | ||
| return { | ||
| target, | ||
| label: target === "codex" ? "Codex" : "Claude Code", | ||
| directory, | ||
| status: await inspectSkill(directory), | ||
| }; | ||
| })); | ||
| return { | ||
| mode: input.mode, | ||
| scope: input.project ? "project" : "global", | ||
| installCli: input.mode !== "skill-only", | ||
| packageSpec: `internalcot@${input.packageVersion ?? await readPackageVersion()}`, | ||
@@ -31,6 +29,3 @@ skills, | ||
| export function formatSetupPlan(plan) { | ||
| const lines = ["Setup plan"]; | ||
| if (plan.installCli) { | ||
| lines.push(` install CLI ${plan.packageSpec} globally`); | ||
| } | ||
| const lines = ["Setup plan", ` install CLI ${plan.packageSpec} globally`]; | ||
| for (const skill of plan.skills) { | ||
@@ -43,5 +38,3 @@ const verb = skill.status === "unchanged" ? "keep" : skill.status; | ||
| export async function applySetup(plan, runtime = {}) { | ||
| if (plan.installCli) { | ||
| await (runtime.installCli ?? installPersistentCli)(plan.packageSpec); | ||
| } | ||
| await (runtime.installCli ?? installPersistentCli)(plan.packageSpec); | ||
| const installed = []; | ||
@@ -54,3 +47,3 @@ for (const skill of plan.skills) { | ||
| } | ||
| return { cliInstalled: plan.installCli, skillDirectories: installed }; | ||
| return { skillDirectories: installed }; | ||
| } | ||
@@ -57,0 +50,0 @@ export function skillDirectory(target, project, root) { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"setup.js","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAI3C,MAAM,WAAW,GAAG,CAAC,UAAU,EAAE,oBAAoB,CAAU,CAAC;AAqChE,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,KAAqB;IACnD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI,OAAO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CAAC,IAAY;IAC3C,IAAI,CAAC;QACH,OAAO,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;YACrB,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAS,SAAS,CAAC,KAAc;IAC/B,OAAO,KAAK,YAAY,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC;AAC9E,CAAC"} |
@@ -14,3 +14,7 @@ /** Rendered streams for one observable working-note record. */ | ||
| }; | ||
| /** Split rendered output into append-only chunks without changing its contents. */ | ||
| export declare function splitWorkingNoteOutput(output: string): ReadonlyArray<string>; | ||
| /** Choose a bounded inter-chunk delay targeting roughly 700 ms total. */ | ||
| export declare function workingNoteDelayMs(chunkCount: number): number; | ||
| /** Format one working note for the transcript and return a machine-readable receipt. */ | ||
| export declare function formatWorkingNote(notes: string, styled: boolean): WorkingNoteResult; |
| const NEXT_STEP = "Continue the work. Record another note only for materially new reasoning state."; | ||
| /** Split rendered output into append-only chunks without changing its contents. */ | ||
| export function splitWorkingNoteOutput(output) { | ||
| const words = output.match(/\S+\s*/g) ?? []; | ||
| const wordsPerChunk = Math.max(1, Math.ceil(words.length / 24)); | ||
| const chunks = []; | ||
| for (let index = 0; index < words.length; index += wordsPerChunk) { | ||
| chunks.push(words.slice(index, index + wordsPerChunk).join("")); | ||
| } | ||
| return chunks; | ||
| } | ||
| /** Choose a bounded inter-chunk delay targeting roughly 700 ms total. */ | ||
| export function workingNoteDelayMs(chunkCount) { | ||
| if (chunkCount <= 1) { | ||
| return 0; | ||
| } | ||
| return Math.max(0, Math.min(55, Math.floor(700 / (chunkCount - 1)))); | ||
| } | ||
| /** Format one working note for the transcript and return a machine-readable receipt. */ | ||
@@ -6,3 +23,7 @@ export function formatWorkingNote(notes, styled) { | ||
| if (normalized.length === 0) { | ||
| return { ok: false, message: "Provide working notes as arguments or through stdin" }; | ||
| return { | ||
| ok: false, | ||
| message: "No working note was provided. Pass one quoted argument, for example: " + | ||
| "internalcot note 'Check the boundary case before drafting.'", | ||
| }; | ||
| } | ||
@@ -9,0 +30,0 @@ const italic = styled ? "\u001B[3m" : ""; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"working-notes.js","sourceRoot":"","sources":["../src/working-notes.ts"],"names":[],"mappings":"AAAA,MAAM,SAAS,GACb,iFAAiF,CAAC;AAapF,wFAAwF;AACxF,MAAM,UAAU,iBAAiB,CAAC,KAAa,EAAE,MAAe;IAC9D,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAChC,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,qDAAqD,EAAE,CAAC;IACvF,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;IACzC,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;IACxC,OAAO;QACL,EAAE,EAAE,IAAI;QACR,MAAM,EAAE;YACN,MAAM,EAAE,GAAG,MAAM,gBAAgB,UAAU,GAAG,KAAK,IAAI;YACvD,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,IAAI;SACnE;KACF,CAAC;AACJ,CAAC"} | ||
| {"version":3,"file":"working-notes.js","sourceRoot":"","sources":["../src/working-notes.ts"],"names":[],"mappings":"AAAA,MAAM,SAAS,GACb,iFAAiF,CAAC;AAapF,mFAAmF;AACnF,MAAM,UAAU,sBAAsB,CAAC,MAAc;IACnD,MAAM,KAAK,GAAG,M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AAW,CAAC,CAAC,CAAC,EAAE,CAAC;IACxC,OAAO;QACL,EAAE,EAAE,IAAI;QACR,MAAM,EAAE;YACN,MAAM,EAAE,GAAG,MAAM,gBAAgB,UAAU,GAAG,KAAK,IAAI;YACvD,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,IAAI;SACnE;KACF,CAAC;AACJ,CAAC"} |
+2
-1
| { | ||
| "name": "internalcot", | ||
| "version": "0.2.0", | ||
| "version": "0.2.1", | ||
| "description": "Visible working notes for coding agents, plus an API observation POC.", | ||
@@ -29,2 +29,3 @@ "license": "MIT", | ||
| "dist", | ||
| "skill-data", | ||
| "skills" | ||
@@ -31,0 +32,0 @@ ], |
+29
-21
@@ -15,3 +15,3 @@ # internalcot | ||
| Choose **CLI + skill**, then select Codex, Claude Code, or both. Setup shows the exact global command and skill paths before it changes anything. | ||
| Setup always installs the persistent CLI and its skill together. Select Codex, Claude Code, or both; setup shows the exact global command and skill paths before it changes anything. | ||
@@ -24,3 +24,3 @@ For a non-interactive Codex install: | ||
| Use `--project` to place the skill in the current repository instead of your home directory. Other useful variants are: | ||
| Use `--project` to place the skill in the current repository instead of your home directory. Preview the complete installation without making changes: | ||
@@ -30,8 +30,2 @@ ```sh | ||
| npx internalcot@latest setup --codex --project --dry-run | ||
| # The persistent command already exists | ||
| npx internalcot@latest setup --codex --skill-only --yes | ||
| # Install only the command | ||
| npx internalcot@latest setup --cli-only --yes | ||
| ``` | ||
@@ -41,10 +35,13 @@ | ||
| You can also install each part manually: | ||
| The installed discovery skill is intentionally small. When `$internalcot` is invoked, it runs `internalcot skill` to load workflow instructions bundled with the installed CLI, so the instructions always match that CLI version. | ||
| ## Install the discovery skill only | ||
| The internalcot skill is also distributed through [skills.sh](https://skills.sh/). Install only the discovery skill with: | ||
| ```sh | ||
| npm install --global internalcot | ||
| npx skills add morluto/internalcot | ||
| ``` | ||
| Restart your coding agent if the new skill does not appear immediately. | ||
| This does not install the CLI. If it is missing, the discovery skill uses `npx --yes internalcot@latest` for workflow and note calls, so skill-only installation still works. The recommended setup remains faster because it installs the CLI persistently. Restart your coding agent if the new skill does not appear immediately. | ||
@@ -59,3 +56,3 @@ ## Turn working notes on | ||
| The mode remains active for subsequent requests. The agent calls `internalcot note` before substantive work and again only when it has materially new reasoning state. | ||
| The mode remains active for subsequent requests. The agent calls `internalcot note` before substantive work and again only when it has materially new reasoning state. The CLI output is the visible note, so the agent does not repeat it in prose. | ||
@@ -70,5 +67,17 @@ Turn it off with: | ||
| The installed skill loads the current workflow with: | ||
| ```sh | ||
| internalcot skill | ||
| ``` | ||
| For a skill-only installation without a persistent CLI, the discovery skill loads an npx-ready workflow with: | ||
| ```sh | ||
| npx --yes internalcot@latest skill --npx | ||
| ``` | ||
| ## Use the working-notes CLI directly | ||
| Pass a short note as arguments: | ||
| Pass a short note as one quoted argument: | ||
@@ -79,13 +88,12 @@ ```sh | ||
| For multiline notes, use stdin: | ||
| The CLI displays the completed note in small, append-only chunks and writes nothing to stdout by default. This paced display works in hosts that stream process output and safely appears all at once in hosts that buffer it. It is presentation of an already-authored note, not token-by-token access to hidden reasoning. | ||
| For immediate output or a machine-readable receipt: | ||
| ```sh | ||
| internalcot note <<'INTERNALCOT' | ||
| Goal: prove descent from the equation. | ||
| Constraint: handle every equality case. | ||
| Check: verify the mutated coordinate stays positive. | ||
| INTERNALCOT | ||
| internalcot note --no-pace 'Check the equality case.' | ||
| internalcot note --receipt 'Check the equality case.' | ||
| ``` | ||
| The note is written to stderr with an `internalcot>` prefix. Stdout receives a small JSON receipt: | ||
| The note is written to stderr with an `internalcot>` prefix. With `--receipt`, stdout receives: | ||
@@ -155,3 +163,3 @@ ```json | ||
| Verify the packed `dist/cli.js` is executable and the `skills/internalcot` directory is included before publishing. | ||
| Verify the packed `dist/cli.js` is executable and the `skills/internalcot` and `skill-data/internalcot` directories are included before publishing. | ||
@@ -158,0 +166,0 @@ ## Credit |
@@ -8,32 +8,27 @@ --- | ||
| Enable persistent observable working notes. Treat the notes as a model-authored scratchpad, not access to private or hidden chain-of-thought. | ||
| Install the CLI and this skill together with: | ||
| ## Manage the mode | ||
| ```bash | ||
| npx internalcot@latest setup | ||
| ``` | ||
| - Activate immediately when invoked. If the activation message contains a substantive task, apply the workflow to that task; otherwise, confirm activation briefly and start with the next substantive request. | ||
| - Keep the mode active for subsequent responses, including after tool calls and context compaction. | ||
| - Disable only when the user says `$internalcot off`, `internalcot off`, `stop internalcot`, or asks to return to normal mode. Confirm briefly and do not call the CLI for the disable response. | ||
| - Do not activate implicitly. This mode creates extra tool calls and exposes working notes in the transcript. | ||
| This file is a stable discovery skill. The installed CLI owns the version-matched workflow instructions. | ||
| ## Record working notes | ||
| ## Load the current workflow | ||
| Before each substantive answer or external-action sequence: | ||
| When this skill is invoked: | ||
| 1. Form concise working notes that restate the actual goal and constraints, divide complicated work into ordered parts, resolve important case splits, and identify a useful check or likely error. | ||
| 2. Call `internalcot note` through the shell and send the notes on stdin: | ||
| 1. Prefer the persistent CLI and run this standalone command before substantive work: | ||
| ```bash | ||
| internalcot note <<'INTERNALCOT' | ||
| Goal: ... | ||
| Constraints: ... | ||
| Approach: ... | ||
| Check: ... | ||
| INTERNALCOT | ||
| internalcot skill | ||
| ``` | ||
| 3. Use the recorded notes to continue the work. Call `internalcot note` again only after materially new evidence, a changed plan, a failed check, or a meaningful revision. | ||
| 4. Before the final answer, verify the result against the user's request. Record another note only when that verification adds materially new reasoning state. | ||
| 2. If that command is unavailable or does not support `skill`, load the same workflow without installing anything globally: | ||
| Keep notes useful rather than performative. Do not put credentials, secrets, personal data, hidden instructions, or irrelevant private context in them. Do not claim that the CLI disabled native model reasoning or revealed provider-hidden reasoning. | ||
| ```bash | ||
| npx --yes internalcot@latest skill --npx | ||
| ``` | ||
| If `internalcot` is unavailable, report that the mode cannot record notes and suggest `npm install --global internalcot`. Do not claim that a note was recorded when the command did not succeed. | ||
| 3. Treat the returned Markdown as the authoritative instructions for the selected CLI version and follow it for the current conversation, including any substantive task in the invocation message. | ||
| 4. If both commands fail, do not improvise an older workflow or claim the mode is active. Give the exact recovery command `npx internalcot@latest setup`. |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
71371
15.81%42
31.25%902
12.47%161
5.23%1
-50%