@xopcai/xopc 0.0.448 → 0.0.449
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/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{index-Dw5NFmnZ.js → index-BAsoPLVl.js} +1 -1
- package/dist/gateway/static/root/index.html +1 -1
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +1 -1
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/external-tools/cliProvider.js +2 -2
- package/dist/src/agent/external-tools/composio-provider.js +2 -2
- package/dist/src/agent/external-tools/endpoint-provider.js +3 -3
- package/dist/src/agent/service.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/skill-manage-ops.js +1 -1
- package/dist/src/agent/tools/personal-read-tool.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.js +2 -2
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/agent-catalog/repository.js +1 -1
- package/dist/src/automations/api/routes.js +2 -2
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/automations/capabilities/write.js +1 -1
- package/dist/src/automations/configuration-conversation.js +1 -1
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/cli/bin.js +2 -2
- package/dist/src/cli/commands/agent.js +2 -2
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/auth.js +1 -1
- package/dist/src/cli/commands/device-host.js +1 -1
- package/dist/src/cli/commands/extension-agent-plugin.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.js +1 -1
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/gateway-ssh-tunnel.js +1 -1
- package/dist/src/cli/commands/import.js +1 -1
- package/dist/src/cli/commands/mcp.js +2 -2
- package/dist/src/cli/commands/models.js +3 -3
- package/dist/src/cli/commands/onboard/model.js +1 -1
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/platform.js +1 -1
- package/dist/src/cli/commands/profile.js +1 -1
- package/dist/src/cli/commands/tunnel.js +1 -1
- package/dist/src/cli/commands/update.js +1 -1
- package/dist/src/cli/extension-cli-register.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/computer/endpoint-transport.js +1 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/index.js +1 -1
- package/dist/src/execution-environments/local-worktree-manager.js +1 -1
- package/dist/src/extensions/agent-plugins/skill-catalog.js +1 -1
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/global-defaults-admin.js +2 -2
- package/dist/src/gateway/hono/app.js +1 -0
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
- package/dist/src/gateway/hono/routes/html-preview.d.ts +0 -1
- package/dist/src/gateway/hono/routes/html-preview.js +3 -40
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/phone-setup.js +1 -1
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/html-preview-shell.d.ts +11 -0
- package/dist/src/gateway/html-preview-shell.js +43 -0
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/server.js +1 -1
- package/dist/src/gateway/service.js +11 -11
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/home-intelligence/host.js +2 -2
- package/dist/src/imports/importService.js +1 -1
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/personal-agent/service.js +1 -1
- package/dist/src/runtime-tools/archive.js +1 -1
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/write.js +1 -1
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { normalizeAgentId } from "../agent-catalog/id.js";
|
|
2
1
|
import { resolveEffectiveAgentConfig } from "../agent-config/resolver.js";
|
|
3
2
|
import { init_agent_config } from "../agent-config/index.js";
|
|
3
|
+
import { normalizeAgentId } from "../agent-catalog/id.js";
|
|
4
4
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
5
5
|
import { init_agent_scope, resolveAgentWorkspaceDir } from "../agent/agent-scope.js";
|
|
6
6
|
import { getConversationRouting } from "../storage/sqlite/conversation-repository.js";
|
package/dist/src/config/index.js
CHANGED
|
@@ -14,9 +14,9 @@ import { applyConfigOverrides, getConfigOverrides, resetConfigOverrides, setConf
|
|
|
14
14
|
import { canonicalizeConfiguredMcpServer, normalizeConfiguredMcpServers } from "./mcp-config-normalize.js";
|
|
15
15
|
import { formatThinkingLevels, listThinkingLevels, normalizeElevatedMode, normalizeReasoningLevel, normalizeThinkLevel, normalizeVerboseLevel, thinkLevelToNumber } from "../agent/transcript/thinking-types.js";
|
|
16
16
|
import { loadConfig, saveConfig } from "./loader.js";
|
|
17
|
+
import { diffConfigPaths } from "./diff.js";
|
|
17
18
|
import { listAgentProfileMarkdownDirs, listAgentWorkspaceDirs } from "./workspace-dirs.js";
|
|
18
19
|
import { ProfileManager, createProfile, deleteProfile, getCurrentProfile, getProfileManager, getProfileNameFromDir, getSwitchCommand, listProfiles, resolveProfileStateDir } from "./profile.js";
|
|
19
|
-
import { diffConfigPaths } from "./diff.js";
|
|
20
20
|
import { BASE_RELOAD_RULES, buildReloadPlan, matchReloadRule } from "./rules.js";
|
|
21
21
|
import { ConfigHotReloader } from "./reload.js";
|
|
22
22
|
//#region src/config/index.ts
|
|
@@ -8,8 +8,8 @@ import { assertManagedWorktreePath, assertNoNestedRegisteredWorktrees, readDirec
|
|
|
8
8
|
import { dirname, resolve } from "node:path";
|
|
9
9
|
import { existsSync } from "node:fs";
|
|
10
10
|
import { randomUUID } from "node:crypto";
|
|
11
|
-
import lockfile from "proper-lockfile";
|
|
12
11
|
import { mkdir, rm, stat } from "node:fs/promises";
|
|
12
|
+
import lockfile from "proper-lockfile";
|
|
13
13
|
//#region src/execution-environments/local-worktree-manager.ts
|
|
14
14
|
init_logger();
|
|
15
15
|
const log = createLogger("ExecutionEnvironment:LocalWorktree");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { parseFrontmatter } from "../../markdown/frontmatter.js";
|
|
1
2
|
import { containedPath } from "./contained-path.js";
|
|
2
3
|
import "./validation.js";
|
|
3
4
|
import { AgentPluginStore } from "./store.js";
|
|
4
|
-
import { parseFrontmatter } from "../../markdown/frontmatter.js";
|
|
5
5
|
import { createSkillConfigManager } from "../../agent/skills/config.js";
|
|
6
6
|
import { parseSkillLocalizations } from "../../agent/skills/parse-skill-metadata.js";
|
|
7
7
|
import { buildSkillMarkdownPreviewFromRaw } from "../../agent/skills/skill-markdown-preview-from-raw.js";
|
|
@@ -9,8 +9,8 @@ import { dirname, join, resolve } from "node:path";
|
|
|
9
9
|
import { existsSync, lstatSync, readFileSync, readdirSync, realpathSync, statSync } from "node:fs";
|
|
10
10
|
import { createHash } from "node:crypto";
|
|
11
11
|
import { z } from "zod";
|
|
12
|
-
import { validateHeaderName, validateHeaderValue } from "node:http";
|
|
13
12
|
import yaml from "js-yaml";
|
|
13
|
+
import { validateHeaderName, validateHeaderValue } from "node:http";
|
|
14
14
|
//#region src/extensions/agent-plugins/validation.ts
|
|
15
15
|
init_schema();
|
|
16
16
|
const PLUGIN_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { normalizeAgentId, validateAgentIdForNewAgent } from "../agent-catalog/id.js";
|
|
2
2
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
3
3
|
import { init_agent_scope, listAgentEntries, resolveAgentProfileDir, resolveAgentWorkspaceDir, resolveDefaultAgentId, resolveUserPath } from "../agent/agent-scope.js";
|
|
4
|
-
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
5
4
|
import { AGENT_PROFILE_MARKDOWN_SYSTEM_FILES, REQUIRED_AGENT_PROFILE_MARKDOWN_FILE_SET } from "../agent/context/workspace.js";
|
|
6
5
|
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
6
|
+
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
7
7
|
import { isPathUnderWorkspace, resolveWorkspaceSafePath } from "./workspace-editor-path.js";
|
|
8
8
|
import { GATEWAY_BUILTIN_TOOL_IDS } from "./agent-builtin-tools.js";
|
|
9
9
|
import { resolve } from "node:path";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AgentDefaultsSchema } from "../agent-config/schema.js";
|
|
2
2
|
import { init_agent_config } from "../agent-config/index.js";
|
|
3
3
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
4
|
-
import { validatePhoneModelChange } from "../phone/model-adapter.js";
|
|
5
4
|
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
6
|
-
import {
|
|
5
|
+
import { validatePhoneModelChange } from "../phone/model-adapter.js";
|
|
7
6
|
import { GATEWAY_BUILTIN_TOOLS } from "./agent-builtin-tools.js";
|
|
7
|
+
import { validateComputerModelChange } from "../computer/model-config.js";
|
|
8
8
|
import { isDeepStrictEqual } from "node:util";
|
|
9
9
|
//#region src/gateway/global-defaults-admin.ts
|
|
10
10
|
init_agent_config();
|
|
@@ -9,6 +9,7 @@ import { loadTunnelState } from "../../tunnel/tunnel-state.js";
|
|
|
9
9
|
import { maxSessionInputRequestBodyBytes } from "../chat-limits.js";
|
|
10
10
|
import { BROWSER_EXTENSION_ID } from "../../browser/extension-identity.js";
|
|
11
11
|
import { isLoopbackIpAddress, isTrustedProxyAddress } from "../client-ip.js";
|
|
12
|
+
import "../html-preview-shell.js";
|
|
12
13
|
import { buildGatewayConsoleCspHeader } from "../security/csp.js";
|
|
13
14
|
import { checkBrowserOrigin, isChromeExtensionOrigin } from "../security/origin-check.js";
|
|
14
15
|
import { auth } from "./middleware/auth.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { normalizeAgentId } from "../../../agent-catalog/id.js";
|
|
2
1
|
import { AgentEntrySchema, AgentModelsOverrideSchema, AgentProfileSchema, RuntimePolicySchema, SkillOverrideSchema, ToolPoliciesSchema } from "../../../agent-config/schema.js";
|
|
3
2
|
import { init_agent_config } from "../../../agent-config/index.js";
|
|
3
|
+
import { normalizeAgentId } from "../../../agent-catalog/id.js";
|
|
4
4
|
import { init_agent_scope } from "../../../agent/agent-scope.js";
|
|
5
5
|
import { getVoiceModelsConfig } from "../../../config/voice.js";
|
|
6
6
|
import { createGatewayAgent, deleteAgentAvatarFile, deleteGatewayAgent, getGatewayAgentEffectiveConfig, listAgentProfileFiles, listGatewayAgents, readAgentAvatarFile, readAgentProfileFile, resolveAgentAvatarImage, updateGatewayAgent, writeAgentAvatarFromBase64, writeAgentProfileFile } from "../../agents-admin.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { BindingsSchema, init_binding_schema } from "../../../../routing/binding-schema.js";
|
|
2
|
+
import { AgentCatalogService } from "../../../../agent-catalog/service.js";
|
|
2
3
|
import { ComputerConfigSchema, init_config } from "../../../../computer/config.js";
|
|
3
4
|
import { ContextPlanningConfigSchema, HomeIntelligenceConfigSchema, KnowledgeMemoryConfigSchema, UserContextConfigSchema, UserModelConfigSchema, init_config as init_config$1 } from "../../../../user-context/config.js";
|
|
4
5
|
import { BrowserConfigSchema, McpConfigSchema, VoiceConfigSchema, init_schema } from "../../../../config/schema.js";
|
|
5
6
|
import { CredentialResolver, init_credentials } from "../../../../auth/credentials.js";
|
|
6
7
|
import { canonicalizeConfiguredMcpServer } from "../../../../config/mcp-config-normalize.js";
|
|
7
|
-
import { AgentCatalogService } from "../../../../agent-catalog/service.js";
|
|
8
8
|
import { mergeGatewaySkillsMarketplacePatch, mergeSessionConfigPatch, mergeUpdateConfigPatch } from "../../../../config/web-patch.js";
|
|
9
9
|
import { assertGatewayAuthConfigured, resolveGatewayAuth } from "../../../auth.js";
|
|
10
10
|
import { isMaskedSecretPatchValue } from "../../lib/mask-secret-length.js";
|
|
@@ -1,45 +1,8 @@
|
|
|
1
|
+
import { HTML_PREVIEW_HEADERS, HTML_PREVIEW_PATH, HTML_PREVIEW_SHELL } from "../../html-preview-shell.js";
|
|
1
2
|
//#region src/gateway/hono/routes/html-preview.ts
|
|
2
|
-
const HTML_PREVIEW_PATH = "/api/preview/html";
|
|
3
|
-
const HTML_PREVIEW_SANDBOX = "allow-scripts allow-popups allow-popups-to-escape-sandbox allow-downloads allow-forms allow-modals";
|
|
4
|
-
const HTML_PREVIEW_CSP = [
|
|
5
|
-
"default-src 'none'",
|
|
6
|
-
`sandbox ${HTML_PREVIEW_SANDBOX}`,
|
|
7
|
-
"script-src 'unsafe-inline' https: blob:",
|
|
8
|
-
"style-src 'unsafe-inline' https:",
|
|
9
|
-
"img-src https: data: blob:",
|
|
10
|
-
"media-src https: data: blob:",
|
|
11
|
-
"font-src https: data:",
|
|
12
|
-
"connect-src https:",
|
|
13
|
-
"frame-src 'self' about:",
|
|
14
|
-
"frame-ancestors 'self'",
|
|
15
|
-
"base-uri 'none'",
|
|
16
|
-
"object-src 'none'",
|
|
17
|
-
"form-action https:"
|
|
18
|
-
].join("; ");
|
|
19
|
-
const HTML_PREVIEW_SHELL = `<!doctype html>
|
|
20
|
-
<html><head><meta charset="utf-8"><title>HTML preview</title>
|
|
21
|
-
<style>html,body{height:100%;margin:0;overflow:hidden}iframe{display:block;width:100%;height:100%;border:0}</style>
|
|
22
|
-
</head><body><iframe title="HTML preview" sandbox="${HTML_PREVIEW_SANDBOX}"></iframe>
|
|
23
|
-
<script>
|
|
24
|
-
const preview = document.querySelector('iframe');
|
|
25
|
-
window.addEventListener('message', (event) => {
|
|
26
|
-
if (event.source !== window.parent || window.parent === window) return;
|
|
27
|
-
const data = event.data;
|
|
28
|
-
if (!data || data.type !== 'xopc-html-preview' || typeof data.html !== 'string') return;
|
|
29
|
-
// Repeated load notifications must not restart scripts or discard preview state.
|
|
30
|
-
if (preview.srcdoc !== data.html) preview.srcdoc = data.html;
|
|
31
|
-
});
|
|
32
|
-
<\/script></body></html>`;
|
|
33
3
|
/** Public static shell only: file contents arrive from the authenticated UI, never a URL. */
|
|
34
4
|
function registerPublicHtmlPreviewRoute(app) {
|
|
35
|
-
app.get(HTML_PREVIEW_PATH, (c) => c.html(HTML_PREVIEW_SHELL, 200,
|
|
36
|
-
"Content-Security-Policy": HTML_PREVIEW_CSP,
|
|
37
|
-
"X-Frame-Options": "SAMEORIGIN",
|
|
38
|
-
"X-Content-Type-Options": "nosniff",
|
|
39
|
-
"Referrer-Policy": "no-referrer",
|
|
40
|
-
"Permissions-Policy": "camera=(), microphone=(), geolocation=()",
|
|
41
|
-
"Cache-Control": "no-store"
|
|
42
|
-
}));
|
|
5
|
+
app.get(HTML_PREVIEW_PATH, (c) => c.html(HTML_PREVIEW_SHELL, 200, HTML_PREVIEW_HEADERS));
|
|
43
6
|
}
|
|
44
7
|
//#endregion
|
|
45
|
-
export {
|
|
8
|
+
export { registerPublicHtmlPreviewRoute };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { NoteDeleteOutputSchema, NoteGetOutputSchema, ProductReadContracts } from "../../../../packages/gateway-contract/src/capabilities.js";
|
|
2
2
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
3
|
-
import { init_session_key, resolveConversationId } from "../../../routing/session-key.js";
|
|
4
|
-
import { agentExists, getDefaultAgentId, init_resolve_route } from "../../../routing/resolve-route.js";
|
|
5
3
|
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
6
4
|
import "../../../capabilities/runtime/dispatcher.js";
|
|
5
|
+
import { init_session_key, resolveConversationId } from "../../../routing/session-key.js";
|
|
6
|
+
import { agentExists, getDefaultAgentId, init_resolve_route } from "../../../routing/resolve-route.js";
|
|
7
7
|
import { resolveReverseProxyPublicUrl } from "../../public-url.js";
|
|
8
8
|
import { createProductDispatcher } from "../../../capabilities/runtime/product.js";
|
|
9
9
|
import { resolveGatewayEffectiveHost } from "../../../config/gateway-bind.js";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { resolveStateDir } from "../../../config/paths-state.js";
|
|
2
2
|
import { getSessionMetadata, init_session_read_repository } from "../../../storage/sqlite/session-read-repository.js";
|
|
3
3
|
import { AgentCatalogRepository, init_repository } from "../../../agent-catalog/repository.js";
|
|
4
|
+
import { AgentCatalogService } from "../../../agent-catalog/service.js";
|
|
4
5
|
import { init_paths } from "../../../config/paths.js";
|
|
5
6
|
import { resolveEffectiveAgentConfigForAgent } from "../../../config/agent-profile.js";
|
|
6
7
|
import { phoneModelProfile } from "../../../phone/model-policy.js";
|
|
@@ -10,7 +11,6 @@ import { managedHdcPath, managedHosJar, managedJavaHome } from "../../../runtime
|
|
|
10
11
|
import { managedPhoneAdbPath } from "../../../runtime-tools/phone-dependency-catalog.js";
|
|
11
12
|
import "../../../phone/model-adapter.js";
|
|
12
13
|
import { getPhoneRuntime } from "../../../phone/runtime.js";
|
|
13
|
-
import { AgentCatalogService } from "../../../agent-catalog/service.js";
|
|
14
14
|
import { PhoneSetupService } from "../../../phone/setup/service.js";
|
|
15
15
|
import { PhoneDependencyManager, probePhoneAdb } from "../../../runtime-tools/phone-dependencies.js";
|
|
16
16
|
import { createHash } from "node:crypto";
|
|
@@ -6,12 +6,12 @@ import { loadTranscriptRowsForSession } from "../../../storage/sqlite/transcript
|
|
|
6
6
|
import "../../../storage/sqlite/index.js";
|
|
7
7
|
import { ActivityService } from "../../../activity/service.js";
|
|
8
8
|
import "../../../activity/index.js";
|
|
9
|
+
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
10
|
+
import "../../../capabilities/runtime/dispatcher.js";
|
|
9
11
|
import { listKnowledgeItems, writeKnowledgeItem } from "../../../knowledge-memory/repository.js";
|
|
10
12
|
import "../../../knowledge-memory/index.js";
|
|
11
13
|
import { resolveEffectiveAgentProfile } from "../../../config/agent-profile.js";
|
|
12
14
|
import { TaskReadModelProjector } from "../../../tasks/task-read-model-projector.js";
|
|
13
|
-
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
14
|
-
import "../../../capabilities/runtime/dispatcher.js";
|
|
15
15
|
import { ProjectWorkspaceConflictError, ProjectWorkspaceMissingError } from "../../../projects/workspace-project.js";
|
|
16
16
|
import { inferProjectExecutionMode, inferProjectKind } from "../../../projects/project-kind.js";
|
|
17
17
|
import { ProjectDeletionBlockedError, ProjectWorkspaceInUseError } from "../../../projects/project-service.js";
|
|
@@ -8,9 +8,9 @@ import { SessionInputControlConflict, init_session_input_control_repository } fr
|
|
|
8
8
|
import { endpointTurnClaimSchema, init_src as init_src$1 } from "../../../../packages/endpoint-tools-protocol/src/index.js";
|
|
9
9
|
import { recordDeviceExecutionActor } from "../../../endpoint-tools/execution-actor.js";
|
|
10
10
|
import { init_types, parseTurnContextRefs } from "../../../agent/source-context/types.js";
|
|
11
|
-
import { init_providers, resolveModel } from "../../../providers/index.js";
|
|
12
11
|
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
13
12
|
import "../../../capabilities/runtime/dispatcher.js";
|
|
13
|
+
import { init_providers, resolveModel } from "../../../providers/index.js";
|
|
14
14
|
import { getModelThinking } from "../../../providers/model-thinking.js";
|
|
15
15
|
import { validateWebchatAttachments, validateWebchatContent } from "../../chat-limits.js";
|
|
16
16
|
import { isTaskDestructiveCommand } from "../../../session/reset-triggers.js";
|
|
@@ -6,9 +6,9 @@ import { hasGatewayScope } from "../../security/gateway-scopes.js";
|
|
|
6
6
|
import { enqueueTaskChangedEvent, init_task_change_events } from "../../../tasks/task-change-events.js";
|
|
7
7
|
import { TaskRepository, init_task_repository } from "../../../tasks/task-repository.js";
|
|
8
8
|
import { TaskRunRepository, init_task_run_repository } from "../../../tasks/task-run-repository.js";
|
|
9
|
-
import { TaskConversationRepository } from "../../../tasks/task-conversation-repository.js";
|
|
10
9
|
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
11
10
|
import "../../../capabilities/runtime/dispatcher.js";
|
|
11
|
+
import { TaskConversationRepository } from "../../../tasks/task-conversation-repository.js";
|
|
12
12
|
import { TaskCriterionReviewRepository } from "../../../tasks/task-criterion-review-repository.js";
|
|
13
13
|
import { TaskContextMutationOutputSchema } from "../../../tasks/capabilities/relations.js";
|
|
14
14
|
import { TaskDeleteOutputSchema } from "../../../tasks/capabilities/management.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const HTML_PREVIEW_PATH = "/api/preview/html";
|
|
2
|
+
export declare const HTML_PREVIEW_SHELL = "<!doctype html>\n<html><head><meta charset=\"utf-8\"><title>HTML preview</title>\n<style>html,body{height:100%;margin:0;overflow:hidden}iframe{display:block;width:100%;height:100%;border:0}</style>\n</head><body><iframe title=\"HTML preview\" sandbox=\"allow-scripts allow-popups allow-popups-to-escape-sandbox allow-downloads allow-forms allow-modals\"></iframe>\n<script>\nconst preview = document.querySelector('iframe');\nwindow.addEventListener('message', (event) => {\n if (event.source !== window.parent || window.parent === window) return;\n const data = event.data;\n if (!data || data.type !== 'xopc-html-preview' || typeof data.html !== 'string') return;\n // Repeated load notifications must not restart scripts or discard preview state.\n if (preview.srcdoc !== data.html) preview.srcdoc = data.html;\n});\n</script></body></html>";
|
|
3
|
+
export declare const HTML_PREVIEW_HEADERS: {
|
|
4
|
+
'Content-Type': string;
|
|
5
|
+
'Content-Security-Policy': string;
|
|
6
|
+
'X-Frame-Options': string;
|
|
7
|
+
'X-Content-Type-Options': string;
|
|
8
|
+
'Referrer-Policy': string;
|
|
9
|
+
'Permissions-Policy': string;
|
|
10
|
+
'Cache-Control': string;
|
|
11
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//#region src/gateway/html-preview-shell.ts
|
|
2
|
+
const HTML_PREVIEW_PATH = "/api/preview/html";
|
|
3
|
+
const HTML_PREVIEW_SANDBOX = "allow-scripts allow-popups allow-popups-to-escape-sandbox allow-downloads allow-forms allow-modals";
|
|
4
|
+
const HTML_PREVIEW_CSP = [
|
|
5
|
+
"default-src 'none'",
|
|
6
|
+
`sandbox ${HTML_PREVIEW_SANDBOX}`,
|
|
7
|
+
"script-src 'unsafe-inline' https: blob:",
|
|
8
|
+
"style-src 'unsafe-inline' https:",
|
|
9
|
+
"img-src https: data: blob:",
|
|
10
|
+
"media-src https: data: blob:",
|
|
11
|
+
"font-src https: data:",
|
|
12
|
+
"connect-src https:",
|
|
13
|
+
"frame-src 'self' about:",
|
|
14
|
+
"frame-ancestors 'self'",
|
|
15
|
+
"base-uri 'none'",
|
|
16
|
+
"object-src 'none'",
|
|
17
|
+
"form-action https:"
|
|
18
|
+
].join("; ");
|
|
19
|
+
const HTML_PREVIEW_SHELL = `<!doctype html>
|
|
20
|
+
<html><head><meta charset="utf-8"><title>HTML preview</title>
|
|
21
|
+
<style>html,body{height:100%;margin:0;overflow:hidden}iframe{display:block;width:100%;height:100%;border:0}</style>
|
|
22
|
+
</head><body><iframe title="HTML preview" sandbox="${HTML_PREVIEW_SANDBOX}"></iframe>
|
|
23
|
+
<script>
|
|
24
|
+
const preview = document.querySelector('iframe');
|
|
25
|
+
window.addEventListener('message', (event) => {
|
|
26
|
+
if (event.source !== window.parent || window.parent === window) return;
|
|
27
|
+
const data = event.data;
|
|
28
|
+
if (!data || data.type !== 'xopc-html-preview' || typeof data.html !== 'string') return;
|
|
29
|
+
// Repeated load notifications must not restart scripts or discard preview state.
|
|
30
|
+
if (preview.srcdoc !== data.html) preview.srcdoc = data.html;
|
|
31
|
+
});
|
|
32
|
+
<\/script></body></html>`;
|
|
33
|
+
const HTML_PREVIEW_HEADERS = {
|
|
34
|
+
"Content-Type": "text/html; charset=UTF-8",
|
|
35
|
+
"Content-Security-Policy": HTML_PREVIEW_CSP,
|
|
36
|
+
"X-Frame-Options": "SAMEORIGIN",
|
|
37
|
+
"X-Content-Type-Options": "nosniff",
|
|
38
|
+
"Referrer-Policy": "no-referrer",
|
|
39
|
+
"Permissions-Policy": "camera=(), microphone=(), geolocation=()",
|
|
40
|
+
"Cache-Control": "no-store"
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
export { HTML_PREVIEW_HEADERS, HTML_PREVIEW_PATH, HTML_PREVIEW_SHELL };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { normalizeAgentId } from "../agent-catalog/id.js";
|
|
2
2
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
3
3
|
import { init_agent_scope } from "../agent/agent-scope.js";
|
|
4
|
+
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
4
5
|
import { ConfigSchema, init_schema } from "../config/schema.js";
|
|
5
6
|
import { resolveEffectiveAgentConfigForAgent } from "../config/agent-profile.js";
|
|
6
7
|
import { fetchWithTimeoutGuarded } from "../media-shared/http/provider-http.js";
|
|
7
8
|
import "../media-shared/http/index.js";
|
|
8
|
-
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
9
9
|
import { getImageGenerationProvider, listImageGenerationProvidersSummary } from "../agent/image/generation/provider-registry.js";
|
|
10
10
|
//#region src/gateway/image-generation-setup.ts
|
|
11
11
|
init_repository();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveGatewayBindHost, resolveGatewayListenHosts } from "../config/gateway-bind.js";
|
|
2
|
-
import { ensureXopcCliOnPath } from "../infra/path-env.js";
|
|
3
2
|
import { resolveGatewayListenPlan } from "./listen.js";
|
|
3
|
+
import { ensureXopcCliOnPath } from "../infra/path-env.js";
|
|
4
4
|
import { GatewayService } from "./service.js";
|
|
5
5
|
import { handleSiteShareUpgrade } from "../share/site-share-router.js";
|
|
6
6
|
import { createHonoApp } from "./hono/app.js";
|
|
@@ -86,8 +86,13 @@ import { registerClarificationChannelRuntime } from "./clarify-runtime.js";
|
|
|
86
86
|
import { ChannelManager } from "../channels/manager.js";
|
|
87
87
|
import { ChatPreviewService } from "../chat-previews/service.js";
|
|
88
88
|
import "../chat-previews/index.js";
|
|
89
|
-
import { configureGatewayHttpProxy } from "../infra/http-proxy-env.js";
|
|
90
89
|
import "../config/index.js";
|
|
90
|
+
import { DiscussionService } from "../discussions/service.js";
|
|
91
|
+
import { DiscussionOrganizer } from "../discussions/organizer.js";
|
|
92
|
+
import { DiscussionLiveWorker } from "../discussions/live-worker.js";
|
|
93
|
+
import { DiscussionOrganizerWorker } from "../discussions/organizer-worker.js";
|
|
94
|
+
import { DiscussionSealer } from "../discussions/sealer.js";
|
|
95
|
+
import "../discussions/index.js";
|
|
91
96
|
import { ManagedComposioEventPoller } from "../connectors/composio-managed-events.js";
|
|
92
97
|
import { startConnectedKnowledgeCoordinator } from "../knowledge/coordinator.js";
|
|
93
98
|
import "../knowledge/index.js";
|
|
@@ -95,14 +100,12 @@ import { PersonalReplyComposer } from "../personal-agent/reply-composer.js";
|
|
|
95
100
|
import { ConnectionRecoveryService } from "../connectors/connection-recovery-service.js";
|
|
96
101
|
import { startConnectorLearningCoordinator } from "../connectors/learning-coordinator.js";
|
|
97
102
|
import { startConnectorSupervisor } from "../connectors/supervisor.js";
|
|
98
|
-
import { DiscussionService } from "../discussions/service.js";
|
|
99
|
-
import { DiscussionOrganizer } from "../discussions/organizer.js";
|
|
100
|
-
import { DiscussionLiveWorker } from "../discussions/live-worker.js";
|
|
101
|
-
import { DiscussionOrganizerWorker } from "../discussions/organizer-worker.js";
|
|
102
|
-
import { DiscussionSealer } from "../discussions/sealer.js";
|
|
103
|
-
import "../discussions/index.js";
|
|
104
103
|
import { EndpointToolRuntime } from "../endpoint-tools/runtime.js";
|
|
105
104
|
import "../endpoint-tools/index.js";
|
|
105
|
+
import { HomeCapabilityPreflightService } from "../home-intelligence/capability-preflight.js";
|
|
106
|
+
import { HomeAdviceGenerator } from "../home-intelligence/generator.js";
|
|
107
|
+
import { HomeIntelligenceHost } from "../home-intelligence/host.js";
|
|
108
|
+
import { HomeSnapshotBuilder } from "../home-intelligence/snapshot.js";
|
|
106
109
|
import { assertGatewayAuthConfigured, extractToken, resolveGatewayAuth, validateToken } from "./auth.js";
|
|
107
110
|
import { prepareAutomationAgentSession } from "./automation-agent-session.js";
|
|
108
111
|
import { deliverAutomationCompletion } from "./automation-completion-delivery.js";
|
|
@@ -114,6 +117,7 @@ import { BrowserSetupService } from "../browser/setup/service.js";
|
|
|
114
117
|
import { McpConversationSetup } from "../agent/mcp/conversation-setup.js";
|
|
115
118
|
import { withGatewayConfigWriteLock } from "./hono/lib/config-write-lock.js";
|
|
116
119
|
import { PhoneStreamGateway } from "../phone/stream-gateway.js";
|
|
120
|
+
import { configureGatewayHttpProxy } from "../infra/http-proxy-env.js";
|
|
117
121
|
import { PersonalProactivityService } from "../personal-agent/proactivity/service.js";
|
|
118
122
|
import { reconcilePersonalProactivityAutomation } from "../personal-agent/proactivity/automation.js";
|
|
119
123
|
import { createBackgroundTask } from "../infra/background-task.js";
|
|
@@ -164,10 +168,6 @@ import { TaskMainUpdateDecisionService } from "../tasks/task-main-update-decisio
|
|
|
164
168
|
import { selectTaskMainUpdateAttempt, submitAndConfirmTaskMainUpdate } from "../tasks/task-main-update-input.js";
|
|
165
169
|
import { checkAppContextAccess, prepareAppContext } from "./service/app-context-access.js";
|
|
166
170
|
import { applyAutomaticVoiceLanguage, inferProductLanguageFromEnvironment, initializeVoiceDefaults } from "../voice/language-profile.js";
|
|
167
|
-
import { HomeAdviceGenerator } from "../home-intelligence/generator.js";
|
|
168
|
-
import { HomeIntelligenceHost } from "../home-intelligence/host.js";
|
|
169
|
-
import { HomeSnapshotBuilder } from "../home-intelligence/snapshot.js";
|
|
170
|
-
import { HomeCapabilityPreflightService } from "../home-intelligence/capability-preflight.js";
|
|
171
171
|
import crypto from "node:crypto";
|
|
172
172
|
//#region src/gateway/service.ts
|
|
173
173
|
init_session_repository();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "../agent-config/schema.js";
|
|
2
2
|
import { init_agent_config } from "../agent-config/index.js";
|
|
3
3
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
4
|
+
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
4
5
|
import { ConfigSchema, init_schema } from "../config/schema.js";
|
|
5
6
|
import { phoneModelProfile } from "../phone/model-policy.js";
|
|
6
7
|
import { init_model_policy, isComputerModel, isDedicatedComputerProfile } from "../computer/model-policy.js";
|
|
@@ -9,7 +10,6 @@ import { init_voice } from "../../packages/realtime-protocol/src/voice.js";
|
|
|
9
10
|
import { getModelCatalogStore, init_model_catalog_store } from "../providers/model-catalog-store.js";
|
|
10
11
|
import "../phone/model-adapter.js";
|
|
11
12
|
import { compareCatalogModels } from "../providers/model-catalog-ranking.js";
|
|
12
|
-
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
13
13
|
import { prepareUpdateGlobalDefaults } from "./global-defaults-admin.js";
|
|
14
14
|
//#region src/gateway/xopc-cloud-capability-setup.ts
|
|
15
15
|
init_voice();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import { HomeAdviceBudgetExceededError, isHomeProseLocalized } from "./generator.js";
|
|
4
3
|
import { homePatternKey } from "./strategy.js";
|
|
5
|
-
import { HomeAdvicePolicy } from "./policy.js";
|
|
6
4
|
import { HomeIntelligenceRepository } from "./repository.js";
|
|
7
5
|
import { HomeOpportunityApplicationService } from "./application-service.js";
|
|
6
|
+
import { HomeAdvicePolicy } from "./policy.js";
|
|
7
|
+
import { HomeAdviceBudgetExceededError, isHomeProseLocalized } from "./generator.js";
|
|
8
8
|
import { buildHomeOpportunityNotification } from "./notification.js";
|
|
9
9
|
import { createHash } from "node:crypto";
|
|
10
10
|
//#region src/home-intelligence/host.ts
|
|
@@ -11,8 +11,8 @@ import { scanLocal } from "./scanner.js";
|
|
|
11
11
|
import { dirname, join } from "node:path";
|
|
12
12
|
import { existsSync, lstatSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
13
13
|
import { randomUUID } from "node:crypto";
|
|
14
|
-
import lockfile from "proper-lockfile";
|
|
15
14
|
import yaml from "js-yaml";
|
|
15
|
+
import lockfile from "proper-lockfile";
|
|
16
16
|
//#region src/imports/importService.ts
|
|
17
17
|
init_write_file_atomic();
|
|
18
18
|
init_logger();
|
|
@@ -5,9 +5,9 @@ import { init_logger } from "../utils/logger.js";
|
|
|
5
5
|
import { afterSqliteCommit, init_transaction, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
6
6
|
import { ExtensionCapabilityBindingsSchema, extensionCapabilityPermissions } from "../../packages/gateway-contract/src/extension-capabilities.js";
|
|
7
7
|
import { init_src } from "../../packages/gateway-contract/src/index.js";
|
|
8
|
+
import { CapabilityError } from "../capabilities/runtime/errors.js";
|
|
8
9
|
import { init_paths, resolveExtensionsDir } from "../config/paths.js";
|
|
9
10
|
import { slugifyProjectName } from "../projects/project-store.js";
|
|
10
|
-
import { CapabilityError } from "../capabilities/runtime/errors.js";
|
|
11
11
|
import { LocalAppStore } from "./store.js";
|
|
12
12
|
import { DomainOutboxDispatcher } from "../infra/domain-outbox-dispatcher.js";
|
|
13
13
|
import { validateLocalAppCapabilityContracts } from "./capabilities/contracts.js";
|
|
@@ -2,11 +2,11 @@ import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js
|
|
|
2
2
|
import { init_session_repository, patchSessionMetadata } from "../storage/sqlite/session-repository.js";
|
|
3
3
|
import { setSessionConfig } from "../storage/sqlite/config-repository.js";
|
|
4
4
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
5
|
+
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
5
6
|
import { createConversation, init_conversation_repository } from "../storage/sqlite/conversation-repository.js";
|
|
6
7
|
import { getAvailableModels, init_providers } from "../providers/index.js";
|
|
7
8
|
import { getPersonalAgent, personalAgentId } from "./repository.js";
|
|
8
9
|
import { PERSONAL_MAIN_TOOL_IDS, PERSONAL_READ_TOOL_ALIASES } from "./policy.js";
|
|
9
|
-
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
10
10
|
import { getModelThinking } from "../providers/model-thinking.js";
|
|
11
11
|
import { personalInstructions } from "./prompts.js";
|
|
12
12
|
import { completePersonalOnboarding } from "./onboarding.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { RuntimeError } from "./errors.js";
|
|
2
2
|
import { isAbsolute, join, posix, relative, resolve } from "node:path";
|
|
3
3
|
import { spawn } from "node:child_process";
|
|
4
|
-
import AdmZip from "adm-zip";
|
|
5
4
|
import { lstat, mkdir, readdir, readlink, rename, rm, stat } from "node:fs/promises";
|
|
5
|
+
import AdmZip from "adm-zip";
|
|
6
6
|
//#region src/runtime-tools/archive.ts
|
|
7
7
|
const MAX_ARCHIVE_ENTRIES = 5e4;
|
|
8
8
|
const MAX_TAR_OUTPUT_BYTES = 16 * 1024 * 1024;
|
|
@@ -2,10 +2,10 @@ import { ProductReadContracts } from "../../../packages/gateway-contract/src/cap
|
|
|
2
2
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
3
3
|
import { TaskRepository, init_task_repository } from "../task-repository.js";
|
|
4
4
|
import { TaskRunRepository, init_task_run_repository } from "../task-run-repository.js";
|
|
5
|
-
import { TaskReadModelProjector } from "../task-read-model-projector.js";
|
|
6
|
-
import { TaskConversationRepository } from "../task-conversation-repository.js";
|
|
7
5
|
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
8
6
|
import { defineReadCapability } from "../../capabilities/runtime/dispatcher.js";
|
|
7
|
+
import { TaskReadModelProjector } from "../task-read-model-projector.js";
|
|
8
|
+
import { TaskConversationRepository } from "../task-conversation-repository.js";
|
|
9
9
|
import { TaskContextRepository } from "../task-context-repository.js";
|
|
10
10
|
import { TaskDependencyService } from "../task-dependency-service.js";
|
|
11
11
|
import { TaskCriterionReviewRepository } from "../task-criterion-review-repository.js";
|
|
@@ -2,9 +2,9 @@ import { TaskCommandRequestSchema, TaskCreateRequestSchema, TaskDetailResponseSc
|
|
|
2
2
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
3
3
|
import { TaskRepository, init_task_repository } from "../task-repository.js";
|
|
4
4
|
import { TaskRunRepository, init_task_run_repository } from "../task-run-repository.js";
|
|
5
|
-
import { resolveTaskLocale } from "../task-language.js";
|
|
6
5
|
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
7
6
|
import { defineAtomicCapability } from "../../capabilities/runtime/dispatcher.js";
|
|
7
|
+
import { resolveTaskLocale } from "../task-language.js";
|
|
8
8
|
import { resolveProjectAgentId } from "../../projects/project-agent.js";
|
|
9
9
|
import { TaskApplicationService } from "../task-application-service.js";
|
|
10
10
|
import { TaskSignalService } from "../task-signal-service.js";
|
|
@@ -10,6 +10,7 @@ import { appendComposerInputHistory, listComposerInputHistory } from "../../stor
|
|
|
10
10
|
import "../../storage/sqlite/index.js";
|
|
11
11
|
import { normalizeAgentId } from "../../agent-catalog/id.js";
|
|
12
12
|
import { init_agent_scope, listAgentEntries } from "../../agent/agent-scope.js";
|
|
13
|
+
import { AgentCatalogService } from "../../agent-catalog/service.js";
|
|
13
14
|
import { init_paths } from "../../config/paths.js";
|
|
14
15
|
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
15
16
|
import { resolveEffectiveAgentProfile } from "../../config/agent-profile.js";
|
|
@@ -18,7 +19,6 @@ import { effectiveWorkspacePathForSession } from "../../session/session-workspac
|
|
|
18
19
|
import { ProjectService } from "../../projects/project-service.js";
|
|
19
20
|
import { inferSuggestedProjectDefaultAgentId } from "../../projects/project-agent-suggestion.js";
|
|
20
21
|
import "../../projects/index.js";
|
|
21
|
-
import { AgentCatalogService } from "../../agent-catalog/service.js";
|
|
22
22
|
import { buildSessionTimeline } from "../../session/transcript-outline.js";
|
|
23
23
|
import { transcriptRowsToClientHistory } from "../../session/client-history.js";
|
|
24
24
|
import { createCreateShareTool, isShareToolAvailable } from "../../agent/tools/create-share-tool.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { init_agent_scope, resolveAgentProfileDir } from "../../agent/agent-scope.js";
|
|
2
|
-
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
3
2
|
import { DEFAULT_SOUL_FILENAME } from "../../agent/context/workspace.js";
|
|
3
|
+
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
4
4
|
import { loadProfileBootstrapFiles } from "../../agent/bootstrap/load-bootstrap-files.js";
|
|
5
5
|
import { join } from "node:path";
|
|
6
6
|
import { statSync } from "node:fs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xopcai/xopc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.449",
|
|
4
4
|
"description": "An open-source AI assistant for work and everyday life. Remembers context and helps you get things done. Local-first, on a computer you choose.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|