@kici-dev/compiler 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/cli.js +37 -7
- package/dist/commands/approve.d.ts +12 -0
- package/dist/commands/approve.js +5 -2
- package/dist/commands/compile.js +5 -15
- package/dist/commands/doctor.js +2 -2
- package/dist/commands/endpoints.js +4 -6
- package/dist/commands/held-run-client.d.ts +21 -1
- package/dist/commands/held-run-client.js +34 -15
- package/dist/commands/hook.js +22 -20
- package/dist/commands/index.d.ts +2 -0
- package/dist/commands/index.js +2 -1
- package/dist/commands/init.d.ts +9 -2
- package/dist/commands/init.js +43 -16
- package/dist/commands/login.js +1 -1
- package/dist/commands/orchestrators.js +3 -2
- package/dist/commands/preview.js +1 -8
- package/dist/commands/reject.d.ts +12 -0
- package/dist/commands/reject.js +5 -2
- package/dist/commands/report/collect.d.ts +82 -0
- package/dist/commands/report/collect.js +234 -0
- package/dist/commands/report/identity.d.ts +48 -0
- package/dist/commands/report/identity.js +49 -0
- package/dist/commands/report/index.d.ts +63 -0
- package/dist/commands/report/index.js +119 -0
- package/dist/commands/report/upload.d.ts +38 -0
- package/dist/commands/report/upload.js +64 -0
- package/dist/commands/run-hold-watch.js +2 -2
- package/dist/commands/run.js +6 -3
- package/dist/commands/runs/show.js +80 -1
- package/dist/commands/types.js +51 -9
- package/dist/errors/formatter.d.ts +2 -4
- package/dist/errors/formatter.js +1 -3
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +2 -2
- package/dist/execution/sdk-alias.js +4 -2
- package/dist/fixtures/compiler.js +2 -1
- package/dist/format.js +3 -3
- package/dist/generators/secrets-dts.d.ts +8 -3
- package/dist/generators/secrets-dts.js +3 -3
- package/dist/hooks/installer.js +2 -1
- package/dist/llm-context/llms-architecture.txt +59 -23
- package/dist/llm-context/llms-cli.txt +168 -34
- package/dist/llm-context/llms-features-execution.txt +2017 -0
- package/dist/llm-context/llms-features.txt +96 -1100
- package/dist/llm-context/llms-full.txt +3131 -1407
- package/dist/llm-context/llms-getting-started.txt +164 -31
- package/dist/llm-context/llms-patterns.txt +186 -7
- package/dist/llm-context/llms-providers.txt +15 -33
- package/dist/llm-context/llms-sdk-runtime.txt +62 -40
- package/dist/llm-context/llms-sdk.txt +284 -58
- package/dist/llm-context/llms.txt +23 -15
- package/dist/local-plane/paths.d.ts +15 -0
- package/dist/local-plane/paths.js +22 -1
- package/dist/local-plane/plane-manager.js +2 -2
- package/dist/local-plane/port-holder.js +1 -1
- package/dist/local-plane/postgres.d.ts +3 -16
- package/dist/local-plane/postgres.js +10 -15
- package/dist/lockfile/generator.d.ts +12 -0
- package/dist/lockfile/generator.js +182 -54
- package/dist/lockfile/index.d.ts +0 -2
- package/dist/lockfile/index.js +1 -2
- package/dist/postinstall.js +2 -1
- package/dist/remote/config.d.ts +2 -15
- package/dist/remote/config.js +2 -16
- package/dist/remote/dashboard-client.d.ts +39 -0
- package/dist/remote/dashboard-client.js +41 -0
- package/dist/remote/oauth.js +7 -5
- package/dist/remote/uploader.js +2 -2
- package/dist/templates/package-json.js +1 -1
- package/dist/test-runner/dry-run.d.ts +1 -2
- package/dist/test-runner/dry-run.js +5 -20
- package/dist/test-runner/git-detector.js +2 -1
- package/dist/test-runner/job-executor.js +2 -1
- package/dist/test-runner/payload-builder.js +11 -17
- package/dist/types.d.ts +64 -10
- package/dist/types.js +7 -1
- package/dist/validation/validator.js +63 -6
- package/package.json +16 -11
- package/sbom.spdx.json +957 -900
- package/dist/lockfile/purity-analyzer.d.ts +0 -25
- package/dist/lockfile/purity-analyzer.js +0 -204
- package/dist/lockfile/purity-diagnostics.d.ts +0 -31
- package/dist/lockfile/purity-diagnostics.js +0 -52
|
@@ -109,7 +109,7 @@ An orchestrator enforces a few limits, each surfaced as a clear step error when
|
|
|
109
109
|
- A **per-org storage quota** (20 GiB by default) across all non-expired artifacts.
|
|
110
110
|
- An **expiry** (30 days by default) after which an artifact is no longer downloadable or listed.
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
Each of the four is a cluster-wide default an operator can raise or lower per organization; see the [orchestrator storage layout](https://docs.kici.dev/operator/orchestrator/storage-layout/#artifacts) for the operator-facing knobs.
|
|
113
113
|
|
|
114
114
|
When an upload or download fails for a reason that is **not** one of these limits — the orchestrator has no artifact storage configured, or it could not service the request — the step error says exactly that, instead of reporting a quota rejection or a missing artifact. So an error that names a limit really is a limit you can act on, and an error that names an orchestrator problem is one to take to whoever runs it.
|
|
115
115
|
|
|
@@ -266,7 +266,7 @@ Source: https://docs.kici.dev/user/sdk/event-payloads/
|
|
|
266
266
|
|
|
267
267
|
## The envelope
|
|
268
268
|
|
|
269
|
-
The normalized event envelope is the single event contract in KiCI. Rules receive it as `ctx.event`, and every dynamic function — `
|
|
269
|
+
The normalized event envelope is the single event contract in KiCI. Rules receive it as `ctx.event`, and every dynamic function — `context:`, `env:`, and `concurrencyGroup:` resolvers, generated jobs, and a workflow's `concurrency.group` — receives the same envelope as its argument.
|
|
270
270
|
|
|
271
271
|
Narrow on the `type` field to branch per trigger kind (`if (event.type === 'push')`). The raw provider webhook body is nested at `payload`; the typed variants below describe its shape per event type.
|
|
272
272
|
|
|
@@ -712,7 +712,7 @@ export const setup = job('setup', {
|
|
|
712
712
|
|
|
713
713
|
## `checkStep(name, options)`
|
|
714
714
|
|
|
715
|
-
The check-mode-aware sibling of `idempotentStep()`. It takes
|
|
715
|
+
The check-mode-aware sibling of `idempotentStep()`. It takes a closely related option shape, but behaves differently when a run is started in check mode (`kici run --check`):
|
|
716
716
|
|
|
717
717
|
| Factory | Behavior under `kici run --check` |
|
|
718
718
|
| ---------------- | ----------------------------------------- |
|
|
@@ -730,10 +730,16 @@ Use `checkStep()` for deploy-style steps where you want a dry-run preview of pen
|
|
|
730
730
|
| `apply` | `(ctx, drift: TDrift) => Promise<TApplied>` | Yes | Brings the system to the desired state. Runs only in apply mode (skipped under `kici run --check`). |
|
|
731
731
|
| `summarize` | `(drift: TDrift) => string` | Yes | Human-readable summary of what `apply()` would do; shown in check-mode drift output. |
|
|
732
732
|
| `whenInSync` | `(ctx) => Promise<TInSync>` | No | Runs when `check()` returned `null` (already in sync). |
|
|
733
|
+
| `outputs` | `OutputSchema` | No | Zod schema validating the step's outputs at runtime. |
|
|
733
734
|
| `continueOnError` | `boolean` | No | When true, the job proceeds even if this step fails. |
|
|
734
735
|
| `timeout` | `number` | No | Step-level timeout in milliseconds. |
|
|
736
|
+
| `retry` | `number \| RetryConfig` | No | Retry policy for the step; `retry: N` is shorthand for `{ maxAttempts: N }`. |
|
|
737
|
+
| `cache` | `CacheInput` | No | Declarative cache restored before the step and saved after it succeeds. |
|
|
738
|
+
| `rules` | `Rule[]` | No | Step-level conditional rules, evaluated agent-side. |
|
|
735
739
|
|
|
736
|
-
|
|
740
|
+
Everything from `outputs` down is a plain [`step()` option](https://docs.kici.dev/user/sdk/core/) forwarded to the underlying step. The three step options `checkStep` does **not** accept are `onCancel`, `cleanup`, and `approval`.
|
|
741
|
+
|
|
742
|
+
There are two signature differences from `idempotentStep`. First, `apply` and `whenInSync` receive `ctx` as their first argument, so the apply logic has access to `ctx.$`, `ctx.log`, and `ctx.secrets`. Second, `summarize` is **required** here, because it is what check mode prints; `idempotentStep` defaults it to a JSON dump of the drift. `idempotentStep` also takes none of the step-option passthroughs above.
|
|
737
743
|
|
|
738
744
|
### Result
|
|
739
745
|
|
|
@@ -841,6 +847,21 @@ const patch = job('patch', {
|
|
|
841
847
|
});
|
|
842
848
|
```
|
|
843
849
|
|
|
850
|
+
### Which hosts are targets
|
|
851
|
+
|
|
852
|
+
`runsOnAll` targets the hosts you declare as members of your fleet. A host becomes
|
|
853
|
+
a target when it registers with the orchestrator under a stable agent identity, or
|
|
854
|
+
when an operator declares it with `kici-admin host declare`.
|
|
855
|
+
|
|
856
|
+
Agents that an auto-scaler starts are **not** targets, even when their labels match
|
|
857
|
+
the predicate. An auto-scaler starts an agent at the fixed shape of its pool, so a
|
|
858
|
+
pinned child would run at that shape and not at its own. Auto-scaler agents stay
|
|
859
|
+
available to `runsOn` and to the queue, and `ctx.kici.inventory` continues to list
|
|
860
|
+
them.
|
|
861
|
+
|
|
862
|
+
The fleet preview and the host detail page in the web UI apply the same rule, so
|
|
863
|
+
they show the hosts a run targets.
|
|
864
|
+
|
|
844
865
|
### Input forms
|
|
845
866
|
|
|
846
867
|
`runsOnAll` accepts three shapes:
|
|
@@ -1130,7 +1151,7 @@ When `--target` narrows a `runsOnAll` job to zero hosts, the run **fails** by de
|
|
|
1130
1151
|
(a mistyped selector should be loud, not silently no-op). Pass `--target-allow-empty`
|
|
1131
1152
|
to **skip** the zeroed job instead — it records a `skipped` status, and downstream jobs
|
|
1132
1153
|
gated with `when: 'on-skip'` (or `when: 'always'`) still run, exactly as for an
|
|
1133
|
-
`onUnreachable: 'skip'` zero-host fan-out. See the [CLI reference](https://docs.kici.dev/user/cli-
|
|
1154
|
+
`onUnreachable: 'skip'` zero-host fan-out. See the [CLI reference](https://docs.kici.dev/user/cli/runs-and-approvals/#host-narrowing-with---target)
|
|
1134
1155
|
for the full flag behavior and the [`needs` gating model](https://docs.kici.dev/user/sdk/core/#job-dependencies-needs)
|
|
1135
1156
|
for how a skipped upstream propagates.
|
|
1136
1157
|
|
|
@@ -1174,41 +1195,42 @@ All types are exported from `@kici-dev/sdk` as type-only imports.
|
|
|
1174
1195
|
|
|
1175
1196
|
### Trigger types
|
|
1176
1197
|
|
|
1177
|
-
| Type
|
|
1178
|
-
|
|
|
1179
|
-
| `Trigger`
|
|
1180
|
-
| `TriggerConfig`
|
|
1181
|
-
| `PrTriggerConfig`
|
|
1182
|
-
| `PushTriggerConfig`
|
|
1183
|
-
| `TagTriggerConfig`
|
|
1184
|
-
| `CommentTriggerConfig`
|
|
1185
|
-
| `ReviewTriggerConfig`
|
|
1186
|
-
| `ReviewCommentTriggerConfig`
|
|
1187
|
-
| `ReleaseTriggerConfig`
|
|
1188
|
-
| `DispatchTriggerConfig`
|
|
1189
|
-
| `CreateTriggerConfig`
|
|
1190
|
-
| `DeleteTriggerConfig`
|
|
1191
|
-
| `StatusTriggerConfig`
|
|
1192
|
-
| `WorkflowRunTriggerConfig`
|
|
1193
|
-
| `ForkTriggerConfig`
|
|
1194
|
-
| `StarTriggerConfig`
|
|
1195
|
-
| `WatchTriggerConfig`
|
|
1196
|
-
| `WebhookTriggerConfig`
|
|
1197
|
-
| `KiciEventTriggerConfig`
|
|
1198
|
-
| `WorkflowCompleteTriggerConfig`
|
|
1199
|
-
| `
|
|
1200
|
-
| `
|
|
1201
|
-
| `
|
|
1202
|
-
| `
|
|
1203
|
-
| `
|
|
1204
|
-
| `
|
|
1205
|
-
| `
|
|
1206
|
-
| `
|
|
1207
|
-
| `
|
|
1208
|
-
| `
|
|
1209
|
-
| `
|
|
1210
|
-
| `
|
|
1211
|
-
| `
|
|
1198
|
+
| Type | Description |
|
|
1199
|
+
| ----------------------------------- | ------------------------------------------------------------------------------ |
|
|
1200
|
+
| `Trigger` | Trigger definition (trigger config + source location) |
|
|
1201
|
+
| `TriggerConfig` | Union of all 23 trigger config types |
|
|
1202
|
+
| `PrTriggerConfig` | PR trigger configuration (from `pr()`) |
|
|
1203
|
+
| `PushTriggerConfig` | Push trigger configuration (from `push()`) |
|
|
1204
|
+
| `TagTriggerConfig` | Tag trigger configuration (from `tag()`) |
|
|
1205
|
+
| `CommentTriggerConfig` | Comment trigger configuration (from `comment()`) |
|
|
1206
|
+
| `ReviewTriggerConfig` | Review trigger configuration (from `review()`) |
|
|
1207
|
+
| `ReviewCommentTriggerConfig` | Review comment trigger configuration (from `reviewComment()`) |
|
|
1208
|
+
| `ReleaseTriggerConfig` | Release trigger configuration (from `release()`) |
|
|
1209
|
+
| `DispatchTriggerConfig` | Repository dispatch trigger configuration (from `dispatch()`) |
|
|
1210
|
+
| `CreateTriggerConfig` | Ref creation trigger configuration (from `create()`) |
|
|
1211
|
+
| `DeleteTriggerConfig` | Ref deletion trigger configuration (from `delete()`) |
|
|
1212
|
+
| `StatusTriggerConfig` | Commit status trigger configuration (from `status()`) |
|
|
1213
|
+
| `WorkflowRunTriggerConfig` | Workflow run trigger configuration (from `workflowRun()`) |
|
|
1214
|
+
| `ForkTriggerConfig` | Fork trigger configuration (from `fork()`) |
|
|
1215
|
+
| `StarTriggerConfig` | Star trigger configuration (from `star()`) |
|
|
1216
|
+
| `WatchTriggerConfig` | Watch trigger configuration (from `watch()`) |
|
|
1217
|
+
| `WebhookTriggerConfig` | Catch-all webhook trigger configuration (from `webhook()`) |
|
|
1218
|
+
| `KiciEventTriggerConfig` | Custom event trigger configuration (from `kiciEvent()`) |
|
|
1219
|
+
| `WorkflowCompleteTriggerConfig` | Workflow completion trigger configuration (from `workflowComplete()`) |
|
|
1220
|
+
| `WorkflowsFailedBatchTriggerConfig` | Batched workflow-failure trigger configuration (from `workflowsFailedBatch()`) |
|
|
1221
|
+
| `JobCompleteTriggerConfig` | Job completion trigger configuration (from `jobComplete()`) |
|
|
1222
|
+
| `GenericWebhookTriggerConfig` | Generic webhook trigger configuration (from `genericWebhook()`) |
|
|
1223
|
+
| `ScheduleTriggerConfig` | Schedule trigger configuration (from `schedule()`) |
|
|
1224
|
+
| `LifecycleTriggerConfig` | Lifecycle trigger configuration (from `lifecycle()`) |
|
|
1225
|
+
| `PrConfigInput` | Config object for `pr()` factory |
|
|
1226
|
+
| `PushConfigInput` | Config object for `push()` factory |
|
|
1227
|
+
| `BranchPattern` | `{ type: 'glob', pattern } \| { type: 'regex', pattern, flags? }` |
|
|
1228
|
+
| `PrEvent` | PR event string literal union (17 event types) |
|
|
1229
|
+
| `GenericWebhookConfigInput` | Config object for `genericWebhook()` factory |
|
|
1230
|
+
| `GenericWebhookAuth` | Union of generic webhook auth types (HMAC or API key) |
|
|
1231
|
+
| `GenericWebhookHmacAuth` | HMAC-SHA256 auth configuration for generic webhooks |
|
|
1232
|
+
| `GenericWebhookApiKeyAuth` | API key auth configuration for generic webhooks |
|
|
1233
|
+
| `GenericWebhookAuthMethod` | Auth method string literal (`'hmac-sha256' \| 'api-key'`) |
|
|
1212
1234
|
|
|
1213
1235
|
### Rule types
|
|
1214
1236
|
|