aienvmp 0.1.30 → 0.1.31

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.31
4
+
5
+ - Added `aienvmp status` as a compact human and AI entrypoint.
6
+ - Summarized clear/review state, next command, counts, top action, and enforcement advice in one output.
7
+ - Kept `context --json` as the richer preflight while making first checks simpler.
8
+
3
9
  ## 0.1.30
4
10
 
5
11
  - 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
@@ -79,6 +80,7 @@ The dashboard shows which strict scopes are CI-ready before you enforce them.
79
80
 
80
81
  ```bash
81
82
  aienvmp sync # update env map, light SBOM, ledger, dashboard
83
+ aienvmp status # one compact clear/review decision
82
84
  aienvmp context # AI preflight brief
83
85
  aienvmp context --json # AI decision contract + actions + compact step summary
84
86
  aienvmp plan # read-only AI action plan using the same decision contract
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aienvmp",
3
- "version": "0.1.30",
3
+ "version": "0.1.31",
4
4
  "description": "AI-first environment maps and lightweight runtime SBOMs for shared development machines.",
5
5
  "type": "module",
6
6
  "bin": {
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
+ }