@ory/argus 0.1.0 → 0.1.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.
@@ -7,7 +7,7 @@ preserving data volumes so you can restart later without losing state.
7
7
  Run:
8
8
 
9
9
  ```bash
10
- npx {{BIN}} local down
10
+ {{NPX}} local down
11
11
  ```
12
12
 
13
13
  To restart later, use {{REF_LOCAL_UP}}.
@@ -15,5 +15,5 @@ To restart later, use {{REF_LOCAL_UP}}.
15
15
  To stop **and** remove all data (full reset), run:
16
16
 
17
17
  ```bash
18
- npx {{BIN}} local reset
18
+ {{NPX}} local reset
19
19
  ```
@@ -7,7 +7,7 @@ and an Nginx gateway on port 4000.
7
7
  Run:
8
8
 
9
9
  ```bash
10
- npx {{BIN}} local up
10
+ {{NPX}} local up
11
11
  ```
12
12
 
13
13
  This will:
@@ -20,8 +20,8 @@ This will:
20
20
  After it completes, set the printed environment variables in your shell:
21
21
 
22
22
  ```bash
23
- eval "$(npx {{BIN}} local env)"
23
+ eval "$({{NPX}} local env)"
24
24
  ```
25
25
 
26
26
  If services are already running, stop them first with {{REF_LOCAL_DOWN}}
27
- or use `npx {{BIN}} local status` to check the current state.
27
+ or use `{{NPX}} local status` to check the current state.
@@ -14,7 +14,7 @@ manage the lifecycle:
14
14
  then seed a test identity, session, and permission tuples.
15
15
  - {{REF_LOCAL_DOWN}} — stop all services while preserving data volumes.
16
16
 
17
- Both delegate to `npx {{BIN}} local <subcommand>`, so the same
17
+ Both delegate to `{{NPX}} local <subcommand>`, so the same
18
18
  workflow runs from the shell when the command shortcuts are not available.
19
19
 
20
20
  ## When to use this skill
@@ -69,7 +69,7 @@ docker engine) and retry. Do not try to install Docker for them.
69
69
  Tell the user to run {{REF_LOCAL_UP}}, or the equivalent shell command:
70
70
 
71
71
  ```bash
72
- npx {{BIN}} local up
72
+ {{NPX}} local up
73
73
  ```
74
74
 
75
75
  Wait for the command to print "All services are running!" and the seed
@@ -79,7 +79,7 @@ output. Capture two values from the output:
79
79
  - `ORY_SESSION_TOKEN` (the seeded session token)
80
80
 
81
81
  If the user wants to skip seeding (to bring their own data), use
82
- `npx {{BIN}} local up --no-seed` instead.
82
+ `{{NPX}} local up --no-seed` instead.
83
83
 
84
84
  ## Step 3: Point the app at the local gateway
85
85
 
@@ -102,7 +102,7 @@ same value as `basePath` in the Ory `Configuration`.
102
102
  machine target the local stack):
103
103
 
104
104
  ```bash
105
- npx {{BIN}} local configure
105
+ {{NPX}} local configure
106
106
  ```
107
107
 
108
108
  This writes the URL to the shared plugin config so future agent runs
@@ -148,10 +148,10 @@ Common day-to-day commands:
148
148
 
149
149
  | Need | Command |
150
150
  |--------------------------------|------------------------------------------|
151
- | Re-seed (after `local reset`) | `npx {{BIN}} local seed` |
152
- | Tail Kratos logs | `npx {{BIN}} local logs kratos -f` |
153
- | Check what's running | `npx {{BIN}} local status` |
154
- | Print env vars to copy/paste | `npx {{BIN}} local env` |
151
+ | Re-seed (after `local reset`) | `{{NPX}} local seed` |
152
+ | Tail Kratos logs | `{{NPX}} local logs kratos -f` |
153
+ | Check what's running | `{{NPX}} local status` |
154
+ | Print env vars to copy/paste | `{{NPX}} local env` |
155
155
 
156
156
  If the user reports flaky behavior, run `local status` first to confirm
157
157
  each service is `healthy`. If a container is unhealthy, `local logs
@@ -161,14 +161,14 @@ have looked at logs.
161
161
  ## Step 7: Stop or reset
162
162
 
163
163
  When the user is done for the session, use {{REF_LOCAL_DOWN}} (equivalent:
164
- `npx {{BIN}} local down`). Containers stop but volumes
164
+ `{{NPX}} local down`). Containers stop but volumes
165
165
  remain, so the next {{REF_LOCAL_UP}} reuses the same identities,
166
166
  sessions, and tuples.
167
167
 
168
168
  For a full wipe (e.g., after schema changes or to clear test data):
169
169
 
170
170
  ```bash
171
- npx {{BIN}} local reset
171
+ {{NPX}} local reset
172
172
  ```
173
173
 
174
174
  `reset` removes data volumes and the generated `.ory-dev/ory/` directory.
@@ -179,8 +179,8 @@ plugin updates the bundled service configs.
179
179
 
180
180
  - **"Docker is not running"** — start Docker Desktop, then re-run
181
181
  {{REF_LOCAL_UP}}.
182
- - **Gateway never becomes healthy** — `npx {{BIN}} local logs
183
- gateway` and `npx {{BIN}} local logs kratos` to see which service
182
+ - **Gateway never becomes healthy** — `{{NPX}} local logs
183
+ gateway` and `{{NPX}} local logs kratos` to see which service
184
184
  failed. Port conflicts on `4000`, `4433`, `4444`, or `4466` are the
185
185
  usual culprit.
186
186
  - **Login works but `whoami` returns 401** — the cookie domain is
@@ -401,7 +401,25 @@ async function publishAllOryToLocal(opts = {}) {
401
401
  if (!fs.existsSync(tarball)) {
402
402
  throw new Error(`Packed ${pkgName} but expected tarball not found at ${tarball}.`);
403
403
  }
404
- const publishResult = (0, node_child_process_1.spawnSync)("npm", ["publish", tarball, "--registry", config_js_1.REGISTRY_URL, "--access=public"], {
404
+ // Scope-specific registry override. A developer who has run
405
+ // `npm login --scope=@ory` (or otherwise set `@ory:registry=…` in
406
+ // `~/.npmrc`) has a scope-pinned registry that takes precedence
407
+ // over `--registry` / `npm_config_registry` for scoped publishes.
408
+ // Without this flag, `npm publish` of an `@ory/*` tarball would
409
+ // silently target npmjs.org instead of localhost even though we
410
+ // strip `publishConfig.registry` and pass `--registry`.
411
+ const scope = packageScope(pkgName);
412
+ const scopeRegistryArg = scope
413
+ ? [`--${scope}:registry=${config_js_1.REGISTRY_URL}`]
414
+ : [];
415
+ const publishResult = (0, node_child_process_1.spawnSync)("npm", [
416
+ "publish",
417
+ tarball,
418
+ "--registry",
419
+ config_js_1.REGISTRY_URL,
420
+ ...scopeRegistryArg,
421
+ "--access=public",
422
+ ], {
405
423
  cwd: pkgDir,
406
424
  stdio: opts.quiet ? "pipe" : "inherit",
407
425
  encoding: "utf-8",
@@ -434,6 +452,14 @@ function readPackageNameVersion(pkgJsonPath) {
434
452
  function tarballFilename(pkgName, version) {
435
453
  return `${pkgName.replace(/^@/, "").replace("/", "-")}-${version}.tgz`;
436
454
  }
455
+ function packageScope(pkgName) {
456
+ if (!pkgName.startsWith("@"))
457
+ return null;
458
+ const slash = pkgName.indexOf("/");
459
+ if (slash < 0)
460
+ return null;
461
+ return pkgName.slice(0, slash);
462
+ }
437
463
  function emitCapturedOutput(quiet, label, result) {
438
464
  if (!quiet)
439
465
  return;
package/dist/skills.js CHANGED
@@ -126,6 +126,7 @@ function buildProfile(harness, opts) {
126
126
  tokens: {
127
127
  "{{BIN}}": opts.binName,
128
128
  "{{PKG}}": opts.packageName,
129
+ "{{NPX}}": `npx -y -p ${opts.packageName} ${opts.binName}`,
129
130
  "{{REF_AUTH_SETUP}}": skillRef("ory-auth-setup"),
130
131
  "{{REF_LOGIN_FLOW}}": skillRef("ory-login-flow"),
131
132
  "{{REF_SOCIAL_LOGIN}}": skillRef("ory-social-login"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ory/argus",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Ory Argus: the core API for building authentication, authorization, and audit into AI agent harness plugins, extensions, and custom integrations",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://ory.com",
@@ -44,7 +44,9 @@
44
44
  "hydra"
45
45
  ],
46
46
  "publishConfig": {
47
- "access": "public"
47
+ "access": "public",
48
+ "registry": "https://registry.npmjs.org/",
49
+ "provenance": true
48
50
  },
49
51
  "main": "dist/index.js",
50
52
  "types": "dist/index.d.ts",