@alfe.ai/integrations 0.0.3 → 0.0.4
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/index.d.ts +11 -11
- package/dist/index.js +14 -32
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -8,11 +8,10 @@
|
|
|
8
8
|
interface RegistryEntry {
|
|
9
9
|
/** Human-readable display name (e.g. 'Alfe Voice') */
|
|
10
10
|
name?: string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
commit?: string;
|
|
11
|
+
/** GitHub repository URL (HTTPS) for public clone */
|
|
12
|
+
repository: string;
|
|
13
|
+
/** Git commit SHA — installer clones and checks out this exact commit */
|
|
14
|
+
commit: string;
|
|
16
15
|
/** Subdirectory within the repo where the integration lives (for monorepos) */
|
|
17
16
|
subdir?: string;
|
|
18
17
|
versions: string[];
|
|
@@ -103,11 +102,10 @@ declare class Registry {
|
|
|
103
102
|
interface ResolvedIntegration {
|
|
104
103
|
id: string;
|
|
105
104
|
name?: string;
|
|
106
|
-
|
|
105
|
+
repository: string;
|
|
107
106
|
version: string;
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
commit?: string;
|
|
107
|
+
/** Git commit SHA to checkout after clone */
|
|
108
|
+
commit: string;
|
|
111
109
|
/** Subdirectory within the repo where the integration lives (for monorepos) */
|
|
112
110
|
subdir?: string;
|
|
113
111
|
description: string;
|
|
@@ -123,7 +121,7 @@ declare class Resolver {
|
|
|
123
121
|
*
|
|
124
122
|
* @param name - Integration name (e.g. "discord")
|
|
125
123
|
* @param version - Specific version (e.g. "1.0.0") or undefined for latest
|
|
126
|
-
* @returns Resolved integration with repo URL and
|
|
124
|
+
* @returns Resolved integration with repo URL and commit hash
|
|
127
125
|
*/
|
|
128
126
|
resolve(id: string, version?: string): Promise<ResolvedIntegration>;
|
|
129
127
|
/**
|
|
@@ -165,7 +163,7 @@ declare class Installer {
|
|
|
165
163
|
*/
|
|
166
164
|
getClonePath(name: string): string;
|
|
167
165
|
/**
|
|
168
|
-
* Install an integration by cloning its git repo and checking out the
|
|
166
|
+
* Install an integration by cloning its git repo and checking out the pinned commit.
|
|
169
167
|
* Returns the effective install path (with subdir if present).
|
|
170
168
|
*/
|
|
171
169
|
install(resolved: ResolvedIntegration): Promise<string>;
|
|
@@ -287,6 +285,8 @@ interface IntegrationManifest {
|
|
|
287
285
|
config_schema: ConfigSchemaField[];
|
|
288
286
|
capabilities: string[];
|
|
289
287
|
hooks: IntegrationHooks;
|
|
288
|
+
/** Git repository URL (HTTPS, with .git suffix) — used by installer to clone */
|
|
289
|
+
repository: string;
|
|
290
290
|
/**
|
|
291
291
|
* Agent runtimes this integration supports.
|
|
292
292
|
* If omitted or empty, the integration is considered universal (all runtimes).
|
package/dist/index.js
CHANGED
|
@@ -83,7 +83,7 @@ var Resolver = class {
|
|
|
83
83
|
*
|
|
84
84
|
* @param name - Integration name (e.g. "discord")
|
|
85
85
|
* @param version - Specific version (e.g. "1.0.0") or undefined for latest
|
|
86
|
-
* @returns Resolved integration with repo URL and
|
|
86
|
+
* @returns Resolved integration with repo URL and commit hash
|
|
87
87
|
*/
|
|
88
88
|
async resolve(id, version) {
|
|
89
89
|
const entry = await this.registry.get(id);
|
|
@@ -93,9 +93,8 @@ var Resolver = class {
|
|
|
93
93
|
return {
|
|
94
94
|
id,
|
|
95
95
|
name: entry.name,
|
|
96
|
-
|
|
96
|
+
repository: entry.repository,
|
|
97
97
|
version: resolvedVersion,
|
|
98
|
-
tag: `v${resolvedVersion}`,
|
|
99
98
|
commit: entry.commit,
|
|
100
99
|
subdir: entry.subdir,
|
|
101
100
|
description: entry.description
|
|
@@ -119,10 +118,10 @@ var Resolver = class {
|
|
|
119
118
|
//#endregion
|
|
120
119
|
//#region src/installer.ts
|
|
121
120
|
/**
|
|
122
|
-
* Installer — git clone
|
|
121
|
+
* Installer — git clone integrations to ~/.alfe/integrations/{name}/.
|
|
123
122
|
*
|
|
124
123
|
* Manages the local installation directory for integration repos.
|
|
125
|
-
* Each integration is
|
|
124
|
+
* Each integration is cloned and checked out to a pinned commit hash.
|
|
126
125
|
*/
|
|
127
126
|
const execFileAsync$1 = promisify(execFile);
|
|
128
127
|
const INTEGRATIONS_DIR = join(homedir(), ".alfe", "integrations");
|
|
@@ -160,7 +159,7 @@ var Installer = class {
|
|
|
160
159
|
return join(this.basePath, name);
|
|
161
160
|
}
|
|
162
161
|
/**
|
|
163
|
-
* Install an integration by cloning its git repo and checking out the
|
|
162
|
+
* Install an integration by cloning its git repo and checking out the pinned commit.
|
|
164
163
|
* Returns the effective install path (with subdir if present).
|
|
165
164
|
*/
|
|
166
165
|
async install(resolved) {
|
|
@@ -169,25 +168,15 @@ var Installer = class {
|
|
|
169
168
|
if (resolved.subdir) this.subdirs.set(resolved.id, resolved.subdir);
|
|
170
169
|
mkdirSync(this.basePath, { recursive: true });
|
|
171
170
|
try {
|
|
172
|
-
|
|
173
|
-
await execFileAsync$1("git", [
|
|
174
|
-
"clone",
|
|
175
|
-
resolved.repo,
|
|
176
|
-
clonePath
|
|
177
|
-
], { timeout: GIT_TIMEOUT_MS });
|
|
178
|
-
await execFileAsync$1("git", ["checkout", resolved.commit], {
|
|
179
|
-
cwd: clonePath,
|
|
180
|
-
timeout: GIT_TIMEOUT_MS
|
|
181
|
-
});
|
|
182
|
-
} else await execFileAsync$1("git", [
|
|
171
|
+
await execFileAsync$1("git", [
|
|
183
172
|
"clone",
|
|
184
|
-
|
|
185
|
-
"1",
|
|
186
|
-
"--branch",
|
|
187
|
-
resolved.tag,
|
|
188
|
-
resolved.repo,
|
|
173
|
+
resolved.repository,
|
|
189
174
|
clonePath
|
|
190
175
|
], { timeout: GIT_TIMEOUT_MS });
|
|
176
|
+
await execFileAsync$1("git", ["checkout", resolved.commit], {
|
|
177
|
+
cwd: clonePath,
|
|
178
|
+
timeout: GIT_TIMEOUT_MS
|
|
179
|
+
});
|
|
191
180
|
} catch (err) {
|
|
192
181
|
if (existsSync(clonePath)) rmSync(clonePath, {
|
|
193
182
|
recursive: true,
|
|
@@ -208,18 +197,11 @@ var Installer = class {
|
|
|
208
197
|
if (resolved.subdir) this.subdirs.set(name, resolved.subdir);
|
|
209
198
|
else this.subdirs.delete(name);
|
|
210
199
|
try {
|
|
211
|
-
await execFileAsync$1("git", [
|
|
212
|
-
"fetch",
|
|
213
|
-
"--depth",
|
|
214
|
-
"1",
|
|
215
|
-
"origin",
|
|
216
|
-
`tag`,
|
|
217
|
-
resolved.tag
|
|
218
|
-
], {
|
|
200
|
+
await execFileAsync$1("git", ["fetch", "origin"], {
|
|
219
201
|
cwd: clonePath,
|
|
220
202
|
timeout: GIT_TIMEOUT_MS
|
|
221
203
|
});
|
|
222
|
-
await execFileAsync$1("git", ["checkout", resolved.
|
|
204
|
+
await execFileAsync$1("git", ["checkout", resolved.commit], {
|
|
223
205
|
cwd: clonePath,
|
|
224
206
|
timeout: GIT_TIMEOUT_MS
|
|
225
207
|
});
|
|
@@ -711,7 +693,7 @@ var IntegrationManager = class {
|
|
|
711
693
|
});
|
|
712
694
|
try {
|
|
713
695
|
const resolved = await this.resolver.resolve(name, version);
|
|
714
|
-
this.log.info(`Resolved ${name}@${resolved.version} from ${resolved.
|
|
696
|
+
this.log.info(`Resolved ${name}@${resolved.version} from ${resolved.repository}`);
|
|
715
697
|
const installPath = await this.installer.install(resolved);
|
|
716
698
|
this.log.info(`Cloned to ${installPath}`);
|
|
717
699
|
const manifestPath = join(installPath, "alfe-integration.yaml");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfe.ai/integrations",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Integration lifecycle management for Alfe — registry, resolution, installation, and state",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@auriclabs/logger": "^0.1.1",
|
|
16
|
-
"@alfe.ai/integration-manifest": "^0.0.
|
|
16
|
+
"@alfe.ai/integration-manifest": "^0.0.3"
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
19
|
"dist"
|