aienvmp 0.1.32 → 0.1.34

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,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.34
4
+
5
+ - Added AI navigation metadata to `.aienvmp/status.json`.
6
+ - Included artifact paths, read order, safe commands, and agent-use rules in the compact status output.
7
+ - Kept the status enhancement read-only and lightweight so `sync` remains the simple default flow.
8
+
9
+ ## 0.1.33
10
+
11
+ - Made `.aienvmp/status.json` a first-class artifact written by `aienvmp sync`.
12
+ - Added `aienvmp status --write` so AI agents and CI can refresh the compact state file directly.
13
+ - Updated the GitHub Action to use the built-in status writer instead of shell redirection.
14
+
3
15
  ## 0.1.32
4
16
 
5
17
  - Added GitHub Action support for writing `.aienvmp/status.json` by default.
package/README.md CHANGED
@@ -45,6 +45,7 @@ npx aienvmp handoff --record --actor agent:codex
45
45
  ```text
46
46
  AIENV.md
47
47
  .aienvmp/manifest.json
48
+ .aienvmp/status.json # first file for AI: clear/review, next command, strict advice
48
49
  .aienvmp/intents.jsonl
49
50
  .aienvmp/timeline.jsonl
50
51
  .aienvmp/plan.json
@@ -53,6 +54,7 @@ AIENV.md
53
54
  ```
54
55
 
55
56
  Trust states are machine-readable: `observed`, `planned`, `changed`, `review`, `verified`, `stale`.
57
+ `status.json` also lists AI read order, artifact paths, and safe commands.
56
58
 
57
59
  AI agents can observe, plan, and record. Only a human or CI should mark environment facts as verified.
58
60
 
@@ -81,8 +83,8 @@ The dashboard shows which strict scopes are CI-ready before you enforce them.
81
83
  ## Commands
82
84
 
83
85
  ```bash
84
- aienvmp sync # update env map, light SBOM, ledger, dashboard
85
- aienvmp status # one compact clear/review decision
86
+ aienvmp sync # update env map, light SBOM, status, ledger, dashboard
87
+ aienvmp status --write # refresh .aienvmp/status.json only
86
88
  aienvmp context # AI preflight brief
87
89
  aienvmp context --json # AI decision contract + actions + compact step summary
88
90
  aienvmp plan # read-only AI action plan using the same decision contract
package/action.yml CHANGED
@@ -38,8 +38,7 @@ runs:
38
38
  shell: bash
39
39
  run: |
40
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"
41
+ node "$GITHUB_ACTION_PATH/bin/aienvmp.js" status --dir "${{ inputs.directory }}" --write --quiet
43
42
  fi
44
43
 
45
44
  - name: Doctor
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aienvmp",
3
- "version": "0.1.32",
3
+ "version": "0.1.34",
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
@@ -80,13 +80,13 @@ function printUsage() {
80
80
  Usage:
81
81
  aienvmp sync [--dir .] [--json] [--quiet] [--deep] [--security]
82
82
  aienvmp context [--dir .] [--json]
83
- aienvmp status [--dir .] [--json]
83
+ aienvmp status [--dir .] [--json] [--write] [--quiet]
84
84
  aienvmp handoff [--dir .] [--json] [--record --actor agent:id]
85
85
  aienvmp plan [--dir .] [--json] [--write]
86
86
 
87
87
  Common:
88
- aienvmp sync update AIENV.md, manifest, ledger, intents, and dashboard
89
- aienvmp status print one simple environment decision
88
+ aienvmp sync update AIENV.md, manifest, status, ledger, intents, and dashboard
89
+ aienvmp status print one simple environment decision; --write saves .aienvmp/status.json
90
90
  aienvmp context print the AI preflight brief
91
91
  aienvmp handoff print the next-agent handoff summary
92
92
  aienvmp plan print a read-only AI environment action plan
@@ -1,7 +1,9 @@
1
+ import fs from "node:fs/promises";
2
+ import path from "node:path";
1
3
  import { diagnose } from "../doctor.js";
2
4
  import { readJson } from "../fsutil.js";
3
5
  import { loadPolicy, policyWarnings } from "../policy.js";
4
- import { intentsPath, manifestPath, timelinePath, workspaceDir } from "../paths.js";
6
+ import { intentsPath, manifestPath, statusJsonPath, timelinePath, workspaceDir } from "../paths.js";
5
7
  import { openIntents, readJsonl, readTimeline } from "../timeline.js";
6
8
  import { recommendedActions } from "../actions.js";
7
9
  import { aiDecision } from "../decision.js";
@@ -16,14 +18,24 @@ export async function statusWorkspace(args) {
16
18
  const intents = openIntents(await readJsonl(intentsPath(dir)));
17
19
  const warnings = [...diagnose(manifest, { timeline, intents }), ...policyWarnings(manifest, policy)];
18
20
  const status = buildStatus(manifest, warnings, intents);
21
+ const artifact = args.write ? await writeStatusArtifact(dir, status) : "";
22
+ const output = artifact ? { ...status, artifact } : status;
19
23
  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}`);
24
+ console.log(JSON.stringify(output, null, 2));
25
+ } else if (!args.quiet) {
26
+ console.log(`${output.state}: ${output.summary}`);
27
+ console.log(`next: ${output.nextCommand}`);
28
+ console.log(`strict: ${output.enforcement.recommendedCommand}`);
29
+ if (artifact) console.log(`status: ${artifact}`);
25
30
  }
26
- return status;
31
+ return output;
32
+ }
33
+
34
+ export async function writeStatusArtifact(dir, status) {
35
+ const out = statusJsonPath(dir);
36
+ await fs.mkdir(path.dirname(out), { recursive: true });
37
+ await fs.writeFile(out, JSON.stringify(status, null, 2), "utf8");
38
+ return out;
27
39
  }
28
40
 
29
41
  export function buildStatus(manifest = {}, warnings = [], intents = []) {
@@ -47,7 +59,43 @@ export function buildStatus(manifest = {}, warnings = [], intents = []) {
47
59
  dependencies: Number(manifest.dependencySnapshot?.summary?.packages || 0),
48
60
  vulnerabilities: Number(manifest.security?.summary?.total || 0)
49
61
  },
62
+ agentUse: {
63
+ purpose: "First AI-readable environment preflight for this workspace.",
64
+ rule: "Read status first, use context for details, record intent before environment changes.",
65
+ projectLocalWork: decision.canContinueProjectLocalWork ? "allowed" : "review-first",
66
+ environmentChanges: decision.canChangeEnvironmentWithoutReview ? "allowed" : "intent-and-review-first"
67
+ },
68
+ artifacts: statusArtifacts(),
69
+ readOrder: [
70
+ ".aienvmp/status.json",
71
+ "AIENV.md",
72
+ ".aienvmp/manifest.json",
73
+ ".aienvmp/plan.json",
74
+ ".aienvmp/timeline.jsonl",
75
+ ".aienvmp/intents.jsonl"
76
+ ],
77
+ commands: {
78
+ refresh: "aienvmp sync",
79
+ status: "aienvmp status --write",
80
+ context: "aienvmp context --json",
81
+ plan: "aienvmp plan --write",
82
+ handoff: "aienvmp handoff --record --actor agent:id",
83
+ recordIntent: "aienvmp intent --actor agent:id --action planned-change"
84
+ },
50
85
  topAction,
51
86
  nextCommand: topAction?.command || decision.nextCommand
52
87
  };
53
88
  }
89
+
90
+ function statusArtifacts() {
91
+ return {
92
+ status: ".aienvmp/status.json",
93
+ envMap: "AIENV.md",
94
+ manifest: ".aienvmp/manifest.json",
95
+ dashboard: ".aienvmp/dashboard.html",
96
+ planJson: ".aienvmp/plan.json",
97
+ planMarkdown: ".aienvmp/plan.md",
98
+ intents: ".aienvmp/intents.jsonl",
99
+ timeline: ".aienvmp/timeline.jsonl"
100
+ };
101
+ }
@@ -2,6 +2,7 @@ import { initWorkspace } from "./init.js";
2
2
  import { scanWorkspace } from "./scan.js";
3
3
  import { compileWorkspace } from "./compile.js";
4
4
  import { dashWorkspace } from "./dash.js";
5
+ import { statusWorkspace } from "./status.js";
5
6
 
6
7
  export async function syncWorkspace(args) {
7
8
  const quiet = args.quiet || args.json;
@@ -11,6 +12,7 @@ export async function syncWorkspace(args) {
11
12
  const scanned = await scanWorkspace(next);
12
13
  const compiled = await compileWorkspace(next);
13
14
  const dashboard = await dashWorkspace(next);
15
+ const status = await statusWorkspace({ ...next, json: false, write: true, quiet: true });
14
16
 
15
17
  const result = {
16
18
  status: "ok",
@@ -18,6 +20,7 @@ export async function syncWorkspace(args) {
18
20
  aiEnv: compiled.aiEnv,
19
21
  manifest: scanned.manifest,
20
22
  timeline: scanned.timeline,
23
+ status: status.artifact,
21
24
  dashboard: dashboard.dashboard
22
25
  },
23
26
  changes: scanned.changes,
@@ -27,7 +30,7 @@ export async function syncWorkspace(args) {
27
30
  if (args.json) {
28
31
  console.log(JSON.stringify(result, null, 2));
29
32
  } else if (!quiet) {
30
- console.log("sync complete: AIENV.md, manifest, ledger, intents, and dashboard are up to date");
33
+ console.log("sync complete: AIENV.md, manifest, status, ledger, intents, and dashboard are up to date");
31
34
  }
32
35
 
33
36
  return result;
package/src/paths.js CHANGED
@@ -12,6 +12,10 @@ export function manifestPath(dir) {
12
12
  return path.join(stateDir(dir), "manifest.json");
13
13
  }
14
14
 
15
+ export function statusJsonPath(dir) {
16
+ return path.join(stateDir(dir), "status.json");
17
+ }
18
+
15
19
  export function previousManifestPath(dir) {
16
20
  return path.join(stateDir(dir), "manifest.previous.json");
17
21
  }