modkh 0.0.0-stage → 0.1.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.
Files changed (256) hide show
  1. package/README.md +24 -2
  2. package/dist/agent/bundled-skills.d.ts +13 -0
  3. package/dist/agent/bundled-skills.js +95 -0
  4. package/dist/agent/images.d.ts +10 -0
  5. package/dist/agent/images.js +33 -0
  6. package/dist/agent/loop.d.ts +56 -0
  7. package/dist/agent/loop.js +155 -0
  8. package/dist/agent/skills.d.ts +20 -0
  9. package/dist/agent/skills.js +169 -0
  10. package/dist/agent/types.d.ts +132 -0
  11. package/dist/agent/types.js +12 -0
  12. package/dist/cli/agents.d.ts +8 -0
  13. package/dist/cli/agents.js +12 -0
  14. package/dist/cli/approval.d.ts +27 -0
  15. package/dist/cli/approval.js +62 -0
  16. package/dist/cli/catalog.d.ts +39 -0
  17. package/dist/cli/catalog.js +76 -0
  18. package/dist/cli/chat.d.ts +18 -0
  19. package/dist/cli/chat.js +733 -0
  20. package/dist/cli/clipboard.d.ts +9 -0
  21. package/dist/cli/clipboard.js +54 -0
  22. package/dist/cli/color.d.ts +42 -0
  23. package/dist/cli/color.js +176 -0
  24. package/dist/cli/config.d.ts +41 -0
  25. package/dist/cli/config.js +188 -0
  26. package/dist/cli/editor.d.ts +16 -0
  27. package/dist/cli/editor.js +77 -0
  28. package/dist/cli/keys.d.ts +18 -0
  29. package/dist/cli/keys.js +82 -0
  30. package/dist/cli/language.d.ts +1 -0
  31. package/dist/cli/language.js +105 -0
  32. package/dist/cli/limits.d.ts +13 -0
  33. package/dist/cli/limits.js +19 -0
  34. package/dist/cli/lines.d.ts +18 -0
  35. package/dist/cli/lines.js +80 -0
  36. package/dist/cli/models.d.ts +4 -0
  37. package/dist/cli/models.js +69 -0
  38. package/dist/cli/permissions.d.ts +25 -0
  39. package/dist/cli/permissions.js +30 -0
  40. package/dist/cli/plugins.d.ts +1 -0
  41. package/dist/cli/plugins.js +53 -0
  42. package/dist/cli/providers.d.ts +46 -0
  43. package/dist/cli/providers.js +76 -0
  44. package/dist/cli/terminal.d.ts +143 -0
  45. package/dist/cli/terminal.js +742 -0
  46. package/dist/cli/usage.d.ts +29 -0
  47. package/dist/cli/usage.js +75 -0
  48. package/dist/index.d.ts +11 -0
  49. package/dist/index.js +164 -0
  50. package/dist/language/catalog.d.ts +44 -0
  51. package/dist/language/catalog.js +100 -0
  52. package/dist/language/commonlisp-bundled.d.ts +11 -0
  53. package/dist/language/commonlisp-bundled.js +22 -0
  54. package/dist/language/commonlisp-dependencies.d.ts +16 -0
  55. package/dist/language/commonlisp-dependencies.js +68 -0
  56. package/dist/language/commonlisp-install.d.ts +14 -0
  57. package/dist/language/commonlisp-install.js +213 -0
  58. package/dist/language/commonlisp-reader.d.ts +17 -0
  59. package/dist/language/commonlisp-reader.js +47 -0
  60. package/dist/language/commonlisp-systems.d.ts +3 -0
  61. package/dist/language/commonlisp-systems.js +32 -0
  62. package/dist/language/commonlisp-tls.d.ts +10 -0
  63. package/dist/language/commonlisp-tls.js +51 -0
  64. package/dist/language/detect.d.ts +29 -0
  65. package/dist/language/detect.js +103 -0
  66. package/dist/language/grammars/LICENSE +24 -0
  67. package/dist/language/grammars/manifest.json +76 -0
  68. package/dist/language/grammars/tree-sitter-c.wasm +0 -0
  69. package/dist/language/grammars/tree-sitter-cpp.wasm +0 -0
  70. package/dist/language/grammars/tree-sitter-css.wasm +0 -0
  71. package/dist/language/grammars/tree-sitter-html.wasm +0 -0
  72. package/dist/language/grammars/tree-sitter-javascript.wasm +0 -0
  73. package/dist/language/grammars/tree-sitter-php.wasm +0 -0
  74. package/dist/language/grammars/tree-sitter-python.wasm +0 -0
  75. package/dist/language/grammars/tree-sitter-ruby.wasm +0 -0
  76. package/dist/language/grammars/tree-sitter-rust.wasm +0 -0
  77. package/dist/language/grammars/tree-sitter-swift.wasm +0 -0
  78. package/dist/language/grammars/tree-sitter-tsx.wasm +0 -0
  79. package/dist/language/grammars/tree-sitter-typescript.wasm +0 -0
  80. package/dist/language/install.d.ts +50 -0
  81. package/dist/language/install.js +293 -0
  82. package/dist/language/lsp/client.d.ts +97 -0
  83. package/dist/language/lsp/client.js +337 -0
  84. package/dist/language/lsp/pool.d.ts +67 -0
  85. package/dist/language/lsp/pool.js +122 -0
  86. package/dist/language/lsp/service.d.ts +46 -0
  87. package/dist/language/lsp/service.js +138 -0
  88. package/dist/language/native.d.ts +8 -0
  89. package/dist/language/native.js +100 -0
  90. package/dist/language/platform.d.ts +14 -0
  91. package/dist/language/platform.js +20 -0
  92. package/dist/language/positions.d.ts +20 -0
  93. package/dist/language/positions.js +46 -0
  94. package/dist/language/syntax/assets.d.ts +9 -0
  95. package/dist/language/syntax/assets.js +73 -0
  96. package/dist/language/syntax/parser.d.ts +24 -0
  97. package/dist/language/syntax/parser.js +144 -0
  98. package/dist/language/typescript-capability.d.ts +6 -0
  99. package/dist/language/typescript-capability.js +42 -0
  100. package/dist/lisp/config.d.ts +16 -0
  101. package/dist/lisp/config.js +159 -0
  102. package/dist/lisp/routing.d.ts +5 -0
  103. package/dist/lisp/routing.js +24 -0
  104. package/dist/lisp/runtime.d.ts +21 -0
  105. package/dist/lisp/runtime.js +83 -0
  106. package/dist/memory/kiokuko.d.ts +32 -0
  107. package/dist/memory/kiokuko.js +102 -0
  108. package/dist/memory/mcp.d.ts +38 -0
  109. package/dist/memory/mcp.js +211 -0
  110. package/dist/model/ai-sdk.d.ts +27 -0
  111. package/dist/model/ai-sdk.js +180 -0
  112. package/dist/model/chatgpt/login.d.ts +42 -0
  113. package/dist/model/chatgpt/login.js +180 -0
  114. package/dist/model/chatgpt/responses.d.ts +41 -0
  115. package/dist/model/chatgpt/responses.js +202 -0
  116. package/dist/model/chatgpt/tokens.d.ts +11 -0
  117. package/dist/model/chatgpt/tokens.js +50 -0
  118. package/dist/model/connection.d.ts +6 -0
  119. package/dist/model/connection.js +65 -0
  120. package/dist/model/context.d.ts +9 -0
  121. package/dist/model/context.js +69 -0
  122. package/dist/model/factory.d.ts +25 -0
  123. package/dist/model/factory.js +88 -0
  124. package/dist/model/fixed.d.ts +17 -0
  125. package/dist/model/fixed.js +41 -0
  126. package/dist/model/reasoning.d.ts +16 -0
  127. package/dist/model/reasoning.js +62 -0
  128. package/dist/plugins/api.d.ts +60 -0
  129. package/dist/plugins/api.js +1 -0
  130. package/dist/plugins/manager.d.ts +34 -0
  131. package/dist/plugins/manager.js +261 -0
  132. package/dist/plugins/package.d.ts +13 -0
  133. package/dist/plugins/package.js +99 -0
  134. package/dist/plugins/registry.d.ts +8 -0
  135. package/dist/plugins/registry.js +14 -0
  136. package/dist/session/store.d.ts +82 -0
  137. package/dist/session/store.js +285 -0
  138. package/dist/session/workspace.d.ts +19 -0
  139. package/dist/session/workspace.js +73 -0
  140. package/dist/subagents/processes.d.ts +18 -0
  141. package/dist/subagents/processes.js +73 -0
  142. package/dist/subagents/request.d.ts +4 -0
  143. package/dist/subagents/request.js +21 -0
  144. package/dist/subagents/service.d.ts +39 -0
  145. package/dist/subagents/service.js +352 -0
  146. package/dist/subagents/settings.d.ts +10 -0
  147. package/dist/subagents/settings.js +32 -0
  148. package/dist/subagents/types.d.ts +43 -0
  149. package/dist/subagents/types.js +1 -0
  150. package/dist/subagents/verification.d.ts +31 -0
  151. package/dist/subagents/verification.js +178 -0
  152. package/dist/tools/diff.d.ts +6 -0
  153. package/dist/tools/diff.js +82 -0
  154. package/dist/tools/edit.d.ts +3 -0
  155. package/dist/tools/edit.js +152 -0
  156. package/dist/tools/files.d.ts +6 -0
  157. package/dist/tools/files.js +96 -0
  158. package/dist/tools/formal.d.ts +8 -0
  159. package/dist/tools/formal.js +77 -0
  160. package/dist/tools/guard.d.ts +7 -0
  161. package/dist/tools/guard.js +48 -0
  162. package/dist/tools/job-tools.d.ts +19 -0
  163. package/dist/tools/job-tools.js +148 -0
  164. package/dist/tools/jobs.d.ts +77 -0
  165. package/dist/tools/jobs.js +181 -0
  166. package/dist/tools/language.d.ts +6 -0
  167. package/dist/tools/language.js +174 -0
  168. package/dist/tools/registry.d.ts +28 -0
  169. package/dist/tools/registry.js +105 -0
  170. package/dist/tools/run.d.ts +13 -0
  171. package/dist/tools/run.js +159 -0
  172. package/dist/tools/search.d.ts +2 -0
  173. package/dist/tools/search.js +156 -0
  174. package/dist/tools/shell-process.d.ts +115 -0
  175. package/dist/tools/shell-process.js +286 -0
  176. package/dist/tools/skills.d.ts +2 -0
  177. package/dist/tools/skills.js +46 -0
  178. package/dist/tools/web.d.ts +24 -0
  179. package/dist/tools/web.js +386 -0
  180. package/docs/ci-repair-20261116.md +30 -0
  181. package/docs/commonlisp-provider-migration.md +22 -0
  182. package/docs/commonlisp-qlot-recovery.md +28 -0
  183. package/docs/commonlisp-tls-recovery.md +28 -0
  184. package/docs/context-efficiency.md +100 -0
  185. package/docs/input.md +66 -0
  186. package/docs/languages.md +117 -0
  187. package/docs/models.md +85 -0
  188. package/docs/modkh-evidence.json +641 -0
  189. package/docs/modkh-failure-comparison.json +675 -0
  190. package/docs/modkh-namespace.md +39 -0
  191. package/docs/modkh-qlot-evidence.json +37 -0
  192. package/docs/modkh-verification.md +173 -0
  193. package/docs/modkh.md +124 -0
  194. package/docs/presets.md +19 -0
  195. package/docs/setup.md +112 -0
  196. package/docs/subagents.md +134 -0
  197. package/docs/web.md +57 -0
  198. package/experiments/presets/common-lisp.lisp +38 -0
  199. package/experiments/presets/css.lisp +38 -0
  200. package/experiments/presets/formal.lisp +7 -0
  201. package/experiments/presets/html.lisp +38 -0
  202. package/experiments/presets/js.lisp +38 -0
  203. package/experiments/presets/php.lisp +38 -0
  204. package/experiments/presets/svelte.lisp +38 -0
  205. package/experiments/presets/tailwindcss.lisp +24 -0
  206. package/experiments/presets/ts.lisp +38 -0
  207. package/package.json +49 -4
  208. package/plugins/modkh-explorer/index.mjs +3 -0
  209. package/plugins/modkh-explorer/plugin.json +1 -0
  210. package/plugins/modkh-worker/index.mjs +3 -0
  211. package/plugins/modkh-worker/plugin.json +1 -0
  212. package/skills/kiokuko-dsh/LICENSE +21 -0
  213. package/skills/kiokuko-dsh/coding-ideal-routine-skill/SKILL.md +106 -0
  214. package/skills/kiokuko-dsh/japanese-translation-for-oss-models/SKILL.md +65 -0
  215. package/skills/kiokuko-dsh/kiokuko-architecture/SKILL.md +20 -0
  216. package/skills/kiokuko-dsh/kiokuko-architecture/references/cases.md +11 -0
  217. package/skills/kiokuko-dsh/kiokuko-benchmark/SKILL.md +20 -0
  218. package/skills/kiokuko-dsh/kiokuko-benchmark/references/cases.md +11 -0
  219. package/skills/kiokuko-dsh/kiokuko-investigate/SKILL.md +20 -0
  220. package/skills/kiokuko-dsh/kiokuko-investigate/references/cases.md +11 -0
  221. package/skills/kiokuko-dsh/kiokuko-lisp/SKILL.md +390 -0
  222. package/skills/kiokuko-dsh/kiokuko-review/SKILL.md +20 -0
  223. package/skills/kiokuko-dsh/kiokuko-review/references/cases.md +11 -0
  224. package/skills/kiokuko-dsh/kiokuko-simple-work/SKILL.md +70 -0
  225. package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/SKILL.md +79 -0
  226. package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/boundaries-and-ownership.md +52 -0
  227. package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/domain-and-types.md +48 -0
  228. package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/effects-and-data.md +43 -0
  229. package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/kiokuko-patterns.md +314 -0
  230. package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/problem-shaping-and-language.md +90 -0
  231. package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/protocols-and-idempotency.md +42 -0
  232. package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/review-checklist.md +92 -0
  233. package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/verification.md +45 -0
  234. package/skills/kiokuko-dsh/kiokuko-skill-authoring/SKILL.md +20 -0
  235. package/skills/kiokuko-dsh/kiokuko-skill-authoring/references/cases.md +11 -0
  236. package/skills/kiokuko-dsh/kiokuko-soul/SKILL.md +25 -0
  237. package/skills/kiokuko-dsh/kiokuko-technical-writing/SKILL.md +20 -0
  238. package/skills/kiokuko-dsh/kiokuko-technical-writing/references/cases.md +11 -0
  239. package/skills/kiokuko-dsh/kiokuko-ui-design-soul/SKILL.md +64 -0
  240. package/skills/kiokuko-dsh/kiokuko-ui-design-soul/references/accessibility-and-navigation.md +31 -0
  241. package/skills/kiokuko-dsh/kiokuko-ui-design-soul/references/async-recovery.md +49 -0
  242. package/skills/kiokuko-dsh/kiokuko-ui-design-soul/references/forms-and-controls.md +35 -0
  243. package/skills/kiokuko-dsh/kiokuko-ui-design-soul/references/interaction-feedback.md +34 -0
  244. package/skills/kiokuko-dsh/kiokuko-ui-design-soul/references/responsive-and-platform.md +38 -0
  245. package/skills/kiokuko-dsh/kiokuko-ui-design-soul/references/safety-and-review.md +43 -0
  246. package/skills/kiokuko-dsh/kiokuko-ui-design-soul/references/ui-checklist.md +75 -0
  247. package/skills/kiokuko-dsh/kiokuko-verification/SKILL.md +20 -0
  248. package/skills/kiokuko-dsh/kiokuko-verification/references/cases.md +11 -0
  249. package/skills/kiokuko-dsh/manifest.json +168 -0
  250. package/skills/kiokuko-dsh/memory-reasoning/SKILL.md +44 -0
  251. package/skills/kiokuko-dsh/one-shot-software-completion/SKILL.md +113 -0
  252. package/skills/kiokuko-dsh/one-shot-software-completion/references/boundaries-and-lifecycle.md +70 -0
  253. package/skills/kiokuko-dsh/one-shot-software-completion/references/discovery-and-scope.md +71 -0
  254. package/skills/kiokuko-dsh/one-shot-software-completion/references/failure-recovery.md +43 -0
  255. package/skills/kiokuko-dsh/one-shot-software-completion/references/verification-and-completion.md +73 -0
  256. package/skills/kiokuko-dsh/veteran-programmer-skill/SKILL.md +66 -0
@@ -0,0 +1,82 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import { configDir } from "./config.js";
4
+ const PROVIDER_PATTERN = /^[a-z][a-z0-9-]{0,63}$/;
5
+ const MAX_KEY_LENGTH = 4096;
6
+ export function keysPath() {
7
+ return path.join(configDir(), 'keys.json');
8
+ }
9
+ /** Values are opaque; only format problems are rejected. Unknown providers are not accepted. */
10
+ function normalizeProvider(provider) {
11
+ const name = provider.trim().toLowerCase();
12
+ if (!PROVIDER_PATTERN.test(name))
13
+ throw new Error(`プロバイダー名が不正です: ${provider}`);
14
+ return name;
15
+ }
16
+ function normalizeKey(key) {
17
+ const trimmed = key.trim();
18
+ if (trimmed.length === 0)
19
+ throw new Error('APIキーが空です');
20
+ if (trimmed.length > MAX_KEY_LENGTH)
21
+ throw new Error('APIキーが長すぎます');
22
+ if (/[\r\n\0]/.test(trimmed))
23
+ throw new Error('APIキーに改行や制御文字は使えません');
24
+ return trimmed;
25
+ }
26
+ /** A malformed or unreadable file is treated as empty rather than granting a partial identity. */
27
+ export function loadSavedKeys() {
28
+ try {
29
+ const parsed = JSON.parse(fs.readFileSync(keysPath(), 'utf8'));
30
+ if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed))
31
+ return {};
32
+ const keys = {};
33
+ for (const [provider, value] of Object.entries(parsed)) {
34
+ if (!PROVIDER_PATTERN.test(provider) || typeof value !== 'string')
35
+ continue;
36
+ const key = value.trim();
37
+ if (key.length === 0 || key.length > MAX_KEY_LENGTH)
38
+ continue;
39
+ keys[provider] = key;
40
+ }
41
+ return keys;
42
+ }
43
+ catch {
44
+ return {};
45
+ }
46
+ }
47
+ function writeKeys(keys) {
48
+ fs.mkdirSync(configDir(), { recursive: true });
49
+ const target = keysPath();
50
+ const temporary = `${target}.${process.pid}.tmp`;
51
+ // Create with 0600 from the start so the secret is never briefly world-readable.
52
+ fs.writeFileSync(temporary, `${JSON.stringify(keys, null, 2)}\n`, { encoding: 'utf8', mode: 0o600 });
53
+ fs.renameSync(temporary, target);
54
+ fs.chmodSync(target, 0o600);
55
+ }
56
+ export function saveKey(provider, key) {
57
+ const name = normalizeProvider(provider), value = normalizeKey(key);
58
+ const keys = loadSavedKeys();
59
+ keys[name] = value;
60
+ writeKeys(keys);
61
+ return { provider: name, path: keysPath() };
62
+ }
63
+ export function removeKey(provider) {
64
+ const name = normalizeProvider(provider);
65
+ const keys = loadSavedKeys();
66
+ if (!(name in keys))
67
+ return false;
68
+ delete keys[name];
69
+ writeKeys(keys);
70
+ return true;
71
+ }
72
+ /** Names only; callers must never print the secret itself. */
73
+ export function savedKeyProviders() {
74
+ return Object.keys(loadSavedKeys()).sort();
75
+ }
76
+ /** Environment first, then the saved key. An empty environment value is ignored. */
77
+ export function resolveApiKey(provider, env = process.env, envName) {
78
+ const fromEnv = envName ? env[envName]?.trim() : undefined;
79
+ if (fromEnv)
80
+ return fromEnv;
81
+ return loadSavedKeys()[normalizeProvider(provider)];
82
+ }
@@ -0,0 +1 @@
1
+ export declare function runLanguageCommand(positional: string, cwd?: string): Promise<void>;
@@ -0,0 +1,105 @@
1
+ import { LANGUAGES, languageById } from "../language/catalog.js";
2
+ import { clearFailure, ensureInstalled, resolveServer, statusReport } from "../language/install.js";
3
+ import { detectedLanguages, parseLanguageSettings } from "../language/detect.js";
4
+ import { availableGrammars, missingGrammars } from "../language/syntax/assets.js";
5
+ import { verifyGrammar } from "../language/syntax/parser.js";
6
+ import { loadConfig } from "./config.js";
7
+ const USAGE = `使い方:
8
+ modkh language status 検出・導入状態と文法を表示
9
+ modkh language install [--detected] 検出した言語(またはすべて)のサーバーを導入
10
+ modkh language retry <id> 失敗記録を消して再試行
11
+ modkh language update 既存の導入を検証し直す
12
+ `;
13
+ export async function runLanguageCommand(positional, cwd = process.cwd()) {
14
+ const [action, ...rest] = positional.trim().split(/\s+/).filter(Boolean);
15
+ const settings = parseLanguageSettings(loadConfig().language);
16
+ if (!action || action === 'status')
17
+ return status(cwd, settings);
18
+ if (action === 'install')
19
+ return install(cwd, settings, rest.includes('--detected'));
20
+ if (action === 'retry') {
21
+ const id = rest[0];
22
+ if (!id || !languageById(id)) {
23
+ process.stderr.write(`言語IDが必要です。対象: ${LANGUAGES.map(l => l.id).join(', ')}\n`);
24
+ process.exit(1);
25
+ }
26
+ clearFailure(id);
27
+ process.stdout.write(`${id} の失敗記録を消しました。次の利用で再試行します。\n`);
28
+ return;
29
+ }
30
+ if (action === 'update')
31
+ return update(settings);
32
+ process.stderr.write(USAGE);
33
+ process.exit(1);
34
+ }
35
+ async function status(cwd, settings) {
36
+ const detected = new Set(detectedLanguages(cwd).map(language => language.id));
37
+ const grammarSet = new Set(availableGrammars());
38
+ const installed = new Map(statusReport().map(entry => [entry.id, entry]));
39
+ process.stdout.write('ID 検出 サーバー 文法 状態\n');
40
+ for (const language of LANGUAGES) {
41
+ const resolved = resolveServer(language, { disabled: settings.disabled.includes(language.id) });
42
+ const grammar = language.grammar ? (grammarSet.has(language.grammar) ? '同梱' : 'なし') : '—';
43
+ const entry = installed.get(language.id);
44
+ const detail = resolved.status === 'ready'
45
+ ? `${entry?.version ?? '導入済み'}${settings.servers[language.id] ? '(設定)' : ''}`
46
+ : resolved.detail ?? '未導入';
47
+ process.stdout.write(`${language.id.padEnd(13)} ${(detected.has(language.id) ? 'yes' : '-').padEnd(4)} `
48
+ + `${resolved.status.padEnd(14)} ${grammar.padEnd(8)} ${detail}\n`);
49
+ }
50
+ const missing = missingGrammars(LANGUAGES.map(language => language.grammar).filter((g) => Boolean(g)));
51
+ if (missing.length)
52
+ process.stdout.write(`\n文法WASM未収録(その言語は構文解析を縮退): ${missing.join(', ')}\n`);
53
+ if (!settings.autoInstall)
54
+ process.stdout.write('\n自動導入は無効(config.json の language.autoInstall)。\n');
55
+ }
56
+ async function install(cwd, settings, detectedOnly) {
57
+ const targets = detectedOnly ? detectedLanguages(cwd) : LANGUAGES;
58
+ if (targets.length === 0) {
59
+ process.stdout.write('対象言語を検出できませんでした。\n');
60
+ return;
61
+ }
62
+ let failures = 0;
63
+ for (const language of targets) {
64
+ const before = resolveServer(language, { disabled: settings.disabled.includes(language.id) });
65
+ if (before.status === 'ready') {
66
+ process.stdout.write(`${language.id}: 導入済み\n`);
67
+ continue;
68
+ }
69
+ if (before.status === 'disabled') {
70
+ process.stdout.write(`${language.id}: 無効\n`);
71
+ continue;
72
+ }
73
+ process.stdout.write(`${language.id}: 導入中…\n`);
74
+ const outcome = await ensureInstalled(language, {
75
+ autoInstall: settings.autoInstall,
76
+ ...(settings.servers[language.id] ? { server: settings.servers[language.id] } : {}),
77
+ });
78
+ process.stdout.write(`${language.id}: ${outcome.status === 'ready' ? '完了' : `未導入 — ${outcome.detail ?? ''}`}\n`);
79
+ if (outcome.status !== 'ready')
80
+ failures++;
81
+ }
82
+ if (failures)
83
+ process.exitCode = 1;
84
+ }
85
+ async function update(settings) {
86
+ const report = statusReport();
87
+ if (report.length === 0) {
88
+ process.stdout.write('管理下のサーバーはありません。\n');
89
+ return;
90
+ }
91
+ for (const entry of report) {
92
+ const language = languageById(entry.id);
93
+ if (!language)
94
+ continue;
95
+ const resolved = resolveServer(language, {});
96
+ if (resolved.status !== 'ready') {
97
+ process.stdout.write(`${entry.id}: 見つかりません(retry で再導入)\n`);
98
+ continue;
99
+ }
100
+ const grammar = language.grammar;
101
+ const grammarCheck = grammar ? await verifyGrammar(grammar) : { ok: true };
102
+ process.stdout.write(`${entry.id}: サーバー ${resolved.installed ? '確認済み' : '設定済み'}`
103
+ + `${grammar ? ` / 文法 ${grammarCheck.ok ? 'ロード成功' : `失敗 — ${'detail' in grammarCheck ? grammarCheck.detail : ''}`}` : ''}\n`);
104
+ }
105
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Per-turn tool round-trip limit.
3
+ *
4
+ * This is a safety valve against a model that loops forever, not a work budget. Long tasks
5
+ * legitimately need hundreds of round trips, so the default sits well above ordinary work and
6
+ * the configured value can be raised up to hard ceiling that still bounds a runaway loop.
7
+ */
8
+ import { DEFAULT_MAX_TURNS } from '../agent/loop.ts';
9
+ export { DEFAULT_MAX_TURNS };
10
+ /** Highest accepted value. Beyond this a single unattended turn could run for hours. */
11
+ export declare const MAX_TURNS_CEILING = 10000;
12
+ /** Positive integers only; strings of digits are accepted because config files are hand-edited. */
13
+ export declare function parseMaxTurns(value: unknown): number | null;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Per-turn tool round-trip limit.
3
+ *
4
+ * This is a safety valve against a model that loops forever, not a work budget. Long tasks
5
+ * legitimately need hundreds of round trips, so the default sits well above ordinary work and
6
+ * the configured value can be raised up to hard ceiling that still bounds a runaway loop.
7
+ */
8
+ import { DEFAULT_MAX_TURNS } from "../agent/loop.js";
9
+ export { DEFAULT_MAX_TURNS };
10
+ /** Highest accepted value. Beyond this a single unattended turn could run for hours. */
11
+ export const MAX_TURNS_CEILING = 10_000;
12
+ /** Positive integers only; strings of digits are accepted because config files are hand-edited. */
13
+ export function parseMaxTurns(value) {
14
+ const numeric = typeof value === 'string' && /^\d+$/.test(value.trim()) ? Number(value.trim())
15
+ : typeof value === 'number' ? value : Number.NaN;
16
+ if (!Number.isSafeInteger(numeric) || numeric < 1 || numeric > MAX_TURNS_CEILING)
17
+ return null;
18
+ return numeric;
19
+ }
@@ -0,0 +1,18 @@
1
+ /** stdin から1行ずつ取得する。ターン実行中に届いた行も失わない。 */
2
+ export declare class LineSource {
3
+ private buffer;
4
+ private queue;
5
+ private closed;
6
+ private waiters;
7
+ private readonly stdin;
8
+ constructor(stdin?: NodeJS.ReadableStream);
9
+ private onData;
10
+ private onEnd;
11
+ private onError;
12
+ /** メニュー中のコマンドを通常入力へ戻す。 */
13
+ unread(line: string): void;
14
+ /** 次の1行。入力終端なら null。 */
15
+ next(signal?: AbortSignal): Promise<string | null>;
16
+ close(): void;
17
+ private wake;
18
+ }
@@ -0,0 +1,80 @@
1
+ /** stdin から1行ずつ取得する。ターン実行中に届いた行も失わない。 */
2
+ export class LineSource {
3
+ buffer = '';
4
+ queue = [];
5
+ closed = false;
6
+ waiters = [];
7
+ stdin;
8
+ constructor(stdin) {
9
+ this.stdin = stdin ?? process.stdin;
10
+ this.stdin.setEncoding?.('utf8');
11
+ this.stdin.on('data', this.onData);
12
+ this.stdin.on('end', this.onEnd);
13
+ this.stdin.on('error', this.onError);
14
+ }
15
+ onData = (chunk) => {
16
+ this.buffer += chunk;
17
+ let at = this.buffer.indexOf('\n');
18
+ while (at >= 0) {
19
+ this.queue.push(this.buffer.slice(0, at).replace(/\r$/, ''));
20
+ this.buffer = this.buffer.slice(at + 1);
21
+ at = this.buffer.indexOf('\n');
22
+ }
23
+ this.wake();
24
+ };
25
+ onEnd = () => {
26
+ if (this.buffer.length > 0) {
27
+ this.queue.push(this.buffer.replace(/\r$/, ''));
28
+ this.buffer = '';
29
+ }
30
+ this.closed = true;
31
+ this.wake();
32
+ };
33
+ onError = () => { this.closed = true; this.wake(); };
34
+ /** メニュー中のコマンドを通常入力へ戻す。 */
35
+ unread(line) { this.queue.unshift(line); }
36
+ /** 次の1行。入力終端なら null。 */
37
+ next(signal) {
38
+ // Stop must not consume a queued instruction belonging to the next turn.
39
+ if (signal?.aborted)
40
+ return Promise.resolve(null);
41
+ const line = this.queue.shift();
42
+ if (line !== undefined)
43
+ return Promise.resolve(line);
44
+ if (this.closed)
45
+ return Promise.resolve(null);
46
+ return new Promise((resolve) => {
47
+ const finish = (value) => {
48
+ signal?.removeEventListener('abort', onAbort);
49
+ this.waiters = this.waiters.filter((waiter) => waiter !== finish);
50
+ resolve(value);
51
+ };
52
+ const onAbort = () => finish(null);
53
+ this.waiters.push(finish);
54
+ signal?.addEventListener('abort', onAbort, { once: true });
55
+ });
56
+ }
57
+ close() {
58
+ this.closed = true;
59
+ this.stdin.removeListener('data', this.onData);
60
+ this.stdin.removeListener('end', this.onEnd);
61
+ this.stdin.removeListener('error', this.onError);
62
+ this.stdin.pause();
63
+ const waiters = this.waiters;
64
+ this.waiters = [];
65
+ for (const waiter of waiters)
66
+ waiter(null);
67
+ }
68
+ wake() {
69
+ while (this.queue.length > 0 && this.waiters.length > 0) {
70
+ const w = this.waiters.shift();
71
+ w?.(this.queue.shift() ?? null);
72
+ }
73
+ if (this.closed && this.queue.length === 0) {
74
+ const ws = this.waiters;
75
+ this.waiters = [];
76
+ for (const w of ws)
77
+ w(null);
78
+ }
79
+ }
80
+ }
@@ -0,0 +1,4 @@
1
+ import type { ChatTerminal } from './terminal.ts';
2
+ /** 接続保証ではなく選択用の候補。一覧外は /connect で直接指定できる。 */
3
+ export declare const MODEL_SUGGESTIONS: readonly string[];
4
+ export declare function selectModel(lines: ChatTerminal, query: string, current: string | null): Promise<string | null>;
@@ -0,0 +1,69 @@
1
+ import { allSuggestions, suggestionsFor, noteFor, isRecommended, SEARCH_ROW_VALUE } from "./catalog.js";
2
+ /** 接続保証ではなく選択用の候補。一覧外は /connect で直接指定できる。 */
3
+ export const MODEL_SUGGESTIONS = allSuggestions();
4
+ function entries(refs, current) {
5
+ return refs.map(ref => {
6
+ const detail = [
7
+ isRecommended(ref) ? 'おすすめ' : '',
8
+ ref === current ? '選択中' : '',
9
+ noteFor(ref) ?? '',
10
+ ].filter(Boolean).join(' · ');
11
+ return { value: ref, label: ref, ...(detail ? { detail } : {}) };
12
+ });
13
+ }
14
+ export async function selectModel(lines, query, current) {
15
+ const candidates = [...new Set([...MODEL_SUGGESTIONS, ...(current ? [current] : [])])];
16
+ // The search row is pinned first in both modes so Enter never connects to an arbitrary model.
17
+ const searchRow = { value: SEARCH_ROW_VALUE, label: '🔍 キーワード検索', pinned: true };
18
+ if (lines.interactive) {
19
+ const provider = query.trim().split(/\s+/)[0];
20
+ const providerList = provider && !provider.includes('/') && /^[a-z][a-z0-9-]*$/.test(provider)
21
+ ? suggestionsFor(provider, current) : [];
22
+ const ordered = [...new Set([...providerList, ...candidates])];
23
+ let keyword = query;
24
+ for (;;) {
25
+ const selected = await lines.choose('モデル候補 — 利用可否はアカウントによります', [searchRow, ...entries(ordered, current)], keyword);
26
+ if (selected !== SEARCH_ROW_VALUE)
27
+ return selected;
28
+ const answer = (await lines.ask('キーワード検索(空白区切りは語順自由。例: seek deep / 空行・/cancelで戻る)'))?.trim();
29
+ if (!answer || answer === '/cancel') {
30
+ keyword = '';
31
+ continue;
32
+ }
33
+ if (answer.startsWith('/')) {
34
+ lines.unread(answer);
35
+ return null;
36
+ }
37
+ keyword = answer;
38
+ }
39
+ }
40
+ let filter = query;
41
+ for (;;) {
42
+ const terms = filter.toLowerCase().trim().split(/\s+/).filter(Boolean);
43
+ const matches = candidates.filter((ref) => terms.every((term) => ref.toLowerCase().includes(term)));
44
+ lines.write('モデル候補 (利用可否は接続先・アカウントによります):\n');
45
+ matches.forEach((ref, i) => {
46
+ const note = [isRecommended(ref) ? 'おすすめ' : '', noteFor(ref) ?? ''].filter(Boolean).join(' · ');
47
+ lines.write(`${i + 1}. ${ref}${note ? ` ${note}` : ''}${ref === current ? ' (選択中)' : ''}\n`);
48
+ });
49
+ if (matches.length === 0)
50
+ lines.write('該当するモデルはありません。\n');
51
+ lines.write('番号で選択 / 文字列で再検索(語順自由: seek deep)/ * で全件 / 空行・/cancel で戻る\n一覧外: /connect <provider>/<model> [--base-url <url>]\n');
52
+ const answer = (await lines.next())?.trim();
53
+ if (!answer || answer === '/cancel')
54
+ return null;
55
+ if (answer.startsWith('/')) {
56
+ lines.unread(answer);
57
+ return null;
58
+ }
59
+ if (/^\d+$/.test(answer)) {
60
+ const selected = matches[Number(answer) - 1];
61
+ if (selected)
62
+ return selected;
63
+ lines.write('番号が範囲外です。\n');
64
+ }
65
+ else {
66
+ filter = answer === '*' ? '' : answer;
67
+ }
68
+ }
69
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Approval policy for effectful tools.
3
+ *
4
+ * This decides when MODKH asks the human; it is not an OS sandbox. `all` and `workspace` still run
5
+ * commands with the user's own privileges, so the distinction is about prompting, not isolation.
6
+ */
7
+ export type PermissionPolicy = 'all' | 'workspace' | 'none';
8
+ /** Widest first, so the list reads as a scale. */
9
+ export declare const POLICY_LEVELS: readonly PermissionPolicy[];
10
+ /** The default keeps the old behaviour for reads/edits inside the workspace but stops prompting
11
+ * on every ordinary command, which is what made routine work tedious. */
12
+ export declare const DEFAULT_POLICY: PermissionPolicy;
13
+ export declare function parsePermissionPolicy(value: string): PermissionPolicy | null;
14
+ export interface ApprovalDecisionInput {
15
+ policy: PermissionPolicy;
16
+ kind: 'edit' | 'command';
17
+ /** True only when the resolved target is proven outside the working root. */
18
+ outsideWorkspace: boolean;
19
+ }
20
+ /**
21
+ * `workspace` never asks for effects inside the root; it still asks for anything that escaped it.
22
+ * A caller that cannot prove the target is inside must pass outsideWorkspace: true.
23
+ */
24
+ export declare function shouldAsk(input: ApprovalDecisionInput): boolean;
25
+ export declare function describePolicy(policy: PermissionPolicy): string;
@@ -0,0 +1,30 @@
1
+ /** Widest first, so the list reads as a scale. */
2
+ export const POLICY_LEVELS = ['all', 'workspace', 'none'];
3
+ /** The default keeps the old behaviour for reads/edits inside the workspace but stops prompting
4
+ * on every ordinary command, which is what made routine work tedious. */
5
+ export const DEFAULT_POLICY = 'workspace';
6
+ export function parsePermissionPolicy(value) {
7
+ const normalized = value.trim().toLowerCase();
8
+ return POLICY_LEVELS.includes(normalized) ? normalized : null;
9
+ }
10
+ /**
11
+ * `workspace` never asks for effects inside the root; it still asks for anything that escaped it.
12
+ * A caller that cannot prove the target is inside must pass outsideWorkspace: true.
13
+ */
14
+ export function shouldAsk(input) {
15
+ if (input.policy === 'all')
16
+ return false;
17
+ if (input.policy === 'none')
18
+ return true;
19
+ return input.outsideWorkspace;
20
+ }
21
+ export function describePolicy(policy) {
22
+ switch (policy) {
23
+ case 'all':
24
+ return 'all — 承認を求めず自動実行する(ワークスペース外も含む)';
25
+ case 'workspace':
26
+ return 'workspace — ワークスペース内は自動、外に出る操作だけ確認する';
27
+ case 'none':
28
+ return 'none — 読み取り以外は毎回確認する';
29
+ }
30
+ }
@@ -0,0 +1 @@
1
+ export declare function runPluginCommand(positional: string): Promise<void>;
@@ -0,0 +1,53 @@
1
+ import path from 'node:path';
2
+ import { PluginManager } from "../plugins/manager.js";
3
+ import { createTerminal } from "./terminal.js";
4
+ export async function runPluginCommand(positional) {
5
+ const manager = new PluginManager();
6
+ const split = positional.indexOf(' ');
7
+ const action = split < 0 ? positional : positional.slice(0, split);
8
+ const target = split < 0 ? '' : positional.slice(split + 1);
9
+ if (action === 'list' && !target) {
10
+ const { registry, diagnostics } = manager.discover();
11
+ for (const diagnostic of diagnostics)
12
+ process.stderr.write(`${diagnostic}\n`);
13
+ for (const row of registry.list())
14
+ process.stdout.write(`${row.id} ${row.enabled ? 'enabled' : 'disabled'} ${row.kind} ${row.version} ${row.digest}\n`);
15
+ if (!registry.list().length)
16
+ process.stdout.write('利用可能なプラグインはありません。\n');
17
+ return;
18
+ }
19
+ if (action === 'add' && target) {
20
+ const directory = path.resolve(target);
21
+ const preview = manager.preview(directory);
22
+ const ui = createTerminal(process.cwd());
23
+ const ac = new AbortController();
24
+ const stop = () => ac.abort();
25
+ process.on('SIGINT', stop);
26
+ try {
27
+ ui.write(`任意のNode.jsコードを実行するプラグインです。OSサンドボックスではありません。\n${preview.manifest.id} ${preview.manifest.version}\n${directory}\nSHA256: ${preview.digest}\n`);
28
+ const answer = await ui.ask('この内容を信頼して登録しますか? [y/N]', ac.signal);
29
+ if (ac.signal.aborted || answer?.trim().toLowerCase() !== 'y') {
30
+ ui.write('登録しませんでした。\n');
31
+ return;
32
+ }
33
+ const installed = manager.install(directory, preview.digest);
34
+ ui.write(`登録しました: ${installed.id}\n`);
35
+ }
36
+ finally {
37
+ process.removeListener('SIGINT', stop);
38
+ ui.close();
39
+ }
40
+ return;
41
+ }
42
+ if ((action === 'enable' || action === 'disable') && target) {
43
+ manager.setEnabled(target, action === 'enable');
44
+ process.stdout.write(`${target}: ${action} (新規の子の起動に反映。実行中の子は維持)\n`);
45
+ return;
46
+ }
47
+ if (action === 'remove' && target) {
48
+ manager.remove(target);
49
+ process.stdout.write(`登録を解除しました: ${target}。監査用パッケージと履歴は保持します。\n`);
50
+ return;
51
+ }
52
+ throw new Error('使い方: modkh plugin list | add <directory> | enable <id> | disable <id> | remove <id>');
53
+ }
@@ -0,0 +1,46 @@
1
+ import type { ChatTerminal } from './terminal.ts';
2
+ export declare const CONNECT_PROVIDERS: readonly [{
3
+ readonly value: "openai";
4
+ readonly label: "OpenAI";
5
+ readonly detail: "ChatGPT OAuth (chatgpt) / OPENAI_API_KEY";
6
+ readonly key: "OPENAI_API_KEY";
7
+ }, {
8
+ readonly value: "opencode";
9
+ readonly label: "OpenCode";
10
+ readonly detail: "Console · OPENCODE_API_KEY";
11
+ readonly key: "OPENCODE_API_KEY";
12
+ }, {
13
+ readonly value: "ollama";
14
+ readonly label: "Ollama Local";
15
+ readonly detail: "ローカル · OLLAMA_BASE_URL";
16
+ readonly key: null;
17
+ }, {
18
+ readonly value: "ollama-cloud";
19
+ readonly label: "Ollama Cloud";
20
+ readonly detail: "ollama.com · OLLAMA_API_KEY";
21
+ readonly key: "OLLAMA_API_KEY";
22
+ }, {
23
+ readonly value: "openrouter";
24
+ readonly label: "OpenRouter";
25
+ readonly detail: "OPENROUTER_API_KEY";
26
+ readonly key: "OPENROUTER_API_KEY";
27
+ }, {
28
+ readonly value: "infron";
29
+ readonly label: "Infron";
30
+ readonly detail: "INFRON_API_KEY";
31
+ readonly key: "INFRON_API_KEY";
32
+ }, {
33
+ readonly value: "hermes";
34
+ readonly label: "Hermes Agent";
35
+ readonly detail: "API server · HERMES_API_KEY";
36
+ readonly key: "HERMES_API_KEY";
37
+ }, {
38
+ readonly value: "brave-search";
39
+ readonly label: "Brave Search";
40
+ readonly detail: "web_search 用のキー · BRAVE_SEARCH_API_KEY";
41
+ readonly key: "BRAVE_SEARCH_API_KEY";
42
+ readonly keyOnly: true;
43
+ }];
44
+ export declare function chooseProvider(ui: ChatTerminal, current: string | null): Promise<string | null>;
45
+ export declare function confirmRemoteAgent(ui: ChatTerminal): Promise<boolean>;
46
+ export declare function chooseProviderModel(ui: ChatTerminal, provider: string): Promise<string | null>;
@@ -0,0 +1,76 @@
1
+ import { suggestionsFor, noteFor, isRecommended, SEARCH_ROW_VALUE } from "./catalog.js";
2
+ export const CONNECT_PROVIDERS = [
3
+ { value: 'openai', label: 'OpenAI', detail: 'ChatGPT OAuth (chatgpt) / OPENAI_API_KEY', key: 'OPENAI_API_KEY' },
4
+ { value: 'opencode', label: 'OpenCode', detail: 'Console · OPENCODE_API_KEY', key: 'OPENCODE_API_KEY' },
5
+ { value: 'ollama', label: 'Ollama Local', detail: 'ローカル · OLLAMA_BASE_URL', key: null },
6
+ { value: 'ollama-cloud', label: 'Ollama Cloud', detail: 'ollama.com · OLLAMA_API_KEY', key: 'OLLAMA_API_KEY' },
7
+ { value: 'openrouter', label: 'OpenRouter', detail: 'OPENROUTER_API_KEY', key: 'OPENROUTER_API_KEY' },
8
+ { value: 'infron', label: 'Infron', detail: 'INFRON_API_KEY', key: 'INFRON_API_KEY' },
9
+ { value: 'hermes', label: 'Hermes Agent', detail: 'API server · HERMES_API_KEY', key: 'HERMES_API_KEY' },
10
+ // Web検索のキー登録専用。モデル接続の一覧には含めない。
11
+ { value: 'brave-search', label: 'Brave Search', detail: 'web_search 用のキー · BRAVE_SEARCH_API_KEY', key: 'BRAVE_SEARCH_API_KEY', keyOnly: true },
12
+ ];
13
+ export async function chooseProvider(ui, current) {
14
+ ui.write(current ? `接続中: ${current}\n` : '未接続です。\n');
15
+ return ui.choose('Connect an integration — 認証先', CONNECT_PROVIDERS.filter(p => !('keyOnly' in p)).map(p => ({ ...p,
16
+ detail: `${current?.startsWith(`${p.value}/`) || p.value === 'openai' && current?.startsWith('chatgpt/') ? '選択中 · ' : ''}${p.detail}`,
17
+ })));
18
+ }
19
+ export async function confirmRemoteAgent(ui) {
20
+ return await ui.choose('Hermes側でツール実行 — MODKHの承認・Stopの保証対象外', [
21
+ { value: 'back', label: '戻る' },
22
+ { value: 'connect', label: 'Hermes Agent に接続', detail: 'サーバー側の権限・設定を使用' },
23
+ ]) === 'connect';
24
+ }
25
+ export async function chooseProviderModel(ui, provider) {
26
+ const choices = suggestionsFor(provider).map(ref => {
27
+ const note = noteFor(ref);
28
+ const detail = [isRecommended(ref) ? 'おすすめ' : '', note ?? ''].filter(Boolean).join(' · ');
29
+ return { value: ref, label: ref, ...(detail ? { detail } : {}) };
30
+ });
31
+ choices.push({ value: 'custom', label: 'モデルIDを直接入力', detail: '一覧にないモデル' });
32
+ for (;;) {
33
+ // The search row is pinned first so a bare Enter never connects to an arbitrary model.
34
+ const selected = await ui.choose(`${provider} — モデルを選択`, [
35
+ { value: SEARCH_ROW_VALUE, label: '🔍 キーワード検索', pinned: true },
36
+ ...choices,
37
+ ]);
38
+ if (selected !== SEARCH_ROW_VALUE) {
39
+ if (selected !== 'custom')
40
+ return selected;
41
+ const model = (await ui.ask('モデルID(空行・/cancelで戻る)'))?.trim();
42
+ if (!model || model === '/cancel')
43
+ return null;
44
+ if (model.startsWith('/')) {
45
+ ui.unread(model);
46
+ return null;
47
+ }
48
+ return model.startsWith(`${provider}/`) ? model : `${provider}/${model}`;
49
+ }
50
+ // Choosing the row with a keyword already typed just reopens the same filtered list; an empty
51
+ // box asks for the keyword explicitly so the row is never a dead end.
52
+ const keyword = (await ui.ask('キーワード検索(空白区切りは語順自由。例: seek deep / 空行・/cancelで戻る)'))?.trim();
53
+ if (!keyword || keyword === '/cancel')
54
+ continue;
55
+ if (keyword.startsWith('/')) {
56
+ ui.unread(keyword);
57
+ return null;
58
+ }
59
+ const reopened = await ui.choose(`${provider} — モデルを選択`, [
60
+ { value: SEARCH_ROW_VALUE, label: '🔍 キーワード検索', pinned: true },
61
+ ...choices,
62
+ ], keyword);
63
+ if (reopened === SEARCH_ROW_VALUE)
64
+ continue;
65
+ if (reopened !== 'custom')
66
+ return reopened;
67
+ const model = (await ui.ask('モデルID(空行・/cancelで戻る)'))?.trim();
68
+ if (!model || model === '/cancel')
69
+ return null;
70
+ if (model.startsWith('/')) {
71
+ ui.unread(model);
72
+ return null;
73
+ }
74
+ return model.startsWith(`${provider}/`) ? model : `${provider}/${model}`;
75
+ }
76
+ }