@quspect/qupai 0.0.0-stage → 0.7.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 ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,6 @@
1
+ qupai-cli
2
+ Copyright 2026 Quspect
3
+
4
+ The qupai binary also contains the Go runtime and standard library and the
5
+ modules listed in THIRD-PARTY-NOTICES, each under its own license, reproduced
6
+ there.
package/README.md CHANGED
@@ -1,3 +1,33 @@
1
- # Temporary Holding Version
1
+ # qupai
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ `qupai` is QuPai's command line. It signs in to a QuPai platform and asks its agents from a terminal, or
4
+ from agents such as Codex and Claude Code. It also checks and packs product packages, runs a task on a
5
+ standalone Runtime and works on QuPai Studio canvases.
6
+
7
+ ```sh
8
+ npm install -g @quspect/qupai
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
14
+ ```
15
+
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).
18
+
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
29
+ machine as an optional dependency (`@quspect/qupai-<platform>-<arch>`), so do not install with
30
+ `--omit=optional`.
31
+
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,115 @@
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). Use when the person asks to use QuPai, a QuPai agent, a QuPai lab or project, or a quantum computer through QuPai.
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
+ ## MCP
108
+
109
+ `claude mcp add qupai -- qupai mcp` (Codex: `codex mcp add qupai -- qupai mcp`) offers the same as tools: `status`,
110
+ `list_agents`, `ask` and `wait`. `ask` takes `prompt` and `product` (with `agent`), `lab` or `thread`; `ask` and `wait`
111
+ follow the turn for at most `timeout_seconds` (default 120, at most 600) and return the same `status`, `answer`,
112
+ `approval_url`, `thread` and `turn`. They never wait on the person, and they use the person's sign-in, never a key you
113
+ pass.
114
+
115
+ 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 ADDED
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ // The qupai command installed from npm. It runs the binary in the platform package npm installed beside this one:
4
+ // @quspect/qupai-<platform>-<arch>, an optional dependency whose os and cpu fields match only this machine.
5
+ // Standard input, output and error are the terminal's own, so `qupai login -api-key-file -` reads the key from it,
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).
10
+ const { spawnSync } = require("node:child_process");
11
+ const { existsSync } = require("node:fs");
12
+ const path = require("node:path");
13
+
14
+ const pkg = `@quspect/qupai-${process.platform}-${process.arch}`;
15
+ let bin;
16
+ try {
17
+ bin = path.join(path.dirname(require.resolve(`${pkg}/package.json`)), "bin", process.platform === "win32" ? "qupai.exe" : "qupai");
18
+ } catch {
19
+ process.stderr.write(
20
+ `qupai: ${pkg} is not installed. qupai is built for macOS, Linux and Windows on x64 and arm64; on one of ` +
21
+ "those, install it again without --omit=optional or --no-optional: npm install -g @quspect/qupai\n",
22
+ );
23
+ process.exit(1);
24
+ }
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
+
34
+ // Ctrl+C reaches the binary too (the same process group): wait for it to finish rather than leave it running.
35
+ const signals = ["SIGINT", "SIGTERM", "SIGHUP"];
36
+ const wait = () => {};
37
+ for (const s of signals) process.on(s, wait);
38
+ const result = spawnSync(bin, process.argv.slice(2), { stdio: "inherit", env });
39
+ for (const s of signals) process.off(s, wait);
40
+
41
+ if (result.error) {
42
+ process.stderr.write(`qupai: ${result.error.message}\n`);
43
+ process.exit(1);
44
+ }
45
+ if (result.signal) process.kill(process.pid, result.signal);
46
+ process.exit(result.status ?? 1);
package/package.json CHANGED
@@ -1,6 +1,39 @@
1
1
  {
2
2
  "name": "@quspect/qupai",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.7.0",
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
+ "license": "Apache-2.0",
6
+ "author": "Quspect",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/QuSpect/qupai-cli.git"
10
+ },
11
+ "keywords": [
12
+ "qupai",
13
+ "quspect",
14
+ "cli",
15
+ "agents"
16
+ ],
17
+ "bin": {
18
+ "qupai": "bin/qupai.js"
19
+ },
20
+ "files": [
21
+ "bin/",
22
+ "tui/",
23
+ "SKILL.md",
24
+ "LICENSE",
25
+ "NOTICE",
26
+ "THIRD-PARTY-NOTICES"
27
+ ],
28
+ "engines": {
29
+ "node": ">=18"
30
+ },
31
+ "optionalDependencies": {
32
+ "@quspect/qupai-darwin-arm64": "0.7.0",
33
+ "@quspect/qupai-darwin-x64": "0.7.0",
34
+ "@quspect/qupai-linux-x64": "0.7.0",
35
+ "@quspect/qupai-linux-arm64": "0.7.0",
36
+ "@quspect/qupai-win32-x64": "0.7.0",
37
+ "@quspect/qupai-win32-arm64": "0.7.0"
38
+ }
39
+ }