@sockulags/agent-os 0.17.0 → 0.17.1

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/cli/index.mjs CHANGED
@@ -6,7 +6,7 @@ import fs from 'node:fs'
6
6
  import os from 'node:os'
7
7
  import path from 'node:path'
8
8
  import { createInterface } from 'node:readline'
9
- import { fileURLToPath, pathToFileURL } from 'node:url'
9
+ import { fileURLToPath } from 'node:url'
10
10
  import {
11
11
  HOOK_TIMEOUT_SECONDS,
12
12
  QUALITY_HOOK_MARKER
@@ -1189,7 +1189,18 @@ export async function run(argv = process.argv.slice(2), dependencies = {}) {
1189
1189
  return 0
1190
1190
  }
1191
1191
 
1192
- if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
1192
+ // npm and npx start the CLI through a bin symlink. Node resolves symlinks for import.meta.url but
1193
+ // leaves process.argv[1] as the symlink path, so compare real paths.
1194
+ function isMainModule() {
1195
+ if (!process.argv[1]) return false
1196
+ try {
1197
+ return fs.realpathSync(process.argv[1]) === fs.realpathSync(fileURLToPath(import.meta.url))
1198
+ } catch {
1199
+ return false
1200
+ }
1201
+ }
1202
+
1203
+ if (isMainModule()) {
1193
1204
  run().then((code) => {
1194
1205
  process.exitCode = code
1195
1206
  }).catch((error) => {
@@ -111,6 +111,16 @@ test('prints scoped npm commands and explains the direct default', async () => {
111
111
  assert.match(help, /--method <name>\s+direct \(default\) or plugin/)
112
112
  })
113
113
 
114
+ test('runs when invoked through a bin symlink as npm and npx do', { skip: process.platform === 'win32' }, () => {
115
+ const binDir = path.join(temporaryRoot(), 'node_modules', '.bin')
116
+ fs.mkdirSync(binDir, { recursive: true })
117
+ const bin = path.join(binDir, 'agent-os')
118
+ fs.symlinkSync(path.join(packageRootForTest(), 'cli', 'index.mjs'), bin)
119
+ const result = spawnSync(process.execPath, [bin, '--version'], { encoding: 'utf8' })
120
+ assert.equal(result.status, 0, result.stderr)
121
+ assert.equal(result.stdout.trim(), VERSION)
122
+ })
123
+
114
124
  test('rejects conflicting policy flags and direct local scope', async () => {
115
125
  assert.throws(() => parseArgs(['install', '--policy', '--no-policy']), /one of --policy and --no-policy/)
116
126
  await assert.rejects(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sockulags/agent-os",
3
- "version": "0.17.0",
3
+ "version": "0.17.1",
4
4
  "description": "A lightweight agent operating system for Claude Code and Codex: agent-os-core for intent, planning, and evidence, and agent-os-dev for delivery, review, and guard hooks.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "agent-os-core",
3
3
  "description": "Agent OS core: capture intent, plan decisions, explain plainly, keep scope, and prove claims. Useful for any agent work, not only code.",
4
- "version": "0.17.0",
4
+ "version": "0.17.1",
5
5
  "author": {
6
6
  "name": "Lucas Skog"
7
7
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "agent-os-core",
3
3
  "description": "Agent OS core: capture intent, plan decisions, explain plainly, keep scope, and prove claims. Useful for any agent work, not only code.",
4
- "version": "0.17.0",
4
+ "version": "0.17.1",
5
5
  "homepage": "https://sockulags.github.io/agent-os/",
6
6
  "repository": "https://github.com/sockulags/agent-os",
7
7
  "keywords": [
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "agent-os-dev",
3
3
  "description": "Agent OS development: shape plans, deliver against ground truth, review independently, and guard delivery with hooks. Requires agent-os-core.",
4
- "version": "0.17.0",
4
+ "version": "0.17.1",
5
5
  "author": {
6
6
  "name": "Lucas Skog"
7
7
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "agent-os-dev",
3
3
  "description": "Agent OS development: shape plans, deliver against ground truth, review independently, and guard delivery with hooks. Requires agent-os-core.",
4
- "version": "0.17.0",
4
+ "version": "0.17.1",
5
5
  "homepage": "https://sockulags.github.io/agent-os/",
6
6
  "repository": "https://github.com/sockulags/agent-os",
7
7
  "keywords": [