@grackle-ai/plugin-orchestration 0.97.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/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # @grackle-ai/plugin-orchestration
2
+
3
+ Orchestration plugin for Grackle — tasks, personas, findings, and escalations.
4
+
5
+ Separating orchestration from core means running Grackle without this plugin gives a clean "sessions + environments only" experience with no task DAG.
6
+
7
+ ## Usage
8
+
9
+ ```typescript
10
+ import { createCorePlugin } from "@grackle-ai/server/core-plugin";
11
+ import { createOrchestrationPlugin } from "@grackle-ai/plugin-orchestration";
12
+ import { loadPlugins } from "@grackle-ai/plugin-sdk";
13
+
14
+ const loaded = await loadPlugins(
15
+ [createCorePlugin(), createOrchestrationPlugin()],
16
+ pluginContext,
17
+ );
18
+ ```
19
+
20
+ ## What This Plugin Contributes
21
+
22
+ ### gRPC Handlers (21 RPCs)
23
+
24
+ | Group | Methods |
25
+ |---|---|
26
+ | Tasks | `listTasks`, `createTask`, `getTask`, `updateTask`, `startTask`, `completeTask`, `setWorkpad`, `resumeTask`, `stopTask`, `deleteTask` |
27
+ | Personas | `listPersonas`, `createPersona`, `getPersona`, `updatePersona`, `deletePersona` |
28
+ | Findings | `postFinding`, `queryFindings`, `getFinding` |
29
+ | Escalations | `createEscalation`, `listEscalations`, `acknowledgeEscalation` |
30
+
31
+ ### Reconciliation Phases
32
+
33
+ - **orphan-reparent** — re-parents child tasks whose parent session has ended
34
+
35
+ ### Event Subscribers
36
+
37
+ - **sigchld** — handles agent process exit, updates task/session state
38
+ - **escalation-auto** — auto-detects and routes escalations to the notification system
39
+ - **orphan-reparent** — triggers reparenting on task lifecycle events
40
+
41
+ ## Dependencies
42
+
43
+ Depends on the `"core"` plugin (declared via `dependencies: ["core"]`).
@@ -0,0 +1,2 @@
1
+ export { createOrchestrationPlugin } from "./orchestration-plugin.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { createOrchestrationPlugin } from "./orchestration-plugin.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Orchestration plugin — contributes task, persona, finding, and escalation
3
+ * gRPC handlers, orphan-reparent reconciliation, and sigchld/escalation/orphan
4
+ * event subscribers.
5
+ *
6
+ * @module
7
+ */
8
+ import type { GracklePlugin } from "@grackle-ai/plugin-sdk";
9
+ /**
10
+ * Create the orchestration plugin that contributes task/persona/finding/escalation
11
+ * capabilities to the Grackle server.
12
+ *
13
+ * - **gRPC handlers**: All 21 orchestration RPCs (tasks, personas, findings, escalations)
14
+ * - **Reconciliation phases**: orphan-reparent
15
+ * - **Event subscribers**: sigchld, escalation-auto, orphan-reparent
16
+ *
17
+ * Depends on the "core" plugin.
18
+ *
19
+ * @returns A GracklePlugin ready to pass to `loadPlugins()`.
20
+ */
21
+ export declare function createOrchestrationPlugin(): GracklePlugin;
22
+ //# sourceMappingURL=orchestration-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestration-plugin.d.ts","sourceRoot":"","sources":["../src/orchestration-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAS5D;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,IAAI,aAAa,CA0BzD"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Orchestration plugin — contributes task, persona, finding, and escalation
3
+ * gRPC handlers, orphan-reparent reconciliation, and sigchld/escalation/orphan
4
+ * event subscribers.
5
+ *
6
+ * @module
7
+ */
8
+ import { grackle } from "@grackle-ai/common";
9
+ import { createOrchestrationCollector, createOrphanPhase, createSigchldSubscriber, createEscalationAutoSubscriber, createOrphanReparentSubscriber, } from "@grackle-ai/plugin-core";
10
+ import { taskStore } from "@grackle-ai/database";
11
+ /**
12
+ * Create the orchestration plugin that contributes task/persona/finding/escalation
13
+ * capabilities to the Grackle server.
14
+ *
15
+ * - **gRPC handlers**: All 21 orchestration RPCs (tasks, personas, findings, escalations)
16
+ * - **Reconciliation phases**: orphan-reparent
17
+ * - **Event subscribers**: sigchld, escalation-auto, orphan-reparent
18
+ *
19
+ * Depends on the "core" plugin.
20
+ *
21
+ * @returns A GracklePlugin ready to pass to `loadPlugins()`.
22
+ */
23
+ export function createOrchestrationPlugin() {
24
+ return {
25
+ name: "orchestration",
26
+ dependencies: ["core"],
27
+ grpcHandlers: () => [{
28
+ service: grackle.Grackle,
29
+ handlers: createOrchestrationCollector().getHandlers(grackle.Grackle),
30
+ }],
31
+ reconciliationPhases: (ctx) => [
32
+ createOrphanPhase({
33
+ listAllTasks: () => taskStore.listTasks(),
34
+ reparentTask: (taskId, newParentTaskId) => {
35
+ taskStore.reparentTask(taskId, newParentTaskId);
36
+ },
37
+ emit: ctx.emit,
38
+ }),
39
+ ],
40
+ eventSubscribers: (ctx) => [
41
+ createSigchldSubscriber(ctx),
42
+ createEscalationAutoSubscriber(ctx),
43
+ createOrphanReparentSubscriber(ctx),
44
+ ],
45
+ };
46
+ }
47
+ //# sourceMappingURL=orchestration-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestration-plugin.js","sourceRoot":"","sources":["../src/orchestration-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EACL,4BAA4B,EAC5B,iBAAiB,EACjB,uBAAuB,EAAE,8BAA8B,EAAE,8BAA8B,GACxF,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,yBAAyB;IACvC,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,YAAY,EAAE,CAAC,MAAM,CAAC;QAEtB,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC;gBACnB,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,QAAQ,EAAE,4BAA4B,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC;aACtE,CAAC;QAEF,oBAAoB,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC;YAC7B,iBAAiB,CAAC;gBAChB,YAAY,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE;gBACzC,YAAY,EAAE,CAAC,MAAc,EAAE,eAAuB,EAAQ,EAAE;oBAC9D,SAAS,CAAC,YAAY,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;gBAClD,CAAC;gBACD,IAAI,EAAE,GAAG,CAAC,IAAI;aACf,CAAC;SACH;QAED,gBAAgB,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC;YACzB,uBAAuB,CAAC,GAAG,CAAC;YAC5B,8BAA8B,CAAC,GAAG,CAAC;YACnC,8BAA8B,CAAC,GAAG,CAAC;SACpC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
+ // It should be published with your NPM package. It should not be tracked by Git.
3
+ {
4
+ "tsdocVersion": "0.12",
5
+ "toolPackages": [
6
+ {
7
+ "packageName": "@microsoft/api-extractor",
8
+ "packageVersion": "7.57.7"
9
+ }
10
+ ]
11
+ }
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@grackle-ai/plugin-orchestration",
3
+ "version": "0.97.0",
4
+ "description": "Orchestration plugin for Grackle — tasks, personas, findings, and escalations",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/nick-pape/grackle.git",
9
+ "directory": "packages/plugin-orchestration"
10
+ },
11
+ "keywords": [
12
+ "grackle",
13
+ "plugin",
14
+ "orchestration"
15
+ ],
16
+ "homepage": "https://github.com/nick-pape/grackle#readme",
17
+ "bugs": {
18
+ "url": "https://github.com/nick-pape/grackle/issues"
19
+ },
20
+ "engines": {
21
+ "node": ">=22.0.0 <24.0.0"
22
+ },
23
+ "type": "module",
24
+ "main": "dist/index.js",
25
+ "types": "dist/index.d.ts",
26
+ "files": [
27
+ "dist/"
28
+ ],
29
+ "dependencies": {
30
+ "@bufbuild/protobuf": "^2.5.0",
31
+ "@grackle-ai/common": "0.97.0",
32
+ "@grackle-ai/core": "0.97.0",
33
+ "@grackle-ai/plugin-core": "0.97.0",
34
+ "@grackle-ai/plugin-sdk": "0.97.0",
35
+ "@grackle-ai/database": "0.97.0"
36
+ },
37
+ "devDependencies": {
38
+ "@rushstack/heft": "1.2.7",
39
+ "@types/node": "^22.0.0",
40
+ "vitest": "^3.2.1",
41
+ "@grackle-ai/heft-rig": "0.0.1"
42
+ },
43
+ "scripts": {
44
+ "build": "heft build --clean",
45
+ "test": "vitest run",
46
+ "clean": "heft clean",
47
+ "_phase:build": "heft run --only build -- --clean",
48
+ "_phase:test": "vitest run"
49
+ }
50
+ }