hngr 0.8.0 → 0.9.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.
- package/README.md +3 -3
- package/dist/{auth-ByGgd_Yn.mjs → auth-CQkOtVxv.mjs} +5 -5
- package/dist/{catalog-qfvmyg4e.mjs → catalog-CmtREMFr.mjs} +13 -3
- package/dist/{commands-39DynBwu.mjs → commands-Bjui8-Nt.mjs} +1 -1
- package/dist/{http-DgHX7Fux.mjs → http-CLG2jrIE.mjs} +2 -2
- package/dist/index.mjs +14 -14
- package/dist/{mcp-CctR-PSK.mjs → mcp-C-oJ6J5B.mjs} +2 -2
- package/dist/{pagination-BXyFxGYA.mjs → pagination-DtoXmj2F.mjs} +1 -1
- package/dist/{scope-D5BF1Dv_.mjs → scope-8BZjgIXy.mjs} +2 -2
- package/dist/{skills-oCdToBxi.mjs → skills-CqHGxo_M.mjs} +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,13 +13,13 @@ hngr --version
|
|
|
13
13
|
## Authenticate
|
|
14
14
|
|
|
15
15
|
```sh
|
|
16
|
-
# Interactive: username and password against
|
|
16
|
+
# Interactive: username and password against https://hangar.paykka.com (the
|
|
17
17
|
# built-in default), then an access token is written to
|
|
18
18
|
# ~/.config/hngr/config.json (0600).
|
|
19
19
|
hngr auth login
|
|
20
20
|
|
|
21
|
-
# A different deployment.
|
|
22
|
-
#
|
|
21
|
+
# A different deployment. Any non-local host needs https:// (or an explicit
|
|
22
|
+
# --insecure).
|
|
23
23
|
hngr auth login --server https://hangar.example.com
|
|
24
24
|
|
|
25
25
|
# CI or containers: read an existing access token from stdin.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as HngrError, d as configFilePath, f as deleteStoredConfig, g as resolveConnection, h as redactUrl, m as readStoredConfig, n as apiGet, p as normalizeServerUrl, t as apiFetch, v as storedAudience, y as writeStoredConfig } from "./http-
|
|
1
|
+
import { C as HngrError, d as configFilePath, f as deleteStoredConfig, g as resolveConnection, h as redactUrl, m as readStoredConfig, n as apiGet, p as normalizeServerUrl, t as apiFetch, v as storedAudience, y as writeStoredConfig } from "./http-CLG2jrIE.mjs";
|
|
2
2
|
import { hostname } from "node:os";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
import { spawn } from "node:child_process";
|
|
@@ -60,8 +60,8 @@ function canPrompt(ctx) {
|
|
|
60
60
|
return ctx.io.stdin.isTTY && ctx.io.stdout.isTTY && ctx.io.prompts !== void 0;
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
|
-
* Enforces https everywhere; http only for localhost, 127.0.0.1, [::1],
|
|
64
|
-
*
|
|
63
|
+
* Enforces https everywhere; http only for localhost, 127.0.0.1, [::1], or
|
|
64
|
+
* with an explicit --insecure.
|
|
65
65
|
*/
|
|
66
66
|
function assertServerUrlAllowed(raw, insecure) {
|
|
67
67
|
const server = normalizeServerUrl(raw);
|
|
@@ -72,7 +72,7 @@ function assertServerUrlAllowed(raw, insecure) {
|
|
|
72
72
|
"localhost",
|
|
73
73
|
"127.0.0.1",
|
|
74
74
|
"[::1]"
|
|
75
|
-
].includes(url.hostname) || insecure
|
|
75
|
+
].includes(url.hostname) || insecure) return server;
|
|
76
76
|
throw new HngrError({
|
|
77
77
|
type: "config",
|
|
78
78
|
title: `Refusing insecure server URL ${redactUrl(server)}`,
|
|
@@ -114,7 +114,7 @@ async function revokePreviousToken(ctx, stored) {
|
|
|
114
114
|
async function login(ctx, argv) {
|
|
115
115
|
if (ctx.env.HANGAR_TOKEN) throw envTokenRefusal();
|
|
116
116
|
const stored = await readStoredConfig(ctx.env);
|
|
117
|
-
const server = assertServerUrlAllowed(ctx.flags.server ?? ctx.env.HANGAR_URL ?? stored?.server ?? "
|
|
117
|
+
const server = assertServerUrlAllowed(ctx.flags.server ?? ctx.env.HANGAR_URL ?? stored?.server ?? "https://hangar.paykka.com", ctx.flags.insecure);
|
|
118
118
|
if (stored?.token && !ctx.flags.force) try {
|
|
119
119
|
const me = asStoredPrincipal(await apiGet({
|
|
120
120
|
server,
|
|
@@ -1242,7 +1242,7 @@ const COMMANDS = deriveCommands({
|
|
|
1242
1242
|
"get": {
|
|
1243
1243
|
"operationId": "listCapabilities",
|
|
1244
1244
|
"summary": "List the Capabilities the caller can read, newest first.",
|
|
1245
|
-
"description": "Reads follow the rules of `lookupCapability`. Filters combine with\nAND. The list is ordered by `created_at` then `id`, both descending,\nand paged by cursor
|
|
1245
|
+
"description": "Reads follow the rules of `lookupCapability`. Filters combine with\nAND. The list is ordered by `created_at` then `id`, both descending,\nand paged by cursor. `total` counts every Capability matching the\nfilters, independent of the cursor.\n",
|
|
1246
1246
|
"security": [
|
|
1247
1247
|
{},
|
|
1248
1248
|
{ "sessionCookie": [] },
|
|
@@ -3660,13 +3660,23 @@ const COMMANDS = deriveCommands({
|
|
|
3660
3660
|
},
|
|
3661
3661
|
"CapabilityList": {
|
|
3662
3662
|
"type": "object",
|
|
3663
|
-
"required": [
|
|
3663
|
+
"required": [
|
|
3664
|
+
"items",
|
|
3665
|
+
"next_cursor",
|
|
3666
|
+
"total"
|
|
3667
|
+
],
|
|
3664
3668
|
"properties": {
|
|
3665
3669
|
"items": {
|
|
3666
3670
|
"type": "array",
|
|
3667
3671
|
"items": { "$ref": "#/components/schemas/Capability" }
|
|
3668
3672
|
},
|
|
3669
|
-
"next_cursor": { "$ref": "#/components/schemas/NextCursor" }
|
|
3673
|
+
"next_cursor": { "$ref": "#/components/schemas/NextCursor" },
|
|
3674
|
+
"total": {
|
|
3675
|
+
"type": "integer",
|
|
3676
|
+
"format": "int64",
|
|
3677
|
+
"minimum": 0,
|
|
3678
|
+
"description": "The number of Capabilities matching the filters, independent of the cursor."
|
|
3679
|
+
}
|
|
3670
3680
|
}
|
|
3671
3681
|
},
|
|
3672
3682
|
"VersionSummary": {
|
|
@@ -171,7 +171,7 @@ async function readStoredConfig(env) {
|
|
|
171
171
|
* The instance the CLI talks to when `--server`, `HANGAR_URL` and the config
|
|
172
172
|
* file are all absent. Point a deployment elsewhere with any of those.
|
|
173
173
|
*/
|
|
174
|
-
const DEFAULT_SERVER_URL = "
|
|
174
|
+
const DEFAULT_SERVER_URL = "https://hangar.paykka.com";
|
|
175
175
|
const INVALID_SERVER_DETAIL = "Pass --server <url>, set HANGAR_URL, or run `hngr auth login` to store one in the config file.";
|
|
176
176
|
/** Parses and normalizes a server URL (no trailing slash); invalid input is a config error. */
|
|
177
177
|
function normalizeServerUrl(server) {
|
|
@@ -225,7 +225,7 @@ async function deleteStoredConfig(env) {
|
|
|
225
225
|
*/
|
|
226
226
|
async function resolveConnection(flags, env) {
|
|
227
227
|
const config = await readStoredConfig(env);
|
|
228
|
-
const server = flags.server ?? env.HANGAR_URL ?? config?.server ?? "
|
|
228
|
+
const server = flags.server ?? env.HANGAR_URL ?? config?.server ?? "https://hangar.paykka.com";
|
|
229
229
|
const token = env.HANGAR_TOKEN ?? config?.token;
|
|
230
230
|
return {
|
|
231
231
|
server: normalizeServerUrl(server),
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as kebabCase, i as normalizeCommandName, n as COMMANDS, o as COMMAND_ALIASES, r as findCommand, t as commandCatalog } from "./catalog-
|
|
2
|
-
import { C as HngrError, S as CancelledError, c as redactUrlForDisplay, g as resolveConnection, i as buildRequestUrl, o as redactQuery, r as apiRequest, s as redactSensitive, u as DEFAULT_SERVER_URL, w as renderError } from "./http-
|
|
3
|
-
import { t as collectPages } from "./pagination-
|
|
1
|
+
import { a as kebabCase, i as normalizeCommandName, n as COMMANDS, o as COMMAND_ALIASES, r as findCommand, t as commandCatalog } from "./catalog-CmtREMFr.mjs";
|
|
2
|
+
import { C as HngrError, S as CancelledError, c as redactUrlForDisplay, g as resolveConnection, i as buildRequestUrl, o as redactQuery, r as apiRequest, s as redactSensitive, u as DEFAULT_SERVER_URL, w as renderError } from "./http-CLG2jrIE.mjs";
|
|
3
|
+
import { t as collectPages } from "./pagination-DtoXmj2F.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import { notStrictEqual, strictEqual } from "assert";
|
|
6
6
|
import { basename, dirname, extname, join, normalize, relative, resolve } from "path";
|
|
@@ -5279,7 +5279,7 @@ function isYargsInstance(y) {
|
|
|
5279
5279
|
// ../../node_modules/.pnpm/yargs@18.2.0/node_modules/yargs/index.mjs
|
|
5280
5280
|
const Yargs = YargsFactory(esm_default);
|
|
5281
5281
|
// package.json
|
|
5282
|
-
var version = "0.
|
|
5282
|
+
var version = "0.9.0";
|
|
5283
5283
|
// src/generated/completion.ts
|
|
5284
5284
|
function isCompletionShell(value) {
|
|
5285
5285
|
return value === "bash" || value === "zsh" || value === "fish";
|
|
@@ -7228,7 +7228,7 @@ function buildParser(onMatched) {
|
|
|
7228
7228
|
parser.command("commands", "Print the command catalog", () => {}, (argv) => {
|
|
7229
7229
|
onMatched({
|
|
7230
7230
|
argv,
|
|
7231
|
-
run: async (ctx) => (await import("./commands-
|
|
7231
|
+
run: async (ctx) => (await import("./commands-Bjui8-Nt.mjs")).run(ctx)
|
|
7232
7232
|
});
|
|
7233
7233
|
});
|
|
7234
7234
|
parser.command("auth", "Manage credentials", (auth) => {
|
|
@@ -7241,13 +7241,13 @@ function buildParser(onMatched) {
|
|
|
7241
7241
|
}).conflicts("password", "token"), (argv) => {
|
|
7242
7242
|
onMatched({
|
|
7243
7243
|
argv,
|
|
7244
|
-
run: async (ctx, matchedArgv) => (await import("./auth-
|
|
7244
|
+
run: async (ctx, matchedArgv) => (await import("./auth-CQkOtVxv.mjs")).login(ctx, matchedArgv)
|
|
7245
7245
|
});
|
|
7246
7246
|
});
|
|
7247
7247
|
auth.command("logout", "Revoke the stored token and delete the local config", () => {}, (argv) => {
|
|
7248
7248
|
onMatched({
|
|
7249
7249
|
argv,
|
|
7250
|
-
run: async (ctx) => (await import("./auth-
|
|
7250
|
+
run: async (ctx) => (await import("./auth-CQkOtVxv.mjs")).logout(ctx)
|
|
7251
7251
|
});
|
|
7252
7252
|
});
|
|
7253
7253
|
auth.command("status", "Show credential source, server, principal, token prefix and audience", (status) => status.option("offline", {
|
|
@@ -7257,7 +7257,7 @@ function buildParser(onMatched) {
|
|
|
7257
7257
|
}), (argv) => {
|
|
7258
7258
|
onMatched({
|
|
7259
7259
|
argv,
|
|
7260
|
-
run: async (ctx, matchedArgv) => (await import("./auth-
|
|
7260
|
+
run: async (ctx, matchedArgv) => (await import("./auth-CQkOtVxv.mjs")).status(ctx, matchedArgv)
|
|
7261
7261
|
});
|
|
7262
7262
|
});
|
|
7263
7263
|
auth.command("token", "Print the access token to stdout and nothing else", (token) => token.option("audience", {
|
|
@@ -7268,13 +7268,13 @@ function buildParser(onMatched) {
|
|
|
7268
7268
|
}), (argv) => {
|
|
7269
7269
|
onMatched({
|
|
7270
7270
|
argv,
|
|
7271
|
-
run: async (ctx, matchedArgv) => (await import("./auth-
|
|
7271
|
+
run: async (ctx, matchedArgv) => (await import("./auth-CQkOtVxv.mjs")).token(ctx, matchedArgv)
|
|
7272
7272
|
});
|
|
7273
7273
|
});
|
|
7274
7274
|
auth.command("whoami", "Print the GET /me payload", () => {}, (argv) => {
|
|
7275
7275
|
onMatched({
|
|
7276
7276
|
argv,
|
|
7277
|
-
run: async (ctx) => (await import("./auth-
|
|
7277
|
+
run: async (ctx) => (await import("./auth-CQkOtVxv.mjs")).whoami(ctx)
|
|
7278
7278
|
});
|
|
7279
7279
|
});
|
|
7280
7280
|
registerGeneratedAuth(auth, onMatched);
|
|
@@ -7312,7 +7312,7 @@ function buildParser(onMatched) {
|
|
|
7312
7312
|
}), (argv) => {
|
|
7313
7313
|
onMatched({
|
|
7314
7314
|
argv,
|
|
7315
|
-
run: async (ctx, matchedArgv) => (await import("./skills-
|
|
7315
|
+
run: async (ctx, matchedArgv) => (await import("./skills-CqHGxo_M.mjs")).add(ctx, matchedArgv)
|
|
7316
7316
|
});
|
|
7317
7317
|
});
|
|
7318
7318
|
skills.command("publish <paths..>", "Publish a local skill directory as a capability or a new version", (publish) => publish.option("namespace", {
|
|
@@ -7340,7 +7340,7 @@ function buildParser(onMatched) {
|
|
|
7340
7340
|
}), (argv) => {
|
|
7341
7341
|
onMatched({
|
|
7342
7342
|
argv,
|
|
7343
|
-
run: async (ctx, matchedArgv) => (await import("./skills-
|
|
7343
|
+
run: async (ctx, matchedArgv) => (await import("./skills-CqHGxo_M.mjs")).publish(ctx, matchedArgv)
|
|
7344
7344
|
});
|
|
7345
7345
|
});
|
|
7346
7346
|
return skills.demandCommand(1);
|
|
@@ -7362,7 +7362,7 @@ function buildParser(onMatched) {
|
|
|
7362
7362
|
}), (argv) => {
|
|
7363
7363
|
onMatched({
|
|
7364
7364
|
argv,
|
|
7365
|
-
run: async (ctx, matchedArgv) => (await import("./mcp-
|
|
7365
|
+
run: async (ctx, matchedArgv) => (await import("./mcp-C-oJ6J5B.mjs")).add(ctx, matchedArgv)
|
|
7366
7366
|
});
|
|
7367
7367
|
});
|
|
7368
7368
|
mcp.command("publish <paths..>", "Publish an MCP snapshot as a capability or a new version", (publish) => publish.option("namespace", {
|
|
@@ -7390,7 +7390,7 @@ function buildParser(onMatched) {
|
|
|
7390
7390
|
}), (argv) => {
|
|
7391
7391
|
onMatched({
|
|
7392
7392
|
argv,
|
|
7393
|
-
run: async (ctx, matchedArgv) => (await import("./mcp-
|
|
7393
|
+
run: async (ctx, matchedArgv) => (await import("./mcp-C-oJ6J5B.mjs")).publish(ctx, matchedArgv)
|
|
7394
7394
|
});
|
|
7395
7395
|
});
|
|
7396
7396
|
return mcp.demandCommand(1);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as HngrError, g as resolveConnection, s as redactSensitive, t as apiFetch, x as writeFileAtomically } from "./http-
|
|
2
|
-
import { S as parseCapabilityPath, T as resolveCapabilityVersion, _ as downloadContent, a as errorBody, c as runBatch, h as findAgentDefinition, i as runPublish, l as stringValues, m as AGENTS, n as explicitName, o as failedResult, p as pathExists, r as readPublishFlags, s as positionalPaths, t as resolveInstallScope, v as MCP_KIND, w as resolveCapability } from "./scope-
|
|
1
|
+
import { C as HngrError, g as resolveConnection, s as redactSensitive, t as apiFetch, x as writeFileAtomically } from "./http-CLG2jrIE.mjs";
|
|
2
|
+
import { S as parseCapabilityPath, T as resolveCapabilityVersion, _ as downloadContent, a as errorBody, c as runBatch, h as findAgentDefinition, i as runPublish, l as stringValues, m as AGENTS, n as explicitName, o as failedResult, p as pathExists, r as readPublishFlags, s as positionalPaths, t as resolveInstallScope, v as MCP_KIND, w as resolveCapability } from "./scope-8BZjgIXy.mjs";
|
|
3
3
|
import { constants } from "node:fs";
|
|
4
4
|
import { access, readFile, stat } from "node:fs/promises";
|
|
5
5
|
import { basename, delimiter, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as HngrError } from "./http-
|
|
1
|
+
import { C as HngrError } from "./http-CLG2jrIE.mjs";
|
|
2
2
|
// src/pagination.ts
|
|
3
3
|
function asCursorPage(body, path) {
|
|
4
4
|
if (body === null || typeof body !== "object" || !Array.isArray(body.items) || !("next_cursor" in body)) throw new HngrError({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as HngrError, _ as scrubCredentials, a as toHngrError, b as writeDirectoryAtomically, g as resolveConnection, h as redactUrl, i as buildRequestUrl, l as apiErrorFromResponse, n as apiGet } from "./http-
|
|
2
|
-
import { t as collectPages } from "./pagination-
|
|
1
|
+
import { C as HngrError, _ as scrubCredentials, a as toHngrError, b as writeDirectoryAtomically, g as resolveConnection, h as redactUrl, i as buildRequestUrl, l as apiErrorFromResponse, n as apiGet } from "./http-CLG2jrIE.mjs";
|
|
2
|
+
import { t as collectPages } from "./pagination-DtoXmj2F.mjs";
|
|
3
3
|
import { lstat, mkdir, readFile, rename, rm, symlink, writeFile } from "node:fs/promises";
|
|
4
4
|
import { homedir } from "node:os";
|
|
5
5
|
import { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as HngrError, g as resolveConnection, r as apiRequest } from "./http-
|
|
2
|
-
import { C as parseCapabilityTarget, S as parseCapabilityPath, T as resolveCapabilityVersion, _ as downloadContent, a as errorBody, b as findCapability, c as runBatch, d as installAtomically, f as linkAtomically, g as homeDir, i as runPublish, l as stringValues, m as AGENTS, n as explicitName, o as failedResult, p as pathExists, r as readPublishFlags, s as positionalPaths, t as resolveInstallScope, u as copyAtomically, w as resolveCapability, x as listCapabilityNamespace, y as SKILL_KIND } from "./scope-
|
|
1
|
+
import { C as HngrError, g as resolveConnection, r as apiRequest } from "./http-CLG2jrIE.mjs";
|
|
2
|
+
import { C as parseCapabilityTarget, S as parseCapabilityPath, T as resolveCapabilityVersion, _ as downloadContent, a as errorBody, b as findCapability, c as runBatch, d as installAtomically, f as linkAtomically, g as homeDir, i as runPublish, l as stringValues, m as AGENTS, n as explicitName, o as failedResult, p as pathExists, r as readPublishFlags, s as positionalPaths, t as resolveInstallScope, u as copyAtomically, w as resolveCapability, x as listCapabilityNamespace, y as SKILL_KIND } from "./scope-8BZjgIXy.mjs";
|
|
3
3
|
import { lstat, readFile, readdir } from "node:fs/promises";
|
|
4
4
|
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
5
5
|
import { randomUUID } from "node:crypto";
|