@stevezhou/sisu 0.3.8 → 0.3.10
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/dist/commands.js +5 -1
- package/dist/runtime/launch.js +17 -0
- package/package.json +1 -1
package/dist/commands.js
CHANGED
|
@@ -37,7 +37,11 @@ const client_1 = require("./client");
|
|
|
37
37
|
const launch_1 = require("./runtime/launch");
|
|
38
38
|
/** Host + pager stamp for `sisu status`. Shipped reporter — tests drive this. */
|
|
39
39
|
function formatCliReleaseStatus(version = client_1.SISU_CLIENT_VERSION, pagerStamp = (0, launch_1.installedPagerStamp)()) {
|
|
40
|
-
|
|
40
|
+
const lines = [`cli ${version}`, `pager ${pagerStamp || 'none'}`];
|
|
41
|
+
if (!pagerStamp || (0, launch_1.comparePagerStamp)(pagerStamp, version) < 0) {
|
|
42
|
+
lines.push('pager behind — run sisu update');
|
|
43
|
+
}
|
|
44
|
+
return lines.join('\n');
|
|
41
45
|
}
|
|
42
46
|
async function loginCommand(input, http = http_1.defaultHttp) {
|
|
43
47
|
const apiBase = (input.apiBase || process.env.SISU_API_BASE || store_1.DEFAULT_API_BASE).replace(/\/+$/, '');
|
package/dist/runtime/launch.js
CHANGED
|
@@ -86,6 +86,9 @@ function writeSisuGrokConfig() {
|
|
|
86
86
|
'[endpoints]',
|
|
87
87
|
`xai_api_base_url = "${runtimeBase}"`,
|
|
88
88
|
'',
|
|
89
|
+
'[agent]',
|
|
90
|
+
'system_prompt_label = "SiSu"',
|
|
91
|
+
'',
|
|
89
92
|
].join('\n');
|
|
90
93
|
const existing = fs_1.default.existsSync(file) ? fs_1.default.readFileSync(file, 'utf8') : '';
|
|
91
94
|
if (!existing || existing.includes('sisu-managed grok-build')) {
|
|
@@ -191,6 +194,19 @@ function sisuGrokBuildEnv() {
|
|
|
191
194
|
else {
|
|
192
195
|
env.XAI_API_KEY = auth?.token || '';
|
|
193
196
|
}
|
|
197
|
+
// grok-build's cached_token path reads GROK_AUTH / GROK_HOME auth.json.
|
|
198
|
+
// Without a disk session it falls through to accounts.x.ai. Seed an ApiKey
|
|
199
|
+
// snapshot of the SiSu JWT so the pager never starts grok.com OAuth.
|
|
200
|
+
delete env.GROK_AUTH;
|
|
201
|
+
if (auth?.token) {
|
|
202
|
+
env.GROK_AUTH = JSON.stringify({
|
|
203
|
+
key: auth.token,
|
|
204
|
+
auth_mode: 'api_key',
|
|
205
|
+
create_time: new Date().toISOString(),
|
|
206
|
+
user_id: auth.user_id || 'sisu',
|
|
207
|
+
email: auth.email || undefined,
|
|
208
|
+
});
|
|
209
|
+
}
|
|
194
210
|
return {
|
|
195
211
|
...env,
|
|
196
212
|
SISU_ACCESS_POINT: '1',
|
|
@@ -201,6 +217,7 @@ function sisuGrokBuildEnv() {
|
|
|
201
217
|
SISU_ACCOUNT_PLAN: auth?.plan_code || '',
|
|
202
218
|
SISU_API_BASE: apiBase,
|
|
203
219
|
SISU_CLIENT_VERSION: client_1.SISU_CLIENT_VERSION,
|
|
220
|
+
GROK_SYSTEM_PROMPT_LABEL: 'SiSu',
|
|
204
221
|
SISU_CONVERSATION_ID: (0, store_1.ensureConversationId)(),
|
|
205
222
|
GROK_XAI_API_BASE_URL: runtime,
|
|
206
223
|
XAI_API_BASE_URL: runtime,
|