@kici-dev/compiler 0.1.16 → 0.1.18

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 (138) hide show
  1. package/dist/auth/headless-detect.js +1 -1
  2. package/dist/cli-banner.js +1 -1
  3. package/dist/cli.js +56 -19
  4. package/dist/commands/approve.js +1 -1
  5. package/dist/commands/compile.js +19 -17
  6. package/dist/commands/diagnostics.d.ts +7 -0
  7. package/dist/commands/diagnostics.js +58 -0
  8. package/dist/commands/docs.js +1 -1
  9. package/dist/commands/drain-worker.js +1 -1
  10. package/dist/commands/endpoints.js +1 -1
  11. package/dist/commands/fixture.js +1 -1
  12. package/dist/commands/held-run-client.js +1 -1
  13. package/dist/commands/held-run-resolve.js +1 -1
  14. package/dist/commands/hook.js +1 -1
  15. package/dist/commands/index.d.ts +16 -4
  16. package/dist/commands/index.js +10 -4
  17. package/dist/commands/init.js +2 -2
  18. package/dist/commands/login.d.ts +0 -2
  19. package/dist/commands/login.js +1 -3
  20. package/dist/commands/logout.js +1 -1
  21. package/dist/commands/orchestrators.d.ts +25 -0
  22. package/dist/commands/orchestrators.js +115 -0
  23. package/dist/commands/org.js +1 -1
  24. package/dist/commands/reject.js +1 -1
  25. package/dist/commands/run.d.ts +2 -9
  26. package/dist/commands/run.js +256 -315
  27. package/dist/commands/runs/cancel.d.ts +6 -0
  28. package/dist/commands/runs/cancel.js +32 -0
  29. package/dist/commands/runs/list.d.ts +6 -0
  30. package/dist/commands/runs/list.js +49 -0
  31. package/dist/commands/runs/logs.d.ts +7 -0
  32. package/dist/commands/runs/logs.js +67 -0
  33. package/dist/commands/runs/rerun.d.ts +5 -0
  34. package/dist/commands/runs/rerun.js +21 -0
  35. package/dist/commands/runs/show.d.ts +5 -0
  36. package/dist/commands/runs/show.js +65 -0
  37. package/dist/commands/secrets-list.d.ts +7 -9
  38. package/dist/commands/secrets-list.js +40 -64
  39. package/dist/commands/test.d.ts +4 -0
  40. package/dist/commands/test.js +4 -6
  41. package/dist/commands/types.d.ts +3 -5
  42. package/dist/commands/types.js +13 -37
  43. package/dist/commands/verify-attestation.d.ts +12 -0
  44. package/dist/commands/verify-attestation.js +69 -0
  45. package/dist/commands/watch.js +1 -1
  46. package/dist/commands/workflows.js +14 -34
  47. package/dist/errors/capability-gap.js +1 -1
  48. package/dist/errors/formatter.js +1 -1
  49. package/dist/errors/index.js +1 -1
  50. package/dist/execution/executor.js +1 -1
  51. package/dist/execution/index.js +1 -1
  52. package/dist/execution/sdk-alias.js +1 -1
  53. package/dist/execution/ts-loader.js +1 -1
  54. package/dist/fixtures/compiler.js +1 -1
  55. package/dist/fixtures/defaults/index.js +1 -1
  56. package/dist/format.js +1 -1
  57. package/dist/generators/secrets-dts.js +2 -2
  58. package/dist/hooks/detector.js +1 -1
  59. package/dist/hooks/index.js +1 -1
  60. package/dist/hooks/installer.js +1 -1
  61. package/dist/hooks/templates.js +1 -1
  62. package/dist/index.js +1 -1
  63. package/dist/llm-context/llms-full.txt +1549 -1282
  64. package/dist/llm-context/llms.txt +6 -2
  65. package/dist/local-executor/dag-scheduler.js +1 -1
  66. package/dist/local-executor/index.js +1 -1
  67. package/dist/local-executor/job-runner.js +40 -18
  68. package/dist/local-executor/materializer.js +1 -1
  69. package/dist/local-executor/output-streamer.js +1 -1
  70. package/dist/local-executor/payload-generator.js +1 -1
  71. package/dist/local-executor/picker.js +1 -1
  72. package/dist/local-executor/runs-on-display.d.ts +9 -0
  73. package/dist/local-executor/runs-on-display.js +23 -0
  74. package/dist/local-executor/secret-loader.js +1 -1
  75. package/dist/local-executor/to-event-payload.js +1 -1
  76. package/dist/local-executor/types.js +1 -1
  77. package/dist/local-executor/workflow-lock.js +0 -0
  78. package/dist/lockfile/generator.d.ts +9 -5
  79. package/dist/lockfile/generator.js +58 -38
  80. package/dist/lockfile/hash-files.js +1 -1
  81. package/dist/lockfile/hasher.js +1 -1
  82. package/dist/lockfile/index.js +1 -1
  83. package/dist/lockfile/purity-analyzer.js +1 -1
  84. package/dist/postinstall.js +1 -1
  85. package/dist/provenance-trust-root.d.ts +14 -0
  86. package/dist/provenance-trust-root.js +49 -0
  87. package/dist/remote/config.d.ts +6 -2
  88. package/dist/remote/config.js +7 -4
  89. package/dist/remote/dashboard-client.d.ts +92 -0
  90. package/dist/remote/dashboard-client.js +168 -0
  91. package/dist/remote/encryption.js +3 -4
  92. package/dist/remote/history.js +1 -1
  93. package/dist/remote/oauth.js +1 -1
  94. package/dist/remote/oidc-discovery.js +1 -1
  95. package/dist/remote/output/json.js +1 -1
  96. package/dist/remote/output/junit.js +1 -1
  97. package/dist/remote/output/streaming.js +1 -1
  98. package/dist/remote/output/summary.js +1 -1
  99. package/dist/remote/platform-client.d.ts +142 -0
  100. package/dist/remote/platform-client.js +187 -0
  101. package/dist/remote/prod-defaults.js +1 -1
  102. package/dist/remote/render.d.ts +11 -0
  103. package/dist/remote/render.js +48 -0
  104. package/dist/remote/secret-upload.js +1 -1
  105. package/dist/remote/uploader.d.ts +9 -0
  106. package/dist/remote/uploader.js +51 -4
  107. package/dist/templates/agents-md.d.ts +1 -1
  108. package/dist/templates/agents-md.js +8 -3
  109. package/dist/templates/index.js +1 -1
  110. package/dist/templates/package-json.js +4 -5
  111. package/dist/templates/tsconfig-json.js +1 -1
  112. package/dist/templates/workflows/hello-world.js +2 -2
  113. package/dist/templates/workflows/hello-world.ts +1 -1
  114. package/dist/templates/workflows/pr-checks.js +3 -3
  115. package/dist/templates/workflows/pr-checks.ts +2 -2
  116. package/dist/test-runner/dry-run.js +1 -1
  117. package/dist/test-runner/event-types.js +1 -1
  118. package/dist/test-runner/git-detector.js +1 -1
  119. package/dist/test-runner/index.js +1 -1
  120. package/dist/test-runner/job-executor.js +3 -2
  121. package/dist/test-runner/output-formatter.js +1 -1
  122. package/dist/test-runner/payload-builder.js +1 -1
  123. package/dist/test-runner/rule-evaluator.js +1 -1
  124. package/dist/test-runner/secrets-file.js +1 -1
  125. package/dist/test-runner/step-context.js +10 -6
  126. package/dist/types.d.ts +29 -8
  127. package/dist/types.js +2 -1
  128. package/dist/validation/index.js +1 -1
  129. package/dist/validation/validator.js +1 -1
  130. package/dist/workflows/hello-world.ts +1 -1
  131. package/dist/workflows/pr-checks.ts +2 -2
  132. package/package.json +10 -9
  133. package/sbom.spdx.json +465 -410
  134. package/dist/commands/cancel.js +0 -124
  135. package/dist/commands/status.js +0 -212
  136. package/dist/remote/client.js +0 -203
  137. package/dist/remote/observer.js +0 -174
  138. /package/dist/{chunk-gOLHoazu.js → chunk-BTugEXQM.js} +0 -0
@@ -1,174 +0,0 @@
1
- import "../chunk-gOLHoazu.js";
2
- import WebSocket from "ws";
3
- //#region src/remote/observer.ts
4
- /**
5
- * WebSocket observer client for real-time run streaming.
6
- *
7
- * Connects to the orchestrator's observer WS endpoint, subscribes to a
8
- * specific run, and relays real-time events (logs, step changes, status
9
- * updates, completion) to registered callbacks.
10
- *
11
- * Features:
12
- * - Auto-reconnect with lastSeenSequence for backfill (up to 5 attempts)
13
- * - Promise-based waitForCompletion()
14
- * - Clean disconnect
15
- */
16
- var ObserverClient = class {
17
- ws = null;
18
- lastSeenSequence = 0;
19
- reconnectAttempts = 0;
20
- intentionalDisconnect = false;
21
- initialConnectCompleted = false;
22
- reconnectTimer = null;
23
- completionResolve = null;
24
- completionReject = null;
25
- completionResult = null;
26
- config;
27
- constructor(config) {
28
- this.config = {
29
- maxReconnectAttempts: 5,
30
- reconnectDelayMs: 1e3,
31
- ...config
32
- };
33
- }
34
- /**
35
- * Connect to the observer endpoint and send the subscribe message.
36
- * Resolves when the WS connection is open and subscribe is sent.
37
- */
38
- connect() {
39
- return new Promise((resolve, reject) => {
40
- this.intentionalDisconnect = false;
41
- this.doConnect(resolve, reject);
42
- });
43
- }
44
- /**
45
- * Returns a promise that resolves when the run completes.
46
- * If the run already completed (from a prior observe.complete),
47
- * resolves immediately.
48
- */
49
- waitForCompletion() {
50
- if (this.completionResult) return Promise.resolve(this.completionResult);
51
- return new Promise((resolve, reject) => {
52
- this.completionResolve = resolve;
53
- this.completionReject = reject;
54
- });
55
- }
56
- /**
57
- * Gracefully disconnect from the observer endpoint.
58
- */
59
- disconnect() {
60
- this.intentionalDisconnect = true;
61
- if (this.reconnectTimer) {
62
- clearTimeout(this.reconnectTimer);
63
- this.reconnectTimer = null;
64
- }
65
- if (this.ws) {
66
- this.ws.close(1e3, "Observer disconnect");
67
- this.ws = null;
68
- }
69
- if (this.completionReject) {
70
- this.completionReject(/* @__PURE__ */ new Error("Observer disconnected"));
71
- this.completionResolve = null;
72
- this.completionReject = null;
73
- }
74
- }
75
- /** Current lastSeenSequence (for testing). */
76
- getLastSeenSequence() {
77
- return this.lastSeenSequence;
78
- }
79
- doConnect(onConnected, onFailed) {
80
- try {
81
- this.ws = new WebSocket(this.config.observeUrl);
82
- } catch (err) {
83
- const error = err instanceof Error ? err : new Error(String(err));
84
- if (onFailed) onFailed(error);
85
- else this.config.onError(error);
86
- return;
87
- }
88
- this.ws.on("open", () => {
89
- const subscribeMsg = {
90
- type: "observe.subscribe",
91
- runId: this.config.runId,
92
- token: this.config.token
93
- };
94
- if (this.lastSeenSequence > 0) subscribeMsg.lastSeenSequence = this.lastSeenSequence;
95
- this.ws.send(JSON.stringify(subscribeMsg));
96
- this.initialConnectCompleted = true;
97
- this.reconnectAttempts = 0;
98
- if (onConnected) onConnected();
99
- });
100
- this.ws.on("message", (data) => {
101
- this.handleMessage(data);
102
- });
103
- this.ws.on("close", (_code) => {
104
- this.ws = null;
105
- if (!this.intentionalDisconnect) this.scheduleReconnect();
106
- });
107
- this.ws.on("error", (err) => {
108
- if (onFailed) {
109
- onFailed(err);
110
- onFailed = void 0;
111
- onConnected = void 0;
112
- } else this.config.onError(err);
113
- });
114
- }
115
- handleMessage(data) {
116
- let msg;
117
- try {
118
- msg = JSON.parse(data.toString());
119
- } catch {
120
- return;
121
- }
122
- if (typeof msg.sequence === "number") this.lastSeenSequence = msg.sequence;
123
- switch (msg.type) {
124
- case "observe.log":
125
- this.config.onLog(msg);
126
- break;
127
- case "observe.step":
128
- this.config.onStep(msg);
129
- break;
130
- case "observe.status":
131
- this.config.onStatus(msg);
132
- break;
133
- case "observe.complete": {
134
- const completeMsg = msg;
135
- this.completionResult = completeMsg;
136
- this.config.onComplete(completeMsg);
137
- if (this.completionResolve) {
138
- this.completionResolve(completeMsg);
139
- this.completionResolve = null;
140
- this.completionReject = null;
141
- }
142
- break;
143
- }
144
- case "error": {
145
- const error = new Error(msg.message || "Observer error");
146
- this.config.onError(error);
147
- break;
148
- }
149
- }
150
- }
151
- scheduleReconnect() {
152
- if (!this.initialConnectCompleted) return;
153
- if (this.reconnectAttempts >= this.config.maxReconnectAttempts) {
154
- const error = /* @__PURE__ */ new Error(`Observer connection lost after ${this.config.maxReconnectAttempts} reconnection attempts`);
155
- this.config.onError(error);
156
- if (this.completionReject) {
157
- this.completionReject(error);
158
- this.completionResolve = null;
159
- this.completionReject = null;
160
- }
161
- return;
162
- }
163
- this.reconnectAttempts++;
164
- process.stderr.write(`Reconnecting to observer (attempt ${this.reconnectAttempts}/${this.config.maxReconnectAttempts})...\n`);
165
- this.reconnectTimer = setTimeout(() => {
166
- this.reconnectTimer = null;
167
- if (!this.intentionalDisconnect) this.doConnect();
168
- }, this.config.reconnectDelayMs);
169
- }
170
- };
171
- //#endregion
172
- export { ObserverClient };
173
-
174
- //# sourceMappingURL=observer.js.map
File without changes