@pixelbyte-software/pixcode 1.33.10 → 1.33.11

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.
Files changed (41) hide show
  1. package/dist/api-docs.html +395 -395
  2. package/dist/assets/{index-B_dU5AHA.js → index-oLYHJ2X5.js} +134 -134
  3. package/dist/favicon.svg +8 -8
  4. package/dist/icons/icon-128x128.svg +9 -9
  5. package/dist/icons/icon-144x144.svg +9 -9
  6. package/dist/icons/icon-152x152.svg +9 -9
  7. package/dist/icons/icon-192x192.svg +9 -9
  8. package/dist/icons/icon-384x384.svg +9 -9
  9. package/dist/icons/icon-512x512.svg +9 -9
  10. package/dist/icons/icon-72x72.svg +9 -9
  11. package/dist/icons/icon-96x96.svg +9 -9
  12. package/dist/icons/icon-template.svg +9 -9
  13. package/dist/index.html +1 -1
  14. package/dist/logo.svg +12 -12
  15. package/dist/openapi.yaml +1311 -1311
  16. package/dist-server/server/opencode-cli.js +4 -1
  17. package/dist-server/server/opencode-cli.js.map +1 -1
  18. package/package.json +178 -178
  19. package/server/database/db.js +794 -794
  20. package/server/database/json-store.js +194 -194
  21. package/server/modules/providers/list/opencode/opencode-auth.provider.ts +130 -130
  22. package/server/modules/providers/list/opencode/opencode-mcp.provider.ts +126 -126
  23. package/server/modules/providers/list/opencode/opencode-sessions.provider.ts +232 -232
  24. package/server/modules/providers/list/opencode/opencode.provider.ts +29 -29
  25. package/server/modules/providers/list/qwen/qwen-auth.provider.ts +145 -145
  26. package/server/modules/providers/list/qwen/qwen-mcp.provider.ts +114 -114
  27. package/server/modules/providers/list/qwen/qwen-sessions.provider.ts +265 -265
  28. package/server/modules/providers/list/qwen/qwen.provider.ts +21 -21
  29. package/server/modules/providers/shared/provider-configs.ts +142 -142
  30. package/server/opencode-cli.js +4 -1
  31. package/server/opencode-response-handler.js +107 -107
  32. package/server/qwen-code-cli.js +395 -395
  33. package/server/qwen-response-handler.js +73 -73
  34. package/server/routes/qwen.js +27 -27
  35. package/server/services/external-access.js +171 -171
  36. package/server/services/provider-credentials.js +189 -189
  37. package/server/services/provider-models.js +381 -381
  38. package/server/services/telegram/telegram-http-client.js +130 -130
  39. package/server/services/vapid-keys.js +36 -36
  40. package/server/utils/port-access.js +209 -209
  41. package/scripts/rest-sweep.mjs +0 -93
@@ -1,126 +1,126 @@
1
- import os from 'node:os';
2
- import path from 'node:path';
3
-
4
- import { McpProvider } from '@/modules/providers/shared/mcp/mcp.provider.js';
5
- import type { McpScope, ProviderMcpServer, UpsertProviderMcpServerInput } from '@/shared/types.js';
6
- import {
7
- AppError,
8
- readJsonConfig,
9
- readObjectRecord,
10
- readOptionalString,
11
- readStringArray,
12
- readStringRecord,
13
- writeJsonConfig,
14
- } from '@/shared/utils.js';
15
-
16
- /**
17
- * OpenCode MCP provider.
18
- *
19
- * OpenCode's MCP servers live under the top-level `mcp` key in
20
- * `opencode.json` (global at `~/.config/opencode/opencode.json`, project at
21
- * `<workspace>/opencode.json`). Each entry is either a local stdio command
22
- * (`{ command, args, env }`) or a remote server (`{ type: "remote", url,
23
- * headers, enabled }`). OpenCode's schema also supports an `enabled: false`
24
- * flag we preserve on write but don't surface in the UI yet.
25
- */
26
- export class OpencodeMcpProvider extends McpProvider {
27
- constructor() {
28
- super('opencode', ['user', 'project'], ['stdio', 'http', 'sse']);
29
- }
30
-
31
- protected async readScopedServers(scope: McpScope, workspacePath: string): Promise<Record<string, unknown>> {
32
- const filePath = scope === 'user'
33
- ? path.join(os.homedir(), '.config', 'opencode', 'opencode.json')
34
- : path.join(workspacePath, 'opencode.json');
35
- const config = await readJsonConfig(filePath);
36
- return readObjectRecord(config.mcp) ?? {};
37
- }
38
-
39
- protected async writeScopedServers(
40
- scope: McpScope,
41
- workspacePath: string,
42
- servers: Record<string, unknown>,
43
- ): Promise<void> {
44
- const filePath = scope === 'user'
45
- ? path.join(os.homedir(), '.config', 'opencode', 'opencode.json')
46
- : path.join(workspacePath, 'opencode.json');
47
- const config = await readJsonConfig(filePath);
48
- config.mcp = servers;
49
- await writeJsonConfig(filePath, config);
50
- }
51
-
52
- protected buildServerConfig(input: UpsertProviderMcpServerInput): Record<string, unknown> {
53
- if (input.transport === 'stdio') {
54
- if (!input.command?.trim()) {
55
- throw new AppError('command is required for stdio MCP servers.', {
56
- code: 'MCP_COMMAND_REQUIRED',
57
- statusCode: 400,
58
- });
59
- }
60
- return {
61
- type: 'local',
62
- command: input.command,
63
- args: input.args ?? [],
64
- env: input.env ?? {},
65
- cwd: input.cwd,
66
- enabled: true,
67
- };
68
- }
69
-
70
- if (!input.url?.trim()) {
71
- throw new AppError('url is required for http/sse MCP servers.', {
72
- code: 'MCP_URL_REQUIRED',
73
- statusCode: 400,
74
- });
75
- }
76
-
77
- return {
78
- type: 'remote',
79
- url: input.url,
80
- headers: input.headers ?? {},
81
- enabled: true,
82
- };
83
- }
84
-
85
- protected normalizeServerConfig(
86
- scope: McpScope,
87
- name: string,
88
- rawConfig: unknown,
89
- ): ProviderMcpServer | null {
90
- if (!rawConfig || typeof rawConfig !== 'object') {
91
- return null;
92
- }
93
-
94
- const config = rawConfig as Record<string, unknown>;
95
- const opencodeType = readOptionalString(config.type);
96
-
97
- // Local (stdio) entries — either type: "local" explicitly or any entry
98
- // with a command field (pre-type schemas).
99
- if (opencodeType === 'local' || typeof config.command === 'string') {
100
- return {
101
- provider: 'opencode',
102
- name,
103
- scope,
104
- transport: 'stdio',
105
- command: typeof config.command === 'string' ? config.command : '',
106
- args: readStringArray(config.args),
107
- env: readStringRecord(config.env),
108
- cwd: readOptionalString(config.cwd),
109
- };
110
- }
111
-
112
- // Remote entries — type: "remote" or any entry with a url field.
113
- if (opencodeType === 'remote' || typeof config.url === 'string') {
114
- return {
115
- provider: 'opencode',
116
- name,
117
- scope,
118
- transport: 'http',
119
- url: typeof config.url === 'string' ? config.url : '',
120
- headers: readStringRecord(config.headers),
121
- };
122
- }
123
-
124
- return null;
125
- }
126
- }
1
+ import os from 'node:os';
2
+ import path from 'node:path';
3
+
4
+ import { McpProvider } from '@/modules/providers/shared/mcp/mcp.provider.js';
5
+ import type { McpScope, ProviderMcpServer, UpsertProviderMcpServerInput } from '@/shared/types.js';
6
+ import {
7
+ AppError,
8
+ readJsonConfig,
9
+ readObjectRecord,
10
+ readOptionalString,
11
+ readStringArray,
12
+ readStringRecord,
13
+ writeJsonConfig,
14
+ } from '@/shared/utils.js';
15
+
16
+ /**
17
+ * OpenCode MCP provider.
18
+ *
19
+ * OpenCode's MCP servers live under the top-level `mcp` key in
20
+ * `opencode.json` (global at `~/.config/opencode/opencode.json`, project at
21
+ * `<workspace>/opencode.json`). Each entry is either a local stdio command
22
+ * (`{ command, args, env }`) or a remote server (`{ type: "remote", url,
23
+ * headers, enabled }`). OpenCode's schema also supports an `enabled: false`
24
+ * flag we preserve on write but don't surface in the UI yet.
25
+ */
26
+ export class OpencodeMcpProvider extends McpProvider {
27
+ constructor() {
28
+ super('opencode', ['user', 'project'], ['stdio', 'http', 'sse']);
29
+ }
30
+
31
+ protected async readScopedServers(scope: McpScope, workspacePath: string): Promise<Record<string, unknown>> {
32
+ const filePath = scope === 'user'
33
+ ? path.join(os.homedir(), '.config', 'opencode', 'opencode.json')
34
+ : path.join(workspacePath, 'opencode.json');
35
+ const config = await readJsonConfig(filePath);
36
+ return readObjectRecord(config.mcp) ?? {};
37
+ }
38
+
39
+ protected async writeScopedServers(
40
+ scope: McpScope,
41
+ workspacePath: string,
42
+ servers: Record<string, unknown>,
43
+ ): Promise<void> {
44
+ const filePath = scope === 'user'
45
+ ? path.join(os.homedir(), '.config', 'opencode', 'opencode.json')
46
+ : path.join(workspacePath, 'opencode.json');
47
+ const config = await readJsonConfig(filePath);
48
+ config.mcp = servers;
49
+ await writeJsonConfig(filePath, config);
50
+ }
51
+
52
+ protected buildServerConfig(input: UpsertProviderMcpServerInput): Record<string, unknown> {
53
+ if (input.transport === 'stdio') {
54
+ if (!input.command?.trim()) {
55
+ throw new AppError('command is required for stdio MCP servers.', {
56
+ code: 'MCP_COMMAND_REQUIRED',
57
+ statusCode: 400,
58
+ });
59
+ }
60
+ return {
61
+ type: 'local',
62
+ command: input.command,
63
+ args: input.args ?? [],
64
+ env: input.env ?? {},
65
+ cwd: input.cwd,
66
+ enabled: true,
67
+ };
68
+ }
69
+
70
+ if (!input.url?.trim()) {
71
+ throw new AppError('url is required for http/sse MCP servers.', {
72
+ code: 'MCP_URL_REQUIRED',
73
+ statusCode: 400,
74
+ });
75
+ }
76
+
77
+ return {
78
+ type: 'remote',
79
+ url: input.url,
80
+ headers: input.headers ?? {},
81
+ enabled: true,
82
+ };
83
+ }
84
+
85
+ protected normalizeServerConfig(
86
+ scope: McpScope,
87
+ name: string,
88
+ rawConfig: unknown,
89
+ ): ProviderMcpServer | null {
90
+ if (!rawConfig || typeof rawConfig !== 'object') {
91
+ return null;
92
+ }
93
+
94
+ const config = rawConfig as Record<string, unknown>;
95
+ const opencodeType = readOptionalString(config.type);
96
+
97
+ // Local (stdio) entries — either type: "local" explicitly or any entry
98
+ // with a command field (pre-type schemas).
99
+ if (opencodeType === 'local' || typeof config.command === 'string') {
100
+ return {
101
+ provider: 'opencode',
102
+ name,
103
+ scope,
104
+ transport: 'stdio',
105
+ command: typeof config.command === 'string' ? config.command : '',
106
+ args: readStringArray(config.args),
107
+ env: readStringRecord(config.env),
108
+ cwd: readOptionalString(config.cwd),
109
+ };
110
+ }
111
+
112
+ // Remote entries — type: "remote" or any entry with a url field.
113
+ if (opencodeType === 'remote' || typeof config.url === 'string') {
114
+ return {
115
+ provider: 'opencode',
116
+ name,
117
+ scope,
118
+ transport: 'http',
119
+ url: typeof config.url === 'string' ? config.url : '',
120
+ headers: readStringRecord(config.headers),
121
+ };
122
+ }
123
+
124
+ return null;
125
+ }
126
+ }