@shigar/muaz 0.3.0 → 0.5.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/README.md CHANGED
@@ -32,10 +32,8 @@ the installer.
32
32
  npm install -g @shigar/muaz
33
33
  ```
34
34
 
35
- **From source**
35
+ **From source** (from a checkout of this repository)
36
36
  ```bash
37
- git clone https://github.com/shigar-dev/muaz
38
- cd muaz
39
37
  cargo build --release -p muaz
40
38
  cp target/release/muaz ~/.local/bin/ # or anywhere on $PATH
41
39
  ```
@@ -48,7 +46,7 @@ On first run, `muaz` bootstraps `~/.muaz/` with sensible defaults.
48
46
  export OPENAI_API_KEY=sk-...
49
47
 
50
48
  muaz chat # open the default (starter) agent
51
- muaz chat --agent coding # open the auto-sde coding agent
49
+ muaz chat --agent starter # pick an agent explicitly
52
50
  muaz chat --incognito # don't save the session to disk
53
51
  muaz chat --session <id> # resume a previous session
54
52
  ```
@@ -58,8 +56,8 @@ The REPL opens immediately. Type your message and press Enter. Use `/help` to se
58
56
  ## Directory layout
59
57
 
60
58
  After the first run, `~/.muaz/` looks like this. Authored content lives inside
61
- plugins — your own in the `local` workspace, shared ones under `plugins/`, and
62
- read-only defaults under `builtins/`:
59
+ plugins — your own in the `local` workspace and shared ones under `plugins/`.
60
+ Read-only defaults ship inside the binary:
63
61
 
64
62
  ```
65
63
  ~/.muaz/
@@ -68,8 +66,8 @@ read-only defaults under `builtins/`:
68
66
  ├── plugins.yaml # per-plugin state (enabled / priority / trusted / source)
69
67
  ├── mcp.json # global MCP server registry
70
68
  ├── secrets.json # chmod-600 API-key store (only when no OS keychain is available)
71
- ├── builtins/
72
- │ └── preset/ # embedded read-only `starter` agent + preset pipelines (refreshed each start)
69
+ ├── registry-state.json # chmod-600 newest plugin-index serial seen per registry
70
+ ├── gateway-token # chmod-600 persisted gateway token
73
71
  ├── plugins/
74
72
  │ ├── local/ # YOUR workspace
75
73
  │ │ ├── agents/ # agents you create
@@ -77,14 +75,22 @@ read-only defaults under `builtins/`:
77
75
  │ │ ├── pipelines/ # multi-agent pipeline definitions
78
76
  │ │ ├── prompts/
79
77
  │ │ └── commands/ # custom slash commands
80
- │ ├── auto-sde/ # seeded example plugin (editable; its agent is `coding`)
81
- │ └── <installed>/ # plugins you install
78
+ │ └── <installed>/ # plugins you install (e.g. auto-sde, the `coding` agent)
82
79
  ├── sessions/ # saved sessions + index.json
83
- ├── memory/ # per-agent cross-session notebooks (<agent>.md)
80
+ ├── memory/ # cross-session notebooks: global.md, agents/, projects/
84
81
  ├── audit/ # append-only security audit log (audit.jsonl)
82
+ ├── cache/ # content-addressed mirrors of the shipped built-ins
85
83
  └── runtimes/ # on-demand Node.js / uv runtimes for MCP servers
86
84
  ```
87
85
 
86
+ Everything above except `secrets.json`, `audit/`, `gateway-token` and `runtimes/`
87
+ is addressed as a *document* rather than a path, which is what lets a shared
88
+ deployment keep it in a database instead of on a disk — see
89
+ [Deployment settings](#deployment-settings). The exceptions are deliberate:
90
+ credentials never enter shared storage, downloaded runtimes are a machine-specific
91
+ cache, and the gateway token is a local convenience a server passes as
92
+ `MUAZ_GATEWAY_TOKEN` instead.
93
+
88
94
  ## Configuration
89
95
 
90
96
  ### Global config (`~/.muaz/config.yaml`)
@@ -95,8 +101,16 @@ default_agent: starter
95
101
 
96
102
  # Provider/model selection lives in models.yaml (see below), not here.
97
103
 
98
- # Override the remote plugin registry index (else $MUAZ_PLUGIN_REGISTRY, else default)
99
- # plugin_registry: "https://example.com/muaz-plugins/index.json"
104
+ # Plugin registries for `muaz plugins install <name>` / `search`, consulted in
105
+ # order (first hit wins). Omit the block to use the official muaz registry.
106
+ # Each registry carries its OWN signing keys, so an internal one is trusted for
107
+ # its own plugins only.
108
+ # plugin_registries:
109
+ # - name: acme-internal
110
+ # index_url: "https://plugins.acme.internal/index.json"
111
+ # trusted_keys: ["RW<your minisign public key>"]
112
+ # require_signed: true # an invalid signature is always fatal
113
+ # # allow_plaintext: true # only for an http:// intranet host you control
100
114
 
101
115
  # Global tool access — one level per tool (off | ask | auto). Per-agent `tools:`
102
116
  # blocks override these; `blocked` forces a tool Off everywhere.
@@ -301,6 +315,48 @@ provider:
301
315
  think: "high" # optional; thinking mode: enabled / high / medium / low
302
316
  ```
303
317
 
318
+ ## Deployment settings
319
+
320
+ Everything above describes a personal install, where you own `config.yaml` and
321
+ nothing overrides you. A **shared** muaz — a team server, a container, one
322
+ sandbox per user — needs two more things: somewhere other than `~/.muaz` to keep
323
+ state, and a way to fix settings the person using it must not be able to relax.
324
+
325
+ Both come from the process environment, read once at startup. With none of them
326
+ set, muaz is exactly the local install described above.
327
+
328
+ | Variable | Meaning |
329
+ |---|---|
330
+ | `MUAZ_STORE` | Backend: unset or `fs` (`~/.muaz`), `fs:<dir>`, an absolute path, `memory`, `mongodb://…`, `dynamodb://<table>` |
331
+ | `MUAZ_SCOPE` | Tenant partition, default `local`. One process serves one scope |
332
+ | `MUAZ_CONFIG_FILE` | YAML file of settings the user cannot loosen |
333
+ | `MUAZ_NETWORK` / `MUAZ_ALLOWLIST_ONLY` / `MUAZ_ALLOWED_URLS` / `MUAZ_DENIED_URLS` / `MUAZ_BLOCKED_TOOLS` | The same pins without a file |
334
+
335
+ Scope is part of the key at rest rather than a filter applied afterwards, so one
336
+ shared store behind many single-user processes cannot leak between them. Under a
337
+ filesystem store, scope `local` maps to the directory itself — which is what
338
+ keeps your laptop's `~/.muaz` exactly where it is — and any other scope gets a
339
+ sibling directory with its own secrets and audit log.
340
+
341
+ MongoDB and DynamoDB are **opt-in build features**, so the binary you install
342
+ locally carries neither driver; naming a backend that was not compiled in tells
343
+ you which feature is missing rather than failing vaguely.
344
+
345
+ ```bash
346
+ cargo build --release -p muaz --features store-mongodb,store-dynamodb
347
+
348
+ MUAZ_STORE='mongodb://muaz:pw@db.internal:27017/muaz?tls=true' \
349
+ MUAZ_SCOPE=user:alice muaz gateway --host 0.0.0.0
350
+ ```
351
+
352
+ With a database backend, sessions and the audit log stop being files — each
353
+ backend brings a native session repository and audit sink alongside the object
354
+ store, and `muaz doctor` reports all three. muaz refuses an unencrypted MongoDB
355
+ connection to a remote host, and never creates a DynamoDB table (a table with a
356
+ secondary index is infrastructure). The full walkthrough, including the
357
+ `create-table` invocation and how pinned settings compose with the user's, is in
358
+ [Configuration → Deployment settings](https://shigar.dev/muaz/docs/cli/configuration/#deployment-settings).
359
+
304
360
  ## CLI reference
305
361
 
306
362
  ```
@@ -313,14 +369,19 @@ Commands:
313
369
  agents Manage agents
314
370
  skills Manage Agent Skills
315
371
  plugins Install and manage plugins (agents, skills, pipelines, prompts)
372
+ models Provider profiles, the global default, and per-agent bindings
373
+ auth Store a provider profile's API key securely (hidden prompt)
316
374
  config View and edit global configuration
317
375
  mcp Manage MCP server registrations
318
376
  runtime Manage bundled MCP runtimes (Node.js, uv)
377
+ audit Inspect the append-only security audit log
319
378
  gateway Start the web server with browser UI
320
379
  doctor Diagnose config, runtimes, and MCP server health
321
380
  ```
322
381
 
323
- Running bare `muaz` (no subcommand) starts interactive chat with the default agent.
382
+ Running bare `muaz` (no subcommand) starts the gateway on `127.0.0.1:7878` and
383
+ opens the browser UI — the primary surface. Over SSH or without a tty it prints
384
+ the URL instead. `muaz chat` is the terminal surface.
324
385
 
325
386
  ### `muaz chat`
326
387
 
@@ -418,7 +479,7 @@ Commands:
418
479
 
419
480
  ### `muaz plugins`
420
481
 
421
- Install and manage [plugins](https://shigar.co.uk/muaz/docs/concepts/plugins/) —
482
+ Install and manage [plugins](https://shigar.dev/muaz/docs/concepts/plugins/) —
422
483
  bundles of agents, skills, pipelines, and prompts.
423
484
 
424
485
  ```
@@ -426,17 +487,40 @@ muaz plugins <COMMAND>
426
487
 
427
488
  Commands:
428
489
  install <target> Install from a local .zip path, or by registry name (name@version)
429
- search <query> Search the remote registry
490
+ search <query> Search the configured registries
491
+ update [id] Apply available updates (--check to only report them)
430
492
  list List installed plugins (enabled/disabled, trusted) + built-ins
431
493
  show <id> Show a plugin's manifest and contents
432
494
  enable <id> Enable a disabled plugin
433
495
  disable <id> Disable a plugin without uninstalling it
496
+ trust <id> Honour its skill tool pre-approvals and run its hooks
497
+ untrust <id> Revoke that, without uninstalling
434
498
  uninstall <id> Uninstall a plugin (deletes its directory)
435
499
 
500
+ Authoring:
501
+ pack <dir> Build the reproducible .zip a registry publishes (--json for CI)
502
+ verify <zip> Check a .zip the way an install will: sha256, manifest, signature
503
+
504
+ Registries:
505
+ registries What muaz has recorded per registry (index serial, signing)
506
+ forget-registry <name>
507
+ Reset that record, so a lower serial is accepted again
508
+
436
509
  Options (install):
437
510
  --force Overwrite an existing plugin with the same id
511
+ --registry <name> Install only from this configured registry
512
+ --allow-unsigned Take a plugin the registry serves unsigned (CLI only —
513
+ the browser UI never offers it)
438
514
  ```
439
515
 
516
+ A plugin from a registry is verified against **that registry's** trusted keys.
517
+ An unsigned one is refused under the default `require_signed: true`, and an
518
+ invalid signature is always fatal — `--allow-unsigned` says "unsigned is
519
+ acceptable here", never "forgeries are". Updates are re-fetched only from the
520
+ registry a plugin was installed from, and trust does not survive an update that
521
+ adds capabilities: the digest recorded when you trusted it is re-checked, and a
522
+ mismatch revokes trust rather than running the new `post_update` hook.
523
+
440
524
  Manage provider profiles and bindings with `muaz models`
441
525
  (`list`/`set`/`set-model`/`default`/`bind`/`unbind`/`remove`), by editing
442
526
  `~/.muaz/models.yaml` directly, or from the browser UI's Providers + Agents pages.
@@ -482,6 +566,21 @@ Commands:
482
566
  clean Remove all downloaded runtimes
483
567
  ```
484
568
 
569
+ ### `muaz audit`
570
+
571
+ The append-only security log at `~/.muaz/audit/audit.jsonl` (chmod 600): tool
572
+ executions, secret changes, plugin/config/connector changes, plugin hook runs,
573
+ and gateway auth failures. It records *what happened*, never values — tool
574
+ arguments are stored as a SHA-256 hash and secret events carry only the name.
575
+
576
+ ```
577
+ muaz audit <COMMAND>
578
+
579
+ Commands:
580
+ tail [--count N] [--json] Show the most recent events
581
+ export Print the whole log (raw JSON Lines) to stdout
582
+ ```
583
+
485
584
  ## Slash commands
486
585
 
487
586
  | Command | Description |
@@ -497,13 +596,15 @@ Commands:
497
596
  | `/pipelines` | List pipelines in your local workspace |
498
597
  | `/skills` | List available Agent Skills |
499
598
  | `/skill <name>` | Show the body of a skill's SKILL.md |
599
+ | `/auth [profile]` | Store a provider profile's API key (hidden input) |
500
600
  | `/incognito` | Toggle incognito mode (session not saved) |
501
601
  | `/compact` | Summarize and compact conversation history now |
502
602
  | `/usage` | Show token and latency stats for this session |
503
603
  | `/clear` | Start a fresh session (old transcript stays saved) |
504
604
  | `/exit` | Exit muaz |
505
605
 
506
- Custom commands defined in `~/.muaz/commands/<name>.yaml` also appear in `/help`.
606
+ Custom commands defined in `~/.muaz/plugins/local/commands/<name>.yaml` also
607
+ appear in `/help`.
507
608
 
508
609
  ## Built-in tools
509
610
 
@@ -569,62 +670,93 @@ From within the REPL:
569
670
 
570
671
  ## Pipelines
571
672
 
572
- Pipelines wire multiple agents together for complex workflows. Define them as YAML files in `~/.muaz/plugins/local/pipelines/` and run with `/run <name> [input]`.
673
+ Pipelines wire multiple agents together for complex workflows. Define them as YAML files in `~/.muaz/plugins/local/pipelines/`, then run them with `/run <name> [input]` in the REPL or `muaz pipeline run <name> [input]` from the shell.
674
+
675
+ A pipeline is a single ordered list of **`steps`**. There is no `pattern` field — sequential, parallel, and router flows are all expressed with steps.
676
+
677
+ One pipeline ships built in: **`code-review`**, an adversarial review where `review-proposer` reports defects, `review-disputer` attacks the list, and `review-arbiter` decides which findings survive.
573
678
 
574
- ### Sequential pipeline
679
+ ```bash
680
+ muaz pipeline run code-review "the staged changes"
681
+ ```
575
682
 
576
- Each agent's output becomes the next agent's input.
683
+ Because each step names an agent, each step is separately bindable — bind the proposer and disputer to *different* models in `models.yaml` so the dispute step isn't checking the proposer's work with the proposer's blind spots:
577
684
 
578
685
  ```yaml
579
- # ~/.muaz/plugins/local/pipelines/research-and-write.yaml
580
- name: research-and-write
581
- pattern: sequential
582
- steps:
583
- - agent: researcher # resolved across namespaces (local, plugins, built-ins)
584
- pass: last_message # pass only the last output (default)
585
- - agent: writer
586
- pass: full_history # prepend all prior step I/O as context
686
+ agents:
687
+ "@preset/review-proposer": { profile: anthropic-main }
688
+ "@preset/review-disputer": { profile: openai-main }
587
689
  ```
588
690
 
589
- `pass` modes:
590
- - `last_message` — the previous agent's response becomes the next agent's input (default)
591
- - `full_history` — all prior step inputs and outputs are prepended as context
691
+ Agents built purely to be steps carry `entrypoint: false`, which keeps them out of the pickers that start a new chat. They are otherwise ordinary agents: resolvable by name, listed by `muaz agents list` (tagged `(step)`), separately bindable, and chattable on request when you want to iterate on their prompt.
692
+
693
+ The examples below name agents like `researcher` and `writer` to show the shape — those are agents you would author, not ones muaz ships.
592
694
 
593
- ### Parallel pipeline
695
+ ### Sequential
594
696
 
595
- All agents run concurrently with the same input. Results are merged with per-agent section headers.
697
+ Each step names itself, so later steps can read its output.
596
698
 
597
699
  ```yaml
598
- name: multi-review
599
- pattern: parallel
600
- agents:
601
- - reviewer-a
602
- - reviewer-b
603
- - reviewer-c
604
- merge: concat # default; 'summary' will be added in a future release
700
+ # ~/.muaz/plugins/local/pipelines/research-write.yaml
701
+ name: research-write
702
+ steps:
703
+ - name: research
704
+ agent: researcher # resolved across namespaces; @plugin/name disambiguates
705
+ input: "Research this topic:\n\n${input}"
706
+ retry: { max: 1, backoff_secs: 2 }
707
+ - name: write
708
+ agent: writer
709
+ input: |
710
+ Write the piece requested below from these notes.
711
+
712
+ Request: ${input}
713
+ Notes: ${steps.research.output}
605
714
  ```
606
715
 
607
- ### Router pipeline
716
+ Templates resolve `${input}`, `${vars.<name>}`, `${steps.<name>.output}`, and `${steps.<name>.<field>}`. An unknown placeholder is a hard error, so a typo fails at load rather than silently interpolating nothing.
608
717
 
609
- A router agent reads the input and returns a JSON routing decision. The message is then forwarded to the selected downstream agent.
718
+ ### Parallel
719
+
720
+ A step may be a `parallel:` group whose members run concurrently:
610
721
 
611
722
  ```yaml
612
- name: smart-dispatch
613
- pattern: router
614
- router_agent: dispatcher # must be a fast, cheap model (e.g. gpt-4o-mini)
615
- routes:
616
- coding: coding-agent # key → agent name
617
- research: research-agent
618
- default: default-agent # fallback if no route matches
723
+ steps:
724
+ - name: reviews
725
+ parallel:
726
+ - name: security
727
+ agent: security-reviewer
728
+ input: "${input}"
729
+ - name: style
730
+ agent: style-reviewer
731
+ input: "${input}"
732
+ - name: summary
733
+ agent: editor
734
+ input: "Security:\n${steps.security.output}\n\nStyle:\n${steps.style.output}"
619
735
  ```
620
736
 
621
- The router agent automatically receives routing instructions appended to its system prompt and is expected to reply with:
737
+ ### Router
622
738
 
623
- ```json
624
- {"route": "coding", "message": "Fix the authentication bug"}
625
- ```
739
+ A router is a step whose `output_schema` carries a `route` field; specialists gate on it with `when:`. The route is typed structured output, not free text scanned out of a reply.
626
740
 
627
- If the response cannot be parsed, the input is forwarded to the `default` route.
741
+ ```yaml
742
+ name: triage
743
+ steps:
744
+ - name: route
745
+ agent: triage-router
746
+ output_schema:
747
+ type: object
748
+ properties:
749
+ route: { type: string, enum: [write, analyze] }
750
+ message: { type: string }
751
+ required: [route, message]
752
+ additionalProperties: false
753
+ - name: write
754
+ agent: writer
755
+ when: { value: "${steps.route.route}", equals: write }
756
+ input: "${steps.route.message}"
757
+ ```
758
+
759
+ Steps also take `on_error: fail | continue | fallback` and a `budget:` (`max_cost_usd`, `max_tokens`, `max_seconds`), which the pipeline as a whole accepts too.
628
760
 
629
761
  ## Custom slash commands
630
762
 
@@ -647,7 +779,10 @@ The command runs via `sh -c`. Environment variables available:
647
779
 
648
780
  ## Session management
649
781
 
650
- Sessions are saved to `~/.muaz/sessions/` as JSON files (one per session). An `index.json` tracks metadata for the last 20 sessions.
782
+ Sessions are saved to `~/.muaz/sessions/` as JSON files (one per session, chmod
783
+ 600), with an `index.json` beside them holding the metadata `/sessions` lists.
784
+ Under a database backend they are rows instead, listed by recency with no index
785
+ document to maintain — the commands below are identical either way.
651
786
 
652
787
  - Use `--session <id>` to resume a session on startup
653
788
  - Use `/sessions` to browse and resume from within the REPL
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "hasInstallScript": true,
20
20
  "name": "@shigar/muaz",
21
- "version": "0.3.0"
21
+ "version": "0.5.0"
22
22
  },
23
23
  "node_modules/detect-libc": {
24
24
  "engines": {
@@ -47,5 +47,5 @@
47
47
  }
48
48
  },
49
49
  "requires": true,
50
- "version": "0.3.0"
50
+ "version": "0.5.0"
51
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "artifactDownloadUrls": [
3
- "https://github.com/shigar-dev/releases-muaz/releases/download/v0.3.0"
3
+ "https://github.com/shigar-dev/releases-muaz/releases/download/v0.5.0"
4
4
  ],
5
5
  "author": "shigar ltd",
6
6
  "bin": {
@@ -81,7 +81,7 @@
81
81
  "zipExt": ".tar.xz"
82
82
  }
83
83
  },
84
- "version": "0.3.0",
84
+ "version": "0.5.0",
85
85
  "volta": {
86
86
  "node": "18.14.1",
87
87
  "npm": "9.5.0"