flyspace-cli 0.1.36 → 0.1.37
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/{chunk-HG5Z6QVF.js → chunk-JTZN44U4.js} +1 -1
- package/dist/cli.js +137 -40
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -369,7 +369,7 @@ function rowToChannel(row) {
|
|
|
369
369
|
agentName: row.agent_name,
|
|
370
370
|
dmKey: row.dm_key,
|
|
371
371
|
isDefault: row.is_default === true,
|
|
372
|
-
profile: row.profile
|
|
372
|
+
profile: row.profile,
|
|
373
373
|
archivedAt: row.archived_at,
|
|
374
374
|
greetedAt: row.greeted_at,
|
|
375
375
|
createdAt: row.created_at,
|
package/dist/cli.js
CHANGED
|
@@ -187,7 +187,7 @@ import {
|
|
|
187
187
|
warnOnBrokenChannelCwds,
|
|
188
188
|
workspaceSkillsDir,
|
|
189
189
|
writeSkillFile
|
|
190
|
-
} from "./chunk-
|
|
190
|
+
} from "./chunk-JTZN44U4.js";
|
|
191
191
|
import {
|
|
192
192
|
firstReplyBody,
|
|
193
193
|
getThread,
|
|
@@ -1861,7 +1861,7 @@ async function runAuthCmd(args) {
|
|
|
1861
1861
|
}
|
|
1862
1862
|
|
|
1863
1863
|
// ../api/src/version.ts
|
|
1864
|
-
var CLI_VERSION = true ? "0.1.
|
|
1864
|
+
var CLI_VERSION = true ? "0.1.37" : null;
|
|
1865
1865
|
function isOlderVersion(a, b) {
|
|
1866
1866
|
const parse = (v) => v.replace(/^v/, "").split("-")[0].split(".").map(Number);
|
|
1867
1867
|
const [pa, pb] = [parse(a), parse(b)];
|
|
@@ -2471,7 +2471,7 @@ function npmEnv(target) {
|
|
|
2471
2471
|
return nodeBin ? { ...process.env, PATH: `${nodeBin}:${process.env.PATH ?? ""}` } : process.env;
|
|
2472
2472
|
}
|
|
2473
2473
|
async function runUpgrade() {
|
|
2474
|
-
const current = "0.1.
|
|
2474
|
+
const current = "0.1.37";
|
|
2475
2475
|
console.log(`Current version: ${current}`);
|
|
2476
2476
|
console.log("Checking for updates...\n");
|
|
2477
2477
|
try {
|
|
@@ -6610,7 +6610,7 @@ var requireDocsAccess = async (c, next) => {
|
|
|
6610
6610
|
};
|
|
6611
6611
|
|
|
6612
6612
|
// ../api/src/dashboard/api.ts
|
|
6613
|
-
import { Hono as
|
|
6613
|
+
import { Hono as Hono32 } from "hono";
|
|
6614
6614
|
|
|
6615
6615
|
// ../api/src/dashboard/public-share-routes.ts
|
|
6616
6616
|
import { existsSync as existsSync17, readFileSync as readFileSync16, statSync as statSync3 } from "fs";
|
|
@@ -13777,8 +13777,89 @@ async function ensureIntroThread(ch) {
|
|
|
13777
13777
|
return error2?.code === "23505" ? (await existing()).data?.id ?? null : null;
|
|
13778
13778
|
}
|
|
13779
13779
|
|
|
13780
|
-
// ../api/src/dashboard/channel-
|
|
13780
|
+
// ../api/src/dashboard/channel-suggest.ts
|
|
13781
13781
|
import { Hono as Hono26 } from "hono";
|
|
13782
|
+
var CATEGORY_MAX_CHARS = 16;
|
|
13783
|
+
var CATEGORY_MAX_ITEMS = 30;
|
|
13784
|
+
var PROMPT_MAX_CHARS = 4e3;
|
|
13785
|
+
var READ_FOLDER = "Read-only: inspect the current folder first (top-level file listing, CLAUDE.md / AGENTS.md, README.md, docs/), but do not create, modify or delete anything.";
|
|
13786
|
+
var SYSTEMS = {
|
|
13787
|
+
topicCategories: [
|
|
13788
|
+
"You propose the preferred topic categories for a chat channel. Each new thread in it is titled `[category] subject`, so the categories should name this project's concrete components or feature areas (e.g. Docs pane, Auto Topic, Login, Billing).",
|
|
13789
|
+
READ_FOLDER,
|
|
13790
|
+
`Rules: roughly 15 to 30 categories; each at most ${CATEGORY_MAX_CHARS} characters; no generic types such as Bug, Feature, Idea, Question or Task; no duplicates. Keep useful ones from the current list and from the recent thread titles. Use the language the project is worked in; for Chinese use Traditional Chinese (Taiwan) and keep technical terms in English. Never use em dashes or en dashes.`,
|
|
13791
|
+
"Output only the categories, one per line, with no numbering, bullets or commentary."
|
|
13792
|
+
].join("\n\n"),
|
|
13793
|
+
prompt: [
|
|
13794
|
+
"You draft the channel prompt for a chat channel: instructions appended to the workspace prompt for every agent run in it. A prompt is about the conversation (who is talking here, the audience, tone, language, and what is off limits), not project knowledge: architecture, conventions and commands already live in the folder's CLAUDE.md / AGENTS.md, so never repeat them.",
|
|
13795
|
+
READ_FOLDER,
|
|
13796
|
+
"Rules: short (at most about 10 lines), concrete, grounded in what the folder and threads show. Improve on the current prompt if there is one rather than starting over. Write in the language the project is worked in; for Chinese use Traditional Chinese (Taiwan), full-width punctuation, technical terms in English. Never use em dashes or en dashes.",
|
|
13797
|
+
"Output only the prompt text itself, with no preamble, quotes or code fences."
|
|
13798
|
+
].join("\n\n")
|
|
13799
|
+
};
|
|
13800
|
+
function buildSuggestContext(ch, field, threadTitles, memories) {
|
|
13801
|
+
return [
|
|
13802
|
+
`Channel: #${ch.name}`,
|
|
13803
|
+
field === "prompt" ? `Current prompt:
|
|
13804
|
+
${ch.prompt?.trim() || "(none)"}` : `Current categories:
|
|
13805
|
+
${ch.topicCategories.join("\n") || "(none)"}`,
|
|
13806
|
+
field === "topicCategories" && ch.prompt ? `Channel prompt:
|
|
13807
|
+
${ch.prompt.slice(0, 1500)}` : "",
|
|
13808
|
+
`Recent thread titles:
|
|
13809
|
+
${threadTitles.join("\n") || "(none yet)"}`,
|
|
13810
|
+
memories.length ? `Channel memory:
|
|
13811
|
+
${memories.map((m) => `- ${m.name}: ${m.description}`).join("\n")}` : ""
|
|
13812
|
+
].filter(Boolean).join("\n\n");
|
|
13813
|
+
}
|
|
13814
|
+
function parseSuggestion(field, raw) {
|
|
13815
|
+
const text = raw.replace(/^```[^\n]*\n?|\n?```\s*$/g, "").replace(/\s*[\u2013\u2014]\s*/g, ", ").trim();
|
|
13816
|
+
if (field === "prompt") return text ? text.slice(0, PROMPT_MAX_CHARS) : null;
|
|
13817
|
+
const seen = /* @__PURE__ */ new Set();
|
|
13818
|
+
const items = [];
|
|
13819
|
+
for (const line of text.split("\n")) {
|
|
13820
|
+
const item = line.replace(/^\s*(?:[-*•]|\d+[.)])\s*/, "").replace(/[`*"[\]]/g, "").trim();
|
|
13821
|
+
const key = item.toLowerCase();
|
|
13822
|
+
if (!item || item.length > CATEGORY_MAX_CHARS || seen.has(key)) continue;
|
|
13823
|
+
seen.add(key);
|
|
13824
|
+
items.push(item);
|
|
13825
|
+
}
|
|
13826
|
+
return items.length ? items.slice(0, CATEGORY_MAX_ITEMS).join("\n") : null;
|
|
13827
|
+
}
|
|
13828
|
+
function createChannelSuggestRouter(agent) {
|
|
13829
|
+
const router = new Hono26();
|
|
13830
|
+
router.post("/:id/suggest", async (c) => {
|
|
13831
|
+
const channel = findChannel(c.req.param("id"));
|
|
13832
|
+
if (!channel || !canSeeChannel(channel, c.get("auth"))) {
|
|
13833
|
+
return c.json({ error: "channel not found" }, 404);
|
|
13834
|
+
}
|
|
13835
|
+
const body = await c.req.json().catch(() => ({}));
|
|
13836
|
+
const field = body.field;
|
|
13837
|
+
if (field !== "prompt" && field !== "topicCategories") return c.json({ error: "invalid field" }, 400);
|
|
13838
|
+
if (!agent.suggestChannelField) return c.json({ error: "not supported here" }, 501);
|
|
13839
|
+
const [{ data: threads }, memories] = await Promise.all([
|
|
13840
|
+
getSupabaseClient().from("threads").select("auto_title, title").eq("channel_id", channel.id).order("created_at", { ascending: false }).limit(50),
|
|
13841
|
+
// Memory is a Labs feature; a channel without it just has none to offer.
|
|
13842
|
+
listChannelMemories(channel.id).catch(() => [])
|
|
13843
|
+
]);
|
|
13844
|
+
const titles = (threads ?? []).map((t) => t.title ?? t.auto_title).filter((t) => !!t);
|
|
13845
|
+
const result = await agent.suggestChannelField({
|
|
13846
|
+
channelId: channel.id,
|
|
13847
|
+
system: SYSTEMS[field],
|
|
13848
|
+
user: buildSuggestContext(channel, field, titles, memories)
|
|
13849
|
+
});
|
|
13850
|
+
if (!result) {
|
|
13851
|
+
const failure3 = agent.getHostCallFailure?.("suggestChannelField");
|
|
13852
|
+
return failure3 ? c.json({ error: "The Host is offline or did not answer in time." }, 503) : c.json({ error: "The Host needs an upgrade for suggestions: run flyspace upgrade." }, 501);
|
|
13853
|
+
}
|
|
13854
|
+
const value = result.ok ? parseSuggestion(field, result.raw) : null;
|
|
13855
|
+
if (value === null) return c.json({ error: "Could not generate a suggestion." }, 502);
|
|
13856
|
+
return c.json({ value });
|
|
13857
|
+
});
|
|
13858
|
+
return router;
|
|
13859
|
+
}
|
|
13860
|
+
|
|
13861
|
+
// ../api/src/dashboard/channel-members-routes.ts
|
|
13862
|
+
import { Hono as Hono27 } from "hono";
|
|
13782
13863
|
async function isChannelAdmin(ctx, channelId) {
|
|
13783
13864
|
if (ctx.role === "admin") return true;
|
|
13784
13865
|
const membership = await getMembershipByUserId(ctx.workspaceId, ctx.userId);
|
|
@@ -13787,7 +13868,7 @@ async function isChannelAdmin(ctx, channelId) {
|
|
|
13787
13868
|
return members.some((m) => m.membershipId === membership.id && m.role === "channel_admin");
|
|
13788
13869
|
}
|
|
13789
13870
|
function createChannelMembersRouter() {
|
|
13790
|
-
const router = new
|
|
13871
|
+
const router = new Hono27();
|
|
13791
13872
|
router.get("/:id/members", async (c) => {
|
|
13792
13873
|
const ctx = await resolveAuthContext(c);
|
|
13793
13874
|
if (!ctx) return c.json({ error: "workspace access required" }, 403);
|
|
@@ -13857,7 +13938,7 @@ function createChannelMembersRouter() {
|
|
|
13857
13938
|
}
|
|
13858
13939
|
|
|
13859
13940
|
// ../api/src/dashboard/memories-routes.ts
|
|
13860
|
-
import { Hono as
|
|
13941
|
+
import { Hono as Hono28 } from "hono";
|
|
13861
13942
|
async function readPatch(c) {
|
|
13862
13943
|
const body = await c.req.json().catch(() => ({}));
|
|
13863
13944
|
const patch = {};
|
|
@@ -13885,7 +13966,7 @@ var requireAgentMemory = async (c, next) => {
|
|
|
13885
13966
|
await next();
|
|
13886
13967
|
};
|
|
13887
13968
|
function createMemoriesRouter() {
|
|
13888
|
-
const router = new
|
|
13969
|
+
const router = new Hono28();
|
|
13889
13970
|
for (const path of [
|
|
13890
13971
|
"/:id/memories",
|
|
13891
13972
|
"/:id/memories/*",
|
|
@@ -13958,7 +14039,7 @@ function createMemoriesRouter() {
|
|
|
13958
14039
|
return router;
|
|
13959
14040
|
}
|
|
13960
14041
|
function createScopedMemoriesRouter() {
|
|
13961
|
-
const router = new
|
|
14042
|
+
const router = new Hono28();
|
|
13962
14043
|
router.use("*", requireAgentMemory);
|
|
13963
14044
|
const workspace = (c) => ({
|
|
13964
14045
|
scope: "workspace",
|
|
@@ -14018,7 +14099,7 @@ function createScopedMemoriesRouter() {
|
|
|
14018
14099
|
}
|
|
14019
14100
|
|
|
14020
14101
|
// ../api/src/dashboard/session-import-routes.ts
|
|
14021
|
-
import { Hono as
|
|
14102
|
+
import { Hono as Hono29 } from "hono";
|
|
14022
14103
|
var MAX_FOLDERS2 = 20;
|
|
14023
14104
|
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
14024
14105
|
var IMPORT_RANGES = ["all", "7d", "latest5"];
|
|
@@ -14124,7 +14205,7 @@ async function syncSession(agent, channelId, session, author, existing) {
|
|
|
14124
14205
|
return messages.length;
|
|
14125
14206
|
}
|
|
14126
14207
|
function createSessionImportRouter(agent) {
|
|
14127
|
-
const app = new
|
|
14208
|
+
const app = new Hono29();
|
|
14128
14209
|
const scanFolders = async () => {
|
|
14129
14210
|
const scan = await ask(agent, { op: "scan", slug: getProfile() });
|
|
14130
14211
|
return scan && importableFolders(scan.folders, getProfileChannelRegistry());
|
|
@@ -14422,6 +14503,7 @@ function registerDataRoutes(api, agent = {}) {
|
|
|
14422
14503
|
api.route("/onboarding", createOnboardingRouter(agent));
|
|
14423
14504
|
api.route("/session-import", createSessionImportRouter(agent));
|
|
14424
14505
|
api.route("/channels", createChannelGreetingRouter(agent));
|
|
14506
|
+
api.route("/channels", createChannelSuggestRouter(agent));
|
|
14425
14507
|
api.route("/channels", createChannelMembersRouter());
|
|
14426
14508
|
api.route("/channels", createMemoriesRouter());
|
|
14427
14509
|
api.route("/memories", createScopedMemoriesRouter());
|
|
@@ -14675,7 +14757,7 @@ function registerDataRoutes(api, agent = {}) {
|
|
|
14675
14757
|
// ../api/src/dashboard/device-auth-routes.ts
|
|
14676
14758
|
import { verify } from "crypto";
|
|
14677
14759
|
import { getConnInfo } from "@hono/node-server/conninfo";
|
|
14678
|
-
import { Hono as
|
|
14760
|
+
import { Hono as Hono30 } from "hono";
|
|
14679
14761
|
var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
14680
14762
|
function cleanText(value, max) {
|
|
14681
14763
|
if (typeof value !== "string") return null;
|
|
@@ -14723,7 +14805,7 @@ async function boundWorkspaceIds(publicKey, userId) {
|
|
|
14723
14805
|
return new Set(existing ? (await listDeviceWorkspaces(existing)).map((w) => w.id) : []);
|
|
14724
14806
|
}
|
|
14725
14807
|
function createDeviceAuthRouter() {
|
|
14726
|
-
const app = new
|
|
14808
|
+
const app = new Hono30();
|
|
14727
14809
|
app.post("/code", async (c) => {
|
|
14728
14810
|
const body = await readBody(c);
|
|
14729
14811
|
const publicKey = typeof body["public_key"] === "string" ? body["public_key"] : "";
|
|
@@ -15042,7 +15124,7 @@ var workspaceRef = () => ({ kind: "workspace" });
|
|
|
15042
15124
|
var channelRef = (c) => ({ kind: "channel", channelId: c.req.param("id") });
|
|
15043
15125
|
|
|
15044
15126
|
// ../api/src/dashboard/output-styles-routes.ts
|
|
15045
|
-
import { Hono as
|
|
15127
|
+
import { Hono as Hono31 } from "hono";
|
|
15046
15128
|
function requireAdmin3(auth) {
|
|
15047
15129
|
return auth?.role === "admin" ? null : "admin access required";
|
|
15048
15130
|
}
|
|
@@ -15062,7 +15144,7 @@ function failure(c, err) {
|
|
|
15062
15144
|
return c.json({ error: message }, err instanceof OutputStyleConflictError ? 409 : 500);
|
|
15063
15145
|
}
|
|
15064
15146
|
function createOutputStylesRouter() {
|
|
15065
|
-
const app = new
|
|
15147
|
+
const app = new Hono31();
|
|
15066
15148
|
app.get("/", (c) => {
|
|
15067
15149
|
const auth = c.get("auth");
|
|
15068
15150
|
const denied = requireAdmin3(auth);
|
|
@@ -15154,7 +15236,7 @@ function createOutputStylesRouter() {
|
|
|
15154
15236
|
return app;
|
|
15155
15237
|
}
|
|
15156
15238
|
async function handleOutputStylesRequest(req) {
|
|
15157
|
-
const app = new
|
|
15239
|
+
const app = new Hono31();
|
|
15158
15240
|
app.use("*", async (c, next) => {
|
|
15159
15241
|
c.set("auth", { role: "admin" });
|
|
15160
15242
|
await next();
|
|
@@ -15175,7 +15257,7 @@ import { streamSSE } from "hono/streaming";
|
|
|
15175
15257
|
|
|
15176
15258
|
// ../api/src/dashboard/api.ts
|
|
15177
15259
|
function createGatedRouter(agent, register) {
|
|
15178
|
-
const api = new
|
|
15260
|
+
const api = new Hono32();
|
|
15179
15261
|
api.use("*", async (c, next) => {
|
|
15180
15262
|
const known = await listKnownWorkspaces();
|
|
15181
15263
|
const fromHost = profileFromHost(trustedHost(c), known);
|
|
@@ -15228,7 +15310,7 @@ import sharp7 from "sharp";
|
|
|
15228
15310
|
|
|
15229
15311
|
// src/dashboard/channels-routes.ts
|
|
15230
15312
|
import { existsSync as existsSync22, mkdirSync as mkdirSync10 } from "fs";
|
|
15231
|
-
import { Hono as
|
|
15313
|
+
import { Hono as Hono33 } from "hono";
|
|
15232
15314
|
function coerceAccess(raw) {
|
|
15233
15315
|
if (raw === "open" || raw === "*" || raw === "all") return raw;
|
|
15234
15316
|
if (Array.isArray(raw) && raw.every((v) => typeof v === "string")) return raw;
|
|
@@ -15295,7 +15377,7 @@ function toResponse3(channel) {
|
|
|
15295
15377
|
};
|
|
15296
15378
|
}
|
|
15297
15379
|
function createChannelWriteRouter() {
|
|
15298
|
-
const app = new
|
|
15380
|
+
const app = new Hono33();
|
|
15299
15381
|
app.post("/", async (c) => {
|
|
15300
15382
|
const body = await c.req.json().catch(() => ({}));
|
|
15301
15383
|
const name = typeof body["name"] === "string" ? body["name"].trim() : "";
|
|
@@ -15438,7 +15520,7 @@ import {
|
|
|
15438
15520
|
} from "fs";
|
|
15439
15521
|
import { Readable } from "stream";
|
|
15440
15522
|
import { basename as basename8, dirname as dirname8, extname, join as join23, relative, resolve as resolve5, sep } from "path";
|
|
15441
|
-
import { Hono as
|
|
15523
|
+
import { Hono as Hono34 } from "hono";
|
|
15442
15524
|
import { streamSSE as streamSSE2 } from "hono/streaming";
|
|
15443
15525
|
|
|
15444
15526
|
// src/dashboard/docs-watcher.ts
|
|
@@ -16016,7 +16098,8 @@ var CLAUDE_MODEL = "sonnet";
|
|
|
16016
16098
|
var CODEX_MODEL = "gpt-6-astra";
|
|
16017
16099
|
var CODEX_EFFORT = "low";
|
|
16018
16100
|
var TIMEOUT_MS2 = 15e4;
|
|
16019
|
-
|
|
16101
|
+
var SUGGEST_TOOLS = "Read,Glob,Grep";
|
|
16102
|
+
function buildInvocation(runner, req, dir, auth, baseEnv = process.env, tools = "") {
|
|
16020
16103
|
const env = { ...baseEnv, CLAUDE_CODE_DISABLE_AUTO_MEMORY: "1" };
|
|
16021
16104
|
if (runner === "codex") {
|
|
16022
16105
|
const outputFile = join21(dir, "last-message.txt");
|
|
@@ -16062,7 +16145,7 @@ ${req.user}`,
|
|
|
16062
16145
|
CLAUDE_MODEL,
|
|
16063
16146
|
"--no-session-persistence",
|
|
16064
16147
|
"--tools",
|
|
16065
|
-
|
|
16148
|
+
tools,
|
|
16066
16149
|
"--strict-mcp-config",
|
|
16067
16150
|
"--setting-sources",
|
|
16068
16151
|
"",
|
|
@@ -16111,20 +16194,33 @@ function run3(inv, cwd) {
|
|
|
16111
16194
|
child.stdin.end(inv.stdin);
|
|
16112
16195
|
});
|
|
16113
16196
|
}
|
|
16114
|
-
async function
|
|
16197
|
+
async function complete(req, tools = "", cwd) {
|
|
16115
16198
|
const runner = runnerForModel(loadDashboardSettings().agent);
|
|
16116
16199
|
const config = resolveChannelConfig(req.channelId);
|
|
16117
16200
|
const dir = mkdtempSync2(join21(tmpdir4(), "flyspace-memory-"));
|
|
16118
16201
|
try {
|
|
16119
|
-
const inv = buildInvocation(
|
|
16120
|
-
|
|
16121
|
-
|
|
16122
|
-
|
|
16123
|
-
|
|
16202
|
+
const inv = buildInvocation(
|
|
16203
|
+
runner,
|
|
16204
|
+
req,
|
|
16205
|
+
dir,
|
|
16206
|
+
{
|
|
16207
|
+
...config.claudeConfigDir ? { claudeConfigDir: config.claudeConfigDir } : {},
|
|
16208
|
+
...config.claudeCodeOauthToken ? { claudeCodeOauthToken: config.claudeCodeOauthToken } : {}
|
|
16209
|
+
},
|
|
16210
|
+
process.env,
|
|
16211
|
+
tools
|
|
16212
|
+
);
|
|
16213
|
+
return await run3(inv, cwd ?? dir);
|
|
16124
16214
|
} finally {
|
|
16125
16215
|
rmSync7(dir, { recursive: true, force: true });
|
|
16126
16216
|
}
|
|
16127
16217
|
}
|
|
16218
|
+
function completeMemoryExtraction(req) {
|
|
16219
|
+
return complete(req);
|
|
16220
|
+
}
|
|
16221
|
+
function suggestChannelField(req) {
|
|
16222
|
+
return complete(req, SUGGEST_TOOLS, resolveChannelConfig(req.channelId).cwd);
|
|
16223
|
+
}
|
|
16128
16224
|
|
|
16129
16225
|
// src/dashboard/rollover-summary.ts
|
|
16130
16226
|
import { spawn as spawn5 } from "child_process";
|
|
@@ -18328,7 +18424,7 @@ function deleteDocEntry(root, path) {
|
|
|
18328
18424
|
};
|
|
18329
18425
|
}
|
|
18330
18426
|
function createDocsRouter({ gate = requireDocsAccess } = {}) {
|
|
18331
|
-
const app = new
|
|
18427
|
+
const app = new Hono34();
|
|
18332
18428
|
app.use("/:id/docs", gate);
|
|
18333
18429
|
app.use("/:id/docs/*", gate);
|
|
18334
18430
|
app.get("/:id/docs", (c) => {
|
|
@@ -18666,7 +18762,7 @@ function withDocLinkBridge(html) {
|
|
|
18666
18762
|
// src/dashboard/skills-routes-host.ts
|
|
18667
18763
|
import { existsSync as existsSync27, statSync as statSync7 } from "fs";
|
|
18668
18764
|
import { dirname as dirname9 } from "path";
|
|
18669
|
-
import { Hono as
|
|
18765
|
+
import { Hono as Hono35 } from "hono";
|
|
18670
18766
|
function workspaceScope() {
|
|
18671
18767
|
const claudeConfigDir = profileClaudeConfigDir();
|
|
18672
18768
|
const cwd = defaultClaudeCwd();
|
|
@@ -18772,12 +18868,12 @@ var diskBackend = {
|
|
|
18772
18868
|
write: writeSkillAndSync
|
|
18773
18869
|
};
|
|
18774
18870
|
function createWorkspaceSkillsRouter() {
|
|
18775
|
-
const app = new
|
|
18871
|
+
const app = new Hono35();
|
|
18776
18872
|
mountSkillRoutes(app, "/skills", workspaceRef, diskBackend);
|
|
18777
18873
|
return app;
|
|
18778
18874
|
}
|
|
18779
18875
|
function createChannelSkillsRouter() {
|
|
18780
|
-
const app = new
|
|
18876
|
+
const app = new Hono35();
|
|
18781
18877
|
mountSkillRoutes(app, "/:id/skill-files", channelRef, diskBackend);
|
|
18782
18878
|
return app;
|
|
18783
18879
|
}
|
|
@@ -18912,7 +19008,7 @@ import { randomUUID as randomUUID5 } from "crypto";
|
|
|
18912
19008
|
import { chmodSync, existsSync as existsSync29, mkdirSync as mkdirSync12, readFileSync as readFileSync23, writeFileSync as writeFileSync12 } from "fs";
|
|
18913
19009
|
import { createRequire } from "module";
|
|
18914
19010
|
import { dirname as dirname10, join as join25 } from "path";
|
|
18915
|
-
import { Hono as
|
|
19011
|
+
import { Hono as Hono36 } from "hono";
|
|
18916
19012
|
var SESSION_TTL_MS = 10 * 6e4;
|
|
18917
19013
|
var URL_WAIT_MS = 3e4;
|
|
18918
19014
|
var TOKEN_WAIT_MS = 6e4;
|
|
@@ -19069,7 +19165,7 @@ function failure2(c, err) {
|
|
|
19069
19165
|
return c.json({ error: err.message }, 500);
|
|
19070
19166
|
}
|
|
19071
19167
|
function createProviderLoginRouter() {
|
|
19072
|
-
const app = new
|
|
19168
|
+
const app = new Hono36();
|
|
19073
19169
|
app.use("*", async (c, next) => {
|
|
19074
19170
|
const denied = requireAdmin4(c.get("auth"));
|
|
19075
19171
|
if (denied) return c.json({ error: denied }, 403);
|
|
@@ -19113,7 +19209,7 @@ function createProviderLoginRouter() {
|
|
|
19113
19209
|
return app;
|
|
19114
19210
|
}
|
|
19115
19211
|
async function handleProviderLoginRequest(req) {
|
|
19116
|
-
const app = new
|
|
19212
|
+
const app = new Hono36();
|
|
19117
19213
|
app.use("*", async (c, next) => {
|
|
19118
19214
|
c.set("auth", { role: "admin" });
|
|
19119
19215
|
await next();
|
|
@@ -19505,13 +19601,13 @@ function handleSessionImportRequest(req) {
|
|
|
19505
19601
|
}
|
|
19506
19602
|
|
|
19507
19603
|
// src/dashboard/docs-relay-host.ts
|
|
19508
|
-
import { Hono as
|
|
19604
|
+
import { Hono as Hono37 } from "hono";
|
|
19509
19605
|
var RETURNED_HEADERS = ["content-type", "content-disposition", "content-security-policy", "cache-control"];
|
|
19510
19606
|
async function handleDocsRequest(req) {
|
|
19511
19607
|
return runRelayed(req, (app) => app.route("/channels", createDocsRouter({ gate: async (_c, next) => next() })));
|
|
19512
19608
|
}
|
|
19513
19609
|
async function runRelayed(req, register) {
|
|
19514
|
-
const app = new
|
|
19610
|
+
const app = new Hono37();
|
|
19515
19611
|
app.use("*", async (c, next) => {
|
|
19516
19612
|
c.set("auth", req.auth);
|
|
19517
19613
|
await next();
|
|
@@ -19809,6 +19905,7 @@ function localAgentCallbacks(chatAgent) {
|
|
|
19809
19905
|
regenerateAgentRun: (threadId, stoppedReplyId) => chatAgent.regenerate(threadId, stoppedReplyId),
|
|
19810
19906
|
listAgentRuns: () => chatAgent.runningThreadIds(),
|
|
19811
19907
|
completeMemoryExtraction: (req) => chatAgent.completeMemoryExtraction(req),
|
|
19908
|
+
suggestChannelField: (req) => suggestChannelField(req),
|
|
19812
19909
|
listMissingCwds: () => auditChannelCwds().map((ch) => ch.id),
|
|
19813
19910
|
listRunningProfiles: () => listProfiles().filter(isServiceRunning2),
|
|
19814
19911
|
getAgentIdentities: () => resolveAgentIdentities(),
|
|
@@ -20095,7 +20192,7 @@ import { join as join28 } from "path";
|
|
|
20095
20192
|
import { serveStatic } from "@hono/node-server/serve-static";
|
|
20096
20193
|
|
|
20097
20194
|
// src/dashboard/app-icon-routes.ts
|
|
20098
|
-
import { Hono as
|
|
20195
|
+
import { Hono as Hono38 } from "hono";
|
|
20099
20196
|
var NEUTRAL_MANIFEST = {
|
|
20100
20197
|
id: "/",
|
|
20101
20198
|
name: "Flyspace",
|
|
@@ -20133,7 +20230,7 @@ async function withResolvedProfile2(c, next) {
|
|
|
20133
20230
|
return profile ? runWithProfile(profile, () => next()) : next();
|
|
20134
20231
|
}
|
|
20135
20232
|
function createAppIconRouter() {
|
|
20136
|
-
const app = new
|
|
20233
|
+
const app = new Hono38();
|
|
20137
20234
|
app.get("/manifest.json", withResolvedProfile2, async (c) => {
|
|
20138
20235
|
if (!await resolvedProfileHost(c)) return c.json(NEUTRAL_MANIFEST);
|
|
20139
20236
|
const profile = getProfile();
|
|
@@ -20707,7 +20804,7 @@ async function main() {
|
|
|
20707
20804
|
break;
|
|
20708
20805
|
case "-v":
|
|
20709
20806
|
case "--version":
|
|
20710
|
-
printRaw("0.1.
|
|
20807
|
+
printRaw("0.1.37");
|
|
20711
20808
|
break;
|
|
20712
20809
|
case "-h":
|
|
20713
20810
|
case "--help":
|
package/dist/index.js
CHANGED