@niq.run/niq-darwin-x64 0.1.1 → 0.2.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.
Files changed (3) hide show
  1. package/bin/README.md +60 -36
  2. package/bin/niq +0 -0
  3. package/package.json +1 -1
package/bin/README.md CHANGED
@@ -1,71 +1,95 @@
1
1
  # niq
2
2
 
3
- > **niq runs programs that haven't been written yet.**
4
-
5
- niq is an **event-driven, decentralized agent runtime**. It is a single agent, but one composed of many **Workers** (a Worker Swarm) that collaborate over an event bus — each worker handles its own focus, and together they form the complete agent.
3
+ niq is an **event-driven agent runtime**. It is a single agent composed of many **Workers** that collaborate over an event bus — each worker handles its own focus, and together they form the complete agent.
6
4
 
7
5
  niq has exactly three core concepts:
8
6
 
9
- - **Worker** — a unit that can do things, like an **actor**: it has its own state and communicates only by sending and reacting to messages. A Worker subscribes to events, processes them, and publishes new events. Every capability (reasoning, tool execution, safety guards, lifecycle) is a Worker; there is only one extension concept.
10
- - **Program** — the source code of a Worker's capability (natural-language Prompts, or formalized DSL Scripts).
7
+ - **Worker** — a unit that can do things, like an **actor**: it has its own state and communicates only by sending and reacting to messages. A Worker subscribes to events, processes them, and publishes new events. The Worker is niq's only extension point.
8
+ - **Program** — the source code of a Worker's capability: a natural-language prompt (like the skills of mainstream agents) or a DSL script (like programmatic tool calling, PTC). Both forms are source code for generating tool calls.
11
9
  - **Event** — the only communication language between Workers, delivered over the event bus.
12
10
 
13
- Core insight: **collaboration is extension.** niq grows not by adding new abstractions, but by adding more participants that cooperate over the event bus. Extending a capability and having a human join the collaboration are the same act — a user is just another collaborating participant, and there can be one or many of them. In niq, everything is workers collaborating over the event bus.
11
+ > **Collaboration is extension.**
12
+
13
+ niq grows not by adding new abstractions, but by adding more participants that cooperate over the event bus. Every capability (reasoning, tool execution, safety guards, lifecycle) is a Worker. Extending a capability and having a human join the collaboration are the same act — a user is just another collaborating participant, and there can be one or many of them. In niq, everything is workers collaborating over the event bus.
14
14
 
15
15
  > **Status: early, fast-moving development.** The design is still evolving; APIs and behavior may change without notice.
16
16
 
17
- ## Project layout
17
+ ## Install
18
18
 
19
+ **npm** (recommended):
20
+
21
+ ```sh
22
+ npm install -g @niq.run/niq
19
23
  ```
20
- core/ interfaces & types (contracts, not implementations)
21
- pkg/ implementations (workers, services, bus, transports)
22
- internal/ control plane, project runtime, WebUI
23
- cmd/ CLI entry point
24
- doc/ design docs & dev notes
24
+
25
+ **Install script** (installs to `~/.niq/bin`):
26
+
27
+ ```sh
28
+ curl -fsSL https://raw.githubusercontent.com/niq-run/niq/main/install.sh | sh
29
+ ```
30
+
31
+ **From source** (Go 1.25+):
32
+
33
+ ```sh
34
+ git clone https://github.com/niq-run/niq
35
+ cd niq && make build # → ./bin/niq
25
36
  ```
26
37
 
27
38
  ## Quick start
28
39
 
29
- ### Prerequisites
40
+ niq has two layers: a **control plane**, and **projects** — each project is an isolated agent instance with its own event bus, worker set and WebUI on its own ports.
30
41
 
31
- - Go 1.22+
32
- - A model API key (for the reason worker), set in `~/.zshenv`:
42
+ ```sh
43
+ # start the control plane (default :9527)
44
+ niq
45
+ ```
33
46
 
34
- ```sh
35
- export OPENAI_API_KEY=sk-xxxx
36
- ```
47
+ Open **http://localhost:9527** — the control plane's WebUI lists your projects and can create and start one from a template, no terminal needed.
37
48
 
38
- ### Run
49
+ Prefer the CLI? Both steps can also be done manually:
39
50
 
40
51
  ```sh
41
- # Start the control plane (listens on :9527 by default)
42
- cd niq && go run ./cmd/niq/
52
+ niq project create my-project
53
+ niq project run my-project
54
+ ```
43
55
 
44
- # Or build first
45
- make build
46
- ./bin/niq
56
+ Each project serves its own WebUI — use it to chat, watch the event flow and manage workers. Ports are assigned dynamically on first run and then persisted per project, so they stay stable across restarts (`--bus` / `--webui` override). `niq project list` shows each project's `webui` and `bus` ports.
47
57
 
48
- # Then create and run a project from the WebUI, or from the CLI:
49
- ./bin/niq project create my-project
50
- ./bin/niq project run my-project
51
- ```
58
+ ### Model provider
52
59
 
53
- Once started, open <http://localhost:19763> for the WebUI — chat, inspect events, and view workers.
60
+ The `reason` worker talks to an LLM provider. Provider settings (endpoint, model, API key) live in `~/.niq/common/providers/provider.json`; `api_key` and header values support environment-variable expansion — e.g. `"api_key": "${OPENAI_API_KEY}"` keeps secrets out of stored files.
61
+
62
+ ## Project layout
63
+
64
+ ```
65
+ core/ interfaces & types (contracts, not implementations)
66
+ pkg/ implementations (workers, services, bus, transports)
67
+ internal/ control plane, project runtime, WebUI
68
+ cmd/ CLI entry point
69
+ npm/ npm distribution (launcher shim + package template)
70
+ ext/ external worker implementations (HTTP)
71
+ ```
54
72
 
55
- ### Build & test
73
+ ## Build & test
56
74
 
57
75
  ```sh
58
- cd niq && go build ./... && go vet ./...
59
- cd niq && go test ./pkg/eventbus/ -count=1
76
+ go build ./... && go vet ./...
77
+ go test ./pkg/eventbus/ -count=1
60
78
  ```
61
79
 
62
- ### Data directory
80
+ ## Data directory
63
81
 
64
82
  Runtime data lives under `~/.niq/`:
65
83
 
66
84
  ```
67
85
  ~/.niq/
68
- ├── id/identities.json # worker identity registry (owned by the bus)
69
- ├── programs/ # Program storage
70
- └── niq.log # run log
86
+ bin/ prebuilt binary (install.sh)
87
+ niq.log control-plane log
88
+ common/
89
+ templates/ project templates
90
+ providers/provider.json shared provider config (API keys via env expansion)
91
+ projects/<id>/ one directory per project
92
+ id/identities.json worker identity registry (owned by the bus)
93
+ programs/ Program storage
94
+ logs/ daily-rotated run logs
71
95
  ```
package/bin/niq CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@niq.run/niq-darwin-x64",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "niq binary for darwin-x64",
5
5
  "license": "MIT",
6
6
  "os": ["darwin"],