@unieai/rabi-subagent-spawn-in-process 0.0.0-stage → 0.2.2-rc.5

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DeepSeek
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,8 @@
1
- # Temporary Holding Version
1
+ # @unieai/rabi-subagent-spawn-in-process
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ In-process spawn subagent backend: runs a fresh child agent on ctx.agents
4
+
5
+ Part of Rabi, the agent harness UnieAI Code runs on. Installed as a dependency of `@unieai/rabi`;
6
+ not meant to be used on its own.
7
+
8
+ See LICENSE for the license and copyright of this package.
package/lib/index.js ADDED
@@ -0,0 +1,39 @@
1
+ import z from "@unieai/schemastery";
2
+ //#region lib/types/index.js
3
+ /**
4
+ * The in-process SPAWN subagent backend: registers a {@link SubagentProvider} on
5
+ * `ctx.subagents` that runs each child as a fresh child {@link Agent} on the same cordis
6
+ * context (its own session, own system prompt, zero parent context). The cheapest transport,
7
+ * reusing the agent factory's quiescent teardown.
8
+ * @module @unieai/rabi-subagent-spawn-in-process
9
+ */
10
+ const name = "subagent-spawn-in-process";
11
+ const inject = ["subagents"];
12
+ const Config = z.object({ providerName: z.string().default("spawn") });
13
+ /**
14
+ * The spawn provider. Supports every start-time capability: `depthLimit` (it
15
+ * constructs the child, so it can enforce a recursion cap), `outputSchema`
16
+ * (the scoped structured runtime), `agentOptions` (merged over the parent
17
+ * route). The selected preset owns persona and tool composition.
18
+ */
19
+ var SpawnInProcessProvider = class {
20
+ name;
21
+ capabilities = {
22
+ agentOptions: true,
23
+ agentPreset: true,
24
+ outputSchema: true,
25
+ depthLimit: true
26
+ };
27
+ inheritsParentContext = false;
28
+ constructor(name) {
29
+ this.name = name;
30
+ }
31
+ prepareContinuable() {
32
+ return Promise.resolve({});
33
+ }
34
+ };
35
+ function apply(ctx, config) {
36
+ ctx.subagents.registerProvider(new SpawnInProcessProvider(config.providerName));
37
+ }
38
+ //#endregion
39
+ export { Config, apply, inject, name };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The in-process SPAWN subagent backend: registers a {@link SubagentProvider} on
3
+ * `ctx.subagents` that runs each child as a fresh child {@link Agent} on the same cordis
4
+ * context (its own session, own system prompt, zero parent context). The cheapest transport,
5
+ * reusing the agent factory's quiescent teardown.
6
+ * @module @unieai/rabi-subagent-spawn-in-process
7
+ */
8
+ import type { Context } from '@unieai/cordis';
9
+ import z from '@unieai/schemastery';
10
+ export declare const name = "subagent-spawn-in-process";
11
+ export declare const inject: string[];
12
+ /** Config: the registry name to register the provider under. */
13
+ export interface Config {
14
+ /** Provider name on `ctx.subagents` (default `spawn`). */
15
+ providerName: string;
16
+ }
17
+ export declare const Config: z<Config>;
18
+ export declare function apply(ctx: Context, config: Config): void;
19
+ //# sourceMappingURL=index.d.ts.map
package/locale/de.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Erstellen Sie ein neues Subagenten-Backend",
4
+ "description": "Erstellen Sie im aktuellen Prozess einen neuen Subagenten und führen Sie unabhängige Aufgaben aus."
5
+ }
6
+ }
package/locale/en.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "meta": {
3
+ "title": "subagent-spawn-in-process"
4
+ }
5
+ }
package/locale/es.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Crear un nuevo backend de subagente",
4
+ "description": "Cree un nuevo subagente en el proceso actual y realice tareas independientes."
5
+ }
6
+ }
package/locale/fr.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Créer un nouveau backend de sous-agent",
4
+ "description": "Créez un nouveau sous-agent dans le processus en cours et effectuez des tâches indépendantes."
5
+ }
6
+ }
package/locale/ja.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "新規サブエージェントバックエンド",
4
+ "description": "現在のプロセス内に新しいサブエージェントを作成し、独立したタスクを実行します。"
5
+ }
6
+ }
package/locale/pt.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Crie um novo back-end de subagente",
4
+ "description": "Crie um novo subagente no processo atual e execute tarefas independentes."
5
+ }
6
+ }
package/locale/ru.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Создайте новый сервер субагента",
4
+ "description": "Создайте нового субагента в текущем процессе и выполняйте независимые задачи."
5
+ }
6
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "新建子智能体后端",
4
+ "description": "在当前进程中新建子智能体,执行独立任务。"
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,6 +1,37 @@
1
1
  {
2
2
  "name": "@unieai/rabi-subagent-spawn-in-process",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "description": "In-process spawn subagent backend: runs a fresh child agent on ctx.agents",
4
+ "version": "0.2.2-rc.5",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "type": "module",
9
+ "main": "lib/index.js",
10
+ "types": "lib/types/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./lib/types/index.d.ts",
14
+ "default": "./lib/index.js"
15
+ },
16
+ "./src/*": "./src/*",
17
+ "./package.json": "./package.json",
18
+ "./locale/*.json": "./locale/*.json"
19
+ },
20
+ "files": [
21
+ "locale/*.json",
22
+ "lib/index.js",
23
+ "lib/types/**/*.d.ts",
24
+ "lib/types/**/*.d.ts.map",
25
+ "lib/**/*.js.map",
26
+ "src",
27
+ "README.md"
28
+ ],
29
+ "license": "MIT",
30
+ "peerDependencies": {
31
+ "@unieai/rabi-subagent": "0.2.2-rc.5",
32
+ "@unieai/cordis": "4.1.0"
33
+ },
34
+ "dependencies": {
35
+ "@unieai/schemastery": "3.19.0"
36
+ }
37
+ }
package/src/index.ts ADDED
@@ -0,0 +1,59 @@
1
+ /**
2
+ * The in-process SPAWN subagent backend: registers a {@link SubagentProvider} on
3
+ * `ctx.subagents` that runs each child as a fresh child {@link Agent} on the same cordis
4
+ * context (its own session, own system prompt, zero parent context). The cheapest transport,
5
+ * reusing the agent factory's quiescent teardown.
6
+ * @module @unieai/rabi-subagent-spawn-in-process
7
+ */
8
+
9
+ import type { Context } from '@unieai/cordis'
10
+ import z from '@unieai/schemastery'
11
+ import type {
12
+ ContinuableCreateSpec,
13
+ SubagentCapabilities,
14
+ SubagentProvider,
15
+ } from '@unieai/rabi-subagent'
16
+
17
+ export const name = 'subagent-spawn-in-process'
18
+ // `tools` is deliberately not injected: the child factory already provides it during setup,
19
+ // and adding it here would unnecessarily change this provider's apply timing.
20
+ export const inject = ['subagents']
21
+
22
+ /** Config: the registry name to register the provider under. */
23
+ export interface Config {
24
+ /** Provider name on `ctx.subagents` (default `spawn`). */
25
+ providerName: string
26
+ }
27
+
28
+ export const Config: z<Config> = z.object({
29
+ providerName: z.string().default('spawn'),
30
+ })
31
+
32
+ /**
33
+ * The spawn provider. Supports every start-time capability: `depthLimit` (it
34
+ * constructs the child, so it can enforce a recursion cap), `outputSchema`
35
+ * (the scoped structured runtime), `agentOptions` (merged over the parent
36
+ * route). The selected preset owns persona and tool composition.
37
+ */
38
+ class SpawnInProcessProvider implements SubagentProvider {
39
+ readonly capabilities: SubagentCapabilities = {
40
+ agentOptions: true,
41
+ agentPreset: true,
42
+ outputSchema: true,
43
+ depthLimit: true,
44
+ }
45
+ // Context contract: a spawned child starts fresh — it never sees the parent conversation.
46
+ readonly inheritsParentContext = false
47
+
48
+ constructor(readonly name: string) {}
49
+
50
+ prepareContinuable(): Promise<ContinuableCreateSpec> {
51
+ // A spawned child starts fresh, so it contributes no seed; the continuation
52
+ // manager owns every later operation on it.
53
+ return Promise.resolve({})
54
+ }
55
+ }
56
+
57
+ export function apply(ctx: Context, config: Config): void {
58
+ ctx.subagents.registerProvider(new SpawnInProcessProvider(config.providerName))
59
+ }