@mainwave/cli 0.13.1 → 0.15.0

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.
@@ -202,6 +202,6 @@
202
202
  "optOut": "markers",
203
203
  "hosts": ["codex"],
204
204
  "dataClasses": ["session id, turn id and agent id", "working directory", "start and end times"],
205
- "why": "Closes a turn that was still open when the session started, resumed or forked: the turn is sent ending at the last event it saw, never at the new start, so a killed Codex can't stretch a turn across the developer's absence. It also deletes turn state older than 7 days. It takes no matcher, so it runs for every source (the session-start refresh is a separate group that runs for `startup|resume|fork` only). Async."
205
+ "why": "Closes a turn an earlier run left open when the session resumed (a startup's, fork's or clear's session id is new, and a compaction is the same run, so those close nothing): the turn is sent ending at the last event it saw, never at the new start, so a killed Codex can't stretch a turn across the developer's absence. It also deletes turn state older than 7 days. It takes no matcher, so it runs for every source (the session-start refresh is a separate group that runs for `startup|resume|fork` only). Async."
206
206
  }
207
207
  ]
@@ -55,21 +55,19 @@
55
55
  // so a send that hasn't finished when such a run ends is lost.
56
56
 
57
57
  import { createHash } from 'node:crypto'
58
- import { readFileSync, writeFileSync } from 'node:fs'
58
+ import { readFileSync } from 'node:fs'
59
59
 
60
60
  import {
61
+ activityMarkerPath,
61
62
  boolAttr,
62
63
  buildMarkerPayload,
63
64
  doubleAttr,
64
65
  emitMarker,
65
66
  hookFlag,
66
67
  intAttr,
67
- isOkStatus,
68
68
  loadOtelConfig,
69
- ensureLogDir,
70
69
  markerHostSource,
71
70
  markerLog,
72
- markerLogPath,
73
71
  markerManagedDir,
74
72
  markerOauthAccountPath,
75
73
  markerProjectDir,
@@ -78,6 +76,7 @@ import {
78
76
  oauthAccountFromRecord,
79
77
  onceReaders,
80
78
  parseTraceparent,
79
+ stampActivity,
81
80
  stringAttr,
82
81
  trimmedOrUndefined,
83
82
  } from './marker-core.mjs'
@@ -124,24 +123,12 @@ const LOG_NAME = 'plan-snapshot.log'
124
123
  * `logOk`); it stamps the success sidecar instead (§ `stampSuccess`). */
125
124
  const snapshotLog = (argv) => markerLog(argv, LOG_NAME)
126
125
 
127
- /** The sidecar a 2xx post rewrites: `<log>.ok`, one timestamp line, never
128
- * appended to, so it stays one line however many prompts run. Its mtime is
129
- * the last successful send — what `doctor` reports as activity. */
130
- export const successMarkerPath = (argv) => `${markerLogPath(argv, LOG_NAME)}.ok`
126
+ /** The activity sidecar (§ marker-core `activityMarkerPath`). */
127
+ export const successMarkerPath = (argv) => activityMarkerPath(argv, LOG_NAME)
131
128
 
132
- /** Rewrite the success sidecar when `status` is a 2xx; anything else — no
133
- * response, a non-2xx — never counts as activity. Best-effort, like the log. */
134
- export const stampSuccess = (status, argv = process.argv, now = new Date()) => {
135
- if (!isOkStatus(status)) return false
136
- try {
137
- const path = successMarkerPath(argv)
138
- ensureLogDir(path)
139
- writeFileSync(path, `${now.toISOString()}\n`, { mode: 0o600 })
140
- return true
141
- } catch {
142
- return false
143
- }
144
- }
129
+ /** Rewrite the sidecar on a 2xx (§ marker-core `stampActivity`). */
130
+ export const stampSuccess = (status, argv = process.argv, now = new Date()) =>
131
+ stampActivity(status, argv, LOG_NAME, now)
145
132
 
146
133
  // Non-coding source/service, as for the ticket and PR markers: the span is
147
134
  // about the Anthropic account, not a stretch of coding work.
@@ -499,6 +486,7 @@ export const handle = async (payload, { argv = process.argv, emit = emitMarker }
499
486
  tool,
500
487
  managedDir,
501
488
  readers,
489
+ argv,
502
490
  )
503
491
  if (!endpoint || !bearer) {
504
492
  log('skip: collector endpoint/bearer not found in settings or env')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mainwave/cli",
3
- "version": "0.13.1",
3
+ "version": "0.15.0",
4
4
  "description": "Setup wizard for connecting third-party coding tools to Mainwave AI.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -45,19 +45,19 @@
45
45
  "api:generate": "openapi-ts"
46
46
  },
47
47
  "dependencies": {
48
- "@inquirer/prompts": "8.7.3",
48
+ "@inquirer/prompts": "8.7.5",
49
49
  "picocolors": "1.1.1"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@hey-api/openapi-ts": "^0.99.0",
53
53
  "@types/node": "22.20.5",
54
- "knip": "6.41.0",
55
- "lefthook": "2.2.1",
56
- "oxlint": "1.87.0",
54
+ "knip": "6.45.0",
55
+ "lefthook": "2.2.2",
56
+ "oxlint": "1.93.0",
57
57
  "prettier": "3.9.10",
58
58
  "typescript": "6.0.3",
59
- "vite": "8.3.4",
60
- "vitest": "5.0.3",
59
+ "vite": "8.3.7",
60
+ "vitest": "5.1.0",
61
61
  "yaml": "2.9.1"
62
62
  },
63
63
  "keywords": [