kiokuko-dsh 0.2.2 → 0.2.4

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 (147) hide show
  1. package/README.ja.md +4 -5
  2. package/README.md +5 -5
  3. package/dist/client.cjs +225 -159
  4. package/dist/context/continuity-view.d.ts +1 -1
  5. package/dist/dsh/coding-workflow/contracts.d.ts +120 -0
  6. package/dist/dsh/coding-workflow/contracts.d.ts.map +1 -0
  7. package/dist/dsh/coding-workflow/contracts.js +77 -0
  8. package/dist/dsh/coding-workflow/contracts.js.map +1 -0
  9. package/dist/dsh/coding-workflow/host.d.ts +41 -0
  10. package/dist/dsh/coding-workflow/host.d.ts.map +1 -0
  11. package/dist/dsh/coding-workflow/host.js +235 -0
  12. package/dist/dsh/coding-workflow/host.js.map +1 -0
  13. package/dist/dsh/coding-workflow/intent.d.ts +15 -0
  14. package/dist/dsh/coding-workflow/intent.d.ts.map +1 -0
  15. package/dist/dsh/coding-workflow/intent.js +86 -0
  16. package/dist/dsh/coding-workflow/intent.js.map +1 -0
  17. package/dist/dsh/coding-workflow/service.d.ts +155 -0
  18. package/dist/dsh/coding-workflow/service.d.ts.map +1 -0
  19. package/dist/dsh/coding-workflow/service.js +282 -0
  20. package/dist/dsh/coding-workflow/service.js.map +1 -0
  21. package/dist/dsh/coding-workflow/store.d.ts +17 -0
  22. package/dist/dsh/coding-workflow/store.d.ts.map +1 -0
  23. package/dist/dsh/coding-workflow/store.js +77 -0
  24. package/dist/dsh/coding-workflow/store.js.map +1 -0
  25. package/dist/dsh/completion-verifiers.d.ts +14 -1
  26. package/dist/dsh/completion-verifiers.d.ts.map +1 -1
  27. package/dist/dsh/completion-verifiers.js.map +1 -1
  28. package/dist/dsh/core/host.d.ts.map +1 -1
  29. package/dist/dsh/core/host.js +48 -7
  30. package/dist/dsh/core/host.js.map +1 -1
  31. package/dist/dsh/core/index.js +2 -2
  32. package/dist/dsh/core/index.js.map +1 -1
  33. package/dist/dsh/core/tasks.d.ts +2 -0
  34. package/dist/dsh/core/tasks.d.ts.map +1 -1
  35. package/dist/dsh/core/tasks.js +37 -2
  36. package/dist/dsh/core/tasks.js.map +1 -1
  37. package/dist/dsh/execution-selection.d.ts +1 -1
  38. package/dist/dsh/host-adapter/admission.d.ts.map +1 -1
  39. package/dist/dsh/host-adapter/admission.js +13 -22
  40. package/dist/dsh/host-adapter/admission.js.map +1 -1
  41. package/dist/dsh/host-adapter/boundaries.d.ts.map +1 -1
  42. package/dist/dsh/host-adapter/boundaries.js +2 -0
  43. package/dist/dsh/host-adapter/boundaries.js.map +1 -1
  44. package/dist/dsh/host-adapter/context.d.ts.map +1 -1
  45. package/dist/dsh/host-adapter/context.js +18 -13
  46. package/dist/dsh/host-adapter/context.js.map +1 -1
  47. package/dist/dsh/host-adapter/lifecycle.d.ts.map +1 -1
  48. package/dist/dsh/host-adapter/lifecycle.js +12 -0
  49. package/dist/dsh/host-adapter/lifecycle.js.map +1 -1
  50. package/dist/dsh/host-adapter/routing.js +1 -1
  51. package/dist/dsh/host-adapter/routing.js.map +1 -1
  52. package/dist/dsh/host-adapter.d.ts.map +1 -1
  53. package/dist/dsh/host-adapter.js +36 -6
  54. package/dist/dsh/host-adapter.js.map +1 -1
  55. package/dist/dsh/lisp/candidate.d.ts +2 -2
  56. package/dist/dsh/lisp/code-intelligence-contracts.d.ts +1 -1
  57. package/dist/dsh/lisp/coding-choice.d.ts +3 -1
  58. package/dist/dsh/lisp/coding-choice.d.ts.map +1 -1
  59. package/dist/dsh/lisp/coding-choice.js +17 -12
  60. package/dist/dsh/lisp/coding-choice.js.map +1 -1
  61. package/dist/dsh/lisp/manager.d.ts +1 -0
  62. package/dist/dsh/lisp/manager.d.ts.map +1 -1
  63. package/dist/dsh/lisp/manager.js +13 -0
  64. package/dist/dsh/lisp/manager.js.map +1 -1
  65. package/dist/dsh/lisp/request-surface.d.ts +12 -2
  66. package/dist/dsh/lisp/request-surface.d.ts.map +1 -1
  67. package/dist/dsh/lisp/request-surface.js +1 -1
  68. package/dist/dsh/lisp/request-surface.js.map +1 -1
  69. package/dist/dsh/lisp/surface.d.ts.map +1 -1
  70. package/dist/dsh/lisp/surface.js +46 -5
  71. package/dist/dsh/lisp/surface.js.map +1 -1
  72. package/dist/dsh/lisp-service-key.d.ts +9 -0
  73. package/dist/dsh/lisp-service-key.d.ts.map +1 -1
  74. package/dist/dsh/lisp-service-key.js +11 -0
  75. package/dist/dsh/lisp-service-key.js.map +1 -1
  76. package/dist/dsh/models/profiles.d.ts +2 -0
  77. package/dist/dsh/models/profiles.d.ts.map +1 -1
  78. package/dist/dsh/models/profiles.js +9 -5
  79. package/dist/dsh/models/profiles.js.map +1 -1
  80. package/dist/dsh/models/service.d.ts +24 -1
  81. package/dist/dsh/models/service.d.ts.map +1 -1
  82. package/dist/dsh/models/service.js +85 -42
  83. package/dist/dsh/models/service.js.map +1 -1
  84. package/dist/dsh/modules/lisp.d.ts.map +1 -1
  85. package/dist/dsh/modules/lisp.js +1 -12
  86. package/dist/dsh/modules/lisp.js.map +1 -1
  87. package/dist/dsh/modules/resources.d.ts +3 -1
  88. package/dist/dsh/modules/resources.d.ts.map +1 -1
  89. package/dist/dsh/modules/resources.js +4 -0
  90. package/dist/dsh/modules/resources.js.map +1 -1
  91. package/dist/dsh/node-tap-summary.d.ts +2 -0
  92. package/dist/dsh/node-tap-summary.d.ts.map +1 -1
  93. package/dist/dsh/node-tap-summary.js +6 -1
  94. package/dist/dsh/node-tap-summary.js.map +1 -1
  95. package/dist/dsh/on-demand-intake.d.ts.map +1 -1
  96. package/dist/dsh/on-demand-intake.js +13 -4
  97. package/dist/dsh/on-demand-intake.js.map +1 -1
  98. package/dist/dsh/owned-evidence.d.ts.map +1 -1
  99. package/dist/dsh/owned-evidence.js +2 -2
  100. package/dist/dsh/owned-evidence.js.map +1 -1
  101. package/dist/dsh/owned-execution.d.ts +1 -0
  102. package/dist/dsh/owned-execution.d.ts.map +1 -1
  103. package/dist/dsh/owned-execution.js +37 -2
  104. package/dist/dsh/owned-execution.js.map +1 -1
  105. package/dist/dsh/skill-prompts.json +1 -1
  106. package/dist/dsh/task-completion-host.js +3 -3
  107. package/dist/dsh/task-completion-host.js.map +1 -1
  108. package/dist/dsh/task-completion.d.ts +16 -0
  109. package/dist/dsh/task-completion.d.ts.map +1 -1
  110. package/dist/dsh/task-completion.js +130 -24
  111. package/dist/dsh/task-completion.js.map +1 -1
  112. package/dist/dsh/task-intake.d.ts.map +1 -1
  113. package/dist/dsh/task-intake.js +7 -0
  114. package/dist/dsh/task-intake.js.map +1 -1
  115. package/dist/enno-oduno/coding-workflow.d.ts +39 -0
  116. package/dist/enno-oduno/coding-workflow.d.ts.map +1 -0
  117. package/dist/enno-oduno/coding-workflow.js +33 -0
  118. package/dist/enno-oduno/coding-workflow.js.map +1 -0
  119. package/dist/enno-oduno/schemas.d.ts +2 -2
  120. package/dist/enno-oduno/store.d.ts.map +1 -1
  121. package/dist/enno-oduno/store.js +46 -3
  122. package/dist/enno-oduno/store.js.map +1 -1
  123. package/dist/enno-oduno/types.d.ts +1 -0
  124. package/dist/enno-oduno/types.d.ts.map +1 -1
  125. package/dist/enno-oduno/verifier.d.ts.map +1 -1
  126. package/dist/enno-oduno/verifier.js +4 -1
  127. package/dist/enno-oduno/verifier.js.map +1 -1
  128. package/dist/locale/en.json +1 -1
  129. package/dist/locale/ja.json +1 -1
  130. package/dist/locale/ko.json +1 -1
  131. package/dist/locale/zh-CN.json +1 -1
  132. package/dist/model-tools/contracts.d.ts +2 -2
  133. package/dist/models-client.cjs +223 -157
  134. package/dist/models-client.d.ts.map +1 -1
  135. package/dist/models-client.js +261 -166
  136. package/dist/models-client.js.map +1 -1
  137. package/docs/coding-workflow.md +45 -0
  138. package/docs/execution-support.md +4 -0
  139. package/docs/kiokuko-models.md +25 -13
  140. package/docs/lisp-hot-tools.md +2 -2
  141. package/docs/lisp.md +7 -9
  142. package/migrations/036_coding_workflow.sql +26 -0
  143. package/package.json +2 -2
  144. package/skills/coding-ideal-routine-skill/SKILL.md +6 -0
  145. package/skills/kiokuko-lisp/SKILL.md +5 -1
  146. package/skills/kiokuko-soul/SKILL.md +2 -2
  147. package/skills/one-shot-software-completion/SKILL.md +5 -6
@@ -68,6 +68,7 @@ window.__ModuleLoader__.load({
68
68
  ollama: ["Ollama", "http://localhost:11434/v1", "chat-completions"],
69
69
  custom: ["Custom connection", "http://localhost:8080/v1", "chat-completions"]
70
70
  };
71
+ var OAUTH_KINDS = ["codex", "claude", "xai", "openai", "openrouter", "nous"];
71
72
  async function modelsApi(body, query = "") {
72
73
  const response = await fetch("/api/kiokuko.models" + query, {
73
74
  ...body ? {
@@ -92,6 +93,7 @@ window.__ModuleLoader__.load({
92
93
  reasoning: false,
93
94
  image: false
94
95
  });
96
+ const [advanced, setAdvanced] = useState(false), [manualOpen, setManualOpen] = useState(false);
95
97
  const operation = useRef(void 0), mounted = useRef(true), working = useRef(false);
96
98
  const sessionId = props.sessionId;
97
99
  const load = async () => {
@@ -133,12 +135,15 @@ window.__ModuleLoader__.load({
133
135
  setError("");
134
136
  setModels([]);
135
137
  try {
136
- setModels(await modelsApi(void 0, "?op=models&id=" + encodeURIComponent(c.id)));
138
+ const list = await modelsApi(void 0, "?op=models&id=" + encodeURIComponent(c.id));
139
+ setModels(list);
140
+ return list;
137
141
  } catch (e) {
138
142
  setError(messageOf(e));
143
+ return [];
139
144
  }
140
145
  };
141
- const save = async () => {
146
+ const persist = async () => {
142
147
  await modelsApi({
143
148
  op: "save",
144
149
  connection: {
@@ -150,11 +155,33 @@ window.__ModuleLoader__.load({
150
155
  serviceTier: connection.serviceTier,
151
156
  models: connection.models
152
157
  },
153
- revision: state.revision
158
+ revision: (await load()).revision
154
159
  });
155
- const next = await load();
156
- await choose(next.connections.find((c) => c.id === connection.id));
157
- setNotice("Connection saved");
160
+ };
161
+ const reopen = async () => {
162
+ const saved = await load();
163
+ return choose(saved.connections.find((c) => c.id === connection.id) ?? connection);
164
+ };
165
+ const connect = async () => {
166
+ const draft = { ...connection };
167
+ await persist();
168
+ const typed = key.trim();
169
+ if (typed) {
170
+ await modelsApi({ op: "key", id: draft.id, key: typed });
171
+ setKey("");
172
+ }
173
+ let failure = "";
174
+ try {
175
+ await modelsApi({ op: "refresh", id: draft.id });
176
+ } catch (e) {
177
+ failure = messageOf(e);
178
+ }
179
+ const list = await reopen();
180
+ if (failure) {
181
+ setNotice(typed ? "Connection and key saved" : "Connection saved");
182
+ setError(failure + " Register a model manually if this endpoint stays unusable.");
183
+ } else
184
+ setNotice(list.length ? "Connected \xB7 " + list.length + " model(s)" : "Connected; no models discovered yet");
158
185
  };
159
186
  const newConnection = (kind) => {
160
187
  const spec = MODEL_CONNECTION_DEFAULTS[kind];
@@ -170,10 +197,11 @@ window.__ModuleLoader__.load({
170
197
  setModels([]);
171
198
  setKey("");
172
199
  setError("");
200
+ setNotice("");
173
201
  };
174
202
  const update = (field, value) => setConnection({ ...connection, [field]: value });
175
203
  const startLogin = async () => {
176
- await save();
204
+ await persist();
177
205
  const result = await modelsApi({ op: "login", id: connection.id });
178
206
  operation.current = result.operationId;
179
207
  setAuth({ id: result.operationId, status: "pending", events: [] });
@@ -189,10 +217,9 @@ window.__ModuleLoader__.load({
189
217
  setAuth(next);
190
218
  if (next.status !== "pending") {
191
219
  operation.current = void 0;
192
- void load().then((value) => {
193
- if (next.status === "success")
194
- return choose(value.connections.find((c) => c.id === connection.id));
195
- setError(next.error ?? "Authentication cancelled");
220
+ void reopen().then(() => {
221
+ if (next.status !== "success")
222
+ setError(next.error ?? "Authentication cancelled");
196
223
  }).catch((e) => setError(messageOf(e)));
197
224
  }
198
225
  }, (e) => {
@@ -205,7 +232,7 @@ window.__ModuleLoader__.load({
205
232
  clearInterval(timer);
206
233
  };
207
234
  }, [auth?.id, auth?.status]);
208
- const input = (label, value, onChange, type = "text") => jsx("label", {
235
+ const input = (label, value, onChange, type = "text", submit) => jsx("label", {
209
236
  children: jsxs(Fragment, {
210
237
  children: [
211
238
  jsx("span", { children: label }),
@@ -215,6 +242,14 @@ window.__ModuleLoader__.load({
215
242
  "aria-label": label,
216
243
  disabled: busy || label === "Base URL" && ["codex", "opencode", "opencode-go"].includes(connection?.kind),
217
244
  onChange: (e) => onChange(e.target.value),
245
+ ...submit ? {
246
+ onKeyDown: (e) => {
247
+ if (e.key !== "Enter")
248
+ return;
249
+ e.preventDefault();
250
+ submit();
251
+ }
252
+ } : {},
218
253
  autoComplete: type === "password" ? "new-password" : "off"
219
254
  })
220
255
  ]
@@ -235,9 +270,9 @@ window.__ModuleLoader__.load({
235
270
  jsx("p", {
236
271
  children: "Connect directly for chat, Enno and Deep. Credentials are shared with dsh-cli. Signing out also signs dsh-cli out."
237
272
  }),
238
- ...error ? [jsx("p", { role: "alert", children: error })] : [],
239
- ...notice ? [jsx("p", { role: "status", children: notice })] : [],
240
- ...busy ? [jsx("p", { role: "status", children: "Working\u2026" })] : [],
273
+ ...error ? [jsx("p", { role: "alert", children: error }, "error")] : [],
274
+ ...notice ? [jsx("p", { role: "status", children: notice }, "notice")] : [],
275
+ ...busy ? [jsx("p", { role: "status", children: "Working\u2026" }, "busy")] : [],
241
276
  button("Reload", () => void run(load)),
242
277
  jsx("label", {
243
278
  children: jsxs(Fragment, {
@@ -264,99 +299,35 @@ window.__ModuleLoader__.load({
264
299
  ...connection ? [
265
300
  jsxs("div", {
266
301
  className: "kiokuko-models-editor",
302
+ key: "editor",
267
303
  children: [
268
- input("Connection name", connection.name, (value) => update("name", value)),
269
- input("Base URL", connection.baseURL, (value) => update("baseURL", value)),
270
- jsx("label", {
271
- children: jsxs(Fragment, {
272
- children: [
273
- "Protocol",
274
- jsx("select", {
275
- "aria-label": "Protocol",
276
- value: connection.protocol,
277
- disabled: busy || [
278
- "codex",
279
- "infron",
280
- "opencode",
281
- "opencode-go"
282
- ].includes(connection.kind),
283
- onChange: (e) => update("protocol", e.target.value),
284
- children: [
285
- ["chat-completions", "Chat Completions"],
286
- ["responses", "Responses"],
287
- ["messages", "Messages"]
288
- ].map(([id, name]) => jsx("option", { value: id, children: name }, id))
289
- })
290
- ]
291
- })
292
- }),
293
- ...connection.kind === "infron" ? [
294
- jsx("label", {
295
- children: jsxs(Fragment, {
296
- children: [
297
- "Service tier",
298
- jsx("select", {
299
- "aria-label": "Service tier",
300
- value: connection.serviceTier,
301
- disabled: busy,
302
- onChange: (e) => update("serviceTier", e.target.value),
303
- children: [
304
- jsx("option", {
305
- value: "standard",
306
- children: "Standard"
307
- }),
308
- jsx("option", {
309
- value: "flex",
310
- children: "Flex"
311
- })
312
- ]
313
- })
314
- ]
304
+ jsxs("h3", {
305
+ children: [
306
+ connection.name,
307
+ jsx("span", {
308
+ className: "kiokuko-models-state",
309
+ children: " \xB7 " + (connection.authState ?? "not saved yet")
315
310
  })
316
- }),
317
- jsx("p", {
318
- children: "Requested tier: " + connection.serviceTier + ". Last request: " + (connection.lastRequestedTier ?? "none") + ". Actual served tier: " + (connection.actualTier ?? "unknown") + ". Infron may serve Standard for a Flex request."
319
- })
320
- ] : [],
321
- button("Save connection", () => void run(save)),
311
+ ]
312
+ }),
322
313
  ...connection.kind !== "codex" && connection.kind !== "ollama" ? [
323
- input("API key / bearer token", key, setKey, "password"),
324
- button("Save key", () => void run(async () => {
325
- await save();
326
- await modelsApi({
327
- op: "key",
328
- id: connection.id,
329
- key
330
- });
331
- setKey("");
332
- await load();
333
- await choose(connection);
334
- setNotice("Key saved");
335
- }), !key)
336
- ] : [],
337
- ...[
338
- "codex",
339
- "claude",
340
- "xai",
341
- "openai",
342
- "openrouter",
343
- "nous"
344
- ].includes(connection.kind) ? [
345
- button("Log in", () => void run(startLogin), auth?.status === "pending")
314
+ input("API key / bearer token", key, setKey, "password", () => {
315
+ if (!busy && key.trim())
316
+ void run(connect);
317
+ })
346
318
  ] : [],
347
- button("Log out (also dsh-cli)", () => void run(async () => {
348
- await modelsApi({ op: "logout", id: connection.id });
349
- setKey("");
350
- setModels([]);
351
- await load();
352
- setNotice("Signed out");
353
- })),
354
- button("Refresh models", () => void run(async () => {
355
- await modelsApi({ op: "refresh", id: connection.id });
356
- const next = await load();
357
- await choose(next.connections.find((c) => c.id === connection.id));
358
- setNotice("Models refreshed");
359
- })),
319
+ jsxs("div", {
320
+ className: "kiokuko-models-actions",
321
+ children: [
322
+ button("Save and connect", () => void run(connect)),
323
+ ...OAUTH_KINDS.includes(connection.kind) ? [
324
+ button("Log in", () => void run(startLogin), auth?.status === "pending")
325
+ ] : []
326
+ ]
327
+ }),
328
+ jsx("p", {
329
+ children: connection.kind === "ollama" ? "Ollama needs no key. Save and connect to list its models." : "Paste the API key and press Enter, or use Save and connect. The key is stored with dsh-cli's shared credentials."
330
+ }),
360
331
  ...auth?.status === "pending" ? [
361
332
  jsxs("div", {
362
333
  "aria-label": "Authentication",
@@ -445,61 +416,156 @@ window.__ModuleLoader__.load({
445
416
  ]
446
417
  })
447
418
  ] : [],
448
- ...!["opencode", "opencode-go"].includes(connection.kind) ? [
449
- jsx("details", {
450
- children: jsxs(Fragment, {
451
- children: [
452
- jsx("summary", {
453
- children: "Register model manually"
454
- }),
455
- input("Model ID", manual.id, (value) => setManual({ ...manual, id: value })),
456
- input("Context window", manual.contextWindow, (value) => setManual({
457
- ...manual,
458
- contextWindow: Number(value)
459
- }), "number"),
460
- input("Maximum output tokens", manual.maxTokens, (value) => setManual({
461
- ...manual,
462
- maxTokens: Number(value)
463
- }), "number"),
464
- jsx("label", {
465
- children: jsxs(Fragment, {
419
+ jsxs("details", {
420
+ open: advanced,
421
+ children: [
422
+ jsx("summary", {
423
+ onClick: (e) => {
424
+ e.preventDefault();
425
+ setAdvanced(!advanced);
426
+ },
427
+ children: "Advanced settings"
428
+ }),
429
+ input("Connection name", connection.name, (value) => update("name", value)),
430
+ input("Base URL", connection.baseURL, (value) => update("baseURL", value)),
431
+ jsx("label", {
432
+ children: jsxs(Fragment, {
433
+ children: [
434
+ "Protocol",
435
+ jsx("select", {
436
+ "aria-label": "Protocol",
437
+ value: connection.protocol,
438
+ disabled: busy || [
439
+ "codex",
440
+ "infron",
441
+ "opencode",
442
+ "opencode-go"
443
+ ].includes(connection.kind),
444
+ onChange: (e) => update("protocol", e.target.value),
466
445
  children: [
467
- jsx("input", {
468
- type: "checkbox",
469
- checked: manual.reasoning,
470
- onChange: (e) => setManual({
471
- ...manual,
472
- reasoning: e.target.checked
473
- })
474
- }),
475
- "Reasoning supported"
476
- ]
446
+ ["chat-completions", "Chat Completions"],
447
+ ["responses", "Responses"],
448
+ ["messages", "Messages"]
449
+ ].map(([id, name]) => jsx("option", { value: id, children: name }, id))
477
450
  })
478
- }),
479
- jsx("label", {
480
- children: jsxs(Fragment, {
481
- children: [
482
- jsx("input", {
483
- type: "checkbox",
484
- checked: manual.image,
485
- onChange: (e) => setManual({
486
- ...manual,
487
- image: e.target.checked
451
+ ]
452
+ })
453
+ }),
454
+ ...connection.kind === "infron" ? [
455
+ jsx("label", {
456
+ children: jsxs(Fragment, {
457
+ children: [
458
+ "Service tier",
459
+ jsx("select", {
460
+ "aria-label": "Service tier",
461
+ value: connection.serviceTier,
462
+ disabled: busy,
463
+ onChange: (e) => update("serviceTier", e.target.value),
464
+ children: [
465
+ jsx("option", {
466
+ value: "standard",
467
+ children: "Standard"
468
+ }),
469
+ jsx("option", {
470
+ value: "flex",
471
+ children: "Flex"
488
472
  })
489
- }),
490
- "Image input supported"
491
- ]
492
- })
493
- }),
494
- button("Add manual model", () => {
495
- update("models", [
496
- ...connection.models.filter((m) => m.id !== manual.id),
497
- { ...manual, name: manual.id }
498
- ]);
499
- setNotice("Model added to draft. Save connection to register it.");
500
- }, !manual.id)
501
- ]
502
- })
473
+ ]
474
+ })
475
+ ]
476
+ })
477
+ }),
478
+ jsx("p", {
479
+ children: "Requested tier: " + connection.serviceTier + ". Last request: " + (connection.lastRequestedTier ?? "none") + ". Actual served tier: " + (connection.actualTier ?? "unknown") + ". Infron may serve Standard for a Flex request."
480
+ })
481
+ ] : [],
482
+ button("Save connection", () => void run(async () => {
483
+ await persist();
484
+ await reopen();
485
+ setNotice("Connection saved");
486
+ })),
487
+ button("Refresh models", () => void run(async () => {
488
+ await persist();
489
+ await modelsApi({ op: "refresh", id: connection.id });
490
+ const list = await reopen();
491
+ setNotice(list.length ? "Models refreshed" : "Models refreshed; none discovered");
492
+ })),
493
+ button("Log out (also dsh-cli)", () => void run(async () => {
494
+ await persist();
495
+ await modelsApi({ op: "logout", id: connection.id });
496
+ setKey("");
497
+ setModels([]);
498
+ await load();
499
+ setNotice("Signed out");
500
+ })),
501
+ ...!["opencode", "opencode-go"].includes(connection.kind) ? [
502
+ jsx("details", {
503
+ open: manualOpen,
504
+ children: jsxs(Fragment, {
505
+ children: [
506
+ jsx("summary", {
507
+ onClick: (e) => {
508
+ e.preventDefault();
509
+ setManualOpen(!manualOpen);
510
+ },
511
+ children: "Register model manually"
512
+ }),
513
+ input("Model ID", manual.id, (value) => setManual({ ...manual, id: value })),
514
+ input("Context window", manual.contextWindow, (value) => setManual({
515
+ ...manual,
516
+ contextWindow: Number(value)
517
+ }), "number"),
518
+ input("Maximum output tokens", manual.maxTokens, (value) => setManual({
519
+ ...manual,
520
+ maxTokens: Number(value)
521
+ }), "number"),
522
+ jsx("label", {
523
+ children: jsxs(Fragment, {
524
+ children: [
525
+ jsx("input", {
526
+ type: "checkbox",
527
+ checked: manual.reasoning,
528
+ onChange: (e) => setManual({
529
+ ...manual,
530
+ reasoning: e.target.checked
531
+ })
532
+ }),
533
+ "Reasoning supported"
534
+ ]
535
+ })
536
+ }),
537
+ jsx("label", {
538
+ children: jsxs(Fragment, {
539
+ children: [
540
+ jsx("input", {
541
+ type: "checkbox",
542
+ checked: manual.image,
543
+ onChange: (e) => setManual({
544
+ ...manual,
545
+ image: e.target.checked
546
+ })
547
+ }),
548
+ "Image input supported"
549
+ ]
550
+ })
551
+ }),
552
+ button("Add manual model", () => {
553
+ update("models", [
554
+ ...connection.models.filter((m) => m.id !== manual.id),
555
+ { ...manual, name: manual.id }
556
+ ]);
557
+ setNotice("Model added to draft. Save connection to register it.");
558
+ }, !manual.id)
559
+ ]
560
+ })
561
+ })
562
+ ] : []
563
+ ]
564
+ }),
565
+ jsx("h4", { children: "Models" }),
566
+ ...models.length === 0 ? [
567
+ jsx("p", {
568
+ children: "No models yet. Save and connect to discover them, or register one under Advanced settings."
503
569
  })
504
570
  ] : [],
505
571
  input("Search models", filter, setFilter),
@@ -590,7 +656,7 @@ window.__ModuleLoader__.load({
590
656
  }, "kiokuko models focus lifecycle");
591
657
  ctx.effect(() => {
592
658
  const style = document.createElement("style");
593
- style.textContent = ".kiokuko-models-modal{width:min(900px,calc(100vw - 32px))}.kiokuko-models-panel{box-sizing:border-box;width:100%;max-width:900px;padding:16px;overflow:auto;max-height:75vh}.kiokuko-models-panel label{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:12px 0}.kiokuko-models-panel input,.kiokuko-models-panel select{max-width:100%;box-sizing:border-box;border:1px solid #888;border-radius:6px;padding:8px;color:inherit;background:transparent}.kiokuko-models-panel button{border:1px solid #888;border-radius:6px;padding:8px;margin:4px;color:inherit}.kiokuko-models-panel button:disabled{opacity:.5}.kiokuko-models-panel li{margin:8px 0}.kiokuko-models-panel :focus-visible{outline:2px solid #3286ff;outline-offset:3px}";
659
+ style.textContent = ".kiokuko-models-modal{width:min(900px,calc(100vw - 32px))}.kiokuko-models-panel{box-sizing:border-box;width:100%;max-width:900px;padding:16px;overflow:auto;max-height:75vh}.kiokuko-models-panel label{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:12px 0}.kiokuko-models-panel input,.kiokuko-models-panel select{max-width:100%;box-sizing:border-box;border:1px solid #888;border-radius:6px;padding:8px;color:inherit;background:transparent}.kiokuko-models-panel button{border:1px solid #888;border-radius:6px;padding:8px;margin:4px;color:inherit}.kiokuko-models-panel button:disabled{opacity:.5}.kiokuko-models-panel li{margin:8px 0}.kiokuko-models-panel :focus-visible{outline:2px solid #3286ff;outline-offset:3px}.kiokuko-models-panel summary{cursor:pointer;margin:12px 0}.kiokuko-models-panel h3,.kiokuko-models-panel h4{margin:12px 0 0}.kiokuko-models-state{font-weight:400;font-size:.85em;opacity:.75}.kiokuko-models-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}";
594
660
  document.head.append(style);
595
661
  return () => style.remove();
596
662
  }, "kiokuko models style");
@@ -1 +1 @@
1
- {"version":3,"file":"models-client.d.ts","sourceRoot":"","sources":["../src/models-client.ts"],"names":[],"mappings":"AAAA,UAAU,gBAAgB;IACxB,GAAG,CAAC,CAAC,IAAI,EAAC,MAAM,EAAC,QAAQ,CAAC,EAAC,KAAK,GAAE,OAAO,CAAC;IAC1C,KAAK,EAAE;QACL,MAAM,CAAC,IAAI,EAAC,MAAM,EAAC,QAAQ,EAAC,MAAI,OAAO,GAAE,OAAO,CAAC;QACjD,QAAQ,CAAC,UAAU,EAAC;YAAC,IAAI,EAAC,MAAM,CAAC;YAAA,EAAE,CAAC,EAAC,MAAM,CAAC;YAAA,KAAK,CAAC,EAAC,MAAM,CAAC;YAAA,KAAK,CAAC,EAAC,MAAM,CAAC;YAAA,MAAM,EAAC,MAAM,CAAC;YAAA,MAAM,CAAC,EAAC,MAAI,MAAM,CAAC,MAAM,EAAC,OAAO,CAAC,CAAA;SAAC,EAAC,SAAS,EAAC,CAAC,KAAK,EAAC,MAAM,CAAC,MAAM,EAAC,OAAO,CAAC,KAAG,OAAO,GAAE,OAAO,CAAC;KACtL,CAAC;IACF,MAAM,EAAC;QAAC,QAAQ,CAAC,SAAS,EAAC,MAAM,EAAC,YAAY,EAAC,MAAM,CAAC,MAAM,EAAC,MAAM,CAAC,MAAM,EAAC,MAAM,CAAC,CAAC,GAAE,OAAO,CAAA;KAAC,CAAC;IAC9F,MAAM,CAAC,KAAK,EAAC,MAAI,IAAI,GAAC,CAAC,MAAI,IAAI,GAAC,OAAO,CAAC,IAAI,CAAC,CAAC,EAAC,KAAK,EAAC,MAAM,GAAE,OAAO,CAAC;IACrE,EAAE,CAAC,KAAK,EAAC,kBAAkB,EAAC,QAAQ,EAAC,CAAC,SAAS,EAAC,MAAM,EAAC,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC;QAAC,QAAQ,CAAC,IAAI,EAAC,MAAM,CAAA;KAAC,KAAG,IAAI,GAAE,OAAO,CAAC;CAClH;AA4BD,eAAO,MAAM,MAAM,8BAA+B,CAAC;AACnD,wBAAgB,KAAK,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAEjD;AA8sBD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAqF7D"}
1
+ {"version":3,"file":"models-client.d.ts","sourceRoot":"","sources":["../src/models-client.ts"],"names":[],"mappings":"AAAA,UAAU,gBAAgB;IACxB,GAAG,CAAC,CAAC,IAAI,EAAC,MAAM,EAAC,QAAQ,CAAC,EAAC,KAAK,GAAE,OAAO,CAAC;IAC1C,KAAK,EAAE;QACL,MAAM,CAAC,IAAI,EAAC,MAAM,EAAC,QAAQ,EAAC,MAAI,OAAO,GAAE,OAAO,CAAC;QACjD,QAAQ,CAAC,UAAU,EAAC;YAAC,IAAI,EAAC,MAAM,CAAC;YAAA,EAAE,CAAC,EAAC,MAAM,CAAC;YAAA,KAAK,CAAC,EAAC,MAAM,CAAC;YAAA,KAAK,CAAC,EAAC,MAAM,CAAC;YAAA,MAAM,EAAC,MAAM,CAAC;YAAA,MAAM,CAAC,EAAC,MAAI,MAAM,CAAC,MAAM,EAAC,OAAO,CAAC,CAAA;SAAC,EAAC,SAAS,EAAC,CAAC,KAAK,EAAC,MAAM,CAAC,MAAM,EAAC,OAAO,CAAC,KAAG,OAAO,GAAE,OAAO,CAAC;KACtL,CAAC;IACF,MAAM,EAAC;QAAC,QAAQ,CAAC,SAAS,EAAC,MAAM,EAAC,YAAY,EAAC,MAAM,CAAC,MAAM,EAAC,MAAM,CAAC,MAAM,EAAC,MAAM,CAAC,CAAC,GAAE,OAAO,CAAA;KAAC,CAAC;IAC9F,MAAM,CAAC,KAAK,EAAC,MAAI,IAAI,GAAC,CAAC,MAAI,IAAI,GAAC,OAAO,CAAC,IAAI,CAAC,CAAC,EAAC,KAAK,EAAC,MAAM,GAAE,OAAO,CAAC;IACrE,EAAE,CAAC,KAAK,EAAC,kBAAkB,EAAC,QAAQ,EAAC,CAAC,SAAS,EAAC,MAAM,EAAC,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC;QAAC,QAAQ,CAAC,IAAI,EAAC,MAAM,CAAA;KAAC,KAAG,IAAI,GAAE,OAAO,CAAC;CAClH;AA4BD,eAAO,MAAM,MAAM,8BAA+B,CAAC;AACnD,wBAAgB,KAAK,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAEjD;AAszBD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAqF7D"}