kiokuko-dsh 0.2.46 → 0.2.48

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 (83) hide show
  1. package/dist/akinator/domain.d.ts +1 -0
  2. package/dist/akinator/domain.d.ts.map +1 -1
  3. package/dist/akinator/domain.js +18 -1
  4. package/dist/akinator/domain.js.map +1 -1
  5. package/dist/build-info.json +4 -4
  6. package/dist/dsh/core/host.d.ts.map +1 -1
  7. package/dist/dsh/core/host.js +3 -1
  8. package/dist/dsh/core/host.js.map +1 -1
  9. package/dist/dsh/decisions/akinator-classification.d.ts +12 -0
  10. package/dist/dsh/decisions/akinator-classification.d.ts.map +1 -1
  11. package/dist/dsh/decisions/akinator-classification.js +48 -0
  12. package/dist/dsh/decisions/akinator-classification.js.map +1 -1
  13. package/dist/dsh/decisions/workflows.d.ts +1 -1
  14. package/dist/dsh/decisions/workflows.d.ts.map +1 -1
  15. package/dist/dsh/decisions/workflows.js +1 -1
  16. package/dist/dsh/decisions/workflows.js.map +1 -1
  17. package/dist/dsh/harness/factory.d.ts +2 -1
  18. package/dist/dsh/harness/factory.d.ts.map +1 -1
  19. package/dist/dsh/harness/factory.js +25 -8
  20. package/dist/dsh/harness/factory.js.map +1 -1
  21. package/dist/dsh/harness/index.d.ts +1 -1
  22. package/dist/dsh/harness/index.d.ts.map +1 -1
  23. package/dist/dsh/harness/index.js +2 -2
  24. package/dist/dsh/harness/index.js.map +1 -1
  25. package/dist/dsh/host-adapter/admission.d.ts.map +1 -1
  26. package/dist/dsh/host-adapter/admission.js +0 -30
  27. package/dist/dsh/host-adapter/admission.js.map +1 -1
  28. package/dist/dsh/host-adapter/context.d.ts.map +1 -1
  29. package/dist/dsh/host-adapter/context.js +4 -7
  30. package/dist/dsh/host-adapter/context.js.map +1 -1
  31. package/dist/dsh/host-adapter.d.ts.map +1 -1
  32. package/dist/dsh/host-adapter.js +3 -1
  33. package/dist/dsh/host-adapter.js.map +1 -1
  34. package/dist/dsh/lisp/coding-preparation.d.ts +1 -1
  35. package/dist/dsh/lisp/coding-preparation.d.ts.map +1 -1
  36. package/dist/dsh/lisp/coding-preparation.js +1 -1
  37. package/dist/dsh/lisp/coding-preparation.js.map +1 -1
  38. package/dist/dsh/lisp/manager.d.ts.map +1 -1
  39. package/dist/dsh/lisp/manager.js +2 -1
  40. package/dist/dsh/lisp/manager.js.map +1 -1
  41. package/dist/dsh/lisp/model-result.d.ts.map +1 -1
  42. package/dist/dsh/lisp/model-result.js +12 -2
  43. package/dist/dsh/lisp/model-result.js.map +1 -1
  44. package/dist/dsh/lisp/surface.d.ts.map +1 -1
  45. package/dist/dsh/lisp/surface.js +4 -3
  46. package/dist/dsh/lisp/surface.js.map +1 -1
  47. package/dist/dsh/lisp/test-report.d.ts +40 -0
  48. package/dist/dsh/lisp/test-report.d.ts.map +1 -0
  49. package/dist/dsh/lisp/test-report.js +163 -0
  50. package/dist/dsh/lisp/test-report.js.map +1 -0
  51. package/dist/dsh/lisp/worker.d.ts.map +1 -1
  52. package/dist/dsh/lisp/worker.js +9 -3
  53. package/dist/dsh/lisp/worker.js.map +1 -1
  54. package/dist/dsh/model-selection-ui.d.ts +7 -12
  55. package/dist/dsh/model-selection-ui.d.ts.map +1 -1
  56. package/dist/dsh/model-selection-ui.js +12 -137
  57. package/dist/dsh/model-selection-ui.js.map +1 -1
  58. package/dist/dsh/models/metadata.d.ts +2 -0
  59. package/dist/dsh/models/metadata.d.ts.map +1 -1
  60. package/dist/dsh/models/metadata.js +11 -5
  61. package/dist/dsh/models/metadata.js.map +1 -1
  62. package/dist/dsh/models/session-selection.d.ts.map +1 -1
  63. package/dist/dsh/models/session-selection.js +4 -3
  64. package/dist/dsh/models/session-selection.js.map +1 -1
  65. package/dist/dsh/models/surface.d.ts.map +1 -1
  66. package/dist/dsh/models/surface.js +6 -4
  67. package/dist/dsh/models/surface.js.map +1 -1
  68. package/dist/dsh/on-demand-intake.d.ts +7 -0
  69. package/dist/dsh/on-demand-intake.d.ts.map +1 -1
  70. package/dist/dsh/on-demand-intake.js +20 -3
  71. package/dist/dsh/on-demand-intake.js.map +1 -1
  72. package/dist/dsh/tool-exposure-diagnostics.d.ts.map +1 -1
  73. package/dist/dsh/tool-exposure-diagnostics.js +12 -1
  74. package/dist/dsh/tool-exposure-diagnostics.js.map +1 -1
  75. package/dist/locale/en.json +1 -1
  76. package/dist/locale/ja.json +1 -1
  77. package/dist/locale/ko.json +1 -1
  78. package/dist/locale/zh-CN.json +1 -1
  79. package/docs/kiokuko-harness.md +4 -2
  80. package/docs/lisp.md +26 -4
  81. package/docs/model-selection.md +12 -16
  82. package/lisp/tools.lisp +38 -3
  83. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"tool-exposure-diagnostics.js","sourceRoot":"","sources":["../../src/dsh/tool-exposure-diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAWvD,8FAA8F;AAC9F,MAAM,UAAU,6BAA6B,CAAC,MAAgC,EAC5E,SAAS,EAAE,IAAI,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;IACnG,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,EAAE,UAAU,GAAG,UAAU,EAAE,CAAA;IACzD,IAAI,QAAQ,GAAG,CAAC,CAAA;IAChB,MAAM,OAAO,GAAG,EAAE,GAAG,eAAe,EAAE,EAAE,GAAG,oBAAoB,EAAE,CAAA;IACjE,MAAM,KAAK,GAAG,CAAC,IAA+B,EAAE,KAA8B,EAAE,OAA4B,EAAE,EAAE;QAC9G,MAAM,IAAI,G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AU;YAAE,MAAM,CAAC,IAAI,CAAC,wEAAwE,KAAK,CAAC,aAAa,IAAI,KAAK,CAAC,MAAM,IAAI,UAAU,EAAE,CAAC,CAAA;;YAC5J,MAAM,CAAC,IAAI,CAAC,yCAAyC,UAAU,EAAE,CAAC,CAAA;IACzE,CAAC,CAAA;IACD,OAAO;QACL,QAAQ,CAAC,MAAc,EAAE,OAA4B;YACnD,IAAI,MAAM,EAAE,CAAC,IAAI,KAAK,MAAM;gBAAE,KAAK,CAAC,UAAU,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,CAAA;QAClH,CAAC;QACD,UAAU,CAAC,IAAwB,EAAE,MAAc,EAAE,OAA4B,EAAE,OAA4B;YAC7G,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC;gBAAE,KAAK,CAAC,YAAY,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,EAAE,OAAO,CAAC,CAAA;QACxI,CAAC;KACF,CAAA;AACH,CAAC"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "kiokuko-dsh",
4
- "description": "Version 0.2.46 — Kiokuko plugin for DeepSeek Harness"
4
+ "description": "Version 0.2.48 — Kiokuko plugin for DeepSeek Harness"
5
5
  }
6
6
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "kiokuko-dsh",
4
- "description": "バージョン 0.2.46 — DeepSeek Harness 向け Kiokuko プラグイン"
4
+ "description": "バージョン 0.2.48 — DeepSeek Harness 向け Kiokuko プラグイン"
5
5
  }
6
6
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "kiokuko-dsh",
4
- "description": "버전 0.2.46 — DeepSeek Harness용 Kiokuko 플러그인"
4
+ "description": "버전 0.2.48 — DeepSeek Harness용 Kiokuko 플러그인"
5
5
  }
6
6
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "kiokuko-dsh",
4
- "description": "版本 0.2.46 — DeepSeek Harness 的 Kiokuko 插件"
4
+ "description": "版本 0.2.48 — DeepSeek Harness 的 Kiokuko 插件"
5
5
  }
6
6
  }
@@ -17,7 +17,9 @@ dsh-cli
17
17
 
18
18
  The profile must already supply DSH and the CLI's required peer services. DSH delegates plugin installation to pnpm; adding a tarball with npm to an existing dsh-cli dependency tree can reject the CLI's bundled `workspace:*` dependencies. Keep the host dependency graph coherent. Do not disable compatibility checks or relax permissions to repair a missing peer package.
19
19
 
20
- The resolved configuration must have one enabled `kiokuko-dsh/harness` and a disabled `agent-loop`. Harness options are provider/model defaults and an explicit step budget:
20
+ The resolved configuration must have one enabled `kiokuko-dsh/harness` and a disabled `agent-loop`. Harness options are provider/model defaults and an optional per-turn step budget. By default there is no step-count limit: long work continues until completion, a native stop/refusal, cancellation, or another runtime failure. The previous implicit 128-step limit could interrupt successful tool work before verification and a final answer.
21
+
22
+ To opt into a fixed limit, set a positive integer explicitly:
21
23
 
22
24
  ```yaml
23
25
  - id: kiokuko-harness
@@ -25,7 +27,7 @@ The resolved configuration must have one enabled `kiokuko-dsh/harness` and a dis
25
27
  maxSteps: 128
26
28
  ```
27
29
 
28
- Reaching the budget records a failed turn for inspection; it does not assert task success. Set a suitable budget for longer work. Tool authority still belongs to the native tool scope and approvals.
30
+ Reaching an explicit budget while more work remains records `KIOKUKO_STEP_BUDGET_REACHED` with the configured limit. It preserves settled tool results and records a failed turn for inspection; it does not assert task success or automatically replay work. A later user continuation gets a fresh per-turn budget. Completion at the exact limit remains successful. Remove `maxSteps` from an existing profile to use the default without a step-count limit, or raise it to allow longer bounded turns. Tool authority still belongs to the native tool scope and approvals.
29
31
 
30
32
  For the previous plugin integration, pass the installed overlay **after** the bundle:
31
33
 
package/docs/lisp.md CHANGED
@@ -404,14 +404,36 @@ composed operation stops before its next step. Use `run` when the function needs
404
404
  to inspect a nonzero exit and handle it explicitly. `result-ok?` is true only for
405
405
  exit code zero; missing or nonnumeric exit codes return false.
406
406
 
407
- For a scratch project, run tests without child-process isolation when supported:
407
+ For selected tests, use the bundled `kioku.test` functions inside `lisp_eval`:
408
408
 
409
409
  ```lisp
410
- (kioku.process:run "node"
411
- '("--test" "--experimental-test-isolation=none" "test/public.test.mjs")
412
- :directory "extract/project")
410
+ (kioku.test:node "test/example.test.ts" :tsx t)
411
+ (kioku.test:vitest "test/example.spec.ts" :config-loader :native)
413
412
  ```
414
413
 
414
+ Both accept one file or a list, a `:directory`, a `:name-pattern` regex and
415
+ `:timeout-ms` for the subprocess. Use a Lisp evaluation timeout long enough to
416
+ collect the result. Vitest uses the development project's installed
417
+ `./node_modules/.bin/vitest` and its JSON reporter. Node uses TAP and can run in
418
+ protected scratch with `:isolation :none`:
419
+
420
+ ```lisp
421
+ (kioku.test:node "test/public.test.mjs" :directory "extract/project" :isolation :none)
422
+ ```
423
+
424
+ These functions use the existing process permissions and cancellation. The
425
+ result keeps the process `code` and includes `testStatus`, a count summary
426
+ when the reporter is readable, and up to eight failures with available
427
+ locations. A zero exit without observed passing cases yields `unknown`.
428
+ For Vitest, each test failure's `file`, `line`, and `column` identify the test
429
+ definition when available. When the assertion stack contains a usable local
430
+ source frame, `assertionLocation` gives the assertion's own `file`, `line`, and
431
+ `column`. That file can be a helper called by the test.
432
+ For missing or truncated reports, check the returned diagnostic and inspect
433
+ the saved `/value/json/stdout` or `/value/json/stderr` with `lisp_inspect`.
434
+ The saved logs are bounded and `logsTruncated` indicates when capture was
435
+ shortened. Project-specific commands remain available through `kioku.process:run`.
436
+
415
437
  The experimental flag spelling works with Node 22.8+ and remains accepted by
416
438
  Node 24/26. The shorter `--test-isolation` spelling requires Node 23.6+.
417
439
  The broker resolves programs through its fixed system PATH, so its Node can differ
@@ -63,13 +63,11 @@ composition and repeated key events do not select or submit.
63
63
 
64
64
  ## Head/worker model pairs
65
65
 
66
- The native selection card offers the current DSH model (`通常実行`) or a fixed
67
- **GPT-6.1-Sol head + DeepSeek V4.1 Flash subagent** pair for the task. The pair is
68
- adopted only after live catalog validation of both exact model IDs; there is no
69
- automatic replacement. A pair is stored per logical run or per session and never
70
- rewrites an active task's resolved configuration. Agent-scoped assembly/request
71
- hooks freeze one selection per request and restore ordinary routing at
72
- completion.
66
+ Tasks start in normal execution. In Web, open **Settings → Kiokuko Models** to
67
+ choose a **GPT-6.1-Sol head + DeepSeek V4.1 Flash subagent** pair for the current
68
+ chat or as the default for new chats. Saving the pair validates both exact model
69
+ IDs against the live catalog. The host binds each request to its resolved
70
+ selection and also supports pairs saved with earlier runs.
73
71
 
74
72
  OpenAI assignments follow the [OpenAI model guide](https://developers.openai.com/api/docs/models):
75
73
  **gpt-6.1-sol** as the head and **gpt-6.1-luna**/DeepSeek **V4.1 Flash** as the
@@ -85,12 +83,10 @@ rather than automatic fallback.
85
83
 
86
84
  Resolved configuration and the ordinary model are persisted per logical run.
87
85
  The configured execution owner binds run ownership to one `mode` and rejects
88
- conflicting ownership rather than allowing a second task lane. A persisted
89
- selection that no longer matches current policy degrades to an explicit reselect
90
- prompt instead of being silently reinterpreted.
91
-
92
- Native tests cover request model IDs, ordinary README completion, cancel/reload,
93
- input recovery, independent sessions, routing restoration and actual adapter
94
- transport. Recording adapters do not verify paid account access, subscription
95
- limits or successful live provider responses. Memory finalization and
96
- AgenticReplay behavior remain in place.
86
+ conflicting ownership. A pending legacy execution selection becomes ready in
87
+ normal mode on admission.
88
+
89
+ Native tests cover request model IDs, ordinary README completion, task
90
+ cancellation and reload, input recovery, independent sessions, routing
91
+ restoration and adapter transport. Recording adapters do not verify paid
92
+ account access, subscription limits or successful live provider responses.
package/lisp/tools.lisp CHANGED
@@ -3,6 +3,7 @@
3
3
  (defpackage :kioku.files (:use :cl) (:export :input :read-text :write-text :propose-write :propose-delete :scratch :search-text :diff-text :list-directory :head-lines :tail-lines :count-lines :glob-scratch :copy-scratch :delete-scratch :grep-scratch))
4
4
  (defpackage :kioku.objects (:use :cl) (:export :retain :inspect-ref :release :register-artifact))
5
5
  (defpackage :kioku.process (:use :cl) (:export :run :python :shell :start-job :job-status :cancel-job :result-code :result-stdout :result-stderr :result-ok? :split-lines :python-stdout :shell-stdout :run-lines :list-jobs :forget-job))
6
+ (defpackage :kioku.test (:use :cl) (:export :node :vitest))
6
7
  (defpackage :kioku.environment (:use :cl) (:export :status))
7
8
  (defpackage :kioku.ci (:use :cl) (:export :list-runs :failed-log :verify))
8
9
  (defpackage :kioku.packages (:use :cl) (:export :metadata :audit :update-lockfiles))
@@ -223,6 +224,40 @@
223
224
  id))
224
225
  (defun job-status (id) (kioku.internal:rpc "job-status" (kioku.internal:object "id" id)))
225
226
  (defun cancel-job (id) (kioku.internal:rpc "cancel-job" (kioku.internal:object "id" id)))
227
+ (in-package :kioku.test)
228
+ (defun test-files (files)
229
+ (let ((paths (if (stringp files) (list files) files)))
230
+ (unless (and (listp paths) paths
231
+ (let ((count (list-length paths))) (and count (<= count 100)))
232
+ (every (lambda (path)
233
+ (and (stringp path) (<= 1 (length path) 4096)
234
+ (char/= (char path 0) #\-)
235
+ (not (find (code-char 0) path))))
236
+ paths))
237
+ (error "TEST_FILES_INVALID: supply one path or a list of up to 100 paths."))
238
+ paths))
239
+ (defun run-tests (runner program arguments files name-pattern directory timeout-ms)
240
+ (unless (or (null name-pattern) (and (stringp name-pattern) (<= 1 (length name-pattern) 4096)
241
+ (not (find (code-char 0) name-pattern))))
242
+ (error "TEST_PATTERN_INVALID: supply a nonempty regular expression string."))
243
+ (kioku.internal:rpc "run"
244
+ (kioku.internal:object "program" program "testRunner" runner "directory" directory "timeoutMs" timeout-ms
245
+ "argv" (coerce (append arguments
246
+ (when name-pattern
247
+ (list (concatenate 'string (if (equal runner "node") "--test-name-pattern=" "--testNamePattern=") name-pattern)))
248
+ (test-files files)) 'vector))))
249
+ (defun node (files &key (directory ".") (timeout-ms 120000) tsx name-pattern isolation)
250
+ "Run selected Node tests with TAP. FILES is a path or list. TSX loads the project's tsx. ISOLATION :NONE supports protected scratch. Inspect testStatus, summary, failures and code."
251
+ (run-tests "node" "node"
252
+ (append (when tsx '("--import" "tsx")) '("--test" "--test-reporter=tap")
253
+ (ecase isolation ((nil) nil) (:none '("--experimental-test-isolation=none"))))
254
+ files name-pattern directory timeout-ms))
255
+ (defun vitest (files &key (directory ".") (timeout-ms 120000) config-loader name-pattern)
256
+ "Run selected tests with the project's installed Vitest and its JSON reporter. CONFIG-LOADER accepts :NATIVE, :RUNNER or :BUNDLE. Inspect testStatus, summary, failures and code."
257
+ (run-tests "vitest" "./node_modules/.bin/vitest"
258
+ (append '("run" "--reporter=json" "--includeTaskLocation")
259
+ (when config-loader (list "--configLoader" (ecase config-loader (:native "native") (:runner "runner") (:bundle "bundle")))))
260
+ files name-pattern directory timeout-ms))
226
261
  (in-package :kioku.ci)
227
262
  (defun list-runs (&key (limit 10))
228
263
  "List recent GitHub Actions runs for the bound workspace repository."
@@ -329,7 +364,7 @@ CHOICES contains 1-8 (restart-name description) pairs. No expression replay or a
329
364
  (kioku.internal:rpc "tool-call" (kioku.internal:object "name" name "args" arguments)))
330
365
  (defun describe-tools ()
331
366
  (mapcar (lambda (package) (cons package (sort (loop for symbol being the external-symbols of (find-package package) collect (symbol-name symbol)) #'string<)))
332
- '("KIOKU.TOOLS" "KIOKU.PROCESS" "KIOKU.FILES" "KIOKU.DATA" "KIOKU.OBJECTS" "KIOKU.ENVIRONMENT" "KIOKU.CI" "KIOKU.PACKAGES" "KIOKU.TYPESAFE" "KIOKU.DECISIONS" "KIOKU.RECOVERY")))
367
+ '("KIOKU.TOOLS" "KIOKU.PROCESS" "KIOKU.TEST" "KIOKU.FILES" "KIOKU.DATA" "KIOKU.OBJECTS" "KIOKU.ENVIRONMENT" "KIOKU.CI" "KIOKU.PACKAGES" "KIOKU.TYPESAFE" "KIOKU.DECISIONS" "KIOKU.RECOVERY")))
333
368
  (defun task-functions ()
334
369
  "List functions and macros defined in this worker's KIOKU.USER package."
335
370
  (let ((package (find-package :kioku.user)))
@@ -343,7 +378,7 @@ CHOICES contains 1-8 (restart-name description) pairs. No expression replay or a
343
378
  (kioku.internal:object "package" "kioku.user" "generation" kioku.internal:*generation*
344
379
  "symbols" (coerce (task-functions) 'vector))))
345
380
  (let ((package (find-package (string-upcase name))))
346
- (when (and package (member (package-name package) '("KIOKU.TOOLS" "KIOKU.PROCESS" "KIOKU.FILES" "KIOKU.DATA" "KIOKU.OBJECTS" "KIOKU.ENVIRONMENT" "KIOKU.CI" "KIOKU.PACKAGES" "KIOKU.TYPESAFE" "KIOKU.DECISIONS" "KIOKU.RECOVERY" "KIOKU.CODE") :test #'equal))
381
+ (when (and package (member (package-name package) '("KIOKU.TOOLS" "KIOKU.PROCESS" "KIOKU.TEST" "KIOKU.FILES" "KIOKU.DATA" "KIOKU.OBJECTS" "KIOKU.ENVIRONMENT" "KIOKU.CI" "KIOKU.PACKAGES" "KIOKU.TYPESAFE" "KIOKU.DECISIONS" "KIOKU.RECOVERY" "KIOKU.CODE") :test #'equal))
347
382
  (return-from describe-symbol
348
383
  (kioku.internal:object "package" (string-downcase (package-name package))
349
384
  "symbols" (coerce (sort (loop for symbol being the external-symbols of package
@@ -353,7 +388,7 @@ CHOICES contains 1-8 (restart-name description) pairs. No expression replay or a
353
388
  (multiple-value-bind (symbol end) (read-from-string name)
354
389
  (unless (and (symbolp symbol) (symbol-package symbol) (fboundp symbol)
355
390
  (zerop (length (string-trim '(#\Space #\Tab #\Newline #\Return) (subseq name end))))
356
- (member (package-name (symbol-package symbol)) '("KIOKU.USER" "KIOKU.TOOLS" "KIOKU.PROCESS" "KIOKU.FILES" "KIOKU.DATA" "KIOKU.OBJECTS" "KIOKU.ENVIRONMENT" "KIOKU.CI" "KIOKU.PACKAGES" "KIOKU.TYPESAFE" "KIOKU.DECISIONS" "KIOKU.RECOVERY" "KIOKU.CODE") :test #'equal))
391
+ (member (package-name (symbol-package symbol)) '("KIOKU.USER" "KIOKU.TOOLS" "KIOKU.PROCESS" "KIOKU.TEST" "KIOKU.FILES" "KIOKU.DATA" "KIOKU.OBJECTS" "KIOKU.ENVIRONMENT" "KIOKU.CI" "KIOKU.PACKAGES" "KIOKU.TYPESAFE" "KIOKU.DECISIONS" "KIOKU.RECOVERY" "KIOKU.CODE") :test #'equal))
357
392
  (error "UNKNOWN_SYMBOL"))
358
393
  (kioku.internal:object "symbol" name "arguments" (kioku.internal::printed (sb-introspect:function-lambda-list symbol)) "documentation" (or (documentation symbol 'function) "No function documentation."))))))
359
394
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kiokuko-dsh",
3
- "version": "0.2.46",
3
+ "version": "0.2.48",
4
4
  "description": "Kiokuko plugin for DeepSeek Harness",
5
5
  "type": "module",
6
6
  "license": "MIT",