@pulsemcp/air-cli 0.0.1 → 0.0.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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepare.d.ts","sourceRoot":"","sources":["../../src/commands/prepare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC,wBAAgB,cAAc,IAAI,OAAO,CAsGxC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { dirname } from "path";
|
|
3
|
+
import { getAirJsonPath, resolveArtifacts, } from "@pulsemcp/air-core";
|
|
4
|
+
import { findAdapter, listAvailableAdapters } from "../adapter-registry.js";
|
|
5
|
+
export function prepareCommand() {
|
|
6
|
+
const cmd = new Command("prepare")
|
|
7
|
+
.description("Prepare a target directory for an agent session (write .mcp.json, inject skills) without starting the agent")
|
|
8
|
+
.option("--config <path>", "Path to air.json (defaults to AIR_CONFIG env or ~/.air/air.json)")
|
|
9
|
+
.option("--root <name>", "Root to activate (filters artifacts by root defaults)")
|
|
10
|
+
.option("--target <dir>", "Target directory to prepare (defaults to cwd)", process.cwd())
|
|
11
|
+
.option("--adapter <name>", "Agent adapter to use (e.g., claude)", "claude")
|
|
12
|
+
.option("--skills <ids>", "Comma-separated skill IDs (overrides root defaults)")
|
|
13
|
+
.option("--mcp-servers <ids>", "Comma-separated MCP server IDs (overrides root defaults)")
|
|
14
|
+
.action(async (options) => {
|
|
15
|
+
// Find the adapter
|
|
16
|
+
const adapter = await findAdapter(options.adapter);
|
|
17
|
+
if (!adapter) {
|
|
18
|
+
const available = await listAvailableAdapters();
|
|
19
|
+
const availableMsg = available.length > 0
|
|
20
|
+
? `Available: ${available.join(", ")}`
|
|
21
|
+
: "No adapters installed";
|
|
22
|
+
console.error(`Error: No adapter found for "${options.adapter}". ${availableMsg}.`);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
// Resolve air.json path
|
|
26
|
+
const airJsonPath = options.config || getAirJsonPath();
|
|
27
|
+
if (!airJsonPath) {
|
|
28
|
+
console.error("Error: No air.json found. Specify --config or set AIR_CONFIG env var.");
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
// Load and resolve all artifacts
|
|
32
|
+
const artifacts = await resolveArtifacts(airJsonPath);
|
|
33
|
+
const baseDir = dirname(airJsonPath);
|
|
34
|
+
// Resolve root if specified
|
|
35
|
+
let root;
|
|
36
|
+
if (options.root) {
|
|
37
|
+
root = artifacts.roots[options.root];
|
|
38
|
+
if (!root) {
|
|
39
|
+
console.error(`Error: Root "${options.root}" not found. Available roots: ${Object.keys(artifacts.roots).join(", ") || "(none)"}`);
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
// Parse overrides
|
|
44
|
+
const skillOverrides = options.skills
|
|
45
|
+
? options.skills.split(",").map((s) => s.trim())
|
|
46
|
+
: undefined;
|
|
47
|
+
const mcpServerOverrides = options.mcpServers
|
|
48
|
+
? options.mcpServers.split(",").map((s) => s.trim())
|
|
49
|
+
: undefined;
|
|
50
|
+
// Prepare the session
|
|
51
|
+
const result = await adapter.prepareSession(artifacts, options.target, {
|
|
52
|
+
root,
|
|
53
|
+
baseDir,
|
|
54
|
+
skillOverrides,
|
|
55
|
+
mcpServerOverrides,
|
|
56
|
+
});
|
|
57
|
+
// Output structured JSON to stdout for orchestrator consumption
|
|
58
|
+
console.log(JSON.stringify(result, null, 2));
|
|
59
|
+
});
|
|
60
|
+
return cmd;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=prepare.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepare.js","sourceRoot":"","sources":["../../src/commands/prepare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,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cAAc;YACd,kBAAkB;SACnB,CACF,CAAC;QAEF,gEAAgE;QAChE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC/C,CAAC,CACF,CAAC;IAEJ,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,15 +2,17 @@
|
|
|
2
2
|
import { Command } from "commander";
|
|
3
3
|
import { validateCommand } from "./commands/validate.js";
|
|
4
4
|
import { startCommand } from "./commands/start.js";
|
|
5
|
+
import { prepareCommand } from "./commands/prepare.js";
|
|
5
6
|
import { listCommand } from "./commands/list.js";
|
|
6
7
|
import { initCommand } from "./commands/init.js";
|
|
7
8
|
const program = new Command();
|
|
8
9
|
program
|
|
9
10
|
.name("air")
|
|
10
11
|
.description("AIR \u2014 Agent Infrastructure Repository CLI")
|
|
11
|
-
.version("0.0.
|
|
12
|
+
.version("0.0.2");
|
|
12
13
|
program.addCommand(validateCommand());
|
|
13
14
|
program.addCommand(startCommand());
|
|
15
|
+
program.addCommand(prepareCommand());
|
|
14
16
|
program.addCommand(listCommand());
|
|
15
17
|
program.addCommand(initCommand());
|
|
16
18
|
program.parseAsync();
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,KAAK,CAAC;KACX,W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@pulsemcp/air-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"lint": "tsc --noEmit"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@pulsemcp/air-core": "0.0.
|
|
30
|
-
"@pulsemcp/air-adapter-claude": "0.0.
|
|
29
|
+
"@pulsemcp/air-core": "0.0.2",
|
|
30
|
+
"@pulsemcp/air-adapter-claude": "0.0.2",
|
|
31
31
|
"commander": "^12.1.0",
|
|
32
32
|
"chalk": "^5.3.0"
|
|
33
33
|
},
|