aienvmp 0.1.32 → 0.1.33

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.33
4
+
5
+ - Made `.aienvmp/status.json` a first-class artifact written by `aienvmp sync`.
6
+ - Added `aienvmp status --write` so AI agents and CI can refresh the compact state file directly.
7
+ - Updated the GitHub Action to use the built-in status writer instead of shell redirection.
8
+
3
9
  ## 0.1.32
4
10
 
5
11
  - 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
@@ -81,8 +82,8 @@ The dashboard shows which strict scopes are CI-ready before you enforce them.
81
82
  ## Commands
82
83
 
83
84
  ```bash
84
- aienvmp sync # update env map, light SBOM, ledger, dashboard
85
- aienvmp status # one compact clear/review decision
85
+ aienvmp sync # update env map, light SBOM, status, ledger, dashboard
86
+ aienvmp status --write # refresh .aienvmp/status.json only
86
87
  aienvmp context # AI preflight brief
87
88
  aienvmp context --json # AI decision contract + actions + compact step summary
88
89
  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.33",
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 = []) {
@@ -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
  }