monarchai 0.0.1 → 2.0.0

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/LICENSE CHANGED
@@ -1,14 +1,177 @@
1
- monarchai — Notice
1
+ Monarch CLI — Software License
2
2
  Copyright (c) 2026 Cymela, Republic of Serbia.
3
3
  All rights reserved.
4
4
 
5
- This package is published as a name reservation for the Monarch model line by
6
- Cymela. It contains no functional software.
5
+ THIS IS A PROPRIETARY LICENSE. IT IS NOT AN OPEN-SOURCE LICENSE.
7
6
 
8
- No licence is granted to use the "Cymela", "Monarch" or "Hyper" names, or any
9
- associated marks, to identify another product or service, or in any way likely
10
- to cause confusion as to origin.
7
+ It permits you to install and use the Monarch CLI, including for commercial
8
+ work, at no cost. It does not permit you to redistribute it, sell it, or
9
+ publish modified versions of it. If that is what you need, ask.
11
10
 
12
- The metadata file included in this package may be read and inspected freely.
11
+ This license accompanies the Cymela Terms of Use ("the Terms"), published
12
+ at https://cymela.com/terms. Where the Terms refer to a LICENSE file
13
+ distributed with a component of the Services, this is that file. It is written
14
+ to be consistent with Section 05 of the Terms, not to displace it.
13
15
 
14
- Contact: contact@cymela.com
16
+
17
+ 1. GRANT
18
+
19
+ Subject to your compliance with this license and with the Terms, the copyright
20
+ holder grants you a personal, worldwide, royalty-free, non-exclusive,
21
+ revocable license to install and use the Monarch CLI for any lawful purpose,
22
+ including commercial work.
23
+
24
+ You may install it on as many machines as you personally use or control, and
25
+ you may use it on private, confidential or commercial codebases. Nothing you
26
+ create with it belongs to the copyright holder: your code, your prompts and
27
+ your output are yours, and no part of them is transmitted to the copyright
28
+ holder in the course of ordinary use.
29
+
30
+
31
+ 2. WHAT THIS LICENSE DOES NOT GRANT
32
+
33
+ Except as stated in Section 1, no rights are granted. In particular, you may
34
+ not, without prior written permission:
35
+
36
+ (a) distribute, publish, sublicense, rent, lease, lend, sell or otherwise
37
+ make the software available to third parties, whether modified or not,
38
+ and whether for a fee or not;
39
+
40
+ (b) publish or distribute a modified version, a fork, or a derivative work;
41
+
42
+ (c) incorporate the software, or a substantial part of it, into another
43
+ product or service that you distribute;
44
+
45
+ (d) remove, obscure or alter any copyright, license or attribution notice;
46
+
47
+ (e) represent any modified build as an official Cymela or Monarch CLI
48
+ release, or use the Cymela name, the Monarch CLI name, or either logo
49
+ in a way that suggests endorsement or affiliation;
50
+
51
+ (f) copy or reuse the software's source code, its structure and organization,
52
+ its user-interface layout, its visual design, its prompt text or its
53
+ written content in any other product or service, whether or not that
54
+ product competes with the Monarch CLI, and whether or not the copied
55
+ material is reproduced verbatim;
56
+
57
+ (g) offer the software, or any product substantially derived from it, to
58
+ third parties as a hosted, managed or software-as-a-service offering; or
59
+
60
+ (h) reverse engineer, decompile or disassemble the software, except to the
61
+ extent this restriction cannot lawfully be excluded (see below).
62
+
63
+ Modifying your own installation for your own use is permitted. Publishing the
64
+ result is what is not.
65
+
66
+ Nothing in this section restricts any right you hold under mandatory law that
67
+ cannot be excluded by agreement. For users in the European Union in particular,
68
+ nothing here restricts the rights granted by Articles 5 and 6 of Directive
69
+ 2009/24/EC on the legal protection of computer programs, including observing or
70
+ studying the program to determine its underlying ideas, and decompilation for
71
+ interoperability purposes. Copyright protects the expression of this software,
72
+ not the ideas or functionality behind it.
73
+
74
+
75
+ 3. CONDITIONS OF USE
76
+
77
+ This license is conditional on your compliance with the acceptable-use terms
78
+ in Section 06 of the Terms. In summary, and without limiting them, you must
79
+ not use the software to break the law, to harm people, or in violation of the
80
+ terms of the model provider whose API you connect it to.
81
+
82
+ You must not rely on the software, without qualified human review, where an
83
+ error could cause death, personal injury, or severe environmental, financial
84
+ or infrastructural damage. It is a developer productivity tool. It is not
85
+ certified, validated or fit for safety-critical use of any kind.
86
+
87
+ You are responsible for reviewing what the agent proposes before you approve
88
+ it, and for everything you produce with it.
89
+
90
+
91
+ 4. THIRD-PARTY COMPONENTS
92
+
93
+ The Monarch CLI depends on third-party open-source packages, which are
94
+ installed from their own sources and are not covered by this license. Each
95
+ remains subject to the license its authors published it under, and those
96
+ licenses govern your rights in those components. This license applies only to
97
+ the Monarch CLI itself.
98
+
99
+ Language models are not part of the software. The CLI is a client for a model
100
+ you choose and pay for, reached with an API key belonging to you. The model
101
+ provider's terms govern that relationship, not this license.
102
+
103
+
104
+ 5. TRADEMARKS
105
+
106
+ The Cymela name, the Monarch CLI name, and the logos and visual identity of
107
+ either are not licensed to you. Nothing here claims the ordinary word
108
+ "monarch" outside its use as the name of this software. Section 1 is a license
109
+ to use the software; it is not a grant of the brand.
110
+
111
+
112
+ 6. NO WARRANTY
113
+
114
+ THE SOFTWARE IS PROVIDED "AS IS" AND "AS AVAILABLE", WITHOUT WARRANTY OF ANY
115
+ KIND, WHETHER EXPRESS, IMPLIED OR STATUTORY. TO THE FULLEST EXTENT PERMITTED
116
+ BY APPLICABLE LAW, ALL IMPLIED WARRANTIES ARE DISCLAIMED, INCLUDING ANY
117
+ IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE,
118
+ ACCURACY AND NON-INFRINGEMENT.
119
+
120
+ There is no warranty that the software will be uninterrupted, secure or
121
+ error-free, that defects will be corrected, or that any output will be
122
+ accurate, complete, safe or reliable. You use it at your own risk, and you are
123
+ solely responsible for any damage to your system, loss of data, or loss of
124
+ work that results.
125
+
126
+
127
+ 7. LIMITATION OF LIABILITY
128
+
129
+ TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, THE COPYRIGHT HOLDER WILL
130
+ NOT BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, EXEMPLARY
131
+ OR PUNITIVE DAMAGES, NOR FOR ANY LOSS OF PROFITS, REVENUE, BUSINESS, GOODWILL,
132
+ DATA OR WORK PRODUCT, ARISING OUT OF OR RELATING TO YOUR USE OF OR INABILITY
133
+ TO USE THE SOFTWARE — WHETHER IN CONTRACT, TORT (INCLUDING NEGLIGENCE),
134
+ STRICT LIABILITY OR OTHERWISE, AND WHETHER OR NOT THE POSSIBILITY OF SUCH
135
+ DAMAGES WAS KNOWN.
136
+
137
+ This expressly includes loss or damage arising from code the agent generated,
138
+ modified, deleted or executed; from output produced by a third-party model;
139
+ from the act or omission of any third-party provider; or from another person's
140
+ misuse of the software.
141
+
142
+ Total aggregate liability will not exceed the greater of (a) the amount you
143
+ have paid the copyright holder for the software in the twelve months preceding
144
+ the claim, which for free software is zero, or (b) EUR 100.
145
+
146
+ Nothing here excludes or limits liability for death or personal injury caused
147
+ by negligence, for fraud or fraudulent misrepresentation, or for anything else
148
+ that cannot lawfully be excluded. If you are a consumer, you keep every
149
+ mandatory right your local consumer-protection law gives you.
150
+
151
+
152
+ 8. TERMINATION
153
+
154
+ This license ends automatically and immediately if you breach it or the Terms.
155
+ On termination you must stop using the software and delete your copies.
156
+ Continuing to use it after termination is unlicensed use of a copyrighted
157
+ work. Sections 2 and 5 to 10 survive termination.
158
+
159
+
160
+ 9. GOVERNING LAW
161
+
162
+ This license is governed by the laws of the Republic of Serbia, without regard
163
+ to its conflict-of-laws rules, and the courts of the Republic of Serbia have
164
+ exclusive jurisdiction. If you use the software as a consumer resident in the
165
+ European Union, the United Kingdom, or another jurisdiction whose law gives
166
+ you a mandatory right to your local courts, this does not deprive you of it.
167
+
168
+
169
+ 10. RELATIONSHIP TO THE TERMS
170
+
171
+ This license and the Terms are intended to be read together. Where they
172
+ genuinely conflict on the scope of the license granted in Section 1, this file
173
+ prevails, as Section 05 of the Terms provides. On every other subject the
174
+ Terms apply in full.
175
+
176
+
177
+ Questions, permissions and licensing enquiries: contact@cymela.com
package/MONARCH.md ADDED
@@ -0,0 +1,10 @@
1
+ # Monarch — install-level notes (loaded every turn)
2
+
3
+ The full operating protocol (ReACT loop, tool catalog, anti-loop, formatting)
4
+ is built in and always active — do not re-derive it from here.
5
+
6
+ Install-level additions only:
7
+
8
+ - **Attachments**: vision extract = ground truth for an image. Paths under `.monarch/attachments/` are real files.
9
+ - **Plan → Execute**: `/run-plan` switches to Default and seeds implementation. Follow the plan; don't re-research unless blocked.
10
+ - **Tone**: brief; lead with the answer; no filler. Never claim success without tool output.
package/README.md CHANGED
@@ -1,35 +1,126 @@
1
- # monarchai
1
+ # Monarch CLI
2
2
 
3
- **Reserved for the Monarch model line by Cymela.** See <https://cymela.com>.
3
+ Premium terminal coding agent, by [Cymela](https://cymela.com).
4
4
 
5
- ## What this is
5
+ Monarch is an agentic CLI: you describe the change, it reads, plans, edits,
6
+ runs and verifies — inside your workspace, with your permission model, on the
7
+ provider of your choice.
6
8
 
7
- A name reservation, held by the project it names. **Monarch** is Cymela's model
8
- line; its frontier tier is called **Hyper**. This package is the npm home for
9
- that line and is published so the name is not taken by an unrelated project.
9
+ ## Highlights
10
10
 
11
- It has no runtime behaviour yet. Requiring it returns metadata describing what
12
- the name is held for:
11
+ - **Verification-first engine.** A deterministic guard chain (verification
12
+ gate, task ladder, close-out audit, anti-loop counters) sits between the
13
+ model and "done" — the agent proves its work instead of asserting it.
14
+ - **Provider-neutral.** OpenAI-compatible, Anthropic and Gemini wire formats;
15
+ OpenRouter, local llama.cpp servers, gateways and proxies via
16
+ `MONARCH_BASE_URL`. Parameter quirks are learned from provider errors, not
17
+ hard-coded.
18
+ - **Sub-agents with roles.** Scout (read-only), Builder, Checker — tool-gated,
19
+ depth-limited, streamed live into the agents panel (`/agents`, Alt+A).
20
+ - **Batch tools.** Recoverable multi-file edits (`multi-edit`), ranged and
21
+ multi-ranged reads (`read-many`, `#L15-29, #L128-236`) so the agent touches
22
+ exactly what it needs.
23
+ - **Sessions, undo, cost.** Every turn is persisted (`/sessions`, which also
24
+ starts a fresh one in the same folder),
25
+ checkpointed (`/undo`, binary-safe file restore with conflict reporting), and metered (`/usage`,
26
+ auto-compaction before the context window overflows).
27
+ - **Memory.** It remembers durable, personal things across sessions and
28
+ projects — preferences, standing decisions, names and dates you tell it to
29
+ hold — on your machine, at `~/.monarch/memory.json`, mode 0600. The contents
30
+ are never in the prompt: the model gets a list of group names and recalls
31
+ when a turn needs one. `/memory` shows everything, `/memory add` writes one
32
+ yourself, `/memory off` stops it collecting.
33
+ - **Themes.** Eight of them (`/theme`). Yes, including `mono` for purists.
13
34
 
14
- ```js
15
- require('monarchai');
16
- // { name: 'monarchai', reservedFor: 'Monarch — the model line by Cymela', status: 'reserved', … }
35
+ ## Install
36
+
37
+ ```bash
38
+ npm install -g monarchai
39
+ ```
40
+
41
+ Then, in any project folder:
42
+
43
+ ```bash
44
+ monarch
45
+ ```
46
+
47
+ `npm install -g cymela` installs exactly the same thing and gives you the same
48
+ `monarch` command — Cymela is the project, Monarch CLI is what it ships, and
49
+ either name works.
50
+
51
+ Nothing is compiled and there are no runtime dependencies — the install is a
52
+ single bundled file. (Commands run through pipes; if you need a real pty for
53
+ programs that prompt, `npm install -g @homebridge/node-pty-prebuilt-multiarch`
54
+ and Monarch will pick it up. `monarch --doctor` reports which backend is in
55
+ use.)
56
+
57
+ Node 20+. First run walks through provider, key and model, then drops you into
58
+ the folder you started it in; after that `monarch` goes straight to the prompt.
59
+ Keys can also come from the environment (`MONARCH_API_KEY`,
60
+ `OPENROUTER_API_KEY`, `ANTHROPIC_API_KEY`, …), in which case the first run
61
+ skips straight past asking for one.
62
+
63
+ ## In a script
64
+
65
+ ```bash
66
+ monarch -p "summarise the uncommitted changes"
67
+ ```
68
+
69
+ One turn, no TUI. The answer goes to stdout and nothing else does — tool
70
+ activity and errors go to stderr — so it pipes. `--mode plan`, `--effort max`,
71
+ `--model <id>` and `--thinking` all apply. Exit code 0 when the turn finished,
72
+ 1 when it did not, 2 when it is not set up yet.
73
+
74
+ ## When something is wrong
75
+
76
+ ```bash
77
+ monarch --doctor
17
78
  ```
18
79
 
19
- ## What this is not
80
+ Checks Node, the terminal, the provider, whether the key is actually accepted,
81
+ the model, file permissions, the shell backend and the workspace — and prints
82
+ the command to fix each failure. `/doctor` runs the same checks from inside a
83
+ session.
84
+
85
+ ## Configuration
86
+
87
+ | Variable | Effect |
88
+ | --- | --- |
89
+ | `MONARCH_BASE_URL` | Endpoint override (local models, gateways, proxies) |
90
+ | `MONARCH_REQUEST_TIMEOUT_MS` | Connect+headers timeout (default 1h, `0` disables) |
91
+ | `MONARCH_STALL_TIMEOUT_MS` | Mid-stream silence watchdog (default 5min, `0` disables) |
92
+
93
+ Project instructions live in `MONARCH.md` (legacy `CYMELA.md`, `HYPER.md` and
94
+ `SYNTH.md` are honoured) — offered on first run in a folder, never written
95
+ without asking. Skills live in `SKILLS.md`. Session data stays in `.monarch/`
96
+ in your workspace, git-ignored automatically. What Monarch remembers about
97
+ *you* is separate and machine-wide: `~/.monarch/memory.json`, readable with
98
+ `/memory`, and nothing leaves this machine except inside a request to the
99
+ provider you chose.
100
+
101
+ ## License
20
102
 
21
- - **Not the Cymela CLI.** The terminal coding agent is published separately as
22
- [`cymela`](https://www.npmjs.com/package/cymela) and installs with
23
- `npm install -g cymela`. That package and its `cymela` command are unaffected
24
- by this reservation.
25
- - **Not a released model.** Nothing here downloads, runs, or provides access to
26
- a model.
103
+ Proprietary — free to install and use, including commercially; no
104
+ redistribution or modified republishing. See [LICENSE](LICENSE).
27
105
 
28
- ## Naming
106
+ ## Execution and recovery boundaries
29
107
 
30
- Cymela is the company. Monarch is the model line. Hyper is the frontier tier
31
- within that line — so a release reads *Monarch Hyper*, never *Cymela Hyper*.
108
+ Plan mode permits native inspection tools and a small set of literal shell reads.
109
+ Scripts, test runners, linters, interpreters, and raw git commands need Agent mode
110
+ and execution approval. Use the structured git tool for inspection in Plan mode.
111
+ The model can enter Plan mode, but only the user can leave it or enable Auto.
112
+ Headless writes require `--mode auto` or a global `permissions.approvedTools` entry.
113
+ Shell approval is not an OS sandbox: approved commands run with the user's host
114
+ permissions. Use an isolated container or VM when executing untrusted project code.
32
115
 
33
- ## Contact
116
+ Multi-edit validates and stages every replacement before committing. Commit
117
+ failures trigger rollback. A crash or incomplete rollback leaves original bytes
118
+ and a manifest under `.monarch/recovery/`; preserve that directory and inspect
119
+ the manifest and current files before restoring anything. Individual file
120
+ replacement is atomic; a multi-file batch is not crash-atomic.
121
+ Undo retains checkpoints when restoration fails and refuses to overwrite changes
122
+ made after a tool completed. Shell and directory operations may leave changes
123
+ outside individual file backups.
34
124
 
35
- <contact@cymela.com> · <https://cymela.com>
125
+ Web fetching validates and pins DNS addresses at every redirect. Pages are limited
126
+ to 2 MB of transferred and decoded content and a 30-second request deadline.