@hop-top/kit 0.5.0-alpha.2 → 0.5.0-alpha.3

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.
@@ -1,6 +1,7 @@
1
- export { A as Anim, a as AnimOpts, B as BadgeOpts, C as ConfirmOpts, L as ListItem, b as ListOpts, P as Progress, S as Spinner, c as StatusKind, d as anim, e as badge, f as clamp01, g as confirm, l as list, m as makeGradient, p as pills, h as progress, r as renderBarPlain, s as spinner, j as status } from '../index--C7Mtsmm.js';
2
- import '../cli-DgOEOsPB.js';
1
+ export { A as Anim, a as AnimOpts, B as BadgeOpts, C as ConfirmOpts, L as ListItem, b as ListOpts, P as Progress, S as Spinner, c as StatusKind, d as anim, e as badge, f as clamp01, g as confirm, l as list, m as makeGradient, p as pills, h as progress, r as renderBarPlain, s as spinner, j as status } from '../index-Bc5c7Ty5.js';
2
+ import '../cli-DLygZLi9.js';
3
3
  import 'commander';
4
4
  import '../netpolicy-asvCfwi8.js';
5
5
  import 'node:stream';
6
- import '../output-VFFLqor9.js';
6
+ import '../output-4aXs91GY.js';
7
+ import '../error-DISJKeDu.js';
package/dist/tui/index.js CHANGED
@@ -108,7 +108,8 @@ var parity_default = {
108
108
  output: "stderr"
109
109
  },
110
110
  extends: [
111
- "scope-defaults.json"
111
+ "scope-defaults.json",
112
+ "serve.json"
112
113
  ]
113
114
  };
114
115
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hop-top/kit",
3
- "version": "0.5.0-alpha.2",
3
+ "version": "0.5.0-alpha.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/hop-top/poly-kit.git",
@@ -121,6 +121,11 @@
121
121
  "require": "./dist/scope.js",
122
122
  "default": "./dist/scope.js"
123
123
  },
124
+ "./serve": {
125
+ "types": "./dist/serve.d.ts",
126
+ "require": "./dist/serve.js",
127
+ "default": "./dist/serve.js"
128
+ },
124
129
  "./telemetry": {
125
130
  "types": "./dist/telemetry/index.d.ts",
126
131
  "require": "./dist/telemetry/index.js",
@@ -175,7 +180,7 @@
175
180
  },
176
181
  "license": "MIT",
177
182
  "scripts": {
178
- "build": "tsup src/index.ts src/alias.ts src/cli.ts src/output.ts src/xdg.ts src/config.ts src/sqlstore.ts src/upgrade.ts src/llm.ts src/routellm.ts src/tui/index.ts src/errcorrect.ts src/safety.ts src/provenance.ts src/stream.ts src/progress.ts src/auth.ts src/api.ts src/rpc.ts src/aim.ts src/netpolicy.ts src/scope.ts src/telemetry/index.ts src/id/index.ts src/mcp/index.ts --format cjs --dts",
183
+ "build": "tsup src/index.ts src/alias.ts src/cli.ts src/output.ts src/xdg.ts src/config.ts src/sqlstore.ts src/upgrade.ts src/llm.ts src/routellm.ts src/tui/index.ts src/errcorrect.ts src/safety.ts src/provenance.ts src/stream.ts src/progress.ts src/auth.ts src/api.ts src/rpc.ts src/aim.ts src/netpolicy.ts src/scope.ts src/serve.ts src/telemetry/index.ts src/id/index.ts src/mcp/index.ts --format cjs --dts",
179
184
  "lint": "eslint src/",
180
185
  "lint:fix": "eslint src/ --fix",
181
186
  "test": "vitest run"
package/src/index.ts CHANGED
@@ -29,6 +29,7 @@ export * as routellm from './routellm.js';
29
29
  export * as rpc from './rpc.js';
30
30
  export * as safety from './safety.js';
31
31
  export * as scope from './scope.js';
32
+ export * as serve from './serve.js';
32
33
  export * as stream from './stream.js';
33
34
  export * as telemetry from './telemetry/index.js';
34
35
  export * as tui from './tui/index.js';
@@ -45,6 +45,13 @@ export const CODE_TRANSIENT = 'TRANSIENT'; // exit 6 — Factor-11 transient/ret
45
45
  export const CODE_PROVENANCE_MISSING = 'PROVENANCE_MISSING'; // exit 65 — Factor-12 strict-mode refusal
46
46
  export const CODE_RATE_LIMITED = 'RATE_LIMITED'; // exit 64 — Factor-10 max-ops budget exceeded
47
47
 
48
+ /**
49
+ * Spec-assigned exit code for the generic failure class: the command
50
+ * failed and no narrower code applies. Pair it with {@link genericError}
51
+ * rather than hand-rolling exit 1, so the envelope carries a transience
52
+ * class.
53
+ */
54
+ export const EXIT_GENERIC = 1;
48
55
  /**
49
56
  * Spec-assigned exit code for transient/retryable failures (Factor 11).
50
57
  * Agents branch on it before parsing stderr: exit 6 means a retry may
@@ -152,6 +159,22 @@ export function withTransience(e: CliError, transience: string): CliError {
152
159
  return clone;
153
160
  }
154
161
 
162
+ /**
163
+ * CODE_GENERIC envelope with exit code 1. The catch-all for failures no
164
+ * narrower code describes; permanent because retrying the same input
165
+ * in the same environment is not expected to help. Wrapping an
166
+ * arbitrary error as CODE_GENERIC via {@link wrapError} still defaults
167
+ * to unknown.
168
+ */
169
+ export function genericError(message: string): CliError {
170
+ return {
171
+ code: CODE_GENERIC,
172
+ message,
173
+ exit_code: EXIT_GENERIC,
174
+ transience: TRANSIENCE_PERMANENT,
175
+ };
176
+ }
177
+
155
178
  /** CODE_NOT_FOUND envelope with exit code 3. */
156
179
  export function notFoundError(message: string): CliError {
157
180
  return {
package/src/output.ts CHANGED
@@ -56,6 +56,7 @@ export {
56
56
  CODE_TRANSIENT,
57
57
  CODE_PROVENANCE_MISSING,
58
58
  CODE_RATE_LIMITED,
59
+ EXIT_GENERIC,
59
60
  EXIT_TRANSIENT,
60
61
  EXIT_RATE_LIMITED,
61
62
  EXIT_PROVENANCE_MISSING,
@@ -66,6 +67,7 @@ export {
66
67
  wrapError,
67
68
  unwrapError,
68
69
  withTransience,
70
+ genericError,
69
71
  notFoundError,
70
72
  conflictError,
71
73
  unauthorizedError,