dsh-plugin-admin 0.4.3 → 0.5.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.
package/lib/index.js CHANGED
@@ -16,6 +16,10 @@
16
16
  * - unarchive(sessionId) → remove from the registry's archived set
17
17
  * - deleteSession(sessionId) → rm the session log directory, detach workspace
18
18
  * accounting, and clear any archived-set entry
19
+ *
20
+ * 3. Namespace `subagentAdmin` (merged from the former dsh-plugin-subagents
21
+ * plugin — see lib/subagent-admin.js): named delegation-tool instances and
22
+ * their external CLI backends, managed as profile cordis.patch.yml rows.
19
23
  */
20
24
 
21
25
  import { spawn, spawnSync } from 'node:child_process'
@@ -26,9 +30,10 @@ import { basename, dirname, join } from 'node:path'
26
30
  import { homedir } from 'node:os'
27
31
  import { fileURLToPath } from 'node:url'
28
32
  import { setTimeout as sleep } from 'node:timers/promises'
33
+ import { applySubagentAdmin } from './subagent-admin.js'
29
34
 
30
35
  /** Services required before this plugin mounts. */
31
- export const inject = ['typert', 'workspaceRegistry', 'sessionPersistence']
36
+ export const inject = ['typert', 'workspaceRegistry', 'sessionPersistence', 'tools', 'subagents']
32
37
 
33
38
  const PLUGIN_SERVICE_KEY = 'pluginAdmin'
34
39
  const PLUGIN_NAMESPACE = 'pluginAdmin'
@@ -2010,6 +2015,14 @@ export function apply(ctx) {
2010
2015
  Object.defineProperty(mcpService, 'typertRemote', { value: mcpBinding, enumerable: false })
2011
2016
  ctx.provide(MCP_SERVICE_KEY, mcpService)
2012
2017
 
2018
+ /* ---------------------- Subagent Admin (merged) -------------------------- */
2019
+ // Mount the subagentAdmin remote (formerly the standalone dsh-plugin-subagents
2020
+ // plugin). It shares this apply's serial queue: mcpAdmin and subagentAdmin
2021
+ // both read-modify-write the profile's cordis.patch.yml. The typert registry
2022
+ // allows ONE registration per package name, so the subagent invocations ride
2023
+ // the unified descriptor below instead of registering their own.
2024
+ const subagentInvocations = applySubagentAdmin(ctx, enqueue)
2025
+
2013
2026
  /* ---------------------- Typert Descriptors Register ---------------------- */
2014
2027
  const specParam = [{ name: 'spec', wire: 'spec', source: 'json', codec: { mode: 'src-json' } }]
2015
2028
  const nameParam = [{ name: 'name', wire: 'name', source: 'json', codec: { mode: 'src-json' } }]
@@ -2152,6 +2165,8 @@ export function apply(ctx) {
2152
2165
  parameters: [{ name: 'id', wire: 'id', source: 'json', codec: { mode: 'src-json' } }],
2153
2166
  result: { mode: 'src-json' },
2154
2167
  },
2168
+ // subagentAdmin (merged from dsh-plugin-subagents)
2169
+ ...subagentInvocations,
2155
2170
  ],
2156
- }), 'plugin-admin: typert descriptors (plugins, sessions, fs, mcp)')
2171
+ }), 'plugin-admin: typert descriptors (plugins, sessions, fs, mcp, subagents)')
2157
2172
  }