@aiassesstech/sam 0.1.0 → 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/agent/AGENTS.md +228 -0
- package/agent/BKUP/AGENTS.md.bkup +223 -0
- package/agent/BKUP/IDENTITY.md.bkup +13 -0
- package/agent/BKUP/SOUL.md.bkup +132 -0
- package/agent/IDENTITY.md +13 -0
- package/agent/SOUL.md +132 -0
- package/dist/cli/bin.d.ts +8 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/bin.js +12 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/runner.d.ts +10 -0
- package/dist/cli/runner.d.ts.map +1 -0
- package/dist/cli/runner.js +67 -0
- package/dist/cli/runner.js.map +1 -0
- package/dist/cli/setup.d.ts +28 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js +291 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/pipeline/pipeline-manager.d.ts +34 -0
- package/dist/pipeline/pipeline-manager.d.ts.map +1 -0
- package/dist/pipeline/pipeline-manager.js +186 -0
- package/dist/pipeline/pipeline-manager.js.map +1 -0
- package/dist/pipeline/pipeline-store.d.ts +18 -0
- package/dist/pipeline/pipeline-store.d.ts.map +1 -0
- package/dist/pipeline/pipeline-store.js +70 -0
- package/dist/pipeline/pipeline-store.js.map +1 -0
- package/dist/pipeline/types.d.ts +73 -0
- package/dist/pipeline/types.d.ts.map +1 -0
- package/dist/pipeline/types.js +30 -0
- package/dist/pipeline/types.js.map +1 -0
- package/dist/plugin.d.ts +19 -10
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +153 -13
- package/dist/plugin.js.map +1 -1
- package/dist/tools/sam-pipeline.d.ts +35 -0
- package/dist/tools/sam-pipeline.d.ts.map +1 -0
- package/dist/tools/sam-pipeline.js +72 -0
- package/dist/tools/sam-pipeline.js.map +1 -0
- package/dist/tools/sam-report.d.ts +36 -0
- package/dist/tools/sam-report.d.ts.map +1 -0
- package/dist/tools/sam-report.js +174 -0
- package/dist/tools/sam-report.js.map +1 -0
- package/dist/tools/sam-request.d.ts +55 -0
- package/dist/tools/sam-request.d.ts.map +1 -0
- package/dist/tools/sam-request.js +91 -0
- package/dist/tools/sam-request.js.map +1 -0
- package/dist/tools/sam-status.d.ts +29 -0
- package/dist/tools/sam-status.d.ts.map +1 -0
- package/dist/tools/sam-status.js +42 -0
- package/dist/tools/sam-status.js.map +1 -0
- package/openclaw.plugin.json +39 -3
- package/package.json +20 -7
package/dist/plugin.js
CHANGED
|
@@ -1,20 +1,156 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Sam (SAM2) — OpenClaw Plugin Entry Point
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* Commander but does NOT initiate outbound fleet communication.
|
|
4
|
+
* This is the ONLY export OpenClaw cares about for plugin loading.
|
|
5
|
+
* The library exports live in index.ts.
|
|
7
6
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* This adapter:
|
|
8
|
+
* 1. Reads plugin config from api.config (+ openclaw.json fallback)
|
|
9
|
+
* 2. Creates PipelineManager eagerly (not lazy)
|
|
10
|
+
* 3. Registers 4 Phase 1 tools, 1 command
|
|
11
|
+
* 4. Conditionally registers Phase 2 sandbox tools (when sandboxEnabled)
|
|
12
|
+
* 5. Wires fleet-bus integration (optional peer dep)
|
|
11
13
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
14
|
+
* CRITICAL: Every registration follows the EXACT shapes from
|
|
15
|
+
* GUIDE-OPENCLAW-PLUGIN-DEVELOPMENT.md to avoid the 7 registration traps.
|
|
16
|
+
*
|
|
17
|
+
* Registration rules (rule 150-openclaw-plugin-standards):
|
|
18
|
+
* - execute uses method syntax, NOT arrow function
|
|
19
|
+
* - parameters has type: "object" even when empty
|
|
20
|
+
* - First param to execute is always _toolCallId: string
|
|
21
|
+
* - Command name has NO leading slash
|
|
22
|
+
* - Command has acceptsArgs: true
|
|
23
|
+
* - Service uses id, NOT name
|
|
15
24
|
*/
|
|
25
|
+
import * as fs from 'node:fs';
|
|
26
|
+
import * as path from 'node:path';
|
|
27
|
+
import { PipelineManager } from './pipeline/pipeline-manager.js';
|
|
28
|
+
import { createStatusTool } from './tools/sam-status.js';
|
|
29
|
+
import { createPipelineTool } from './tools/sam-pipeline.js';
|
|
30
|
+
import { createRequestTool } from './tools/sam-request.js';
|
|
31
|
+
import { createReportTool } from './tools/sam-report.js';
|
|
32
|
+
import { DEFAULT_CONFIG } from './pipeline/types.js';
|
|
33
|
+
// ── Config Helpers ───────────────────────────────────────────────
|
|
34
|
+
function resolveOpenClawHome() {
|
|
35
|
+
return (process.env.OPENCLAW_HOME ||
|
|
36
|
+
path.join(process.env.HOME || '~', '.openclaw'));
|
|
37
|
+
}
|
|
38
|
+
function loadOpenClawConfig() {
|
|
39
|
+
const candidates = [
|
|
40
|
+
path.join(resolveOpenClawHome(), 'openclaw.json'),
|
|
41
|
+
path.join(process.env.HOME || '~', '.clawdbot', 'openclaw.json'),
|
|
42
|
+
];
|
|
43
|
+
for (const configPath of candidates) {
|
|
44
|
+
try {
|
|
45
|
+
if (fs.existsSync(configPath)) {
|
|
46
|
+
return JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
catch { /* try next */ }
|
|
50
|
+
}
|
|
51
|
+
return {};
|
|
52
|
+
}
|
|
53
|
+
function resolveConfig(api) {
|
|
54
|
+
const runtime = api.config ?? {};
|
|
55
|
+
let raw;
|
|
56
|
+
if (Object.keys(runtime).length > 0) {
|
|
57
|
+
raw = runtime;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
try {
|
|
61
|
+
const config = loadOpenClawConfig();
|
|
62
|
+
raw = config?.plugins?.entries?.['sam']?.config ?? {};
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
raw = {};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
dataDir: raw.dataDir ?? DEFAULT_CONFIG.dataDir,
|
|
70
|
+
sandboxEnabled: raw.sandboxEnabled ?? DEFAULT_CONFIG.sandboxEnabled,
|
|
71
|
+
sandboxImage: raw.sandboxImage ?? DEFAULT_CONFIG.sandboxImage,
|
|
72
|
+
artifactDir: raw.artifactDir ?? DEFAULT_CONFIG.artifactDir,
|
|
73
|
+
artifactRetentionDays: raw.artifactRetentionDays ?? DEFAULT_CONFIG.artifactRetentionDays,
|
|
74
|
+
telegramToken: raw.telegramToken,
|
|
75
|
+
telegramChatId: raw.telegramChatId,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
// ── Plugin Entry Point ───────────────────────────────────────────
|
|
16
79
|
export default function register(api) {
|
|
17
|
-
|
|
80
|
+
const cfg = resolveConfig(api);
|
|
81
|
+
// ── Eager Initialization ────────────────────────────────────
|
|
82
|
+
const pipeline = new PipelineManager(cfg);
|
|
83
|
+
pipeline.initialize().catch((err) => {
|
|
84
|
+
console.warn('[sam] Pipeline initialization warning (non-fatal):', err);
|
|
85
|
+
});
|
|
86
|
+
// Fleet-bus status tracker
|
|
87
|
+
let fleetBusState = 'standalone';
|
|
88
|
+
const getFleetBusStatus = () => fleetBusState;
|
|
89
|
+
// ── Phase 1: Management Tools (always available) ────────────
|
|
90
|
+
const statusTool = createStatusTool(pipeline, cfg, getFleetBusStatus);
|
|
91
|
+
api.registerTool({
|
|
92
|
+
name: statusTool.name,
|
|
93
|
+
description: statusTool.description,
|
|
94
|
+
parameters: statusTool.parameters,
|
|
95
|
+
async execute(_toolCallId, params) {
|
|
96
|
+
return statusTool.execute(_toolCallId, params);
|
|
97
|
+
},
|
|
98
|
+
}, { optional: false });
|
|
99
|
+
const pipelineTool = createPipelineTool(pipeline);
|
|
100
|
+
api.registerTool({
|
|
101
|
+
name: pipelineTool.name,
|
|
102
|
+
description: pipelineTool.description,
|
|
103
|
+
parameters: pipelineTool.parameters,
|
|
104
|
+
async execute(_toolCallId, params) {
|
|
105
|
+
return pipelineTool.execute(_toolCallId, params);
|
|
106
|
+
},
|
|
107
|
+
}, { optional: false });
|
|
108
|
+
const requestTool = createRequestTool(pipeline);
|
|
109
|
+
api.registerTool({
|
|
110
|
+
name: requestTool.name,
|
|
111
|
+
description: requestTool.description,
|
|
112
|
+
parameters: requestTool.parameters,
|
|
113
|
+
async execute(_toolCallId, params) {
|
|
114
|
+
return requestTool.execute(_toolCallId, params);
|
|
115
|
+
},
|
|
116
|
+
}, { optional: false });
|
|
117
|
+
const reportTool = createReportTool(pipeline);
|
|
118
|
+
api.registerTool({
|
|
119
|
+
name: reportTool.name,
|
|
120
|
+
description: reportTool.description,
|
|
121
|
+
parameters: reportTool.parameters,
|
|
122
|
+
async execute(_toolCallId, params) {
|
|
123
|
+
return reportTool.execute(_toolCallId, params);
|
|
124
|
+
},
|
|
125
|
+
}, { optional: false });
|
|
126
|
+
// ── Phase 2: Execution Tools (conditional on sandbox) ───────
|
|
127
|
+
if (cfg.sandboxEnabled) {
|
|
128
|
+
console.log('[sam] Sandbox enabled — Phase 2 tools will be registered when implemented');
|
|
129
|
+
}
|
|
130
|
+
// ── Command: /sam ──────────────────────────────────────────
|
|
131
|
+
api.registerCommand({
|
|
132
|
+
name: 'sam',
|
|
133
|
+
description: 'Sam engineering commands. Usage: /sam status, /sam pipeline, /sam request',
|
|
134
|
+
acceptsArgs: true,
|
|
135
|
+
handler: (_ctx) => {
|
|
136
|
+
return {
|
|
137
|
+
text: '# Sam — Chief Engineer\n\n' +
|
|
138
|
+
'Use Sam\'s tools for engineering pipeline management:\n\n' +
|
|
139
|
+
'**Pipeline Management:**\n' +
|
|
140
|
+
'- **sam_status** — Current state: active ERs, sandbox, fleet-bus\n' +
|
|
141
|
+
'- **sam_pipeline** — Full engineering pipeline view with filters\n' +
|
|
142
|
+
'- **sam_request** — Create, update, or close Engineering Requests\n' +
|
|
143
|
+
'- **sam_report** — Engineering reports (summary, detailed, debt)\n\n' +
|
|
144
|
+
'**Sandbox (Phase 2):**\n' +
|
|
145
|
+
'- **sam_execute** — Run code in Docker sandbox\n' +
|
|
146
|
+
'- **sam_sandbox** — Manage sandbox lifecycle\n' +
|
|
147
|
+
'- **sam_test** — Run test suites in sandbox\n' +
|
|
148
|
+
'- **sam_artifact** — Package build artifacts for Archie\n\n' +
|
|
149
|
+
'Sam manages the 6-stage engineering pipeline: INTAKE → ANALYSIS → BUILD → SELF-REVIEW → ARCHIE-REVIEW → DELIVERED',
|
|
150
|
+
};
|
|
151
|
+
},
|
|
152
|
+
});
|
|
153
|
+
// ── Fleet Bus Integration ──────────────────────────────────
|
|
18
154
|
const fleetBusMod = "@aiassesstech/fleet-bus";
|
|
19
155
|
import(fleetBusMod)
|
|
20
156
|
.then(async ({ FleetBus, SAM_CARD, createTransport, fleetReceive }) => {
|
|
@@ -38,15 +174,19 @@ export default function register(api) {
|
|
|
38
174
|
console.log(`[sam] Fleet message received: ${msg.method} from ${msg.from}`);
|
|
39
175
|
},
|
|
40
176
|
});
|
|
41
|
-
|
|
177
|
+
fleetBusState = 'connected';
|
|
178
|
+
console.log("[sam] Fleet bus: active (full participation)");
|
|
42
179
|
}
|
|
43
180
|
else {
|
|
181
|
+
fleetBusState = 'observer';
|
|
44
182
|
console.log("[sam] Fleet bus: observer mode (gateway transport unavailable)");
|
|
45
183
|
}
|
|
46
184
|
})
|
|
47
185
|
.catch(() => {
|
|
186
|
+
fleetBusState = 'standalone';
|
|
48
187
|
console.warn("[sam] Fleet bus unavailable — operating standalone");
|
|
49
188
|
});
|
|
50
|
-
console.log(
|
|
189
|
+
console.log('[sam] Plugin registered: sam_status, sam_pipeline, sam_request, sam_report tools; /sam command' +
|
|
190
|
+
(cfg.sandboxEnabled ? '; Phase 2 sandbox tools pending' : ''));
|
|
51
191
|
}
|
|
52
192
|
//# sourceMappingURL=plugin.js.map
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,oEAAoE;AAEpE,SAAS,mBAAmB;IAC1B,OAAO,CACL,OAAO,CAAC,GAAG,CAAC,aAAa;QACzB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,GAAG,EAAE,WAAW,CAAC,CAChD,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB;IACzB,MAAM,UAAU,GAAG;QACjB,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE,eAAe,CAAC;QACjD,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,GAAG,EAAE,WAAW,EAAE,eAAe,CAAC;KACjE,CAAC;IAEF,KAAK,MAAM,UAAU,IAAI,UAAU,EAAE,CAAC;QACpC,IAAI,CAAC;YACH,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,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EAAE,CAAC,CAC9D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* sam_pipeline — Read and display the engineering pipeline
|
|
3
|
+
*
|
|
4
|
+
* Called by: Jessie (morning protocol step 4.5), Greg, any agent needing engineering status
|
|
5
|
+
*/
|
|
6
|
+
import type { PipelineManager } from '../pipeline/pipeline-manager.js';
|
|
7
|
+
export declare function createPipelineTool(pipeline: PipelineManager): {
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
parameters: {
|
|
11
|
+
type: "object";
|
|
12
|
+
properties: {
|
|
13
|
+
filter: {
|
|
14
|
+
type: string;
|
|
15
|
+
enum: string[];
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
required: string[];
|
|
20
|
+
};
|
|
21
|
+
execute(_toolCallId: string, params: Record<string, unknown>): Promise<{
|
|
22
|
+
content: {
|
|
23
|
+
type: string;
|
|
24
|
+
text: string;
|
|
25
|
+
}[];
|
|
26
|
+
isError?: undefined;
|
|
27
|
+
} | {
|
|
28
|
+
content: {
|
|
29
|
+
type: string;
|
|
30
|
+
text: string;
|
|
31
|
+
}[];
|
|
32
|
+
isError: boolean;
|
|
33
|
+
}>;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=sam-pipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sam-pipeline.d.ts","sourceRoot":"","sources":["../../src/tools/sam-pipeline.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAmBvE,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,eAAe;;;;;;;;;;;;kBActC,MAAM,EAAE;;yBAEC,MAAM,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;;EAsCrE"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* sam_pipeline — Read and display the engineering pipeline
|
|
3
|
+
*
|
|
4
|
+
* Called by: Jessie (morning protocol step 4.5), Greg, any agent needing engineering status
|
|
5
|
+
*/
|
|
6
|
+
function formatER(er) {
|
|
7
|
+
return {
|
|
8
|
+
id: er.id,
|
|
9
|
+
description: er.description,
|
|
10
|
+
requester: er.requester,
|
|
11
|
+
stage: er.stage,
|
|
12
|
+
blocked: er.blocked,
|
|
13
|
+
...(er.blocker ? { blocker: er.blocker } : {}),
|
|
14
|
+
buildAttempts: er.buildAttempts,
|
|
15
|
+
createdAt: er.createdAt,
|
|
16
|
+
updatedAt: er.updatedAt,
|
|
17
|
+
...(er.deliveredAt ? { deliveredAt: er.deliveredAt } : {}),
|
|
18
|
+
notesCount: er.notes.length,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export function createPipelineTool(pipeline) {
|
|
22
|
+
return {
|
|
23
|
+
name: 'sam_pipeline',
|
|
24
|
+
description: 'View the full engineering pipeline with optional filters. Returns all ERs with stage, status, and timeline data.',
|
|
25
|
+
parameters: {
|
|
26
|
+
type: 'object',
|
|
27
|
+
properties: {
|
|
28
|
+
filter: {
|
|
29
|
+
type: 'string',
|
|
30
|
+
enum: ['all', 'active', 'blocked', 'complete'],
|
|
31
|
+
description: 'Filter ERs: all (default), active (not delivered, not blocked), blocked, or complete (delivered)',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
required: [],
|
|
35
|
+
},
|
|
36
|
+
async execute(_toolCallId, params) {
|
|
37
|
+
try {
|
|
38
|
+
const filter = params.filter ?? 'all';
|
|
39
|
+
let requests;
|
|
40
|
+
switch (filter) {
|
|
41
|
+
case 'active':
|
|
42
|
+
requests = pipeline.getActive();
|
|
43
|
+
break;
|
|
44
|
+
case 'blocked':
|
|
45
|
+
requests = pipeline.getBlocked();
|
|
46
|
+
break;
|
|
47
|
+
case 'complete':
|
|
48
|
+
requests = pipeline.getComplete();
|
|
49
|
+
break;
|
|
50
|
+
default:
|
|
51
|
+
requests = pipeline.getAll();
|
|
52
|
+
}
|
|
53
|
+
const summary = pipeline.getSummary();
|
|
54
|
+
const result = {
|
|
55
|
+
filter,
|
|
56
|
+
summary,
|
|
57
|
+
requests: requests.map(formatER),
|
|
58
|
+
};
|
|
59
|
+
return {
|
|
60
|
+
content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
return {
|
|
65
|
+
content: [{ type: 'text', text: `sam_pipeline error: ${err instanceof Error ? err.message : String(err)}` }],
|
|
66
|
+
isError: true,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=sam-pipeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sam-pipeline.js","sourceRoot":"","sources":["../../src/tools/sam-pipeline.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,SAAS,QAAQ,CAAC,EAAsB;IACtC,OAAO;QACL,EAAE,EAAE,EAAE,CAAC,EAAE;QACT,WAAW,EAAE,EAAE,CAAC,WAAW;QAC3B,SAAS,EAAE,EAAE,CAAC,SAAS;QACvB,KAAK,EAAE,EAAE,CAAC,KAAK;QACf,OAAO,EAAE,EAAE,CAAC,OAAO;QACnB,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9C,aAAa,EAAE,EAAE,CAAC,aAAa;QAC/B,SAAS,EAAE,EAAE,CAAC,SAAS;QACvB,SAAS,EAAE,EAAE,CAAC,SAAS;QACvB,GAAG,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1D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,CAAC,EAAE,CAAC;iBACnE,CAAC;YACJ,CAAC;YAAC,OAAO,GAAY,EAAE,CAAC;gBACtB,OAAO;oBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;oBAC5G,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* sam_report — Generate engineering status reports
|
|
3
|
+
*
|
|
4
|
+
* Formats: summary (brief), detailed (full pipeline), debt (tech debt register)
|
|
5
|
+
* Called by: Jessie (morning protocol), Greg (on-demand)
|
|
6
|
+
*/
|
|
7
|
+
import type { PipelineManager } from '../pipeline/pipeline-manager.js';
|
|
8
|
+
export declare function createReportTool(pipeline: PipelineManager): {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
parameters: {
|
|
12
|
+
type: "object";
|
|
13
|
+
properties: {
|
|
14
|
+
type: {
|
|
15
|
+
type: string;
|
|
16
|
+
enum: string[];
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
required: string[];
|
|
21
|
+
};
|
|
22
|
+
execute(_toolCallId: string, params: Record<string, unknown>): Promise<{
|
|
23
|
+
content: {
|
|
24
|
+
type: string;
|
|
25
|
+
text: string;
|
|
26
|
+
}[];
|
|
27
|
+
isError?: undefined;
|
|
28
|
+
} | {
|
|
29
|
+
content: {
|
|
30
|
+
type: string;
|
|
31
|
+
text: string;
|
|
32
|
+
}[];
|
|
33
|
+
isError: boolean;
|
|
34
|
+
}>;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=sam-report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sam-report.d.ts","sourceRoot":"","sources":["../../src/tools/sam-report.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAoJvE,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,eAAe;;;;;;;;;;;;kBAepC,MAAM,EAAE;;yBAEC,MAAM,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;;EA2BrE"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* sam_report — Generate engineering status reports
|
|
3
|
+
*
|
|
4
|
+
* Formats: summary (brief), detailed (full pipeline), debt (tech debt register)
|
|
5
|
+
* Called by: Jessie (morning protocol), Greg (on-demand)
|
|
6
|
+
*/
|
|
7
|
+
function formatDate(iso) {
|
|
8
|
+
return iso.slice(0, 10);
|
|
9
|
+
}
|
|
10
|
+
function summaryReport(pipeline) {
|
|
11
|
+
const s = pipeline.getSummary();
|
|
12
|
+
const active = pipeline.getActive();
|
|
13
|
+
const blocked = pipeline.getBlocked();
|
|
14
|
+
const lines = [
|
|
15
|
+
'# Sam — Engineering Status Summary',
|
|
16
|
+
'',
|
|
17
|
+
`**Pipeline**: ${s.total} total | ${s.active} active | ${s.blocked} blocked | ${s.delivered} delivered`,
|
|
18
|
+
'',
|
|
19
|
+
];
|
|
20
|
+
if (active.length > 0) {
|
|
21
|
+
lines.push('**Active ERs:**');
|
|
22
|
+
for (const er of active) {
|
|
23
|
+
lines.push(`- ${er.id}: ${er.description} [${er.stage}]`);
|
|
24
|
+
}
|
|
25
|
+
lines.push('');
|
|
26
|
+
}
|
|
27
|
+
if (blocked.length > 0) {
|
|
28
|
+
lines.push('**Blocked ERs:**');
|
|
29
|
+
for (const er of blocked) {
|
|
30
|
+
lines.push(`- ${er.id}: ${er.description} — BLOCKED: ${er.blocker ?? 'unknown'}`);
|
|
31
|
+
}
|
|
32
|
+
lines.push('');
|
|
33
|
+
}
|
|
34
|
+
if (s.total === 0) {
|
|
35
|
+
lines.push('*No engineering requests in the pipeline.*');
|
|
36
|
+
}
|
|
37
|
+
return lines.join('\n');
|
|
38
|
+
}
|
|
39
|
+
function detailedReport(pipeline) {
|
|
40
|
+
const all = pipeline.getAll();
|
|
41
|
+
const s = pipeline.getSummary();
|
|
42
|
+
const lines = [
|
|
43
|
+
'# Sam — Detailed Engineering Report',
|
|
44
|
+
'',
|
|
45
|
+
`**Generated**: ${new Date().toISOString()}`,
|
|
46
|
+
`**Pipeline**: ${s.total} total | ${s.active} active | ${s.blocked} blocked | ${s.delivered} delivered`,
|
|
47
|
+
'',
|
|
48
|
+
'---',
|
|
49
|
+
'',
|
|
50
|
+
];
|
|
51
|
+
if (all.length === 0) {
|
|
52
|
+
lines.push('*No engineering requests in the pipeline.*');
|
|
53
|
+
return lines.join('\n');
|
|
54
|
+
}
|
|
55
|
+
for (const er of all) {
|
|
56
|
+
lines.push(`## ${er.id}: ${er.description}`);
|
|
57
|
+
lines.push('');
|
|
58
|
+
lines.push(`| Field | Value |`);
|
|
59
|
+
lines.push(`|-------|-------|`);
|
|
60
|
+
lines.push(`| Requester | ${er.requester} |`);
|
|
61
|
+
lines.push(`| Stage | ${er.stage} |`);
|
|
62
|
+
lines.push(`| Status | ${er.blocked ? `BLOCKED: ${er.blocker}` : 'Active'} |`);
|
|
63
|
+
lines.push(`| Build Attempts | ${er.buildAttempts} |`);
|
|
64
|
+
lines.push(`| Created | ${formatDate(er.createdAt)} |`);
|
|
65
|
+
lines.push(`| Updated | ${formatDate(er.updatedAt)} |`);
|
|
66
|
+
if (er.deliveredAt) {
|
|
67
|
+
lines.push(`| Delivered | ${formatDate(er.deliveredAt)} |`);
|
|
68
|
+
}
|
|
69
|
+
lines.push('');
|
|
70
|
+
if (er.notes.length > 0) {
|
|
71
|
+
lines.push('**Timeline:**');
|
|
72
|
+
for (const note of er.notes.slice(-5)) {
|
|
73
|
+
lines.push(`- ${note}`);
|
|
74
|
+
}
|
|
75
|
+
lines.push('');
|
|
76
|
+
}
|
|
77
|
+
lines.push('---');
|
|
78
|
+
lines.push('');
|
|
79
|
+
}
|
|
80
|
+
return lines.join('\n');
|
|
81
|
+
}
|
|
82
|
+
function debtReport(pipeline) {
|
|
83
|
+
const all = pipeline.getAll();
|
|
84
|
+
const highAttempts = all.filter((er) => er.buildAttempts >= 2 && er.stage !== 'DELIVERED');
|
|
85
|
+
const longRunning = all.filter((er) => {
|
|
86
|
+
if (er.stage === 'DELIVERED')
|
|
87
|
+
return false;
|
|
88
|
+
const created = new Date(er.createdAt).getTime();
|
|
89
|
+
const now = Date.now();
|
|
90
|
+
const daysOld = (now - created) / (1000 * 60 * 60 * 24);
|
|
91
|
+
return daysOld > 7;
|
|
92
|
+
});
|
|
93
|
+
const blocked = pipeline.getBlocked();
|
|
94
|
+
const lines = [
|
|
95
|
+
'# Sam — Technical Debt & Risk Report',
|
|
96
|
+
'',
|
|
97
|
+
`**Generated**: ${new Date().toISOString()}`,
|
|
98
|
+
'',
|
|
99
|
+
];
|
|
100
|
+
if (highAttempts.length === 0 && longRunning.length === 0 && blocked.length === 0) {
|
|
101
|
+
lines.push('*No technical debt or risk items identified.*');
|
|
102
|
+
return lines.join('\n');
|
|
103
|
+
}
|
|
104
|
+
if (highAttempts.length > 0) {
|
|
105
|
+
lines.push('## High Build Attempts (Risk of Escalation)');
|
|
106
|
+
lines.push('');
|
|
107
|
+
for (const er of highAttempts) {
|
|
108
|
+
lines.push(`- **${er.id}**: ${er.description} — ${er.buildAttempts} attempts [${er.stage}]`);
|
|
109
|
+
}
|
|
110
|
+
lines.push('');
|
|
111
|
+
}
|
|
112
|
+
if (longRunning.length > 0) {
|
|
113
|
+
lines.push('## Long-Running ERs (>7 days)');
|
|
114
|
+
lines.push('');
|
|
115
|
+
for (const er of longRunning) {
|
|
116
|
+
const daysOld = Math.floor((Date.now() - new Date(er.createdAt).getTime()) / (1000 * 60 * 60 * 24));
|
|
117
|
+
lines.push(`- **${er.id}**: ${er.description} — ${daysOld} days old [${er.stage}]`);
|
|
118
|
+
}
|
|
119
|
+
lines.push('');
|
|
120
|
+
}
|
|
121
|
+
if (blocked.length > 0) {
|
|
122
|
+
lines.push('## Blocked ERs');
|
|
123
|
+
lines.push('');
|
|
124
|
+
for (const er of blocked) {
|
|
125
|
+
lines.push(`- **${er.id}**: ${er.description} — BLOCKED: ${er.blocker ?? 'unknown'}`);
|
|
126
|
+
}
|
|
127
|
+
lines.push('');
|
|
128
|
+
}
|
|
129
|
+
return lines.join('\n');
|
|
130
|
+
}
|
|
131
|
+
export function createReportTool(pipeline) {
|
|
132
|
+
return {
|
|
133
|
+
name: 'sam_report',
|
|
134
|
+
description: 'Generate engineering status reports. Types: summary (brief overview for briefings), ' +
|
|
135
|
+
'detailed (full pipeline with timeline), debt (technical debt and risk items).',
|
|
136
|
+
parameters: {
|
|
137
|
+
type: 'object',
|
|
138
|
+
properties: {
|
|
139
|
+
type: {
|
|
140
|
+
type: 'string',
|
|
141
|
+
enum: ['summary', 'detailed', 'debt'],
|
|
142
|
+
description: 'Report type: summary (default), detailed, or debt',
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
required: [],
|
|
146
|
+
},
|
|
147
|
+
async execute(_toolCallId, params) {
|
|
148
|
+
try {
|
|
149
|
+
const reportType = params.type ?? 'summary';
|
|
150
|
+
let report;
|
|
151
|
+
switch (reportType) {
|
|
152
|
+
case 'detailed':
|
|
153
|
+
report = detailedReport(pipeline);
|
|
154
|
+
break;
|
|
155
|
+
case 'debt':
|
|
156
|
+
report = debtReport(pipeline);
|
|
157
|
+
break;
|
|
158
|
+
default:
|
|
159
|
+
report = summaryReport(pipeline);
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
content: [{ type: 'text', text: report }],
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
catch (err) {
|
|
166
|
+
return {
|
|
167
|
+
content: [{ type: 'text', text: `sam_report error: ${err instanceof Error ? err.message : String(err)}` }],
|
|
168
|
+
isError: true,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=sam-report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sam-report.js","sourceRoot":"","sources":["../../src/tools/sam-report.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,SAAS,UAAU,CAAC,GAAW;IAC7B,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC1B,CAAC;AAED,SAAS,aAAa,CAAC,QAAyB;IAC9C,MAAM,CAAC,GAAG,QAAQ,CAAC,UAAU,EAAE,CAAC;IAChC,MAAM,MAAM,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC;IACpC,MAAM,OAAO,GAAG,QAAQ,CAAC,UAAU,EAAE,CAAC;IAEtC,MAAM,KAAK,GAAa;QACtB,oCAAoC;QACpC,EAAE;QACF,iBAAiB,CAAC,CAAC,KAAK,YAAY,CAAC,CAAC,MAAM,aAAa,CAAC,CAAC,OAAO,cAAc,CAAC,CAAC,SAAS,YAAY;QACvG,EAAE;KACH,CAAC;IAEF,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAC9B,KAAK,MAAM,EAAE,IAAI,MAAM,EAAE,CAAC;YACxB,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,WAAW,KAAK,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC;QAC5D,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAC/B,KAAK,MAAM,EAAE,IA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,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;oBAC1G,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* sam_request — Create, update, or close Engineering Requests
|
|
3
|
+
*
|
|
4
|
+
* Side effects: writes memory files (when MemoryWriter available),
|
|
5
|
+
* sends fleet-bus task/status (when fleet-bus available).
|
|
6
|
+
*/
|
|
7
|
+
import type { PipelineManager } from '../pipeline/pipeline-manager.js';
|
|
8
|
+
export declare function createRequestTool(pipeline: PipelineManager): {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
parameters: {
|
|
12
|
+
type: "object";
|
|
13
|
+
properties: {
|
|
14
|
+
action: {
|
|
15
|
+
type: string;
|
|
16
|
+
enum: string[];
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
er_id: {
|
|
20
|
+
type: string;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
description: {
|
|
24
|
+
type: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
requester: {
|
|
28
|
+
type: string;
|
|
29
|
+
description: string;
|
|
30
|
+
};
|
|
31
|
+
stage: {
|
|
32
|
+
type: string;
|
|
33
|
+
enum: string[];
|
|
34
|
+
description: string;
|
|
35
|
+
};
|
|
36
|
+
blocker: {
|
|
37
|
+
type: string;
|
|
38
|
+
description: string;
|
|
39
|
+
};
|
|
40
|
+
notes: {
|
|
41
|
+
type: string;
|
|
42
|
+
description: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
required: string[];
|
|
46
|
+
};
|
|
47
|
+
execute(_toolCallId: string, params: Record<string, unknown>): Promise<{
|
|
48
|
+
isError?: boolean | undefined;
|
|
49
|
+
content: {
|
|
50
|
+
type: string;
|
|
51
|
+
text: string;
|
|
52
|
+
}[];
|
|
53
|
+
}>;
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=sam-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sam-request.d.ts","sourceRoot":"","sources":["../../src/tools/sam-request.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAGvE,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA0C7B,MAAM,EAAE;;yBAEP,MAAM,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;EAyCrE"}
|