@signetai/connector-opencode 0.140.1

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/bin/install.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import { runConnectorInstaller } from "@signetai/connector-base";
3
+ import { OpenCodeConnector } from "../dist/index.js";
4
+
5
+ runConnectorInstaller("opencode", OpenCodeConnector);
@@ -0,0 +1,92 @@
1
+ /**
2
+ * @signetai/connector-opencode
3
+ *
4
+ * Signet connector for OpenCode - installs hooks and generates config
5
+ * during 'signet install'.
6
+ *
7
+ * This connector:
8
+ * - Writes a bundled signet.mjs plugin to ~/.config/opencode/plugins/
9
+ * (OpenCode auto-discovers plugins from that directory)
10
+ * - Generates ~/.config/opencode/AGENTS.md from identity files
11
+ * - Migrates away from the legacy memory.mjs approach on install/uninstall
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * import { OpenCodeConnector } from '@signetai/connector-opencode'
16
+ *
17
+ * const connector = new OpenCodeConnector()
18
+ * await connector.install('/home/user/.agents')
19
+ * ```
20
+ */
21
+ import { BaseConnector, type InstallResult, type UninstallResult } from "@signetai/connector-base";
22
+ /**
23
+ * OpenCode connector for Signet
24
+ *
25
+ * Implements the connector pattern for setting up OpenCode integration.
26
+ * Run during 'signet install' to write the plugin bundle and AGENTS.md.
27
+ */
28
+ export declare class OpenCodeConnector extends BaseConnector {
29
+ readonly name = "OpenCode";
30
+ readonly harnessId = "opencode";
31
+ protected getOpenCodePath(): string;
32
+ getConfigPath(): string;
33
+ private getPluginsPath;
34
+ private getPluginFilePath;
35
+ private getPluginConfigEntry;
36
+ /**
37
+ * Install OpenCode integration
38
+ *
39
+ * Writes:
40
+ * - ~/.config/opencode/plugins/signet.mjs — bundled plugin
41
+ * - ~/.config/opencode/AGENTS.md — agent instructions
42
+ *
43
+ * Also migrates away from the legacy memory.mjs approach.
44
+ */
45
+ install(basePath: string): Promise<InstallResult>;
46
+ /**
47
+ * Remove Signet integration from OpenCode
48
+ */
49
+ uninstall(): Promise<UninstallResult>;
50
+ /**
51
+ * Check if Signet integration is already set up for OpenCode
52
+ */
53
+ isInstalled(): boolean;
54
+ /**
55
+ * Check if OpenCode is installed on the system
56
+ */
57
+ static isHarnessInstalled(): boolean;
58
+ /**
59
+ * Remove legacy memory.mjs installation artifacts
60
+ *
61
+ * Deletes the old memory.mjs from the OpenCode root directory and scrubs
62
+ * any file:// URL or path referencing it from all known config candidates.
63
+ */
64
+ private migrateFromLegacy;
65
+ /**
66
+ * Scrub any plugin entry that references memory.mjs from the config object.
67
+ * Returns true if the config was modified.
68
+ */
69
+ private removeMemoryMjsEntries;
70
+ /**
71
+ * Register Signet MCP server in OpenCode config file
72
+ */
73
+ private registerPlugin;
74
+ private removePlugin;
75
+ private registerMcpServer;
76
+ /**
77
+ * Remove Signet MCP server from OpenCode config file
78
+ */
79
+ private removeMcpServer;
80
+ private static readonly PIPELINE_AGENT_CONFIG;
81
+ private registerPipelineAgent;
82
+ private removePipelineAgent;
83
+ private ensureConfigFile;
84
+ private getConfigCandidates;
85
+ /**
86
+ * Generate AGENTS.md for OpenCode from identity files
87
+ */
88
+ private generateAgentsMd;
89
+ }
90
+ export declare const opencodeConnector: OpenCodeConnector;
91
+ export default OpenCodeConnector;
92
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,OAAO,EAAE,aAAa,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAmB,MAAM,wBAAwB,CAAC;AA6LlH;;;;;GAKG;AACH,qBAAa,iBAAkB,SAAQ,aAAa;IACnD,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,SAAS,cAAc;IAEhC,SAAS,CAAC,eAAe,IAAI,MAAM;IAInC,aAAa,IAAI,MAAM;IAUvB,OAAO,CAAC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