@pixelbyte-software/pixcode 1.33.10 → 1.34.0

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 (75) hide show
  1. package/dist/api-docs.html +395 -395
  2. package/dist/assets/{index-B_dU5AHA.js → index-BvClqlMf.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/index.js +4 -0
  17. package/dist-server/server/index.js.map +1 -1
  18. package/dist-server/server/modules/orchestration/a2a/adapter-registry.js +47 -0
  19. package/dist-server/server/modules/orchestration/a2a/adapter-registry.js.map +1 -0
  20. package/dist-server/server/modules/orchestration/a2a/adapters/abstract-a2a.adapter.js +17 -0
  21. package/dist-server/server/modules/orchestration/a2a/adapters/abstract-a2a.adapter.js.map +1 -0
  22. package/dist-server/server/modules/orchestration/a2a/adapters/claude-code.adapter.js +233 -0
  23. package/dist-server/server/modules/orchestration/a2a/adapters/claude-code.adapter.js.map +1 -0
  24. package/dist-server/server/modules/orchestration/a2a/agent-card.js +50 -0
  25. package/dist-server/server/modules/orchestration/a2a/agent-card.js.map +1 -0
  26. package/dist-server/server/modules/orchestration/a2a/auth.middleware.js +25 -0
  27. package/dist-server/server/modules/orchestration/a2a/auth.middleware.js.map +1 -0
  28. package/dist-server/server/modules/orchestration/a2a/bus.js +34 -0
  29. package/dist-server/server/modules/orchestration/a2a/bus.js.map +1 -0
  30. package/dist-server/server/modules/orchestration/a2a/routes.js +233 -0
  31. package/dist-server/server/modules/orchestration/a2a/routes.js.map +1 -0
  32. package/dist-server/server/modules/orchestration/a2a/types.js +6 -0
  33. package/dist-server/server/modules/orchestration/a2a/types.js.map +1 -0
  34. package/dist-server/server/modules/orchestration/a2a/validator.js +85 -0
  35. package/dist-server/server/modules/orchestration/a2a/validator.js.map +1 -0
  36. package/dist-server/server/modules/orchestration/index.js +10 -0
  37. package/dist-server/server/modules/orchestration/index.js.map +1 -0
  38. package/dist-server/server/opencode-cli.js +4 -1
  39. package/dist-server/server/opencode-cli.js.map +1 -1
  40. package/package.json +178 -178
  41. package/scripts/smoke/a2a-roundtrip.mjs +98 -0
  42. package/server/database/db.js +794 -794
  43. package/server/database/json-store.js +194 -194
  44. package/server/index.js +9 -0
  45. package/server/modules/orchestration/a2a/adapter-registry.ts +58 -0
  46. package/server/modules/orchestration/a2a/adapters/abstract-a2a.adapter.ts +49 -0
  47. package/server/modules/orchestration/a2a/adapters/claude-code.adapter.ts +283 -0
  48. package/server/modules/orchestration/a2a/agent-card.ts +55 -0
  49. package/server/modules/orchestration/a2a/auth.middleware.ts +29 -0
  50. package/server/modules/orchestration/a2a/bus.ts +46 -0
  51. package/server/modules/orchestration/a2a/routes.ts +264 -0
  52. package/server/modules/orchestration/a2a/types.ts +111 -0
  53. package/server/modules/orchestration/a2a/validator.ts +90 -0
  54. package/server/modules/orchestration/index.ts +26 -0
  55. package/server/modules/providers/list/opencode/opencode-auth.provider.ts +130 -130
  56. package/server/modules/providers/list/opencode/opencode-mcp.provider.ts +126 -126
  57. package/server/modules/providers/list/opencode/opencode-sessions.provider.ts +232 -232
  58. package/server/modules/providers/list/opencode/opencode.provider.ts +29 -29
  59. package/server/modules/providers/list/qwen/qwen-auth.provider.ts +145 -145
  60. package/server/modules/providers/list/qwen/qwen-mcp.provider.ts +114 -114
  61. package/server/modules/providers/list/qwen/qwen-sessions.provider.ts +265 -265
  62. package/server/modules/providers/list/qwen/qwen.provider.ts +21 -21
  63. package/server/modules/providers/shared/provider-configs.ts +142 -142
  64. package/server/opencode-cli.js +4 -1
  65. package/server/opencode-response-handler.js +107 -107
  66. package/server/qwen-code-cli.js +395 -395
  67. package/server/qwen-response-handler.js +73 -73
  68. package/server/routes/qwen.js +27 -27
  69. package/server/services/external-access.js +171 -171
  70. package/server/services/provider-credentials.js +189 -189
  71. package/server/services/provider-models.js +381 -381
  72. package/server/services/telegram/telegram-http-client.js +130 -130
  73. package/server/services/vapid-keys.js +36 -36
  74. package/server/utils/port-access.js +209 -209
  75. 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
+ }