@kici-dev/shared 0.4.0 → 0.6.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/dist/cold-store/chunk-id.js +3 -2
- package/dist/cold-store/config.js +3 -3
- package/dist/container-runtime.d.ts +148 -0
- package/dist/container-runtime.js +298 -0
- package/dist/container-runtime.test.d.ts +2 -0
- package/dist/db-admin.d.ts +0 -1015
- package/dist/db-admin.js +1 -1744
- package/dist/db.js +2 -1
- package/dist/diagnostics/bundle-archive.d.ts +7 -9
- package/dist/diagnostics/bundle-archive.js +12 -85
- package/dist/diagnostics/bundle-chunks.js +1 -1
- package/dist/env/define-env.d.ts +7 -6
- package/dist/env/define-env.js +8 -7
- package/dist/graceful-shutdown.d.ts +6 -2
- package/dist/graceful-shutdown.js +1 -1
- package/dist/idempotency-files.js +2 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/telemetry/init.js +2 -1
- package/package.json +13 -7
- package/sbom.spdx.json +395 -390
package/dist/db.js
CHANGED
|
@@ -76,7 +76,8 @@ function isPoolAcquireTimeout(err) {
|
|
|
76
76
|
* its own schema type (e.g., orchestrator Database vs Platform Database).
|
|
77
77
|
*/
|
|
78
78
|
function createDb(pool) {
|
|
79
|
-
|
|
79
|
+
const dialect = new PostgresDialect({ pool });
|
|
80
|
+
return new Kysely({ dialect });
|
|
80
81
|
}
|
|
81
82
|
//#endregion
|
|
82
83
|
export { createDb, createPool, isPoolAcquireTimeout };
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared debug-bundle archive primitives.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Windowed log-file archiving, used by the orchestrator's in-process bundle
|
|
5
|
+
* writer, the kici-admin CLI's local bundle, and the agent's fleet mini-bundle
|
|
6
|
+
* assembler. Keeping one copy means a node cannot drift from the archiving
|
|
7
|
+
* posture of its peers.
|
|
8
|
+
*
|
|
9
|
+
* The redaction primitives it applies live in `@kici-dev/core` so the `kici`
|
|
10
|
+
* CLI can reuse them without importing this package.
|
|
8
11
|
*/
|
|
9
12
|
import type { Archiver } from 'archiver';
|
|
10
13
|
/** Maximum total log bytes to include in bundle (50MB). */
|
|
11
14
|
export declare const MAX_LOG_BYTES: number;
|
|
12
|
-
/**
|
|
13
|
-
* Redact config values using allowlist approach.
|
|
14
|
-
* Only known-safe fields are preserved; everything else becomes "****".
|
|
15
|
-
*/
|
|
16
|
-
export declare function redactConfig(obj: unknown, parentKey?: string): unknown;
|
|
17
15
|
/**
|
|
18
16
|
* Add log files from logDir to the archive, respecting MAX_LOG_BYTES cap
|
|
19
17
|
* and the logWindow time filter. Matches any `*.log` file in the directory,
|
|
@@ -1,94 +1,21 @@
|
|
|
1
1
|
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
|
+
import { scrubText } from "@kici-dev/core";
|
|
2
3
|
import * as fs from "node:fs";
|
|
3
4
|
import * as path$1 from "node:path";
|
|
4
5
|
//#region src/diagnostics/bundle-archive.ts
|
|
5
6
|
/**
|
|
6
7
|
* Shared debug-bundle archive primitives.
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* Windowed log-file archiving, used by the orchestrator's in-process bundle
|
|
10
|
+
* writer, the kici-admin CLI's local bundle, and the agent's fleet mini-bundle
|
|
11
|
+
* assembler. Keeping one copy means a node cannot drift from the archiving
|
|
12
|
+
* posture of its peers.
|
|
13
|
+
*
|
|
14
|
+
* The redaction primitives it applies live in `@kici-dev/core` so the `kici`
|
|
15
|
+
* CLI can reuse them without importing this package.
|
|
12
16
|
*/
|
|
13
17
|
/** Maximum total log bytes to include in bundle (50MB). */
|
|
14
|
-
const MAX_LOG_BYTES =
|
|
15
|
-
/**
|
|
16
|
-
* Config field names that are safe to include unredacted.
|
|
17
|
-
* Everything else gets replaced with "****".
|
|
18
|
-
*/
|
|
19
|
-
const SAFE_CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
20
|
-
"mode",
|
|
21
|
-
"host",
|
|
22
|
-
"port",
|
|
23
|
-
"logLevel",
|
|
24
|
-
"region",
|
|
25
|
-
"environment",
|
|
26
|
-
"name",
|
|
27
|
-
"label",
|
|
28
|
-
"labels",
|
|
29
|
-
"enabled",
|
|
30
|
-
"disabled",
|
|
31
|
-
"timeout",
|
|
32
|
-
"interval",
|
|
33
|
-
"maxRetries",
|
|
34
|
-
"retries",
|
|
35
|
-
"workers",
|
|
36
|
-
"concurrency",
|
|
37
|
-
"maxConcurrency",
|
|
38
|
-
"batchSize",
|
|
39
|
-
"bufferSize",
|
|
40
|
-
"warmPool",
|
|
41
|
-
"cooldown",
|
|
42
|
-
"type",
|
|
43
|
-
"provider",
|
|
44
|
-
"scaler",
|
|
45
|
-
"driver",
|
|
46
|
-
"backend",
|
|
47
|
-
"protocol",
|
|
48
|
-
"scheme",
|
|
49
|
-
"path",
|
|
50
|
-
"basePath",
|
|
51
|
-
"metricsPath",
|
|
52
|
-
"healthPath",
|
|
53
|
-
"logFormat",
|
|
54
|
-
"logFile",
|
|
55
|
-
"logDir",
|
|
56
|
-
"dataDir",
|
|
57
|
-
"version",
|
|
58
|
-
"debug",
|
|
59
|
-
"verbose",
|
|
60
|
-
"quiet",
|
|
61
|
-
"tls",
|
|
62
|
-
"cors",
|
|
63
|
-
"rateLimiting",
|
|
64
|
-
"maxConnections",
|
|
65
|
-
"poolSize",
|
|
66
|
-
"minPool",
|
|
67
|
-
"maxPool",
|
|
68
|
-
"idleTimeout",
|
|
69
|
-
"connectTimeout",
|
|
70
|
-
"requestTimeout",
|
|
71
|
-
"shutdownTimeout",
|
|
72
|
-
"gracefulShutdown"
|
|
73
|
-
]);
|
|
74
|
-
/**
|
|
75
|
-
* Redact config values using allowlist approach.
|
|
76
|
-
* Only known-safe fields are preserved; everything else becomes "****".
|
|
77
|
-
*/
|
|
78
|
-
function redactConfig(obj, parentKey) {
|
|
79
|
-
if (obj === null || obj === void 0) return obj;
|
|
80
|
-
if (Array.isArray(obj)) return obj.map((item) => redactConfig(item, parentKey));
|
|
81
|
-
if (typeof obj === "object") {
|
|
82
|
-
const result = {};
|
|
83
|
-
for (const [key, value] of Object.entries(obj)) result[key] = redactConfig(value, key);
|
|
84
|
-
return result;
|
|
85
|
-
}
|
|
86
|
-
if (typeof obj === "string" && parentKey && !SAFE_CONFIG_KEYS.has(parentKey)) return "****";
|
|
87
|
-
if (typeof obj === "number" || typeof obj === "boolean") return obj;
|
|
88
|
-
if (typeof obj === "string" && parentKey && SAFE_CONFIG_KEYS.has(parentKey)) return obj;
|
|
89
|
-
if (typeof obj === "string") return "****";
|
|
90
|
-
return obj;
|
|
91
|
-
}
|
|
18
|
+
const MAX_LOG_BYTES = 52428800;
|
|
92
19
|
/**
|
|
93
20
|
* Add log files from logDir to the archive, respecting MAX_LOG_BYTES cap
|
|
94
21
|
* and the logWindow time filter. Matches any `*.log` file in the directory,
|
|
@@ -117,9 +44,9 @@ async function addLogsToArchive(archive, logDir, logWindowHours) {
|
|
|
117
44
|
const filePath = path$1.join(logDir, entry);
|
|
118
45
|
const stat = fs.statSync(filePath);
|
|
119
46
|
if (totalBytes + stat.size > 52428800) break;
|
|
120
|
-
const content = fs.readFileSync(filePath, "utf-8");
|
|
47
|
+
const content = scrubText(fs.readFileSync(filePath, "utf-8"));
|
|
121
48
|
archive.append(content, { name: `logs/${entry}` });
|
|
122
|
-
totalBytes +=
|
|
49
|
+
totalBytes += Buffer.byteLength(content, "utf-8");
|
|
123
50
|
const lines = content.split("\n");
|
|
124
51
|
totalLines += lines.length;
|
|
125
52
|
for (const line of lines) {
|
|
@@ -136,6 +63,6 @@ async function addLogsToArchive(archive, logDir, logWindowHours) {
|
|
|
136
63
|
archive.append(JSON.stringify(summary, null, 2), { name: "logs/summary.json" });
|
|
137
64
|
}
|
|
138
65
|
//#endregion
|
|
139
|
-
export { MAX_LOG_BYTES, addLogsToArchive
|
|
66
|
+
export { MAX_LOG_BYTES, addLogsToArchive };
|
|
140
67
|
|
|
141
68
|
//# sourceMappingURL=bundle-archive.js.map
|
|
@@ -9,7 +9,7 @@ import "../rolldown-runtime-ClRpJifh.js";
|
|
|
9
9
|
* the receiver. Used on both the orchestrator-agent and peer channels.
|
|
10
10
|
*/
|
|
11
11
|
/** Raw bytes per chunk before base64 (matches webhook-relay's ~85 KiB frames). */
|
|
12
|
-
const FLEET_CHUNK_BYTES =
|
|
12
|
+
const FLEET_CHUNK_BYTES = 87040;
|
|
13
13
|
/** Split a Buffer into ordered base64 frames. An empty buffer yields one final frame. */
|
|
14
14
|
function chunkBuffer(buf, chunkBytes = FLEET_CHUNK_BYTES) {
|
|
15
15
|
const frames = [];
|
package/dist/env/define-env.d.ts
CHANGED
|
@@ -112,12 +112,13 @@ export declare function defineEnv<TShape extends z.ZodRawShape>(opts: DefineEnvO
|
|
|
112
112
|
* `hack/lib/commit-build-counter.mjs` (skip the per-build `.build-counter`
|
|
113
113
|
* commit on a force-synced checkout, e.g. a remote E2E executor). Set in the
|
|
114
114
|
* ambient shell for `pnpm build`; the native orchestrator spawn inherits it.
|
|
115
|
-
* - `
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
* shape as the `KICI_E2E_`
|
|
115
|
+
* - `KICI_CONFIG_DIR`: the isolated, empty config directory the vitest harness
|
|
116
|
+
* sets at config-eval time (`hack/lib/vitest-isolation.ts`, enforced by
|
|
117
|
+
* `hack/check-vitest-isolation.ts`) so the CLI's `getConfigDir` reads a
|
|
118
|
+
* throwaway dir instead of the developer machine's ambient `~/.kici`. It is a
|
|
119
|
+
* real CLI var (not a config typo) inherited by every service a test spawns —
|
|
120
|
+
* which do not read it — same leak-by-inheritance shape as the `KICI_E2E_`
|
|
121
|
+
* prefix below.
|
|
121
122
|
*
|
|
122
123
|
* Keep this list small and well-justified. Every addition is a typo we can
|
|
123
124
|
* no longer catch, so only list things that are (a) actually set in the
|
package/dist/env/define-env.js
CHANGED
|
@@ -231,12 +231,13 @@ function suggestClosest(name, candidates) {
|
|
|
231
231
|
* `hack/lib/commit-build-counter.mjs` (skip the per-build `.build-counter`
|
|
232
232
|
* commit on a force-synced checkout, e.g. a remote E2E executor). Set in the
|
|
233
233
|
* ambient shell for `pnpm build`; the native orchestrator spawn inherits it.
|
|
234
|
-
* - `
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
* shape as the `KICI_E2E_`
|
|
234
|
+
* - `KICI_CONFIG_DIR`: the isolated, empty config directory the vitest harness
|
|
235
|
+
* sets at config-eval time (`hack/lib/vitest-isolation.ts`, enforced by
|
|
236
|
+
* `hack/check-vitest-isolation.ts`) so the CLI's `getConfigDir` reads a
|
|
237
|
+
* throwaway dir instead of the developer machine's ambient `~/.kici`. It is a
|
|
238
|
+
* real CLI var (not a config typo) inherited by every service a test spawns —
|
|
239
|
+
* which do not read it — same leak-by-inheritance shape as the `KICI_E2E_`
|
|
240
|
+
* prefix below.
|
|
240
241
|
*
|
|
241
242
|
* Keep this list small and well-justified. Every addition is a typo we can
|
|
242
243
|
* no longer catch, so only list things that are (a) actually set in the
|
|
@@ -246,7 +247,7 @@ const RESERVED_NON_SCHEMA_KICI_VARS = [
|
|
|
246
247
|
"KICI_CACHE",
|
|
247
248
|
"KICI_DEV",
|
|
248
249
|
"KICI_BUILD_COUNTER_NO_COMMIT",
|
|
249
|
-
"
|
|
250
|
+
"KICI_CONFIG_DIR"
|
|
250
251
|
];
|
|
251
252
|
/**
|
|
252
253
|
* `KICI_*` prefixes that are entirely outside the service-config namespace —
|
|
@@ -44,8 +44,12 @@ export interface GracefulShutdownOptions {
|
|
|
44
44
|
* trigger shutdown programmatically (e.g., from SIGUSR1 drain handlers).
|
|
45
45
|
*/
|
|
46
46
|
export interface ShutdownHandle {
|
|
47
|
-
/**
|
|
48
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Trigger shutdown with the given reason string. Pass a non-zero `code` for a
|
|
49
|
+
* deliberate-but-failed stop (e.g. a one-shot agent whose self-bootstrap claim
|
|
50
|
+
* was rejected) so the process exits non-zero; omit it for a clean stop.
|
|
51
|
+
*/
|
|
52
|
+
shutdown(signal: string, code?: number): Promise<void>;
|
|
49
53
|
}
|
|
50
54
|
/**
|
|
51
55
|
* Wire up SIGTERM / SIGINT (and optionally uncaughtException /
|
|
@@ -77,7 +77,7 @@ function setupGracefulShutdown(options) {
|
|
|
77
77
|
gracefulShutdown("unhandledRejection", 1);
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
|
-
return { shutdown: (signal) => gracefulShutdown(signal) };
|
|
80
|
+
return { shutdown: (signal, code = 0) => gracefulShutdown(signal, code) };
|
|
81
81
|
}
|
|
82
82
|
//#endregion
|
|
83
83
|
export { setupGracefulShutdown };
|
|
@@ -195,7 +195,8 @@ function renderEnvDiffBody(entry, opts) {
|
|
|
195
195
|
const local = entry.localContent ?? "";
|
|
196
196
|
const remote = entry.category === "new" ? "" : entry.remoteContent ?? "";
|
|
197
197
|
if (local === "" && remote === "" && entry.category !== "new") return [];
|
|
198
|
-
|
|
198
|
+
const diff = diffEnvFiles(local, remote);
|
|
199
|
+
return renderEnvDiff(diff, {
|
|
199
200
|
reveal: opts.revealEnvValues ?? false,
|
|
200
201
|
color: opts.color ?? false
|
|
201
202
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -2,11 +2,11 @@ export * from '@kici-dev/core';
|
|
|
2
2
|
export * from './agent-platform.js';
|
|
3
3
|
export { encrypt, decrypt, deriveKey, generateMasterKey, type EncryptedValue, } from './secret-crypto.js';
|
|
4
4
|
export { RingBuffer } from './ring-buffer.js';
|
|
5
|
-
export {
|
|
5
|
+
export { addLogsToArchive, MAX_LOG_BYTES } from './diagnostics/bundle-archive.js';
|
|
6
6
|
export { chunkBuffer, BundleChunkAssembler, ChunkRequestWaiter, FLEET_CHUNK_BYTES, type BundleChunkFrame, } from './diagnostics/bundle-chunks.js';
|
|
7
7
|
export { createPool, createDb, isPoolAcquireTimeout, type CreatePoolOptions, type PgPoolErrorSource, type PoolAcquireOutcome, } from './db.js';
|
|
8
8
|
export { isPgUniqueViolation } from './pg-errors.js';
|
|
9
|
-
export { parseDatabaseUrl, maskDatabaseUrl, dropAndCreateDatabase,
|
|
9
|
+
export { parseDatabaseUrl, maskDatabaseUrl, dropAndCreateDatabase, ensureDatabase, type EnsureDatabaseOpts, createDbRole, createReadOnlyDbUser, computeMigrationsHash, storeMigrationContentHash, readStoredMigrationContentHash, isSchemaCurrent, clearDispatchQueueDirect, purgeStaleExecutionDirect, purgeStaleSourcesDirect, purgeScopedSecretsDirect, purgeContextsDirect, seedContextDirect, deleteContextDirect, seedContextBindingDirect, setContextPolicyDirect, listContextsDirect, showContextDirect, createContextTemplateDirect, setContextSecretDirect, listQueueDirect, showQueueEntryDirect, listExecutionRunsDirect, showExecutionRunDirect, listCheckRunTrackingDirect, listRegistrationsDirect, showRegistrationDirect, registerWorkflowManualDirect, resetRaftStateDirect, emitKiciEventDirect, purgeSecretBackendsDirect, prunePeerCredentialsDirect, type EventLogRow as PlatformEventLogRow, type OrgSettingsRepoPatternEntry, type EmitKiciEventOpts, REGISTERABLE_TRIGGER_TYPES, MIGRATION_HASH_TABLE, type PurgeStaleExecutionResult, type PurgeStaleSourcesResult, type SeedContextOpts, type SeedContextResult, type SeedContextBindingOpts, type SetContextPolicyOpts, type ContextRow, type ContextVariableRow, type ContextBindingRow, type ShowContextResult, type CreateContextTemplateOpts, type SetContextSecretOpts, type DispatchQueueRow, type ListQueueOpts, type ExecutionRunRow, type ExecutionJobRow, type ListExecutionRunsOpts, type CheckRunTrackingDirectRow, type ListCheckRunTrackingOpts, type WorkflowRegistrationRow, type ListRegistrationsOpts, type ListRegistrationsResult, type ShowRegistrationResult, type RegisterWorkflowManualOpts, type RegisterWorkflowManualResult, } from './db-admin.js';
|
|
10
10
|
export { createMetricsRoutes, type MetricsRoutesDeps } from './routes/metrics.js';
|
|
11
11
|
export { createHealthRoutes, type HealthRoutesDeps } from './routes/health.js';
|
|
12
12
|
export { getReconnectDelay } from './reconnect-delay.js';
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "./rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { AgentDeliveryMode, AgentPlatform, splitAgentPlatform } from "./agent-platform.js";
|
|
3
3
|
import { createDb, createPool, isPoolAcquireTimeout } from "./db.js";
|
|
4
|
-
import {
|
|
4
|
+
import { MIGRATION_HASH_TABLE, REGISTERABLE_TRIGGER_TYPES, clearDispatchQueueDirect, computeMigrationsHash, createContextTemplateDirect, createDbRole, createReadOnlyDbUser, deleteContextDirect, dropAndCreateDatabase, emitKiciEventDirect, ensureDatabase, isSchemaCurrent, listCheckRunTrackingDirect, listContextsDirect, listExecutionRunsDirect, listQueueDirect, listRegistrationsDirect, maskDatabaseUrl, parseDatabaseUrl, prunePeerCredentialsDirect, purgeContextsDirect, purgeScopedSecretsDirect, purgeSecretBackendsDirect, purgeStaleExecutionDirect, purgeStaleSourcesDirect, readStoredMigrationContentHash, registerWorkflowManualDirect, resetRaftStateDirect, seedContextBindingDirect, seedContextDirect, setContextPolicyDirect, setContextSecretDirect, showContextDirect, showExecutionRunDirect, showQueueEntryDirect, showRegistrationDirect, storeMigrationContentHash } from "./db-admin.js";
|
|
5
5
|
import { setupGracefulShutdown } from "./graceful-shutdown.js";
|
|
6
6
|
import { decrypt, deriveKey, encrypt, generateMasterKey } from "./secret-crypto.js";
|
|
7
7
|
import { RingBuffer } from "./ring-buffer.js";
|
|
8
|
-
import { MAX_LOG_BYTES, addLogsToArchive
|
|
8
|
+
import { MAX_LOG_BYTES, addLogsToArchive } from "./diagnostics/bundle-archive.js";
|
|
9
9
|
import { BundleChunkAssembler, ChunkRequestWaiter, FLEET_CHUNK_BYTES, chunkBuffer } from "./diagnostics/bundle-chunks.js";
|
|
10
10
|
import { isPgUniqueViolation } from "./pg-errors.js";
|
|
11
11
|
import { createMetricsRoutes } from "./routes/metrics.js";
|
|
@@ -28,4 +28,4 @@ import { BaseColdStore } from "./cold-store/cold-store.js";
|
|
|
28
28
|
import { ChunkLru } from "./cold-store/lru.js";
|
|
29
29
|
import "./cold-store/index.js";
|
|
30
30
|
export * from "@kici-dev/core";
|
|
31
|
-
export { AgentDeliveryMode, AgentPlatform, BaseColdStore, BundleChunkAssembler,
|
|
31
|
+
export { AgentDeliveryMode, AgentPlatform, BaseColdStore, BundleChunkAssembler, COLD_BUCKET_NAMES, ChunkLru, ChunkRequestWaiter, DEFAULT_TABLE_CONFIG, FLEET_CHUNK_BYTES, MAX_LOG_BYTES, MIGRATION_HASH_TABLE, REGISTERABLE_TRIGGER_TYPES, RingBuffer, addLogsToArchive, chunkBuffer, chunkObjectKey, clearDispatchQueueDirect, coldDaysToBucket, coldStoreArchiveBytesTotal, coldStoreArchiveCyclesTotal, coldStoreArchiveDurationSeconds, coldStoreArchiveRowsTotal, coldStorePurgeBytesTotal, coldStorePurgeChunksTotal, coldStorePurgeDurationSeconds, coldStoreRehydrateBytesTotal, coldStoreRehydrateDurationSeconds, coldStoreRehydrateRequestsTotal, coldStoreReplayDurationSeconds, coldStoreReplayRowsTotal, coldStoreVerifyFailuresTotal, collectRuntimeMetricNames, computeChunkId, computeMigrationsHash, createContextTemplateDirect, createDb, createDbRole, createHealthRoutes, createMeter, createMetricsRoutes, createPool, createReadOnlyDbUser, createS3Client, decodeChunk, decrypt, deleteContextDirect, deriveKey, dropAndCreateDatabase, emitKiciEventDirect, encodeChunk, encodeKeySegment, encrypt, ensureDatabase, generateMasterKey, getPrometheusExporter, getReconnectDelay, initTelemetry, isLongerColdRetention, isPgUniqueViolation, isPoolAcquireTimeout, isSchemaCurrent, kiciMkdtemp, kiciTmpBase, listCheckRunTrackingDirect, listContextsDirect, listExecutionRunsDirect, listQueueDirect, listRegistrationsDirect, maskDatabaseUrl, parseDatabaseUrl, parseManifest, prunePeerCredentialsDirect, purgeContextsDirect, purgeScopedSecretsDirect, purgeSecretBackendsDirect, purgeStaleExecutionDirect, purgeStaleSourcesDirect, readStoredMigrationContentHash, registerWorkflowManualDirect, resetRaftStateDirect, resolveTableConfig, seedContextBindingDirect, seedContextDirect, serializeManifest, setContextPolicyDirect, setContextSecretDirect, setupGracefulShutdown, showContextDirect, showExecutionRunDirect, showQueueEntryDirect, showRegistrationDirect, splitAgentPlatform, storeMigrationContentHash, tablePrefix, tenantDayBucketPrefix, tenantDayPrefix, validateRequiredTools };
|
package/dist/telemetry/init.js
CHANGED
|
@@ -23,10 +23,11 @@ function initTelemetry(config) {
|
|
|
23
23
|
prefix: config.metricPrefix
|
|
24
24
|
});
|
|
25
25
|
_prometheusExporter = prometheusExporter;
|
|
26
|
+
const traceExporter = config.otlpEndpoint ? new OTLPTraceExporter({ url: `${config.otlpEndpoint}/v1/traces` }) : void 0;
|
|
26
27
|
const sdk = new NodeSDK({
|
|
27
28
|
resource,
|
|
28
29
|
metricReader: prometheusExporter,
|
|
29
|
-
traceExporter
|
|
30
|
+
traceExporter,
|
|
30
31
|
instrumentations: [new RuntimeNodeInstrumentation()]
|
|
31
32
|
});
|
|
32
33
|
sdk.start();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kici-dev/shared",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Shared utilities for the KiCI CI/CD stack — logging, zx setup, crypto, telemetry, health and metrics routes. No business logic.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ci",
|
|
@@ -89,10 +89,14 @@
|
|
|
89
89
|
"./package-manager-types": {
|
|
90
90
|
"import": "./dist/package-manager-types.js",
|
|
91
91
|
"types": "./dist/package-manager-types.d.ts"
|
|
92
|
+
},
|
|
93
|
+
"./container-runtime": {
|
|
94
|
+
"import": "./dist/container-runtime.js",
|
|
95
|
+
"types": "./dist/container-runtime.d.ts"
|
|
92
96
|
}
|
|
93
97
|
},
|
|
94
98
|
"dependencies": {
|
|
95
|
-
"@aws-sdk/client-s3": "^3.
|
|
99
|
+
"@aws-sdk/client-s3": "^3.1121.0",
|
|
96
100
|
"@opentelemetry/api": "^1.9.1",
|
|
97
101
|
"@opentelemetry/exporter-metrics-otlp-http": "^0.221.0",
|
|
98
102
|
"@opentelemetry/exporter-prometheus": "^0.221.0",
|
|
@@ -103,22 +107,24 @@
|
|
|
103
107
|
"@opentelemetry/semantic-conventions": "^1.43.0",
|
|
104
108
|
"archiver": "^8.0.0",
|
|
105
109
|
"diff": "^9.0.0",
|
|
106
|
-
"hono": "^4.
|
|
110
|
+
"hono": "^4.13.2",
|
|
107
111
|
"kysely": "^0.29.4",
|
|
108
112
|
"oxc-transform": "0.140.0",
|
|
109
|
-
"pg": "^8.
|
|
113
|
+
"pg": "^8.23.0",
|
|
110
114
|
"picocolors": "^1.1.1",
|
|
111
115
|
"winston": "^3.19.0",
|
|
112
116
|
"winston-daily-rotate-file": "^5.0.0",
|
|
113
117
|
"yaml": "^2.9.0",
|
|
114
118
|
"zod": "^4.4.3",
|
|
115
119
|
"zx": "^8.8.5",
|
|
116
|
-
"@kici-dev/core": "0.
|
|
117
|
-
"@kici-dev/engine": "0.
|
|
120
|
+
"@kici-dev/core": "0.6.0",
|
|
121
|
+
"@kici-dev/engine": "0.6.0"
|
|
118
122
|
},
|
|
119
123
|
"devDependencies": {
|
|
120
124
|
"@opentelemetry/sdk-trace-base": "^2.10.0",
|
|
121
|
-
"@types/archiver": "^8.0.0"
|
|
125
|
+
"@types/archiver": "^8.0.0",
|
|
126
|
+
"@types/dockerode": "^4.0.1",
|
|
127
|
+
"dockerode": "^5.0.1"
|
|
122
128
|
},
|
|
123
129
|
"scripts": {
|
|
124
130
|
"build": "node ../../scripts/build-ts.mjs && tsgo --emitDeclarationOnly",
|