@kvman/kvcoder 0.1.1 → 0.1.2

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 (42) hide show
  1. package/dist/api.d.ts +34 -0
  2. package/dist/api.d.ts.map +1 -1
  3. package/dist/connectors/delegate.d.ts.map +1 -1
  4. package/dist/connectors/delegate.js +1 -0
  5. package/dist/connectors/delegate.js.map +1 -1
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +4 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/prompt/session-prompt.d.ts +1 -1
  10. package/dist/prompt/session-prompt.d.ts.map +1 -1
  11. package/dist/prompt/session-prompt.js +17 -2
  12. package/dist/prompt/session-prompt.js.map +1 -1
  13. package/dist/registry/register-connectors.d.ts +1 -0
  14. package/dist/registry/register-connectors.d.ts.map +1 -1
  15. package/dist/registry/register-connectors.js +32 -4
  16. package/dist/registry/register-connectors.js.map +1 -1
  17. package/dist/registry/register-slash-commands.d.ts +6 -0
  18. package/dist/registry/register-slash-commands.d.ts.map +1 -0
  19. package/dist/registry/register-slash-commands.js +85 -0
  20. package/dist/registry/register-slash-commands.js.map +1 -0
  21. package/dist/schemas/records.d.ts +1 -0
  22. package/dist/schemas/records.d.ts.map +1 -1
  23. package/dist/schemas/records.js +2 -0
  24. package/dist/schemas/records.js.map +1 -1
  25. package/dist/schemas/registry.d.ts +32 -0
  26. package/dist/schemas/registry.d.ts.map +1 -1
  27. package/dist/schemas/registry.js +9 -2
  28. package/dist/schemas/registry.js.map +1 -1
  29. package/dist/sessions/new-session.d.ts.map +1 -1
  30. package/dist/sessions/new-session.js +1 -0
  31. package/dist/sessions/new-session.js.map +1 -1
  32. package/dist/store/collections.d.ts +18 -0
  33. package/dist/store/collections.d.ts.map +1 -1
  34. package/dist/store/collections.js +5 -2
  35. package/dist/store/collections.js.map +1 -1
  36. package/dist/turns/start-turn.d.ts +1 -0
  37. package/dist/turns/start-turn.d.ts.map +1 -1
  38. package/dist/web/components/conversation.js +217 -168
  39. package/docs/connectors.md +21 -1
  40. package/locales/ar.json +4 -0
  41. package/locales/en.json +4 -0
  42. package/package.json +3 -3
@@ -68,6 +68,26 @@ The agent calls a binary connector with two commands. `exec { args?, background?
68
68
 
69
69
  `kvcoder.connector.unregister { name }` removes one of the caller's own connectors; a missing name does nothing. `kvcoder.connector.list` answers every registered connector and program, each with `enabled`. The setting `kvcoder.connectors.disabled` lists the names that are turned off, kvcoder's own seven included: such a connector is left out of the prompt and can't be called, from the next step.
70
70
 
71
+ ## A connector that is off until enabled
72
+
73
+ Register a connector with `optIn: true`, the only value the field takes, when it belongs only in chats that asked for it.
74
+
75
+ - It is in no chat's connector index and no `run` enum, and a call to it gets the answer for a connector that doesn't exist.
76
+ - Its owner switches it on for one chat: `kvcoder.connector.enable { sessionId, names }`. Each name must be an `optIn` connector of the caller (`VALIDATION_FAILED`); an unknown session fails `kvcoder/SESSION_NOT_FOUND`, and a subagent's `VALIDATION_FAILED`.
77
+ - The chat keeps it across restarts. A subagent has it only when its chat enabled it and its worker lists it. A fork starts with none. Nothing switches one off again, and `kvcoder.connectors.disabled` still turns it off.
78
+ - `kvcoder.connector.list` rows have `optIn`.
79
+
80
+ ## Slash commands
81
+
82
+ `kvcoder.slash.register { commands: [{ name, description, command, message? }] }` adds commands to the send box, after kvcoder's own six.
83
+
84
+ - `name`: lowercase kebab case; kvcoder's own names and another extension's fail `kvcoder/NAME_TAKEN`, and a name given twice `VALIDATION_FAILED`. All of a call's commands are stored, or none.
85
+ - `description` and `message`: translation keys of the caller's catalog.
86
+ - `command`: a public command of the caller (`VALIDATION_FAILED` otherwise). The send box calls it with `{ sessionId, argument }`, where `argument` is the text after the name, `''` when there is none.
87
+ - With `message`, a command that succeeded is followed by the person's message: the argument, or with none the text of `message`. A command that failed shows its Problem and sends nothing.
88
+ - `kvcoder.slash.unregister { name }` removes the caller's own; `kvcoder.slash.list` answers `[{ name, description, command, message?, owner }]`, by name.
89
+ - With no chat open yet, the list is greyed and nothing runs.
90
+
71
91
  ## Built-in connectors
72
92
 
73
93
  kvcoder's own connectors are `shell` (one line in the real shell), `fs` (read, list, search, write, and edit files in the workspace folder), `artifact` (a document shown beside the chat), `background` (follow up on what was started with `background: true`), `ask` (a question that suspends the turn), `delegate` (`delegate run { worker, task, background? }` hands a task to a worker, which runs it in a helper session; the workers are the setting `kvcoder.delegate.workers`, and it is a connector of a session only while a worker is turned on), and `mcp` (the tools of the MCP servers the person added; it is a connector of a session only while the workspace has a server). Their names are taken: registering one fails `kvcoder/NAME_TAKEN`.
@@ -81,6 +101,6 @@ kvcoder's own connectors are `shell` (one line in the real shell), `fs` (read, l
81
101
 
82
102
  ## Lifetime
83
103
 
84
- - Connectors last one run. kvcoder clears them in its own `kernel.started` handler, which runs first because registering extensions declare kvcoder as a dependency. Each extension registers its connectors again from its own `kernel.started` handler. A hot reload of kvcoder reruns its dependents' handlers too.
104
+ - Connectors and slash commands last one run. kvcoder clears them in its own `kernel.started` handler, which runs first because registering extensions declare kvcoder as a dependency. Each extension registers its connectors and slash commands again from its own `kernel.started` handler. A hot reload of kvcoder reruns its dependents' handlers too.
85
105
  - Sections are stored until removed; see [Sections](sections.md).
86
106
  - When kvcoder reads, it ignores any connector whose owner isn't loaded.
package/locales/ar.json CHANGED
@@ -164,6 +164,10 @@
164
164
  "kvcoder.connector.register.description": "يسجّل موصّلًا يستدعيه الوكيل بأداته run: أوامر المستدعي العامة، أو برنامجًا يعمل في الطرفية.",
165
165
  "kvcoder.connector.unregister.description": "يزيل أحد موصّلات المستدعي.",
166
166
  "kvcoder.connector.list.description": "يسرد الموصّلات التي يمكن للوكيل استخدامها.",
167
+ "kvcoder.connector.enable.description": "يشغّل موصّلات المستدعي الاختيارية (optIn) في محادثة واحدة.",
168
+ "kvcoder.slash.register.description": "يسجّل أوامر الشرطة المائلة في مربع الإرسال، وكلٌّ منها يشغّل أحد أوامر المستدعي العامة.",
169
+ "kvcoder.slash.unregister.description": "يزيل أحد أوامر الشرطة المائلة للمستدعي.",
170
+ "kvcoder.slash.list.description": "يسرد أوامر الشرطة المائلة التي أضافتها الإضافات إلى مربع الإرسال.",
167
171
  "kvcoder.section.set.description": "يضبط أحد أقسام المستدعي في تعليمات النظام.",
168
172
  "kvcoder.section.remove.description": "يزيل أحد أقسام المستدعي؛ ولا يفعل شيئًا إن لم يكن القسم موجودًا.",
169
173
  "kvcoder.section.list.description": "يسرد الأقسام التي تدخل في تعليمات محادثة، أو أقسام مساحة العمل عند عدم تحديد محادثة.",
package/locales/en.json CHANGED
@@ -164,6 +164,10 @@
164
164
  "kvcoder.connector.register.description": "Registers a connector the agent calls with its run tool: the caller's public commands, or a program run in the shell.",
165
165
  "kvcoder.connector.unregister.description": "Removes one of the caller's connectors.",
166
166
  "kvcoder.connector.list.description": "Lists the connectors the agent may use.",
167
+ "kvcoder.connector.enable.description": "Switches the caller's own optIn connectors on for one chat.",
168
+ "kvcoder.slash.register.description": "Registers slash commands of the send box, each running one of the caller's public commands.",
169
+ "kvcoder.slash.unregister.description": "Removes one of the caller's slash commands.",
170
+ "kvcoder.slash.list.description": "Lists the slash commands that extensions added to the send box.",
167
171
  "kvcoder.section.set.description": "Sets one of the caller's sections of the system prompt.",
168
172
  "kvcoder.section.remove.description": "Removes one of the caller's sections; a missing one does nothing.",
169
173
  "kvcoder.section.list.description": "Lists the sections a session's prompt reaches, or the workspace's without a session.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kvman/kvcoder",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "kvcoder: the app-building harness, with one run tool over connectors, sections, and its conversation UI.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -43,9 +43,9 @@
43
43
  "vue": "3.5.43"
44
44
  },
45
45
  "devDependencies": {
46
- "@kvman/kvwebui": "0.1.0",
46
+ "@kvman/kvwebui": "0.1.1",
47
47
  "@kvman/sdk": "0.1.0",
48
- "@kvman/testkit": "0.1.1",
48
+ "@kvman/testkit": "0.1.2",
49
49
  "@types/cross-spawn": "6.0.6",
50
50
  "@vitejs/plugin-vue": "6.0.9",
51
51
  "@vue/test-utils": "2.5.1",