@promethea-research/sundial 0.0.0-stage → 0.2.1

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,3 +1,184 @@
1
- # Temporary Holding Version
1
+ # Sundial (`@promethea-research/sundial`)
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ **Sundial** is an agentic terminal harness and cognitive co-processor created by [Promethea Research](https://promethearesearch.com), powered by **Uchi**—Promethea Research's flagship cognitive model (**99.8% zero-shot mean across 48 industry and Stage 8 BCI benchmarks**).
4
+
5
+ Sundial runs directly in your terminal, shares the same account, conversations, billing, and **Knowledge Graphs** as the [Sundial Web Workspace](https://sundial.promethearesearch.com) and Desktop App, and executes verified code edits and shell commands across Linux (`bash`), macOS (`zsh`), and Windows (`PowerShell` / `CMD`).
6
+
7
+ ---
8
+
9
+ ## Quickstart
10
+
11
+ ### 1. Install via npm
12
+
13
+ Requires **Node.js 20+**:
14
+
15
+ ```bash
16
+ npm i @promethea-research/sundial
17
+ ```
18
+ *(Or globally with `npm i -g @promethea-research/sundial` — both register the `sundial` command in your terminal `PATH` automatically.)*
19
+
20
+ ### 2. Launch & Sign In
21
+
22
+ Run `sundial` in your terminal:
23
+
24
+ ```bash
25
+ sundial
26
+ ```
27
+
28
+ Inside the interactive terminal prompt, sign in to your Promethea Research account (or start immediately as a guest):
29
+
30
+ ```text
31
+ /login
32
+ ```
33
+
34
+ ### 3. Run Non-Interactive / Headless Tasks (`sundial exec`)
35
+
36
+ Execute a single turn or autonomous coding loop directly from scripts or CI pipelines:
37
+
38
+ ```bash
39
+ # Single non-interactive prompt (streams reply to stdout)
40
+ sundial exec "summarize the authentication flow in this repository"
41
+
42
+ # Autonomous coding agent loop (plan -> edit -> run tests until passing)
43
+ sundial exec --code --approvals full-auto "fix the failing unit tests in src/auth"
44
+
45
+ # Multi-turn scripted run from a JSON array of prompts with structured JSON output
46
+ sundial exec --turns prompts.json --json --pace 10
47
+ ```
48
+
49
+ ---
50
+
51
+ ## Command-Line Interface Reference
52
+
53
+ ### Synopsis
54
+
55
+ ```bash
56
+ sundial [folder] [options]
57
+ sundial exec "<prompt>" [folder] [options]
58
+ sundial exec --turns <file.json> [folder] [options]
59
+ ```
60
+
61
+ ### Options & Flags
62
+
63
+ | Flag | Values / Format | Description |
64
+ | :--- | :--- | :--- |
65
+ | `--model <id>` | `uchi` *(default)* | Select the model for the session (`uchi` is Promethea Research's flagship model). |
66
+ | `--effort <tier>` | `low` \| `medium` \| `high` | Reasoning depth and compute allocation per turn. |
67
+ | `--approvals <mode>` | `suggest` \| `auto-edit` \| `full-auto` | Approval gate policy for file edits and shell commands (`suggest` asks before edits/commands; `auto-edit` applies file edits automatically and asks before shell commands; `full-auto` runs edits and sandboxed commands autonomously). |
68
+ | `--sandbox <mode>` | `read-only` \| `workspace-write` | File-system write boundary (`read-only` prevents any file modifications; `workspace-write` restricts writes to the active project directory). |
69
+ | `--code` | *(boolean, `exec` mode)* | Run Uchi's multi-step coding agent on the workspace (plan, edit files, and run verification tests). |
70
+ | `--turns <path>` | `file.json` *(`exec` mode)* | Execute multiple sequential turns from a JSON array of prompt strings (`["turn 1", "turn 2"]`). |
71
+ | `--json` | *(boolean, `exec` mode)* | Emit a single structured JSON object `{"replies": [...], "errors": [...]}` on `stdout`. |
72
+ | `--pace <N>` | Positive integer *(`exec` mode)* | Rate-limit scripted executions to at most `N` turns per minute. |
73
+ | `--server <url>` | URL | Override the Sundial backend endpoint (defaults to `https://sundial.promethearesearch.com` or `$PROMETHEA_URL`). |
74
+ | `--version` | *(boolean)* | Print the installed `@promethea-research/sundial` version and exit. |
75
+
76
+ ---
77
+
78
+ ## Interactive Slash Commands & Shortcuts
79
+
80
+ Inside the `sundial` terminal UI, type `/` to open the interactive command autocomplete menu:
81
+
82
+ | Command | Description |
83
+ | :--- | :--- |
84
+ | `/code <task>` | Run Uchi's autonomous coding agent on the current folder: plan, edit files, and run tests until they pass. |
85
+ | `/plan <task>` | Formulate a step-by-step architectural plan without modifying any files until you approve. |
86
+ | `/model` | Switch the active model (`Uchi` is the flagship model). |
87
+ | `/effort` | Choose reasoning effort tier (`low`, `medium`, or `high`). |
88
+ | `/approvals` | Set approval policy (`suggest`, `auto-edit`, or `full-auto`). |
89
+ | `/sandbox` | Set sandbox boundary (`read-only` or `workspace-write`). |
90
+ | `/diff` | Inspect unified diffs of all file changes made in the current thread. |
91
+ | `/undo` | Revert the most recent file modification made by Sundial. |
92
+ | `/compact [focus]` | Summarize earlier turns in the thread to free up context window space (optionally specifying what details to preserve). |
93
+ | `/new` | Start a clean conversation thread. |
94
+ | `/resume` | Browse and resume an earlier conversation thread from your account. |
95
+ | `/knowledge` | Open your Personal, Organizational, and Public Knowledge Graphs in the browser. |
96
+ | `/init` | Create a starter `PROMETHEA.md` project instruction file in the current workspace. |
97
+ | `/status` | Display current account, active plan, token allowance meters, model, sandbox policy, and loaded instruction files. |
98
+ | `/usage` | View session, weekly, and monthly token allowance windows and remaining credits. |
99
+ | `/upgrade` | Open Sundial plans and billing in your browser. |
100
+ | `/login` | Authenticate this machine with your Promethea Research account via browser device code. |
101
+ | `/logout` | Remove local authentication credentials from this machine. |
102
+ | `/help` | List all interactive commands and keyboard shortcuts. |
103
+ | `/quit` / `/exit` | Exit Sundial. |
104
+
105
+ ### Prompt Shortcuts & Keybindings
106
+
107
+ - **`@path/to/file`** — Attach a local file directly into the prompt context.
108
+ - **`# <instruction>`** — Append a persistent project rule directly to `./PROMETHEA.md` (e.g., `# always run vitest before finishing`).
109
+ - **`Shift+Tab`** — Cycle approval modes on the fly (`suggest` → `auto-edit` → `full-auto`).
110
+ - **`Tab`** — Autocomplete the highlighted `/command`.
111
+ - **`Esc`** — Stop an in-progress generation or agent turn immediately.
112
+ - **`Ctrl+C`** — Stop an active turn, or exit Sundial when idle.
113
+
114
+ ---
115
+
116
+ ## Project Instructions (`PROMETHEA.md` / `SUNDIAL.md`)
117
+
118
+ Sundial automatically loads plain-Markdown instruction files from your repository so Uchi follows your build commands, coding conventions, and architectural rules on every turn. Files are merged from general to specific:
119
+
120
+ 1. `~/.config/promethea/PROMETHEA.md` — Your personal global instructions across all projects.
121
+ 2. `SUNDIAL.md`, `PROMETHEA.md`, `AGENTS.md`, or `UCHI.md` — Read from the Git repository root down to the current working directory.
122
+ 3. `.promethea/PROMETHEA.md` — Checked-in workspace instructions.
123
+
124
+ Run `/init` inside `sundial` to generate a `PROMETHEA.md` template in your current directory, or prefix any prompt with `# ` to append a rule automatically.
125
+
126
+ ---
127
+
128
+ ## Model Context Protocol (MCP) Servers
129
+
130
+ Sundial supports local **MCP (`2025-06-18`) stdio servers** out of the box. Configure MCP servers in either `.promethea/sundial.json` (project-scoped) or `~/.config/promethea/sundial.json` (user-scoped):
131
+
132
+ ```json
133
+ {
134
+ "mcpServers": {
135
+ "filesystem-extra": {
136
+ "command": "npx",
137
+ "args": ["-y", "@modelcontextprotocol/server-everything"],
138
+ "env": {},
139
+ "autoApprove": false
140
+ }
141
+ }
142
+ }
143
+ ```
144
+
145
+ When Sundial starts, it initializes each configured MCP server over JSON-RPC stdio and exposes its tools to Uchi. By default, MCP tool calls require user confirmation unless `"autoApprove": true` is explicitly set for that server.
146
+
147
+ ---
148
+
149
+ ## Configuration & Environment Variables
150
+
151
+ - **Config File Location:** `~/.config/promethea/sundial.json` (or `$XDG_CONFIG_HOME/promethea/sundial.json`, overridable via `$SUNDIAL_CONFIG_DIR`). Created with `0600` user-only permissions.
152
+ - **`PROMETHEA_URL`:** Optional environment variable to override the default server URL (`https://sundial.promethearesearch.com`).
153
+
154
+ ---
155
+
156
+ ## Uchi Flagship Benchmark Highlights
157
+
158
+ Uchi achieves a **99.8% zero-shot mean across 48 industry and Stage 8 BCI benchmarks**:
159
+
160
+ - **100.0%** SWE-bench Verified & GPQA Diamond
161
+ - **100.0%** AIME & OSWorld
162
+ - **99.95%** FrontierMath
163
+ - **100.0%** Stage 8 Non-Invasive BCI Intent Decoding
164
+
165
+ Explore the complete 48-benchmark breakdown at [sundial.promethearesearch.com/uchi](https://sundial.promethearesearch.com/uchi).
166
+
167
+ ---
168
+
169
+ ## Official Links & Support
170
+
171
+ - **Sundial Web Workspace:** [https://sundial.promethearesearch.com](https://sundial.promethearesearch.com)
172
+ - **CLI Documentation:** [https://sundial.promethearesearch.com/docs/cli](https://sundial.promethearesearch.com/docs/cli)
173
+ - **API Reference:** [https://sundial.promethearesearch.com/docs/api](https://sundial.promethearesearch.com/docs/api)
174
+ - **Uchi Model & Benchmarks:** [https://sundial.promethearesearch.com/uchi](https://sundial.promethearesearch.com/uchi)
175
+ - **Pricing & Plans:** [https://sundial.promethearesearch.com/pricing](https://sundial.promethearesearch.com/pricing)
176
+ - **Promethea Research:** [https://promethearesearch.com](https://promethearesearch.com)
177
+ - **Security & Privacy:** [https://sundial.promethearesearch.com/security](https://sundial.promethearesearch.com/security)
178
+ - **Support:** [support@promethearesearch.com](mailto:support@promethearesearch.com)
179
+
180
+ ---
181
+
182
+ ## License
183
+
184
+ Copyright © Promethea Research LLC. All rights reserved. Use of `@promethea-research/sundial` is governed by the Promethea Research [Terms of Service](https://sundial.promethearesearch.com/terms) and [Privacy Policy](https://sundial.promethearesearch.com/privacy).
@@ -0,0 +1,84 @@
1
+ #!/usr/bin/env node
2
+ // Ensures `sundial` is runnable directly in the terminal even after `npm i @promethea-research/sundial` (without -g).
3
+ import fs from "node:fs";
4
+ import os from "node:os";
5
+ import path from "node:path";
6
+ import { spawnSync } from "node:child_process";
7
+ import { fileURLToPath } from "node:url";
8
+
9
+ try {
10
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
11
+ const entry = path.resolve(__dirname, "sundial.js");
12
+ try { fs.chmodSync(entry, 0o755); } catch {}
13
+
14
+ const home = os.homedir();
15
+ const pathDirs = (process.env.PATH || "")
16
+ .split(path.delimiter)
17
+ .map((d) => d.trim())
18
+ .filter((d) => d && !d.includes("node_modules"));
19
+
20
+ if (process.platform === "win32") {
21
+ const cmdScript = `@echo off\r\nnode "${entry}" %*\r\n`;
22
+ const shScript = `#!/usr/bin/env sh\nexec node "${entry.replace(/\\/g, "/")}" "$@"\n`;
23
+ const winCandidates = [
24
+ process.env.APPDATA ? path.join(process.env.APPDATA, "npm") : "",
25
+ process.env.LOCALAPPDATA ? path.join(process.env.LOCALAPPDATA, "Microsoft", "WindowsApps") : "",
26
+ ...pathDirs,
27
+ ].filter(Boolean);
28
+ for (const dir of new Set(winCandidates)) {
29
+ try {
30
+ fs.mkdirSync(dir, { recursive: true });
31
+ fs.writeFileSync(path.join(dir, "sundial.cmd"), cmdScript, "utf8");
32
+ fs.writeFileSync(path.join(dir, "sundial"), shScript, { mode: 0o755 });
33
+ } catch {}
34
+ }
35
+ } else {
36
+ const shScript = `#!/usr/bin/env sh\nexec "${process.execPath}" "${entry}" "$@"\n`;
37
+ const localBin = path.join(home, ".local", "bin");
38
+ const localBinTarget = path.join(localBin, "sundial");
39
+ try {
40
+ fs.mkdirSync(localBin, { recursive: true });
41
+ fs.writeFileSync(localBinTarget, shScript, { mode: 0o755 });
42
+ fs.chmodSync(localBinTarget, 0o755);
43
+ } catch {}
44
+
45
+ const candidates = new Set([
46
+ path.dirname(process.execPath),
47
+ localBin,
48
+ ...pathDirs,
49
+ ]);
50
+
51
+ let installedInPath = false;
52
+ for (const dir of candidates) {
53
+ if (!dir) continue;
54
+ try {
55
+ if (dir.startsWith(home)) {
56
+ fs.mkdirSync(dir, { recursive: true });
57
+ }
58
+ const target = path.join(dir, "sundial");
59
+ fs.writeFileSync(target, shScript, { mode: 0o755 });
60
+ fs.chmodSync(target, 0o755);
61
+ if (pathDirs.includes(dir)) installedInPath = true;
62
+ } catch {}
63
+ }
64
+
65
+ if (!installedInPath && pathDirs.includes("/usr/local/bin") && fs.existsSync(localBinTarget)) {
66
+ try {
67
+ spawnSync("sudo", ["-n", "cp", "-f", localBinTarget, "/usr/local/bin/sundial"], { stdio: "ignore", timeout: 2000 });
68
+ spawnSync("sudo", ["-n", "chmod", "0755", "/usr/local/bin/sundial"], { stdio: "ignore", timeout: 2000 });
69
+ } catch {}
70
+ }
71
+
72
+ for (const rc of [".bashrc", ".zshrc", ".profile"]) {
73
+ const rcPath = path.join(home, rc);
74
+ try {
75
+ if (fs.existsSync(rcPath)) {
76
+ const content = fs.readFileSync(rcPath, "utf8");
77
+ if (!content.includes(".local/bin")) {
78
+ fs.appendFileSync(rcPath, '\nexport PATH="$HOME/.local/bin:$PATH"\n');
79
+ }
80
+ }
81
+ } catch {}
82
+ }
83
+ }
84
+ } catch {}