@agentknight/client 0.9.46 → 0.9.47
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 +201 -201
- package/README.md +305 -305
- package/package.json +5 -5
package/LICENSE
CHANGED
|
@@ -1,201 +1,201 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Copyright [yyyy] [name of copyright owner]
|
|
190
|
-
|
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
-
you may not use this file except in compliance with the License.
|
|
193
|
-
You may obtain a copy of the License at
|
|
194
|
-
|
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
-
|
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
-
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,305 +1,305 @@
|
|
|
1
|
-
# AgentKnight
|
|
2
|
-
|
|
3
|
-
AgentKnight PC Agent connects local coding-agent sessions to an AgentKnight
|
|
4
|
-
Relay Server through Copilot, PI SDK, or ACP adapters.
|
|
5
|
-
|
|
6
|
-
## Embed
|
|
7
|
-
|
|
8
|
-
Use `@agentknight/sdk` to embed the PC Agent runtime in a Node.js application
|
|
9
|
-
without running the CLI or its local management service.
|
|
10
|
-
Call `initialize` with an explicit absolute `dataDirectory` and the connection,
|
|
11
|
-
identity and logging options, then manage the returned runtime with `start` and
|
|
12
|
-
`stop`. The SDK does not select `~/.ak` or read the CLI configuration for you.
|
|
13
|
-
Do not share a data directory between running instances.
|
|
14
|
-
|
|
15
|
-
The CLI depends on the SDK; both use the same release version. The SDK can be
|
|
16
|
-
published independently through the [npm release workflow](../../.github/workflows/agentknight-npm-publish.yml).
|
|
17
|
-
See the [SDK entry point](../../shared/sdk/src/index.ts) for the public API.
|
|
18
|
-
|
|
19
|
-
## Run
|
|
20
|
-
|
|
21
|
-
Use the Node.js version required by [package.json](package.json) and authenticate
|
|
22
|
-
the coding agents you want to use.
|
|
23
|
-
|
|
24
|
-
```powershell
|
|
25
|
-
npx @agentknight/client --env C:\path\to\agentknight.env
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Or install it globally:
|
|
29
|
-
|
|
30
|
-
```powershell
|
|
31
|
-
npm install --global @agentknight/client
|
|
32
|
-
agentknight --env C:\path\to\agentknight.env
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
To switch from the unscoped `agentknight` package, stop the Agent and its service,
|
|
36
|
-
run `npm uninstall --global agentknight`, then install `@agentknight/client` as
|
|
37
|
-
above. The command remains `agentknight`; keep the existing data home and
|
|
38
|
-
configuration. Re-register services that pin the old package path before
|
|
39
|
-
restarting. Updating the old package does not migrate it to the new name.
|
|
40
|
-
|
|
41
|
-
`AGENTKNIGHT_HOME` selects the PC data home, defaulting to `~/.ak`. Without
|
|
42
|
-
`--env`, AgentKnight reads `<home>/agentknight.env`, with process settings taking
|
|
43
|
-
precedence. With `--env`, the selected file is authoritative for PC settings:
|
|
44
|
-
missing settings use defaults or fail validation, rather than inheriting old
|
|
45
|
-
Relay credentials, machine names or data paths. OS and external provider
|
|
46
|
-
environment variables are retained; explicitly supplied file values override them.
|
|
47
|
-
Set custom `AGENTKNIGHT_HOME` in that file as well so restarts use the same home.
|
|
48
|
-
|
|
49
|
-
`COPILOT_REMOTE_HOME` and `AGENTKNIGHT_PI_DIRECTORY` are deprecated input aliases
|
|
50
|
-
for `AGENTKNIGHT_HOME` and PI's native `PI_CODING_AGENT_DIR`. Conflicting aliases
|
|
51
|
-
in the same source are rejected. New configuration and restart metadata use only
|
|
52
|
-
the canonical names. PI's native tilde, file URL and Windows shell path syntax
|
|
53
|
-
is preserved; an explicitly empty PI directory selects its native default.
|
|
54
|
-
|
|
55
|
-
The first normal startup can import legacy working-directory `.env` files or
|
|
56
|
-
the old macOS service configuration into `~/.ak/agentknight.env`. Conflicting
|
|
57
|
-
legacy values require selecting or reconciling the correct file; no source
|
|
58
|
-
silently wins. A selected custom home does not import another home's settings.
|
|
59
|
-
Status and upgrade commands do not import or migrate configuration.
|
|
60
|
-
|
|
61
|
-
A legacy `~/.copilot-remote` home is copied only while the old Agent is stopped,
|
|
62
|
-
preserving its machine identity, pairing keys and saved state. The stable device
|
|
63
|
-
ID now lives in `<home>/device-id` alongside `device.json`; existing identities
|
|
64
|
-
are preserved when importing a retired client layout's ID. Fresh custom homes have
|
|
65
|
-
independent identities. No retired client directory or compatibility symlink is
|
|
66
|
-
created. Conflicting identities or homes require manual resolution, not an
|
|
67
|
-
automatic reset. Retained legacy files are rollback copies, never dual-written;
|
|
68
|
-
remove them only after verifying the migrated installation while old agents are stopped.
|
|
69
|
-
|
|
70
|
-
Diagnostic JSONL files are under `<data-home>/logs/<version>/`. Existing
|
|
71
|
-
unversioned logs remain historical files; they are not assigned an invented
|
|
72
|
-
version. The local pairing page shows the running version, last successful
|
|
73
|
-
upgrade time, configuration location, and Relay URL.
|
|
74
|
-
|
|
75
|
-
## Status and upgrades
|
|
76
|
-
|
|
77
|
-
```powershell
|
|
78
|
-
agentknight --version
|
|
79
|
-
agentknight status
|
|
80
|
-
agentknight status --json
|
|
81
|
-
agentknight upgrade --check
|
|
82
|
-
agentknight upgrade
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
`upgrade` uses the latest published version; `upgrade <version>` selects an exact
|
|
86
|
-
newer version. Self-upgrade requires a global npm installation, not an `npx`
|
|
87
|
-
cache or source checkout. Install a release containing this command through npm
|
|
88
|
-
before using it for subsequent upgrades.
|
|
89
|
-
|
|
90
|
-
Package resolution and installation try the official npm registry first, then
|
|
91
|
-
the Tencent npm mirror for network failures. Existing npm/proxy configuration
|
|
92
|
-
is respected without changing global settings. Archives and dependencies for
|
|
93
|
-
both the target and rollback are prepared before stopping the running Agent.
|
|
94
|
-
|
|
95
|
-
An independent worker waits for idle and performs the switch. Windows scheduled
|
|
96
|
-
tasks and the supplied macOS LaunchAgent retain their existing configuration;
|
|
97
|
-
foreground instances restart in the background. Persist their configuration and
|
|
98
|
-
provider credentials in the environment file before upgrading; shell-only values
|
|
99
|
-
that cannot be restored cause the upgrade to be refused. A stopped installation
|
|
100
|
-
remains stopped. User-level installations do not require elevation; protected npm
|
|
101
|
-
prefixes or service definitions need their existing permissions.
|
|
102
|
-
|
|
103
|
-
The command reports the handoff, not successful completion. Use `status` to see
|
|
104
|
-
the persistent result if the initiating connection closes. An Agent that remains
|
|
105
|
-
busy is left running. Startup failure triggers an offline rollback; readiness
|
|
106
|
-
requires the new instance's registration and initial synchronization, not merely
|
|
107
|
-
an HTTP health response. Upgrading briefly interrupts the PC connection and does
|
|
108
|
-
not migrate an active model turn between processes.
|
|
109
|
-
|
|
110
|
-
Successful upgrades remove their temporary installation materials. Failed jobs
|
|
111
|
-
retain their diagnostic files under `<data-home>/upgrades`; the last successful
|
|
112
|
-
upgrade timestamp changes only after recovery is confirmed.
|
|
113
|
-
|
|
114
|
-
## Configuration
|
|
115
|
-
|
|
116
|
-
Create the environment file from the
|
|
117
|
-
[PC Agent example](https://github.com/hydraxman/AgentKnight/blob/main/clients/pc-agent/.env.example).
|
|
118
|
-
|
|
119
|
-
`RELAY_URL` is used for HTTP APIs and Socket.IO, so an `https://` URL enables
|
|
120
|
-
HTTPS and WSS for the entire PC Agent connection. `AGENTKNIGHT_MACHINE_NAME`
|
|
121
|
-
controls the PC name shown to mobile clients. The selection and pairing webpage
|
|
122
|
-
listens only on loopback; `PAIRING_PAGE_PORT` changes its local port.
|
|
123
|
-
|
|
124
|
-
Repository checkouts also include Windows Scheduled Task and macOS LaunchAgent
|
|
125
|
-
installers under `clients/pc-agent/scripts`. Services use the same canonical
|
|
126
|
-
configuration as the CLI, not a copied environment file. Service support files
|
|
127
|
-
and output logs live under `<home>/service` and `<home>/logs/service`; OS task and
|
|
128
|
-
LaunchAgent registrations stay in their required system locations. Reinstall the
|
|
129
|
-
service to update an older registration after stopping it and migrating its
|
|
130
|
-
configuration. Explicit external environment files remain referenced in place.
|
|
131
|
-
Uninstalling the service preserves configuration, identity and logs.
|
|
132
|
-
Installers resolve the data home through `agentknight status --json`, so they
|
|
133
|
-
must be used with the matching installed CLI. They pin the installation working
|
|
134
|
-
directory to preserve relative paths; reinstall after changing the configured
|
|
135
|
-
home or moving that directory. A missing canonical configuration must be
|
|
136
|
-
created or migrated before installing the default service. Both default and
|
|
137
|
-
explicit-file installations refuse a pending legacy-home migration; stop the old
|
|
138
|
-
service and complete a normal startup with the selected configuration first.
|
|
139
|
-
|
|
140
|
-
Re-register older Windows tasks
|
|
141
|
-
that use `-CaCertPath` with `agentknight-service.ps1 install -EnvFile <path>`
|
|
142
|
-
(and `-TaskName <name>` for a custom task), omitting `-CaCertPath`.
|
|
143
|
-
|
|
144
|
-
### Microsoft sign-in
|
|
145
|
-
|
|
146
|
-
Set `RELAY_URL` and `RELAY_AUTH=microsoft` in the environment file, then start
|
|
147
|
-
AgentKnight. Open the printed loopback URL and select **使用 Microsoft 登录**.
|
|
148
|
-
Complete Microsoft sign-in and any application consent in a browser on that same
|
|
149
|
-
computer. The browser returns to AgentKnight automatically; there is no device
|
|
150
|
-
code to copy or enter. The Relay must support browser callback sign-in, have
|
|
151
|
-
Microsoft sign-in enabled, and admit your account through its administrator.
|
|
152
|
-
An older Relay must be upgraded rather than silently switching to manual codes.
|
|
153
|
-
|
|
154
|
-
After approval, AgentKnight saves the machine-bound Relay credential in the
|
|
155
|
-
current OS user's credential store, confirms it with Relay, and connects. The
|
|
156
|
-
normal local page then provides Android pairing. Android still only scans or
|
|
157
|
-
imports the pairing information; Microsoft sign-in does not replace the
|
|
158
|
-
PC–phone encryption key or authenticate GitHub Copilot.
|
|
159
|
-
|
|
160
|
-
Microsoft sign-in supports Windows Credential Manager and macOS Keychain only.
|
|
161
|
-
Other operating systems are not supported for Microsoft sign-in; existing token
|
|
162
|
-
authentication is unchanged. There is no plaintext or nonpersistent-keyring fallback.
|
|
163
|
-
Run the service as the same OS user who signed in. Restarts reuse the saved
|
|
164
|
-
credential; no Microsoft password, browser cookie or client secret is stored by
|
|
165
|
-
the PC Agent.
|
|
166
|
-
|
|
167
|
-
Microsoft sign-in must remain enabled on Relay so the Agent can verify saved
|
|
168
|
-
credentials at startup. Verification failures retain the saved credential and
|
|
169
|
-
show an error instead of silently switching accounts.
|
|
170
|
-
|
|
171
|
-
To authorize a stopped installation explicitly, including before headless
|
|
172
|
-
startup, run:
|
|
173
|
-
|
|
174
|
-
```powershell
|
|
175
|
-
agentknight login --env C:\path\to\agentknight.env
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
Use the same environment file and data home as the service. Do not delete or
|
|
179
|
-
recreate `device.json` to sign in. A running Agent must be stopped before an
|
|
180
|
-
explicit login; the command does not stop it for you. Browser logout does not
|
|
181
|
-
revoke this PC: use the Relay's `/account` page to revoke its grant.
|
|
182
|
-
|
|
183
|
-
### Existing tokens
|
|
184
|
-
|
|
185
|
-
An existing `RELAY_TOKEN` continues to select token authentication unless
|
|
186
|
-
`RELAY_AUTH=microsoft` is explicitly set. Microsoft sign-in uses the server's
|
|
187
|
-
returned user identity, not `USER_ID`, and never falls back to the old token on
|
|
188
|
-
failure. Keep legacy tokens in the environment file, not command-line arguments
|
|
189
|
-
or source control.
|
|
190
|
-
|
|
191
|
-
The local page shows the Relay account's username, role and authentication
|
|
192
|
-
method, separately from coding-agent connections. Generated Microsoft usernames
|
|
193
|
-
are displayed as "Microsoft account"; **查看账户** opens the Relay's browser account
|
|
194
|
-
page to view the Microsoft name and manage device grants. Account details require the
|
|
195
|
-
Relay's PC account endpoint; update Relay as well as the PC client. An older
|
|
196
|
-
Relay is reported explicitly instead of guessing a username from `USER_ID`.
|
|
197
|
-
|
|
198
|
-
See the [AgentKnight repository](https://github.com/hydraxman/AgentKnight) for
|
|
199
|
-
Relay Server and Android client setup.
|
|
200
|
-
|
|
201
|
-
## Coding agents
|
|
202
|
-
|
|
203
|
-
The Copilot SDK and bundled CLI are pinned together in the [SDK manifest](../../shared/sdk/package.json).
|
|
204
|
-
Keep separately installed Copilot terminals aligned with that CLI when attaching
|
|
205
|
-
to their live sessions; restart the terminal after upgrading it. A
|
|
206
|
-
`COPILOT_CLI_PATH` override must provide a compatible runtime.
|
|
207
|
-
|
|
208
|
-
With `AGENTKNIGHT_CODING_AGENT=managed`, saved agent selections are restored at
|
|
209
|
-
startup, including an intentionally empty selection. Without a saved selection,
|
|
210
|
-
GitHub Copilot sync is enabled without visiting the local webpage. Use the webpage
|
|
211
|
-
to enable agents and select **同步** (Sync), or explicitly show the QR code to pair Android.
|
|
212
|
-
Multiple agents share one PC connection. Enabling an agent syncs all of its
|
|
213
|
-
current and future locally discoverable sessions; individual sessions need no
|
|
214
|
-
selection. Unselected agents remain private. Selections survive PC Agent restarts.
|
|
215
|
-
|
|
216
|
-
Use `--agents copilot,pi` to enable agent sync at startup, or `--agents none` to disable
|
|
217
|
-
all agent sync. This switches to managed mode and overrides both the saved selection and
|
|
218
|
-
`AGENTKNIGHT_CODING_AGENT` for that start without overwriting saved settings.
|
|
219
|
-
Native agent configuration still comes from the environment file. Subsequent
|
|
220
|
-
webpage Sync actions apply immediately and save the selection; the startup flag takes precedence
|
|
221
|
-
again on restart. Managed mode also works with the local webpage disabled.
|
|
222
|
-
|
|
223
|
-
PI discovery reads its native session inventory without resuming conversations.
|
|
224
|
-
AgentKnight can continue saved PI sessions, but cannot attach to a running PI
|
|
225
|
-
terminal. Avoid continuing the same session concurrently in both applications.
|
|
226
|
-
|
|
227
|
-
In Android, choose **Rename** from a supported session's menu to change its native
|
|
228
|
-
name, not a local display alias. Renaming a group changes only its title, not its
|
|
229
|
-
participants' names.
|
|
230
|
-
|
|
231
|
-
Use **Agent 群聊** on the local webpage to enable or disable group chat without
|
|
232
|
-
restarting the PC Agent. The saved choice takes precedence over the environment
|
|
233
|
-
setting in [.env.example](.env.example), including after a restart. Disabling
|
|
234
|
-
pauses active groups and keeps their history; enabling does not resume them automatically.
|
|
235
|
-
Groups connect two shared Copilot sessions on the same PC, in either managed or
|
|
236
|
-
single-engine mode, including sessions created in the CLI or restored after a restart.
|
|
237
|
-
Both participants must be idle with no pending input. After restarting, groups remain
|
|
238
|
-
paused without replay; send a new group message to continue with the existing members.
|
|
239
|
-
Other engines do not support groups.
|
|
240
|
-
|
|
241
|
-
For experimental online conversation between Copilot sessions on two PCs, see
|
|
242
|
-
the [peer-chat setup](../../docs/remote-sessions/agent-group-chat-design.md#使用).
|
|
243
|
-
It is separate from local groups and sends Relay-readable text.
|
|
244
|
-
Use only non-sensitive test content.
|
|
245
|
-
|
|
246
|
-
Explicit engine values retain single-engine operation without
|
|
247
|
-
selection filtering. See [.env.example](.env.example) for configuration.
|
|
248
|
-
|
|
249
|
-
| Engine | Setup |
|
|
250
|
-
| --- | --- |
|
|
251
|
-
| `copilot` | Authenticate the GitHub Copilot CLI as before. |
|
|
252
|
-
| `pi` | Install the optional PI dependencies using the Node.js version required by their manifests. Authenticate through PI's CLI or supported provider environment variables. |
|
|
253
|
-
| `codex` | Install and authenticate the [official Codex CLI](https://developers.openai.com/codex/cli/); executable overrides are in [.env.example](.env.example). |
|
|
254
|
-
| `claude` | Enable optional dependencies and follow the [official Agent SDK setup](https://platform.claude.com/docs/en/agent-sdk/overview) for API-key or cloud-provider authentication. Personal subscription OAuth is not reused. |
|
|
255
|
-
| `acp` | Install and authenticate an ACP-compatible agent or bridge. Set `AGENTKNIGHT_ACP_COMMAND` to its executable and `AGENTKNIGHT_ACP_ARGS` to a JSON string array, such as `["--stdio"]` if that agent requires it. |
|
|
256
|
-
|
|
257
|
-
PI uses its native directory by default. `PI_CODING_AGENT_DIR` selects an
|
|
258
|
-
alternative directory containing PI authentication, model configuration, and
|
|
259
|
-
session history; use the same directory when authenticating PI. Install
|
|
260
|
-
AgentKnight with optional dependencies enabled to use PI.
|
|
261
|
-
Source builds and the complete adapter suite also require the PI-compatible Node
|
|
262
|
-
version; Copilot-only operation retains the baseline version in the manifest.
|
|
263
|
-
|
|
264
|
-
Codex (App Server) and Claude (Agent SDK) expose only AgentKnight-created
|
|
265
|
-
conversations and their saved history, not existing CLI/IDE conversations.
|
|
266
|
-
Credentials stay on the PC; discovery does not verify authentication.
|
|
267
|
-
Copilot-specific Workbench, group and peer-chat operations remain unsupported.
|
|
268
|
-
|
|
269
|
-
The ACP executable must speak the Agent Client Protocol over stdio; an ordinary
|
|
270
|
-
Codex or Claude Code CLI is not automatically an ACP endpoint. Arguments are
|
|
271
|
-
passed literally, without a shell. AgentKnight does not download or authenticate
|
|
272
|
-
the configured executable. Choose a trusted local agent: its own tools execute
|
|
273
|
-
with the PC user's privileges. ACP state is kept under the PC data directory,
|
|
274
|
-
separately for each executable/argument configuration.
|
|
275
|
-
|
|
276
|
-
Adapters expose only supported configuration and operations. PI executes tools
|
|
277
|
-
natively, without an added per-tool approval layer. Project resources follow PI's
|
|
278
|
-
native project trust decisions, with unresolved trust prompts routed to Android.
|
|
279
|
-
Machine-wide features such as uploads and deletion are available only when every
|
|
280
|
-
selected engine supports them; session controls use that session's own engine.
|
|
281
|
-
ACP approvals use the agent's offered one-time permission option, never an
|
|
282
|
-
automatic persistent grant. Unsupported operations return errors rather than
|
|
283
|
-
pretending to succeed. Only Copilot exposes its remote-mode toggle.
|
|
284
|
-
Generic file uploads remain Copilot-only; PI, Codex and Claude also reject image uploads, while
|
|
285
|
-
ACP images require the agent's negotiated image support.
|
|
286
|
-
|
|
287
|
-
Optional controls follow the [capability compatibility policy](../../docs/remote-sessions/protocol-compatibility-plan.md);
|
|
288
|
-
the historical registration `sdkVersion` is a compatibility marker, while
|
|
289
|
-
startup logs record the actual engine and SDK version.
|
|
290
|
-
|
|
291
|
-
## Copilot uploaded files
|
|
292
|
-
|
|
293
|
-
Mobile uploads are integrity-checked transport bytes, not model API messages.
|
|
294
|
-
The PC Agent keeps generic files in its Copilot session state (`COPILOT_HOME`,
|
|
295
|
-
or the default Copilot home) and sends absolute paths through the official
|
|
296
|
-
[SDK file attachment contract](https://github.com/github/copilot-sdk/blob/v1.0.11/nodejs/src/types.ts);
|
|
297
|
-
images remain blob attachments. The local CLI decides native document handling
|
|
298
|
-
versus file-tool access: even [document support](https://github.com/github/copilot-sdk/blob/v1.0.11/docs/features/citations.md#attach-documents-to-a-message)
|
|
299
|
-
depends on the model, so an accepted upload does not guarantee every format is readable.
|
|
300
|
-
Files remain across acknowledgements, queued turns, failed sends and local restarts/resumes;
|
|
301
|
-
they are removed only after successful explicit session deletion, not after each turn.
|
|
302
|
-
This requires the runtime to share the PC Agent's filesystem and Copilot home.
|
|
303
|
-
The default stdio runtime and the SDK's in-process override are local; unverified
|
|
304
|
-
external clients do not advertise file uploads and reject them with an actionable error.
|
|
305
|
-
Moving a session to another machine does not transfer these local files.
|
|
1
|
+
# AgentKnight
|
|
2
|
+
|
|
3
|
+
AgentKnight PC Agent connects local coding-agent sessions to an AgentKnight
|
|
4
|
+
Relay Server through Copilot, PI SDK, or ACP adapters.
|
|
5
|
+
|
|
6
|
+
## Embed
|
|
7
|
+
|
|
8
|
+
Use `@agentknight/sdk` to embed the PC Agent runtime in a Node.js application
|
|
9
|
+
without running the CLI or its local management service.
|
|
10
|
+
Call `initialize` with an explicit absolute `dataDirectory` and the connection,
|
|
11
|
+
identity and logging options, then manage the returned runtime with `start` and
|
|
12
|
+
`stop`. The SDK does not select `~/.ak` or read the CLI configuration for you.
|
|
13
|
+
Do not share a data directory between running instances.
|
|
14
|
+
|
|
15
|
+
The CLI depends on the SDK; both use the same release version. The SDK can be
|
|
16
|
+
published independently through the [npm release workflow](../../.github/workflows/agentknight-npm-publish.yml).
|
|
17
|
+
See the [SDK entry point](../../shared/sdk/src/index.ts) for the public API.
|
|
18
|
+
|
|
19
|
+
## Run
|
|
20
|
+
|
|
21
|
+
Use the Node.js version required by [package.json](package.json) and authenticate
|
|
22
|
+
the coding agents you want to use.
|
|
23
|
+
|
|
24
|
+
```powershell
|
|
25
|
+
npx @agentknight/client --env C:\path\to\agentknight.env
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Or install it globally:
|
|
29
|
+
|
|
30
|
+
```powershell
|
|
31
|
+
npm install --global @agentknight/client
|
|
32
|
+
agentknight --env C:\path\to\agentknight.env
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
To switch from the unscoped `agentknight` package, stop the Agent and its service,
|
|
36
|
+
run `npm uninstall --global agentknight`, then install `@agentknight/client` as
|
|
37
|
+
above. The command remains `agentknight`; keep the existing data home and
|
|
38
|
+
configuration. Re-register services that pin the old package path before
|
|
39
|
+
restarting. Updating the old package does not migrate it to the new name.
|
|
40
|
+
|
|
41
|
+
`AGENTKNIGHT_HOME` selects the PC data home, defaulting to `~/.ak`. Without
|
|
42
|
+
`--env`, AgentKnight reads `<home>/agentknight.env`, with process settings taking
|
|
43
|
+
precedence. With `--env`, the selected file is authoritative for PC settings:
|
|
44
|
+
missing settings use defaults or fail validation, rather than inheriting old
|
|
45
|
+
Relay credentials, machine names or data paths. OS and external provider
|
|
46
|
+
environment variables are retained; explicitly supplied file values override them.
|
|
47
|
+
Set custom `AGENTKNIGHT_HOME` in that file as well so restarts use the same home.
|
|
48
|
+
|
|
49
|
+
`COPILOT_REMOTE_HOME` and `AGENTKNIGHT_PI_DIRECTORY` are deprecated input aliases
|
|
50
|
+
for `AGENTKNIGHT_HOME` and PI's native `PI_CODING_AGENT_DIR`. Conflicting aliases
|
|
51
|
+
in the same source are rejected. New configuration and restart metadata use only
|
|
52
|
+
the canonical names. PI's native tilde, file URL and Windows shell path syntax
|
|
53
|
+
is preserved; an explicitly empty PI directory selects its native default.
|
|
54
|
+
|
|
55
|
+
The first normal startup can import legacy working-directory `.env` files or
|
|
56
|
+
the old macOS service configuration into `~/.ak/agentknight.env`. Conflicting
|
|
57
|
+
legacy values require selecting or reconciling the correct file; no source
|
|
58
|
+
silently wins. A selected custom home does not import another home's settings.
|
|
59
|
+
Status and upgrade commands do not import or migrate configuration.
|
|
60
|
+
|
|
61
|
+
A legacy `~/.copilot-remote` home is copied only while the old Agent is stopped,
|
|
62
|
+
preserving its machine identity, pairing keys and saved state. The stable device
|
|
63
|
+
ID now lives in `<home>/device-id` alongside `device.json`; existing identities
|
|
64
|
+
are preserved when importing a retired client layout's ID. Fresh custom homes have
|
|
65
|
+
independent identities. No retired client directory or compatibility symlink is
|
|
66
|
+
created. Conflicting identities or homes require manual resolution, not an
|
|
67
|
+
automatic reset. Retained legacy files are rollback copies, never dual-written;
|
|
68
|
+
remove them only after verifying the migrated installation while old agents are stopped.
|
|
69
|
+
|
|
70
|
+
Diagnostic JSONL files are under `<data-home>/logs/<version>/`. Existing
|
|
71
|
+
unversioned logs remain historical files; they are not assigned an invented
|
|
72
|
+
version. The local pairing page shows the running version, last successful
|
|
73
|
+
upgrade time, configuration location, and Relay URL.
|
|
74
|
+
|
|
75
|
+
## Status and upgrades
|
|
76
|
+
|
|
77
|
+
```powershell
|
|
78
|
+
agentknight --version
|
|
79
|
+
agentknight status
|
|
80
|
+
agentknight status --json
|
|
81
|
+
agentknight upgrade --check
|
|
82
|
+
agentknight upgrade
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
`upgrade` uses the latest published version; `upgrade <version>` selects an exact
|
|
86
|
+
newer version. Self-upgrade requires a global npm installation, not an `npx`
|
|
87
|
+
cache or source checkout. Install a release containing this command through npm
|
|
88
|
+
before using it for subsequent upgrades.
|
|
89
|
+
|
|
90
|
+
Package resolution and installation try the official npm registry first, then
|
|
91
|
+
the Tencent npm mirror for network failures. Existing npm/proxy configuration
|
|
92
|
+
is respected without changing global settings. Archives and dependencies for
|
|
93
|
+
both the target and rollback are prepared before stopping the running Agent.
|
|
94
|
+
|
|
95
|
+
An independent worker waits for idle and performs the switch. Windows scheduled
|
|
96
|
+
tasks and the supplied macOS LaunchAgent retain their existing configuration;
|
|
97
|
+
foreground instances restart in the background. Persist their configuration and
|
|
98
|
+
provider credentials in the environment file before upgrading; shell-only values
|
|
99
|
+
that cannot be restored cause the upgrade to be refused. A stopped installation
|
|
100
|
+
remains stopped. User-level installations do not require elevation; protected npm
|
|
101
|
+
prefixes or service definitions need their existing permissions.
|
|
102
|
+
|
|
103
|
+
The command reports the handoff, not successful completion. Use `status` to see
|
|
104
|
+
the persistent result if the initiating connection closes. An Agent that remains
|
|
105
|
+
busy is left running. Startup failure triggers an offline rollback; readiness
|
|
106
|
+
requires the new instance's registration and initial synchronization, not merely
|
|
107
|
+
an HTTP health response. Upgrading briefly interrupts the PC connection and does
|
|
108
|
+
not migrate an active model turn between processes.
|
|
109
|
+
|
|
110
|
+
Successful upgrades remove their temporary installation materials. Failed jobs
|
|
111
|
+
retain their diagnostic files under `<data-home>/upgrades`; the last successful
|
|
112
|
+
upgrade timestamp changes only after recovery is confirmed.
|
|
113
|
+
|
|
114
|
+
## Configuration
|
|
115
|
+
|
|
116
|
+
Create the environment file from the
|
|
117
|
+
[PC Agent example](https://github.com/hydraxman/AgentKnight/blob/main/clients/pc-agent/.env.example).
|
|
118
|
+
|
|
119
|
+
`RELAY_URL` is used for HTTP APIs and Socket.IO, so an `https://` URL enables
|
|
120
|
+
HTTPS and WSS for the entire PC Agent connection. `AGENTKNIGHT_MACHINE_NAME`
|
|
121
|
+
controls the PC name shown to mobile clients. The selection and pairing webpage
|
|
122
|
+
listens only on loopback; `PAIRING_PAGE_PORT` changes its local port.
|
|
123
|
+
|
|
124
|
+
Repository checkouts also include Windows Scheduled Task and macOS LaunchAgent
|
|
125
|
+
installers under `clients/pc-agent/scripts`. Services use the same canonical
|
|
126
|
+
configuration as the CLI, not a copied environment file. Service support files
|
|
127
|
+
and output logs live under `<home>/service` and `<home>/logs/service`; OS task and
|
|
128
|
+
LaunchAgent registrations stay in their required system locations. Reinstall the
|
|
129
|
+
service to update an older registration after stopping it and migrating its
|
|
130
|
+
configuration. Explicit external environment files remain referenced in place.
|
|
131
|
+
Uninstalling the service preserves configuration, identity and logs.
|
|
132
|
+
Installers resolve the data home through `agentknight status --json`, so they
|
|
133
|
+
must be used with the matching installed CLI. They pin the installation working
|
|
134
|
+
directory to preserve relative paths; reinstall after changing the configured
|
|
135
|
+
home or moving that directory. A missing canonical configuration must be
|
|
136
|
+
created or migrated before installing the default service. Both default and
|
|
137
|
+
explicit-file installations refuse a pending legacy-home migration; stop the old
|
|
138
|
+
service and complete a normal startup with the selected configuration first.
|
|
139
|
+
|
|
140
|
+
Re-register older Windows tasks
|
|
141
|
+
that use `-CaCertPath` with `agentknight-service.ps1 install -EnvFile <path>`
|
|
142
|
+
(and `-TaskName <name>` for a custom task), omitting `-CaCertPath`.
|
|
143
|
+
|
|
144
|
+
### Microsoft sign-in
|
|
145
|
+
|
|
146
|
+
Set `RELAY_URL` and `RELAY_AUTH=microsoft` in the environment file, then start
|
|
147
|
+
AgentKnight. Open the printed loopback URL and select **使用 Microsoft 登录**.
|
|
148
|
+
Complete Microsoft sign-in and any application consent in a browser on that same
|
|
149
|
+
computer. The browser returns to AgentKnight automatically; there is no device
|
|
150
|
+
code to copy or enter. The Relay must support browser callback sign-in, have
|
|
151
|
+
Microsoft sign-in enabled, and admit your account through its administrator.
|
|
152
|
+
An older Relay must be upgraded rather than silently switching to manual codes.
|
|
153
|
+
|
|
154
|
+
After approval, AgentKnight saves the machine-bound Relay credential in the
|
|
155
|
+
current OS user's credential store, confirms it with Relay, and connects. The
|
|
156
|
+
normal local page then provides Android pairing. Android still only scans or
|
|
157
|
+
imports the pairing information; Microsoft sign-in does not replace the
|
|
158
|
+
PC–phone encryption key or authenticate GitHub Copilot.
|
|
159
|
+
|
|
160
|
+
Microsoft sign-in supports Windows Credential Manager and macOS Keychain only.
|
|
161
|
+
Other operating systems are not supported for Microsoft sign-in; existing token
|
|
162
|
+
authentication is unchanged. There is no plaintext or nonpersistent-keyring fallback.
|
|
163
|
+
Run the service as the same OS user who signed in. Restarts reuse the saved
|
|
164
|
+
credential; no Microsoft password, browser cookie or client secret is stored by
|
|
165
|
+
the PC Agent.
|
|
166
|
+
|
|
167
|
+
Microsoft sign-in must remain enabled on Relay so the Agent can verify saved
|
|
168
|
+
credentials at startup. Verification failures retain the saved credential and
|
|
169
|
+
show an error instead of silently switching accounts.
|
|
170
|
+
|
|
171
|
+
To authorize a stopped installation explicitly, including before headless
|
|
172
|
+
startup, run:
|
|
173
|
+
|
|
174
|
+
```powershell
|
|
175
|
+
agentknight login --env C:\path\to\agentknight.env
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Use the same environment file and data home as the service. Do not delete or
|
|
179
|
+
recreate `device.json` to sign in. A running Agent must be stopped before an
|
|
180
|
+
explicit login; the command does not stop it for you. Browser logout does not
|
|
181
|
+
revoke this PC: use the Relay's `/account` page to revoke its grant.
|
|
182
|
+
|
|
183
|
+
### Existing tokens
|
|
184
|
+
|
|
185
|
+
An existing `RELAY_TOKEN` continues to select token authentication unless
|
|
186
|
+
`RELAY_AUTH=microsoft` is explicitly set. Microsoft sign-in uses the server's
|
|
187
|
+
returned user identity, not `USER_ID`, and never falls back to the old token on
|
|
188
|
+
failure. Keep legacy tokens in the environment file, not command-line arguments
|
|
189
|
+
or source control.
|
|
190
|
+
|
|
191
|
+
The local page shows the Relay account's username, role and authentication
|
|
192
|
+
method, separately from coding-agent connections. Generated Microsoft usernames
|
|
193
|
+
are displayed as "Microsoft account"; **查看账户** opens the Relay's browser account
|
|
194
|
+
page to view the Microsoft name and manage device grants. Account details require the
|
|
195
|
+
Relay's PC account endpoint; update Relay as well as the PC client. An older
|
|
196
|
+
Relay is reported explicitly instead of guessing a username from `USER_ID`.
|
|
197
|
+
|
|
198
|
+
See the [AgentKnight repository](https://github.com/hydraxman/AgentKnight) for
|
|
199
|
+
Relay Server and Android client setup.
|
|
200
|
+
|
|
201
|
+
## Coding agents
|
|
202
|
+
|
|
203
|
+
The Copilot SDK and bundled CLI are pinned together in the [SDK manifest](../../shared/sdk/package.json).
|
|
204
|
+
Keep separately installed Copilot terminals aligned with that CLI when attaching
|
|
205
|
+
to their live sessions; restart the terminal after upgrading it. A
|
|
206
|
+
`COPILOT_CLI_PATH` override must provide a compatible runtime.
|
|
207
|
+
|
|
208
|
+
With `AGENTKNIGHT_CODING_AGENT=managed`, saved agent selections are restored at
|
|
209
|
+
startup, including an intentionally empty selection. Without a saved selection,
|
|
210
|
+
GitHub Copilot sync is enabled without visiting the local webpage. Use the webpage
|
|
211
|
+
to enable agents and select **同步** (Sync), or explicitly show the QR code to pair Android.
|
|
212
|
+
Multiple agents share one PC connection. Enabling an agent syncs all of its
|
|
213
|
+
current and future locally discoverable sessions; individual sessions need no
|
|
214
|
+
selection. Unselected agents remain private. Selections survive PC Agent restarts.
|
|
215
|
+
|
|
216
|
+
Use `--agents copilot,pi` to enable agent sync at startup, or `--agents none` to disable
|
|
217
|
+
all agent sync. This switches to managed mode and overrides both the saved selection and
|
|
218
|
+
`AGENTKNIGHT_CODING_AGENT` for that start without overwriting saved settings.
|
|
219
|
+
Native agent configuration still comes from the environment file. Subsequent
|
|
220
|
+
webpage Sync actions apply immediately and save the selection; the startup flag takes precedence
|
|
221
|
+
again on restart. Managed mode also works with the local webpage disabled.
|
|
222
|
+
|
|
223
|
+
PI discovery reads its native session inventory without resuming conversations.
|
|
224
|
+
AgentKnight can continue saved PI sessions, but cannot attach to a running PI
|
|
225
|
+
terminal. Avoid continuing the same session concurrently in both applications.
|
|
226
|
+
|
|
227
|
+
In Android, choose **Rename** from a supported session's menu to change its native
|
|
228
|
+
name, not a local display alias. Renaming a group changes only its title, not its
|
|
229
|
+
participants' names.
|
|
230
|
+
|
|
231
|
+
Use **Agent 群聊** on the local webpage to enable or disable group chat without
|
|
232
|
+
restarting the PC Agent. The saved choice takes precedence over the environment
|
|
233
|
+
setting in [.env.example](.env.example), including after a restart. Disabling
|
|
234
|
+
pauses active groups and keeps their history; enabling does not resume them automatically.
|
|
235
|
+
Groups connect two shared Copilot sessions on the same PC, in either managed or
|
|
236
|
+
single-engine mode, including sessions created in the CLI or restored after a restart.
|
|
237
|
+
Both participants must be idle with no pending input. After restarting, groups remain
|
|
238
|
+
paused without replay; send a new group message to continue with the existing members.
|
|
239
|
+
Other engines do not support groups.
|
|
240
|
+
|
|
241
|
+
For experimental online conversation between Copilot sessions on two PCs, see
|
|
242
|
+
the [peer-chat setup](../../docs/remote-sessions/agent-group-chat-design.md#使用).
|
|
243
|
+
It is separate from local groups and sends Relay-readable text.
|
|
244
|
+
Use only non-sensitive test content.
|
|
245
|
+
|
|
246
|
+
Explicit engine values retain single-engine operation without
|
|
247
|
+
selection filtering. See [.env.example](.env.example) for configuration.
|
|
248
|
+
|
|
249
|
+
| Engine | Setup |
|
|
250
|
+
| --- | --- |
|
|
251
|
+
| `copilot` | Authenticate the GitHub Copilot CLI as before. |
|
|
252
|
+
| `pi` | Install the optional PI dependencies using the Node.js version required by their manifests. Authenticate through PI's CLI or supported provider environment variables. |
|
|
253
|
+
| `codex` | Install and authenticate the [official Codex CLI](https://developers.openai.com/codex/cli/); executable overrides are in [.env.example](.env.example). |
|
|
254
|
+
| `claude` | Enable optional dependencies and follow the [official Agent SDK setup](https://platform.claude.com/docs/en/agent-sdk/overview) for API-key or cloud-provider authentication. Personal subscription OAuth is not reused. |
|
|
255
|
+
| `acp` | Install and authenticate an ACP-compatible agent or bridge. Set `AGENTKNIGHT_ACP_COMMAND` to its executable and `AGENTKNIGHT_ACP_ARGS` to a JSON string array, such as `["--stdio"]` if that agent requires it. |
|
|
256
|
+
|
|
257
|
+
PI uses its native directory by default. `PI_CODING_AGENT_DIR` selects an
|
|
258
|
+
alternative directory containing PI authentication, model configuration, and
|
|
259
|
+
session history; use the same directory when authenticating PI. Install
|
|
260
|
+
AgentKnight with optional dependencies enabled to use PI.
|
|
261
|
+
Source builds and the complete adapter suite also require the PI-compatible Node
|
|
262
|
+
version; Copilot-only operation retains the baseline version in the manifest.
|
|
263
|
+
|
|
264
|
+
Codex (App Server) and Claude (Agent SDK) expose only AgentKnight-created
|
|
265
|
+
conversations and their saved history, not existing CLI/IDE conversations.
|
|
266
|
+
Credentials stay on the PC; discovery does not verify authentication.
|
|
267
|
+
Copilot-specific Workbench, group and peer-chat operations remain unsupported.
|
|
268
|
+
|
|
269
|
+
The ACP executable must speak the Agent Client Protocol over stdio; an ordinary
|
|
270
|
+
Codex or Claude Code CLI is not automatically an ACP endpoint. Arguments are
|
|
271
|
+
passed literally, without a shell. AgentKnight does not download or authenticate
|
|
272
|
+
the configured executable. Choose a trusted local agent: its own tools execute
|
|
273
|
+
with the PC user's privileges. ACP state is kept under the PC data directory,
|
|
274
|
+
separately for each executable/argument configuration.
|
|
275
|
+
|
|
276
|
+
Adapters expose only supported configuration and operations. PI executes tools
|
|
277
|
+
natively, without an added per-tool approval layer. Project resources follow PI's
|
|
278
|
+
native project trust decisions, with unresolved trust prompts routed to Android.
|
|
279
|
+
Machine-wide features such as uploads and deletion are available only when every
|
|
280
|
+
selected engine supports them; session controls use that session's own engine.
|
|
281
|
+
ACP approvals use the agent's offered one-time permission option, never an
|
|
282
|
+
automatic persistent grant. Unsupported operations return errors rather than
|
|
283
|
+
pretending to succeed. Only Copilot exposes its remote-mode toggle.
|
|
284
|
+
Generic file uploads remain Copilot-only; PI, Codex and Claude also reject image uploads, while
|
|
285
|
+
ACP images require the agent's negotiated image support.
|
|
286
|
+
|
|
287
|
+
Optional controls follow the [capability compatibility policy](../../docs/remote-sessions/protocol-compatibility-plan.md);
|
|
288
|
+
the historical registration `sdkVersion` is a compatibility marker, while
|
|
289
|
+
startup logs record the actual engine and SDK version.
|
|
290
|
+
|
|
291
|
+
## Copilot uploaded files
|
|
292
|
+
|
|
293
|
+
Mobile uploads are integrity-checked transport bytes, not model API messages.
|
|
294
|
+
The PC Agent keeps generic files in its Copilot session state (`COPILOT_HOME`,
|
|
295
|
+
or the default Copilot home) and sends absolute paths through the official
|
|
296
|
+
[SDK file attachment contract](https://github.com/github/copilot-sdk/blob/v1.0.11/nodejs/src/types.ts);
|
|
297
|
+
images remain blob attachments. The local CLI decides native document handling
|
|
298
|
+
versus file-tool access: even [document support](https://github.com/github/copilot-sdk/blob/v1.0.11/docs/features/citations.md#attach-documents-to-a-message)
|
|
299
|
+
depends on the model, so an accepted upload does not guarantee every format is readable.
|
|
300
|
+
Files remain across acknowledgements, queued turns, failed sends and local restarts/resumes;
|
|
301
|
+
they are removed only after successful explicit session deletion, not after each turn.
|
|
302
|
+
This requires the runtime to share the PC Agent's filesystem and Copilot home.
|
|
303
|
+
The default stdio runtime and the SDK's in-process override are local; unverified
|
|
304
|
+
external clients do not advertise file uploads and reject them with an actionable error.
|
|
305
|
+
Moving a session to another machine does not transfer these local files.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentknight/client",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.47",
|
|
4
4
|
"description": "AgentKnight PC Agent CLI for remote coding sessions",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
"registry": "https://registry.npmjs.org/"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@napi-rs/keyring": "2.1.
|
|
39
|
+
"@napi-rs/keyring": "2.1.2",
|
|
40
40
|
"pino": "10.3.1",
|
|
41
41
|
"qrcode": "1.5.4",
|
|
42
42
|
"qrcode-terminal": "0.12.0",
|
|
43
43
|
"zod": "4.6.5",
|
|
44
|
-
"@agentknight/sdk": "0.9.
|
|
44
|
+
"@agentknight/sdk": "0.9.47"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/qrcode": "1.5.6",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"esbuild": "0.28.2",
|
|
50
50
|
"sharp": "0.35.5",
|
|
51
51
|
"socket.io-client": "4.8.4",
|
|
52
|
-
"@agentknight/
|
|
53
|
-
"@agentknight/
|
|
52
|
+
"@agentknight/protocol": "0.1.0",
|
|
53
|
+
"@agentknight/shared": "0.1.0"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
|