clawup 1.0.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.
- package/README.md +245 -0
- package/dist/adapters/api-adapter.d.ts +76 -0
- package/dist/adapters/api-adapter.js +250 -0
- package/dist/adapters/api-adapter.js.map +1 -0
- package/dist/adapters/cli-adapter.d.ts +15 -0
- package/dist/adapters/cli-adapter.js +208 -0
- package/dist/adapters/cli-adapter.js.map +1 -0
- package/dist/adapters/index.d.ts +22 -0
- package/dist/adapters/index.js +32 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/types.d.ts +135 -0
- package/dist/adapters/types.js +14 -0
- package/dist/adapters/types.js.map +1 -0
- package/dist/bin.d.ts +8 -0
- package/dist/bin.js +221 -0
- package/dist/bin.js.map +1 -0
- package/dist/commands/config.d.ts +21 -0
- package/dist/commands/config.js +323 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/deploy.d.ts +7 -0
- package/dist/commands/deploy.js +13 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/destroy.d.ts +7 -0
- package/dist/commands/destroy.js +13 -0
- package/dist/commands/destroy.js.map +1 -0
- package/dist/commands/init.d.ts +13 -0
- package/dist/commands/init.js +698 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/list.d.ts +8 -0
- package/dist/commands/list.js +42 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/push.d.ts +7 -0
- package/dist/commands/push.js +19 -0
- package/dist/commands/push.js.map +1 -0
- package/dist/commands/redeploy.d.ts +7 -0
- package/dist/commands/redeploy.js +13 -0
- package/dist/commands/redeploy.js.map +1 -0
- package/dist/commands/secrets.d.ts +16 -0
- package/dist/commands/secrets.js +169 -0
- package/dist/commands/secrets.js.map +1 -0
- package/dist/commands/ssh.d.ts +9 -0
- package/dist/commands/ssh.js +108 -0
- package/dist/commands/ssh.js.map +1 -0
- package/dist/commands/status.d.ts +7 -0
- package/dist/commands/status.js +13 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/update.d.ts +7 -0
- package/dist/commands/update.js +126 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/validate.d.ts +7 -0
- package/dist/commands/validate.js +13 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/commands/webhooks.d.ts +7 -0
- package/dist/commands/webhooks.js +13 -0
- package/dist/commands/webhooks.js.map +1 -0
- package/dist/lib/__tests__/identity.test.d.ts +1 -0
- package/dist/lib/__tests__/identity.test.js +186 -0
- package/dist/lib/__tests__/identity.test.js.map +1 -0
- package/dist/lib/__tests__/validate-agent.test.d.ts +1 -0
- package/dist/lib/__tests__/validate-agent.test.js +38 -0
- package/dist/lib/__tests__/validate-agent.test.js.map +1 -0
- package/dist/lib/config.d.ts +69 -0
- package/dist/lib/config.js +218 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/constants.d.ts +5 -0
- package/dist/lib/constants.js +29 -0
- package/dist/lib/constants.js.map +1 -0
- package/dist/lib/exec.d.ts +24 -0
- package/dist/lib/exec.js +63 -0
- package/dist/lib/exec.js.map +1 -0
- package/dist/lib/prerequisites.d.ts +8 -0
- package/dist/lib/prerequisites.js +146 -0
- package/dist/lib/prerequisites.js.map +1 -0
- package/dist/lib/process.d.ts +18 -0
- package/dist/lib/process.js +37 -0
- package/dist/lib/process.js.map +1 -0
- package/dist/lib/pulumi.d.ts +37 -0
- package/dist/lib/pulumi.js +87 -0
- package/dist/lib/pulumi.js.map +1 -0
- package/dist/lib/tailscale.d.ts +75 -0
- package/dist/lib/tailscale.js +251 -0
- package/dist/lib/tailscale.js.map +1 -0
- package/dist/lib/tool-helpers.d.ts +15 -0
- package/dist/lib/tool-helpers.js +35 -0
- package/dist/lib/tool-helpers.js.map +1 -0
- package/dist/lib/ui.d.ts +26 -0
- package/dist/lib/ui.js +86 -0
- package/dist/lib/ui.js.map +1 -0
- package/dist/lib/update-check.d.ts +8 -0
- package/dist/lib/update-check.js +151 -0
- package/dist/lib/update-check.js.map +1 -0
- package/dist/lib/vendor.d.ts +34 -0
- package/dist/lib/vendor.js +128 -0
- package/dist/lib/vendor.js.map +1 -0
- package/dist/lib/workspace.d.ts +21 -0
- package/dist/lib/workspace.js +170 -0
- package/dist/lib/workspace.js.map +1 -0
- package/dist/tools/deploy.d.ts +16 -0
- package/dist/tools/deploy.js +181 -0
- package/dist/tools/deploy.js.map +1 -0
- package/dist/tools/destroy.d.ts +16 -0
- package/dist/tools/destroy.js +119 -0
- package/dist/tools/destroy.js.map +1 -0
- package/dist/tools/index.d.ts +20 -0
- package/dist/tools/index.js +34 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/push.d.ts +29 -0
- package/dist/tools/push.js +341 -0
- package/dist/tools/push.js.map +1 -0
- package/dist/tools/redeploy.d.ts +17 -0
- package/dist/tools/redeploy.js +181 -0
- package/dist/tools/redeploy.js.map +1 -0
- package/dist/tools/status.d.ts +16 -0
- package/dist/tools/status.js +205 -0
- package/dist/tools/status.js.map +1 -0
- package/dist/tools/validate.d.ts +16 -0
- package/dist/tools/validate.js +219 -0
- package/dist/tools/validate.js.map +1 -0
- package/dist/tools/webhooks.d.ts +17 -0
- package/dist/tools/webhooks.js +181 -0
- package/dist/tools/webhooks.js.map +1 -0
- package/dist/types.d.ts +6 -0
- package/dist/types.js +10 -0
- package/dist/types.js.map +1 -0
- package/infra/Pulumi.yaml +6 -0
- package/infra/dist/components/cloud-init.js +412 -0
- package/infra/dist/components/config-generator.js +254 -0
- package/infra/dist/components/hetzner-agent.js +162 -0
- package/infra/dist/components/index.js +18 -0
- package/infra/dist/components/openclaw-agent.js +287 -0
- package/infra/dist/components/shared.js +132 -0
- package/infra/dist/components/types.js +6 -0
- package/infra/dist/index.js +387 -0
- package/infra/dist/shared-vpc.js +167 -0
- package/infra/node_modules/@clawup/core/dist/__tests__/schemas.test.d.ts +2 -0
- package/infra/node_modules/@clawup/core/dist/__tests__/schemas.test.d.ts.map +1 -0
- package/infra/node_modules/@clawup/core/dist/__tests__/schemas.test.js +124 -0
- package/infra/node_modules/@clawup/core/dist/__tests__/schemas.test.js.map +1 -0
- package/infra/node_modules/@clawup/core/dist/coding-agent-registry.d.ts +32 -0
- package/infra/node_modules/@clawup/core/dist/coding-agent-registry.d.ts.map +1 -0
- package/infra/node_modules/@clawup/core/dist/coding-agent-registry.js +56 -0
- package/infra/node_modules/@clawup/core/dist/coding-agent-registry.js.map +1 -0
- package/infra/node_modules/@clawup/core/dist/constants.d.ts +137 -0
- package/infra/node_modules/@clawup/core/dist/constants.d.ts.map +1 -0
- package/infra/node_modules/@clawup/core/dist/constants.js +314 -0
- package/infra/node_modules/@clawup/core/dist/constants.js.map +1 -0
- package/infra/node_modules/@clawup/core/dist/dep-registry.d.ts +25 -0
- package/infra/node_modules/@clawup/core/dist/dep-registry.d.ts.map +1 -0
- package/infra/node_modules/@clawup/core/dist/dep-registry.js +46 -0
- package/infra/node_modules/@clawup/core/dist/dep-registry.js.map +1 -0
- package/infra/node_modules/@clawup/core/dist/deps.d.ts +18 -0
- package/infra/node_modules/@clawup/core/dist/deps.d.ts.map +1 -0
- package/infra/node_modules/@clawup/core/dist/deps.js +39 -0
- package/infra/node_modules/@clawup/core/dist/deps.js.map +1 -0
- package/infra/node_modules/@clawup/core/dist/identity.d.ts +20 -0
- package/infra/node_modules/@clawup/core/dist/identity.d.ts.map +1 -0
- package/infra/node_modules/@clawup/core/dist/identity.js +217 -0
- package/infra/node_modules/@clawup/core/dist/identity.js.map +1 -0
- package/infra/node_modules/@clawup/core/dist/index.d.ts +18 -0
- package/infra/node_modules/@clawup/core/dist/index.d.ts.map +1 -0
- package/infra/node_modules/@clawup/core/dist/index.js +52 -0
- package/infra/node_modules/@clawup/core/dist/index.js.map +1 -0
- package/infra/node_modules/@clawup/core/dist/plugin-registry.d.ts +13 -0
- package/infra/node_modules/@clawup/core/dist/plugin-registry.d.ts.map +1 -0
- package/infra/node_modules/@clawup/core/dist/plugin-registry.js +24 -0
- package/infra/node_modules/@clawup/core/dist/plugin-registry.js.map +1 -0
- package/infra/node_modules/@clawup/core/dist/schemas/identity.d.ts +74 -0
- package/infra/node_modules/@clawup/core/dist/schemas/identity.d.ts.map +1 -0
- package/infra/node_modules/@clawup/core/dist/schemas/identity.js +45 -0
- package/infra/node_modules/@clawup/core/dist/schemas/identity.js.map +1 -0
- package/infra/node_modules/@clawup/core/dist/schemas/index.d.ts +6 -0
- package/infra/node_modules/@clawup/core/dist/schemas/index.d.ts.map +1 -0
- package/infra/node_modules/@clawup/core/dist/schemas/index.js +13 -0
- package/infra/node_modules/@clawup/core/dist/schemas/index.js.map +1 -0
- package/infra/node_modules/@clawup/core/dist/schemas/manifest.d.ts +159 -0
- package/infra/node_modules/@clawup/core/dist/schemas/manifest.d.ts.map +1 -0
- package/infra/node_modules/@clawup/core/dist/schemas/manifest.js +54 -0
- package/infra/node_modules/@clawup/core/dist/schemas/manifest.js.map +1 -0
- package/infra/node_modules/@clawup/core/dist/skills.d.ts +30 -0
- package/infra/node_modules/@clawup/core/dist/skills.d.ts.map +1 -0
- package/infra/node_modules/@clawup/core/dist/skills.js +52 -0
- package/infra/node_modules/@clawup/core/dist/skills.js.map +1 -0
- package/infra/node_modules/@clawup/core/dist/types.d.ts +59 -0
- package/infra/node_modules/@clawup/core/dist/types.d.ts.map +1 -0
- package/infra/node_modules/@clawup/core/dist/types.js +30 -0
- package/infra/node_modules/@clawup/core/dist/types.js.map +1 -0
- package/infra/node_modules/@clawup/core/package.json +46 -0
- package/infra/package.json +12 -0
- package/package.json +43 -0
- package/scripts/postinstall.mjs +395 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dep resolution utilities — resolves dep names to registry entries
|
|
3
|
+
* and collects the secret env vars they need.
|
|
4
|
+
*/
|
|
5
|
+
import { DepRegistryEntry } from "./dep-registry";
|
|
6
|
+
export interface ResolvedDep {
|
|
7
|
+
name: string;
|
|
8
|
+
entry: DepRegistryEntry;
|
|
9
|
+
}
|
|
10
|
+
/** Resolve dep names to registry entries. Throws on unknown deps. */
|
|
11
|
+
export declare function resolveDeps(depNames: string[]): ResolvedDep[];
|
|
12
|
+
/** Collect all secret env vars needed by a set of deps. */
|
|
13
|
+
export declare function collectDepSecrets(deps: ResolvedDep[]): {
|
|
14
|
+
envVar: string;
|
|
15
|
+
scope: "agent" | "global";
|
|
16
|
+
configKeySuffix: string;
|
|
17
|
+
}[];
|
|
18
|
+
//# sourceMappingURL=deps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deps.d.ts","sourceRoot":"","sources":["../src/deps.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAgB,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEhE,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,gBAAgB,CAAC;CACzB;AAED,qEAAqE;AACrE,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,CAW7D;AAED,2DAA2D;AAC3D,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,WAAW,EAAE,GAClB;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC;IAAC,eAAe,EAAE,MAAM,CAAA;CAAE,EAAE,CAkB1E"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Dep resolution utilities — resolves dep names to registry entries
|
|
4
|
+
* and collects the secret env vars they need.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.resolveDeps = resolveDeps;
|
|
8
|
+
exports.collectDepSecrets = collectDepSecrets;
|
|
9
|
+
const dep_registry_1 = require("./dep-registry");
|
|
10
|
+
/** Resolve dep names to registry entries. Throws on unknown deps. */
|
|
11
|
+
function resolveDeps(depNames) {
|
|
12
|
+
return depNames.map((name) => {
|
|
13
|
+
const entry = dep_registry_1.DEP_REGISTRY[name];
|
|
14
|
+
if (!entry) {
|
|
15
|
+
const known = Object.keys(dep_registry_1.DEP_REGISTRY).join(", ");
|
|
16
|
+
throw new Error(`Unknown dep "${name}". Known deps: ${known}`);
|
|
17
|
+
}
|
|
18
|
+
return { name, entry };
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
/** Collect all secret env vars needed by a set of deps. */
|
|
22
|
+
function collectDepSecrets(deps) {
|
|
23
|
+
const secrets = [];
|
|
24
|
+
const seen = new Set();
|
|
25
|
+
for (const dep of deps) {
|
|
26
|
+
for (const [suffix, secret] of Object.entries(dep.entry.secrets)) {
|
|
27
|
+
if (!seen.has(secret.envVar)) {
|
|
28
|
+
seen.add(secret.envVar);
|
|
29
|
+
secrets.push({
|
|
30
|
+
envVar: secret.envVar,
|
|
31
|
+
scope: secret.scope,
|
|
32
|
+
configKeySuffix: suffix,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return secrets;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=deps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deps.js","sourceRoot":"","sources":["../src/deps.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAUH,kCAWC;AAGD,8CAoBC;AA1CD,iDAAgE;AAOhE,qEAAqE;AACrE,SAAgB,WAAW,CAAC,QAAkB;IAC5C,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAC3B,MAAM,KAAK,GAAG,2BAAY,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,2BAAY,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnD,MAAM,IAAI,KAAK,CACb,gBAAgB,IAAI,kBAAkB,KAAK,EAAE,CAC9C,CAAC;QACJ,CAAC;QACD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IACzB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,2DAA2D;AAC3D,SAAgB,iBAAiB,CAC/B,IAAmB;IAEnB,MAAM,OAAO,GAA6E,EAAE,CAAC;IAC7F,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAE/B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;YACjE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC7B,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBACxB,OAAO,CAAC,IAAI,CAAC;oBACX,MAAM,EAAE,MAAM,CAAC,MAAM;oBACrB,KAAK,EAAE,MAAM,CAAC,KAAK;oBACnB,eAAe,EAAE,MAAM;iBACxB,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Identity loader — fetches agent identities from Git repos or local paths.
|
|
3
|
+
*
|
|
4
|
+
* An identity is a directory containing an `identity.yaml` manifest and
|
|
5
|
+
* workspace files (SOUL.md, IDENTITY.md, skills/, etc.) that define an agent's
|
|
6
|
+
* persona and capabilities.
|
|
7
|
+
*/
|
|
8
|
+
import type { IdentityManifest, IdentityResult } from "./types";
|
|
9
|
+
/**
|
|
10
|
+
* Validate and parse an identity manifest object using Zod schema.
|
|
11
|
+
* Throws with descriptive errors if required fields are missing or malformed.
|
|
12
|
+
*/
|
|
13
|
+
export declare function parseManifest(raw: unknown, sourcePath: string): IdentityManifest;
|
|
14
|
+
/**
|
|
15
|
+
* Synchronous version of fetchIdentity for use in contexts that don't support async
|
|
16
|
+
* (e.g., Pulumi resource construction).
|
|
17
|
+
*/
|
|
18
|
+
export declare function fetchIdentitySync(source: string, cacheDir: string): IdentityResult;
|
|
19
|
+
export declare function fetchIdentity(source: string, cacheDir: string): Promise<IdentityResult>;
|
|
20
|
+
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AA4IhE;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,gBAAgB,CAyBhF;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,cAAc,CAElF;AAED,wBAAsB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAE7F"}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Identity loader — fetches agent identities from Git repos or local paths.
|
|
4
|
+
*
|
|
5
|
+
* An identity is a directory containing an `identity.yaml` manifest and
|
|
6
|
+
* workspace files (SOUL.md, IDENTITY.md, skills/, etc.) that define an agent's
|
|
7
|
+
* persona and capabilities.
|
|
8
|
+
*/
|
|
9
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.parseManifest = parseManifest;
|
|
14
|
+
exports.fetchIdentitySync = fetchIdentitySync;
|
|
15
|
+
exports.fetchIdentity = fetchIdentity;
|
|
16
|
+
const child_process_1 = require("child_process");
|
|
17
|
+
const fs_1 = require("fs");
|
|
18
|
+
const path_1 = require("path");
|
|
19
|
+
const crypto_1 = require("crypto");
|
|
20
|
+
const yaml_1 = __importDefault(require("yaml"));
|
|
21
|
+
const schemas_1 = require("./schemas");
|
|
22
|
+
/**
|
|
23
|
+
* Simple command runner for git operations.
|
|
24
|
+
* No vendored binary resolution needed — only used for git clone/pull/rm.
|
|
25
|
+
*/
|
|
26
|
+
function capture(command, args = [], cwd) {
|
|
27
|
+
try {
|
|
28
|
+
const result = (0, child_process_1.execFileSync)(command, args, {
|
|
29
|
+
cwd,
|
|
30
|
+
encoding: "utf-8",
|
|
31
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
32
|
+
});
|
|
33
|
+
return { stdout: result.trim(), stderr: "", exitCode: 0 };
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
const e = err;
|
|
37
|
+
return {
|
|
38
|
+
stdout: (e.stdout ?? "").toString().trim(),
|
|
39
|
+
stderr: (e.stderr ?? "").toString().trim(),
|
|
40
|
+
exitCode: e.status ?? 1,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Parse a source string into its components.
|
|
46
|
+
* Supports:
|
|
47
|
+
* - Local paths: `./my-identity`, `/abs/path/to/identity`
|
|
48
|
+
* - Git HTTPS URLs: `https://github.com/org/repo#subfolder`
|
|
49
|
+
* - Git SSH URLs: `git@github.com:org/repo#subfolder`
|
|
50
|
+
*/
|
|
51
|
+
function parseSource(source) {
|
|
52
|
+
// Local path — starts with `.` or `/`
|
|
53
|
+
if (source.startsWith(".") || source.startsWith("/")) {
|
|
54
|
+
return { type: "local", path: source };
|
|
55
|
+
}
|
|
56
|
+
// SSH-style Git URL (git@host:org/repo or user@host:path)
|
|
57
|
+
if (source.startsWith("git@") || /^[\w.-]+@[\w.-]+:/.test(source)) {
|
|
58
|
+
return parseGitUrl(source);
|
|
59
|
+
}
|
|
60
|
+
// HTTPS Git URL — contains ://
|
|
61
|
+
if (source.includes("://")) {
|
|
62
|
+
return parseGitUrl(source);
|
|
63
|
+
}
|
|
64
|
+
// Fallback: treat as local path
|
|
65
|
+
return { type: "local", path: source };
|
|
66
|
+
}
|
|
67
|
+
function parseGitUrl(source) {
|
|
68
|
+
const hashIdx = source.indexOf("#");
|
|
69
|
+
if (hashIdx === -1) {
|
|
70
|
+
return { type: "git", url: source };
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
type: "git",
|
|
74
|
+
url: source.slice(0, hashIdx),
|
|
75
|
+
subfolder: source.slice(hashIdx + 1),
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Generate a stable cache key for a Git URL.
|
|
80
|
+
*/
|
|
81
|
+
function cacheKey(url) {
|
|
82
|
+
return (0, crypto_1.createHash)("sha256").update(url).digest("hex").slice(0, 16);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Clone or update a Git repo into the cache directory.
|
|
86
|
+
* Returns the path to the cloned repo.
|
|
87
|
+
*/
|
|
88
|
+
function ensureRepo(url, cacheDir) {
|
|
89
|
+
(0, fs_1.mkdirSync)(cacheDir, { recursive: true });
|
|
90
|
+
const repoDir = (0, path_1.join)(cacheDir, cacheKey(url));
|
|
91
|
+
if ((0, fs_1.existsSync)((0, path_1.join)(repoDir, ".git"))) {
|
|
92
|
+
// Cache hit — pull latest
|
|
93
|
+
const result = capture("git", ["pull", "--ff-only"], repoDir);
|
|
94
|
+
if (result.exitCode !== 0) {
|
|
95
|
+
// Pull failed (e.g., diverged) — re-clone
|
|
96
|
+
capture("rm", ["-rf", repoDir]);
|
|
97
|
+
const clone = capture("git", ["clone", "--depth", "1", url, repoDir]);
|
|
98
|
+
if (clone.exitCode !== 0) {
|
|
99
|
+
throw new Error(`Failed to clone ${url}: ${clone.stderr}`);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
// Cache miss — shallow clone
|
|
105
|
+
const result = capture("git", ["clone", "--depth", "1", url, repoDir]);
|
|
106
|
+
if (result.exitCode !== 0) {
|
|
107
|
+
throw new Error(`Failed to clone ${url}: ${result.stderr}`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return repoDir;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Recursively read all files in a directory, returning a map of
|
|
114
|
+
* relative paths to file contents (text files only).
|
|
115
|
+
*/
|
|
116
|
+
function readFilesRecursive(dir, base) {
|
|
117
|
+
const root = base ?? dir;
|
|
118
|
+
const files = {};
|
|
119
|
+
for (const entry of (0, fs_1.readdirSync)(dir)) {
|
|
120
|
+
// Skip hidden dirs (e.g., .git)
|
|
121
|
+
if (entry.startsWith("."))
|
|
122
|
+
continue;
|
|
123
|
+
const full = (0, path_1.join)(dir, entry);
|
|
124
|
+
const stat = (0, fs_1.statSync)(full);
|
|
125
|
+
if (stat.isDirectory()) {
|
|
126
|
+
Object.assign(files, readFilesRecursive(full, root));
|
|
127
|
+
}
|
|
128
|
+
else if (stat.isFile()) {
|
|
129
|
+
const rel = (0, path_1.relative)(root, full);
|
|
130
|
+
try {
|
|
131
|
+
files[rel] = (0, fs_1.readFileSync)(full, "utf-8");
|
|
132
|
+
}
|
|
133
|
+
catch {
|
|
134
|
+
// Skip binary / unreadable files
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return files;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Validate and parse an identity manifest object using Zod schema.
|
|
142
|
+
* Throws with descriptive errors if required fields are missing or malformed.
|
|
143
|
+
*/
|
|
144
|
+
function parseManifest(raw, sourcePath) {
|
|
145
|
+
const result = schemas_1.IdentityManifestSchema.safeParse(raw);
|
|
146
|
+
if (!result.success) {
|
|
147
|
+
// Build a human-readable error message from Zod issues
|
|
148
|
+
const issues = result.error.issues;
|
|
149
|
+
// Check for missing required fields
|
|
150
|
+
const missingFields = issues
|
|
151
|
+
.filter((i) => i.code === "invalid_type" && i.received === "undefined")
|
|
152
|
+
.map((i) => i.path.join("."));
|
|
153
|
+
if (missingFields.length > 0) {
|
|
154
|
+
throw new Error(`identity manifest at ${sourcePath} is missing required fields: ${missingFields.join(", ")}`);
|
|
155
|
+
}
|
|
156
|
+
// For other errors, use the first issue's message
|
|
157
|
+
const firstIssue = issues[0];
|
|
158
|
+
const fieldPath = firstIssue.path.length > 0 ? `"${firstIssue.path.join(".")}"` : "root";
|
|
159
|
+
throw new Error(`identity manifest: ${fieldPath} — ${firstIssue.message}`);
|
|
160
|
+
}
|
|
161
|
+
return result.data;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Synchronous version of fetchIdentity for use in contexts that don't support async
|
|
165
|
+
* (e.g., Pulumi resource construction).
|
|
166
|
+
*/
|
|
167
|
+
function fetchIdentitySync(source, cacheDir) {
|
|
168
|
+
return _fetchIdentity(source, cacheDir);
|
|
169
|
+
}
|
|
170
|
+
async function fetchIdentity(source, cacheDir) {
|
|
171
|
+
return _fetchIdentity(source, cacheDir);
|
|
172
|
+
}
|
|
173
|
+
function _fetchIdentity(source, cacheDir) {
|
|
174
|
+
const parsed = parseSource(source);
|
|
175
|
+
let identityDir;
|
|
176
|
+
if (parsed.type === "local") {
|
|
177
|
+
identityDir = (0, path_1.resolve)(parsed.path);
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
const repoDir = ensureRepo(parsed.url, cacheDir);
|
|
181
|
+
identityDir = parsed.subfolder ? (0, path_1.join)(repoDir, parsed.subfolder) : repoDir;
|
|
182
|
+
}
|
|
183
|
+
// Verify the directory exists
|
|
184
|
+
if (!(0, fs_1.existsSync)(identityDir) || !(0, fs_1.statSync)(identityDir).isDirectory()) {
|
|
185
|
+
throw new Error(`Identity directory not found: ${identityDir}`);
|
|
186
|
+
}
|
|
187
|
+
// Read and parse identity manifest (prefer .yaml, fall back to .json for third-party compat)
|
|
188
|
+
const yamlPath = (0, path_1.join)(identityDir, "identity.yaml");
|
|
189
|
+
const jsonPath = (0, path_1.join)(identityDir, "identity.json");
|
|
190
|
+
let manifestPath;
|
|
191
|
+
let manifestFilename;
|
|
192
|
+
if ((0, fs_1.existsSync)(yamlPath)) {
|
|
193
|
+
manifestPath = yamlPath;
|
|
194
|
+
manifestFilename = "identity.yaml";
|
|
195
|
+
}
|
|
196
|
+
else if ((0, fs_1.existsSync)(jsonPath)) {
|
|
197
|
+
manifestPath = jsonPath;
|
|
198
|
+
manifestFilename = "identity.json";
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
throw new Error(`identity.yaml not found in ${identityDir}`);
|
|
202
|
+
}
|
|
203
|
+
let raw;
|
|
204
|
+
try {
|
|
205
|
+
const content = (0, fs_1.readFileSync)(manifestPath, "utf-8");
|
|
206
|
+
raw = manifestFilename.endsWith(".yaml") ? yaml_1.default.parse(content) : JSON.parse(content);
|
|
207
|
+
}
|
|
208
|
+
catch (err) {
|
|
209
|
+
throw new Error(`Failed to parse ${manifestFilename} in ${identityDir}: ${err.message}`);
|
|
210
|
+
}
|
|
211
|
+
const manifest = parseManifest(raw, identityDir);
|
|
212
|
+
// Read all files (excluding the manifest file itself and .git)
|
|
213
|
+
const allFiles = readFilesRecursive(identityDir);
|
|
214
|
+
delete allFiles[manifestFilename];
|
|
215
|
+
return { manifest, files: allFiles };
|
|
216
|
+
}
|
|
217
|
+
//# sourceMappingURL=identity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;AAuJH,sCAyBC;AAMD,8CAEC;AAED,sCAEC;AA1LD,iDAA6C;AAC7C,2BAAgF;AAChF,+BAA+C;AAC/C,mCAAoC;AACpC,gDAAwB;AAExB,uCAAmD;AASnD;;;GAGG;AACH,SAAS,OAAO,CAAC,OAAe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AElC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @clawup/core — shared types, constants, registries, and utilities
|
|
3
|
+
*/
|
|
4
|
+
export type { AgentDefinition, ClawupManifest, IdentityManifest, IdentityResult, PluginConfigFile, PrereqResult, VoidResult, Result, } from "./types";
|
|
5
|
+
export { validateAgentDefinition } from "./types";
|
|
6
|
+
export { AGENT_ALIASES, AWS_REGIONS, BUILT_IN_IDENTITIES, CONFIG_DIR, COST_ESTIMATES, HETZNER_COST_ESTIMATES, HETZNER_LOCATIONS, HETZNER_SERVER_TYPES_EU, HETZNER_SERVER_TYPES_US, HETZNER_US_LOCATIONS, INSTANCE_TYPES, KEY_INSTRUCTIONS, MANIFEST_FILE, MODEL_PROVIDERS, PLUGINS_DIR, PROVIDERS, SSH_USER, hetznerServerTypes, slackAppManifest, tailscaleHostname, } from "./constants";
|
|
7
|
+
export type { PluginRegistryEntry } from "./plugin-registry";
|
|
8
|
+
export { PLUGIN_REGISTRY } from "./plugin-registry";
|
|
9
|
+
export type { CodingAgentEntry } from "./coding-agent-registry";
|
|
10
|
+
export { CODING_AGENT_REGISTRY } from "./coding-agent-registry";
|
|
11
|
+
export type { DepSecret, DepRegistryEntry } from "./dep-registry";
|
|
12
|
+
export { DEP_REGISTRY } from "./dep-registry";
|
|
13
|
+
export type { ResolvedDep } from "./deps";
|
|
14
|
+
export { resolveDeps, collectDepSecrets } from "./deps";
|
|
15
|
+
export type { ParsedSkill } from "./skills";
|
|
16
|
+
export { CLAWHUB_PREFIX, parseSkill, classifySkills } from "./skills";
|
|
17
|
+
export { AgentDefinitionSchema, ClawupManifestSchema, PluginConfigFileSchema, IdentityManifestSchema, } from "./schemas";
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","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+
/**
|
|
3
|
+
* @clawup/core — shared types, constants, registries, and utilities
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.IdentityManifestSchema = exports.PluginConfigFileSchema = exports.ClawupManifestSchema = exports.AgentDefinitionSchema = exports.classifySkills = exports.parseSkill = exports.CLAWHUB_PREFIX = exports.collectDepSecrets = exports.resolveDeps = exports.DEP_REGISTRY = exports.CODING_AGENT_REGISTRY = exports.PLUGIN_REGISTRY = exports.tailscaleHostname = exports.slackAppManifest = exports.hetznerServerTypes = exports.SSH_USER = exports.PROVIDERS = exports.PLUGINS_DIR = exports.MODEL_PROVIDERS = exports.MANIFEST_FILE = exports.KEY_INSTRUCTIONS = exports.INSTANCE_TYPES = exports.HETZNER_US_LOCATIONS = exports.HETZNER_SERVER_TYPES_US = exports.HETZNER_SERVER_TYPES_EU = exports.HETZNER_LOCATIONS = exports.HETZNER_COST_ESTIMATES = exports.COST_ESTIMATES = exports.CONFIG_DIR = exports.BUILT_IN_IDENTITIES = exports.AWS_REGIONS = exports.AGENT_ALIASES = exports.validateAgentDefinition = void 0;
|
|
7
|
+
var types_1 = require("./types");
|
|
8
|
+
Object.defineProperty(exports, "validateAgentDefinition", { enumerable: true, get: function () { return types_1.validateAgentDefinition; } });
|
|
9
|
+
// Constants
|
|
10
|
+
var constants_1 = require("./constants");
|
|
11
|
+
Object.defineProperty(exports, "AGENT_ALIASES", { enumerable: true, get: function () { return constants_1.AGENT_ALIASES; } });
|
|
12
|
+
Object.defineProperty(exports, "AWS_REGIONS", { enumerable: true, get: function () { return constants_1.AWS_REGIONS; } });
|
|
13
|
+
Object.defineProperty(exports, "BUILT_IN_IDENTITIES", { enumerable: true, get: function () { return constants_1.BUILT_IN_IDENTITIES; } });
|
|
14
|
+
Object.defineProperty(exports, "CONFIG_DIR", { enumerable: true, get: function () { return constants_1.CONFIG_DIR; } });
|
|
15
|
+
Object.defineProperty(exports, "COST_ESTIMATES", { enumerable: true, get: function () { return constants_1.COST_ESTIMATES; } });
|
|
16
|
+
Object.defineProperty(exports, "HETZNER_COST_ESTIMATES", { enumerable: true, get: function () { return constants_1.HETZNER_COST_ESTIMATES; } });
|
|
17
|
+
Object.defineProperty(exports, "HETZNER_LOCATIONS", { enumerable: true, get: function () { return constants_1.HETZNER_LOCATIONS; } });
|
|
18
|
+
Object.defineProperty(exports, "HETZNER_SERVER_TYPES_EU", { enumerable: true, get: function () { return constants_1.HETZNER_SERVER_TYPES_EU; } });
|
|
19
|
+
Object.defineProperty(exports, "HETZNER_SERVER_TYPES_US", { enumerable: true, get: function () { return constants_1.HETZNER_SERVER_TYPES_US; } });
|
|
20
|
+
Object.defineProperty(exports, "HETZNER_US_LOCATIONS", { enumerable: true, get: function () { return constants_1.HETZNER_US_LOCATIONS; } });
|
|
21
|
+
Object.defineProperty(exports, "INSTANCE_TYPES", { enumerable: true, get: function () { return constants_1.INSTANCE_TYPES; } });
|
|
22
|
+
Object.defineProperty(exports, "KEY_INSTRUCTIONS", { enumerable: true, get: function () { return constants_1.KEY_INSTRUCTIONS; } });
|
|
23
|
+
Object.defineProperty(exports, "MANIFEST_FILE", { enumerable: true, get: function () { return constants_1.MANIFEST_FILE; } });
|
|
24
|
+
Object.defineProperty(exports, "MODEL_PROVIDERS", { enumerable: true, get: function () { return constants_1.MODEL_PROVIDERS; } });
|
|
25
|
+
Object.defineProperty(exports, "PLUGINS_DIR", { enumerable: true, get: function () { return constants_1.PLUGINS_DIR; } });
|
|
26
|
+
Object.defineProperty(exports, "PROVIDERS", { enumerable: true, get: function () { return constants_1.PROVIDERS; } });
|
|
27
|
+
Object.defineProperty(exports, "SSH_USER", { enumerable: true, get: function () { return constants_1.SSH_USER; } });
|
|
28
|
+
Object.defineProperty(exports, "hetznerServerTypes", { enumerable: true, get: function () { return constants_1.hetznerServerTypes; } });
|
|
29
|
+
Object.defineProperty(exports, "slackAppManifest", { enumerable: true, get: function () { return constants_1.slackAppManifest; } });
|
|
30
|
+
Object.defineProperty(exports, "tailscaleHostname", { enumerable: true, get: function () { return constants_1.tailscaleHostname; } });
|
|
31
|
+
var plugin_registry_1 = require("./plugin-registry");
|
|
32
|
+
Object.defineProperty(exports, "PLUGIN_REGISTRY", { enumerable: true, get: function () { return plugin_registry_1.PLUGIN_REGISTRY; } });
|
|
33
|
+
var coding_agent_registry_1 = require("./coding-agent-registry");
|
|
34
|
+
Object.defineProperty(exports, "CODING_AGENT_REGISTRY", { enumerable: true, get: function () { return coding_agent_registry_1.CODING_AGENT_REGISTRY; } });
|
|
35
|
+
var dep_registry_1 = require("./dep-registry");
|
|
36
|
+
Object.defineProperty(exports, "DEP_REGISTRY", { enumerable: true, get: function () { return dep_registry_1.DEP_REGISTRY; } });
|
|
37
|
+
var deps_1 = require("./deps");
|
|
38
|
+
Object.defineProperty(exports, "resolveDeps", { enumerable: true, get: function () { return deps_1.resolveDeps; } });
|
|
39
|
+
Object.defineProperty(exports, "collectDepSecrets", { enumerable: true, get: function () { return deps_1.collectDepSecrets; } });
|
|
40
|
+
var skills_1 = require("./skills");
|
|
41
|
+
Object.defineProperty(exports, "CLAWHUB_PREFIX", { enumerable: true, get: function () { return skills_1.CLAWHUB_PREFIX; } });
|
|
42
|
+
Object.defineProperty(exports, "parseSkill", { enumerable: true, get: function () { return skills_1.parseSkill; } });
|
|
43
|
+
Object.defineProperty(exports, "classifySkills", { enumerable: true, get: function () { return skills_1.classifySkills; } });
|
|
44
|
+
// Identity — re-exported from "@clawup/core/identity" subpath to avoid
|
|
45
|
+
// pulling Node.js-only modules (fs, child_process) into browser bundles.
|
|
46
|
+
// Schemas
|
|
47
|
+
var schemas_1 = require("./schemas");
|
|
48
|
+
Object.defineProperty(exports, "AgentDefinitionSchema", { enumerable: true, get: function () { return schemas_1.AgentDefinitionSchema; } });
|
|
49
|
+
Object.defineProperty(exports, "ClawupManifestSchema", { enumerable: true, get: function () { return schemas_1.ClawupManifestSchema; } });
|
|
50
|
+
Object.defineProperty(exports, "PluginConfigFileSchema", { enumerable: true, get: function () { return schemas_1.PluginConfigFileSchema; } });
|
|
51
|
+
Object.defineProperty(exports, "IdentityManifestSchema", { enumerable: true, get: function () { return schemas_1.IdentityManifestSchema; } });
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAaH,iCAAkD;AAAzC,gHAAA,uBAAuB,OAAA;AAEhC,YAAY;AACZ,yCAqBqB;AApBnB,0GAAA,aAAa,OAAA;AACb,wGAAA,WAAW,OAAA;AACX,gHAAA,mBAAmB,OAAA;AACnB,uGAAA,UAAU,OAAA;AACV,2GAAA,cAAc,OAAA;AACd,mHAAA,sBAAsB,OAAA;AACtB,8GAAA,iBAAiB,OAAA;AACjB,oHAAA,uBAAuB,OAAA;AACvB,oHAAA,uBAAuB,OAAA;AACvB,iHAAA,oBAAoB,OAAA;AACpB,2GAAA,cAAc,OAAA;AACd,6GAAA,gBAAgB,OAAA;AAChB,0GAAA,aAAa,OAAA;AACb,4GAAA,eAAe,OAAA;AACf,wGAAA,WAAW,OAAA;AACX,sGAAA,SAAS,OAAA;AACT,qGAAA,QAAQ,OAAA;AACR,+GAAA,kBAAkB,OAAA;AAClB,6GAAA,gBAAgB,OAAA;AAChB,8GAAA,iBAAiB,OAAA;AAKnB,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AAIxB,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA;AAI9B,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AAIrB,+BAAwD;AAA/C,mGAAA,WAAW,OAAA;AAAE,yGAAA,iBAAiB,OAAA;AAIvC,mCAAsE;AAA7D,wGAAA,cAAc,OAAA;AAAE,oGAAA,UAAU,OAAA;AAAE,wGAAA,cAAc,OAAA;AAEnD,uEAAuE;AACvE,yEAAyE;AAEzE,UAAU;AACV,qCAKmB;AAJjB,gHAAA,qBAAqB,OAAA;AACrB,+GAAA,oBAAoB,OAAA;AACpB,iHAAA,sBAAsB,OAAA;AACtB,iHAAA,sBAAsB,OAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared plugin registry — metadata used by both index.ts (Pulumi) and the CLI.
|
|
3
|
+
*/
|
|
4
|
+
export interface PluginRegistryEntry {
|
|
5
|
+
/** Secret env var mappings: { configKey: envVarName } */
|
|
6
|
+
secretEnvVars: Record<string, string>;
|
|
7
|
+
/** Whether to run `openclaw plugins install` during cloud-init */
|
|
8
|
+
installable: boolean;
|
|
9
|
+
/** Whether this plugin needs Tailscale Funnel (public HTTPS for webhooks) */
|
|
10
|
+
needsFunnel?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const PLUGIN_REGISTRY: Record<string, PluginRegistryEntry>;
|
|
13
|
+
//# sourceMappingURL=plugin-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-registry.d.ts","sourceRoot":"","sources":["../src/plugin-registry.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,mBAAmB;IAClC,yDAAyD;IACzD,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,kEAAkE;IAClE,WAAW,EAAE,OAAO,CAAC;IACrB,6EAA6E;IAC7E,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAgB/D,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared plugin registry — metadata used by both index.ts (Pulumi) and the CLI.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PLUGIN_REGISTRY = void 0;
|
|
7
|
+
exports.PLUGIN_REGISTRY = {
|
|
8
|
+
"openclaw-linear": {
|
|
9
|
+
secretEnvVars: {
|
|
10
|
+
apiKey: "LINEAR_API_KEY",
|
|
11
|
+
webhookSecret: "LINEAR_WEBHOOK_SECRET",
|
|
12
|
+
},
|
|
13
|
+
installable: true,
|
|
14
|
+
needsFunnel: true,
|
|
15
|
+
},
|
|
16
|
+
slack: {
|
|
17
|
+
secretEnvVars: {
|
|
18
|
+
botToken: "SLACK_BOT_TOKEN",
|
|
19
|
+
appToken: "SLACK_APP_TOKEN",
|
|
20
|
+
},
|
|
21
|
+
installable: false,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=plugin-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-registry.js","sourceRoot":"","sources":["../src/plugin-registry.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAWU,QAAA,eAAe,GAAwC;IAClE,iBAAiB,EAAE;QACjB,aAAa,EAAE;YACb,MAAM,EAAE,gBAAgB;YACxB,aAAa,EAAE,uBAAuB;SACvC;QACD,WAAW,EAAE,IAAI;QACjB,WAAW,EAAE,IAAI;KAClB;IACD,KAAK,EAAE;QACL,aAAa,EAAE;YACb,QAAQ,EAAE,iBAAiB;YAC3B,QAAQ,EAAE,iBAAiB;SAC5B;QACD,WAAW,EAAE,KAAK;KACnB;CACF,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for identity.yaml manifests.
|
|
3
|
+
* Source of truth — the IdentityManifest type is derived via z.infer<>.
|
|
4
|
+
*/
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
/** Schema for an agent identity manifest (identity.yaml) */
|
|
7
|
+
export declare const IdentityManifestSchema: z.ZodObject<{
|
|
8
|
+
/** Machine-readable identity name (e.g., "juno", "titus") */
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
/** Human-readable display name (e.g., "Juno", "Titus") */
|
|
11
|
+
displayName: z.ZodString;
|
|
12
|
+
/** Role identifier (e.g., "pm", "eng", "tester") */
|
|
13
|
+
role: z.ZodString;
|
|
14
|
+
/** Emoji for the agent (GitHub shortcode, e.g., "clipboard") */
|
|
15
|
+
emoji: z.ZodString;
|
|
16
|
+
/** Short description of the agent's purpose */
|
|
17
|
+
description: z.ZodString;
|
|
18
|
+
/** Default EBS volume size in GB */
|
|
19
|
+
volumeSize: z.ZodNumber;
|
|
20
|
+
/** Optional default instance type override */
|
|
21
|
+
instanceType: z.ZodOptional<z.ZodString>;
|
|
22
|
+
/**
|
|
23
|
+
* List of skill identifiers for this identity.
|
|
24
|
+
* Plain names are private skills; "clawhub:" prefixed are public.
|
|
25
|
+
*/
|
|
26
|
+
skills: z.ZodArray<z.ZodString, "many">;
|
|
27
|
+
/** Recommended plugins for this identity (e.g., ["openclaw-linear"]) */
|
|
28
|
+
plugins: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
29
|
+
/** Recommended deps for this identity (e.g., ["gh", "brave-search"]) */
|
|
30
|
+
deps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
31
|
+
/** Per-plugin default config (merged with user plugin config at deploy time) */
|
|
32
|
+
pluginDefaults: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
33
|
+
/** List of template variable names this identity uses */
|
|
34
|
+
templateVars: z.ZodArray<z.ZodString, "many">;
|
|
35
|
+
/** Default AI model for this identity (e.g., "anthropic/claude-opus-4-6") */
|
|
36
|
+
model: z.ZodOptional<z.ZodString>;
|
|
37
|
+
/** Backup/fallback model (e.g., "anthropic/claude-sonnet-4-5") */
|
|
38
|
+
backupModel: z.ZodOptional<z.ZodString>;
|
|
39
|
+
/** Coding agent CLI to use (e.g., "claude-code", "codex", "amp"). Defaults to "claude-code". */
|
|
40
|
+
codingAgent: z.ZodOptional<z.ZodString>;
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
name: string;
|
|
43
|
+
displayName: string;
|
|
44
|
+
role: string;
|
|
45
|
+
volumeSize: number;
|
|
46
|
+
emoji: string;
|
|
47
|
+
templateVars: string[];
|
|
48
|
+
description: string;
|
|
49
|
+
skills: string[];
|
|
50
|
+
plugins?: string[] | undefined;
|
|
51
|
+
instanceType?: string | undefined;
|
|
52
|
+
deps?: string[] | undefined;
|
|
53
|
+
pluginDefaults?: Record<string, Record<string, unknown>> | undefined;
|
|
54
|
+
model?: string | undefined;
|
|
55
|
+
backupModel?: string | undefined;
|
|
56
|
+
codingAgent?: string | undefined;
|
|
57
|
+
}, {
|
|
58
|
+
name: string;
|
|
59
|
+
displayName: string;
|
|
60
|
+
role: string;
|
|
61
|
+
volumeSize: number;
|
|
62
|
+
emoji: string;
|
|
63
|
+
templateVars: string[];
|
|
64
|
+
description: string;
|
|
65
|
+
skills: string[];
|
|
66
|
+
plugins?: string[] | undefined;
|
|
67
|
+
instanceType?: string | undefined;
|
|
68
|
+
deps?: string[] | undefined;
|
|
69
|
+
pluginDefaults?: Record<string, Record<string, unknown>> | undefined;
|
|
70
|
+
model?: string | undefined;
|
|
71
|
+
backupModel?: string | undefined;
|
|
72
|
+
codingAgent?: string | undefined;
|
|
73
|
+
}>;
|
|
74
|
+
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/schemas/identity.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,4DAA4D;AAC5D,eAAO,MAAM,sBAAsB;IACjC,6DAA6D;;IAE7D,0DAA0D;;IAE1D,oDAAoD;;IAEpD,gEAAgE;;IAEhE,+CAA+C;;IAE/C,oCAAoC;;IAEpC,8CAA8C;;IAE9C;;;OAGG;;IAEH,wEAAwE;;IAKxE,wEAAwE;;IAExE,gFAAgF;;IAKhF,yDAAyD;;IAEzD,6EAA6E;;IAE7E,kEAAkE;;IAElE,gGAAgG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEhG,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Zod schema for identity.yaml manifests.
|
|
4
|
+
* Source of truth — the IdentityManifest type is derived via z.infer<>.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.IdentityManifestSchema = void 0;
|
|
8
|
+
const zod_1 = require("zod");
|
|
9
|
+
/** Schema for an agent identity manifest (identity.yaml) */
|
|
10
|
+
exports.IdentityManifestSchema = zod_1.z.object({
|
|
11
|
+
/** Machine-readable identity name (e.g., "juno", "titus") */
|
|
12
|
+
name: zod_1.z.string().min(1, '"name" must be a non-empty string'),
|
|
13
|
+
/** Human-readable display name (e.g., "Juno", "Titus") */
|
|
14
|
+
displayName: zod_1.z.string().min(1, '"displayName" must be a non-empty string'),
|
|
15
|
+
/** Role identifier (e.g., "pm", "eng", "tester") */
|
|
16
|
+
role: zod_1.z.string().min(1, '"role" must be a non-empty string'),
|
|
17
|
+
/** Emoji for the agent (GitHub shortcode, e.g., "clipboard") */
|
|
18
|
+
emoji: zod_1.z.string().min(1, '"emoji" must be a non-empty string'),
|
|
19
|
+
/** Short description of the agent's purpose */
|
|
20
|
+
description: zod_1.z.string().min(1, '"description" must be a non-empty string'),
|
|
21
|
+
/** Default EBS volume size in GB */
|
|
22
|
+
volumeSize: zod_1.z.number({ invalid_type_error: '"volumeSize" must be a number' }).positive(),
|
|
23
|
+
/** Optional default instance type override */
|
|
24
|
+
instanceType: zod_1.z.string().optional(),
|
|
25
|
+
/**
|
|
26
|
+
* List of skill identifiers for this identity.
|
|
27
|
+
* Plain names are private skills; "clawhub:" prefixed are public.
|
|
28
|
+
*/
|
|
29
|
+
skills: zod_1.z.array(zod_1.z.string(), { invalid_type_error: '"skills" must be an array' }),
|
|
30
|
+
/** Recommended plugins for this identity (e.g., ["openclaw-linear"]) */
|
|
31
|
+
plugins: zod_1.z.array(zod_1.z.string().min(1, "each plugin must be a non-empty string"), { invalid_type_error: '"plugins" must be an array of strings' }).optional(),
|
|
32
|
+
/** Recommended deps for this identity (e.g., ["gh", "brave-search"]) */
|
|
33
|
+
deps: zod_1.z.array(zod_1.z.string()).optional(),
|
|
34
|
+
/** Per-plugin default config (merged with user plugin config at deploy time) */
|
|
35
|
+
pluginDefaults: zod_1.z.record(zod_1.z.string(), zod_1.z.record(zod_1.z.string(), zod_1.z.unknown())).optional(),
|
|
36
|
+
/** List of template variable names this identity uses */
|
|
37
|
+
templateVars: zod_1.z.array(zod_1.z.string(), { invalid_type_error: '"templateVars" must be an array' }),
|
|
38
|
+
/** Default AI model for this identity (e.g., "anthropic/claude-opus-4-6") */
|
|
39
|
+
model: zod_1.z.string().optional(),
|
|
40
|
+
/** Backup/fallback model (e.g., "anthropic/claude-sonnet-4-5") */
|
|
41
|
+
backupModel: zod_1.z.string().optional(),
|
|
42
|
+
/** Coding agent CLI to use (e.g., "claude-code", "codex", "amp"). Defaults to "claude-code". */
|
|
43
|
+
codingAgent: zod_1.z.string().optional(),
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=identity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/schemas/identity.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6BAAwB;AAExB,4DAA4D;AAC/C,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,6DAA6D;IAC7D,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,mCAAmC,CAAC;IAC5D,0DAA0D;IAC1D,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,0CAA0C,CAAC;IAC1E,oDAAoD;IACpD,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,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QAAQ,EAAE;IAC5B,kEAAkE;IAClE,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,gGAAgG;IAChG,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,sBAAsB,GACvB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Barrel export for all Zod schemas.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.IdentityManifestSchema = exports.PluginConfigFileSchema = exports.ClawupManifestSchema = exports.AgentDefinitionSchema = void 0;
|
|
7
|
+
var manifest_1 = require("./manifest");
|
|
8
|
+
Object.defineProperty(exports, "AgentDefinitionSchema", { enumerable: true, get: function () { return manifest_1.AgentDefinitionSchema; } });
|
|
9
|
+
Object.defineProperty(exports, "ClawupManifestSchema", { enumerable: true, get: function () { return manifest_1.ClawupManifestSchema; } });
|
|
10
|
+
Object.defineProperty(exports, "PluginConfigFileSchema", { enumerable: true, get: function () { return manifest_1.PluginConfigFileSchema; } });
|
|
11
|
+
var identity_1 = require("./identity");
|
|
12
|
+
Object.defineProperty(exports, "IdentityManifestSchema", { enumerable: true, get: function () { return identity_1.IdentityManifestSchema; } });
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,uCAIoB;AAHlB,iHAAA,qBAAqB,OAAA;AACrB,gHAAA,oBAAoB,OAAA;AACpB,kHAAA,sBAAsB,OAAA;AAGxB,uCAEoB;AADlB,kHAAA,sBAAsB,OAAA"}
|