flyspace-cli 0.1.61 → 0.1.62

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.
@@ -25483,7 +25483,7 @@ async function withMcpConfig(profile, connectionIds, fn, extraServers = {}) {
25483
25483
 
25484
25484
  // ../api/src/version.ts
25485
25485
  import { readFileSync as readFileSync8 } from "fs";
25486
- var CLI_VERSION = true ? "0.1.61" : devVersion();
25486
+ var CLI_VERSION = true ? "0.1.62" : devVersion();
25487
25487
  function isOlderVersion(a, b) {
25488
25488
  const parse2 = (v) => v.replace(/^v/, "").split("-")[0].split(".").map(Number);
25489
25489
  const [pa, pb] = [parse2(a), parse2(b)];
@@ -26264,6 +26264,20 @@ var RATE_CARDS = [
26264
26264
  cacheWritePer1M: 3.75,
26265
26265
  effectiveFrom: "2026-09-01"
26266
26266
  },
26267
+ {
26268
+ // Anthropic's pricing page, checked 2026-11-09: the scheduled rise to $3/$15
26269
+ // never happened and $2/$10 became the standard price. Rows recorded since
26270
+ // 2026-09-01 still point at the card above and were overpriced by 50%.
26271
+ id: "anthropic:sonnet-5@2026-11-09",
26272
+ provider: "anthropic",
26273
+ model: "Claude Sonnet 5",
26274
+ matches: ["sonnet", "claude-sonnet"],
26275
+ inputPer1M: 2,
26276
+ outputPer1M: 10,
26277
+ cacheReadPer1M: 0.2,
26278
+ cacheWritePer1M: 2.5,
26279
+ effectiveFrom: "2026-11-09"
26280
+ },
26267
26281
  {
26268
26282
  id: "anthropic:opus-5@launch",
26269
26283
  provider: "anthropic",
@@ -26339,6 +26353,18 @@ var RATE_CARDS = [
26339
26353
  cacheWritePer1M: 5,
26340
26354
  effectiveFrom: EPOCH
26341
26355
  },
26356
+ {
26357
+ // OpenAI's pricing page, checked 2026-11-09: GPT-5.6 Sol dropped to $4/$20.
26358
+ id: "openai:gpt-5.6-sol@2026-11-09",
26359
+ provider: "openai",
26360
+ model: "GPT-5.6 Sol",
26361
+ matches: ["gpt-5.6-sol"],
26362
+ inputPer1M: 4,
26363
+ outputPer1M: 20,
26364
+ cacheReadPer1M: 0.4,
26365
+ cacheWritePer1M: 4,
26366
+ effectiveFrom: "2026-11-09"
26367
+ },
26342
26368
  {
26343
26369
  id: "openai:gpt-5.6-terra@0730",
26344
26370
  provider: "openai",
@@ -32402,42 +32428,49 @@ ${msg.body}` : expandSkillCommand(channelConfig.claudeConfigDir, channelConfig.c
32402
32428
  } : {};
32403
32429
  const permissionServer = channelConfig.runtime === "host" && permission;
32404
32430
  try {
32405
- return await withMcpConfig(
32431
+ return await runWithProfile(
32406
32432
  channelConfig.profile,
32407
- channelConfig.mcpConnections,
32408
- (mcpConfigPath) => this.ask(
32409
- prompt,
32410
- channelConfig.cwd,
32411
- this.config.botName,
32412
- {
32413
- model: channelConfig.model,
32414
- effort: channelConfig.effort,
32415
- runtime: channelConfig.runtime,
32416
- mounts: channelConfig.mounts,
32417
- permissionMode: channelConfig.permissionMode,
32418
- ...permissionServer ? { permissionPromptTool: PERMISSION_PROMPT_TOOL } : {},
32419
- maxBudgetUsd: this.config.maxBudgetUsd,
32420
- agentPersona,
32421
- channelPrompt: channelConfig.prompt,
32422
- ownPersona: channelConfig.ownPersona,
32423
- slackBound: channelConfig.slackBound,
32424
- onActivity,
32425
- ...channelConfig.permissionThread ? {
32426
- onPluginUi: (state) => void this.savePluginUi(channelConfig.profile, channelConfig.permissionThread.threadId, state)
32427
- } : {},
32428
- signal,
32429
- mcpConfigPath,
32430
- ...usageContext ? { usageContext } : {},
32431
- ...channelConfig.docsAccess ? { docsAccess: channelConfig.docsAccess } : {},
32432
- ...channelConfig.docsAccessUnverified ? { docsAccessUnverified: true } : {},
32433
- ...channelConfig.memoryPrompt ? { memoryPrompt: channelConfig.memoryPrompt } : {},
32434
- ...channelConfig.disableAutoMemory ? { disableAutoMemory: true } : {}
32435
- },
32436
- channelConfig.claudeConfigDir,
32437
- sessionId,
32438
- channelConfig.claudeCodeOauthToken
32439
- ),
32440
- ownServers
32433
+ () => withMcpConfig(
32434
+ channelConfig.profile,
32435
+ channelConfig.mcpConnections,
32436
+ (mcpConfigPath) => this.ask(
32437
+ prompt,
32438
+ channelConfig.cwd,
32439
+ this.config.botName,
32440
+ {
32441
+ model: channelConfig.model,
32442
+ effort: channelConfig.effort,
32443
+ runtime: channelConfig.runtime,
32444
+ mounts: channelConfig.mounts,
32445
+ permissionMode: channelConfig.permissionMode,
32446
+ ...permissionServer ? { permissionPromptTool: PERMISSION_PROMPT_TOOL } : {},
32447
+ maxBudgetUsd: this.config.maxBudgetUsd,
32448
+ agentPersona,
32449
+ channelPrompt: channelConfig.prompt,
32450
+ ownPersona: channelConfig.ownPersona,
32451
+ slackBound: channelConfig.slackBound,
32452
+ onActivity,
32453
+ ...channelConfig.permissionThread ? {
32454
+ onPluginUi: (state) => void this.savePluginUi(
32455
+ channelConfig.profile,
32456
+ channelConfig.permissionThread.threadId,
32457
+ state
32458
+ )
32459
+ } : {},
32460
+ signal,
32461
+ mcpConfigPath,
32462
+ ...usageContext ? { usageContext } : {},
32463
+ ...channelConfig.docsAccess ? { docsAccess: channelConfig.docsAccess } : {},
32464
+ ...channelConfig.docsAccessUnverified ? { docsAccessUnverified: true } : {},
32465
+ ...channelConfig.memoryPrompt ? { memoryPrompt: channelConfig.memoryPrompt } : {},
32466
+ ...channelConfig.disableAutoMemory ? { disableAutoMemory: true } : {}
32467
+ },
32468
+ channelConfig.claudeConfigDir,
32469
+ sessionId,
32470
+ channelConfig.claudeCodeOauthToken
32471
+ ),
32472
+ ownServers
32473
+ )
32441
32474
  );
32442
32475
  } catch (err) {
32443
32476
  console.error("[chat-agent] ask failed:", err.message);
@@ -32470,40 +32503,43 @@ ${msg.body}` : expandSkillCommand(channelConfig.claudeConfigDir, channelConfig.c
32470
32503
  const name = subAgentName(channelConfig.agentName);
32471
32504
  const agentPersona = name ? readAgentPersona(channelConfig.claudeConfigDir, channelConfig.cwd, name) : void 0;
32472
32505
  try {
32473
- return await askCodex(
32474
- prompt,
32475
- channelConfig.cwd,
32476
- {
32477
- // A channel (or the composer) can name a Codex model in the same
32478
- // `model` field Claude uses — whichever runner recognises the value
32479
- // owns it. Falling back to CUSTIE_CODEX_MODEL, then to whatever
32480
- // Codex's own config.toml says.
32481
- ...isCodexModel(channelConfig.model) ? { model: channelConfig.model } : channelConfig.codexModel ? { model: channelConfig.codexModel } : {},
32482
- ...channelConfig.effort ? { effort: channelConfig.effort } : {},
32483
- // Codex has no --append-system-prompt, so the workspace persona and
32484
- // the channel's own instructions ride in with the prompt. Without
32485
- // this a Codex turn answers as a generic coding agent: no house
32486
- // language rules, no Slack/dashboard conventions, no channel prompt.
32487
- systemPrompt: [
32488
- buildSystemPrompt(
32489
- this.config.botName,
32490
- agentPersona,
32491
- channelConfig.prompt,
32492
- resolveSelectedOutputStyle(channelConfig.claudeConfigDir)?.body,
32493
- channelConfig.slackBound
32494
- ),
32495
- channelConfig.memoryPrompt,
32496
- docsAccessPromptNote(channelConfig.docsAccess, channelConfig.docsAccessUnverified)
32497
- ].filter(Boolean).join("\n\n---\n\n"),
32498
- // Codex has no per-tool deny list, so any restricted requester gets
32499
- // its read-only sandbox (no file writes). It can still read: see the
32500
- // residual-gap note in docs/features/user-roles.md.
32501
- ...channelConfig.docsAccess === "read" || channelConfig.docsAccess === "none" ? { sandbox: "read-only" } : {},
32502
- ...onActivity ? { onActivity } : {},
32503
- ...signal ? { signal } : {},
32504
- ...usageContext ? { usageContext } : {}
32505
- },
32506
- sessionId
32506
+ return await runWithProfile(
32507
+ channelConfig.profile,
32508
+ () => askCodex(
32509
+ prompt,
32510
+ channelConfig.cwd,
32511
+ {
32512
+ // A channel (or the composer) can name a Codex model in the same
32513
+ // `model` field Claude uses — whichever runner recognises the value
32514
+ // owns it. Falling back to CUSTIE_CODEX_MODEL, then to whatever
32515
+ // Codex's own config.toml says.
32516
+ ...isCodexModel(channelConfig.model) ? { model: channelConfig.model } : channelConfig.codexModel ? { model: channelConfig.codexModel } : {},
32517
+ ...channelConfig.effort ? { effort: channelConfig.effort } : {},
32518
+ // Codex has no --append-system-prompt, so the workspace persona and
32519
+ // the channel's own instructions ride in with the prompt. Without
32520
+ // this a Codex turn answers as a generic coding agent: no house
32521
+ // language rules, no Slack/dashboard conventions, no channel prompt.
32522
+ systemPrompt: [
32523
+ buildSystemPrompt(
32524
+ this.config.botName,
32525
+ agentPersona,
32526
+ channelConfig.prompt,
32527
+ resolveSelectedOutputStyle(channelConfig.claudeConfigDir)?.body,
32528
+ channelConfig.slackBound
32529
+ ),
32530
+ channelConfig.memoryPrompt,
32531
+ docsAccessPromptNote(channelConfig.docsAccess, channelConfig.docsAccessUnverified)
32532
+ ].filter(Boolean).join("\n\n---\n\n"),
32533
+ // Codex has no per-tool deny list, so any restricted requester gets
32534
+ // its read-only sandbox (no file writes). It can still read: see the
32535
+ // residual-gap note in docs/features/user-roles.md.
32536
+ ...channelConfig.docsAccess === "read" || channelConfig.docsAccess === "none" ? { sandbox: "read-only" } : {},
32537
+ ...onActivity ? { onActivity } : {},
32538
+ ...signal ? { signal } : {},
32539
+ ...usageContext ? { usageContext } : {}
32540
+ },
32541
+ sessionId
32542
+ )
32507
32543
  );
32508
32544
  } catch (err) {
32509
32545
  console.error("[chat-agent] ask codex failed:", err.message);
@@ -35165,6 +35201,7 @@ export {
35165
35201
  TRANSLATION_LANGUAGES,
35166
35202
  canonicalLanguage,
35167
35203
  isTranslatableLanguage,
35204
+ isSourceLanguage,
35168
35205
  detectSourceLanguage,
35169
35206
  createTtsRouter,
35170
35207
  dropShareAudio,
package/dist/cli.js CHANGED
@@ -139,6 +139,7 @@ import {
139
139
  isOlderVersion,
140
140
  isPermissionMode,
141
141
  isSlugAvailable,
142
+ isSourceLanguage,
142
143
  isTranslatableLanguage,
143
144
  isUnderLogicalRoot,
144
145
  isUnknownWorkspaceHost,
@@ -280,7 +281,7 @@ import {
280
281
  workspaceHostname,
281
282
  workspaceSkillsDir,
282
283
  writeSkillFile
283
- } from "./chunk-METRJ6PG.js";
284
+ } from "./chunk-BDUA5N6B.js";
284
285
  import {
285
286
  checkPermissionAction,
286
287
  createThreadAction,
@@ -2206,7 +2207,7 @@ function npmEnv(target) {
2206
2207
  return nodeBin ? { ...process.env, PATH: `${nodeBin}:${process.env.PATH ?? ""}` } : process.env;
2207
2208
  }
2208
2209
  async function runUpgrade() {
2209
- const current = "0.1.61";
2210
+ const current = "0.1.62";
2210
2211
  console.log(`Current version: ${current}`);
2211
2212
  console.log("Checking for updates...\n");
2212
2213
  try {
@@ -4120,7 +4121,10 @@ function createAuthConfirmRouter() {
4120
4121
  const back = `/auth/invite?token=${encodeURIComponent(token)}`;
4121
4122
  const lookup = await findInvite(token);
4122
4123
  if (lookup.state !== "valid") return c.redirect(back, 303);
4123
- const link = await generateSignInLink(lookup.invite.email, callbackUrl(c));
4124
+ const workspace = await getWorkspaceById(lookup.invite.workspaceId);
4125
+ const callback = new URL(callbackUrl(c));
4126
+ if (workspace) callback.searchParams.set("next", `/${encodeURIComponent(workspace.slug)}`);
4127
+ const link = await generateSignInLink(lookup.invite.email, callback.toString());
4124
4128
  const src = new URL(link.actionLink);
4125
4129
  const params = readParams({
4126
4130
  token: src.searchParams.get("token") ?? void 0,
@@ -8424,6 +8428,31 @@ function createContinuousChatRouter() {
8424
8428
  return app;
8425
8429
  }
8426
8430
 
8431
+ // ../api/src/dashboard/reply-language.ts
8432
+ var UNDETERMINED = "und";
8433
+ var BACKFILL_CONCURRENCY = 8;
8434
+ async function detectAndStore(replyId, body) {
8435
+ const lang = await detectSourceLanguage("", body) ?? UNDETERMINED;
8436
+ const { error: error2 } = await getSupabaseClient().from("thread_replies").update({ lang }).eq("id", replyId);
8437
+ if (error2) console.error(`Reply language not stored (${replyId}):`, error2.message);
8438
+ return lang;
8439
+ }
8440
+ function recordReplyLanguage(replyId, body) {
8441
+ void detectAndStore(replyId, body).catch(
8442
+ (err) => console.error(`Reply language detection failed (${replyId}):`, err)
8443
+ );
8444
+ }
8445
+ async function backfillReplyLanguages(replies) {
8446
+ const unknown = replies.filter((r) => r.lang == null);
8447
+ for (let i = 0; i < unknown.length; i += BACKFILL_CONCURRENCY) {
8448
+ await Promise.all(
8449
+ unknown.slice(i, i + BACKFILL_CONCURRENCY).map(async (r) => {
8450
+ r.lang = await detectAndStore(r.id, r.body).catch(() => null);
8451
+ })
8452
+ );
8453
+ }
8454
+ }
8455
+
8427
8456
  // ../api/src/dashboard/thread-translate.ts
8428
8457
  import { createHash as createHash4 } from "crypto";
8429
8458
 
@@ -8527,6 +8556,7 @@ Rules:
8527
8556
  - Translate meaning, not words. These are people talking, not prose to be polished. Keep the speaker's register: a terse message stays terse, a casual one stays casual, a rude one stays rude. Do not make anyone sound more formal, more complete, or more articulate than they wrote.
8528
8557
  - A short reply ("\u597D\u554A", "same", "nope") is translated as the natural equivalent in ${languageName}, using the context to see what it is answering. Never expand it into a full sentence the speaker did not write.
8529
8558
  - Keep the Markdown exactly as it is: same heading levels, list nesting, table shape, link and image syntax, blockquotes, and order. Do not add, merge, split, or reorder anything.
8559
+ - A line like \`[BUTTONS: A | B | C]\` holds quick-reply button labels: keep the \`[BUTTONS:\` marker, the \` | \` separators and the closing \`]\` exactly, and translate each label. Never put \`|\` or \`]\` inside a translated label.
8530
8560
  - Do NOT translate: text inside fenced or inline code blocks, URLs, file paths, command names, or @mentions and /skill tokens. Leave them byte-for-byte identical.
8531
8561
  - Keep established technical terms in English where a fluent speaker of ${languageName} would keep them in English rather than reaching for a translated coinage.
8532
8562
  - Use the punctuation conventions of ${languageName}, including full-width punctuation for Chinese and Japanese. Use ordinary ASCII hyphens, never typographic or non-breaking hyphen variants.
@@ -8643,17 +8673,25 @@ async function translateCached(lang, scope, messages, contextFor) {
8643
8673
  const missing = keyed.filter((m) => !cachedOf(m));
8644
8674
  const fresh = /* @__PURE__ */ new Map();
8645
8675
  const freshKey = (m) => `${m.kind}:${m.id}`;
8646
- if (missing.length > 0) {
8676
+ for (const m of missing) {
8677
+ if (isSourceLanguage(lang, m.lang ?? null)) {
8678
+ fresh.set(freshKey(m), { id: m.id, body: m.body, passthrough: true });
8679
+ }
8680
+ }
8681
+ const toModel = missing.filter((m) => !fresh.has(freshKey(m)));
8682
+ if (toModel.length > 0) {
8647
8683
  if (await getTranslationTokensToday(scope.workspaceId) >= DAILY_TOKEN_LIMIT) {
8648
8684
  throw new TranslationLimitError();
8649
8685
  }
8650
- const batches = batchMessages(missing);
8686
+ const batches = batchMessages(toModel);
8651
8687
  const results = await Promise.all(
8652
8688
  batches.map((batch) => translateBatch(batch, contextFor(batch[0]), lang, scope))
8653
8689
  );
8654
8690
  batches.forEach(
8655
8691
  (batch, b) => batch.forEach((m, i) => fresh.set(freshKey(m), results[b][i]))
8656
8692
  );
8693
+ }
8694
+ if (missing.length > 0) {
8657
8695
  await Promise.all(
8658
8696
  kinds.map(
8659
8697
  (kind) => putThreadTranslations(
@@ -9323,7 +9361,7 @@ function createChatRouter(agent = {}) {
9323
9361
  if (!isTranslatableLanguage2(lang)) return c.json({ error: "unsupported language" }, 400);
9324
9362
  const [thread, replies] = await Promise.all([
9325
9363
  getSupabaseClient().from("threads").select("channel_id").eq("id", id).single(),
9326
- getSupabaseClient().from("thread_replies").select("id, author, body").eq("thread_id", id).is("archived_at", null).order("created_at", { ascending: true }).limit(TRANSLATABLE_REPLIES_MAX)
9364
+ getSupabaseClient().from("thread_replies").select("id, author, body, lang").eq("thread_id", id).is("archived_at", null).order("created_at", { ascending: true }).limit(TRANSLATABLE_REPLIES_MAX)
9327
9365
  ]);
9328
9366
  if (thread.error) return c.json({ error: "not found" }, 404);
9329
9367
  if (replies.error) return c.json({ error: replies.error.message }, 500);
@@ -9331,10 +9369,15 @@ function createChatRouter(agent = {}) {
9331
9369
  if (!channelId || !(await globalChannelMeta(c)).has(channelId)) {
9332
9370
  return c.json({ error: "not found" }, 404);
9333
9371
  }
9334
- const messages = (replies.data ?? []).map(
9335
- (r) => ({ id: r.id, author: r.author, body: slackMrkdwnToMarkdown(r.body) })
9336
- );
9372
+ const rows = replies.data ?? [];
9337
9373
  try {
9374
+ await backfillReplyLanguages(rows);
9375
+ const messages = rows.map((r) => ({
9376
+ id: r.id,
9377
+ author: r.author,
9378
+ body: slackMrkdwnToMarkdown(r.body),
9379
+ lang: r.lang
9380
+ }));
9338
9381
  const glossary = (await getChannelGlossaries([channelId])).get(channelId)?.terms ?? [];
9339
9382
  const scope = { workspaceId: c.get("auth").workspaceId, glossary };
9340
9383
  return c.json({ lang, messages: await translateThread(lang, scope, messages) });
@@ -9562,6 +9605,7 @@ function createChatRouter(agent = {}) {
9562
9605
  effort: effortFromRow(reply["effort"])
9563
9606
  });
9564
9607
  askSupport(c, thread.id, input2.author, input2.body);
9608
+ recordReplyLanguage(reply.id, input2.body);
9565
9609
  tagStoredReply(c, {
9566
9610
  threadId: thread.id,
9567
9611
  replyId: reply.id,
@@ -9686,6 +9730,7 @@ function createChatRouter(agent = {}) {
9686
9730
  effort: effortFromRow(data.effort)
9687
9731
  });
9688
9732
  askSupport(c, threadId, input2.author, input2.body);
9733
+ recordReplyLanguage(data.id, input2.body);
9689
9734
  tagStoredReply(c, {
9690
9735
  threadId,
9691
9736
  replyId: data.id,
@@ -10329,7 +10374,7 @@ function createDomainRouter() {
10329
10374
  import { Hono as Hono17 } from "hono";
10330
10375
  var GROQ_TRANSCRIBE_URL = "https://api.groq.com/openai/v1/audio/transcriptions";
10331
10376
  var MODEL2 = "whisper-large-v3-turbo";
10332
- var MAX_AUDIO_BYTES = 5 * 1024 * 1024;
10377
+ var MAX_AUDIO_BYTES = 25 * 1024 * 1024;
10333
10378
  var MAX_PROMPT_CHARS = 400;
10334
10379
  var NO_SPEECH_THRESHOLD = 0.6;
10335
10380
  function createTranscribeRouter() {
@@ -10340,7 +10385,7 @@ function createTranscribeRouter() {
10340
10385
  const body = await c.req.parseBody().catch(() => null);
10341
10386
  const file = body?.["file"];
10342
10387
  if (!(file instanceof File)) return c.json({ error: "missing file" }, 400);
10343
- if (file.size > MAX_AUDIO_BYTES) return c.json({ error: "audio segment too large" }, 400);
10388
+ if (file.size > MAX_AUDIO_BYTES) return c.json({ error: "audio too large" }, 400);
10344
10389
  const form = new FormData();
10345
10390
  form.append("file", file, file.name || "segment.wav");
10346
10391
  form.append("model", MODEL2);
@@ -15125,6 +15170,11 @@ import { join as join16 } from "path";
15125
15170
  var running = false;
15126
15171
  function startHostUpgrade() {
15127
15172
  if (running) return { started: false };
15173
+ if (process.env.FLY_MACHINE_ID) {
15174
+ running = true;
15175
+ setTimeout(() => process.exit(0), 1e3);
15176
+ return { started: true };
15177
+ }
15128
15178
  mkdirSync10(paths.LOG_DIR, { recursive: true });
15129
15179
  const log5 = openSync3(join16(paths.LOG_DIR, "host-upgrade.log"), "a");
15130
15180
  const child = spawn5(process.execPath, [process.argv[1] ?? "", "upgrade"], {
@@ -16170,7 +16220,7 @@ async function main() {
16170
16220
  break;
16171
16221
  case "-v":
16172
16222
  case "--version":
16173
- printRaw("0.1.61");
16223
+ printRaw("0.1.62");
16174
16224
  break;
16175
16225
  case "-h":
16176
16226
  case "--help":
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { createRequire as __flyspaceCreateRequire } from 'node:module';
3
3
  const require = __flyspaceCreateRequire(import.meta.url);
4
4
  import {
5
5
  startServer
6
- } from "./chunk-METRJ6PG.js";
6
+ } from "./chunk-BDUA5N6B.js";
7
7
  import "./chunk-UZMHXV4D.js";
8
8
  export {
9
9
  startServer
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flyspace-cli",
3
- "version": "0.1.61",
3
+ "version": "0.1.62",
4
4
  "description": "AI-native headless community OS",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "private": false,