@quspect/qupai 0.6.8 → 0.7.7

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
@@ -6,16 +6,28 @@ standalone Runtime and works on QuPai Studio canvases.
6
6
 
7
7
  ```sh
8
8
  npm install -g @quspect/qupai
9
- qupai login -server https://<your QuPai> -api-key-file - # paste a personal API key, then Ctrl+D
10
- qupai product list # the products your organization runs, with their agents
11
- qupai ask -product <product> -agent <agent> "<what to do>" # a thread with that agent, streamed here
9
+ qupai # the full-screen app: ask QuPai's agents, answer their approvals
10
+ qupai login # through the browser, to https://qupai.quspect.com (-server for another)
11
+ qupai status # who is signed in, where, and until when
12
+ qupai agent list # every agent you can ask: your products' and your labs' own
13
+ qupai ask -product <product> "<what to do>" # a thread with that agent, streamed here
12
14
  ```
13
15
 
14
- Create a personal API key in the QuPai app under Settings › API keys. `qupai help` lists every command.
16
+ `qupai help` lists every command, and `qupai help <command>` gives its flags, examples and exit codes. On a computer
17
+ without a browser, `qupai login -api-key-file -` keeps a personal API key made in the app (Settings › API keys).
15
18
 
16
- Node.js 18 or later on macOS, Linux or Windows (x64 or arm64). npm installs the native binary for this
19
+ For Claude Code, Codex and other coding agents: `qupai skill install` writes this package's `SKILL.md` (the guide that
20
+ `qupai guide` prints) where they read skills, and `claude mcp add qupai -- qupai mcp` (or `codex mcp add qupai --
21
+ qupai mcp`) offers QuPai's agents as MCP tools. A turn that waits for the person's approval never holds an agent: the
22
+ command exits 4 with the link where the person answers it.
23
+
24
+ `qupai` alone on a terminal (or `qupai chat`) opens the full-screen app: the welcome with your organization's default
25
+ agent, a conversation whose answers stream and whose tool calls unfold, `/agent`, `/lab`, `/threads` and the other
26
+ commands, and approvals answered with A or R. It runs on Node.js 22.19 or later; `?` lists its keys.
27
+
28
+ Node.js 18 or later on macOS, Linux or Windows (x64 or arm64); the full-screen app needs 22.19 or later. npm installs the native binary for this
17
29
  machine as an optional dependency (`@quspect/qupai-<platform>-<arch>`), so do not install with
18
30
  `--omit=optional`.
19
31
 
20
- Licensed under the Apache License 2.0. The binary includes third-party software; see NOTICE and
21
- THIRD-PARTY-NOTICES in the platform package.
32
+ Licensed under the Apache License 2.0. The binary and the full-screen app include third-party software; see NOTICE
33
+ and THIRD-PARTY-NOTICES (in this package and in the platform package).
package/SKILL.md ADDED
@@ -0,0 +1,134 @@
1
+ ---
2
+ name: qupai
3
+ description: Ask QuPai's agents (the agents of the products the person's organization runs, such as QuPilot, and their labs' own agents) from this machine with the qupai command, hand approvals to the person, and read the person's QuPai threads, projects, artifacts, labs, compute, credits and what they set up (agents, knowledge bases, schedules, goals, workspaces); for QuPai staff, work the staff console on a staff session (qupai admin). Use when the person asks to use QuPai, a QuPai agent, a QuPai lab or project, or a quantum computer through QuPai, or for QuPai staff work.
4
+ ---
5
+
6
+ # Using QuPai through the qupai command
7
+
8
+ `qupai` asks QuPai's agents for the person. Each ask is a thread of theirs in the QuPai app and an ordinary billed
9
+ turn in their account. A change on a real machine (a lab instrument, a quantum computer) always waits for the person
10
+ to approve it in the app: you never approve anything, and you have no access to a lab's own tools; you ask the lab's
11
+ agent.
12
+
13
+ ## 1. Check the sign-in
14
+
15
+ ```sh
16
+ qupai status -json
17
+ ```
18
+
19
+ - Exit 0: signed in. `user`, `organization` and `platform` say as whom and where.
20
+ - Exit 3: not signed in, the sign-in has ended, or it is for another platform. Ask the person to run the line in
21
+ `next` (usually `qupai login`) in their own terminal; in Claude Code they can type `! qupai login`. Do not run it
22
+ yourself: it waits for them in a browser.
23
+ - Never ask for, paste, print or store an API key, and do not read the command's credentials file.
24
+
25
+ ## 2. Find an agent
26
+
27
+ ```sh
28
+ qupai agent list -json
29
+ ```
30
+
31
+ Each entry has `product` and `agent`; a lab's own agent also has `lab`, and `ask` is the command line that asks it.
32
+ `labs_without_agent` says what the person would ask for to use a lab. `qupai product list -json` has the products in
33
+ full.
34
+
35
+ ## 3. Ask
36
+
37
+ ```sh
38
+ qupai ask -product qupilot -json -timeout 90s "What limits T2* on q3?"
39
+ qupai ask -lab csmot -json -timeout 90s "Load the MOT and report the atom number"
40
+ qupai ask -thread <thread> -json -timeout 90s "Now fit the decay"
41
+ ```
42
+
43
+ With `-json` the first line is `{"type":"qupai.started","thread":…,"turn":…}` and the last
44
+ `{"type":"qupai.result","status":…,"answer":…,"approval_url":…}`, the platform's events between them. `status` is
45
+ `complete`, `failed`, `aborted`, `waiting` (the person must answer an approval) or `running` (`-timeout` passed).
46
+ Keep `-timeout` under your shell's own time limit. Without `-json` the answer is on standard output. Without
47
+ `-product`, `-lab` or `-thread`, `ask` asks the person's default agent (the one they chose last in `qupai`, else their
48
+ organization's default); name the agent when it matters. `qupai` alone and `qupai chat` open the person's full-screen
49
+ app on their terminal: do not run them.
50
+
51
+ ## 4. Exit codes
52
+
53
+ | Code | Meaning | What to do |
54
+ | --- | --- | --- |
55
+ | 0 | done | use the answer |
56
+ | 1 | failed | read the message on standard error, or `error` in the result |
57
+ | 2 | usage | fix the command line (`qupai help <command>`) |
58
+ | 3 | not signed in | step 1 |
59
+ | 4 | waiting for a person, or still running at `-timeout` | step 5 |
60
+ | 5 | no access | tell the person what the message says to ask for |
61
+
62
+ ## 5. When it waits (exit 4)
63
+
64
+ If `status` is `waiting`, give the person `approval_url` (the thread in the QuPai app) and say what the agent wants to
65
+ do. Once they have answered, or if `status` was `running`:
66
+
67
+ ```sh
68
+ qupai wait -thread <thread> -json -timeout 90s
69
+ ```
70
+
71
+ It ends with 0 or 1 when the turn ends, and 4 again while it still needs the person or still runs.
72
+
73
+ ## 6. The person's other work
74
+
75
+ With the same sign-in, read what the person has, and do what they ask, through the platform's rules. Lists and shows
76
+ take `-json`, and the exit codes above hold for every command (`qupai help <command>` gives its flags).
77
+
78
+ ```sh
79
+ qupai thread search "rabi" -json # their threads by title; thread show / export <thread> reads one
80
+ qupai thread files <thread> -json # a thread's sandbox files; thread file get <thread> <path> -o FILE
81
+ qupai ask -thread <thread> -file data.csv -json -timeout 90s "Fit these" # attach files to a message
82
+ qupai project list -json # their projects; project show / files / get, project put to write one
83
+ qupai ask -project <project> -json -timeout 90s "Add a README" # a session in a project
84
+ qupai artifact list -json # what their agents made; artifact show / get <artifact> -o FILE
85
+ qupai lab list -json # their labs: role, status, agent; lab show <lab> -json: its machines
86
+ qupai compute providers -json # providers and their keys; device list / show, simulator list -json
87
+ qupai job list -kind hardware -json # their hardware runs and how each stands
88
+ qupai notifications -unread -json # what is new for them; balance -json, usage -json: their credits
89
+ qupai agent show <product/agent> -json # an agent and what it may be changed in; agent list -own: their own
90
+ qupai kb search <kb> "D2 line" -json # their knowledge bases (kb list, kb docs <kb>), searched as agents do
91
+ qupai schedule list -json # likewise goal list, workspace list, connection list, library skills
92
+ ```
93
+
94
+ - Keys and secrets are the person's: never run `key create`, `compute key set`, `model provider add`/`edit` with a
95
+ key, `connection add` or `library plugin connect` with a secret, `connection authorize` or `channel pair`; never ask
96
+ for, paste, print or store a key, and never read a key file: they run these in their own terminal.
97
+ - Approvals and hardware runs are the person's: an agent never answers one and never starts one. `job list` only
98
+ shows the runs they started; a goal waits for their approval in the app (`goal open <goal>` shows where).
99
+ - Work on a lab through its agent (`qupai ask -lab`); `lab request`, `lab withdraw` and `lab leave` change the
100
+ person's access, so run them only when the person asked.
101
+ - What they set up (`agent create`/`edit`, `library skill new`/`install`, `kb new`/`add`, `schedule new`/`edit`,
102
+ `goal new`, `workspace new`/`start`, `credits request`, `invoice request`) is theirs, and `connection call` may
103
+ change things on a server: do these only when they asked. Scheduled runs and goal rounds are billed turns.
104
+ - Deleting (`thread delete`, `agent delete`, `library skill delete`, `schedule delete`, `goal stop`, `lab leave`…)
105
+ cannot be undone: run it only when asked for that very thing, with `-yes`; `redeem` and `artifact share` likewise.
106
+
107
+ ## 7. Staff: the staff console (QuPai staff only)
108
+
109
+ When the person is QuPai staff and asks for staff work (organizations, accounts, users, access, labs, the catalog),
110
+ they run `! qupai login -staff` themselves and tick in the browser what the session may do; it lasts 8 hours.
111
+ `qupai status -json` then has `staff_session.state` `active` and its `reach`, and `qupai admin <area> <verb>` works
112
+ within it (`qupai help admin` lists them; each takes `-json`):
113
+
114
+ ```sh
115
+ qupai admin org list -json # likewise user list -q TEXT, lab list, access app show -org ORG
116
+ qupai admin lab grant csmot -org acme -user bob@acme.example -role operate
117
+ ```
118
+
119
+ - Exit 3: no staff session, or it ended: ask the person to run `qupai login -staff`. Exit 5: outside its reach (the
120
+ message names the box to tick on a new session) or their staff role does not allow it. Staff roles and changing
121
+ money stay in the browser.
122
+ - Writes change customers' organizations: run one only when asked for that very thing. Suspending, disabling,
123
+ removing and disconnecting need `-yes`. A password or key comes from a file the person gives (`-password-file`,
124
+ `-secret-file`), never an argument: never make one up, print one, or read one yourself.
125
+
126
+ ## MCP
127
+
128
+ `claude mcp add qupai -- qupai mcp` (Codex: `codex mcp add qupai -- qupai mcp`) offers the same as tools: `status`,
129
+ `list_agents`, `ask` and `wait`. `ask` takes `prompt` and `product` (with `agent`), `lab` or `thread`; `ask` and `wait`
130
+ follow the turn for at most `timeout_seconds` (default 120, at most 600) and return the same `status`, `answer`,
131
+ `approval_url`, `thread` and `turn`. They never wait on the person, and they use the person's sign-in, never a key you
132
+ pass.
133
+
134
+ This guide is `qupai guide`; `qupai skill install` writes it where Claude Code and Codex read skills.
@@ -0,0 +1,198 @@
1
+ Third-party software in the qupai binary and the full-screen app
2
+
3
+ The qupai binary is built with Go and links the modules below. Each keeps its
4
+ own license, reproduced here. scripts/npm-packages.mjs refuses to build when the
5
+ binary links a module this file does not name.
6
+
7
+ The full-screen app (tui/qupai-tui.mjs in the npm package @quspect/qupai) is one
8
+ JavaScript file bundled from tui/ with the npm packages named after the Go
9
+ modules, at the exact versions shown. scripts/npm-packages.mjs refuses to build
10
+ it when it bundles a package this file does not name at its version.
11
+
12
+ ================================================================================
13
+ Go (the runtime and standard library), https://go.dev
14
+ License: BSD-3-Clause
15
+ --------------------------------------------------------------------------------
16
+ Copyright 2009 The Go Authors.
17
+
18
+ Redistribution and use in source and binary forms, with or without
19
+ modification, are permitted provided that the following conditions are
20
+ met:
21
+
22
+ * Redistributions of source code must retain the above copyright
23
+ notice, this list of conditions and the following disclaimer.
24
+ * Redistributions in binary form must reproduce the above
25
+ copyright notice, this list of conditions and the following disclaimer
26
+ in the documentation and/or other materials provided with the
27
+ distribution.
28
+ * Neither the name of Google LLC nor the names of its
29
+ contributors may be used to endorse or promote products derived from
30
+ this software without specific prior written permission.
31
+
32
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
35
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
36
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
37
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
38
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
39
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
40
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
41
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
42
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43
+
44
+ ================================================================================
45
+ golang.org/x/text v0.14.0, https://pkg.go.dev/golang.org/x/text
46
+ License: BSD-3-Clause
47
+ --------------------------------------------------------------------------------
48
+ Copyright (c) 2009 The Go Authors. All rights reserved.
49
+
50
+ Redistribution and use in source and binary forms, with or without
51
+ modification, are permitted provided that the following conditions are
52
+ met:
53
+
54
+ * Redistributions of source code must retain the above copyright
55
+ notice, this list of conditions and the following disclaimer.
56
+ * Redistributions in binary form must reproduce the above
57
+ copyright notice, this list of conditions and the following disclaimer
58
+ in the documentation and/or other materials provided with the
59
+ distribution.
60
+ * Neither the name of Google Inc. nor the names of its
61
+ contributors may be used to endorse or promote products derived from
62
+ this software without specific prior written permission.
63
+
64
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
65
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
66
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
67
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
68
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
69
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
70
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
71
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
72
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
73
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
74
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
75
+
76
+ ================================================================================
77
+ github.com/santhosh-tekuri/jsonschema/v6 v6.0.3,
78
+ https://github.com/santhosh-tekuri/jsonschema
79
+ License: Apache-2.0, the same text as this repository's LICENSE file. The
80
+ module ships no NOTICE file.
81
+
82
+ ================================================================================
83
+ @earendil-works/pi-tui 1.5.2, https://github.com/earendil-works/pi
84
+ (packages/tui)
85
+ License: MIT (the npm package ships no license file; this is the text of the
86
+ pi repository's LICENSE)
87
+ --------------------------------------------------------------------------------
88
+ MIT License
89
+
90
+ Copyright (c) 2025 Mario Zechner
91
+
92
+ Permission is hereby granted, free of charge, to any person obtaining a copy
93
+ of this software and associated documentation files (the "Software"), to deal
94
+ in the Software without restriction, including without limitation the rights
95
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
96
+ copies of the Software, and to permit persons to whom the Software is
97
+ furnished to do so, subject to the following conditions:
98
+
99
+ The above copyright notice and this permission notice shall be included in all
100
+ copies or substantial portions of the Software.
101
+
102
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
103
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
104
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
105
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
106
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
107
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
108
+ SOFTWARE.
109
+
110
+ ================================================================================
111
+ marked 18.0.11, https://github.com/markedjs/marked
112
+ License: MIT (and, for the Markdown syntax it follows, John Gruber's license)
113
+ --------------------------------------------------------------------------------
114
+ # License information
115
+
116
+ ## Contribution License Agreement
117
+
118
+ If you contribute code to this project, you are implicitly allowing your code
119
+ to be distributed under the MIT license. You are also implicitly verifying that
120
+ all code is your original work. `</legalese>`
121
+
122
+ ## Marked
123
+
124
+ Copyright (c) 2018+, MarkedJS (https://github.com/markedjs/)
125
+ Copyright (c) 2011-2018, Christopher Jeffrey (https://github.com/chjj/)
126
+
127
+ Permission is hereby granted, free of charge, to any person obtaining a copy
128
+ of this software and associated documentation files (the "Software"), to deal
129
+ in the Software without restriction, including without limitation the rights
130
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
131
+ copies of the Software, and to permit persons to whom the Software is
132
+ furnished to do so, subject to the following conditions:
133
+
134
+ The above copyright notice and this permission notice shall be included in
135
+ all copies or substantial portions of the Software.
136
+
137
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
138
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
139
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
140
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
141
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
142
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
143
+ THE SOFTWARE.
144
+
145
+ ## Markdown
146
+
147
+ Copyright © 2004, John Gruber
148
+ http://daringfireball.net/
149
+ All rights reserved.
150
+
151
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
152
+
153
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
154
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
155
+ * Neither the name “Markdown” nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
156
+
157
+ This software is provided by the copyright holders and contributors “as is” and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.
158
+
159
+ ================================================================================
160
+ marked-cjk-friendly 0.1.2, https://github.com/tats-u/markdown-cjk-friendly
161
+ License: MIT
162
+ --------------------------------------------------------------------------------
163
+ Copyright (c) 2024 Tatsunori Uchino, and authors and contributors of original packages
164
+
165
+ Permission is hereby granted, free of charge, to any person
166
+ obtaining a copy of this software and associated documentation
167
+ files (the "Software"), to deal in the Software without
168
+ restriction, including without limitation the rights to use,
169
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
170
+ copies of the Software, and to permit persons to whom the
171
+ Software is furnished to do so, subject to the following
172
+ conditions:
173
+
174
+ The above copyright notice and this permission notice shall be
175
+ included in all copies or substantial portions of the Software.
176
+
177
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
178
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
179
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
180
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
181
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
182
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
183
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
184
+ OTHER DEALINGS IN THE SOFTWARE.
185
+
186
+ ================================================================================
187
+ get-east-asian-width 1.6.0, https://github.com/sindresorhus/get-east-asian-width
188
+ License: MIT
189
+ --------------------------------------------------------------------------------
190
+ MIT License
191
+
192
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
193
+
194
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
195
+
196
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
197
+
198
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/bin/qupai.js CHANGED
@@ -4,7 +4,11 @@
4
4
  // @quspect/qupai-<platform>-<arch>, an optional dependency whose os and cpu fields match only this machine.
5
5
  // Standard input, output and error are the terminal's own, so `qupai login -api-key-file -` reads the key from it,
6
6
  // and the binary's exit status (or the signal that ended it) becomes this command's.
7
+ // It also tells the binary where the full-screen app is (this package's tui/qupai-tui.mjs) and which Node.js runs it
8
+ // (the one running this file), so `qupai` alone on a terminal opens it: QUPAI_TUI_ENTRY, QUPAI_TUI_NODE and
9
+ // QUPAI_TUI_NODE_VERSION, none of them secret. The binary checks the version (pi-tui needs Node.js 22.19 or later).
7
10
  const { spawnSync } = require("node:child_process");
11
+ const { existsSync } = require("node:fs");
8
12
  const path = require("node:path");
9
13
 
10
14
  const pkg = `@quspect/qupai-${process.platform}-${process.arch}`;
@@ -19,11 +23,19 @@ try {
19
23
  process.exit(1);
20
24
  }
21
25
 
26
+ const env = { ...process.env };
27
+ const tui = path.join(__dirname, "..", "tui", "qupai-tui.mjs");
28
+ if (existsSync(tui)) {
29
+ env.QUPAI_TUI_ENTRY = tui;
30
+ env.QUPAI_TUI_NODE = process.execPath;
31
+ env.QUPAI_TUI_NODE_VERSION = process.versions.node;
32
+ }
33
+
22
34
  // Ctrl+C reaches the binary too (the same process group): wait for it to finish rather than leave it running.
23
35
  const signals = ["SIGINT", "SIGTERM", "SIGHUP"];
24
36
  const wait = () => {};
25
37
  for (const s of signals) process.on(s, wait);
26
- const result = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
38
+ const result = spawnSync(bin, process.argv.slice(2), { stdio: "inherit", env });
27
39
  for (const s of signals) process.off(s, wait);
28
40
 
29
41
  if (result.error) {
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "@quspect/qupai",
3
- "version": "0.6.8",
3
+ "version": "0.7.7",
4
4
  "description": "QuPai's command line: sign in to a QuPai platform and ask its agents from a terminal, or from Codex and Claude Code",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Quspect",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/QuSpect/qupai-cli.git"
10
+ },
7
11
  "keywords": [
8
12
  "qupai",
9
13
  "quspect",
@@ -15,18 +19,21 @@
15
19
  },
16
20
  "files": [
17
21
  "bin/",
22
+ "tui/",
23
+ "SKILL.md",
18
24
  "LICENSE",
19
- "NOTICE"
25
+ "NOTICE",
26
+ "THIRD-PARTY-NOTICES"
20
27
  ],
21
28
  "engines": {
22
29
  "node": ">=18"
23
30
  },
24
31
  "optionalDependencies": {
25
- "@quspect/qupai-darwin-arm64": "0.6.8",
26
- "@quspect/qupai-darwin-x64": "0.6.8",
27
- "@quspect/qupai-linux-x64": "0.6.8",
28
- "@quspect/qupai-linux-arm64": "0.6.8",
29
- "@quspect/qupai-win32-x64": "0.6.8",
30
- "@quspect/qupai-win32-arm64": "0.6.8"
32
+ "@quspect/qupai-darwin-arm64": "0.7.7",
33
+ "@quspect/qupai-darwin-x64": "0.7.7",
34
+ "@quspect/qupai-linux-x64": "0.7.7",
35
+ "@quspect/qupai-linux-arm64": "0.7.7",
36
+ "@quspect/qupai-win32-x64": "0.7.7",
37
+ "@quspect/qupai-win32-arm64": "0.7.7"
31
38
  }
32
39
  }