@cyanautomation/kaseki-agent 1.43.1 → 1.44.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.
@@ -1 +1 @@
1
- {"version":3,"file":"kaseki-api-web.d.ts","sourceRoot":"","sources":["../src/kaseki-api-web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AA4vBjC,wBAAgB,eAAe,IAAI,MAAM,CAQxC"}
1
+ {"version":3,"file":"kaseki-api-web.d.ts","sourceRoot":"","sources":["../src/kaseki-api-web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAy1BjC,wBAAgB,eAAe,IAAI,MAAM,CAQxC"}
@@ -32,6 +32,62 @@ const controllerPage = String.raw `<!doctype html>
32
32
  color: var(--ink);
33
33
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
34
34
  }
35
+ .header-bar {
36
+ background: var(--panel);
37
+ border-bottom: 1px solid var(--line);
38
+ padding: var(--space-3) var(--space-3);
39
+ display: flex;
40
+ align-items: center;
41
+ gap: var(--space-3);
42
+ justify-content: space-between;
43
+ }
44
+ .header-bar h1 {
45
+ margin: 0;
46
+ font-size: clamp(24px, 4vw, 32px);
47
+ line-height: 1.2;
48
+ }
49
+ .header-bar-title {
50
+ display: flex;
51
+ align-items: center;
52
+ gap: var(--space-2);
53
+ }
54
+ .header-token-input {
55
+ min-width: 200px;
56
+ max-width: 300px;
57
+ width: auto;
58
+ padding: 10px 11px;
59
+ font-size: 14px;
60
+ }
61
+ @media (max-width: 767px) {
62
+ .header-token-input {
63
+ min-width: 160px;
64
+ max-width: 100%;
65
+ }
66
+ }
67
+ .status-indicator {
68
+ display: inline-flex;
69
+ align-items: center;
70
+ justify-content: center;
71
+ width: 12px;
72
+ height: 12px;
73
+ border-radius: 50%;
74
+ background: var(--muted);
75
+ flex-shrink: 0;
76
+ }
77
+ .status-indicator.running {
78
+ background: #e8b923;
79
+ animation: pulse 1s ease-in-out infinite;
80
+ }
81
+ .status-indicator.completed {
82
+ background: var(--ok);
83
+ }
84
+ .status-indicator.failed {
85
+ background: var(--bad);
86
+ }
87
+ @keyframes pulse {
88
+ 0%, 100% { opacity: 1; }
89
+ 50% { opacity: 0.6; }
90
+ }
35
91
  main {
36
92
  display: grid;
37
93
  gap: var(--space-4);
@@ -41,7 +97,6 @@ const controllerPage = String.raw `<!doctype html>
41
97
  padding: var(--space-3);
42
98
  }
43
99
  h1, h2 { margin: 0; }
44
- h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.12; }
45
100
  h2 { font-size: clamp(20px, 2.2vw, 24px); line-height: 1.2; }
46
101
  p { color: var(--muted); font-size: 16px; line-height: 1.5; margin: var(--space-1) 0 0; }
47
102
  .panel {
@@ -178,6 +233,9 @@ const controllerPage = String.raw `<!doctype html>
178
233
  #state.ok { color: var(--ok); }
179
234
  #state.bad { color: var(--bad); }
180
235
  @media (min-width: 768px) {
236
+ .header-bar {
237
+ padding: clamp(var(--space-3), 2vw, 24px) clamp(var(--space-3), 4vw, 48px);
238
+ }
181
239
  main {
182
240
  grid-template-columns: minmax(320px, 560px) minmax(320px, 1fr);
183
241
  padding: clamp(var(--space-3), 4vw, 48px);
@@ -270,19 +328,23 @@ const controllerPage = String.raw `<!doctype html>
270
328
  .health-check-status.bad::before { content: '✕'; }
271
329
  @media (max-width: 767px) {
272
330
  .action-row.run-actions > .run { order: 1; }
273
- .response-panel { min-height: 52vh; }
331
+ .response-panel { min-height: 40vh; }
274
332
  .health-checks-grid { grid-template-columns: repeat(2, 1fr); }
333
+ main {
334
+ grid-template-columns: minmax(0, 1fr);
335
+ }
275
336
  }
276
337
  </style>
277
338
  </head>
278
339
  <body>
340
+ <header class="header-bar">
341
+ <div class="header-bar-title">
342
+ <h1>Kaseki Task Console</h1>
343
+ <span class="status-indicator" id="header-status" data-status="idle"></span>
344
+ </div>
345
+ <input id="header-api-token" class="header-token-input" type="password" autocomplete="off" placeholder="API bearer token (required)" aria-label="API bearer token">
346
+ </header>
279
347
  <main>
280
- <section class="panel" aria-labelledby="page-title">
281
- <header>
282
- <h1 id="page-title">Kaseki Task Console</h1>
283
- <p>Check system health and submit repository tasks to the Kaseki API controller.</p>
284
- </header>
285
- </section>
286
348
  <section class="panel stack" aria-labelledby="tabs-heading">
287
349
  <div class="tabs-nav" role="tablist" aria-label="Console tabs">
288
350
  <button class="tab-button active" data-tab="health" role="tab" aria-selected="true" aria-controls="health-tab">Health</button>
@@ -332,12 +394,7 @@ const controllerPage = String.raw `<!doctype html>
332
394
  <fieldset class="form-fields">
333
395
  <legend>Required information</legend>
334
396
  <div class="form-field">
335
- <label for="token">API bearer token</label>
336
- <input id="token" name="token" type="password" autocomplete="off" placeholder="Required to submit tasks">
337
- <p class="field-helper">Stored in this tab only after a successful request.</p>
338
- <p class="field-error" data-error-for="token" aria-live="polite"></p>
339
- </div>
340
- <div class="form-field">
397
+
341
398
  <label for="repo-url">Repository URL</label>
342
399
  <input id="repo-url" name="repoUrl" type="url" required placeholder="https://github.com/org/repo">
343
400
  <p class="field-error" data-error-for="repoUrl" aria-live="polite"></p>
@@ -427,13 +484,45 @@ const controllerPage = String.raw `<!doctype html>
427
484
  const output = document.querySelector('#output');
428
485
  const outputMeta = document.querySelector('#output-meta');
429
486
  const state = document.querySelector('#state');
430
- const tokenInput = document.querySelector('#token');
487
+ const headerTokenInput = document.querySelector('#header-api-token');
431
488
  const runIdInput = document.querySelector('#run-id');
432
489
  const runLinks = document.querySelector('#run-links');
433
490
  const recommendedArtifacts = document.querySelector('#recommended-artifacts');
434
491
  const recommendedArtifactLinks = document.querySelector('#recommended-artifact-links');
492
+ const headerStatus = document.querySelector('#header-status');
435
493
  let pollTimer = null;
436
- tokenInput.value = sessionStorage.getItem('kasekiApiToken') || '';
494
+
495
+ function getApiToken() {
496
+ return headerTokenInput.value.trim();
497
+ }
498
+
499
+ // Restore token from session storage on page load
500
+ headerTokenInput.value = sessionStorage.getItem('kasekiApiToken') || '';
501
+
502
+ // Save token to session storage when it changes
503
+ headerTokenInput.addEventListener('change', () => {
504
+ const token = getApiToken();
505
+ if (token) {
506
+ sessionStorage.setItem('kasekiApiToken', token);
507
+ } else {
508
+ sessionStorage.removeItem('kasekiApiToken');
509
+ }
510
+ });
511
+
512
+ function updateHeaderStatus(status) {
513
+ if (!headerStatus) return;
514
+ const statusMap = {
515
+ 'idle': 'idle',
516
+ 'running': 'running',
517
+ 'queued': 'running',
518
+ 'completed': 'completed',
519
+ 'failed': 'failed',
520
+ 'request ok': 'idle',
521
+ };
522
+ const statusClass = statusMap[status] || 'idle';
523
+ headerStatus.className = 'status-indicator ' + statusClass;
524
+ headerStatus.setAttribute('data-status', statusClass);
525
+ }
437
526
 
438
527
  function sanitizeOutput(value) {
439
528
  if (typeof value === 'string') return value;
@@ -455,6 +544,7 @@ const controllerPage = String.raw `<!doctype html>
455
544
 
456
545
  function setOutputMetadata(status, runId) {
457
546
  outputMeta.textContent = 'Status: ' + status + (runId ? ' | Run ID: ' + runId : '');
547
+ updateHeaderStatus(status);
458
548
  }
459
549
 
460
550
  function responseStatusLabel(response, payload) {
@@ -586,9 +676,9 @@ const controllerPage = String.raw `<!doctype html>
586
676
  }
587
677
 
588
678
  async function apiRequest(path, options) {
589
- const token = tokenInput.value.trim();
679
+ const token = getApiToken();
590
680
  const needsAuth = options && options.auth;
591
- if (needsAuth && !token) throw new Error('Enter the API bearer token first.');
681
+ if (needsAuth && !token) throw new Error('Enter the API bearer token in the header first.');
592
682
  if (needsAuth && token && !isLikelyBearerToken(token)) {
593
683
  throw new Error('Token format looks invalid. Use a plain bearer token without spaces.');
594
684
  }
@@ -692,6 +782,9 @@ const controllerPage = String.raw `<!doctype html>
692
782
  const savedTab = sessionStorage.getItem('kasekiActiveTab') || 'health';
693
783
  const savedTabButton = document.querySelector('[data-tab="' + savedTab + '"]');
694
784
  if (savedTabButton) savedTabButton.click();
785
+
786
+ // Initialize header status
787
+ updateHeaderStatus('idle');
695
788
 
696
789
  // Health check button handlers
697
790
  document.querySelectorAll('[data-probe]').forEach((button) => {
@@ -1 +1 @@
1
- {"version":3,"file":"kaseki-api-web.js","sourceRoot":"","sources":["../src/kaseki-api-web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwvBhC,CAAC;AAEF,MAAM,U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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAq1BhC,CAAC;AAEF,MAAM,UAAU,eAAe;IAC7B,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;QACrC,GAAG,CAAC,GAAG,CAAC,yBAAyB,EAAE,2JAA2J,CAAC,CAAC;QAChM,GAAG,CAAC,GAAG,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;QAC1C,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyanautomation/kaseki-agent",
3
- "version": "1.43.1",
3
+ "version": "1.44.0",
4
4
  "description": "Admin/helper/doctor toolbox and local API client for Kaseki diagnostics, setup, and API-backed coding-agent task workflows",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -47,7 +47,7 @@
47
47
  "generate:openapi": "node scripts/generate-openapi-spec.js",
48
48
  "build": "tsc && node dist/add-js-extensions.js && npm run generate:openapi && npm run check:dist-dynamic-imports && chmod 0755 dist/*.js",
49
49
  "prepublishOnly": "npm run build",
50
- "type-check": "tsc --noEmit",
50
+ "type-check": "tsc --noEmit -p tsconfig.json",
51
51
  "check": "npm run type-check && npm run lint",
52
52
  "test": "npm run test:unit",
53
53
  "test:unit": "jest --passWithNoTests",