@crewhaus/target-crew 0.1.8 → 0.2.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/dist/index.d.ts +2 -2
- package/dist/index.js +7 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
* future shell pipeline consumer) can parse them deterministically.
|
|
18
18
|
*/
|
|
19
19
|
import { CrewhausError } from "@crewhaus/errors";
|
|
20
|
-
import type
|
|
20
|
+
import { type Bundle, type EmitReadmeOptions, type IrCrewV0 } from "@crewhaus/ir";
|
|
21
21
|
export declare class TargetEmitError extends CrewhausError {
|
|
22
22
|
readonly name = "TargetEmitError";
|
|
23
23
|
constructor(message: string, cause?: unknown);
|
|
24
24
|
}
|
|
25
|
-
export declare function emitCrew(ir: IrCrewV0): Bundle;
|
|
25
|
+
export declare function emitCrew(ir: IrCrewV0, opts?: EmitReadmeOptions): Bundle;
|
package/dist/index.js
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { CrewhausError } from "@crewhaus/errors";
|
|
20
20
|
import { escapeJsonString } from "@crewhaus/infra-utils";
|
|
21
|
+
import { renderBundleReadme, } from "@crewhaus/ir";
|
|
21
22
|
export class TargetEmitError extends CrewhausError {
|
|
22
23
|
name = "TargetEmitError";
|
|
23
24
|
constructor(message, cause) {
|
|
@@ -64,7 +65,7 @@ const BUILTIN_TOOL_MAP = {
|
|
|
64
65
|
codegraphCallees: { package: "@crewhaus/tool-codegraph", export: "codegraphCallees" },
|
|
65
66
|
codegraphImpact: { package: "@crewhaus/tool-codegraph", export: "codegraphImpact" },
|
|
66
67
|
};
|
|
67
|
-
export function emitCrew(ir) {
|
|
68
|
+
export function emitCrew(ir, opts = {}) {
|
|
68
69
|
if (ir.roles.length === 0) {
|
|
69
70
|
throw new TargetEmitError("crew target requires at least one role");
|
|
70
71
|
}
|
|
@@ -81,6 +82,11 @@ export function emitCrew(ir) {
|
|
|
81
82
|
for (const role of ir.roles) {
|
|
82
83
|
files.push({ path: `agent_${safeFileName(role.name)}.ts`, content: renderRoleAgent(ir, role) });
|
|
83
84
|
}
|
|
85
|
+
// Item 42 — generated bundle README; default ON (`crewhaus compile
|
|
86
|
+
// --no-readme` opts out).
|
|
87
|
+
if (opts.readme !== false) {
|
|
88
|
+
files.push({ path: "README.md", content: renderBundleReadme(ir) });
|
|
89
|
+
}
|
|
84
90
|
return { files };
|
|
85
91
|
}
|
|
86
92
|
function safeFileName(role) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crewhaus/target-crew",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Codegen for the CRW target — emits a daemon + per-role agent files driven by crew-orchestrator (Section 22)",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"test": "bun test src"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@crewhaus/errors": "0.
|
|
19
|
-
"@crewhaus/infra-utils": "0.
|
|
20
|
-
"@crewhaus/ir": "0.
|
|
18
|
+
"@crewhaus/errors": "0.2.0",
|
|
19
|
+
"@crewhaus/infra-utils": "0.2.0",
|
|
20
|
+
"@crewhaus/ir": "0.2.0"
|
|
21
21
|
},
|
|
22
22
|
"license": "Apache-2.0",
|
|
23
23
|
"author": {
|