@openacp/cli 2026.331.1 → 2026.331.2

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 (181) hide show
  1. package/README.md +2 -1
  2. package/dist/cli.js +24932 -270
  3. package/dist/cli.js.map +1 -1
  4. package/dist/data/registry-snapshot.json +1 -1
  5. package/dist/index.js +17626 -409
  6. package/dist/index.js.map +1 -1
  7. package/package.json +2 -2
  8. package/dist/adapter-ELG3VRZ3.js +0 -14
  9. package/dist/adapter-ELG3VRZ3.js.map +0 -1
  10. package/dist/agent-catalog-UYD26QDK.js +0 -10
  11. package/dist/agent-catalog-UYD26QDK.js.map +0 -1
  12. package/dist/agent-dependencies-ED2ZTUHG.js +0 -23
  13. package/dist/agent-dependencies-ED2ZTUHG.js.map +0 -1
  14. package/dist/agent-registry-YOGP656W.js +0 -8
  15. package/dist/agent-registry-YOGP656W.js.map +0 -1
  16. package/dist/agent-store-5UHZH2XI.js +0 -8
  17. package/dist/agent-store-5UHZH2XI.js.map +0 -1
  18. package/dist/api-client-PEMHYL5U.js +0 -13
  19. package/dist/api-client-PEMHYL5U.js.map +0 -1
  20. package/dist/api-server-DATG2KBR.js +0 -10
  21. package/dist/api-server-DATG2KBR.js.map +0 -1
  22. package/dist/api-server-L5Z7XACW.js +0 -7
  23. package/dist/api-server-L5Z7XACW.js.map +0 -1
  24. package/dist/autostart-CUPZMKKC.js +0 -22
  25. package/dist/autostart-CUPZMKKC.js.map +0 -1
  26. package/dist/chunk-23SRIVG4.js +0 -50
  27. package/dist/chunk-23SRIVG4.js.map +0 -1
  28. package/dist/chunk-2KT6TROD.js +0 -129
  29. package/dist/chunk-2KT6TROD.js.map +0 -1
  30. package/dist/chunk-2R5XM3ES.js +0 -154
  31. package/dist/chunk-2R5XM3ES.js.map +0 -1
  32. package/dist/chunk-3EWTPOF7.js +0 -51
  33. package/dist/chunk-3EWTPOF7.js.map +0 -1
  34. package/dist/chunk-566W6INH.js +0 -83
  35. package/dist/chunk-566W6INH.js.map +0 -1
  36. package/dist/chunk-5WGVYX3C.js +0 -55
  37. package/dist/chunk-5WGVYX3C.js.map +0 -1
  38. package/dist/chunk-7GXEMMEV.js +0 -44
  39. package/dist/chunk-7GXEMMEV.js.map +0 -1
  40. package/dist/chunk-7U6IZIJP.js +0 -186
  41. package/dist/chunk-7U6IZIJP.js.map +0 -1
  42. package/dist/chunk-7YIKTRSM.js +0 -105
  43. package/dist/chunk-7YIKTRSM.js.map +0 -1
  44. package/dist/chunk-7ZCQF6QM.js +0 -27
  45. package/dist/chunk-7ZCQF6QM.js.map +0 -1
  46. package/dist/chunk-AFKX424Q.js +0 -92
  47. package/dist/chunk-AFKX424Q.js.map +0 -1
  48. package/dist/chunk-BYCJQPMN.js +0 -543
  49. package/dist/chunk-BYCJQPMN.js.map +0 -1
  50. package/dist/chunk-CDAUYTVP.js +0 -41
  51. package/dist/chunk-CDAUYTVP.js.map +0 -1
  52. package/dist/chunk-EWVXSTQK.js +0 -6544
  53. package/dist/chunk-EWVXSTQK.js.map +0 -1
  54. package/dist/chunk-FNRSWA2K.js +0 -1
  55. package/dist/chunk-FNRSWA2K.js.map +0 -1
  56. package/dist/chunk-FPKQYCQS.js +0 -776
  57. package/dist/chunk-FPKQYCQS.js.map +0 -1
  58. package/dist/chunk-IZ5UEZF7.js +0 -138
  59. package/dist/chunk-IZ5UEZF7.js.map +0 -1
  60. package/dist/chunk-K6UY5M75.js +0 -653
  61. package/dist/chunk-K6UY5M75.js.map +0 -1
  62. package/dist/chunk-KGAQW6F4.js +0 -106
  63. package/dist/chunk-KGAQW6F4.js.map +0 -1
  64. package/dist/chunk-LGFWH3AE.js +0 -26
  65. package/dist/chunk-LGFWH3AE.js.map +0 -1
  66. package/dist/chunk-LRV56K2M.js +0 -4106
  67. package/dist/chunk-LRV56K2M.js.map +0 -1
  68. package/dist/chunk-MDJHCCFS.js +0 -485
  69. package/dist/chunk-MDJHCCFS.js.map +0 -1
  70. package/dist/chunk-MLF4W5R6.js +0 -101
  71. package/dist/chunk-MLF4W5R6.js.map +0 -1
  72. package/dist/chunk-NHD5XDD2.js +0 -686
  73. package/dist/chunk-NHD5XDD2.js.map +0 -1
  74. package/dist/chunk-NJX75BLK.js +0 -259
  75. package/dist/chunk-NJX75BLK.js.map +0 -1
  76. package/dist/chunk-NOEAJNTK.js +0 -156
  77. package/dist/chunk-NOEAJNTK.js.map +0 -1
  78. package/dist/chunk-ON7HB5O7.js +0 -58
  79. package/dist/chunk-ON7HB5O7.js.map +0 -1
  80. package/dist/chunk-OSBZXY2W.js +0 -126
  81. package/dist/chunk-OSBZXY2W.js.map +0 -1
  82. package/dist/chunk-OYSAN7UX.js +0 -15
  83. package/dist/chunk-OYSAN7UX.js.map +0 -1
  84. package/dist/chunk-P3HHJANC.js +0 -209
  85. package/dist/chunk-P3HHJANC.js.map +0 -1
  86. package/dist/chunk-R2YLDQLI.js +0 -1115
  87. package/dist/chunk-R2YLDQLI.js.map +0 -1
  88. package/dist/chunk-R6KZYF7D.js +0 -231
  89. package/dist/chunk-R6KZYF7D.js.map +0 -1
  90. package/dist/chunk-S64CB6J3.js +0 -98
  91. package/dist/chunk-S64CB6J3.js.map +0 -1
  92. package/dist/chunk-SSLVNCEA.js +0 -236
  93. package/dist/chunk-SSLVNCEA.js.map +0 -1
  94. package/dist/chunk-TGP34LQN.js +0 -681
  95. package/dist/chunk-TGP34LQN.js.map +0 -1
  96. package/dist/chunk-VUSCVRJL.js +0 -229
  97. package/dist/chunk-VUSCVRJL.js.map +0 -1
  98. package/dist/chunk-W26AUH5B.js +0 -61
  99. package/dist/chunk-W26AUH5B.js.map +0 -1
  100. package/dist/chunk-WQCJTU2C.js +0 -84
  101. package/dist/chunk-WQCJTU2C.js.map +0 -1
  102. package/dist/chunk-XRJUS6FE.js +0 -53
  103. package/dist/chunk-XRJUS6FE.js.map +0 -1
  104. package/dist/chunk-YZCKSNRN.js +0 -453
  105. package/dist/chunk-YZCKSNRN.js.map +0 -1
  106. package/dist/chunk-ZIRH6QWW.js +0 -69
  107. package/dist/chunk-ZIRH6QWW.js.map +0 -1
  108. package/dist/chunk-ZSLHHQPQ.js +0 -282
  109. package/dist/chunk-ZSLHHQPQ.js.map +0 -1
  110. package/dist/config-X4UP7H6R.js +0 -13
  111. package/dist/config-X4UP7H6R.js.map +0 -1
  112. package/dist/config-editor-7BENRVG5.js +0 -11
  113. package/dist/config-editor-7BENRVG5.js.map +0 -1
  114. package/dist/config-registry-M3FFWEVM.js +0 -18
  115. package/dist/config-registry-M3FFWEVM.js.map +0 -1
  116. package/dist/context-FVGCU5TI.js +0 -9
  117. package/dist/context-FVGCU5TI.js.map +0 -1
  118. package/dist/core-plugins-JSY2I44L.js +0 -25
  119. package/dist/core-plugins-JSY2I44L.js.map +0 -1
  120. package/dist/daemon-UOSRDEXW.js +0 -34
  121. package/dist/daemon-UOSRDEXW.js.map +0 -1
  122. package/dist/dev-loader-7P3HZCIA.js +0 -37
  123. package/dist/dev-loader-7P3HZCIA.js.map +0 -1
  124. package/dist/doctor-6DLACBR4.js +0 -10
  125. package/dist/doctor-6DLACBR4.js.map +0 -1
  126. package/dist/file-service-FQQYME7M.js +0 -8
  127. package/dist/file-service-FQQYME7M.js.map +0 -1
  128. package/dist/install-cloudflared-LNS5L5FR.js +0 -33
  129. package/dist/install-cloudflared-LNS5L5FR.js.map +0 -1
  130. package/dist/install-context-KZO5FR4D.js +0 -78
  131. package/dist/install-context-KZO5FR4D.js.map +0 -1
  132. package/dist/install-jq-SN4IA5K4.js +0 -31
  133. package/dist/install-jq-SN4IA5K4.js.map +0 -1
  134. package/dist/instance-context-FLCE7VZ4.js +0 -13
  135. package/dist/instance-context-FLCE7VZ4.js.map +0 -1
  136. package/dist/instance-registry-SW5FWKHO.js +0 -7
  137. package/dist/instance-registry-SW5FWKHO.js.map +0 -1
  138. package/dist/integrate-JIEZYDOR.js +0 -371
  139. package/dist/integrate-JIEZYDOR.js.map +0 -1
  140. package/dist/log-YZ243M5G.js +0 -25
  141. package/dist/log-YZ243M5G.js.map +0 -1
  142. package/dist/main-D7M2AKRM.js +0 -697
  143. package/dist/main-D7M2AKRM.js.map +0 -1
  144. package/dist/menu-ALFN37IR.js +0 -15
  145. package/dist/menu-ALFN37IR.js.map +0 -1
  146. package/dist/notifications-MO23S7S3.js +0 -8
  147. package/dist/notifications-MO23S7S3.js.map +0 -1
  148. package/dist/plugin-create-HFKS23JY.js +0 -968
  149. package/dist/plugin-create-HFKS23JY.js.map +0 -1
  150. package/dist/plugin-installer-VSTYZSXC.js +0 -9
  151. package/dist/plugin-installer-VSTYZSXC.js.map +0 -1
  152. package/dist/plugin-registry-6J3YSFHF.js +0 -7
  153. package/dist/plugin-registry-6J3YSFHF.js.map +0 -1
  154. package/dist/plugin-search-MGKAL5JM.js +0 -39
  155. package/dist/plugin-search-MGKAL5JM.js.map +0 -1
  156. package/dist/post-upgrade-F4YPMTUT.js +0 -79
  157. package/dist/post-upgrade-F4YPMTUT.js.map +0 -1
  158. package/dist/read-text-file-DJBTITIB.js +0 -7
  159. package/dist/read-text-file-DJBTITIB.js.map +0 -1
  160. package/dist/registry-client-GTBWLXYU.js +0 -7
  161. package/dist/registry-client-GTBWLXYU.js.map +0 -1
  162. package/dist/security-O4XGN2CM.js +0 -8
  163. package/dist/security-O4XGN2CM.js.map +0 -1
  164. package/dist/settings-manager-B4UN2LAC.js +0 -7
  165. package/dist/settings-manager-B4UN2LAC.js.map +0 -1
  166. package/dist/setup-44WLBIOT.js +0 -989
  167. package/dist/setup-44WLBIOT.js.map +0 -1
  168. package/dist/speech-GHTSWDAN.js +0 -9
  169. package/dist/speech-GHTSWDAN.js.map +0 -1
  170. package/dist/suggest-RST5VOHB.js +0 -36
  171. package/dist/suggest-RST5VOHB.js.map +0 -1
  172. package/dist/telegram-D7ASLVEB.js +0 -7
  173. package/dist/telegram-D7ASLVEB.js.map +0 -1
  174. package/dist/tunnel-ALJDPFDQ.js +0 -10
  175. package/dist/tunnel-ALJDPFDQ.js.map +0 -1
  176. package/dist/tunnel-service-TBAHDXMF.js +0 -755
  177. package/dist/tunnel-service-TBAHDXMF.js.map +0 -1
  178. package/dist/validators-GITLOFXC.js +0 -11
  179. package/dist/validators-GITLOFXC.js.map +0 -1
  180. package/dist/version-AXXV6IV2.js +0 -15
  181. package/dist/version-AXXV6IV2.js.map +0 -1
@@ -1,83 +0,0 @@
1
- import {
2
- createChildLogger
3
- } from "./chunk-R6KZYF7D.js";
4
-
5
- // src/core/agents/agent-store.ts
6
- import * as fs from "fs";
7
- import * as path from "path";
8
- import * as os from "os";
9
- import { z } from "zod";
10
- var log = createChildLogger({ module: "agent-store" });
11
- var InstalledAgentSchema = z.object({
12
- registryId: z.string().nullable(),
13
- name: z.string(),
14
- version: z.string(),
15
- distribution: z.enum(["npx", "uvx", "binary", "custom"]),
16
- command: z.string(),
17
- args: z.array(z.string()).default([]),
18
- env: z.record(z.string(), z.string()).default({}),
19
- workingDirectory: z.string().optional(),
20
- installedAt: z.string(),
21
- binaryPath: z.string().nullable().default(null)
22
- });
23
- var AgentStoreSchema = z.object({
24
- version: z.number().default(1),
25
- installed: z.record(z.string(), InstalledAgentSchema).default({})
26
- });
27
- var AgentStore = class {
28
- data = { version: 1, installed: {} };
29
- filePath;
30
- constructor(filePath) {
31
- this.filePath = filePath ?? path.join(os.homedir(), ".openacp", "agents.json");
32
- }
33
- load() {
34
- fs.mkdirSync(path.dirname(this.filePath), { recursive: true });
35
- if (!fs.existsSync(this.filePath)) {
36
- this.data = { version: 1, installed: {} };
37
- return;
38
- }
39
- try {
40
- const raw = JSON.parse(fs.readFileSync(this.filePath, "utf-8"));
41
- const result = AgentStoreSchema.safeParse(raw);
42
- if (result.success) {
43
- this.data = result.data;
44
- } else {
45
- log.warn({ errors: result.error.issues }, "Invalid agents.json, starting fresh");
46
- this.data = { version: 1, installed: {} };
47
- }
48
- } catch (err) {
49
- log.warn({ err }, "Failed to read agents.json, starting fresh");
50
- this.data = { version: 1, installed: {} };
51
- }
52
- }
53
- exists() {
54
- return fs.existsSync(this.filePath);
55
- }
56
- getInstalled() {
57
- return this.data.installed;
58
- }
59
- getAgent(key) {
60
- return this.data.installed[key];
61
- }
62
- addAgent(key, agent) {
63
- this.data.installed[key] = agent;
64
- this.save();
65
- }
66
- removeAgent(key) {
67
- delete this.data.installed[key];
68
- this.save();
69
- }
70
- hasAgent(key) {
71
- return key in this.data.installed;
72
- }
73
- save() {
74
- const tmpPath = this.filePath + ".tmp";
75
- fs.writeFileSync(tmpPath, JSON.stringify(this.data, null, 2));
76
- fs.renameSync(tmpPath, this.filePath);
77
- }
78
- };
79
-
80
- export {
81
- AgentStore
82
- };
83
- //# sourceMappingURL=chunk-566W6INH.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/core/agents/agent-store.ts"],"sourcesContent":["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport * as os from \"node:os\";\nimport { z } from \"zod\";\nimport type { InstalledAgent } from \"../types.js\";\nimport { createChildLogger } from \"../utils/log.js\";\n\nconst log = createChildLogger({ module: \"agent-store\" });\n\nconst InstalledAgentSchema = z.object({\n registryId: z.string().nullable(),\n name: z.string(),\n version: z.string(),\n distribution: z.enum([\"npx\", \"uvx\", \"binary\", \"custom\"]),\n command: z.string(),\n args: z.array(z.string()).default([]),\n env: z.record(z.string(), z.string()).default({}),\n workingDirectory: z.string().optional(),\n installedAt: z.string(),\n binaryPath: z.string().nullable().default(null),\n});\n\nconst AgentStoreSchema = z.object({\n version: z.number().default(1),\n installed: z.record(z.string(), InstalledAgentSchema).default({}),\n});\n\ntype AgentStoreData = z.infer<typeof AgentStoreSchema>;\n\nexport class AgentStore {\n private data: AgentStoreData = { version: 1, installed: {} };\n private filePath: string;\n\n constructor(filePath?: string) {\n this.filePath = filePath ?? path.join(os.homedir(), \".openacp\", \"agents.json\");\n }\n\n load(): void {\n fs.mkdirSync(path.dirname(this.filePath), { recursive: true });\n\n if (!fs.existsSync(this.filePath)) {\n this.data = { version: 1, installed: {} };\n return;\n }\n\n try {\n const raw = JSON.parse(fs.readFileSync(this.filePath, \"utf-8\") as string);\n const result = AgentStoreSchema.safeParse(raw);\n if (result.success) {\n this.data = result.data;\n } else {\n log.warn({ errors: result.error.issues }, \"Invalid agents.json, starting fresh\");\n this.data = { version: 1, installed: {} };\n }\n } catch (err) {\n log.warn({ err }, \"Failed to read agents.json, starting fresh\");\n this.data = { version: 1, installed: {} };\n }\n }\n\n exists(): boolean {\n return fs.existsSync(this.filePath);\n }\n\n getInstalled(): Record<string, InstalledAgent> {\n return this.data.installed;\n }\n\n getAgent(key: string): InstalledAgent | undefined {\n return this.data.installed[key];\n }\n\n addAgent(key: string, agent: InstalledAgent): void {\n this.data.installed[key] = agent;\n this.save();\n }\n\n removeAgent(key: string): void {\n delete this.data.installed[key];\n this.save();\n }\n\n hasAgent(key: string): boolean {\n return key in this.data.installed;\n }\n\n private save(): void {\n const tmpPath = this.filePath + \".tmp\";\n fs.writeFileSync(tmpPath, JSON.stringify(this.data, null, 2));\n fs.renameSync(tmpPath, this.filePath);\n }\n}\n"],"mappings":";;;;;AAAA,YAAY,QAAQ;AACpB,YAAY,UAAU;AACtB,YAAY,QAAQ;AACpB,SAAS,SAAS;AAIlB,IAAM,MAAM,kBAAkB,EAAE,QAAQ,cAAc,CAAC;AAEvD,IAAM,uBAAuB,EAAE,OAAO;AAAA,EACpC,YAAY,EAAE,OAAO,EAAE,SAAS;AAAA,EAChC,MAAM,EAAE,OAAO;AAAA,EACf,SAAS,EAAE,OAAO;AAAA,EAClB,cAAc,EAAE,KAAK,CAAC,OAAO,OAAO,UAAU,QAAQ,CAAC;AAAA,EACvD,SAAS,EAAE,OAAO;AAAA,EAClB,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,CAAC;AAAA,EACpC,KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,CAAC;AAAA,EAChD,kBAAkB,EAAE,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AAO,KAAK,KAAK;AAAA,EACnB;AAAA,EAEA,SAAS,KAAyC;AAChD,WAAO,KAAK,KAAK,UAAU,GAAG;AAAA,EAChC;AAAA,EAEA,SAAS,KAAa,OAA6B;AACjD,SAAK,KAAK,UAAU,GAAG,IAAI;AAC3B,SAAK,KAAK;AAAA,EACZ;AAAA,EAEA,YAAY,KAAmB;AAC7B,WAAO,KAAK,KAAK,UAAU,GAAG;AAC9B,SAAK,KAAK;AAAA,EACZ;AAAA,EAEA,SAAS,KAAsB;AAC7B,WAAO,OAAO,KAAK,KAAK;AAAA,EAC1B;AAAA,EAEQ,OAAa;AACnB,UAAM,UAAU,KAAK,WAAW;AAChC,IAAG,iBAAc,SAAS,KAAK,UAAU,KAAK,MAAM,MAAM,CAAC,CAAC;AAC5D,IAAG,cAAW,SAAS,KAAK,QAAQ;AAAA,EACtC;AACF;","names":[]}
@@ -1,55 +0,0 @@
1
- // src/core/plugin/plugin-installer.ts
2
- import { exec } from "child_process";
3
- import { promisify } from "util";
4
- import * as fs from "fs/promises";
5
- import * as os from "os";
6
- import * as path from "path";
7
- import { pathToFileURL } from "url";
8
- var execAsync = promisify(exec);
9
- async function importFromDir(packageName, dir) {
10
- const pkgDir = path.join(dir, "node_modules", ...packageName.split("/"));
11
- const pkgJsonPath = path.join(pkgDir, "package.json");
12
- let pkgJson;
13
- try {
14
- pkgJson = JSON.parse(await fs.readFile(pkgJsonPath, "utf-8"));
15
- } catch (err) {
16
- throw new Error(`Cannot read package.json for "${packageName}" at ${pkgJsonPath}: ${err.message}`);
17
- }
18
- let entry;
19
- const exportsMain = pkgJson.exports?.["."];
20
- if (typeof exportsMain === "string") {
21
- entry = exportsMain;
22
- } else if (exportsMain?.import) {
23
- entry = exportsMain.import;
24
- } else {
25
- entry = pkgJson.main ?? "index.js";
26
- }
27
- const entryPath = path.join(pkgDir, entry);
28
- try {
29
- await fs.access(entryPath);
30
- } catch {
31
- throw new Error(`Entry point "${entry}" not found for "${packageName}" at ${entryPath}`);
32
- }
33
- return import(pathToFileURL(entryPath).href);
34
- }
35
- var VALID_NPM_NAME = /^(@[a-z0-9][\w.-]*\/)?[a-z0-9][\w.-]*(@[\w.^~>=<|-]+)?$/i;
36
- async function installNpmPlugin(packageName, pluginsDir) {
37
- if (!VALID_NPM_NAME.test(packageName)) {
38
- throw new Error(`Invalid package name: "${packageName}". Must be a valid npm package name.`);
39
- }
40
- const dir = pluginsDir ?? path.join(os.homedir(), ".openacp", "plugins");
41
- try {
42
- return await importFromDir(packageName, dir);
43
- } catch {
44
- }
45
- await execAsync(`npm install ${packageName} --prefix "${dir}" --save`, {
46
- timeout: 6e4
47
- });
48
- return await importFromDir(packageName, dir);
49
- }
50
-
51
- export {
52
- importFromDir,
53
- installNpmPlugin
54
- };
55
- //# sourceMappingURL=chunk-5WGVYX3C.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/core/plugin/plugin-installer.ts"],"sourcesContent":["import { exec } from 'node:child_process'\nimport { promisify } from 'node:util'\nimport * as fs from 'node:fs/promises'\nimport * as os from 'node:os'\nimport * as path from 'node:path'\nimport { pathToFileURL } from 'node:url'\n\nconst execAsync = promisify(exec)\n\n/**\n * Import a package resolved from a specific directory (not the project root).\n * Reads the package's package.json to find the ESM entry point, then imports by file path.\n */\nexport async function importFromDir(packageName: string, dir: string): Promise<any> {\n const pkgDir = path.join(dir, 'node_modules', ...packageName.split('/'))\n const pkgJsonPath = path.join(pkgDir, 'package.json')\n\n let pkgJson: Record<string, any>\n try {\n pkgJson = JSON.parse(await fs.readFile(pkgJsonPath, 'utf-8'))\n } catch (err) {\n throw new Error(`Cannot read package.json for \"${packageName}\" at ${pkgJsonPath}: ${(err as Error).message}`)\n }\n\n // Resolve entry: exports[\".\"].import > main > index.js\n let entry: string\n const exportsMain = pkgJson.exports?.['.']\n if (typeof exportsMain === 'string') {\n entry = exportsMain\n } else if (exportsMain?.import) {\n entry = exportsMain.import\n } else {\n entry = pkgJson.main ?? 'index.js'\n }\n\n const entryPath = path.join(pkgDir, entry)\n try {\n await fs.access(entryPath)\n } catch {\n throw new Error(`Entry point \"${entry}\" not found for \"${packageName}\" at ${entryPath}`)\n }\n\n return import(pathToFileURL(entryPath).href)\n}\n\n/** Valid npm package name: optional @scope/, alphanumeric/hyphens/dots, optional @version */\nconst VALID_NPM_NAME = /^(@[a-z0-9][\\w.-]*\\/)?[a-z0-9][\\w.-]*(@[\\w.^~>=<|-]+)?$/i;\n\n/**\n * Install an npm package to the plugins directory and return the loaded module.\n * Tries to import first; if not installed, runs npm install asynchronously.\n */\nexport async function installNpmPlugin(packageName: string, pluginsDir?: string): Promise<any> {\n if (!VALID_NPM_NAME.test(packageName)) {\n throw new Error(`Invalid package name: \"${packageName}\". Must be a valid npm package name.`);\n }\n\n const dir = pluginsDir ?? path.join(os.homedir(), '.openacp', 'plugins')\n\n // Try import from plugins dir first — already installed\n try {\n return await importFromDir(packageName, dir)\n } catch {\n // Not installed, proceed with install\n }\n\n await execAsync(`npm install ${packageName} --prefix \"${dir}\" --save`, {\n timeout: 60000,\n })\n\n return await importFromDir(packageName, dir)\n}\n"],"mappings":";AAAA,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAC1B,YAAY,QAAQ;AACpB,YAAY,QAAQ;AACpB,YAAY,UAAU;AACtB,SAAS,qBAAqB;AAE9B,IAAM,YAAY,UAAU,IAAI;AAMhC,eAAsB,cAAc,aAAqB,KAA2B;AAClF,QAAM,SAAc,UAAK,KAAK,gBAAgB,GAAG,YAAY,MAAM,GAAG,CAAC;AACvE,QAAM,cAAmB,UAAK,QAAQ,cAAc;AAEpD,MAAI;AACJ,MAAI;AACF,cAAU,KAAK,MAAM,MAAS,YAAS,aAAa,OAAO,CAAC;AAAA,EAC9D,SAAS,KAAK;AACZ,UAAM,IAAI,MAAM,iCAAiC,WAAW,QAAQ,WAAW,KAAM,IAAc,OAAO,EAAE;AAAA,EAC9G;AAGA,MAAI;AACJ,QAAM,cAAc,QAAQ,UAAU,GAAG;AACzC,MAAI,OAAO,gBAAgB,UAAU;AACnC,YAAQ;AAAA,EACV,WAAW,aAAa,QAAQ;AAC9B,YAAQ,YAAY;AAAA,EACtB,OAAO;AACL,YAAQ,QAAQ,QAAQ;AAAA,EAC1B;AAEA,QAAM,YAAiB,UAAK,QAAQ,KAAK;AACzC,MAAI;AACF,UAAS,UAAO,SAAS;AAAA,EAC3B,QAAQ;AACN,UAAM,IAAI,MAAM,gBAAgB,KAAK,oBAAoB,WAAW,QAAQ,SAAS,EAAE;AAAA,EACzF;AAEA,SAAO,OAAO,cAAc,SAAS,EAAE;AACzC;AAGA,IAAM,iBAAiB;AAMvB,eAAsB,iBAAiB,aAAqB,YAAmC;AAC7F,MAAI,CAAC,eAAe,KAAK,WAAW,GAAG;AACrC,UAAM,IAAI,MAAM,0BAA0B,WAAW,sCAAsC;AAAA,EAC7F;AAEA,QAAM,MAAM,cAAmB,UAAQ,WAAQ,GAAG,YAAY,SAAS;AAGvE,MAAI;AACF,WAAO,MAAM,cAAc,aAAa,GAAG;AAAA,EAC7C,QAAQ;AAAA,EAER;AAEA,QAAM,UAAU,eAAe,WAAW,cAAc,GAAG,YAAY;AAAA,IACrE,SAAS;AAAA,EACX,CAAC;AAED,SAAO,MAAM,cAAc,aAAa,GAAG;AAC7C;","names":[]}
@@ -1,44 +0,0 @@
1
- import {
2
- api_server_default
3
- } from "./chunk-KGAQW6F4.js";
4
- import {
5
- telegram_default
6
- } from "./chunk-SSLVNCEA.js";
7
- import {
8
- tunnel_default
9
- } from "./chunk-P3HHJANC.js";
10
- import {
11
- file_service_default
12
- } from "./chunk-ZIRH6QWW.js";
13
- import {
14
- context_default
15
- } from "./chunk-FPKQYCQS.js";
16
- import {
17
- speech_default
18
- } from "./chunk-VUSCVRJL.js";
19
- import {
20
- notifications_default
21
- } from "./chunk-3EWTPOF7.js";
22
- import {
23
- security_default
24
- } from "./chunk-OSBZXY2W.js";
25
-
26
- // src/plugins/core-plugins.ts
27
- var corePlugins = [
28
- // Service plugins (no adapter dependencies)
29
- security_default,
30
- file_service_default,
31
- context_default,
32
- speech_default,
33
- notifications_default,
34
- // Infrastructure plugins
35
- tunnel_default,
36
- api_server_default,
37
- // Adapter plugins (depend on security, notifications, etc.)
38
- telegram_default
39
- ];
40
-
41
- export {
42
- corePlugins
43
- };
44
- //# sourceMappingURL=chunk-7GXEMMEV.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/plugins/core-plugins.ts"],"sourcesContent":["/**\n * All built-in plugins: services, infrastructure, and adapters.\n * Booted by LifecycleManager in dependency order.\n * Adapter plugins depend on service plugins, so they boot last.\n */\nimport securityPlugin from './security/index.js'\nimport fileServicePlugin from './file-service/index.js'\nimport contextPlugin from './context/index.js'\nimport speechPlugin from './speech/index.js'\nimport notificationsPlugin from './notifications/index.js'\nimport tunnelPlugin from './tunnel/index.js'\nimport apiServerPlugin from './api-server/index.js'\nimport telegramPlugin from './telegram/index.js'\n\nexport const corePlugins = [\n // Service plugins (no adapter dependencies)\n securityPlugin,\n fileServicePlugin,\n contextPlugin,\n speechPlugin,\n notificationsPlugin,\n // Infrastructure plugins\n tunnelPlugin,\n apiServerPlugin,\n // Adapter plugins (depend on security, notifications, etc.)\n telegramPlugin,\n]\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAcO,IAAM,cAAc;AAAA;AAAA,EAEzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA;AAAA,EAEA;AACF;","names":[]}
@@ -1,186 +0,0 @@
1
- import {
2
- expandHome
3
- } from "./chunk-YZCKSNRN.js";
4
-
5
- // src/cli/daemon.ts
6
- import { spawn } from "child_process";
7
- import * as fs from "fs";
8
- import * as path from "path";
9
- import * as os from "os";
10
- var DEFAULT_ROOT = path.join(os.homedir(), ".openacp");
11
- function getPidPath(root) {
12
- const base = root ?? DEFAULT_ROOT;
13
- return path.join(base, "openacp.pid");
14
- }
15
- function getLogDir(root) {
16
- const base = root ?? DEFAULT_ROOT;
17
- return path.join(base, "logs");
18
- }
19
- function getRunningMarker(root) {
20
- const base = root ?? DEFAULT_ROOT;
21
- return path.join(base, "running");
22
- }
23
- function writePidFile(pidPath, pid) {
24
- const dir = path.dirname(pidPath);
25
- fs.mkdirSync(dir, { recursive: true });
26
- fs.writeFileSync(pidPath, String(pid));
27
- }
28
- function readPidFile(pidPath) {
29
- try {
30
- const content = fs.readFileSync(pidPath, "utf-8").trim();
31
- const pid = parseInt(content, 10);
32
- return isNaN(pid) ? null : pid;
33
- } catch {
34
- return null;
35
- }
36
- }
37
- function removePidFile(pidPath) {
38
- try {
39
- fs.unlinkSync(pidPath);
40
- } catch {
41
- }
42
- }
43
- function isProcessRunning(pidPath) {
44
- const pid = readPidFile(pidPath);
45
- if (pid === null) return false;
46
- try {
47
- process.kill(pid, 0);
48
- return true;
49
- } catch {
50
- removePidFile(pidPath);
51
- return false;
52
- }
53
- }
54
- function getStatus(pidPath = getPidPath()) {
55
- const pid = readPidFile(pidPath);
56
- if (pid === null) return { running: false };
57
- try {
58
- process.kill(pid, 0);
59
- return { running: true, pid };
60
- } catch {
61
- removePidFile(pidPath);
62
- return { running: false };
63
- }
64
- }
65
- function startDaemon(pidPath = getPidPath(), logDir, instanceRoot) {
66
- markRunning(instanceRoot);
67
- if (isProcessRunning(pidPath)) {
68
- const pid = readPidFile(pidPath);
69
- return { error: `Already running (PID ${pid})` };
70
- }
71
- const resolvedLogDir = logDir ? expandHome(logDir) : getLogDir(instanceRoot);
72
- fs.mkdirSync(resolvedLogDir, { recursive: true });
73
- const logFile = path.join(resolvedLogDir, "openacp.log");
74
- const cliPath = path.resolve(process.argv[1]);
75
- const nodePath = process.execPath;
76
- const out = fs.openSync(logFile, "a");
77
- const err = fs.openSync(logFile, "a");
78
- const child = spawn(nodePath, [cliPath, "--daemon-child"], {
79
- detached: true,
80
- stdio: ["ignore", out, err],
81
- env: {
82
- ...process.env,
83
- ...instanceRoot ? { OPENACP_INSTANCE_ROOT: instanceRoot } : {}
84
- }
85
- });
86
- fs.closeSync(out);
87
- fs.closeSync(err);
88
- if (!child.pid) {
89
- return { error: "Failed to spawn daemon process" };
90
- }
91
- writePidFile(pidPath, child.pid);
92
- child.unref();
93
- return { pid: child.pid };
94
- }
95
- function sleep(ms) {
96
- return new Promise((resolve2) => setTimeout(resolve2, ms));
97
- }
98
- function isProcessAlive(pid) {
99
- try {
100
- process.kill(pid, 0);
101
- return "alive";
102
- } catch (e) {
103
- const err = e;
104
- if (err.code === "EPERM") return "eperm";
105
- return "dead";
106
- }
107
- }
108
- async function stopDaemon(pidPath = getPidPath(), instanceRoot) {
109
- const pid = readPidFile(pidPath);
110
- if (pid === null) return { stopped: false, error: "Not running (no PID file)" };
111
- const status = isProcessAlive(pid);
112
- if (status === "dead") {
113
- removePidFile(pidPath);
114
- return { stopped: false, error: "Not running (stale PID file removed)" };
115
- }
116
- if (status === "eperm") {
117
- removePidFile(pidPath);
118
- return { stopped: false, error: "PID belongs to another process (stale PID file removed)" };
119
- }
120
- try {
121
- process.kill(pid, "SIGTERM");
122
- } catch (e) {
123
- return { stopped: false, error: `Failed to stop: ${e.message}` };
124
- }
125
- clearRunning(instanceRoot);
126
- const POLL_INTERVAL = 100;
127
- const TIMEOUT = 5e3;
128
- const start = Date.now();
129
- while (Date.now() - start < TIMEOUT) {
130
- await sleep(POLL_INTERVAL);
131
- const s = isProcessAlive(pid);
132
- if (s === "dead" || s === "eperm") {
133
- removePidFile(pidPath);
134
- return { stopped: true, pid };
135
- }
136
- }
137
- try {
138
- process.kill(pid, "SIGKILL");
139
- } catch (e) {
140
- const err = e;
141
- if (err.code === "EPERM") {
142
- return { stopped: false, pid, error: "PID may have been reused by another process. Run `openacp status` to verify, or manually delete the PID file." };
143
- }
144
- }
145
- const killStart = Date.now();
146
- while (Date.now() - killStart < 1e3) {
147
- await sleep(POLL_INTERVAL);
148
- const s = isProcessAlive(pid);
149
- if (s === "dead" || s === "eperm") {
150
- removePidFile(pidPath);
151
- return { stopped: true, pid };
152
- }
153
- }
154
- return { stopped: false, pid, error: "Process did not exit after SIGKILL (possible uninterruptible I/O). PID file retained." };
155
- }
156
- function markRunning(root) {
157
- const marker = getRunningMarker(root);
158
- fs.mkdirSync(path.dirname(marker), { recursive: true });
159
- fs.writeFileSync(marker, "");
160
- }
161
- function clearRunning(root) {
162
- try {
163
- fs.unlinkSync(getRunningMarker(root));
164
- } catch {
165
- }
166
- }
167
- function shouldAutoStart(root) {
168
- return fs.existsSync(getRunningMarker(root));
169
- }
170
-
171
- export {
172
- getPidPath,
173
- getLogDir,
174
- getRunningMarker,
175
- writePidFile,
176
- readPidFile,
177
- removePidFile,
178
- isProcessRunning,
179
- getStatus,
180
- startDaemon,
181
- stopDaemon,
182
- markRunning,
183
- clearRunning,
184
- shouldAutoStart
185
- };
186
- //# sourceMappingURL=chunk-7U6IZIJP.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/cli/daemon.ts"],"sourcesContent":["import { spawn } from 'node:child_process'\nimport * as fs from 'node:fs'\nimport * as path from 'node:path'\nimport * as os from 'node:os'\nimport { expandHome } from '../core/config/config.js'\n\nconst DEFAULT_ROOT = path.join(os.homedir(), '.openacp')\n\nexport function getPidPath(root?: string): string {\n const base = root ?? DEFAULT_ROOT\n return path.join(base, 'openacp.pid')\n}\n\nexport function getLogDir(root?: string): string {\n const base = root ?? DEFAULT_ROOT\n return path.join(base, 'logs')\n}\n\nexport function getRunningMarker(root?: string): string {\n const base = root ?? DEFAULT_ROOT\n return path.join(base, 'running')\n}\n\nexport function writePidFile(pidPath: string, pid: number): void {\n const dir = path.dirname(pidPath)\n fs.mkdirSync(dir, { recursive: true })\n fs.writeFileSync(pidPath, String(pid))\n}\n\nexport function readPidFile(pidPath: string): number | null {\n try {\n const content = fs.readFileSync(pidPath, 'utf-8').trim()\n const pid = parseInt(content, 10)\n return isNaN(pid) ? null : pid\n } catch {\n return null\n }\n}\n\nexport function removePidFile(pidPath: string): void {\n try {\n fs.unlinkSync(pidPath)\n } catch {\n // ignore if already gone\n }\n}\n\nexport function isProcessRunning(pidPath: string): boolean {\n const pid = readPidFile(pidPath)\n if (pid === null) return false\n try {\n process.kill(pid, 0)\n return true\n } catch {\n // Process not running, clean up stale PID file\n removePidFile(pidPath)\n return false\n }\n}\n\nexport function getStatus(pidPath: string = getPidPath()): { running: boolean; pid?: number } {\n const pid = readPidFile(pidPath)\n if (pid === null) return { running: false }\n try {\n process.kill(pid, 0)\n return { running: true, pid }\n } catch {\n removePidFile(pidPath)\n return { running: false }\n }\n}\n\nexport function startDaemon(pidPath: string = getPidPath(), logDir?: string, instanceRoot?: string): { pid: number } | { error: string } {\n // Mark as running so auto-start works on next boot\n markRunning(instanceRoot)\n\n // Check if already running\n if (isProcessRunning(pidPath)) {\n const pid = readPidFile(pidPath)!\n return { error: `Already running (PID ${pid})` }\n }\n\n const resolvedLogDir = logDir ? expandHome(logDir) : getLogDir(instanceRoot)\n fs.mkdirSync(resolvedLogDir, { recursive: true })\n const logFile = path.join(resolvedLogDir, 'openacp.log')\n\n // Find the CLI entry point\n const cliPath = path.resolve(process.argv[1])\n const nodePath = process.execPath\n\n const out = fs.openSync(logFile, 'a')\n const err = fs.openSync(logFile, 'a')\n\n const child = spawn(nodePath, [cliPath, '--daemon-child'], {\n detached: true,\n stdio: ['ignore', out, err],\n env: {\n ...process.env,\n ...(instanceRoot ? { OPENACP_INSTANCE_ROOT: instanceRoot } : {}),\n },\n })\n\n // Close file descriptors in parent — child has its own copies\n fs.closeSync(out)\n fs.closeSync(err)\n\n if (!child.pid) {\n return { error: 'Failed to spawn daemon process' }\n }\n\n // PID file is written by the child process itself (in main.ts startServer)\n // to avoid race conditions and ensure consistency with LaunchAgent/systemd starts.\n // We still write it here as a fallback in case the child hasn't written it yet\n // when the parent needs to report the PID.\n writePidFile(pidPath, child.pid)\n child.unref()\n\n return { pid: child.pid }\n}\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise(resolve => setTimeout(resolve, ms))\n}\n\nfunction isProcessAlive(pid: number): 'alive' | 'dead' | 'eperm' {\n try {\n process.kill(pid, 0)\n return 'alive'\n } catch (e) {\n const err = e as NodeJS.ErrnoException\n if (err.code === 'EPERM') return 'eperm'\n return 'dead'\n }\n}\n\nexport async function stopDaemon(pidPath: string = getPidPath(), instanceRoot?: string): Promise<{ stopped: boolean; pid?: number; error?: string }> {\n const pid = readPidFile(pidPath)\n if (pid === null) return { stopped: false, error: 'Not running (no PID file)' }\n\n const status = isProcessAlive(pid)\n if (status === 'dead') {\n removePidFile(pidPath)\n return { stopped: false, error: 'Not running (stale PID file removed)' }\n }\n if (status === 'eperm') {\n removePidFile(pidPath)\n return { stopped: false, error: 'PID belongs to another process (stale PID file removed)' }\n }\n\n try {\n process.kill(pid, 'SIGTERM')\n } catch (e) {\n return { stopped: false, error: `Failed to stop: ${(e as Error).message}` }\n }\n\n clearRunning(instanceRoot)\n\n const POLL_INTERVAL = 100\n const TIMEOUT = 5000\n const start = Date.now()\n\n while (Date.now() - start < TIMEOUT) {\n await sleep(POLL_INTERVAL)\n const s = isProcessAlive(pid)\n if (s === 'dead' || s === 'eperm') {\n removePidFile(pidPath)\n return { stopped: true, pid }\n }\n }\n\n try {\n process.kill(pid, 'SIGKILL')\n } catch (e) {\n const err = e as NodeJS.ErrnoException\n if (err.code === 'EPERM') {\n return { stopped: false, pid, error: 'PID may have been reused by another process. Run `openacp status` to verify, or manually delete the PID file.' }\n }\n }\n\n const killStart = Date.now()\n while (Date.now() - killStart < 1000) {\n await sleep(POLL_INTERVAL)\n const s = isProcessAlive(pid)\n if (s === 'dead' || s === 'eperm') {\n removePidFile(pidPath)\n return { stopped: true, pid }\n }\n }\n\n // SIGKILL sent but process still alive after 1s — extremely rare (uninterruptible I/O).\n return { stopped: false, pid, error: 'Process did not exit after SIGKILL (possible uninterruptible I/O). PID file retained.' }\n}\n\n/** Mark that the daemon should auto-start on boot */\nexport function markRunning(root?: string): void {\n const marker = getRunningMarker(root)\n fs.mkdirSync(path.dirname(marker), { recursive: true })\n fs.writeFileSync(marker, '')\n}\n\n/** Remove running marker — daemon won't auto-start on boot */\nexport function clearRunning(root?: string): void {\n try { fs.unlinkSync(getRunningMarker(root)) } catch { /* ignore */ }\n}\n\n/** Check if the daemon was running before (should auto-start on boot) */\nexport function shouldAutoStart(root?: string): boolean {\n return fs.existsSync(getRunningMarker(root))\n}\n"],"mappings":";;;;;AAAA,SAAS,aAAa;AACtB,YAAY,QAAQ;AACpB,YAAY,UAAU;AACtB,YAAY,QAAQ;AAGpB,IAAM,eAAoB,UAAQ,WAAQ,GAAG,UAAU;AAEhD,SAAS,WAAW,MAAuB;AAChD,QAAM,OAAO,QAAQ;AACrB,SAAY,UAAK,MAAM,aAAa;AACtC;AAEO,SAAS,UAAU,MAAuB;AAC/C,QAAM,OAAO,QAAQ;AACrB,SAAY,UAAK,MAAM,MAAM;AAC/B;AAEO,SAAS,iBAAiB,MAAuB;AACtD,QAAM,OAAO,QAAQ;AACrB,SAAY,UAAK,MAAM,SAAS;AAClC;AAEO,SAAS,aAAa,SAAiB,KAAmB;AAC/D,QAAM,MAAW,aAAQ,OAAO;AAChC,EAAG,aAAU,KAAK,EAAE,WAAW,KAAK,CAAC;AACrC,EAAG,iBAAc,SAAS,OAAO,GAAG,CAAC;AACvC;AAEO,SAAS,YAAY,SAAgC;AAC1D,MAAI;AACF,UAAM,UAAa,gBAAa,SAAS,OAAO,EAAE,KAAK;AACvD,UAAM,MAAM,SAAS,SAAS,EAAE;AAChC,WAAO,MAAM,GAAG,IAAI,OAAO;AAAA,EAC7B,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEO,SAAS,cAAc,SAAuB;AACnD,MAAI;AACF,IAAG,cAAW,OAAO;AAAA,EACvB,QAAQ;AAAA,EAER;AACF;AAEO,SAAS,iBAAiB,SAA0B;AACzD,QAAM,MAAM,YAAY,OAAO;AAC/B,MAAI,QAAQ,KAAM,QAAO;AACzB,MAAI;AACF,YAAQ,KAAK,KAA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AS;AAAA,EAC7B,SAAS,GAAG;AACV,UAAM,MAAM;AACZ,QAAI,IAAI,SAAS,SAAS;AACxB,aAAO,EAAE,SAAS,OAAO,KAAK,OAAO,gHAAgH;AAAA,IACvJ;AAAA,EACF;AAEA,QAAM,YAAY,KAAK,IAAI;AAC3B,SAAO,KAAK,IAAI,IAAI,YAAY,KAAM;AACpC,UAAM,MAAM,aAAa;AACzB,UAAM,IAAI,eAAe,GAAG;AAC5B,QAAI,MAAM,UAAU,MAAM,SAAS;AACjC,oBAAc,OAAO;AACrB,aAAO,EAAE,SAAS,MAAM,IAAI;AAAA,IAC9B;AAAA,EACF;AAGA,SAAO,EAAE,SAAS,OAAO,KAAK,OAAO,wFAAwF;AAC/H;AAGO,SAAS,YAAY,MAAqB;AAC/C,QAAM,SAAS,iBAAiB,IAAI;AACpC,EAAG,aAAe,aAAQ,MAAM,GAAG,EAAE,WAAW,KAAK,CAAC;AACtD,EAAG,iBAAc,QAAQ,EAAE;AAC7B;AAGO,SAAS,aAAa,MAAqB;AAChD,MAAI;AAAE,IAAG,cAAW,iBAAiB,IAAI,CAAC;AAAA,EAAE,QAAQ;AAAA,EAAe;AACrE;AAGO,SAAS,gBAAgB,MAAwB;AACtD,SAAU,cAAW,iBAAiB,IAAI,CAAC;AAC7C;","names":["resolve"]}
@@ -1,105 +0,0 @@
1
- import {
2
- createChildLogger
3
- } from "./chunk-R6KZYF7D.js";
4
- import {
5
- commandExists
6
- } from "./chunk-ZSLHHQPQ.js";
7
-
8
- // src/core/utils/install-binary.ts
9
- import fs from "fs";
10
- import path from "path";
11
- import https from "https";
12
- import os from "os";
13
- import { execSync } from "child_process";
14
- var log = createChildLogger({ module: "binary-installer" });
15
- var DEFAULT_BIN_DIR = path.join(os.homedir(), ".openacp", "bin");
16
- var IS_WINDOWS = os.platform() === "win32";
17
- function downloadFile(url, dest) {
18
- return new Promise((resolve, reject) => {
19
- const file = fs.createWriteStream(dest);
20
- const cleanup = () => {
21
- try {
22
- if (fs.existsSync(dest)) fs.unlinkSync(dest);
23
- } catch {
24
- }
25
- };
26
- https.get(url, (response) => {
27
- if (response.statusCode === 301 || response.statusCode === 302) {
28
- file.close(() => {
29
- cleanup();
30
- downloadFile(response.headers.location, dest).then(resolve).catch(reject);
31
- });
32
- return;
33
- }
34
- if (response.statusCode !== 200) {
35
- file.close(() => {
36
- cleanup();
37
- reject(new Error(`Download failed with status ${response.statusCode}`));
38
- });
39
- return;
40
- }
41
- response.pipe(file);
42
- file.on("finish", () => file.close(() => resolve(dest)));
43
- file.on("error", (err) => {
44
- file.close(() => {
45
- cleanup();
46
- reject(err);
47
- });
48
- });
49
- }).on("error", (err) => {
50
- file.close(() => {
51
- cleanup();
52
- reject(err);
53
- });
54
- });
55
- });
56
- }
57
- function getDownloadUrl(spec) {
58
- const platform = os.platform();
59
- const arch = os.arch();
60
- const mapping = spec.platforms[platform];
61
- if (!mapping) throw new Error(`${spec.name}: unsupported platform ${platform}`);
62
- const binary = mapping[arch];
63
- if (!binary) throw new Error(`${spec.name}: unsupported architecture ${arch} for ${platform}`);
64
- return `${spec.githubBaseUrl}/${binary}`;
65
- }
66
- async function ensureBinary(spec, binDir) {
67
- const resolvedBinDir = binDir ?? DEFAULT_BIN_DIR;
68
- const binName = IS_WINDOWS ? `${spec.name}.exe` : spec.name;
69
- const binPath = path.join(resolvedBinDir, binName);
70
- if (commandExists(spec.name)) {
71
- log.debug({ name: spec.name }, "Found in PATH");
72
- return spec.name;
73
- }
74
- if (fs.existsSync(binPath)) {
75
- if (!IS_WINDOWS) fs.chmodSync(binPath, "755");
76
- log.debug({ name: spec.name, path: binPath }, "Found in ~/.openacp/bin");
77
- return binPath;
78
- }
79
- log.info({ name: spec.name }, "Not found, downloading from GitHub...");
80
- fs.mkdirSync(resolvedBinDir, { recursive: true });
81
- const url = getDownloadUrl(spec);
82
- const isArchive = spec.isArchive?.(url) ?? false;
83
- const downloadDest = isArchive ? path.join(resolvedBinDir, `${spec.name}.tgz`) : binPath;
84
- await downloadFile(url, downloadDest);
85
- if (isArchive) {
86
- execSync(`tar -xzf "${downloadDest}" -C "${resolvedBinDir}"`, { stdio: "pipe" });
87
- try {
88
- fs.unlinkSync(downloadDest);
89
- } catch {
90
- }
91
- }
92
- if (!fs.existsSync(binPath)) {
93
- throw new Error(`${spec.name}: binary not found at ${binPath} after download/extraction. The archive structure may have changed.`);
94
- }
95
- if (!IS_WINDOWS) {
96
- fs.chmodSync(binPath, "755");
97
- }
98
- log.info({ name: spec.name, path: binPath }, "Installed successfully");
99
- return binPath;
100
- }
101
-
102
- export {
103
- ensureBinary
104
- };
105
- //# sourceMappingURL=chunk-7YIKTRSM.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/core/utils/install-binary.ts"],"sourcesContent":["import fs from 'node:fs'\nimport path from 'node:path'\nimport https from 'node:https'\nimport os from 'node:os'\nimport { execSync } from 'node:child_process'\nimport { createChildLogger } from './log.js'\nimport { commandExists } from '../agents/agent-dependencies.js'\n\nconst log = createChildLogger({ module: 'binary-installer' })\n\nconst DEFAULT_BIN_DIR = path.join(os.homedir(), '.openacp', 'bin')\nconst IS_WINDOWS = os.platform() === 'win32'\n\nexport interface BinarySpec {\n name: string\n /** GitHub base URL for releases, e.g. \"https://github.com/jqlang/jq/releases/latest/download\" */\n githubBaseUrl: string\n /** Platform → arch → filename mapping */\n platforms: Record<string, Record<string, string>>\n /** If true, downloaded file is a .tgz archive that needs extraction */\n isArchive?: (url: string) => boolean\n}\n\nfunction downloadFile(url: string, dest: string): Promise<string> {\n return new Promise((resolve, reject) => {\n const file = fs.createWriteStream(dest)\n\n const cleanup = () => {\n try { if (fs.existsSync(dest)) fs.unlinkSync(dest) } catch { /* ignore */ }\n }\n\n https.get(url, (response) => {\n if (response.statusCode === 301 || response.statusCode === 302) {\n file.close(() => {\n cleanup()\n downloadFile(response.headers.location!, dest).then(resolve).catch(reject)\n })\n return\n }\n\n if (response.statusCode !== 200) {\n file.close(() => {\n cleanup()\n reject(new Error(`Download failed with status ${response.statusCode}`))\n })\n return\n }\n\n response.pipe(file)\n file.on('finish', () => file.close(() => resolve(dest)))\n file.on('error', (err) => {\n file.close(() => {\n cleanup()\n reject(err)\n })\n })\n }).on('error', (err) => {\n file.close(() => {\n cleanup()\n reject(err)\n })\n })\n })\n}\n\nfunction getDownloadUrl(spec: BinarySpec): string {\n const platform = os.platform()\n const arch = os.arch()\n const mapping = spec.platforms[platform]\n if (!mapping) throw new Error(`${spec.name}: unsupported platform ${platform}`)\n const binary = mapping[arch]\n if (!binary) throw new Error(`${spec.name}: unsupported architecture ${arch} for ${platform}`)\n return `${spec.githubBaseUrl}/${binary}`\n}\n\n/**\n * Ensure a binary is available.\n * 1. Check PATH first (respects user's system install)\n * 2. Check ~/.openacp/bin/\n * 3. Download from GitHub releases\n */\nexport async function ensureBinary(spec: BinarySpec, binDir?: string): Promise<string> {\n const resolvedBinDir = binDir ?? DEFAULT_BIN_DIR\n const binName = IS_WINDOWS ? `${spec.name}.exe` : spec.name\n const binPath = path.join(resolvedBinDir, binName)\n\n // 1. Check PATH first\n if (commandExists(spec.name)) {\n log.debug({ name: spec.name }, 'Found in PATH')\n return spec.name\n }\n\n // 2. Check our bin directory\n if (fs.existsSync(binPath)) {\n if (!IS_WINDOWS) fs.chmodSync(binPath, '755')\n log.debug({ name: spec.name, path: binPath }, 'Found in ~/.openacp/bin')\n return binPath\n }\n\n // 3. Download\n log.info({ name: spec.name }, 'Not found, downloading from GitHub...')\n fs.mkdirSync(resolvedBinDir, { recursive: true })\n\n const url = getDownloadUrl(spec)\n const isArchive = spec.isArchive?.(url) ?? false\n const downloadDest = isArchive ? path.join(resolvedBinDir, `${spec.name}.tgz`) : binPath\n\n await downloadFile(url, downloadDest)\n\n if (isArchive) {\n execSync(`tar -xzf \"${downloadDest}\" -C \"${resolvedBinDir}\"`, { stdio: 'pipe' })\n try { fs.unlinkSync(downloadDest) } catch { /* ignore */ }\n }\n\n // Validate the binary was actually produced\n if (!fs.existsSync(binPath)) {\n throw new Error(`${spec.name}: binary not found at ${binPath} after download/extraction. The archive structure may have changed.`)\n }\n\n if (!IS_WINDOWS) {\n fs.chmodSync(binPath, '755')\n }\n\n log.info({ name: spec.name, path: binPath }, 'Installed successfully')\n return binPath\n}\n"],"mappings":";;;;;;;;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,WAAW;AAClB,OAAO,QAAQ;AACf,SAAS,gBAAgB;AAIzB,IAAM,MAAM,kBAAkB,EAAE,QAAQ,mBAAmB,CAAC;AAE5D,IAAM,kBAAkB,KAAK,KAAK,GAAG,QAAQ,GAAG,YAAY,KAAK;AACjE,IAAM,aAAa,GAAG,SAAS,MAAM;AAYrC,SAAS,aAAa,KAAa,MAA+B;AAChE,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,UAAM,OAAO,GAAG,kBAAkB,IAAI;AAEtC,UAAM,UAAU,MAAM;AACpB,UAAI;AAAE,YAAI,GAAG,WAAW,IAAI,EAAG,IAAG,WAAW,IAAI;AAAA,MAAE,QAAQ;AAAA,MAAe;AAAA,IAC5E;AAEA,UAAM,IAAI,KAAK,CAAC,aAAa;AAC3B,UAAI,SAAS,eAAe,OAAO,SAAS,eAAe,KAAK;AAC9D,aAAK,MAAM,MAAM;AACf,kBAAQ;AACR,uBAAa,SAAS,QAAQ,UAAW,IAAI,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM;AAAA,QAC3E,CAAC;AACD;AAAA,MACF;AAEA,UAAI,SAAS,eAAe,KAAK;AAC/B,aAAK,MAAM,MAAM;AACf,kBAAQ;AACR,iBAAO,IAAI,MAAM,+BAA+B,SAAS,UAAU,EAAE,CAAC;AAAA,QACxE,CAAC;AACD;AAAA,MACF;AAEA,eAAS,KAAK,IAAI;AAClB,WAAK,GAAG,UAAU,MAAM,KAAK,MAAM,MAAM,QAAQ,IAAI,CAAC,CAAC;AACvD,WAAK,GAAG,SAAS,CAAC,QAAQ;AACxB,aAAK,MAAM,MAAM;AACf,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AY,GAAG,KAAK;AAC3C,QAAM,eAAe,YAAY,KAAK,KAAK,gBAAgB,GAAG,KAAK,IAAI,MAAM,IAAI;AAEjF,QAAM,aAAa,KAAK,YAAY;AAEpC,MAAI,WAAW;AACb,aAAS,aAAa,YAAY,SAAS,cAAc,KAAK,EAAE,OAAO,OAAO,CAAC;AAC/E,QAAI;AAAE,SAAG,WAAW,YAAY;AAAA,IAAE,QAAQ;AAAA,IAAe;AAAA,EAC3D;AAGA,MAAI,CAAC,GAAG,WAAW,OAAO,GAAG;AAC3B,UAAM,IAAI,MAAM,GAAG,KAAK,IAAI,yBAAyB,OAAO,qEAAqE;AAAA,EACnI;AAEA,MAAI,CAAC,YAAY;AACf,OAAG,UAAU,SAAS,KAAK;AAAA,EAC7B;AAEA,MAAI,KAAK,EAAE,MAAM,KAAK,MAAM,MAAM,QAAQ,GAAG,wBAAwB;AACrE,SAAO;AACT;","names":[]}
@@ -1,27 +0,0 @@
1
- // src/plugins/notifications/notification.ts
2
- var NotificationManager = class {
3
- constructor(adapters) {
4
- this.adapters = adapters;
5
- }
6
- async notify(channelId, notification) {
7
- const adapter = this.adapters.get(channelId);
8
- if (!adapter) return;
9
- try {
10
- await adapter.sendNotification(notification);
11
- } catch {
12
- }
13
- }
14
- async notifyAll(notification) {
15
- for (const adapter of this.adapters.values()) {
16
- try {
17
- await adapter.sendNotification(notification);
18
- } catch {
19
- }
20
- }
21
- }
22
- };
23
-
24
- export {
25
- NotificationManager
26
- };
27
- //# sourceMappingURL=chunk-7ZCQF6QM.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/plugins/notifications/notification.ts"],"sourcesContent":["import type { IChannelAdapter } from '../../core/channel.js'\nimport type { NotificationMessage } from '../../core/types.js'\n\nexport class NotificationManager {\n constructor(private adapters: Map<string, IChannelAdapter>) {}\n\n async notify(channelId: string, notification: NotificationMessage): Promise<void> {\n const adapter = this.adapters.get(channelId)\n if (!adapter) return\n try {\n await adapter.sendNotification(notification)\n } catch {\n // Don't let notification failures crash the caller\n }\n }\n\n async notifyAll(notification: NotificationMessage): Promise<void> {\n for (const adapter of this.adapters.values()) {\n try {\n await adapter.sendNotification(notification)\n } catch {\n // Continue to next adapter\n }\n }\n }\n}\n"],"mappings":";AAGO,IAAM,sBAAN,MAA0B;AAAA,EAC/B,YAAoB,UAAwC;AAAxC;AAAA,EAAyC;AAAA,EAE7D,MAAM,OAAO,WAAmB,cAAkD;AAChF,UAAM,UAAU,KAAK,SAAS,IAAI,SAAS;AAC3C,QAAI,CAAC,QAAS;AACd,QAAI;AACF,YAAM,QAAQ,iBAAiB,YAAY;AAAA,IAC7C,QAAQ;AAAA,IAER;AAAA,EACF;AAAA,EAEA,MAAM,UAAU,cAAkD;AAChE,eAAW,WAAW,KAAK,SAAS,OAAO,GAAG;AAC5C,UAAI;AACF,cAAM,QAAQ,iBAAiB,YAAY;AAAA,MAC7C,QAAQ;AAAA,MAER;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
@@ -1,92 +0,0 @@
1
- // src/plugins/telegram/commands/menu.ts
2
- import { InlineKeyboard } from "grammy";
3
- function buildMenuKeyboard() {
4
- return new InlineKeyboard().text("\u{1F195} New Session", "m:new").text("\u{1F4CB} Sessions", "m:topics").row().text("\u{1F4CA} Status", "m:status").text("\u{1F916} Agents", "m:agents").row().text("\u2699\uFE0F Settings", "m:settings").text("\u{1F517} Integrate", "m:integrate").row().text("\u{1F504} Restart", "m:restart").text("\u2B06\uFE0F Update", "m:update").row().text("\u2753 Help", "m:help").text("\u{1FA7A} Doctor", "m:doctor");
5
- }
6
- async function handleMenu(ctx) {
7
- await ctx.reply(`<b>OpenACP Menu</b>
8
- Choose an action:`, {
9
- parse_mode: "HTML",
10
- reply_markup: buildMenuKeyboard()
11
- });
12
- }
13
- async function handleHelp(ctx) {
14
- await ctx.reply(
15
- `\u{1F4D6} <b>OpenACP Help</b>
16
-
17
- \u{1F680} <b>Getting Started</b>
18
- Tap \u{1F195} New Session to start coding with AI.
19
- Each session gets its own topic \u2014 chat there to work with the agent.
20
-
21
- \u{1F4A1} <b>Common Tasks</b>
22
- /new [agent] [workspace] \u2014 Create new session
23
- /cancel \u2014 Cancel session (in session topic)
24
- /status \u2014 Show session or system status
25
- /sessions \u2014 List all sessions
26
- /agents \u2014 Browse & install agents
27
- /install <name> \u2014 Install an agent
28
-
29
- \u2699\uFE0F <b>System</b>
30
- /restart \u2014 Restart OpenACP
31
- /update \u2014 Update to latest version
32
- /integrate \u2014 Manage agent integrations
33
- /menu \u2014 Show action menu
34
-
35
- \u{1F512} <b>Session Options</b>
36
- /enable_dangerous \u2014 Auto-approve permissions
37
- /disable_dangerous \u2014 Restore permission prompts
38
- /handoff \u2014 Continue session in terminal
39
- /archive \u2014 Archive session topic
40
- /clear \u2014 Clear assistant history
41
-
42
- \u{1F4AC} Need help? Just ask me in this topic!`,
43
- { parse_mode: "HTML" }
44
- );
45
- }
46
- async function handleClear(ctx, assistant) {
47
- if (!assistant) {
48
- await ctx.reply("\u26A0\uFE0F Assistant is not available.", { parse_mode: "HTML" });
49
- return;
50
- }
51
- const threadId = ctx.message?.message_thread_id;
52
- if (threadId !== assistant.topicId) {
53
- await ctx.reply("\u2139\uFE0F /clear only works in the Assistant topic.", { parse_mode: "HTML" });
54
- return;
55
- }
56
- await ctx.reply("\u{1F504} Clearing assistant history...", { parse_mode: "HTML" });
57
- try {
58
- await assistant.respawn();
59
- await ctx.reply("\u2705 Assistant history cleared.", { parse_mode: "HTML" });
60
- } catch (err) {
61
- const message = err instanceof Error ? err.message : String(err);
62
- await ctx.reply(`\u274C Failed to clear: <code>${message}</code>`, { parse_mode: "HTML" });
63
- }
64
- }
65
- var TELEGRAM_MSG_LIMIT = 4096;
66
- function buildSkillMessages(commands) {
67
- const sorted = [...commands].sort((a, b) => a.name.localeCompare(b.name));
68
- const header = "\u{1F6E0} <b>Available Skills</b>\n";
69
- const lines = sorted.map((c) => `<code>/${c.name}</code>`);
70
- const messages = [];
71
- let current = header;
72
- for (const line of lines) {
73
- const candidate = current + "\n" + line;
74
- if (candidate.length > TELEGRAM_MSG_LIMIT) {
75
- messages.push(current);
76
- current = line;
77
- } else {
78
- current = candidate;
79
- }
80
- }
81
- if (current) messages.push(current);
82
- return messages;
83
- }
84
-
85
- export {
86
- buildMenuKeyboard,
87
- handleMenu,
88
- handleHelp,
89
- handleClear,
90
- buildSkillMessages
91
- };
92
- //# sourceMappingURL=chunk-AFKX424Q.js.map