@xopcai/xopc 0.0.53 → 0.0.54
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/extensions/dingtalk/src/plugin.js +1 -1
- package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
- package/dist/extensions/telegram/src/plugin.js +1 -1
- package/dist/extensions/telegram/src/routing-integration.js +2 -2
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/api/api.js +2 -2
- package/dist/extensions/weixin/src/auth/accounts.js +1 -1
- package/dist/extensions/weixin/src/cdn/upload.js +1 -1
- package/dist/extensions/weixin/src/media/data-url.js +1 -1
- package/dist/extensions/weixin/src/messaging/debug-mode.js +1 -1
- package/dist/extensions/weixin/src/messaging/inbound.js +1 -1
- package/dist/extensions/weixin/src/messaging/process-message.js +1 -1
- package/dist/extensions/weixin/src/plugin.js +1 -1
- package/dist/extensions/weixin/src/storage/sync-buf.js +1 -1
- package/dist/gateway/static/root/assets/{agents-Dk8idifM.js → agents-Cccit5xQ.js} +2 -2
- package/dist/gateway/static/root/assets/{agents-Dk8idifM.js.map → agents-Cccit5xQ.js.map} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-C4_ekFnF.js → apps-page-JMpsr3yK.js} +2 -2
- package/dist/gateway/static/root/assets/{apps-page-C4_ekFnF.js.map → apps-page-JMpsr3yK.js.map} +1 -1
- package/dist/gateway/static/root/assets/{channels-settings-BoRUNSby.js → channels-settings-jJX9xOyE.js} +2 -2
- package/dist/gateway/static/root/assets/{channels-settings-BoRUNSby.js.map → channels-settings-jJX9xOyE.js.map} +1 -1
- package/dist/gateway/static/root/assets/{cron-dreaming-jobs-DjK4YEV9.js → cron-dreaming-jobs-DousYqF2.js} +2 -2
- package/dist/gateway/static/root/assets/{cron-dreaming-jobs-DjK4YEV9.js.map → cron-dreaming-jobs-DousYqF2.js.map} +1 -1
- package/dist/gateway/static/root/assets/{cron-page-wQAlt7WL.js → cron-page-CdYb690n.js} +2 -2
- package/dist/gateway/static/root/assets/{cron-page-wQAlt7WL.js.map → cron-page-CdYb690n.js.map} +1 -1
- package/dist/gateway/static/root/assets/{dist-DfWs1l6V.js → dist-D8QibYZR.js} +2 -2
- package/dist/gateway/static/root/assets/{dist-DfWs1l6V.js.map → dist-D8QibYZR.js.map} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-DKpIM74M.js → extension-debug-page-DJ-puhUh.js} +2 -2
- package/dist/gateway/static/root/assets/{extension-debug-page-DKpIM74M.js.map → extension-debug-page-DJ-puhUh.js.map} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DR980mtQ.js → extension-page-DgDGH7uc.js} +2 -2
- package/dist/gateway/static/root/assets/{extension-page-DR980mtQ.js.map → extension-page-DgDGH7uc.js.map} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CZWcC3OA.js → extension-settings-page-BnQ2f4Fq.js} +2 -2
- package/dist/gateway/static/root/assets/{extension-settings-page-CZWcC3OA.js.map → extension-settings-page-BnQ2f4Fq.js.map} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-config-api-D4vLbsOG.js → heartbeat-config-api-B9hxMalj.js} +2 -2
- package/dist/gateway/static/root/assets/{heartbeat-config-api-D4vLbsOG.js.map → heartbeat-config-api-B9hxMalj.js.map} +1 -1
- package/dist/gateway/static/root/assets/{index-DZLKmP08.js → index-8IFT6i7x.js} +4 -4
- package/dist/gateway/static/root/assets/{index-DZLKmP08.js.map → index-8IFT6i7x.js.map} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-f_viqgaf.js → logs-page-DNHn8mTk.js} +2 -2
- package/dist/gateway/static/root/assets/{logs-page-f_viqgaf.js.map → logs-page-DNHn8mTk.js.map} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-DW2-c8fv.js → sessions-page-D3kE1tob.js} +2 -2
- package/dist/gateway/static/root/assets/{sessions-page-DW2-c8fv.js.map → sessions-page-D3kE1tob.js.map} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-D7-piKSc.js → settings-page-B4tuVOtd.js} +2 -2
- package/dist/gateway/static/root/assets/{settings-page-D7-piKSc.js.map → settings-page-B4tuVOtd.js.map} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-ChpOJZM1.js → skills-page-Dgd20nUt.js} +2 -2
- package/dist/gateway/static/root/assets/{skills-page-ChpOJZM1.js.map → skills-page-Dgd20nUt.js.map} +1 -1
- package/dist/gateway/static/root/assets/{use-image-provider-credentials-131rA-SV.js → use-image-provider-credentials-CqMkyIiU.js} +2 -2
- package/dist/gateway/static/root/assets/{use-image-provider-credentials-131rA-SV.js.map → use-image-provider-credentials-CqMkyIiU.js.map} +1 -1
- package/dist/gateway/static/root/index.html +1 -1
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +6 -6
- package/dist/src/agent/context/workspace-seed.js +2 -2
- package/dist/src/agent/goals/post-turn.js +1 -1
- package/dist/src/agent/image/load-image-media.js +1 -1
- package/dist/src/agent/ipc/bus.js +1 -1
- package/dist/src/agent/ipc/inbox.js +2 -2
- package/dist/src/agent/ipc/socket.js +1 -1
- package/dist/src/agent/memory/builtin-memory-store.js +1 -1
- package/dist/src/agent/memory/dreaming/deep-promotion.js +1 -1
- package/dist/src/agent/memory/dreaming/events.js +1 -1
- package/dist/src/agent/memory/dreaming/last-run.js +1 -1
- package/dist/src/agent/memory/dreaming/light-sweep.js +1 -1
- package/dist/src/agent/memory/dreaming/preview.js +1 -1
- package/dist/src/agent/memory/dreaming/rem-patterns.js +1 -1
- package/dist/src/agent/memory/dreaming/short-term-store.js +1 -1
- package/dist/src/agent/memory/dreaming/utils.js +1 -1
- package/dist/src/agent/memory/plugin-discovery.js +1 -1
- package/dist/src/agent/models/manager.js +1 -1
- package/dist/src/agent/prompt/service-prompt-builder.js +2 -2
- package/dist/src/agent/service.js +5 -5
- package/dist/src/agent/skills/config.js +1 -1
- package/dist/src/agent/skills/hub-hash.js +2 -2
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/skills/hub-pull.js +1 -1
- package/dist/src/agent/skills/index.js +1 -1
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/scanner.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/skills/skill-manager.js +1 -1
- package/dist/src/agent/tools/dreaming-tool.js +1 -1
- package/dist/src/agent/tools/factory.js +1 -1
- package/dist/src/agent/tools/image-generate-tool.js +1 -1
- package/dist/src/agent/tools/send-media.js +1 -1
- package/dist/src/agent/tools/skill-manage-tool.js +1 -1
- package/dist/src/agent/tools/write.js +1 -1
- package/dist/src/auth/credentials.js +3 -3
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +1 -1
- package/dist/src/channels/attachments/inbound-persist.js +1 -1
- package/dist/src/channels/attachments/outbound-tts-persist.js +1 -1
- package/dist/src/channels/outbound/persist-store.js +1 -1
- package/dist/src/channels/pairing/allow-from-file.js +1 -1
- package/dist/src/channels/pairing/pairing-store.js +2 -2
- package/dist/src/chat-commands/builtins/config.js +2 -2
- package/dist/src/chat-commands/context.js +1 -1
- package/dist/src/cli/commands/agent.js +1 -1
- package/dist/src/cli/commands/config.js +1 -1
- package/dist/src/cli/commands/doctor/checks/config-health.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
- package/dist/src/cli/commands/doctor/checks/session-integrity.js +1 -1
- package/dist/src/cli/commands/doctor/checks/state-integrity.js +1 -1
- package/dist/src/cli/commands/doctor/checks/workspace-status.js +1 -1
- package/dist/src/cli/commands/extension-dev.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +1 -1
- package/dist/src/cli/commands/extension-pack.js +1 -1
- package/dist/src/cli/commands/image.js +1 -1
- package/dist/src/cli/commands/init.js +4 -4
- package/dist/src/cli/utils/init-workspace.js +2 -2
- package/dist/src/config/index.js +3 -3
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.js +2 -2
- package/dist/src/config/profile.js +2 -2
- package/dist/src/cron/executor.js +2 -2
- package/dist/src/cron/persistence.js +1 -1
- package/dist/src/cron/run-log-store.js +1 -1
- package/dist/src/daemon/launchd.js +2 -2
- package/dist/src/daemon/systemd.js +2 -2
- package/dist/src/extensions/health.js +1 -1
- package/dist/src/extensions/loader.js +1 -1
- package/dist/src/extensions/lockfile.js +2 -2
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/hono/lib/extension-store.js +1 -1
- package/dist/src/gateway/hono/lib/static-ui.js +1 -1
- package/dist/src/gateway/hono/oauth.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/config.js +1 -1
- package/dist/src/gateway/hono/routes/dreaming.js +1 -1
- package/dist/src/gateway/hono/routes/host-fs.js +1 -1
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/workspace.js +3 -3
- package/dist/src/gateway/hono/sse.js +2 -2
- package/dist/src/gateway/lock.js +2 -2
- package/dist/src/gateway/security/csp.d.ts +1 -0
- package/dist/src/gateway/security/csp.js +2 -0
- package/dist/src/gateway/security/csp.js.map +1 -1
- package/dist/src/gateway/service/run-gateway-agent.js +2 -2
- package/dist/src/gateway/service.js +5 -5
- package/dist/src/gateway/workspace-fs-file-list.js +1 -1
- package/dist/src/gateway/workspace-heartbeat-path.js +1 -1
- package/dist/src/infra/update-check.js +1 -1
- package/dist/src/infra/update-lock.js +3 -3
- package/dist/src/infra/update-runner.js +1 -1
- package/dist/src/infra/update-startup.js +2 -2
- package/dist/src/infra/write-file-atomic.js +2 -2
- package/dist/src/providers/auth-runtime/auth-profile-store.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/session/config-store.js +2 -2
- package/dist/src/session/parity/jsonl-transcript-io.js +2 -2
- package/dist/src/session/parity/sessions-json-file.js +1 -1
- package/dist/src/session/parity/transcript-file-lock.js +2 -2
- package/dist/src/session/parity/transcript-paths.js +1 -1
- package/dist/src/session/search-index-cache.js +1 -1
- package/dist/src/session/search-index.js +1 -1
- package/dist/src/session/session-title.js +1 -1
- package/dist/src/session/store.js +4 -4
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/tui/tui.js +1 -1
- package/dist/src/utils/logger/audit.js +1 -1
- package/dist/src/utils/logger/log-store.js +1 -1
- package/dist/src/utils/logger/rotation.js +1 -1
- package/dist/src/voice/tts/audio.js +1 -1
- package/dist/src/voice/tts/providers/edge-speech.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
2
|
-
import { anthropicOAuthProvider } from "../../auth/oauth/anthropic.js";
|
|
3
2
|
import { init_providers, isProviderConfigured } from "../../providers/index.js";
|
|
3
|
+
import { anthropicOAuthProvider } from "../../auth/oauth/anthropic.js";
|
|
4
4
|
import { minimaxOAuthProvider } from "../../auth/oauth/minimax.js";
|
|
5
5
|
import { minimaxCnOAuthProvider } from "../../auth/oauth/minimax-cn.js";
|
|
6
6
|
import { kimiCodingOAuthProvider } from "../../auth/oauth/kimi-coding.js";
|
|
@@ -7,8 +7,8 @@ import { createOAuthHandler } from "../oauth.js";
|
|
|
7
7
|
import { createOAuthAsyncHandler } from "../oauth-async.js";
|
|
8
8
|
import { extensionAssetMimeType } from "../lib/extension-assets.js";
|
|
9
9
|
import { loadExtensionStore, saveExtensionStore } from "../lib/extension-store.js";
|
|
10
|
-
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
11
10
|
import { relative, resolve } from "node:path";
|
|
11
|
+
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
12
12
|
//#region src/gateway/hono/routes/auth-registry-extensions.ts
|
|
13
13
|
init_providers();
|
|
14
14
|
const EXTENSION_ASSET_CSP = "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; connect-src 'none'; frame-ancestors 'self'; frame-src 'none'; base-uri 'none'; object-src 'none'; form-action 'none'";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CredentialResolver, init_credentials } from "../../../auth/credentials.js";
|
|
2
1
|
import { BindingsConfigSchema, init_schema } from "../../../config/schema.js";
|
|
2
|
+
import { CredentialResolver, init_credentials } from "../../../auth/credentials.js";
|
|
3
3
|
import { normalizePatchAgentImageGenerationModel, normalizePatchAgentModel } from "../lib/agent-model.js";
|
|
4
4
|
import { applyToolsWebPatch } from "../../config-tools-web.js";
|
|
5
5
|
import { buildSafeWebConfigPayload } from "../lib/config-payload.js";
|
|
@@ -5,8 +5,8 @@ import { resolveDreamingConfig } from "../../../agent/memory/dreaming/config.js"
|
|
|
5
5
|
import { parseDreamingLastRunFile } from "../../../agent/memory/dreaming/last-run.js";
|
|
6
6
|
import { readDreamingEvents } from "../../../agent/memory/dreaming/events.js";
|
|
7
7
|
import { previewDreamingDeepPromotion } from "../../../agent/memory/dreaming/preview.js";
|
|
8
|
-
import fs from "node:fs/promises";
|
|
9
8
|
import path from "node:path";
|
|
9
|
+
import fs from "node:fs/promises";
|
|
10
10
|
//#region src/gateway/hono/routes/dreaming.ts
|
|
11
11
|
init_schema();
|
|
12
12
|
function isRecord(v) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createLogger } from "../../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../../utils/logger.js";
|
|
3
|
-
import { readdir, realpath, stat } from "node:fs/promises";
|
|
4
3
|
import * as path$1 from "node:path";
|
|
5
4
|
import * as os$1 from "node:os";
|
|
5
|
+
import { readdir, realpath, stat } from "node:fs/promises";
|
|
6
6
|
//#region src/gateway/hono/routes/host-fs.ts
|
|
7
7
|
init_logger();
|
|
8
8
|
const log = createLogger("HostFs");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
2
|
-
import { CredentialResolver, init_credentials } from "../../../auth/credentials.js";
|
|
3
2
|
import { init_resolve_config_value, testApiKeyResolution } from "../../../config/resolve-config-value.js";
|
|
4
3
|
import { init_models_json, loadModelsJson, saveModelsJson, validateModelsConfig } from "../../../config/models-json.js";
|
|
5
4
|
import { getModelRegistry } from "../../../providers/model-registry.js";
|
|
5
|
+
import { CredentialResolver, init_credentials } from "../../../auth/credentials.js";
|
|
6
6
|
import { getProviderRegistry, init_plugin_registry } from "../../../providers/plugin-registry.js";
|
|
7
7
|
import { PROVIDER_META, getAllModels, getAllProviders, getAvailableModels, getProviderActiveKeySource, init_providers, isProviderConfigured } from "../../../providers/index.js";
|
|
8
8
|
import { getImageGenerationProvider } from "../../../agent/image/generation/provider-registry.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { createLogger } from "../../../utils/logger/index.js";
|
|
2
|
-
import { init_logger } from "../../../utils/logger.js";
|
|
3
1
|
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveAgentHomeDir, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../../../agent/agent-scope.js";
|
|
4
2
|
import { getWorkspacePath, init_schema } from "../../../config/schema.js";
|
|
5
3
|
import { extractProfileAgentId } from "../../../config/agent-profile.js";
|
|
4
|
+
import { createLogger } from "../../../utils/logger/index.js";
|
|
5
|
+
import { init_logger } from "../../../utils/logger.js";
|
|
6
6
|
import { resolveSafeInboundFilePath } from "../../../channels/attachments/inbound-persist.js";
|
|
7
7
|
import { isPathUnderWorkspace, resolveWorkspaceSafePath, toWorkspaceRelativePosix } from "../../workspace-editor-path.js";
|
|
8
8
|
import { resolveSafeTtsFilePath } from "../../../channels/attachments/outbound-tts-persist.js";
|
|
9
9
|
import { resolveHeartbeatMdPath } from "../../workspace-heartbeat-path.js";
|
|
10
10
|
import { listWorkspaceRelativeFilesFsFallback } from "../../workspace-fs-file-list.js";
|
|
11
11
|
import { runRipgrepInDirectory, runRipgrepListFiles } from "../../workspace-ripgrep.js";
|
|
12
|
-
import { readFile, readdir, stat, writeFile } from "node:fs/promises";
|
|
13
12
|
import { join, resolve } from "node:path";
|
|
13
|
+
import { readFile, readdir, stat, writeFile } from "node:fs/promises";
|
|
14
14
|
//#region src/gateway/hono/routes/workspace.ts
|
|
15
15
|
init_schema();
|
|
16
16
|
init_agent_scope();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { buildSessionKey, init_session_key, parseSessionKey } from "../../routing/session-key.js";
|
|
2
|
+
import { getDefaultAgentId, init_resolve_route } from "../../routing/resolve-route.js";
|
|
1
3
|
import { updateAsyncLogContext } from "../../utils/logger/context.js";
|
|
2
4
|
import { createLogger } from "../../utils/logger/index.js";
|
|
3
5
|
import { init_logger } from "../../utils/logger.js";
|
|
4
|
-
import { buildSessionKey, init_session_key, parseSessionKey } from "../../routing/session-key.js";
|
|
5
|
-
import { getDefaultAgentId, init_resolve_route } from "../../routing/resolve-route.js";
|
|
6
6
|
import { MAX_WEBCHAT_ATTACHMENT_FILE_BYTES } from "../chat-limits.js";
|
|
7
7
|
import { stringifySSEData } from "./sse-json.js";
|
|
8
8
|
import { randomUUID } from "node:crypto";
|
package/dist/src/gateway/lock.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import path from "node:path";
|
|
2
2
|
import fsSync from "node:fs";
|
|
3
|
+
import { createHash } from "node:crypto";
|
|
3
4
|
import fs from "node:fs/promises";
|
|
4
|
-
import path from "node:path";
|
|
5
5
|
import net from "node:net";
|
|
6
6
|
import { homedir } from "os";
|
|
7
7
|
//#region src/gateway/lock.ts
|
|
@@ -9,6 +9,7 @@ export declare function computeInlineScriptHashes(html: string): string[];
|
|
|
9
9
|
* For the gateway console, we use:
|
|
10
10
|
* - `script-src 'self'` + optional SHA-256 hashes for inline scripts (no unsafe-inline)
|
|
11
11
|
* - `style-src 'self' 'unsafe-inline'` (Tailwind + runtime style injection)
|
|
12
|
+
* - `media-src 'self' blob:` (chat voice previews / recorded clips use blob URLs)
|
|
12
13
|
* - `frame-ancestors 'none'` (prevent clickjacking)
|
|
13
14
|
* - `base-uri 'none'` (prevent base tag hijacking)
|
|
14
15
|
* - `object-src 'none'` (prevent plugin execution)
|
|
@@ -27,6 +27,7 @@ function hasSrcAttribute(openTag) {
|
|
|
27
27
|
* For the gateway console, we use:
|
|
28
28
|
* - `script-src 'self'` + optional SHA-256 hashes for inline scripts (no unsafe-inline)
|
|
29
29
|
* - `style-src 'self' 'unsafe-inline'` (Tailwind + runtime style injection)
|
|
30
|
+
* - `media-src 'self' blob:` (chat voice previews / recorded clips use blob URLs)
|
|
30
31
|
* - `frame-ancestors 'none'` (prevent clickjacking)
|
|
31
32
|
* - `base-uri 'none'` (prevent base tag hijacking)
|
|
32
33
|
* - `object-src 'none'` (prevent plugin execution)
|
|
@@ -41,6 +42,7 @@ function buildGatewayConsoleCspHeader(options) {
|
|
|
41
42
|
hashes?.length ? `script-src 'self' ${hashes.map((hash) => `'${hash}'`).join(" ")}` : "script-src 'self'",
|
|
42
43
|
"style-src 'self' 'unsafe-inline'",
|
|
43
44
|
"img-src 'self' data: blob: https:",
|
|
45
|
+
"media-src 'self' blob: data:",
|
|
44
46
|
"font-src 'self'",
|
|
45
47
|
`connect-src ${options?.connectSrc ?? "'self' ws: wss:"}`,
|
|
46
48
|
"worker-src 'self'"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"csp.js","names":[],"sources":["../../../../src/gateway/security/csp.ts"],"sourcesContent":["import { createHash } from 'node:crypto';\n\n/**\n * Compute SHA-256 CSP hashes for inline `<script>` blocks in an HTML string.\n * Only scripts without a `src` attribute are considered inline.\n */\nexport function computeInlineScriptHashes(html: string): string[] {\n const hashes: string[] = [];\n const scriptRegex = /<script(?:\\s[^>]*)?>([^]*?)<\\/script>/gi;\n let match: RegExpExecArray | null;\n while ((match = scriptRegex.exec(html)) !== null) {\n const openTag = match[0].slice(0, match[0].indexOf('>') + 1);\n if (hasSrcAttribute(openTag)) {\n continue;\n }\n const content = match[1];\n if (!content) {\n continue;\n }\n const hash = createHash('sha256').update(content, 'utf8').digest('base64');\n hashes.push(`sha256-${hash}`);\n }\n return hashes;\n}\n\nconst ATTRIBUTE_NAME_REGEX = /\\s([^\\s=/>]+)(?:\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s>]+))?/g;\n\nfunction hasSrcAttribute(openTag: string): boolean {\n return Array.from(openTag.matchAll(ATTRIBUTE_NAME_REGEX)).some(\n (attrMatch) => attrMatch[1]?.toLowerCase() === 'src',\n );\n}\n\n/**\n * Build a Content-Security-Policy header string.\n *\n * For the gateway console, we use:\n * - `script-src 'self'` + optional SHA-256 hashes for inline scripts (no unsafe-inline)\n * - `style-src 'self' 'unsafe-inline'` (Tailwind + runtime style injection)\n * - `frame-ancestors 'none'` (prevent clickjacking)\n * - `base-uri 'none'` (prevent base tag hijacking)\n * - `object-src 'none'` (prevent plugin execution)\n */\nexport function buildGatewayConsoleCspHeader(options?: {\n inlineScriptHashes?: string[];\n connectSrc?: string;\n}): string {\n const hashes = options?.inlineScriptHashes;\n const scriptSrc = hashes?.length\n ? `script-src 'self' ${hashes.map((hash) => `'${hash}'`).join(' ')}`\n : \"script-src 'self'\";\n const connectSrc = options?.connectSrc ?? \"'self' ws: wss:\";\n\n return [\n \"default-src 'self'\",\n \"base-uri 'none'\",\n \"object-src 'none'\",\n \"frame-ancestors 'none'\",\n scriptSrc,\n \"style-src 'self' 'unsafe-inline'\",\n \"img-src 'self' data: blob: https:\",\n \"font-src 'self'\",\n `connect-src ${connectSrc}`,\n \"worker-src 'self'\",\n ].join('; ');\n}\n"],"mappings":";;;;;;AAMA,SAAgB,0BAA0B,MAAwB;CAChE,MAAM,SAAmB,EAAE;CAC3B,MAAM,cAAc;CACpB,IAAI;AACJ,SAAQ,QAAQ,YAAY,KAAK,KAAK,MAAM,MAAM;AAEhD,MAAI,gBADY,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,IAAI,GAAG,EAC/B,CAAC,CAC1B;EAEF,MAAM,UAAU,MAAM;AACtB,MAAI,CAAC,QACH;EAEF,MAAM,OAAO,WAAW,SAAS,CAAC,OAAO,SAAS,OAAO,CAAC,OAAO,SAAS;AAC1E,SAAO,KAAK,UAAU,OAAO;;AAE/B,QAAO;;AAGT,MAAM,uBAAuB;AAE7B,SAAS,gBAAgB,SAA0B;AACjD,QAAO,MAAM,KAAK,QAAQ,SAAS,qBAAqB,CAAC,CAAC,MACvD,cAAc,UAAU,IAAI,aAAa,KAAK,MAChD
|
|
1
|
+
{"version":3,"file":"csp.js","names":[],"sources":["../../../../src/gateway/security/csp.ts"],"sourcesContent":["import { createHash } from 'node:crypto';\n\n/**\n * Compute SHA-256 CSP hashes for inline `<script>` blocks in an HTML string.\n * Only scripts without a `src` attribute are considered inline.\n */\nexport function computeInlineScriptHashes(html: string): string[] {\n const hashes: string[] = [];\n const scriptRegex = /<script(?:\\s[^>]*)?>([^]*?)<\\/script>/gi;\n let match: RegExpExecArray | null;\n while ((match = scriptRegex.exec(html)) !== null) {\n const openTag = match[0].slice(0, match[0].indexOf('>') + 1);\n if (hasSrcAttribute(openTag)) {\n continue;\n }\n const content = match[1];\n if (!content) {\n continue;\n }\n const hash = createHash('sha256').update(content, 'utf8').digest('base64');\n hashes.push(`sha256-${hash}`);\n }\n return hashes;\n}\n\nconst ATTRIBUTE_NAME_REGEX = /\\s([^\\s=/>]+)(?:\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s>]+))?/g;\n\nfunction hasSrcAttribute(openTag: string): boolean {\n return Array.from(openTag.matchAll(ATTRIBUTE_NAME_REGEX)).some(\n (attrMatch) => attrMatch[1]?.toLowerCase() === 'src',\n );\n}\n\n/**\n * Build a Content-Security-Policy header string.\n *\n * For the gateway console, we use:\n * - `script-src 'self'` + optional SHA-256 hashes for inline scripts (no unsafe-inline)\n * - `style-src 'self' 'unsafe-inline'` (Tailwind + runtime style injection)\n * - `media-src 'self' blob:` (chat voice previews / recorded clips use blob URLs)\n * - `frame-ancestors 'none'` (prevent clickjacking)\n * - `base-uri 'none'` (prevent base tag hijacking)\n * - `object-src 'none'` (prevent plugin execution)\n */\nexport function buildGatewayConsoleCspHeader(options?: {\n inlineScriptHashes?: string[];\n connectSrc?: string;\n}): string {\n const hashes = options?.inlineScriptHashes;\n const scriptSrc = hashes?.length\n ? `script-src 'self' ${hashes.map((hash) => `'${hash}'`).join(' ')}`\n : \"script-src 'self'\";\n const connectSrc = options?.connectSrc ?? \"'self' ws: wss:\";\n\n return [\n \"default-src 'self'\",\n \"base-uri 'none'\",\n \"object-src 'none'\",\n \"frame-ancestors 'none'\",\n scriptSrc,\n \"style-src 'self' 'unsafe-inline'\",\n \"img-src 'self' data: blob: https:\",\n \"media-src 'self' blob: data:\",\n \"font-src 'self'\",\n `connect-src ${connectSrc}`,\n \"worker-src 'self'\",\n ].join('; ');\n}\n"],"mappings":";;;;;;AAMA,SAAgB,0BAA0B,MAAwB;CAChE,MAAM,SAAmB,EAAE;CAC3B,MAAM,cAAc;CACpB,IAAI;AACJ,SAAQ,QAAQ,YAAY,KAAK,KAAK,MAAM,MAAM;AAEhD,MAAI,gBADY,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,IAAI,GAAG,EAC/B,CAAC,CAC1B;EAEF,MAAM,UAAU,MAAM;AACtB,MAAI,CAAC,QACH;EAEF,MAAM,OAAO,WAAW,SAAS,CAAC,OAAO,SAAS,OAAO,CAAC,OAAO,SAAS;AAC1E,SAAO,KAAK,UAAU,OAAO;;AAE/B,QAAO;;AAGT,MAAM,uBAAuB;AAE7B,SAAS,gBAAgB,SAA0B;AACjD,QAAO,MAAM,KAAK,QAAQ,SAAS,qBAAqB,CAAC,CAAC,MACvD,cAAc,UAAU,IAAI,aAAa,KAAK,MAChD;;;;;;;;;;;;;AAcH,SAAgB,6BAA6B,SAGlC;CACT,MAAM,SAAS,SAAS;AAMxB,QAAO;EACL;EACA;EACA;EACA;EATgB,QAAQ,SACtB,qBAAqB,OAAO,KAAK,SAAS,IAAI,KAAK,GAAG,CAAC,KAAK,IAAI,KAChE;EASF;EACA;EACA;EACA;EACA,eAZiB,SAAS,cAAc;EAaxC;EACD,CAAC,KAAK,KAAK"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { buildSessionKey, init_session_key, parseSessionKey } from "../../routing/session-key.js";
|
|
2
|
+
import { getDefaultAgentId, init_resolve_route } from "../../routing/resolve-route.js";
|
|
1
3
|
import { inboundCorrelationMetadataFromAsyncLogContext } from "../../utils/logger/context.js";
|
|
2
4
|
import { createLogger } from "../../utils/logger/index.js";
|
|
3
5
|
import { init_logger } from "../../utils/logger.js";
|
|
4
|
-
import { buildSessionKey, init_session_key, parseSessionKey } from "../../routing/session-key.js";
|
|
5
|
-
import { getDefaultAgentId, init_resolve_route } from "../../routing/resolve-route.js";
|
|
6
6
|
import { prependEnvelopeTimestamp } from "../../channels/envelope-timestamp.js";
|
|
7
7
|
import { shouldSkipWebchatInboundByAbortCutoff } from "../../session/abort-cutoff.js";
|
|
8
8
|
import "../chat-limits.js";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { __toCommonJS } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { PACKAGE_VERSION, init_package_version } from "../package-version.js";
|
|
3
|
+
import { resolveStateDir } from "../config/paths-state.js";
|
|
4
|
+
import { getWorkspacePath, init_schema } from "../config/schema.js";
|
|
5
|
+
import { buildSessionKey, init_session_key, parseSessionKey } from "../routing/session-key.js";
|
|
6
|
+
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
3
7
|
import { getLogDir } from "../utils/logger/config.js";
|
|
4
8
|
import { getLogStats } from "../utils/logger/stats.js";
|
|
5
9
|
import { createLogger } from "../utils/logger/index.js";
|
|
6
10
|
import { init_logger } from "../utils/logger.js";
|
|
7
|
-
import { resolveStateDir } from "../config/paths-state.js";
|
|
8
11
|
import { init_paths, resolveAgentDir, resolveConfigPath, resolveCronJobsPath, resolveExtensionsDir } from "../config/paths.js";
|
|
9
|
-
import { getWorkspacePath, init_schema } from "../config/schema.js";
|
|
10
12
|
import { loadConfig, saveConfig } from "../config/loader.js";
|
|
11
|
-
import { buildSessionKey, init_session_key, parseSessionKey } from "../routing/session-key.js";
|
|
12
|
-
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
13
13
|
import { getModelRegistry } from "../providers/model-registry.js";
|
|
14
14
|
import { init_providers, providers_exports } from "../providers/index.js";
|
|
15
15
|
import { createSkillConfigManager } from "../agent/skills/config.js";
|
|
@@ -48,8 +48,8 @@ import { restartGatewayProcessWithFreshPid } from "./respawn.js";
|
|
|
48
48
|
import { getDistinctSessionChatIds } from "./service/session-chat-ids.js";
|
|
49
49
|
import { runGatewayAgent } from "./service/run-gateway-agent.js";
|
|
50
50
|
import { GatewaySseHub } from "./service/sse-hub.js";
|
|
51
|
-
import { existsSync, mkdirSync, rmSync } from "node:fs";
|
|
52
51
|
import { join } from "node:path";
|
|
52
|
+
import { existsSync, mkdirSync, rmSync } from "node:fs";
|
|
53
53
|
import crypto from "crypto";
|
|
54
54
|
//#region src/gateway/service.ts
|
|
55
55
|
init_schema();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import { readdir } from "node:fs/promises";
|
|
4
3
|
import { join, relative } from "node:path";
|
|
4
|
+
import { readdir } from "node:fs/promises";
|
|
5
5
|
//#region src/gateway/workspace-fs-file-list.ts
|
|
6
6
|
init_logger();
|
|
7
7
|
const log = createLogger("WorkspaceFsFileList");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { init_agent_scope, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
2
|
-
import { WORKSPACE_FILES, init_paths } from "../config/paths.js";
|
|
3
2
|
import { getWorkspacePath, init_schema } from "../config/schema.js";
|
|
3
|
+
import { WORKSPACE_FILES, init_paths } from "../config/paths.js";
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
//#region src/gateway/workspace-heartbeat-path.ts
|
|
6
6
|
init_schema();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PACKAGE_VERSION, init_package_version } from "../package-version.js";
|
|
2
2
|
import { channelToNpmTag } from "./update-channels.js";
|
|
3
|
-
import { access, readFile } from "node:fs/promises";
|
|
4
3
|
import { dirname, join } from "node:path";
|
|
4
|
+
import { access, readFile } from "node:fs/promises";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
//#region src/infra/update-check.ts
|
|
7
7
|
init_package_version();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { init_paths_state, resolveUpdateLockPath } from "../config/paths-state.js";
|
|
2
2
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../utils/logger.js";
|
|
4
|
-
import {
|
|
5
|
-
import { mkdir, readFile, unlink } from "node:fs/promises";
|
|
4
|
+
import { init_write_file_atomic, writeTextAtomic } from "./write-file-atomic.js";
|
|
6
5
|
import { dirname } from "node:path";
|
|
6
|
+
import { mkdir, readFile, unlink } from "node:fs/promises";
|
|
7
7
|
//#region src/infra/update-lock.ts
|
|
8
8
|
init_write_file_atomic();
|
|
9
9
|
init_paths_state();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import { access, readdir, unlink } from "node:fs/promises";
|
|
4
3
|
import { join } from "node:path";
|
|
4
|
+
import { access, readdir, unlink } from "node:fs/promises";
|
|
5
5
|
import { spawn } from "node:child_process";
|
|
6
6
|
//#region src/infra/update-runner.ts
|
|
7
7
|
init_logger();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PACKAGE_VERSION, init_package_version } from "../package-version.js";
|
|
2
|
-
import {
|
|
2
|
+
import { init_paths_state, resolveUpdateCheckStatePath } from "../config/paths-state.js";
|
|
3
3
|
import { createLogger } from "../utils/logger/index.js";
|
|
4
4
|
import { init_logger } from "../utils/logger.js";
|
|
5
|
-
import {
|
|
5
|
+
import { init_write_file_atomic, writeTextAtomic } from "./write-file-atomic.js";
|
|
6
6
|
import { acquireUpdateLock } from "./update-lock.js";
|
|
7
7
|
import { normalizeUpdateChannel } from "./update-channels.js";
|
|
8
8
|
import { compareSemver, detectInstallKind, resolveNpmChannelTag, resolvePackageRoot } from "./update-check.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import
|
|
2
|
+
import path from "node:path";
|
|
3
3
|
import { chmodSync, closeSync, copyFileSync, fsyncSync, mkdirSync, openSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { randomUUID } from "node:crypto";
|
|
4
5
|
import { chmod, copyFile, mkdir, open, rename, rm } from "node:fs/promises";
|
|
5
|
-
import path from "node:path";
|
|
6
6
|
//#region src/infra/write-file-atomic.ts
|
|
7
7
|
/**
|
|
8
8
|
* Durable single-file writes: temp file → fsync → rename to target.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
4
3
|
import { dirname, join } from "node:path";
|
|
4
|
+
import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
5
5
|
//#region src/providers/auth-runtime/auth-profile-store.ts
|
|
6
6
|
/**
|
|
7
7
|
* {@link AuthProfileStore} implementations.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __esmMin, __exportAll } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { PROVIDER_ENV_MAP, getApiKeyFromEnv, init_env_keys } from "./env-keys.js";
|
|
3
|
-
import { CredentialResolver, hasCredentials, init_credentials, resolveApiKey } from "../auth/credentials.js";
|
|
4
2
|
import { hasProviderAuthOnDiskSync, init_sync_provider_auth } from "../auth/sync-provider-auth.js";
|
|
3
|
+
import { PROVIDER_ENV_MAP, getApiKeyFromEnv, init_env_keys } from "./env-keys.js";
|
|
5
4
|
import { ModelRegistry, getModelRegistry, init_model_registry, resetModelRegistry } from "./model-registry.js";
|
|
5
|
+
import { CredentialResolver, hasCredentials, init_credentials, resolveApiKey } from "../auth/credentials.js";
|
|
6
6
|
import { getProviderRegistry, init_plugin_registry } from "./plugin-registry.js";
|
|
7
7
|
import { getModel, getModels, getProviders } from "@earendil-works/pi-ai";
|
|
8
8
|
//#region src/providers/index.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../utils/logger.js";
|
|
4
|
-
import { getApiKeyFromEnv, init_env_keys } from "./env-keys.js";
|
|
5
4
|
import { resolveModelsJsonPath } from "../config/paths.js";
|
|
6
5
|
import { init_resolve_config_value, resolveConfigValue, resolveHeaders } from "../config/resolve-config-value.js";
|
|
7
6
|
import { getDefaultModelValues, init_models_json, validateModelsConfig } from "../config/models-json.js";
|
|
7
|
+
import { getApiKeyFromEnv, init_env_keys } from "./env-keys.js";
|
|
8
8
|
import { existsSync, readFileSync } from "fs";
|
|
9
9
|
import { getModels, getProviders } from "@earendil-works/pi-ai";
|
|
10
10
|
//#region src/providers/model-registry.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
2
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
2
|
import { init_logger } from "../utils/logger.js";
|
|
4
|
-
import {
|
|
3
|
+
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
5
4
|
import { join } from "path";
|
|
6
5
|
import { existsSync } from "fs";
|
|
6
|
+
import { mkdir, readFile } from "fs/promises";
|
|
7
7
|
//#region src/session/config-store.ts
|
|
8
8
|
/**
|
|
9
9
|
* Session Config Store
|
|
@@ -2,9 +2,9 @@ import { init_write_file_atomic, writeTextAtomic } from "../../infra/write-file-
|
|
|
2
2
|
import { loadEntriesFromFile } from "./load-jsonl-entries.js";
|
|
3
3
|
import { withTranscriptFileLock } from "./transcript-file-lock.js";
|
|
4
4
|
import { buildSessionContextForLlm, isTranscriptContextEntry } from "../session-context-for-llm.js";
|
|
5
|
-
import { randomUUID } from "node:crypto";
|
|
6
|
-
import { existsSync } from "node:fs";
|
|
7
5
|
import path from "node:path";
|
|
6
|
+
import { existsSync } from "node:fs";
|
|
7
|
+
import { randomUUID } from "node:crypto";
|
|
8
8
|
import { CURRENT_SESSION_VERSION, SessionManager } from "@earendil-works/pi-coding-agent";
|
|
9
9
|
//#region src/session/parity/jsonl-transcript-io.ts
|
|
10
10
|
init_write_file_atomic();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { init_write_file_atomic, writeTextAtomic } from "../../infra/write-file-atomic.js";
|
|
2
|
+
import { dirname } from "node:path";
|
|
2
3
|
import { existsSync } from "node:fs";
|
|
3
4
|
import { mkdir, readFile } from "node:fs/promises";
|
|
4
|
-
import { dirname } from "node:path";
|
|
5
5
|
import lockfile from "proper-lockfile";
|
|
6
6
|
//#region src/session/parity/sessions-json-file.ts
|
|
7
7
|
init_write_file_atomic();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import path from "node:path";
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
|
+
import { createHash } from "node:crypto";
|
|
3
4
|
import { mkdir, open, readFile, rm, stat } from "node:fs/promises";
|
|
4
|
-
import path from "node:path";
|
|
5
5
|
//#region src/session/parity/transcript-file-lock.ts
|
|
6
6
|
/**
|
|
7
7
|
* Cross-process (and re-entrant same-process) advisory lock for session transcript JSONL.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { formatSessionArchiveTimestamp, init_artifacts } from "./artifacts.js";
|
|
3
3
|
import { init_session_id, validateSessionId } from "./session-id.js";
|
|
4
|
-
import fsSync from "node:fs";
|
|
5
4
|
import { dirname, relative, resolve } from "node:path";
|
|
5
|
+
import fsSync from "node:fs";
|
|
6
6
|
//#region src/session/parity/transcript-paths.ts
|
|
7
7
|
function resolveSessionsDir(opts) {
|
|
8
8
|
const sessionsDir = opts?.sessionsDir?.trim();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FILENAMES, init_paths } from "../config/paths.js";
|
|
2
2
|
import { SessionSearchIndex } from "./search-index.js";
|
|
3
|
-
import { stat } from "node:fs/promises";
|
|
4
3
|
import { join } from "node:path";
|
|
4
|
+
import { stat } from "node:fs/promises";
|
|
5
5
|
//#region src/session/search-index-cache.ts
|
|
6
6
|
/**
|
|
7
7
|
* Shared cache for {@link SessionSearchIndex} builds (invalidated on session writes).
|
|
@@ -2,8 +2,8 @@ import { init_transcript_paths, resolveSessionFilePath } from "./parity/transcri
|
|
|
2
2
|
import { FILENAMES, init_paths } from "../config/paths.js";
|
|
3
3
|
import { isTranscriptContextEntry } from "./session-context-for-llm.js";
|
|
4
4
|
import { readTranscriptRowsFromFile, rowsToLlmMessages } from "./parity/jsonl-transcript-io.js";
|
|
5
|
-
import { readFile } from "node:fs/promises";
|
|
6
5
|
import { join } from "node:path";
|
|
6
|
+
import { readFile } from "node:fs/promises";
|
|
7
7
|
//#region src/session/search-index.ts
|
|
8
8
|
/**
|
|
9
9
|
* In-memory inverted index over session transcripts (`sessions.json` + JSONL).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { init_session_key, isCronSessionKey, parseSessionKey } from "../routing/session-key.js";
|
|
1
2
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
3
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import { init_session_key, isCronSessionKey, parseSessionKey } from "../routing/session-key.js";
|
|
4
4
|
import { init_providers, resolveModel } from "../providers/index.js";
|
|
5
5
|
import { readAgentMessageContent } from "../agent/memory/agent-message-access.js";
|
|
6
6
|
import { stripInboundFileMetadataFromText } from "../channels/attachments/inbound-persist.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { init_agent_scope, listAgentEntries, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
2
|
+
import { init_session_key, parseSessionKey } from "../routing/session-key.js";
|
|
1
3
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
4
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import { init_agent_scope, listAgentEntries, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
4
5
|
import { init_artifacts, parseCompactionCheckpointTranscriptFileName } from "./parity/artifacts.js";
|
|
5
6
|
import { init_session_id, validateSessionId } from "./parity/session-id.js";
|
|
6
7
|
import { archiveFileOnDisk, init_transcript_paths, resolveSessionFilePath, resolveSessionTranscriptPathInDir } from "./parity/transcript-paths.js";
|
|
7
8
|
import { FILENAMES, init_paths, resolveSessionsDir } from "../config/paths.js";
|
|
8
|
-
import { init_session_key, parseSessionKey } from "../routing/session-key.js";
|
|
9
9
|
import { loadEntriesFromFile } from "./parity/load-jsonl-entries.js";
|
|
10
10
|
import { mergeLlmMessagesPreservingContextRows } from "./session-context-for-llm.js";
|
|
11
11
|
import { persistMergedTranscriptRows, readTranscriptRowsFromFile, rowsToLlmMessages, writeTranscriptJsonl } from "./parity/jsonl-transcript-io.js";
|
|
@@ -15,10 +15,10 @@ import { SlidingWindow } from "../agent/memory/window.js";
|
|
|
15
15
|
import { normalizeCompactionCheckpointId } from "./compaction-checkpoints.js";
|
|
16
16
|
import "./types.js";
|
|
17
17
|
import { readSessionsJsonFile, withSessionsJsonLock } from "./parity/sessions-json-file.js";
|
|
18
|
-
import { copyFile, mkdir, readdir, stat, unlink } from "fs/promises";
|
|
19
|
-
import { randomUUID } from "node:crypto";
|
|
20
18
|
import { join } from "path";
|
|
21
19
|
import { existsSync } from "fs";
|
|
20
|
+
import { copyFile, mkdir, readdir, stat, unlink } from "fs/promises";
|
|
21
|
+
import { randomUUID } from "node:crypto";
|
|
22
22
|
//#region src/session/store.ts
|
|
23
23
|
init_paths();
|
|
24
24
|
init_agent_scope();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { getWorkspacePath } from "../../config/schema.js";
|
|
1
2
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
3
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { getWorkspacePath } from "../../config/schema.js";
|
|
4
4
|
import { loadConfig } from "../../config/loader.js";
|
|
5
5
|
import { getAllProviders, getModelsByProvider, init_providers } from "../../providers/index.js";
|
|
6
6
|
import { MessageBus, MessageBusShutdownError } from "../../infra/bus/queue.js";
|
package/dist/src/tui/tui.js
CHANGED
|
@@ -17,9 +17,9 @@ import { GatewaySseBackend } from "./backends/gateway-sse-backend.js";
|
|
|
17
17
|
import { ChatLog } from "./components/chat-log.js";
|
|
18
18
|
import { CustomEditor } from "./components/custom-editor.js";
|
|
19
19
|
import { TuiBottomBar } from "./components/tui-bottom-bar.js";
|
|
20
|
-
import { mkdtempSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
|
|
21
20
|
import { join } from "node:path";
|
|
22
21
|
import { tmpdir } from "node:os";
|
|
22
|
+
import { mkdtempSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
|
|
23
23
|
import { spawnSync } from "node:child_process";
|
|
24
24
|
import { CombinedAutocompleteProvider, Container, Loader, ProcessTerminal, TUI, Text, setKeybindings } from "@earendil-works/pi-tui";
|
|
25
25
|
//#region src/tui/tui.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { getLogDir, init_config } from "./config.js";
|
|
3
|
-
import { appendFile } from "fs/promises";
|
|
4
3
|
import path from "path";
|
|
5
4
|
import { existsSync, mkdirSync } from "fs";
|
|
5
|
+
import { appendFile } from "fs/promises";
|
|
6
6
|
//#region src/utils/logger/audit.ts
|
|
7
7
|
/**
|
|
8
8
|
* Audit Log
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { readFile } from "fs/promises";
|
|
2
1
|
import { basename, join } from "path";
|
|
3
2
|
import { createReadStream, existsSync, mkdirSync, readdirSync, statSync, unlinkSync } from "fs";
|
|
3
|
+
import { readFile } from "fs/promises";
|
|
4
4
|
import { gunzip } from "zlib";
|
|
5
5
|
import { promisify } from "util";
|
|
6
6
|
import { createInterface } from "readline";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { config, getLogDir, init_config } from "./config.js";
|
|
3
|
-
import { writeFile } from "fs/promises";
|
|
4
3
|
import { join } from "path";
|
|
5
4
|
import { readFileSync, readdirSync, statSync, unlinkSync } from "fs";
|
|
5
|
+
import { writeFile } from "fs/promises";
|
|
6
6
|
import { gzip } from "zlib";
|
|
7
7
|
import { promisify } from "util";
|
|
8
8
|
//#region src/utils/logger/rotation.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { unlink, writeFile } from "fs/promises";
|
|
4
3
|
import { join } from "path";
|
|
4
|
+
import { unlink, writeFile } from "fs/promises";
|
|
5
5
|
import { spawn } from "child_process";
|
|
6
6
|
import { tmpdir } from "os";
|
|
7
7
|
//#region src/voice/tts/audio.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createLogger } from "../../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../../utils/logger.js";
|
|
3
3
|
import { registerSpeechProvider } from "../speech-registry.js";
|
|
4
|
-
import { mkdtempSync, readFileSync, rmSync } from "node:fs";
|
|
5
4
|
import path from "node:path";
|
|
6
5
|
import { tmpdir } from "node:os";
|
|
6
|
+
import { mkdtempSync, readFileSync, rmSync } from "node:fs";
|
|
7
7
|
//#region src/voice/tts/providers/edge-speech.ts
|
|
8
8
|
/**
|
|
9
9
|
* Edge TTS provider — wraps the `node-edge-tts` package. Requires no API key
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xopcai/xopc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.54",
|
|
4
4
|
"description": "The OPC workstation that grows with you: AI assistant for One Person Companies — CLI, gateway, multi-channel (Telegram/WeChat), 20+ LLM providers via pi-ai, extensions and skills.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|