@kici-dev/compiler 0.1.27 → 0.2.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.
Files changed (153) hide show
  1. package/dist/auth/headless-detect.d.ts +14 -5
  2. package/dist/auth/headless-detect.js +50 -9
  3. package/dist/cli.js +120 -11
  4. package/dist/commands/compile.js +28 -4
  5. package/dist/commands/diagnostics.js +14 -2
  6. package/dist/commands/doctor.d.ts +64 -0
  7. package/dist/commands/doctor.js +413 -0
  8. package/dist/commands/endpoints.js +6 -0
  9. package/dist/commands/fixture.js +13 -0
  10. package/dist/commands/hook.js +3 -2
  11. package/dist/commands/index.d.ts +8 -0
  12. package/dist/commands/index.js +5 -1
  13. package/dist/commands/init-host-os.d.ts +34 -0
  14. package/dist/commands/init-host-os.js +44 -0
  15. package/dist/commands/init.d.ts +4 -0
  16. package/dist/commands/init.js +159 -36
  17. package/dist/commands/local.d.ts +28 -2
  18. package/dist/commands/local.js +74 -5
  19. package/dist/commands/login.js +1 -1
  20. package/dist/commands/notifications.d.ts +61 -0
  21. package/dist/commands/notifications.js +274 -0
  22. package/dist/commands/preview.js +8 -1
  23. package/dist/commands/run-routed.js +10 -1
  24. package/dist/commands/run.js +41 -12
  25. package/dist/commands/runs/artifacts/download.d.ts +24 -0
  26. package/dist/commands/runs/artifacts/download.js +154 -0
  27. package/dist/commands/runs/artifacts/list.d.ts +5 -0
  28. package/dist/commands/runs/artifacts/list.js +47 -0
  29. package/dist/commands/runs/cancel.js +2 -2
  30. package/dist/commands/runs/list.js +8 -2
  31. package/dist/commands/verify-attestation.d.ts +3 -1
  32. package/dist/commands/verify-attestation.js +18 -7
  33. package/dist/errors/formatter.d.ts +14 -1
  34. package/dist/errors/formatter.js +13 -3
  35. package/dist/errors/index.d.ts +2 -1
  36. package/dist/errors/index.js +3 -2
  37. package/dist/errors/source-location.d.ts +20 -0
  38. package/dist/errors/source-location.js +45 -0
  39. package/dist/execution/executor.js +25 -5
  40. package/dist/fixtures/defaults/index.js +2 -1
  41. package/dist/llm-context/llms-architecture.txt +48 -19
  42. package/dist/llm-context/llms-cli.txt +2461 -1582
  43. package/dist/llm-context/llms-features.txt +178 -106
  44. package/dist/llm-context/llms-full.txt +6124 -4423
  45. package/dist/llm-context/llms-getting-started.txt +306 -42
  46. package/dist/llm-context/llms-patterns.txt +13 -7
  47. package/dist/llm-context/llms-sdk-runtime.txt +2013 -0
  48. package/dist/llm-context/llms-sdk.txt +591 -2152
  49. package/dist/llm-context/llms.txt +30 -16
  50. package/dist/local-plane/orchestrator-process.d.ts +12 -7
  51. package/dist/local-plane/orchestrator-process.js +28 -14
  52. package/dist/local-plane/os-mismatch-hint.d.ts +16 -0
  53. package/dist/local-plane/os-mismatch-hint.js +34 -0
  54. package/dist/local-plane/plane-liveness.d.ts +68 -0
  55. package/dist/local-plane/plane-liveness.js +145 -0
  56. package/dist/local-plane/plane-manager.d.ts +60 -18
  57. package/dist/local-plane/plane-manager.js +210 -70
  58. package/dist/local-plane/plane-trigger.d.ts +13 -4
  59. package/dist/local-plane/plane-trigger.js +27 -14
  60. package/dist/local-plane/platform-attach.js +1 -5
  61. package/dist/local-plane/port-holder.d.ts +78 -0
  62. package/dist/local-plane/port-holder.js +227 -0
  63. package/dist/local-plane/postgres.d.ts +15 -3
  64. package/dist/local-plane/postgres.js +34 -12
  65. package/dist/local-plane/run-follow.d.ts +20 -0
  66. package/dist/local-plane/run-follow.js +51 -4
  67. package/dist/local-plane/scaler-config.d.ts +28 -14
  68. package/dist/local-plane/scaler-config.js +59 -41
  69. package/dist/local-plane/source-provider.js +4 -10
  70. package/dist/lockfile/generator.d.ts +14 -1
  71. package/dist/lockfile/generator.js +99 -33
  72. package/dist/lockfile/index.d.ts +3 -1
  73. package/dist/lockfile/index.js +3 -2
  74. package/dist/lockfile/purity-diagnostics.d.ts +31 -0
  75. package/dist/lockfile/purity-diagnostics.js +52 -0
  76. package/dist/postinstall.js +2 -1
  77. package/dist/remote/artifact-extract.d.ts +8 -0
  78. package/dist/remote/artifact-extract.js +58 -0
  79. package/dist/remote/config.d.ts +21 -3
  80. package/dist/remote/config.js +24 -5
  81. package/dist/remote/dashboard-client.d.ts +39 -2
  82. package/dist/remote/dashboard-client.js +47 -4
  83. package/dist/remote/fs-case.d.ts +21 -0
  84. package/dist/remote/fs-case.js +45 -0
  85. package/dist/remote/history.d.ts +9 -3
  86. package/dist/remote/history.js +79 -10
  87. package/dist/remote/local-repo-identity.d.ts +1 -1
  88. package/dist/remote/local-repo-identity.js +2 -1
  89. package/dist/remote/notifications-client.d.ts +149 -0
  90. package/dist/remote/notifications-client.js +103 -0
  91. package/dist/remote/oauth.d.ts +13 -0
  92. package/dist/remote/oauth.js +31 -5
  93. package/dist/remote/output/summary.js +76 -14
  94. package/dist/remote/render.js +30 -9
  95. package/dist/remote/uploader.js +5 -4
  96. package/dist/templates/agents-md.d.ts +1 -1
  97. package/dist/templates/agents-md.js +6 -6
  98. package/dist/templates/index.d.ts +1 -1
  99. package/dist/templates/index.js +2 -2
  100. package/dist/templates/package-json.d.ts +15 -0
  101. package/dist/templates/package-json.js +26 -5
  102. package/dist/test-runner/dry-run.d.ts +2 -1
  103. package/dist/test-runner/dry-run.js +18 -1
  104. package/dist/test-runner/event-types.d.ts +2 -0
  105. package/dist/test-runner/event-types.js +3 -0
  106. package/dist/test-runner/job-executor.d.ts +1 -0
  107. package/dist/test-runner/job-executor.js +81 -43
  108. package/dist/test-runner/output-formatter.d.ts +5 -2
  109. package/dist/test-runner/output-formatter.js +6 -4
  110. package/dist/test-runner/payload-builder.d.ts +7 -1
  111. package/dist/test-runner/payload-builder.js +11 -2
  112. package/dist/test-runner/rule-evaluator.d.ts +7 -3
  113. package/dist/test-runner/rule-evaluator.js +13 -12
  114. package/dist/test-runner/step-context.d.ts +23 -5
  115. package/dist/test-runner/step-context.js +28 -118
  116. package/dist/types.d.ts +21 -2
  117. package/dist/types.js +4 -2
  118. package/dist/validation/index.d.ts +2 -0
  119. package/dist/validation/index.js +2 -1
  120. package/dist/validation/typecheck.d.ts +28 -0
  121. package/dist/validation/typecheck.js +110 -0
  122. package/dist/validation/validator.d.ts +9 -4
  123. package/dist/validation/validator.js +38 -44
  124. package/package.json +12 -15
  125. package/sbom.spdx.json +1322 -1964
  126. package/dist/assets/api-TJJVHrjC.json +0 -118
  127. package/dist/assets/descriptor-BTtjzN9L.json +0 -1382
  128. package/dist/assets/package-BpQF9kR8.json +0 -74
  129. package/dist/assets/package-Ceo2h27X.json +0 -89
  130. package/dist/assets/source_context-D0atuL28.json +0 -20
  131. package/dist/assets/type-BFqO8SCZ.json +0 -202
  132. package/dist/commands/cancel.d.ts +0 -22
  133. package/dist/commands/detect-package-manager.d.ts +0 -42
  134. package/dist/commands/held-run-resolve.d.ts +0 -50
  135. package/dist/commands/status.d.ts +0 -34
  136. package/dist/commands/test.d.ts +0 -88
  137. package/dist/errors/codes.d.ts +0 -25
  138. package/dist/local-executor/dag-scheduler.d.ts +0 -44
  139. package/dist/local-executor/index.d.ts +0 -23
  140. package/dist/local-executor/job-runner.d.ts +0 -47
  141. package/dist/local-executor/materializer.d.ts +0 -44
  142. package/dist/local-executor/output-streamer.d.ts +0 -31
  143. package/dist/local-executor/payload-generator.d.ts +0 -16
  144. package/dist/local-executor/picker.d.ts +0 -33
  145. package/dist/local-executor/runs-on-display.d.ts +0 -9
  146. package/dist/local-executor/secret-loader.d.ts +0 -18
  147. package/dist/local-executor/to-event-payload.d.ts +0 -16
  148. package/dist/local-executor/types.d.ts +0 -93
  149. package/dist/local-executor/workflow-lock.d.ts +0 -82
  150. package/dist/package-F7UXSDHW.json +0 -74
  151. package/dist/remote/client.d.ts +0 -210
  152. package/dist/remote/observer.d.ts +0 -81
  153. package/dist/test-runner/summary.d.ts +0 -7
@@ -1,210 +0,0 @@
1
- /**
2
- * REST client for communicating with the KiCI orchestrator.
3
- *
4
- * Provides typed methods for triggering test runs, cancelling runs,
5
- * managing uploads, and checking run status.
6
- */
7
- export declare class AuthenticationError extends Error {
8
- constructor(message?: string);
9
- }
10
- export declare class NotFoundError extends Error {
11
- constructor(message?: string);
12
- }
13
- export declare class ServerError extends Error {
14
- statusCode?: number | undefined;
15
- constructor(message?: string, statusCode?: number | undefined);
16
- }
17
- export declare class ConnectionError extends Error {
18
- endpoint?: string | undefined;
19
- constructor(message: string, endpoint?: string | undefined);
20
- }
21
- export interface TestTriggerInput {
22
- fixtureId: string;
23
- event: {
24
- type: string;
25
- action?: string;
26
- targetBranch: string;
27
- sourceBranch?: string;
28
- payload: Record<string, unknown>;
29
- changedFiles?: string[];
30
- };
31
- routingKey: string;
32
- uploadId?: string;
33
- /** CLI's ephemeral public key (base64, SPKI/DER) for overlay decryption */
34
- cliPublicKey?: string;
35
- secrets?: Record<string, string>;
36
- /** Base64 X25519+AES-GCM blob of the developer's local secrets ({flat, contexts}). */
37
- encryptedSecrets?: string;
38
- /** Base64 ephemeral CLI public key that encrypted `encryptedSecrets`. */
39
- encryptedSecretsKey?: string;
40
- workflowName?: string;
41
- /** JSON-stringified lock file content for repos with no remote. */
42
- inlineLockFile?: string;
43
- /** When true, repo has no remote -- agent uses overlay tarball as full workspace. */
44
- fullRepo?: boolean;
45
- }
46
- export interface TestTriggerResponse {
47
- runId: string;
48
- observeUrl: string;
49
- status: 'accepted' | 'rejected';
50
- reason?: string;
51
- jobIds?: string[];
52
- }
53
- export interface TestCancelResponse {
54
- status: 'cancelled' | 'not_found' | 'already_complete';
55
- cancelledJobs?: number;
56
- }
57
- interface UploadInitInput {
58
- routingKey: string;
59
- sha?: string;
60
- fileCount?: number;
61
- compressedSize?: number;
62
- }
63
- interface UploadInitResponse {
64
- uploadId: string;
65
- signedUrl: string;
66
- publicKey: string;
67
- expiresIn: number;
68
- }
69
- interface UploadStatusResponse {
70
- uploadId: string;
71
- status: string;
72
- routingKey?: string;
73
- sha?: string | null;
74
- fileCount?: number | null;
75
- compressedSize?: number | null;
76
- }
77
- export interface RunStatusResponse {
78
- runId: string;
79
- status: string;
80
- failureReason?: string;
81
- summary?: {
82
- totalDurationMs: number;
83
- jobs: Array<{
84
- name: string;
85
- status: string;
86
- durationMs?: number;
87
- errorMessage?: string;
88
- }>;
89
- };
90
- }
91
- export interface RunLogsResponse {
92
- runId: string;
93
- status: string;
94
- /** Present when the run is still active — connect via WebSocket for live streaming. */
95
- observeUrl?: string;
96
- /** Present when the run is terminal — historical log entries. */
97
- logs?: Array<{
98
- jobName: string;
99
- stepIndex: number;
100
- stepName: string;
101
- lines: string[];
102
- }>;
103
- }
104
- export interface RegistrationItem {
105
- id: string;
106
- repoIdentifier: string;
107
- workflowName: string;
108
- triggerTypes: string[];
109
- triggers: unknown[];
110
- lastTriggeredAt: string | null;
111
- nextFireAt: string | null;
112
- sourceRepos: string[];
113
- createdAt: string;
114
- updatedAt: string;
115
- }
116
- interface RegistrationsListResponse {
117
- registrations: RegistrationItem[];
118
- registryVersion: number;
119
- registryUpdatedAt: string;
120
- }
121
- interface OrchestratorClientConfig {
122
- endpoint: string;
123
- token: string;
124
- }
125
- /**
126
- * Orchestrator capability manifest returned by `GET /api/v1/capabilities`.
127
- *
128
- * All fields are optional because the endpoint may not exist on older
129
- * orchestrators. Callers treat missing fields as "unknown" and format an
130
- * error that says so rather than failing hard.
131
- */
132
- export interface OrchestratorCapabilities {
133
- orchestratorVersion?: string;
134
- protocolVersion?: number;
135
- minProtocolVersion?: number;
136
- }
137
- /**
138
- * REST client for the KiCI orchestrator API.
139
- *
140
- * Handles authentication, request formatting, and typed response parsing
141
- * for all test-trigger and upload operations.
142
- */
143
- export declare class OrchestratorClient {
144
- private readonly baseUrl;
145
- private readonly token;
146
- private cachedCapabilities?;
147
- constructor(config: OrchestratorClientConfig);
148
- /**
149
- * Fetch the orchestrator's capability manifest.
150
- *
151
- * Never throws — on any failure (old orchestrator returning 404, network
152
- * error, malformed JSON) it returns an empty manifest. Callers use the
153
- * returned fields to format actionable capability-gap errors and treat
154
- * missing fields as "unknown".
155
- *
156
- * Memoised per client instance so repeated calls in a single CLI session
157
- * hit the orchestrator once.
158
- */
159
- getCapabilities(): Promise<OrchestratorCapabilities>;
160
- private fetchCapabilities;
161
- /**
162
- * Trigger a test run on the orchestrator.
163
- *
164
- * POST /api/v1/test/trigger
165
- */
166
- triggerTest(input: TestTriggerInput): Promise<TestTriggerResponse>;
167
- /**
168
- * Cancel a running test run.
169
- *
170
- * POST /api/v1/test/cancel
171
- */
172
- cancelTest(runId: string): Promise<TestCancelResponse>;
173
- /**
174
- * Initialize an upload and get a pre-signed URL.
175
- *
176
- * POST /api/v1/uploads/init
177
- */
178
- initUpload(opts: UploadInitInput): Promise<UploadInitResponse>;
179
- /**
180
- * Get the status of an upload.
181
- *
182
- * GET /api/v1/uploads/:uploadId/status
183
- */
184
- getUploadStatus(uploadId: string): Promise<UploadStatusResponse>;
185
- /**
186
- * List workflow registrations for an organization.
187
- *
188
- * GET /api/v1/orgs/:orgId/registrations
189
- */
190
- getRegistrations(orgId: string, filters?: Record<string, string>): Promise<RegistrationsListResponse>;
191
- /**
192
- * Get the status of a test run (polling fallback).
193
- *
194
- * GET /api/v1/test/runs/:runId
195
- */
196
- getRunStatus(runId: string): Promise<RunStatusResponse>;
197
- /**
198
- * Get logs for a test run.
199
- *
200
- * GET /api/v1/test/runs/:runId/logs
201
- */
202
- getRunLogs(runId: string, jobFilter?: string): Promise<RunLogsResponse>;
203
- /**
204
- * Make an authenticated request to the orchestrator.
205
- * Handles error classification and connection errors.
206
- */
207
- private request;
208
- }
209
- export {};
210
- //# sourceMappingURL=client.d.ts.map
@@ -1,81 +0,0 @@
1
- /**
2
- * WebSocket observer client for real-time run streaming.
3
- *
4
- * Connects to the orchestrator's observer WS endpoint, subscribes to a
5
- * specific run, and relays real-time events (logs, step changes, status
6
- * updates, completion) to registered callbacks.
7
- *
8
- * Features:
9
- * - Auto-reconnect with lastSeenSequence for backfill (up to 5 attempts)
10
- * - Promise-based waitForCompletion()
11
- * - Clean disconnect
12
- */
13
- import type { ObserveLog, ObserveStep, ObserveStatus, ObserveComplete } from '@kici-dev/engine';
14
- /** Configuration for ObserverClient. */
15
- interface ObserverClientConfig {
16
- /** WebSocket URL for the observer endpoint. */
17
- observeUrl: string;
18
- /** Authentication token. */
19
- token: string;
20
- /** Run ID to observe. */
21
- runId: string;
22
- /** Callback for log messages. */
23
- onLog: (msg: ObserveLog & {
24
- sequence: number;
25
- }) => void;
26
- /** Callback for step lifecycle changes. */
27
- onStep: (msg: ObserveStep & {
28
- sequence: number;
29
- }) => void;
30
- /** Callback for status changes. */
31
- onStatus: (msg: ObserveStatus & {
32
- sequence: number;
33
- }) => void;
34
- /** Callback for run completion. */
35
- onComplete: (msg: ObserveComplete & {
36
- sequence: number;
37
- }) => void;
38
- /** Callback for errors (WS errors or auth failures). */
39
- onError: (err: Error) => void;
40
- /** Maximum reconnection attempts. Default: 5. */
41
- maxReconnectAttempts?: number;
42
- /** Reconnection delay in ms. Default: 1000. */
43
- reconnectDelayMs?: number;
44
- }
45
- export declare class ObserverClient {
46
- private ws;
47
- private lastSeenSequence;
48
- private reconnectAttempts;
49
- private intentionalDisconnect;
50
- private initialConnectCompleted;
51
- private reconnectTimer;
52
- private completionResolve;
53
- private completionReject;
54
- private completionResult;
55
- private readonly config;
56
- constructor(config: ObserverClientConfig);
57
- /**
58
- * Connect to the observer endpoint and send the subscribe message.
59
- * Resolves when the WS connection is open and subscribe is sent.
60
- */
61
- connect(): Promise<void>;
62
- /**
63
- * Returns a promise that resolves when the run completes.
64
- * If the run already completed (from a prior observe.complete),
65
- * resolves immediately.
66
- */
67
- waitForCompletion(): Promise<ObserveComplete & {
68
- sequence: number;
69
- }>;
70
- /**
71
- * Gracefully disconnect from the observer endpoint.
72
- */
73
- disconnect(): void;
74
- /** Current lastSeenSequence (for testing). */
75
- getLastSeenSequence(): number;
76
- private doConnect;
77
- private handleMessage;
78
- private scheduleReconnect;
79
- }
80
- export {};
81
- //# sourceMappingURL=observer.d.ts.map
@@ -1,7 +0,0 @@
1
- import type { WorkflowResult } from './job-executor.js';
2
- import type { WorkflowDecision } from '@kici-dev/engine';
3
- /**
4
- * Display final execution summary.
5
- */
6
- export declare function displaySummary(results: WorkflowResult[], decisions: WorkflowDecision[]): void;
7
- //# sourceMappingURL=summary.d.ts.map