Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ jobs:
# DelegationRequest types) — must build + publish after it. Same
# max-parallel: 1 contract keeps webhook-runtime's publish after
# specialists'.
PACKAGES='["traits","persona","connectivity","coordination","core","sessions","surfaces","policy","proactive","harness","telemetry","memory","turn-context","inbox","continuation","sdk","vfs","specialists","webhook-runtime","cloudflare-runtime"]'
# persona + dispatch (Phase 0 of proactive-unification) are types-only
# packages with zero runtime deps — keep persona where main placed it
# (after traits) and insert dispatch alongside it.
PACKAGES='["traits","persona","dispatch","connectivity","coordination","core","sessions","surfaces","policy","proactive","harness","telemetry","memory","turn-context","inbox","continuation","sdk","vfs","specialists","webhook-runtime","cloudflare-runtime"]'
FIRST='traits'
;;
*)
Expand Down
54 changes: 34 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"packages/routing",
"packages/connectivity",
"packages/coordination",
"packages/dispatch",
"packages/proactive",
"packages/policy",
"packages/integration",
Expand All @@ -29,6 +30,7 @@
],
"scripts": {
"build": "npm run build --workspaces --if-present",
"typecheck": "npm run typecheck -w @agent-assistant/dispatch && npm run typecheck -w @agent-assistant/persona",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Root typecheck script only covers 2 of 13+ packages that have typecheck scripts. The generic name implies full project coverage, but it will miss TypeScript errors in the other 11+ packages (traits, core, routing, sdk, etc.). Consider using npm run typecheck --workspaces --if-present so all workspaces with typecheck scripts are covered, or rename this to something specific like typecheck:dispatch-persona if it's intentionally scoped.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At package.json, line 31:

<comment>Root `typecheck` script only covers 2 of 13+ packages that have typecheck scripts. The generic name implies full project coverage, but it will miss TypeScript errors in the other 11+ packages (traits, core, routing, sdk, etc.). Consider using `npm run typecheck --workspaces --if-present` so all workspaces with typecheck scripts are covered, or rename this to something specific like `typecheck:dispatch-persona` if it's intentionally scoped.</comment>

<file context>
@@ -16,16 +16,19 @@
     "packages/webhook-runtime"
   ],
   "scripts": {
+    "typecheck": "npm run typecheck -w @agent-assistant/dispatch && npm run typecheck -w @agent-assistant/persona",
     "build:sdk": "npm run build -w @agent-assistant/sdk",
     "agent": "RELAY_AUTO_SPAWN=false RELAY_CHANNEL=specialists RELAY_WORKER=specialist-worker RELAY_CLI=claude RELAY_MODEL=claude-sonnet-4-6 npm run cli -w @agent-assistant/webhook-runtime",
</file context>
Suggested change
"typecheck": "npm run typecheck -w @agent-assistant/dispatch && npm run typecheck -w @agent-assistant/persona",
"typecheck": "npm run typecheck --workspaces --if-present",

"build:sdk": "npm run build -w @agent-assistant/sdk",
"pretest": "npm run build",
"test": "npm run test --workspaces --if-present -- --passWithNoTests",
Expand Down
7 changes: 7 additions & 0 deletions packages/dispatch/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog

## 0.1.0 - 2026-05-23

- Added dispatch envelope contract types: `DispatchEnvelope`, `EventEnvelope`, and `IntegrationAccess`.
- Added dispatch response union: `DispatchResponse`.
- Added response helper types: `DeliveryHint`, `LogEntry`, `SandboxTask`, and `AfterTaskHook`.
26 changes: 26 additions & 0 deletions packages/dispatch/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# @agent-assistant/dispatch

TypeScript contract types for proactive persona dispatch requests and responses in Agent Assistant. The exported dispatch envelope follows canonical spec section 7.2: https://github.com/AgentWorkforce/sage/blob/main/specs/proactive-unification.md#72-dispatch-envelope.

The response union covers the synchronous, sandbox-borrow, async callback, and error outcomes from canonical spec section 7.5: https://github.com/AgentWorkforce/sage/blob/main/specs/proactive-unification.md#75-async-callback.

```ts
import type { DispatchEnvelope, DispatchResponse } from "@agent-assistant/dispatch";

const envelope: DispatchEnvelope<{ cron: string }> = {
type: "cron.tick",
personaId: "morning-briefing",
workspaceId: "workspace-1",
deploymentId: "deployment-1",
occurredAt: new Date().toISOString(),
envelope: {
id: "evt-1",
payload: { cron: "0 8 * * 1-5" },
},
};

const response: DispatchResponse = {
kind: "done",
delivery: [{ kind: "slack.message", text: "Briefing ready" }],
};
```
35 changes: 35 additions & 0 deletions packages/dispatch/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "@agent-assistant/dispatch",
"version": "0.1.0",
"description": "Dispatch envelope and async response contract types for Agent Assistant proactive personas",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
"files": [
"dist"
],
"scripts": {
"build": "tsc -p tsconfig.json",
"test": "tsc --noEmit --module NodeNext --moduleResolution NodeNext --target ES2022 --strict --skipLibCheck --types vitest src/types.test.ts && vitest run",
"test:watch": "vitest",
"typecheck": "tsc --noEmit -p tsconfig.json"
},
"devDependencies": {
"typescript": "^5.9.3",
"vitest": "^3.2.4"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/AgentWorkforce/agent-assistant"
},
"publishConfig": {
"access": "public"
}
}
10 changes: 10 additions & 0 deletions packages/dispatch/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export type {
AfterTaskHook,
DeliveryHint,
DispatchEnvelope,
DispatchResponse,
EventEnvelope,
IntegrationAccess,
LogEntry,
SandboxTask,
} from "./types.js";
Loading
Loading