@premsan/cli 0.0.0-stage → 0.1.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/package.json CHANGED
@@ -1,6 +1,52 @@
1
1
  {
2
2
  "name": "@premsan/cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "Every Premsan assistant in your terminal: your conversations in each product, answered where you work.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "bin": {
8
+ "premsan": "./dist/premsan.mjs"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "skill",
13
+ "README.md"
14
+ ],
15
+ "engines": {
16
+ "node": ">=22"
17
+ },
18
+ "exports": {},
19
+ "devDependencies": {
20
+ "@earendil-works/pi-tui": "1.5.0",
21
+ "@xterm/headless": "6.0.0",
22
+ "@types/node": "^24.13.6",
23
+ "@types/react": "^19.3.0",
24
+ "esbuild": "^0.28.2",
25
+ "react": "^19.3.0",
26
+ "typescript": "^7.0.2",
27
+ "vitest": "^5.0.5",
28
+ "@agents/auth": "0.0.1",
29
+ "@agents/contract": "0.0.1",
30
+ "@agents/narrow": "0.0.1",
31
+ "@agents/client": "0.0.1",
32
+ "@agents/console": "0.0.1",
33
+ "@agents/loop": "0.0.1",
34
+ "@agents/i18n": "0.0.1",
35
+ "@agents/scripts": "0.0.0"
36
+ },
37
+ "publishConfig": {
38
+ "access": "public"
39
+ },
40
+ "keywords": [
41
+ "premsan",
42
+ "assistant",
43
+ "cli",
44
+ "tui"
45
+ ],
46
+ "scripts": {
47
+ "typecheck": "tsc --noEmit",
48
+ "test": "vitest run",
49
+ "build": "node scripts/bundle.ts && node ../../scripts/release-check.ts",
50
+ "local": "node scripts/bundle.ts local"
51
+ }
6
52
  }
package/skill/SKILL.md ADDED
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: premsan
3
+ description: Work with the assistants in Premsan's products (Paperingo, Resumical, PerSQL and the rest) through the premsan command - start and continue a conversation, answer the assistant's questions, apply its proposals. Use when the user asks for something done in one of those products.
4
+ ---
5
+
6
+ # premsan
7
+
8
+ `premsan` reaches the assistant in every Premsan product. Each assistant works on the user's own data in that product, so do only what the user asked.
9
+
10
+ ## Install
11
+
12
+ - `npm install -g @premsan/cli` installs `premsan`, on Node 22 or later.
13
+ - `npx -y @premsan/cli <command>` runs it once without installing.
14
+
15
+ ## Sign in
16
+
17
+ - `premsan products` lists every product with its API host and the variable that holds its key.
18
+ - A developer key signs in without a browser: the user makes one in the product's web app, under Settings, Account, Developer keys, and sets it as that variable (`PAPERINGO_KEY` for Paperingo).
19
+ - In a sandbox, the product's API host must be allowed in the sandbox's network settings.
20
+ - On the user's own machine, `premsan login <product>` signs in through the browser instead.
21
+
22
+ ## Find the tools
23
+
24
+ - `premsan <product> tools --json` lists every tool the product offers, with its input schema.
25
+ - Every tool is a command: `premsan <product> <tool> <required arguments, in order> [--name value]`.
26
+ - `premsan <product> <tool> --help` shows its arguments. `--input '<json>'` passes them all at once, and `-` as a value reads it from standard input.
27
+ - Results print as JSON.
28
+
29
+ ## Work with the assistant
30
+
31
+ 1. `premsan <product> list_conversations` lists the user's conversations. Where the product has its own assistant, its id is `conversation` and it comes first; new work starts there, or with the product's own tool, such as `premsan paperingo new_paper "<instruction>"`.
32
+ 2. `premsan <product> send_message <conversation> "<message>"` sends a message and waits for the reply for a while. When the result says `"running": true`, run `premsan <product> read_conversation <conversation> --wait` until it says `false`.
33
+ 3. When the last run has a `question`, ask the user, then answer each question by its id: `premsan <product> answer_question <conversation> '[{"id":"<id>","answers":["<an option, or the user's words>"]}]'`.
34
+ 4. A run's `proposals` change nothing until `premsan <product> decide_proposal <conversation> <proposal> true`, so ask the user first; `false` discards one.
35
+ 5. `premsan <product> stop_run <conversation>` stops a run; what it did stays.
36
+
37
+ ## Exit codes
38
+
39
+ | Code | Meaning | What to do |
40
+ | ---- | ------- | ---------- |
41
+ | 0 | Done | Read the JSON |
42
+ | 1 | Failed | Read the message |
43
+ | 2 | The arguments do not fit the command | Run it with `--help` |
44
+ | 3 | Not signed in | Set the key's variable, or run `premsan login <product>` |
45
+ | 4 | The user has not allowed the assistant | The user allows it once in the product's web app, at the address in the message |
46
+ | 5 | The plan does not cover this | The user subscribes in the product's Settings |
47
+ | 6 | Too many turns this hour | Wait as long as the message says |
48
+ | 7 | The API could not be reached | Allow the host the message names in the sandbox's network settings |
49
+
50
+ With `--json`, a failure prints `{"error": {"message", "code", "url", "retryAfter"}}`.
51
+
52
+ ## MCP
53
+
54
+ Each product also serves these tools over MCP at `https://<API host>/mcp`, with the key as `Authorization: Bearer <key>`, for clients that connect to MCP servers.