skykoi 2026.3.319 → 2026.3.321
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/{admin-unlock-GB1CQc19.js → admin-unlock-DfFhvRis.js} +1 -1
- package/dist/{archive-Bs-21LV3.js → archive-BrDQDedR.js} +1 -1
- package/dist/{audit-BvUrQ3Cp.js → audit-D_KuVAWW.js} +3 -3
- package/dist/{bonjour-discovery-CDm_rOJY.js → bonjour-discovery-D3DvZVgk.js} +1 -1
- package/dist/build-info.json +3 -3
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{channel-options-C5Kr-13Y.js → channel-options-DBAp2tQo.js} +1 -1
- package/dist/{channel-summary-6BHUaO6e.js → channel-summary-DZinsO88.js} +2 -2
- package/dist/{channels-cli-DVlJniHJ.js → channels-cli-CVWoM0lN.js} +18 -18
- package/dist/cli/daemon-cli.js +1 -1
- package/dist/{cli-BAxOGSI_.js → cli-CLRALtXM.js} +12 -12
- package/dist/{completion-cli-BInkP0uq.js → completion-cli-B06sgaew.js} +1 -1
- package/dist/{config-guard-CylpNtVO.js → config-guard-GucPWd71.js} +20 -300
- package/dist/{configure-BEBbY5Ka.js → configure-BGddNvFM.js} +4 -4
- package/dist/{cron-cli-DTv9hgBs.js → cron-cli-B4jsE0t8.js} +1 -1
- package/dist/{daemon-cli-BTxnCkrl.js → daemon-cli-Nog8RDGE.js} +1 -1
- package/dist/{deliver-BIkfwDKa.js → deliver-BU-ss2iZ.js} +2 -2
- package/dist/{deps-B5sQqkkU.js → deps-BkqEahC_.js} +2 -2
- package/dist/{dist-BkAagrCw.js → dist-iFsGHQA2.js} +2 -2
- package/dist/{dns-cli-sT3-o-6-.js → dns-cli-rVLQNNbi.js} +1 -1
- package/dist/{docs-cli-CsfJ5WGx.js → docs-cli-Bx_epYB_.js} +2 -2
- package/dist/{doctor-DXwy-g7X.js → doctor-gZ7cszFo.js} +7 -7
- package/dist/entry.js +1 -1
- package/dist/extension-api.js +12 -12
- package/dist/{gateway-cli-Cu2BKpdL.js → gateway-cli-CArFuisz.js} +35 -35
- package/dist/{github-copilot-auth-DpSsslSG.js → github-copilot-auth-BDRjMk4p.js} +1 -1
- package/dist/{gmail-setup-utils-twOioqAE.js → gmail-setup-utils-C1un4e8h.js} +1 -1
- package/dist/{health-format-icfnzIim.js → health-format-CW12kvrh.js} +3 -3
- package/dist/{hooks-cli-N-Ahuxjs.js → hooks-cli-dxr-rrJk.js} +15 -15
- package/dist/{hooks-status-_AUcVHYD.js → hooks-status-CV-O6Xro.js} +1 -1
- package/dist/{image-CqXszfhc.js → image-CUVl1Hhm.js} +2 -2
- package/dist/index.js +40 -40
- package/dist/{installs-DXuSR0Lh.js → installs-D-K256Jd.js} +1 -1
- package/dist/{koi-A5Bh5_Pd.js → koi-B9sw4JKe.js} +6 -6
- package/dist/{login-B5m1ylCf.js → login-A_sTANpw.js} +4 -3
- package/dist/{login-qr-Ce1JaJyP.js → login-qr-BDJgj3j2.js} +3 -3
- package/dist/{models-cli-cetUhGPM.js → models-cli-DAuwTHVI.js} +13 -13
- package/dist/{onboard-channels-C2wN_1gP.js → onboard-channels-BqKUp6cL.js} +2 -2
- package/dist/{onboard-skills-X6cb-Cv7.js → onboard-skills-YZFGxDZB.js} +8 -8
- package/dist/{onboarding-CDmoLuxy.js → onboarding-HT8NN42O.js} +13 -13
- package/dist/{pi-embedded-helpers-D7O9V1nM.js → pi-embedded-helpers-Df7l-4vq.js} +1 -1
- package/dist/{pi-model-discovery-Pi0QODWE.js → pi-model-discovery-E8vIYAbb.js} +1 -1
- package/dist/{pi-tools.policy-lG_VLe1a.js → pi-tools.policy-CA2hGIde.js} +1 -1
- package/dist/{plugin-registry-DKPdd-kj.js → plugin-registry-BQc-z1Y2.js} +1 -1
- package/dist/plugin-sdk/index.js +5 -5
- package/dist/plugin-sdk/koi/tools/browser-tool.schema.d.ts +1 -1
- package/dist/plugin-sdk/pairing/pairing-messages.d.ts +10 -1
- package/dist/plugin-sdk/{pi-model-discovery-szlzYGsC.js → pi-model-discovery-CBWcyyqn.js} +3 -3
- package/dist/plugin-sdk/web/inbound/access-control.d.ts +3 -0
- package/dist/{plugins-cli-DzqbJJjS.js → plugins-cli-5AW6PyYC.js} +16 -16
- package/dist/{program-CgdG_vop.js → program-B9hoSXbr.js} +6 -6
- package/dist/{register.subclis-B2XzXn8k.js → register.subclis-DU1_EbNo.js} +19 -19
- package/dist/{reply-DxGIEwyW.js → reply-CZUaueaY.js} +56 -76
- package/dist/{run-main-CimZPTTm.js → run-main-D4irbtkS.js} +44 -44
- package/dist/{sandbox-BzoIu7x3.js → sandbox-CDOYKOkn.js} +2 -2
- package/dist/{sandbox-cli-BskldQAk.js → sandbox-cli-ByJ2hhJm.js} +4 -4
- package/dist/{security-cli-BW5XJTFQ.js → security-cli-CLAgO06R.js} +6 -6
- package/dist/{server-node-events-R8fJQMYC.js → server-node-events-CzONpK7e.js} +14 -14
- package/dist/{sessions-BmJ6o7Fo.js → sessions-DyqGkYWU.js} +1 -1
- package/dist/{skills-Bfv5jR68.js → skills-DHpPesfZ.js} +1 -1
- package/dist/{skills-cli-CMDC7PXD.js → skills-cli-DL-FIJL2.js} +3 -3
- package/dist/{skills-status-BCDp49SA.js → skills-status-CrL8zDk3.js} +2 -2
- package/dist/{status-Da4Jytsy.js → status-DdawtCgi.js} +1 -1
- package/dist/{tui-DfMm4BHo.js → tui-QrrdMeaH.js} +3 -3
- package/dist/{tui-cli-C_2PwEBj.js → tui-cli-C1YyDE3y.js} +7 -7
- package/dist/{update-mLNkYTUN.js → update-Bz-WhoU_.js} +1 -1
- package/dist/{update-cli-9LWSq9PP.js → update-cli-C-mo4h_Q.js} +24 -24
- package/dist/{update-runner-CzJ8sY70.js → update-runner-D7y7t7Dm.js} +3 -3
- package/dist/{webhooks-cli-HlmM4WRW.js → webhooks-cli-BDrXshEa.js} +3 -3
- package/package.json +1 -1
- /package/dist/{ensure-local-gateway-D8d3GA8E.js → ensure-local-gateway-CwgaMY79.js} +0 -0
- /package/dist/{helpers-BNTDHUZB.js → helpers-D8iloRub.js} +0 -0
- /package/dist/{systemd-linger-8Xh54IOl.js → systemd-linger-DFrKH2dP.js} +0 -0
- /package/dist/{widearea-dns-BbZrO9Lc.js → widearea-dns-nPnswBoX.js} +0 -0
|
@@ -130,7 +130,7 @@ async function adminUnlock(opts = {}) {
|
|
|
130
130
|
error: err?.message ?? "Failed to write config"
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
-
const { ensureLocalGatewayRunning } = await import("./ensure-local-gateway-
|
|
133
|
+
const { ensureLocalGatewayRunning } = await import("./ensure-local-gateway-CwgaMY79.js").then((n) => n.n);
|
|
134
134
|
const gw = await ensureLocalGatewayRunning();
|
|
135
135
|
if (!gw.ok) return {
|
|
136
136
|
ok: false,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as __require, o as __toESM, t as __commonJSMin } from "./chunk-D_gEzPfs.js";
|
|
2
|
-
import { Ft as require_inherits } from "./reply-
|
|
2
|
+
import { Ft as require_inherits } from "./reply-CZUaueaY.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import fs from "node:fs/promises";
|
|
5
5
|
import * as tar from "tar";
|
|
@@ -6,15 +6,15 @@ import { t as formatCliCommand } from "./command-format-DOYW_19_.js";
|
|
|
6
6
|
import { O as INCLUDE_KEY, a as createConfigIO, k as MAX_INCLUDE_DEPTH } from "./config-BOTdzMIB.js";
|
|
7
7
|
import { a as MANIFEST_KEY } from "./manifest-registry-D7MfBQxU.js";
|
|
8
8
|
import { n as listChannelPlugins } from "./plugins-dW6cc0qG.js";
|
|
9
|
-
import { d as resolveSandboxToolPolicyForKoi, l as resolveSandboxConfigForKoi } from "./sandbox-
|
|
9
|
+
import { d as resolveSandboxToolPolicyForKoi, l as resolveSandboxConfigForKoi } from "./sandbox-CDOYKOkn.js";
|
|
10
10
|
import { s as resolveToolProfilePolicy } from "./tool-policy-itfBRjY_.js";
|
|
11
|
-
import { i as loadWorkspaceSkillEntries } from "./skills-
|
|
11
|
+
import { i as loadWorkspaceSkillEntries } from "./skills-DHpPesfZ.js";
|
|
12
12
|
import { i as resolveBrowserConfig, o as resolveProfile } from "./server-context-Cs8Yx5qf.js";
|
|
13
13
|
import { h as GATEWAY_CLIENT_NAMES, m as GATEWAY_CLIENT_MODES } from "./message-channel-B-LM-U45.js";
|
|
14
14
|
import { n as GatewayClient } from "./client-CnWPlz1L.js";
|
|
15
15
|
import { t as buildGatewayConnectionDetails } from "./call-By5olg7I.js";
|
|
16
16
|
import { i as readChannelAllowFromStore } from "./pairing-store-DnxZNJ-U.js";
|
|
17
|
-
import { c as resolveNativeSkillsEnabled, n as isToolAllowedByPolicies, s as resolveNativeCommandsEnabled } from "./pi-tools.policy-
|
|
17
|
+
import { c as resolveNativeSkillsEnabled, n as isToolAllowedByPolicies, s as resolveNativeCommandsEnabled } from "./pi-tools.policy-CA2hGIde.js";
|
|
18
18
|
import { t as resolveChannelDefaultAccountId } from "./helpers-BS0OoBpd.js";
|
|
19
19
|
import { t as scanDirectoryWithSummary } from "./skill-scanner-BSxHCT2R.js";
|
|
20
20
|
import { i as resolveGatewayAuth } from "./auth-tu2F7_70.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as __exportAll } from "./chunk-D_gEzPfs.js";
|
|
2
2
|
import { t as runCommandWithTimeout } from "./exec-BBWSxSu-.js";
|
|
3
|
-
import { n as resolveWideAreaDiscoveryDomain } from "./widearea-dns-
|
|
3
|
+
import { n as resolveWideAreaDiscoveryDomain } from "./widearea-dns-nPnswBoX.js";
|
|
4
4
|
|
|
5
5
|
//#region src/infra/bonjour-discovery.ts
|
|
6
6
|
var bonjour_discovery_exports = /* @__PURE__ */ __exportAll({ discoverGatewayBeacons: () => discoverGatewayBeacons });
|
package/dist/build-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
3ce5acb8cfe1877733c1af3019e63e07099903ccab01097153a1f788a4170fab
|
|
@@ -2,7 +2,7 @@ import { O as CHAT_CHANNEL_ORDER } from "./subsystem-hATE68va.js";
|
|
|
2
2
|
import { t as isTruthyEnvValue } from "./env-ChCKTuXK.js";
|
|
3
3
|
import { n as listChannelPlugins } from "./plugins-dW6cc0qG.js";
|
|
4
4
|
import { i as listChannelPluginCatalogEntries } from "./plugin-auto-enable-BIRsItbt.js";
|
|
5
|
-
import { t as ensurePluginRegistryLoaded } from "./plugin-registry-
|
|
5
|
+
import { t as ensurePluginRegistryLoaded } from "./plugin-registry-BQc-z1Y2.js";
|
|
6
6
|
|
|
7
7
|
//#region src/cli/channel-options.ts
|
|
8
8
|
function dedupe(values) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { L as listThinkingLevels, m as formatRawAssistantErrorForUi } from "./pi-embedded-helpers-
|
|
1
|
+
import { L as listThinkingLevels, m as formatRawAssistantErrorForUi } from "./pi-embedded-helpers-Df7l-4vq.js";
|
|
2
2
|
import { L as getActivePluginRegistry } from "./subsystem-hATE68va.js";
|
|
3
3
|
import { r as theme } from "./theme-C5EwWDWE.js";
|
|
4
4
|
import { t as DEFAULT_ACCOUNT_ID } from "./session-key-B2OXLVi_.js";
|
|
5
5
|
import { Ct as DEFAULT_PROVIDER, St as DEFAULT_MODEL, d as resolveConfiguredModelRef } from "./model-selection-DvQd6xjM.js";
|
|
6
6
|
import { o as loadConfig } from "./config-BOTdzMIB.js";
|
|
7
7
|
import { n as listChannelPlugins } from "./plugins-dW6cc0qG.js";
|
|
8
|
-
import { I as listChannelDocks } from "./sessions-
|
|
8
|
+
import { I as listChannelDocks } from "./sessions-DyqGkYWU.js";
|
|
9
9
|
import { n as formatTokenCount } from "./usage-format-Ct9Z1hWu.js";
|
|
10
10
|
import { createRequire } from "node:module";
|
|
11
11
|
import fs from "node:fs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./pi-embedded-helpers-
|
|
2
|
-
import { $ as writeNylasGrant, At as loadProviderUsageSummary, En as createSlackWebClient, J as nylasLinked, K as DEFAULT_NYLAS_API_URI, L as sendMessage, Q as sendMessage$1, X as readNylasGrant, Z as resolveNylasConfig, fn as parseDiscordTarget, jt as formatUsageReportLines, pn as fetchChannelPermissionsDiscord, q as nylasConfigured } from "./reply-
|
|
1
|
+
import "./pi-embedded-helpers-Df7l-4vq.js";
|
|
2
|
+
import { $ as writeNylasGrant, At as loadProviderUsageSummary, En as createSlackWebClient, J as nylasLinked, K as DEFAULT_NYLAS_API_URI, L as sendMessage, Q as sendMessage$1, X as readNylasGrant, Z as resolveNylasConfig, fn as parseDiscordTarget, jt as formatUsageReportLines, pn as fetchChannelPermissionsDiscord, q as nylasConfigured } from "./reply-CZUaueaY.js";
|
|
3
3
|
import { b as success, f as danger, k as DEFAULT_CHAT_CHANNEL, p as info, s as defaultRuntime, v as setVerbose, w as getResolvedLoggerSettings } from "./subsystem-hATE68va.js";
|
|
4
4
|
import "./paths-VdmjGGyc.js";
|
|
5
5
|
import { r as theme } from "./theme-C5EwWDWE.js";
|
|
@@ -19,16 +19,16 @@ import "./github-copilot-token-BqhLBQWA.js";
|
|
|
19
19
|
import { c as readConfigFileSnapshot, o as loadConfig, u as writeConfigFile } from "./config-BOTdzMIB.js";
|
|
20
20
|
import "./manifest-registry-D7MfBQxU.js";
|
|
21
21
|
import { n as listChannelPlugins, r as normalizeChannelId, t as getChannelPlugin } from "./plugins-dW6cc0qG.js";
|
|
22
|
-
import "./sessions-
|
|
23
|
-
import "./image-
|
|
24
|
-
import "./dist-
|
|
22
|
+
import "./sessions-DyqGkYWU.js";
|
|
23
|
+
import "./image-CUVl1Hhm.js";
|
|
24
|
+
import "./dist-iFsGHQA2.js";
|
|
25
25
|
import "./lib-C-WEldjv.js";
|
|
26
26
|
import "./src-CiVOi-Ma.js";
|
|
27
27
|
import "./core-DrwlWTgS.js";
|
|
28
|
-
import "./pi-model-discovery-
|
|
29
|
-
import "./sandbox-
|
|
28
|
+
import "./pi-model-discovery-E8vIYAbb.js";
|
|
29
|
+
import "./sandbox-CDOYKOkn.js";
|
|
30
30
|
import "./chrome-CTicuLaA.js";
|
|
31
|
-
import "./skills-
|
|
31
|
+
import "./skills-DHpPesfZ.js";
|
|
32
32
|
import "./routes-C952rvWJ.js";
|
|
33
33
|
import "./server-context-Cs8Yx5qf.js";
|
|
34
34
|
import "./image-ops-B6MN1Uli.js";
|
|
@@ -39,7 +39,7 @@ import "./paths-DSzdyYR5.js";
|
|
|
39
39
|
import "./tool-images-DOYdkgEG.js";
|
|
40
40
|
import "./redact-Db6nXe_o.js";
|
|
41
41
|
import "./tool-display-CGLMse-l.js";
|
|
42
|
-
import "./deliver-
|
|
42
|
+
import "./deliver-BU-ss2iZ.js";
|
|
43
43
|
import "./dispatcher-Da_eDTB8.js";
|
|
44
44
|
import "./dist-JRNJAZWM.js";
|
|
45
45
|
import "./pi-tool-definition-adapter-DZBstpDD.js";
|
|
@@ -47,8 +47,8 @@ import "./manager-CvGvPIqL.js";
|
|
|
47
47
|
import "./sqlite-CbC9FUO2.js";
|
|
48
48
|
import "./warnings-D1qUihoO.js";
|
|
49
49
|
import "./proxy-from-env-BBdtl5-Y.js";
|
|
50
|
-
import "./login-qr-
|
|
51
|
-
import { n as formatAge } from "./channel-summary-
|
|
50
|
+
import "./login-qr-BDJgj3j2.js";
|
|
51
|
+
import { n as formatAge } from "./channel-summary-DZinsO88.js";
|
|
52
52
|
import "./device-identity-CBC9Fa-4.js";
|
|
53
53
|
import "./client-CnWPlz1L.js";
|
|
54
54
|
import { n as callGateway } from "./call-By5olg7I.js";
|
|
@@ -58,7 +58,7 @@ import { t as formatDocsLink } from "./links-DlFnXfJ_.js";
|
|
|
58
58
|
import { n as runCommandWithRuntime } from "./cli-utils-Cx9puqXU.js";
|
|
59
59
|
import { n as withProgress } from "./progress-X-YSIEVf.js";
|
|
60
60
|
import "./node-pairing-ClP_ps1x.js";
|
|
61
|
-
import "./pi-tools.policy-
|
|
61
|
+
import "./pi-tools.policy-CA2hGIde.js";
|
|
62
62
|
import "./onboard-helpers-DXmuVr9a.js";
|
|
63
63
|
import "./prompt-style-ko1k1LE0.js";
|
|
64
64
|
import "./pairing-labels-CNooTiAc.js";
|
|
@@ -71,18 +71,18 @@ import "./daemon-runtime-EHtDn8NC.js";
|
|
|
71
71
|
import { t as resolveChannelDefaultAccountId } from "./helpers-BS0OoBpd.js";
|
|
72
72
|
import "./note-D68Wd3Zr.js";
|
|
73
73
|
import { t as createClackPrompter } from "./clack-prompter-DF6HE5p6.js";
|
|
74
|
-
import { i as reloadOnboardingPluginRegistry, n as setupChannels, r as ensureOnboardingPluginInstalled } from "./onboard-channels-
|
|
74
|
+
import { i as reloadOnboardingPluginRegistry, n as setupChannels, r as ensureOnboardingPluginInstalled } from "./onboard-channels-BqKUp6cL.js";
|
|
75
75
|
import { i as listChannelPluginCatalogEntries } from "./plugin-auto-enable-BIRsItbt.js";
|
|
76
|
-
import "./archive-
|
|
76
|
+
import "./archive-BrDQDedR.js";
|
|
77
77
|
import "./skill-scanner-BSxHCT2R.js";
|
|
78
|
-
import "./installs-
|
|
78
|
+
import "./installs-D-K256Jd.js";
|
|
79
79
|
import "./service-C6lyBW0F.js";
|
|
80
80
|
import "./systemd-C7TaOB0r.js";
|
|
81
81
|
import "./diagnostics-B6_fjn4Z.js";
|
|
82
82
|
import { t as collectChannelStatusIssues } from "./channels-status-issues-CNNkv5DB.js";
|
|
83
|
-
import {
|
|
84
|
-
import {
|
|
85
|
-
import { t as formatCliChannelOptions } from "./channel-options-
|
|
83
|
+
import { n as hasExplicitOptions } from "./plugin-registry-BQc-z1Y2.js";
|
|
84
|
+
import { t as ensureLocalGatewayRunning } from "./ensure-local-gateway-CwgaMY79.js";
|
|
85
|
+
import { t as formatCliChannelOptions } from "./channel-options-DBAp2tQo.js";
|
|
86
86
|
import { t as buildChannelAccountSnapshot } from "./status-DDy8N8Gk.js";
|
|
87
87
|
import { t as parseLogLine } from "./parse-log-line-BjTuAFt0.js";
|
|
88
88
|
import process$1 from "node:process";
|
package/dist/cli/daemon-cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Legacy shim for pre-tsdown update-cli imports.
|
|
2
|
-
export { registerDaemonCli, runDaemonInstall, runDaemonRestart, runDaemonStart, runDaemonStatus, runDaemonStop, runDaemonUninstall } from "../daemon-cli-
|
|
2
|
+
export { registerDaemonCli, runDaemonInstall, runDaemonRestart, runDaemonStart, runDaemonStatus, runDaemonStop, runDaemonUninstall } from "../daemon-cli-Nog8RDGE.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./pi-embedded-helpers-
|
|
2
|
-
import { kt as loadSKYKOIPlugins } from "./reply-
|
|
1
|
+
import "./pi-embedded-helpers-Df7l-4vq.js";
|
|
2
|
+
import { kt as loadSKYKOIPlugins } from "./reply-CZUaueaY.js";
|
|
3
3
|
import { t as createSubsystemLogger } from "./subsystem-hATE68va.js";
|
|
4
4
|
import "./paths-VdmjGGyc.js";
|
|
5
5
|
import "./theme-C5EwWDWE.js";
|
|
@@ -17,16 +17,16 @@ import "./github-copilot-token-BqhLBQWA.js";
|
|
|
17
17
|
import { o as loadConfig } from "./config-BOTdzMIB.js";
|
|
18
18
|
import "./manifest-registry-D7MfBQxU.js";
|
|
19
19
|
import "./plugins-dW6cc0qG.js";
|
|
20
|
-
import "./sessions-
|
|
21
|
-
import "./image-
|
|
22
|
-
import "./dist-
|
|
20
|
+
import "./sessions-DyqGkYWU.js";
|
|
21
|
+
import "./image-CUVl1Hhm.js";
|
|
22
|
+
import "./dist-iFsGHQA2.js";
|
|
23
23
|
import "./lib-C-WEldjv.js";
|
|
24
24
|
import "./src-CiVOi-Ma.js";
|
|
25
25
|
import "./core-DrwlWTgS.js";
|
|
26
|
-
import "./pi-model-discovery-
|
|
27
|
-
import "./sandbox-
|
|
26
|
+
import "./pi-model-discovery-E8vIYAbb.js";
|
|
27
|
+
import "./sandbox-CDOYKOkn.js";
|
|
28
28
|
import "./chrome-CTicuLaA.js";
|
|
29
|
-
import "./skills-
|
|
29
|
+
import "./skills-DHpPesfZ.js";
|
|
30
30
|
import "./routes-C952rvWJ.js";
|
|
31
31
|
import "./server-context-Cs8Yx5qf.js";
|
|
32
32
|
import "./image-ops-B6MN1Uli.js";
|
|
@@ -37,7 +37,7 @@ import "./paths-DSzdyYR5.js";
|
|
|
37
37
|
import "./tool-images-DOYdkgEG.js";
|
|
38
38
|
import "./redact-Db6nXe_o.js";
|
|
39
39
|
import "./tool-display-CGLMse-l.js";
|
|
40
|
-
import "./deliver-
|
|
40
|
+
import "./deliver-BU-ss2iZ.js";
|
|
41
41
|
import "./dispatcher-Da_eDTB8.js";
|
|
42
42
|
import "./dist-JRNJAZWM.js";
|
|
43
43
|
import "./pi-tool-definition-adapter-DZBstpDD.js";
|
|
@@ -45,8 +45,8 @@ import "./manager-CvGvPIqL.js";
|
|
|
45
45
|
import "./sqlite-CbC9FUO2.js";
|
|
46
46
|
import "./warnings-D1qUihoO.js";
|
|
47
47
|
import "./proxy-from-env-BBdtl5-Y.js";
|
|
48
|
-
import "./login-qr-
|
|
49
|
-
import "./channel-summary-
|
|
48
|
+
import "./login-qr-BDJgj3j2.js";
|
|
49
|
+
import "./channel-summary-DZinsO88.js";
|
|
50
50
|
import "./device-identity-CBC9Fa-4.js";
|
|
51
51
|
import "./client-CnWPlz1L.js";
|
|
52
52
|
import "./call-By5olg7I.js";
|
|
@@ -55,7 +55,7 @@ import "./pairing-store-DnxZNJ-U.js";
|
|
|
55
55
|
import "./links-DlFnXfJ_.js";
|
|
56
56
|
import "./progress-X-YSIEVf.js";
|
|
57
57
|
import "./node-pairing-ClP_ps1x.js";
|
|
58
|
-
import "./pi-tools.policy-
|
|
58
|
+
import "./pi-tools.policy-CA2hGIde.js";
|
|
59
59
|
import "./onboard-helpers-DXmuVr9a.js";
|
|
60
60
|
import "./prompt-style-ko1k1LE0.js";
|
|
61
61
|
import "./pairing-labels-CNooTiAc.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as __exportAll } from "./chunk-D_gEzPfs.js";
|
|
2
2
|
import { g as resolveStateDir } from "./paths-VdmjGGyc.js";
|
|
3
|
-
import { n as registerSubCliByName, t as getSubCliEntries } from "./register.subclis-
|
|
3
|
+
import { n as registerSubCliByName, t as getSubCliEntries } from "./register.subclis-DU1_EbNo.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import os from "node:os";
|
|
6
6
|
import fs from "node:fs/promises";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H as formatTargetDisplay, P as runMessageAction, Tt as CHANNEL_TARGET_DESCRIPTION, W as CHANNEL_MESSAGE_ACTION_NAMES, Xt as runMemoryStatus, Yt as registerMemoryCli, cr as lookupContextTokens, wt as CHANNEL_TARGETS_DESCRIPTION } from "./reply-
|
|
1
|
+
import { H as formatTargetDisplay, P as runMessageAction, Tt as CHANNEL_TARGET_DESCRIPTION, W as CHANNEL_MESSAGE_ACTION_NAMES, Xt as runMemoryStatus, Yt as registerMemoryCli, cr as lookupContextTokens, wt as CHANNEL_TARGETS_DESCRIPTION } from "./reply-CZUaueaY.js";
|
|
2
2
|
import { I as normalizeChatChannelId, M as getChatChannelMeta, c as restoreTerminalState, f as danger, k as DEFAULT_CHAT_CHANNEL, p as info, s as defaultRuntime, v as setVerbose } from "./subsystem-hATE68va.js";
|
|
3
3
|
import { g as resolveStateDir, i as isNixMode, m as resolveOAuthDir, o as resolveConfigPath, r as STATE_DIR, t as CONFIG_PATH, u as resolveGatewayPort } from "./paths-VdmjGGyc.js";
|
|
4
4
|
import { n as isRich, r as theme, t as colorize } from "./theme-C5EwWDWE.js";
|
|
@@ -11,7 +11,7 @@ import { t as formatCliCommand } from "./command-format-DOYW_19_.js";
|
|
|
11
11
|
import { t as parseBooleanValue } from "./boolean-D-3joTkO.js";
|
|
12
12
|
import { D as applyLegacyMigrations, _ as parseDurationMs, a as createConfigIO, c as readConfigFileSnapshot, o as loadConfig, u as writeConfigFile } from "./config-BOTdzMIB.js";
|
|
13
13
|
import { n as listChannelPlugins, r as normalizeChannelId, t as getChannelPlugin } from "./plugins-dW6cc0qG.js";
|
|
14
|
-
import { i as loadSessionStore } from "./sessions-
|
|
14
|
+
import { i as loadSessionStore } from "./sessions-DyqGkYWU.js";
|
|
15
15
|
import { n as movePathToTrash } from "./server-context-Cs8Yx5qf.js";
|
|
16
16
|
import { h as GATEWAY_CLIENT_NAMES, l as normalizeMessageChannel, m as GATEWAY_CLIENT_MODES } from "./message-channel-B-LM-U45.js";
|
|
17
17
|
import { a as resolveSessionTranscriptsDirForKoi, i as resolveSessionTranscriptsDir, o as resolveStorePath } from "./paths-DSzdyYR5.js";
|
|
@@ -21,37 +21,36 @@ import { n as runCommandWithRuntime } from "./cli-utils-Cx9puqXU.js";
|
|
|
21
21
|
import { n as withProgress } from "./progress-X-YSIEVf.js";
|
|
22
22
|
import { a as ensureWorkspaceAndSessions, c as handleReset, d as openUrl, h as resolveControlUiLinks, i as detectBrowserOpenSupport, l as moveToTrash, m as randomToken, n as applyWizardMetadata, o as formatControlUiSshHint, t as DEFAULT_WORKSPACE, v as waitForGatewayReachable } from "./onboard-helpers-DXmuVr9a.js";
|
|
23
23
|
import { n as stylePromptMessage, r as stylePromptTitle, t as stylePromptHint } from "./prompt-style-ko1k1LE0.js";
|
|
24
|
-
import { t as createDefaultDeps } from "./deps-
|
|
24
|
+
import { t as createDefaultDeps } from "./deps-BkqEahC_.js";
|
|
25
25
|
import { a as gatewayInstallErrorHint, g as assertSupportedRuntime, i as buildGatewayInstallPlan, r as isGatewayDaemonRuntime, t as DEFAULT_GATEWAY_DAEMON_RUNTIME } from "./daemon-runtime-EHtDn8NC.js";
|
|
26
26
|
import { t as resolveChannelDefaultAccountId } from "./helpers-BS0OoBpd.js";
|
|
27
27
|
import { n as logConfigUpdated, t as formatConfigPath } from "./logging-D-QZpI1i.js";
|
|
28
28
|
import { t as WizardCancelledError } from "./prompts-CSOhuiqe.js";
|
|
29
29
|
import { t as createClackPrompter } from "./clack-prompter-DF6HE5p6.js";
|
|
30
|
-
import { a as buildKoiSummaries, c as loadKoiIdentity, f as parseIdentityMarkdown, i as applyKoiConfig, l as pruneKoiConfig, n as statusCommand, o as findKoiEntryIndex, s as listKoiEntries, t as runOnboardingWizard, u as identityHasValues } from "./onboarding-
|
|
31
|
-
import { d as applyAuthChoice, f as applyOpenAIConfig, h as promptAuthChoiceGrouped, m as applyGoogleGeminiModelDefault, p as upsertSharedEnvVar, u as warnIfModelConfigLooksOff } from "./onboard-skills-
|
|
32
|
-
import { $ as setOpenrouterApiKey, C as applyMoonshotConfig, D as applyOpenrouterConfig, F as applyVercelAiGatewayConfig, J as setGeminiApiKey, K as setAnthropicApiKey, L as applyXaiConfig, N as applyVeniceConfig, Q as setOpencodeZenApiKey, V as applyZaiConfig, X as setMinimaxApiKey, Y as setKimiCodingApiKey, Z as setMoonshotApiKey, at as setXiaomiApiKey, et as setQianfanApiKey, f as applyOpencodeZenConfig, ft as buildTokenProfileId, g as applyMinimaxConfig, it as setXaiApiKey, j as applySyntheticConfig, k as applyQianfanConfig, m as applyMinimaxApiConfig, nt as setVeniceApiKey, ot as setZaiApiKey, pt as validateAnthropicSetupToken, q as setCloudflareAiGatewayConfig, rt as setVercelAiGatewayApiKey, tt as setSyntheticApiKey, v as applyAuthProfileConfig, w as applyMoonshotConfigCn, x as applyKimiCodeConfig, y as applyCloudflareAiGatewayConfig, z as applyXiaomiConfig } from "./github-copilot-auth-
|
|
33
|
-
import { n as setupChannels } from "./onboard-channels-
|
|
34
|
-
import { l as healthCommand } from "./health-format-
|
|
30
|
+
import { a as buildKoiSummaries, c as loadKoiIdentity, f as parseIdentityMarkdown, i as applyKoiConfig, l as pruneKoiConfig, n as statusCommand, o as findKoiEntryIndex, s as listKoiEntries, t as runOnboardingWizard, u as identityHasValues } from "./onboarding-HT8NN42O.js";
|
|
31
|
+
import { d as applyAuthChoice, f as applyOpenAIConfig, h as promptAuthChoiceGrouped, m as applyGoogleGeminiModelDefault, p as upsertSharedEnvVar, u as warnIfModelConfigLooksOff } from "./onboard-skills-YZFGxDZB.js";
|
|
32
|
+
import { $ as setOpenrouterApiKey, C as applyMoonshotConfig, D as applyOpenrouterConfig, F as applyVercelAiGatewayConfig, J as setGeminiApiKey, K as setAnthropicApiKey, L as applyXaiConfig, N as applyVeniceConfig, Q as setOpencodeZenApiKey, V as applyZaiConfig, X as setMinimaxApiKey, Y as setKimiCodingApiKey, Z as setMoonshotApiKey, at as setXiaomiApiKey, et as setQianfanApiKey, f as applyOpencodeZenConfig, ft as buildTokenProfileId, g as applyMinimaxConfig, it as setXaiApiKey, j as applySyntheticConfig, k as applyQianfanConfig, m as applyMinimaxApiConfig, nt as setVeniceApiKey, ot as setZaiApiKey, pt as validateAnthropicSetupToken, q as setCloudflareAiGatewayConfig, rt as setVercelAiGatewayApiKey, tt as setSyntheticApiKey, v as applyAuthProfileConfig, w as applyMoonshotConfigCn, x as applyKimiCodeConfig, y as applyCloudflareAiGatewayConfig, z as applyXiaomiConfig } from "./github-copilot-auth-BDRjMk4p.js";
|
|
33
|
+
import { n as setupChannels } from "./onboard-channels-BqKUp6cL.js";
|
|
34
|
+
import { l as healthCommand } from "./health-format-CW12kvrh.js";
|
|
35
35
|
import { t as renderTable } from "./table-Bu1gPkD7.js";
|
|
36
36
|
import { t as resolveGatewayService } from "./service-C6lyBW0F.js";
|
|
37
37
|
import { r as isSystemdUserServiceAvailable } from "./systemd-C7TaOB0r.js";
|
|
38
|
-
import { l as getVerboseFlag, o as getFlagValue, r as registerSubCliCommands, s as getPositiveIntFlagValue, u as hasFlag } from "./register.subclis-
|
|
38
|
+
import { l as getVerboseFlag, o as getFlagValue, r as registerSubCliCommands, s as getPositiveIntFlagValue, u as hasFlag } from "./register.subclis-DU1_EbNo.js";
|
|
39
39
|
import { n as callGatewayFromCli, t as addGatewayClientOptions } from "./gateway-rpc-FMQ_vIWH.js";
|
|
40
40
|
import { t as formatHelpExamples } from "./help-format-CN9mmVLD.js";
|
|
41
|
-
import { t as adminUnlockCommand } from "./admin-unlock-
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import { n as
|
|
45
|
-
import { n as
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import { n as loadAndMaybeMigrateDoctorConfig, t as doctorCommand } from "./doctor-
|
|
41
|
+
import { t as adminUnlockCommand } from "./admin-unlock-DfFhvRis.js";
|
|
42
|
+
import { a as createOutboundSendDeps, n as resolveSessionKeyForRequest, t as koiCommand } from "./koi-B9sw4JKe.js";
|
|
43
|
+
import { n as hasExplicitOptions, t as ensurePluginRegistryLoaded } from "./plugin-registry-BQc-z1Y2.js";
|
|
44
|
+
import { n as parsePositiveIntOrUndefined, t as collectOption } from "./helpers-D8iloRub.js";
|
|
45
|
+
import { i as CONFIGURE_WIZARD_SECTIONS, n as configureCommand, r as configureCommandWithSections } from "./configure-BGddNvFM.js";
|
|
46
|
+
import { n as ensureSystemdUserLingerNonInteractive } from "./systemd-linger-DFrKH2dP.js";
|
|
47
|
+
import { t as loginCommand } from "./login-A_sTANpw.js";
|
|
48
|
+
import { n as loadAndMaybeMigrateDoctorConfig, t as doctorCommand } from "./doctor-gZ7cszFo.js";
|
|
49
49
|
import { fileURLToPath } from "node:url";
|
|
50
50
|
import fs from "node:fs";
|
|
51
51
|
import path from "node:path";
|
|
52
52
|
import JSON5 from "json5";
|
|
53
53
|
import fs$1 from "node:fs/promises";
|
|
54
|
-
import { createInterface } from "node:readline";
|
|
55
54
|
import { cancel, confirm, isCancel, multiselect, select } from "@clack/prompts";
|
|
56
55
|
|
|
57
56
|
//#region src/commands/kois.bindings.ts
|
|
@@ -2797,7 +2796,7 @@ async function loadValidConfig() {
|
|
|
2797
2796
|
}
|
|
2798
2797
|
function registerConfigCli(program) {
|
|
2799
2798
|
const cmd = program.command("config").description("Config helpers (get/set/unset). Run without subcommand for the wizard.").addHelpText("after", () => `\n${theme.muted("Docs:")} ${formatDocsLink("/cli/config", "docs.skykoi.com/cli/config")}\n`).option("--section <section>", "Configure wizard sections (repeatable). Use with no subcommand.", (value, previous) => [...previous, value], []).action(async (opts) => {
|
|
2800
|
-
const { CONFIGURE_WIZARD_SECTIONS, configureCommand, configureCommandWithSections } = await import("./configure-
|
|
2799
|
+
const { CONFIGURE_WIZARD_SECTIONS, configureCommand, configureCommandWithSections } = await import("./configure-BGddNvFM.js").then((n) => n.t);
|
|
2801
2800
|
const sections = Array.isArray(opts.section) ? opts.section.map((value) => typeof value === "string" ? value.trim() : "").filter(Boolean) : [];
|
|
2802
2801
|
if (sections.length === 0) {
|
|
2803
2802
|
await configureCommand(defaultRuntime);
|
|
@@ -2878,281 +2877,6 @@ function registerAdminCommand(program) {
|
|
|
2878
2877
|
});
|
|
2879
2878
|
}
|
|
2880
2879
|
|
|
2881
|
-
//#endregion
|
|
2882
|
-
//#region src/commands/platform-chat.ts
|
|
2883
|
-
/**
|
|
2884
|
-
* `skykoi chat` — message a PLATFORM koi from the terminal.
|
|
2885
|
-
*
|
|
2886
|
-
* Differs from `skykoi koi -m` (which talks to the local gateway):
|
|
2887
|
-
* this command uses the saved CLI token in ~/.skykoi/auth.json to
|
|
2888
|
-
* hit the platform's HTTP API directly. No local gateway needed.
|
|
2889
|
-
* The user logs in once with `skykoi login`, then `skykoi chat` Just
|
|
2890
|
-
* Works.
|
|
2891
|
-
*
|
|
2892
|
-
* Modes:
|
|
2893
|
-
*
|
|
2894
|
-
* skykoi chat # interactive REPL (default)
|
|
2895
|
-
* skykoi chat -m "hello" # one-shot, prints reply
|
|
2896
|
-
* skykoi chat --koi <id> -m "..." # target a specific koi
|
|
2897
|
-
* skykoi chat --list # just list kois and exit
|
|
2898
|
-
*
|
|
2899
|
-
* Koi selection precedence:
|
|
2900
|
-
* 1. --koi <id> flag
|
|
2901
|
-
* 2. SKYKOI_KOI_ID env var
|
|
2902
|
-
* 3. saved 'lastKoiId' in auth.json (set on first successful chat)
|
|
2903
|
-
* 4. interactive picker if stdin is a TTY
|
|
2904
|
-
* 5. error otherwise
|
|
2905
|
-
*/
|
|
2906
|
-
async function fetchJson(url, init) {
|
|
2907
|
-
let res;
|
|
2908
|
-
try {
|
|
2909
|
-
res = await fetch(url, init);
|
|
2910
|
-
} catch (err) {
|
|
2911
|
-
return {
|
|
2912
|
-
ok: false,
|
|
2913
|
-
error: err?.message ?? "network error",
|
|
2914
|
-
status: 0
|
|
2915
|
-
};
|
|
2916
|
-
}
|
|
2917
|
-
if (!res.ok) return {
|
|
2918
|
-
ok: false,
|
|
2919
|
-
error: (await res.text().catch(() => "")).slice(0, 300) || res.statusText,
|
|
2920
|
-
status: res.status
|
|
2921
|
-
};
|
|
2922
|
-
const data = await res.json().catch(() => null);
|
|
2923
|
-
if (data === null) return {
|
|
2924
|
-
ok: false,
|
|
2925
|
-
error: "non-JSON response",
|
|
2926
|
-
status: res.status
|
|
2927
|
-
};
|
|
2928
|
-
return {
|
|
2929
|
-
ok: true,
|
|
2930
|
-
data
|
|
2931
|
-
};
|
|
2932
|
-
}
|
|
2933
|
-
async function pickKoiInteractive(kois) {
|
|
2934
|
-
if (kois.length === 0) return null;
|
|
2935
|
-
if (kois.length === 1) return kois[0];
|
|
2936
|
-
if (!process.stdin.isTTY) return kois[0];
|
|
2937
|
-
console.log("\n Available kois:");
|
|
2938
|
-
kois.forEach((k, i) => {
|
|
2939
|
-
const last = k.lastUserActivity ? `, last used ${new Date(k.lastUserActivity).toLocaleString()}` : "";
|
|
2940
|
-
console.log(` ${i + 1}. ${k.name} (${k.id}) — ${k.status}${last}`);
|
|
2941
|
-
});
|
|
2942
|
-
console.log("");
|
|
2943
|
-
const rl = createInterface({
|
|
2944
|
-
input: process.stdin,
|
|
2945
|
-
output: process.stdout
|
|
2946
|
-
});
|
|
2947
|
-
const answer = await new Promise((resolve) => {
|
|
2948
|
-
rl.question(` Pick [1-${kois.length}, default 1]: `, (a) => resolve(a));
|
|
2949
|
-
});
|
|
2950
|
-
rl.close();
|
|
2951
|
-
const trimmed = answer.trim();
|
|
2952
|
-
if (!trimmed) return kois[0];
|
|
2953
|
-
const n = parseInt(trimmed, 10);
|
|
2954
|
-
if (Number.isNaN(n) || n < 1 || n > kois.length) {
|
|
2955
|
-
console.log(" Invalid choice; defaulting to first koi.");
|
|
2956
|
-
return kois[0];
|
|
2957
|
-
}
|
|
2958
|
-
return kois[n - 1];
|
|
2959
|
-
}
|
|
2960
|
-
/**
|
|
2961
|
-
* Stream one chat turn from the platform's SSE endpoint and render
|
|
2962
|
-
* deltas to stdout as they arrive.
|
|
2963
|
-
*/
|
|
2964
|
-
async function streamChatTurn(args) {
|
|
2965
|
-
const res = await fetch(`${args.platformUrl}/api/koi/${args.koiId}/chat`, {
|
|
2966
|
-
method: "POST",
|
|
2967
|
-
headers: {
|
|
2968
|
-
"Content-Type": "application/json",
|
|
2969
|
-
Accept: "text/event-stream",
|
|
2970
|
-
Authorization: `Bearer ${args.token}`
|
|
2971
|
-
},
|
|
2972
|
-
body: JSON.stringify({
|
|
2973
|
-
message: args.message,
|
|
2974
|
-
stream: true
|
|
2975
|
-
})
|
|
2976
|
-
}).catch((err) => ({
|
|
2977
|
-
ok: false,
|
|
2978
|
-
status: 0,
|
|
2979
|
-
body: null,
|
|
2980
|
-
statusText: err?.message ?? "network error"
|
|
2981
|
-
}));
|
|
2982
|
-
if (!("ok" in res) || !res.ok) return {
|
|
2983
|
-
ok: false,
|
|
2984
|
-
error: `chat request failed (${res?.status ?? "?"})`
|
|
2985
|
-
};
|
|
2986
|
-
const body = res.body;
|
|
2987
|
-
if (!body) return {
|
|
2988
|
-
ok: false,
|
|
2989
|
-
error: "no response body"
|
|
2990
|
-
};
|
|
2991
|
-
const reader = body.getReader();
|
|
2992
|
-
const decoder = new TextDecoder();
|
|
2993
|
-
let buffer = "";
|
|
2994
|
-
let currentEvent = null;
|
|
2995
|
-
let printedAny = false;
|
|
2996
|
-
while (true) {
|
|
2997
|
-
const { value, done } = await reader.read();
|
|
2998
|
-
if (done) break;
|
|
2999
|
-
buffer += decoder.decode(value, { stream: true });
|
|
3000
|
-
for (;;) {
|
|
3001
|
-
const lineEnd = buffer.indexOf("\n");
|
|
3002
|
-
if (lineEnd === -1) break;
|
|
3003
|
-
const line = buffer.slice(0, lineEnd).replace(/\r$/, "");
|
|
3004
|
-
buffer = buffer.slice(lineEnd + 1);
|
|
3005
|
-
if (!line) {
|
|
3006
|
-
currentEvent = null;
|
|
3007
|
-
continue;
|
|
3008
|
-
}
|
|
3009
|
-
if (line.startsWith("event:")) {
|
|
3010
|
-
currentEvent = line.slice(6).trim();
|
|
3011
|
-
continue;
|
|
3012
|
-
}
|
|
3013
|
-
if (line.startsWith("data:")) {
|
|
3014
|
-
const rawData = line.slice(5).trim();
|
|
3015
|
-
try {
|
|
3016
|
-
const payload = JSON.parse(rawData);
|
|
3017
|
-
const kind = currentEvent ?? "data";
|
|
3018
|
-
if (kind === "delta") {
|
|
3019
|
-
const text = payload.text ?? "";
|
|
3020
|
-
if (text) {
|
|
3021
|
-
process.stdout.write(text);
|
|
3022
|
-
printedAny = true;
|
|
3023
|
-
}
|
|
3024
|
-
} else if (kind === "tool") {
|
|
3025
|
-
const status = payload.status ?? "";
|
|
3026
|
-
const name = payload.name ?? "";
|
|
3027
|
-
const desc = payload.description ?? "";
|
|
3028
|
-
if (status === "running") {
|
|
3029
|
-
const label = desc || name;
|
|
3030
|
-
if (label) process.stderr.write(`\n · ${label}…\n`);
|
|
3031
|
-
}
|
|
3032
|
-
} else if (kind === "done") {
|
|
3033
|
-
const content = payload.content ?? "";
|
|
3034
|
-
if (!printedAny && content) process.stdout.write(content);
|
|
3035
|
-
process.stdout.write("\n");
|
|
3036
|
-
} else if (kind === "error") {
|
|
3037
|
-
const msg = payload.message ?? "unknown error";
|
|
3038
|
-
process.stderr.write(`\n ! ${msg}\n`);
|
|
3039
|
-
}
|
|
3040
|
-
} catch {}
|
|
3041
|
-
continue;
|
|
3042
|
-
}
|
|
3043
|
-
}
|
|
3044
|
-
}
|
|
3045
|
-
return { ok: true };
|
|
3046
|
-
}
|
|
3047
|
-
async function platformChatCommand(opts) {
|
|
3048
|
-
const auth = await readAuthFile();
|
|
3049
|
-
if (!auth) return {
|
|
3050
|
-
ok: false,
|
|
3051
|
-
error: "Not logged in. Run `skykoi login` first."
|
|
3052
|
-
};
|
|
3053
|
-
const platformUrl = auth.platformUrl.replace(/\/$/, "");
|
|
3054
|
-
const headers = { Authorization: `Bearer ${auth.token}` };
|
|
3055
|
-
const listRes = await fetchJson(`${platformUrl}/api/kois`, { headers });
|
|
3056
|
-
if (!listRes.ok) {
|
|
3057
|
-
if (listRes.status === 401 || listRes.status === 403) return {
|
|
3058
|
-
ok: false,
|
|
3059
|
-
error: "Token rejected. Run `skykoi login` to refresh."
|
|
3060
|
-
};
|
|
3061
|
-
return {
|
|
3062
|
-
ok: false,
|
|
3063
|
-
error: `Failed to list kois: ${listRes.error}`
|
|
3064
|
-
};
|
|
3065
|
-
}
|
|
3066
|
-
const kois = listRes.data.kois;
|
|
3067
|
-
if (opts.list) {
|
|
3068
|
-
if (opts.json) {
|
|
3069
|
-
process.stdout.write(JSON.stringify(kois, null, 2) + "\n");
|
|
3070
|
-
return { ok: true };
|
|
3071
|
-
}
|
|
3072
|
-
if (kois.length === 0) {
|
|
3073
|
-
console.log("(no kois — create one on the dashboard)");
|
|
3074
|
-
return { ok: true };
|
|
3075
|
-
}
|
|
3076
|
-
for (const k of kois) console.log(`${k.id}\t${k.status}\t${k.name}`);
|
|
3077
|
-
return { ok: true };
|
|
3078
|
-
}
|
|
3079
|
-
if (kois.length === 0) return {
|
|
3080
|
-
ok: false,
|
|
3081
|
-
error: "No kois yet. Create one on https://www.skykoi.com first."
|
|
3082
|
-
};
|
|
3083
|
-
let chosen = null;
|
|
3084
|
-
const wantId = opts.koi || process.env.SKYKOI_KOI_ID;
|
|
3085
|
-
if (wantId) {
|
|
3086
|
-
chosen = kois.find((k) => k.id === wantId) ?? null;
|
|
3087
|
-
if (!chosen) return {
|
|
3088
|
-
ok: false,
|
|
3089
|
-
error: `Koi ${wantId} not found in your account. Run \`skykoi chat --list\` to see options.`
|
|
3090
|
-
};
|
|
3091
|
-
} else chosen = await pickKoiInteractive(kois);
|
|
3092
|
-
if (!chosen) return {
|
|
3093
|
-
ok: false,
|
|
3094
|
-
error: "No koi selected."
|
|
3095
|
-
};
|
|
3096
|
-
if (opts.message && opts.message.trim()) {
|
|
3097
|
-
process.stdout.write(`> ${opts.message}\n\n`);
|
|
3098
|
-
const res = await streamChatTurn({
|
|
3099
|
-
platformUrl,
|
|
3100
|
-
token: auth.token,
|
|
3101
|
-
koiId: chosen.id,
|
|
3102
|
-
message: opts.message
|
|
3103
|
-
});
|
|
3104
|
-
return res.ok ? { ok: true } : {
|
|
3105
|
-
ok: false,
|
|
3106
|
-
error: res.error
|
|
3107
|
-
};
|
|
3108
|
-
}
|
|
3109
|
-
if (!process.stdin.isTTY) return {
|
|
3110
|
-
ok: false,
|
|
3111
|
-
error: "No --message provided and stdin isn't a TTY. Run `skykoi chat -m \"...\"` or open in a real terminal."
|
|
3112
|
-
};
|
|
3113
|
-
console.log(`\n Chatting with ${chosen.name} (${chosen.id})`);
|
|
3114
|
-
console.log(" Type your message. Empty line or Ctrl-C to exit.\n");
|
|
3115
|
-
const rl = createInterface({
|
|
3116
|
-
input: process.stdin,
|
|
3117
|
-
output: process.stdout,
|
|
3118
|
-
terminal: true
|
|
3119
|
-
});
|
|
3120
|
-
const ask = () => new Promise((resolve) => {
|
|
3121
|
-
rl.question("> ", (line) => resolve(line));
|
|
3122
|
-
});
|
|
3123
|
-
while (true) {
|
|
3124
|
-
const line = await ask().catch(() => "");
|
|
3125
|
-
if (!line.trim()) break;
|
|
3126
|
-
process.stdout.write("\n");
|
|
3127
|
-
await streamChatTurn({
|
|
3128
|
-
platformUrl,
|
|
3129
|
-
token: auth.token,
|
|
3130
|
-
koiId: chosen.id,
|
|
3131
|
-
message: line
|
|
3132
|
-
});
|
|
3133
|
-
process.stdout.write("\n");
|
|
3134
|
-
}
|
|
3135
|
-
rl.close();
|
|
3136
|
-
return { ok: true };
|
|
3137
|
-
}
|
|
3138
|
-
|
|
3139
|
-
//#endregion
|
|
3140
|
-
//#region src/cli/program/register.chat.ts
|
|
3141
|
-
function registerChatCommand(program) {
|
|
3142
|
-
program.command("chat").description("Message your platform koi from the terminal (uses the saved login token)").addHelpText("after", () => `\n${theme.muted("Docs:")} ${formatDocsLink("/cli/chat", "docs.skykoi.com/cli/chat")}\n`).option("-m, --message <text>", "Send a single message and print the reply (one-shot mode)").option("--koi <id>", "Target a specific koi by id (default: last-used or interactive picker)").option("--list", "Just list your kois and exit").option("--json", "When listing, output JSON").action(async (opts) => {
|
|
3143
|
-
const result = await platformChatCommand({
|
|
3144
|
-
message: opts.message,
|
|
3145
|
-
koi: opts.koi,
|
|
3146
|
-
list: opts.list,
|
|
3147
|
-
json: opts.json
|
|
3148
|
-
});
|
|
3149
|
-
if (!result.ok) {
|
|
3150
|
-
console.error(theme.error(`✗ ${result.error || "chat failed"}`));
|
|
3151
|
-
process.exit(1);
|
|
3152
|
-
}
|
|
3153
|
-
});
|
|
3154
|
-
}
|
|
3155
|
-
|
|
3156
2880
|
//#endregion
|
|
3157
2881
|
//#region src/commands/koi-via-gateway.ts
|
|
3158
2882
|
function parseTimeoutSeconds(opts) {
|
|
@@ -3380,7 +3104,7 @@ function registerLoginCommand(program) {
|
|
|
3380
3104
|
console.log(theme.muted(` user=${result.userId} org=${result.orgId}`));
|
|
3381
3105
|
}
|
|
3382
3106
|
if (opts.chat !== false && result.gatewayUrl && process.stdin.isTTY && process.stdout.isTTY) {
|
|
3383
|
-
const { runTui } = await import("./tui-
|
|
3107
|
+
const { runTui } = await import("./tui-QrrdMeaH.js").then((n) => n.n);
|
|
3384
3108
|
console.log(theme.muted("\n Opening your koi chat…\n"));
|
|
3385
3109
|
await runTui({
|
|
3386
3110
|
url: result.gatewayUrl,
|
|
@@ -3405,7 +3129,7 @@ function registerLoginCommand(program) {
|
|
|
3405
3129
|
}
|
|
3406
3130
|
});
|
|
3407
3131
|
program.command("whoami").description("Show the currently-logged-in SkyKoi account").action(async () => {
|
|
3408
|
-
const { readAuthFile } = await import("./login-
|
|
3132
|
+
const { readAuthFile } = await import("./login-A_sTANpw.js").then((n) => n.n);
|
|
3409
3133
|
const auth = await readAuthFile();
|
|
3410
3134
|
if (!auth) {
|
|
3411
3135
|
console.log(theme.muted("Not logged in. Run `skykoi login`."));
|
|
@@ -5712,10 +5436,6 @@ const commandRegistry = [
|
|
|
5712
5436
|
id: "admin",
|
|
5713
5437
|
register: ({ program }) => registerAdminCommand(program)
|
|
5714
5438
|
},
|
|
5715
|
-
{
|
|
5716
|
-
id: "chat",
|
|
5717
|
-
register: ({ program }) => registerChatCommand(program)
|
|
5718
|
-
},
|
|
5719
5439
|
{
|
|
5720
5440
|
id: "setup",
|
|
5721
5441
|
register: ({ program }) => registerSetupCommand(program)
|