aienvmp 0.1.30 → 0.1.32
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/CHANGELOG.md +12 -0
- package/README.md +4 -0
- package/action.yml +12 -0
- package/examples/github-action.yml +1 -0
- package/package.json +1 -1
- package/src/cli.js +5 -1
- package/src/commands/status.js +53 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.32
|
|
4
|
+
|
|
5
|
+
- Added GitHub Action support for writing `.aienvmp/status.json` by default.
|
|
6
|
+
- Added a `write-status` action input so CI can keep compact AI status artifacts optional.
|
|
7
|
+
- Updated the GitHub Action example artifact list to include the status output.
|
|
8
|
+
|
|
9
|
+
## 0.1.31
|
|
10
|
+
|
|
11
|
+
- Added `aienvmp status` as a compact human and AI entrypoint.
|
|
12
|
+
- Summarized clear/review state, next command, counts, top action, and enforcement advice in one output.
|
|
13
|
+
- Kept `context --json` as the richer preflight while making first checks simpler.
|
|
14
|
+
|
|
3
15
|
## 0.1.30
|
|
4
16
|
|
|
5
17
|
- Added shared enforcement advice for AI and CI surfaces.
|
package/README.md
CHANGED
|
@@ -16,6 +16,7 @@ Core loop: scan once, link runtime/dependency/security context, give AI a shared
|
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
18
|
npx aienvmp sync
|
|
19
|
+
npx aienvmp status
|
|
19
20
|
npx aienvmp context
|
|
20
21
|
npx aienvmp plan
|
|
21
22
|
npx aienvmp handoff
|
|
@@ -66,11 +67,13 @@ npx aienvmp snippet agents
|
|
|
66
67
|
## CI Usage
|
|
67
68
|
|
|
68
69
|
Use the GitHub Action to write the env map, plan, dashboard, and optional strict checks. See [examples/github-action.yml](examples/github-action.yml).
|
|
70
|
+
CI also writes `.aienvmp/status.json` for a compact AI-readable result.
|
|
69
71
|
The dashboard shows which strict scopes are CI-ready before you enforce them.
|
|
70
72
|
|
|
71
73
|
```yaml
|
|
72
74
|
- uses: soovwv/aienvmp@main
|
|
73
75
|
with:
|
|
76
|
+
write-status: "true"
|
|
74
77
|
write-plan: "true"
|
|
75
78
|
strict: "off" # security, policy, coordination, all, or off
|
|
76
79
|
```
|
|
@@ -79,6 +82,7 @@ The dashboard shows which strict scopes are CI-ready before you enforce them.
|
|
|
79
82
|
|
|
80
83
|
```bash
|
|
81
84
|
aienvmp sync # update env map, light SBOM, ledger, dashboard
|
|
85
|
+
aienvmp status # one compact clear/review decision
|
|
82
86
|
aienvmp context # AI preflight brief
|
|
83
87
|
aienvmp context --json # AI decision contract + actions + compact step summary
|
|
84
88
|
aienvmp plan # read-only AI action plan using the same decision contract
|
package/action.yml
CHANGED
|
@@ -15,6 +15,10 @@ inputs:
|
|
|
15
15
|
description: Write read-only AI plan artifacts
|
|
16
16
|
required: false
|
|
17
17
|
default: "true"
|
|
18
|
+
write-status:
|
|
19
|
+
description: Write compact AI status artifact
|
|
20
|
+
required: false
|
|
21
|
+
default: "true"
|
|
18
22
|
|
|
19
23
|
runs:
|
|
20
24
|
using: composite
|
|
@@ -30,6 +34,14 @@ runs:
|
|
|
30
34
|
node "$GITHUB_ACTION_PATH/bin/aienvmp.js" plan --dir "${{ inputs.directory }}" --write --json
|
|
31
35
|
fi
|
|
32
36
|
|
|
37
|
+
- name: Write AI status
|
|
38
|
+
shell: bash
|
|
39
|
+
run: |
|
|
40
|
+
if [ "${{ inputs.write-status }}" = "true" ]; then
|
|
41
|
+
mkdir -p "${{ inputs.directory }}/.aienvmp"
|
|
42
|
+
node "$GITHUB_ACTION_PATH/bin/aienvmp.js" status --dir "${{ inputs.directory }}" --json > "${{ inputs.directory }}/.aienvmp/status.json"
|
|
43
|
+
fi
|
|
44
|
+
|
|
33
45
|
- name: Doctor
|
|
34
46
|
shell: bash
|
|
35
47
|
run: |
|
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -12,6 +12,7 @@ import { syncWorkspace } from "./commands/sync.js";
|
|
|
12
12
|
import { snippetWorkspace } from "./commands/snippet.js";
|
|
13
13
|
import { handoffWorkspace } from "./commands/handoff.js";
|
|
14
14
|
import { planWorkspace } from "./commands/plan.js";
|
|
15
|
+
import { statusWorkspace } from "./commands/status.js";
|
|
15
16
|
import { readFileSync } from "node:fs";
|
|
16
17
|
|
|
17
18
|
const commands = new Map([
|
|
@@ -28,7 +29,8 @@ const commands = new Map([
|
|
|
28
29
|
["sync", syncWorkspace],
|
|
29
30
|
["snippet", snippetWorkspace],
|
|
30
31
|
["handoff", handoffWorkspace],
|
|
31
|
-
["plan", planWorkspace]
|
|
32
|
+
["plan", planWorkspace],
|
|
33
|
+
["status", statusWorkspace]
|
|
32
34
|
]);
|
|
33
35
|
|
|
34
36
|
const version = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version;
|
|
@@ -78,11 +80,13 @@ function printUsage() {
|
|
|
78
80
|
Usage:
|
|
79
81
|
aienvmp sync [--dir .] [--json] [--quiet] [--deep] [--security]
|
|
80
82
|
aienvmp context [--dir .] [--json]
|
|
83
|
+
aienvmp status [--dir .] [--json]
|
|
81
84
|
aienvmp handoff [--dir .] [--json] [--record --actor agent:id]
|
|
82
85
|
aienvmp plan [--dir .] [--json] [--write]
|
|
83
86
|
|
|
84
87
|
Common:
|
|
85
88
|
aienvmp sync update AIENV.md, manifest, ledger, intents, and dashboard
|
|
89
|
+
aienvmp status print one simple environment decision
|
|
86
90
|
aienvmp context print the AI preflight brief
|
|
87
91
|
aienvmp handoff print the next-agent handoff summary
|
|
88
92
|
aienvmp plan print a read-only AI environment action plan
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { diagnose } from "../doctor.js";
|
|
2
|
+
import { readJson } from "../fsutil.js";
|
|
3
|
+
import { loadPolicy, policyWarnings } from "../policy.js";
|
|
4
|
+
import { intentsPath, manifestPath, timelinePath, workspaceDir } from "../paths.js";
|
|
5
|
+
import { openIntents, readJsonl, readTimeline } from "../timeline.js";
|
|
6
|
+
import { recommendedActions } from "../actions.js";
|
|
7
|
+
import { aiDecision } from "../decision.js";
|
|
8
|
+
import { enforcementAdvice } from "../enforcement.js";
|
|
9
|
+
|
|
10
|
+
export async function statusWorkspace(args) {
|
|
11
|
+
const dir = workspaceDir(args);
|
|
12
|
+
const manifest = await readJson(manifestPath(dir));
|
|
13
|
+
if (!manifest) throw new Error("missing manifest; run `aienvmp sync` first");
|
|
14
|
+
const policy = await loadPolicy(dir);
|
|
15
|
+
const timeline = await readTimeline(timelinePath(dir));
|
|
16
|
+
const intents = openIntents(await readJsonl(intentsPath(dir)));
|
|
17
|
+
const warnings = [...diagnose(manifest, { timeline, intents }), ...policyWarnings(manifest, policy)];
|
|
18
|
+
const status = buildStatus(manifest, warnings, intents);
|
|
19
|
+
if (args.json) {
|
|
20
|
+
console.log(JSON.stringify(status, null, 2));
|
|
21
|
+
} else {
|
|
22
|
+
console.log(`${status.state}: ${status.summary}`);
|
|
23
|
+
console.log(`next: ${status.nextCommand}`);
|
|
24
|
+
console.log(`strict: ${status.enforcement.recommendedCommand}`);
|
|
25
|
+
}
|
|
26
|
+
return status;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function buildStatus(manifest = {}, warnings = [], intents = []) {
|
|
30
|
+
const decision = aiDecision(warnings, intents);
|
|
31
|
+
const enforcement = enforcementAdvice(warnings);
|
|
32
|
+
const actions = recommendedActions(manifest, { warnings, intents });
|
|
33
|
+
const state = decision.reviewRequired ? "review-required" : "clear";
|
|
34
|
+
const topAction = actions[0] || null;
|
|
35
|
+
return {
|
|
36
|
+
schemaVersion: 1,
|
|
37
|
+
state,
|
|
38
|
+
summary: state === "clear"
|
|
39
|
+
? "Project-local work can continue. Record intent before environment changes."
|
|
40
|
+
: "Review warnings or open intents before environment changes.",
|
|
41
|
+
decision,
|
|
42
|
+
enforcement,
|
|
43
|
+
counts: {
|
|
44
|
+
warnings: warnings.length,
|
|
45
|
+
openIntents: intents.length,
|
|
46
|
+
runtimes: Object.keys(manifest.runtimes || {}).length,
|
|
47
|
+
dependencies: Number(manifest.dependencySnapshot?.summary?.packages || 0),
|
|
48
|
+
vulnerabilities: Number(manifest.security?.summary?.total || 0)
|
|
49
|
+
},
|
|
50
|
+
topAction,
|
|
51
|
+
nextCommand: topAction?.command || decision.nextCommand
|
|
52
|
+
};
|
|
53
|
+
}
|