kushi-agents 6.1.1 → 6.1.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.
- package/package.json +1 -1
- package/plugin/instructions/evidence-layout-canonical.instructions.md +3 -3
- package/plugin/runners/bootstrap.mjs +60 -1
- package/plugin/runners/discover.mjs +2 -2
- package/plugin/runners/lib/csc-pull.mjs +3 -1
- package/plugin/runners/lib/layout.mjs +4 -4
- package/plugin/runners/test/integration/bootstrap.integration.test.mjs +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kushi-agents",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.2",
|
|
4
4
|
"description": "Install Kushi — multi-source project evidence agent with Comprehensive Structured Capture (CSC) into weekly-only files across Email, Teams, OneNote, Loop, SharePoint, Meetings, CRM, ADO. Meetings retain a sibling verbatim/ audit folder. WorkIQ-only for M365 sources (Graph / m365_* FORBIDDEN as fallbacks; user-paste is first-class). Host-agnostic.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -62,8 +62,8 @@ Concretely, a pull skill MUST NOT create or write to any of these (representativ
|
|
|
62
62
|
| `<project>/_Weekly Summaries/` | `<project>/Evidence/<alias>/<source>/weekly/` |
|
|
63
63
|
| `<project>/Meetings/` (at project root) | `<project>/Evidence/<alias>/meetings/` |
|
|
64
64
|
| `<project>/Teams/` (at project root) | `<project>/Evidence/<alias>/teams/` |
|
|
65
|
-
| `<project>/SharePoint/` (at project root) | `<project>/Evidence
|
|
66
|
-
| `<project>/CRM/`, `<project>/ADO/` (at project root) | `<project>/Evidence
|
|
65
|
+
| `<project>/SharePoint/` (at project root) | `<project>/Evidence/_shared/sharepoint/` (project-scoped; v6.1.2+) |
|
|
66
|
+
| `<project>/CRM/`, `<project>/ADO/` (at project root) | `<project>/Evidence/_shared/{crm,ado}/` |
|
|
67
67
|
| any `<project>/<source>-context/`, `<project>/<source>-summary/`, etc. | `<project>/Evidence/<alias>/<source>/weekly/` |
|
|
68
68
|
|
|
69
69
|
`State/`, `Reports/`, `integrations.yml` are the **only** top-level siblings of `Evidence/` that pull/refresh skills are allowed to leave alone (they are written by `build-state`, `aggregate-project`, and bootstrap respectively — not by pull-* skills).
|
|
@@ -83,7 +83,7 @@ If alias is ambiguous (legacy folder pre-dates multi-user), default to the curre
|
|
|
83
83
|
|
|
84
84
|
By contract, downstream skills walk:
|
|
85
85
|
|
|
86
|
-
- `Evidence/*/email/`, `Evidence/*/teams/`, `Evidence/*/meetings/`, `Evidence/*/onenote/`, `Evidence
|
|
86
|
+
- `Evidence/*/email/`, `Evidence/*/teams/`, `Evidence/*/meetings/`, `Evidence/*/onenote/`, `Evidence/_shared/sharepoint/`, `Evidence/_shared/crm/`, `Evidence/_shared/ado/`
|
|
87
87
|
|
|
88
88
|
Anything outside these paths is invisible to them — by design. The path IS the contract. There is no "also scan sibling folders" fallback.
|
|
89
89
|
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
aliasRoot, projectSharedFile, userFile, USER_FILES,
|
|
27
27
|
} from './lib/layout.mjs';
|
|
28
28
|
import { writeAtomic, pathExists } from './lib/evidence.mjs';
|
|
29
|
+
import { writeRefreshReport, appendRunLog } from './lib/runlog.mjs';
|
|
29
30
|
|
|
30
31
|
function parseArgs(argv) {
|
|
31
32
|
const args = { force: false, dryRun: false, lookbackDays: null, interactive: false };
|
|
@@ -254,7 +255,7 @@ const USER_DIRS = [
|
|
|
254
255
|
USER_FILES.discovery,
|
|
255
256
|
USER_FILES.deferredRetries,
|
|
256
257
|
USER_FILES.refreshReports,
|
|
257
|
-
'email', 'teams', 'meetings', 'onenote',
|
|
258
|
+
'email', 'teams', 'meetings', 'onenote',
|
|
258
259
|
'crm-notes', 'ado-notes',
|
|
259
260
|
];
|
|
260
261
|
|
|
@@ -327,6 +328,63 @@ async function main() {
|
|
|
327
328
|
});
|
|
328
329
|
}
|
|
329
330
|
|
|
331
|
+
const startedAt = new Date(); // capture when scaffold started (before report)
|
|
332
|
+
// v6.1.2: write bootstrap report to refresh-reports/<ts>_bootstrap.md per
|
|
333
|
+
// run-reports doctrine. Bootstrap is scaffold-only (no HTTP, no pulls), so
|
|
334
|
+
// the report enumerates files/dirs created vs. existed, plus optional
|
|
335
|
+
// dateFloor + interactive outcomes. Diagnostics-only; never blocks.
|
|
336
|
+
let reportPath = null;
|
|
337
|
+
if (!args.dryRun) {
|
|
338
|
+
try {
|
|
339
|
+
const created = log.created.map(p => path.relative(root, p) || '.');
|
|
340
|
+
const existed = log.existed.map(p => path.relative(root, p) || '.');
|
|
341
|
+
const summaryLine = `bootstrap ${args.alias}: created=${created.length} existed=${existed.length}` +
|
|
342
|
+
(dateFloorReport && dateFloorReport.fields?.length ? ` dateFloor=${dateFloorReport.dateFloor}` : '') +
|
|
343
|
+
(interactiveReport && interactiveReport.fields?.length ? ` interactive=${interactiveReport.fields.length}` : '');
|
|
344
|
+
const details = {
|
|
345
|
+
mode: 'bootstrap',
|
|
346
|
+
contributor: args.alias,
|
|
347
|
+
started: startedAt.toISOString(),
|
|
348
|
+
ended: new Date().toISOString(),
|
|
349
|
+
scope: 'scaffold-only (no HTTP, no pulls)',
|
|
350
|
+
what_was_done: {
|
|
351
|
+
configs_probed: ['integrations.yml', 'project-info.md', 'external-links.yml', 'contributors.yml'],
|
|
352
|
+
shared_dirs: SHARED_DIRS,
|
|
353
|
+
user_dirs: USER_DIRS,
|
|
354
|
+
per_user_files: ['boundaries.yml', 'external-links.local.yml', '_ledger.yml'],
|
|
355
|
+
counts: {
|
|
356
|
+
created: created.length,
|
|
357
|
+
existed: existed.length,
|
|
358
|
+
},
|
|
359
|
+
},
|
|
360
|
+
created,
|
|
361
|
+
existed,
|
|
362
|
+
date_floor: dateFloorReport || null,
|
|
363
|
+
interactive: interactiveReport || null,
|
|
364
|
+
skips_and_gaps: [
|
|
365
|
+
'Bootstrap is scaffold-only — no source pulls performed.',
|
|
366
|
+
'Run `kushi discover <project>` next to populate boundaries.yml/integrations.yml.',
|
|
367
|
+
'Then `kushi refresh <project>` to capture per-source CSC weekly files.',
|
|
368
|
+
],
|
|
369
|
+
};
|
|
370
|
+
const r = await writeRefreshReport(args.project, args.alias, {
|
|
371
|
+
type: 'bootstrap',
|
|
372
|
+
summary: summaryLine,
|
|
373
|
+
details,
|
|
374
|
+
});
|
|
375
|
+
reportPath = r?.path || null;
|
|
376
|
+
try {
|
|
377
|
+
await appendRunLog(args.project, {
|
|
378
|
+
mode: 'bootstrap',
|
|
379
|
+
contributor: args.alias,
|
|
380
|
+
status: 'ok',
|
|
381
|
+
summary: summaryLine,
|
|
382
|
+
report: reportPath ? path.relative(root, reportPath) : null,
|
|
383
|
+
});
|
|
384
|
+
} catch { /* run-log is diagnostics-only */ }
|
|
385
|
+
} catch { /* bootstrap-report is diagnostics-only, never block */ }
|
|
386
|
+
}
|
|
387
|
+
|
|
330
388
|
emit({
|
|
331
389
|
status: 'ok',
|
|
332
390
|
project: root,
|
|
@@ -334,6 +392,7 @@ async function main() {
|
|
|
334
392
|
created: log.created.map(p => path.relative(root, p) || '.'),
|
|
335
393
|
existed: log.existed.map(p => path.relative(root, p) || '.'),
|
|
336
394
|
dry_run: args.dryRun,
|
|
395
|
+
...(reportPath ? { report: path.relative(root, reportPath) } : {}),
|
|
337
396
|
...(dateFloorReport ? { date_floor: dateFloorReport } : {}),
|
|
338
397
|
...(interactiveReport ? { interactive: interactiveReport } : {}),
|
|
339
398
|
});
|
|
@@ -66,8 +66,8 @@ function buildPrompt(source, projectName, scope = null) {
|
|
|
66
66
|
meetings: `Find recurring Teams meeting series related to project "${projectName}".`,
|
|
67
67
|
onenote: `Find OneNote sections related to project "${projectName}".`,
|
|
68
68
|
sharepoint: `Find SharePoint sites or libraries related to project "${projectName}".`,
|
|
69
|
-
crm: `
|
|
70
|
-
ado: `
|
|
69
|
+
crm: `Search the user's indexed M365 content (emails, OneNote pages, SharePoint/OneDrive documents, Teams messages) for Dataverse CRM request/incident identifiers that relate to project "${projectName}". CRM IDs typically look like FE-2026-001458, REQ-12345, INC-9, or 6+ digit numerics, and appear in email signatures/subjects, project briefs, status decks, or Loop pages from iscrm.crm.dynamics.com. Return the request_id (preferred) or incident_number you see most consistently associated with the project.`,
|
|
70
|
+
ado: `Search the user's indexed M365 content (emails, OneNote pages, SharePoint/OneDrive documents, Teams messages) for Azure DevOps work items related to project "${projectName}" in the IndustrySolutions/IS Engagements org. Engagement work items are typically referenced by 5–7 digit numeric IDs in URLs like dev.azure.com/IndustrySolutions/IS%20Engagements/_workitems/edit/123456 or in shorthand like "AB#123456" / "WI 123456". Return the engagement_id (top-level "Engagement" work item id, preferred) or work_item_id you see most consistently associated with the project.`,
|
|
71
71
|
};
|
|
72
72
|
const fields = {
|
|
73
73
|
email: 'value (full folder path like "Inbox/Northwind"), confidence (high|medium|low)',
|
|
@@ -69,8 +69,10 @@ export function buildPullPrompt({ source, project, entity, weekStart, scope, opt
|
|
|
69
69
|
if (scope?.notebookName) lines.push(`Restrict to notebook "${scope.notebookName}".`);
|
|
70
70
|
lines.push('One CSC block per page touched in the week.');
|
|
71
71
|
} else if (source === 'sharepoint') {
|
|
72
|
-
lines.push(`Find SharePoint files within site "${entity}" modified between ${fromYmd} and ${toYmd}, inclusive.`);
|
|
72
|
+
lines.push(`Find SharePoint files within site "${entity}" — including its top-level document libraries and the first level of folders inside each library (depth 1) — modified between ${fromYmd} and ${toYmd}, inclusive.`);
|
|
73
|
+
lines.push('For each file, capture: filename, full server-relative path, last_modified timestamp, last_modified_by, and any external links (http/https URLs to other systems, e.g. external SharePoint sites, ADO/CRM/Jira, Loop, OneDrive, third-party docs) referenced in the document body or metadata.');
|
|
73
74
|
lines.push('One CSC block per file touched in the week.');
|
|
75
|
+
lines.push('In the CSC block, place the captured external links into `topics` as a comma-separated list of bare URLs (or `_none_` if none), and use `summary` for a one-line description of what changed in the file.');
|
|
74
76
|
} else {
|
|
75
77
|
throw new Error(`csc-pull: unsupported source "${source}"`);
|
|
76
78
|
}
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
import path from 'node:path';
|
|
6
6
|
|
|
7
7
|
/** Sources whose record bodies are project-scoped (live under Evidence/_shared/). */
|
|
8
|
-
export const SHARED_SOURCES = new Set(['crm', 'ado']);
|
|
8
|
+
export const SHARED_SOURCES = new Set(['crm', 'ado', 'sharepoint']);
|
|
9
9
|
|
|
10
10
|
/** Sources whose captures are per-user (live under Evidence/<alias>/<source>/). */
|
|
11
|
-
export const USER_SOURCES = new Set(['email', 'teams', 'meetings', 'onenote'
|
|
11
|
+
export const USER_SOURCES = new Set(['email', 'teams', 'meetings', 'onenote']);
|
|
12
12
|
|
|
13
13
|
/** Per-user note folders for shared sources (annotations only, not record bodies). */
|
|
14
14
|
export const USER_NOTE_DIRS = { crm: 'crm-notes', ado: 'ado-notes' };
|
|
@@ -35,8 +35,8 @@ export function sharedRoot(project) {
|
|
|
35
35
|
|
|
36
36
|
/** Evidence/_shared/<source>/ — only for SHARED_SOURCES. */
|
|
37
37
|
export function sharedSourceDir(project, source) {
|
|
38
|
-
if (!SHARED_SOURCES.has(source)
|
|
39
|
-
throw new Error(`layout: source "${source}" is not a shared source (allowed: ${[...SHARED_SOURCES
|
|
38
|
+
if (!SHARED_SOURCES.has(source)) {
|
|
39
|
+
throw new Error(`layout: source "${source}" is not a shared source (allowed: ${[...SHARED_SOURCES].join(', ')})`);
|
|
40
40
|
}
|
|
41
41
|
return path.join(sharedRoot(project), source);
|
|
42
42
|
}
|
|
@@ -45,7 +45,7 @@ test('scaffolds project skeleton on empty dir', async () => {
|
|
|
45
45
|
const ledger = YAML.parse(await fs.readFile(path.join(p, 'Evidence', 'ushak', '_ledger.yml'), 'utf8'));
|
|
46
46
|
assert.deepEqual(ledger, { entries: {} });
|
|
47
47
|
for (const d of ['_discovery', '_deferred-retries', 'refresh-reports',
|
|
48
|
-
'email', 'teams', 'meetings', 'onenote',
|
|
48
|
+
'email', 'teams', 'meetings', 'onenote',
|
|
49
49
|
'crm-notes', 'ado-notes']) {
|
|
50
50
|
await fs.access(path.join(p, 'Evidence', 'ushak', d));
|
|
51
51
|
}
|