@kindgi/api 0.1.4-rc.3 → 0.1.4-rc.5
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/dist/app.d.ts +7 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +12 -1
- package/dist/app.js.map +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +7 -0
- package/dist/errors.js.map +1 -1
- package/dist/gate-policy-binding.d.ts +7 -5
- package/dist/gate-policy-binding.d.ts.map +1 -1
- package/dist/handler-binding.d.ts +9 -0
- package/dist/handler-binding.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/live-version-binding.d.ts +40 -8
- package/dist/live-version-binding.d.ts.map +1 -1
- package/dist/middleware/error-mapper.d.ts.map +1 -1
- package/dist/middleware/error-mapper.js +2 -0
- package/dist/middleware/error-mapper.js.map +1 -1
- package/dist/middleware/request-log.d.ts +31 -0
- package/dist/middleware/request-log.d.ts.map +1 -0
- package/dist/middleware/request-log.js +80 -0
- package/dist/middleware/request-log.js.map +1 -0
- package/dist/openapi/operations.d.ts.map +1 -1
- package/dist/openapi/operations.js +8 -5
- package/dist/openapi/operations.js.map +1 -1
- package/dist/openapi/schemas.d.ts.map +1 -1
- package/dist/openapi/schemas.js +5 -0
- package/dist/openapi/schemas.js.map +1 -1
- package/dist/routes/agent-releases.d.ts.map +1 -1
- package/dist/routes/agent-releases.js +42 -1
- package/dist/routes/agent-releases.js.map +1 -1
- package/dist/routes/runs.d.ts.map +1 -1
- package/dist/routes/runs.js +5 -2
- package/dist/routes/runs.js.map +1 -1
- package/dist/secrets-binding.d.ts +8 -0
- package/dist/secrets-binding.d.ts.map +1 -1
- package/dist/types.d.ts +9 -0
- package/dist/types.d.ts.map +1 -1
- package/openapi.json +40 -6
- package/package.json +22 -21
- package/src/app.ts +17 -1
- package/src/errors.ts +7 -0
- package/src/gate-policy-binding.ts +7 -5
- package/src/handler-binding.ts +10 -0
- package/src/index.ts +1 -0
- package/src/live-version-binding.ts +39 -7
- package/src/middleware/error-mapper.ts +3 -0
- package/src/middleware/request-log.ts +89 -0
- package/src/openapi/operations.ts +16 -5
- package/src/openapi/schemas.ts +6 -0
- package/src/routes/agent-releases.ts +46 -2
- package/src/routes/runs.ts +11 -1
- package/src/secrets-binding.ts +5 -0
- package/src/types.ts +9 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Copyright (C) 2026 Kindgi Inc.
|
|
3
|
+
import { formatTraceparent, traceFromHeader } from '@kindgi/log';
|
|
4
|
+
import { routePath } from 'hono/route';
|
|
5
|
+
/** Paths a client or a probe reads all the time: their lines are `debug` even when they fail to read. */
|
|
6
|
+
const QUIET_PATHS = new Set(['/health', '/ready', '/v1/openapi.json']);
|
|
7
|
+
const WRITES = new Set(['POST', 'PUT', 'PATCH', 'DELETE']);
|
|
8
|
+
/**
|
|
9
|
+
* The access line's level, so `info` stays readable with a console open
|
|
10
|
+
* (it polls every few seconds): a write, and every 4xx, at `info`; every
|
|
11
|
+
* 5xx at `error`; a successful read (`GET`, `HEAD`: the polling), the
|
|
12
|
+
* health and readiness probes, the spec and the console's files, and a
|
|
13
|
+
* stream's opening, at `debug`.
|
|
14
|
+
*/
|
|
15
|
+
export function accessLevel(c) {
|
|
16
|
+
const status = c.res.status;
|
|
17
|
+
if (status >= 500)
|
|
18
|
+
return 'error';
|
|
19
|
+
if (QUIET_PATHS.has(c.req.path) || !c.req.path.startsWith('/v1/'))
|
|
20
|
+
return 'debug';
|
|
21
|
+
if (WRITES.has(c.req.method) || status >= 400)
|
|
22
|
+
return 'info';
|
|
23
|
+
return 'debug';
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The request's trace context and logger, then its access line.
|
|
27
|
+
*
|
|
28
|
+
* - **Trace:** an incoming `traceparent` (a load balancer's, an API
|
|
29
|
+
* gateway's, the caller's own app) is honoured: its trace id is kept
|
|
30
|
+
* and the request gets its own span, a child of the caller's. A
|
|
31
|
+
* missing or malformed one starts a fresh trace. `c.var.trace` holds
|
|
32
|
+
* it; the response answers `traceresponse` (W3C Trace Context Level
|
|
33
|
+
* 2) next to `X-Request-Id`.
|
|
34
|
+
* - **Logger:** `c.var.log` is a child of the app's logger with the
|
|
35
|
+
* request's `requestId`, `traceId` and `spanId` (subsystem `http`);
|
|
36
|
+
* routes log through it, and authentication adds `tenantId`.
|
|
37
|
+
* - **Access line:** `METHOD route status ms`, with the route's
|
|
38
|
+
* pattern (`/v1/runs/:runId`, never the raw path, so ids don't
|
|
39
|
+
* multiply lines), at the level `accessLevel` gives.
|
|
40
|
+
*
|
|
41
|
+
* Mounted right after the request-id middleware.
|
|
42
|
+
*/
|
|
43
|
+
export function requestLogMiddleware(logger) {
|
|
44
|
+
return async (c, next) => {
|
|
45
|
+
const started = Date.now();
|
|
46
|
+
const trace = traceFromHeader(c.req.header('traceparent'));
|
|
47
|
+
c.set('trace', trace);
|
|
48
|
+
c.set('log', logger.child({
|
|
49
|
+
subsystem: 'http',
|
|
50
|
+
requestId: c.get('requestId'),
|
|
51
|
+
traceId: trace.traceId,
|
|
52
|
+
spanId: trace.spanId,
|
|
53
|
+
}));
|
|
54
|
+
try {
|
|
55
|
+
await next();
|
|
56
|
+
}
|
|
57
|
+
finally {
|
|
58
|
+
c.header('traceresponse', formatTraceparent(trace));
|
|
59
|
+
const log = c.get('log');
|
|
60
|
+
const level = accessLevel(c);
|
|
61
|
+
if (log.isLevelEnabled(level)) {
|
|
62
|
+
// The responding route's pattern; a request no route matched ends on a wildcard.
|
|
63
|
+
const pattern = routePath(c, -1);
|
|
64
|
+
const route = pattern.endsWith('*') ? c.req.path : pattern;
|
|
65
|
+
const durationMs = Date.now() - started;
|
|
66
|
+
const stream = (c.res.headers.get('content-type') ?? '').startsWith('text/event-stream');
|
|
67
|
+
log[stream ? 'debug' : level](`${c.req.method} ${route} ${c.res.status} ${durationMs}ms${stream ? ' (stream opened)' : ''}`, {
|
|
68
|
+
method: c.req.method,
|
|
69
|
+
route,
|
|
70
|
+
status: c.res.status,
|
|
71
|
+
durationMs,
|
|
72
|
+
...(c.get('tenantId') !== undefined && { tenantId: c.get('tenantId') }),
|
|
73
|
+
},
|
|
74
|
+
// The message says them: a terminal line needn't again.
|
|
75
|
+
{ inMessage: ['method', 'route', 'status', 'durationMs'] });
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=request-log.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-log.js","sourceRoot":"","sources":["../../src/middleware/request-log.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;AAEjC,OAAO,EAA8B,iBAAiB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE7F,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAIvC,yGAAyG;AACzG,MAAM,WAAW,GAAwB,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,kBAAkB,CAAC,CAAC,CAAC;AAE5F,MAAM,MAAM,GAAwB,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEhF;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,CAAkB;IAC5C,MAAM,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC;IAC5B,IAAI,MAAM,IAAI,GAAG;QAAE,OAAO,OAAO,CAAC;IAClC,IAAI,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;QAAE,OAAO,OAAO,CAAC;IAClF,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,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
operationId: 'agents.promotions.create',
|
|
1659
1659
|
summary: 'Make a version live for a scope',
|
|
1660
|
-
description: "Pins `version` live for `scope`: runs in that scope that don't name a version use it, from the next run. Open conversations keep their version. The version must be registered and active. Every promotion is recorded, with who asked and why. Needs `promote` on the agent.\n\nWith a gate policy for the scope (`GET …/gate-policy`), the promotion is checked first against the comparison named by `evalRunId`: `201` promoted; `202` the gate passed and the policy wants a reviewer's approval (a HITL approval, subject `agent-promotion`; the live version moves once it's approved, if nothing changed meanwhile); `422 gate-failed` with `details.promotionId`, `details.policy` and every check in `details.checks`. A refused promotion is recorded too.",
|
|
1660
|
+
description: "Pins `version` live for `scope`: runs in that scope that don't name a version use it, from the next run. Open conversations keep their version. The version must be registered and active. Every promotion is recorded, with who asked and why. Needs `promote` on the agent.\n\nWith a gate policy for the scope (`GET …/gate-policy`), the promotion is checked first against the comparison named by `evalRunId`: `201` promoted; `202` the gate passed and the policy wants a reviewer's approval (a HITL approval, subject `agent-promotion`; the live version moves once it's approved, if nothing changed meanwhile); `422 gate-failed` with `details.promotionId`, `details.policy` and every check in `details.checks`. A refused promotion is recorded too.\n\nA pin in place skips the gate: when the scope has no live version of its own and already serves exactly `version` (from a scope above, or as the latest), pinning it there changes nothing any run gets, so it is promoted (`201`) with one passing `pinInPlace` check, no comparison and no approval, its reason starting `pin-in-place`. It is re-checked as it is written; if the scope moved meanwhile, `409 promotion-superseded`: check again.",
|
|
1661
1661
|
tags: ['agents'],
|
|
1662
1662
|
security: 'bearer',
|
|
1663
1663
|
parameters: [AgentIdPathParam, IdempotencyKeyParam],
|
|
@@ -1670,7 +1670,7 @@ export const OPERATIONS = [
|
|
|
1670
1670
|
},
|
|
1671
1671
|
...CommonMutationErrors,
|
|
1672
1672
|
'404': ErrorResponse('The version is not registered, or was unregistered; or the eval run is not found.'),
|
|
1673
|
-
'409': ErrorResponse("`promotion-superseded`: the scope's live version changed while the gate ran; check again."),
|
|
1673
|
+
'409': ErrorResponse("`promotion-superseded`: the scope's live version changed while the gate ran; check again. `gate-policy-descendant-unpinned`: the change would also move a narrower scope a gate policy applies to, which has no live version of its own and so follows this scope, without its gate; the message names each one: pin it at its current version first."),
|
|
1674
1674
|
'422': ErrorResponse('`gate-failed`: the gate refused it. `details.checks` has every check; the refusal is recorded (`details.promotionId`).'),
|
|
1675
1675
|
'501': ErrorResponse("`promotion-gate-unsupported`: a gate policy applies, and the deployment can't record a gated promotion."),
|
|
1676
1676
|
},
|
|
@@ -1758,7 +1758,7 @@ export const OPERATIONS = [
|
|
|
1758
1758
|
'201': { description: 'Gate policy published.', schema: ref('GatePolicy') },
|
|
1759
1759
|
...CommonMutationErrors,
|
|
1760
1760
|
'400': ErrorResponse('Validation failed (see `details.issues`).'),
|
|
1761
|
-
'409': ErrorResponse('`gate-policy-already-registered`: that (id, version) exists. `gate-policy-scope-taken`: another policy gates the agent for the scope (`details.heldBy`). `gate-policy-scope-changed`: the version would change the agent or scope. `gate-policy-scope-unpinned`:
|
|
1761
|
+
'409': ErrorResponse('`gate-policy-already-registered`: that (id, version) exists. `gate-policy-scope-taken`: another policy gates the agent for the scope (`details.heldBy`). `gate-policy-scope-changed`: the version would change the agent or scope. `gate-policy-scope-unpinned`: the scope has no live version of its own; a gated scope holds its own pin (a pin above it is not enough, since a promotion there would change this scope ungated), so pin a version for the scope first.'),
|
|
1762
1762
|
},
|
|
1763
1763
|
},
|
|
1764
1764
|
{
|
|
@@ -1838,6 +1838,7 @@ export const OPERATIONS = [
|
|
|
1838
1838
|
'200': { description: 'The reinstated version.', schema: ref('GatePolicy') },
|
|
1839
1839
|
...CommonMutationErrors,
|
|
1840
1840
|
'404': ErrorResponse('No such version.'),
|
|
1841
|
+
'409': ErrorResponse('`gate-policy-scope-taken`: another policy gates the agent for the scope now (`details.heldBy`). `gate-policy-scope-unpinned`: the scope has no live version of its own; pin one first.'),
|
|
1841
1842
|
},
|
|
1842
1843
|
},
|
|
1843
1844
|
{
|
|
@@ -1893,7 +1894,7 @@ export const OPERATIONS = [
|
|
|
1893
1894
|
'200': { description: 'Rolled back.', schema: ref('Promotion') },
|
|
1894
1895
|
...CommonMutationErrors,
|
|
1895
1896
|
'404': ErrorResponse('`toVersion` is not registered, or was unregistered.'),
|
|
1896
|
-
'409': ErrorResponse('
|
|
1897
|
+
'409': ErrorResponse('`not-pinned`: the scope has no pin of its own. `nothing-to-roll-back`: no earlier version to go back to. `gate-policy-descendant-unpinned`: the change would also move a narrower scope a gate policy applies to, which has no live version of its own and so follows this scope, without its gate; the message names each one: pin it at its current version first.'),
|
|
1897
1898
|
},
|
|
1898
1899
|
},
|
|
1899
1900
|
{
|
|
@@ -1910,7 +1911,7 @@ export const OPERATIONS = [
|
|
|
1910
1911
|
responses: {
|
|
1911
1912
|
'200': { description: 'Unpinned.', schema: ref('Promotion') },
|
|
1912
1913
|
...CommonMutationErrors,
|
|
1913
|
-
'409': ErrorResponse('`not-pinned`: the scope has no pin of its own. `gate-policy-needs-pin`:
|
|
1914
|
+
'409': ErrorResponse('`not-pinned`: the scope has no pin of its own. `gate-policy-needs-pin`: the scope has a gate policy of its own, and a gated scope keeps its own pin; unregister the policy first, or roll back instead. `gate-policy-descendant-unpinned`: the change would also move a narrower scope a gate policy applies to, which has no live version of its own and so follows this scope, without its gate; the message names each one: pin it at its current version first.'),
|
|
1914
1915
|
},
|
|
1915
1916
|
},
|
|
1916
1917
|
// ---------- flows ----------
|
|
@@ -5493,6 +5494,7 @@ export const OPERATIONS = [
|
|
|
5493
5494
|
...CommonMutationErrors,
|
|
5494
5495
|
'403': ErrorResponse('Bearer token missing `secrets:rotate` capability.'),
|
|
5495
5496
|
'404': ErrorResponse('Unknown secret.'),
|
|
5497
|
+
'501': ErrorResponse("The store doesn't rotate (`secret-operation-unsupported`): under `kindgi dev` secrets live in the env files and have no versions; the message says what to do instead."),
|
|
5496
5498
|
},
|
|
5497
5499
|
},
|
|
5498
5500
|
{
|
|
@@ -5587,6 +5589,7 @@ export const OPERATIONS = [
|
|
|
5587
5589
|
'400': ErrorResponse('Missing or malformed scope / envName.'),
|
|
5588
5590
|
'403': ErrorResponse('Bearer token missing revoke capability.'),
|
|
5589
5591
|
'404': ErrorResponse('Unknown secret.'),
|
|
5592
|
+
'501': ErrorResponse("The store doesn't revoke (`secret-operation-unsupported`): under `kindgi dev` secrets live in the env files; the message says to remove the name there."),
|
|
5590
5593
|
},
|
|
5591
5594
|
},
|
|
5592
5595
|
// ---------- schedules (trigger surface) ----------
|