Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions bin/obsidian-idea-intake
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env node
import { runObsidianIdeaIntakeCli } from '../scripts/obsidian-idea-intake.mjs';

runObsidianIdeaIntakeCli().catch((error) => {
process.stdout.write(`${JSON.stringify({ ok: false, error: error?.message || String(error), sideEffects: { obsidianWrites: false, kanbanWrites: false, githubCalls: false, githubWrites: false, telegramSends: false, serviceTimerChanges: false, dispatcherSwarm: false, liveCapturedIdeasAppend: false, tempCapturedIdeasAppend: false } }, null, 2)}\n`);
process.exitCode = 1;
});
7 changes: 7 additions & 0 deletions bin/public-github-discovery-timer-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env node
import { runPublicGithubDiscoveryTimerCli } from '../scripts/public-github-discovery-timer.mjs';

runPublicGithubDiscoveryTimerCli().catch((error) => {
process.stderr.write(`${error.message}\n`);
process.exitCode = 1;
});
7 changes: 7 additions & 0 deletions bin/public-github-discovery-timer-plan
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env node
import { runPublicGithubDiscoveryTimerCli } from '../scripts/public-github-discovery-timer.mjs';

runPublicGithubDiscoveryTimerCli().catch((error) => {
process.stderr.write(`${error.message}\n`);
process.exitCode = 1;
});
7 changes: 7 additions & 0 deletions bin/telegram-approval-poll
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env node
import { runTelegramApprovalPollCli } from '../scripts/telegram-approval-poll.mjs';

runTelegramApprovalPollCli().catch((error) => {
process.stdout.write(`${JSON.stringify({ ok: false, error: String(error?.message || error).replace(/bot\d+:[A-Za-z0-9_-]+/g, 'bot[REDACTED]'), offsetUpdated: false, decisionsAppended: 0, decision_rows: [], executor: false, clone: false, fork: false, runCode: false, installDependencies: false, createRepo: false, push: false, prOpen: false, merge: false, delete: false, githubWrites: false, auditAppend: false, durableMutation: false, obsidianKanbanWrites: false, note: 'No executor ran. No approval decision recorded after this error.' }, null, 2)}\n`);
process.exitCode = 1;
});
4 changes: 4 additions & 0 deletions bin/telegram-approved-discovery-executor
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env node
import { runTelegramApprovedDiscoveryExecutorCli } from '../scripts/telegram-approved-discovery-executor.mjs';

runTelegramApprovedDiscoveryExecutorCli();
3 changes: 3 additions & 0 deletions bin/telegram-approved-discovery-research
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
set -euo pipefail
exec node "$(dirname "$0")/../scripts/telegram-approved-discovery-research.mjs" "$@"
7 changes: 7 additions & 0 deletions bin/telegram-approved-implementation-build-plan
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env node
import { runApprovedImplementationBuildPlanCli } from '../scripts/telegram-approved-implementation-build-plan.mjs'

runApprovedImplementationBuildPlanCli().catch((error) => {
process.stderr.write(`${error.message}\n`)
process.exitCode = 1
})
7 changes: 7 additions & 0 deletions bin/telegram-code-edit-approval-packet
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env node
import { runTelegramCodeEditApprovalPacketCli } from '../scripts/telegram-code-edit-approval-packet.mjs'

runTelegramCodeEditApprovalPacketCli().catch((error) => {
process.stderr.write(`${error.message}\n`)
process.exitCode = 1
})
7 changes: 7 additions & 0 deletions bin/telegram-discovery-approval-preview
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env node
import { runTelegramDiscoveryNotificationCli } from '../scripts/telegram-discovery-notification.mjs';

runTelegramDiscoveryNotificationCli().catch((error) => {
process.stdout.write(`${JSON.stringify({ ok: false, sent: false, executed: false, approved: false, rejected: false, error: error.message.replace(/bot\d+:[A-Za-z0-9_-]+/g, 'bot[REDACTED]'), githubCalls: false, githubWrites: false, cloneForkRunInstallCreateRepoPushPrMergeDelete: false, auditAppend: false, durableMutation: false, obsidianKanbanWrites: false, note: 'No approve/reject commands. No action taken.' }, null, 2)}\n`);
process.exitCode = 1;
});
7 changes: 7 additions & 0 deletions bin/telegram-discovery-approval-send
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env node
import { runTelegramDiscoveryNotificationCli } from '../scripts/telegram-discovery-notification.mjs';

runTelegramDiscoveryNotificationCli().catch((error) => {
process.stdout.write(`${JSON.stringify({ ok: false, sent: false, stateAppended: false, executed: false, approved: false, rejected: false, error: error.message.replace(/bot\d+:[A-Za-z0-9_-]+/g, 'bot[REDACTED]'), githubCalls: false, githubWrites: false, cloneForkRunInstallCreateRepoPushPrMergeDelete: false, auditAppend: false, durableMutation: false, obsidianKanbanWrites: false, getUpdatesPolling: false, approveRejectHandling: false, executor: false, note: 'No action taken.' }, null, 2)}\n`);
process.exitCode = 1;
});
7 changes: 7 additions & 0 deletions bin/telegram-discovery-notification-preview
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env node
import { runTelegramDiscoveryNotificationCli } from '../scripts/telegram-discovery-notification.mjs';

runTelegramDiscoveryNotificationCli().catch((error) => {
process.stdout.write(`${JSON.stringify({ ok: false, sent: false, error: error.message.replace(/bot\d+:[A-Za-z0-9_-]+/g, 'bot[REDACTED]'), githubCalls: false, githubWrites: false, cloneForkRunInstallCreateRepoPushPrMergeDelete: false, auditAppend: false, durableMutation: false, obsidianKanbanWrites: false, note: 'No action taken.' }, null, 2)}\n`);
process.exitCode = 1;
});
7 changes: 7 additions & 0 deletions bin/telegram-discovery-notification-send
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env node
import { runTelegramDiscoveryNotificationCli } from '../scripts/telegram-discovery-notification.mjs';

runTelegramDiscoveryNotificationCli().catch((error) => {
process.stdout.write(`${JSON.stringify({ ok: false, sent: false, error: error.message.replace(/bot\d+:[A-Za-z0-9_-]+/g, 'bot[REDACTED]'), githubCalls: false, githubWrites: false, cloneForkRunInstallCreateRepoPushPrMergeDelete: false, auditAppend: false, durableMutation: false, obsidianKanbanWrites: false, note: 'No action taken.' }, null, 2)}\n`);
process.exitCode = 1;
});
7 changes: 7 additions & 0 deletions bin/telegram-message-preview
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env node
import { runTelegramMessagePreviewCli } from '../scripts/telegram-message-format.mjs'

runTelegramMessagePreviewCli().catch((error) => {
process.stdout.write(`${JSON.stringify({ ok: false, blocked: true, error: String(error?.message || error), sent: false }, null, 2)}\n`)
process.exitCode = 1
})
7 changes: 7 additions & 0 deletions bin/telegram-notification-credentials-status
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env node
import { runTelegramChatRegistrationCli } from '../scripts/telegram-chat-registration.mjs';

runTelegramChatRegistrationCli().catch((error) => {
process.stdout.write(`${JSON.stringify({ ok: false, error: String(error?.message || error).replace(/bot\d+:[A-Za-z0-9_-]+|\b\d{5,}:[A-Za-z0-9_-]+\b/g, '[REDACTED]'), sentTelegramMessages: false, githubCalls: false, githubWrites: false, auditAppend: false, durableMutation: false, obsidianKanbanWrites: false, approvalActions: false, note: 'No action taken.' }, null, 2)}\n`);
process.exitCode = 1;
});
7 changes: 7 additions & 0 deletions bin/telegram-register-chat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env node
import { runTelegramChatRegistrationCli } from '../scripts/telegram-chat-registration.mjs';

runTelegramChatRegistrationCli().catch((error) => {
process.stdout.write(`${JSON.stringify({ ok: false, error: String(error?.message || error).replace(/bot\d+:[A-Za-z0-9_-]+|\b\d{5,}:[A-Za-z0-9_-]+\b/g, '[REDACTED]'), sentTelegramMessages: false, githubCalls: false, githubWrites: false, auditAppend: false, durableMutation: false, obsidianKanbanWrites: false, approvalActions: false, note: 'No action taken.' }, null, 2)}\n`);
process.exitCode = 1;
});
3 changes: 3 additions & 0 deletions bin/telegram-research-implementation-proposal
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
set -euo pipefail
exec node "$(dirname "$0")/../scripts/telegram-research-implementation-proposal.mjs" "$@"
7 changes: 7 additions & 0 deletions bin/telegram-source-code-edit-lane
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env node
import { runTelegramSourceCodeEditLaneCli } from '../scripts/telegram-source-code-edit-lane.mjs'

runTelegramSourceCodeEditLaneCli().catch((error) => {
process.stderr.write(`${error.stack || error.message}\n`)
process.exitCode = 1
})
19 changes: 19 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@
"license": "MIT",
"private": true,
"type": "module",
"bin": {
"telegram-message-preview": "./bin/telegram-message-preview",
"public-github-discovery-timer-plan": "./bin/public-github-discovery-timer-plan",
"public-github-discovery-timer-install": "./bin/public-github-discovery-timer-install",
"obsidian-idea-intake": "./bin/obsidian-idea-intake",
"telegram-discovery-notification-preview": "./bin/telegram-discovery-notification-preview",
"telegram-discovery-notification-send": "./bin/telegram-discovery-notification-send",
"telegram-discovery-approval-preview": "./bin/telegram-discovery-approval-preview",
"telegram-discovery-approval-send": "./bin/telegram-discovery-approval-send",
"telegram-register-chat": "./bin/telegram-register-chat",
"telegram-notification-credentials-status": "./bin/telegram-notification-credentials-status",
"telegram-approval-poll": "./bin/telegram-approval-poll",
"telegram-approved-discovery-executor": "./bin/telegram-approved-discovery-executor",
"telegram-approved-discovery-research": "./bin/telegram-approved-discovery-research",
"telegram-research-implementation-proposal": "./bin/telegram-research-implementation-proposal",
"telegram-approved-implementation-build-plan": "./bin/telegram-approved-implementation-build-plan",
"telegram-code-edit-approval-packet": "./bin/telegram-code-edit-approval-packet",
"telegram-source-code-edit-lane": "./bin/telegram-source-code-edit-lane"
},
"main": "electron/main.cjs",
"scripts": {
"dev": "vite dev",
Expand Down
127 changes: 127 additions & 0 deletions scripts/__snapshots__/telegram-message-format.test.mjs.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`human-readable Telegram message formatting > formats approval as a short six-part phone message 1`] = `
"Approval needed

What happened: Request 90abcdef is ready for learn_from.
Recommendation: Approve only if the scope looks right.
If you approve: I will do only the approved next step.
What will NOT happen: No GitHub writes, clone/fork/install, code edits, or durable mutation.
Details saved in report.
Reply: Approve: /approve 90abcdef
Reject: /reject 90abcdef"
`;

exports[`human-readable Telegram message formatting > formats approval-recorded as a short six-part phone message 1`] = `
"Approval recorded

What happened: approved recorded for 90abcdef.
Recommendation: Next worker may proceed only within the approved scope.
If you approve: Already recorded. No extra reply needed.
What will NOT happen: Recording the reply did not run executor, edit code, call GitHub, or mutate durable store.
Reply: No reply needed."
`;

exports[`human-readable Telegram message formatting > formats blocked-error as a short six-part phone message 1`] = `
"Blocked

What happened: Exact edit scope is missing.
Recommendation: Fix the blocker or send a narrower approval.
If you approve: Approval alone may not continue until the blocker is fixed.
What will NOT happen: No retry, code edit, GitHub call/write, audit append, durable mutation, or Obsidian/Kanban write.
Reply: Reply with corrected scope or say stop."
`;

exports[`human-readable Telegram message formatting > formats code-edit-approval as a short six-part phone message 1`] = `
"Code edit approval needed

What happened: Edit packet edit1 is ready. Files: scripts/telegram-message-format.mjs, bin/telegram-message-preview.
Recommendation: Approve only if these exact files are right.
If you approve: Reply /approve edit1 to allow edits to the exact listed files.
What will NOT happen: No extra files, staging, commit, GitHub call/write, audit append, or durable mutation.
Details saved in report.
Reply: Approve: /approve edit1
Reject: /reject edit1"
`;

exports[`human-readable Telegram message formatting > formats completion as a short six-part phone message 1`] = `
"Execution completed

What happened: Completed for done1.
Recommendation: Review the result before approving any stage/commit/send step.
If you approve: Reply /approve done1 only if a follow-up approval request asks for it.
What will NOT happen: No staging, commit, push, PR, GitHub write, audit append, or durable mutation happened here.
Details saved in report.
Reply: Reply with the next exact instruction if you want follow-up work."
`;

exports[`human-readable Telegram message formatting > formats discovery as a short six-part phone message 1`] = `
"Discovery ready

What happened: Found owner/repo for Cleaner Telegram approval UX.
Recommendation: learn_from
If you approve: Reply /approve 90abcdef to allow the next read-only step.
What will NOT happen: No clone, fork, GitHub write, code edit, audit append, or Obsidian/Kanban write.
Details saved in report.
Reply: Approve: /approve 90abcdef
Reject: /reject 90abcdef"
`;

exports[`human-readable Telegram message formatting > formats implementation-proposal-approval as a short six-part phone message 1`] = `
"Implementation proposal ready

What happened: Proposal aaaabbbb is ready for review.
Recommendation: Approve only if you want a later build plan; this is not code approval.
If you approve: Reply /approve aaaabbbb to allow a build plan.
What will NOT happen: No code edits, commands, installs, GitHub writes, audit append, or durable mutation.
Details saved in report.
Reply: Approve: /approve aaaabbbb
Reject: /reject aaaabbbb"
`;

exports[`human-readable Telegram message formatting > telegram-message-preview --type approval --json works without side effects 1`] = `
"Approval needed

What happened: Request 90abcdef is ready for learn_from.
Recommendation: Approve only if the scope looks right.
If you approve: I will do only the approved next step.
What will NOT happen: No GitHub writes, clone/fork/install, code edits, or durable mutation.
Details saved in report.
Reply: Approve: /approve 90abcdef
Reject: /reject 90abcdef"
`;

exports[`human-readable Telegram message formatting > telegram-message-preview --type code-edit-approval --json works without side effects 1`] = `
"Code edit approval needed

What happened: Edit packet edit1 is ready. Files: scripts/telegram-message-format.mjs, bin/telegram-message-preview.
Recommendation: Approve only if these exact files are right.
If you approve: Reply /approve edit1 to allow edits to the exact listed files.
What will NOT happen: No extra files, staging, commit, GitHub call/write, audit append, or durable mutation.
Details saved in report.
Reply: Approve: /approve edit1
Reject: /reject edit1"
`;

exports[`human-readable Telegram message formatting > telegram-message-preview --type completion --json works without side effects 1`] = `
"Execution completed

What happened: Completed for done1.
Recommendation: Review the result before approving any stage/commit/send step.
If you approve: Reply /approve done1 only if a follow-up approval request asks for it.
What will NOT happen: No staging, commit, push, PR, GitHub write, audit append, or durable mutation happened here.
Details saved in report.
Reply: Reply with the next exact instruction if you want follow-up work."
`;

exports[`human-readable Telegram message formatting > telegram-message-preview --type discovery --json works without side effects 1`] = `
"Discovery ready

What happened: Found owner/repo for Cleaner Telegram approval UX.
Recommendation: learn_from
If you approve: Reply /approve 90abcdef to allow the next read-only step.
What will NOT happen: No clone, fork, GitHub write, code edit, audit append, or Obsidian/Kanban write.
Details saved in report.
Reply: Approve: /approve 90abcdef
Reject: /reject 90abcdef"
`;
Loading