Skip to content
Closed
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
154 changes: 136 additions & 18 deletions package-lock.json

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

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
"main": "./out/main/index.js",
"scripts": {
"dev": "electron-vite dev",
"prebuild": "node scripts/sync-runtime-types.mjs",
"build": "electron-vite build",
"preview": "electron-vite preview"
"preview": "electron-vite preview",
"sync:runtime-types": "node scripts/sync-runtime-types.mjs"
},
"dependencies": {
"@agent-relay/sdk": "^6.3.1",
"@agentworkforce/deploy": "^3.0.15",
"@monaco-editor/react": "^4.7.0",
"@xterm/addon-fit": "^0.10.0",
"@xterm/addon-web-links": "^0.11.0",
"@xterm/xterm": "^5.5.0",
Expand Down
93 changes: 93 additions & 0 deletions scripts/sync-runtime-types.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
import { mkdir, writeFile } from 'node:fs/promises'
import { dirname, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'

const rootDir = resolve(dirname(fileURLToPath(import.meta.url)), '..')
const outPath = resolve(rootDir, 'vendor/agentworkforce-runtime-types.d.ts')

const source = `// Generated by scripts/sync-runtime-types.mjs.
// Keep this file vendored so the proactive-agent editor can type-check
// handler snippets without requiring the workforce repo in packaged builds.

declare module '@agentworkforce/runtime' {
export type WatchEvent = 'created' | 'updated' | 'deleted'

export interface WatchRule {
paths: string[]
events: WatchEvent[]
debounceMs?: number
match?: string
}

export interface WorkforceEventBase {
id: string
type: string
workspace: string
occurredAt: string
attempt?: number
}

export interface RelayfileChangedEvent extends WorkforceEventBase {
type: 'relayfile.changed' | 'relayfile.created' | 'relayfile.updated' | 'relayfile.deleted'
path: string
resource?: unknown
}

export type WorkforceEvent = WorkforceEventBase | RelayfileChangedEvent

export interface FilesContext {
read(path: string): Promise<string>
write(path: string, contents: string): Promise<void>
exists(path: string): Promise<boolean>
}

export interface NotifyInput {
channel?: string
text: string
}

export interface WorkforceCtx {
workspaceId: string
agentId: string
fs: FilesContext
notify(input: NotifyInput): Promise<void>
log(level: 'debug' | 'info' | 'warn' | 'error', message: string, data?: Record<string, unknown>): void
}

export type WorkforceHandler = (ctx: WorkforceCtx, event: WorkforceEvent) => Promise<void> | void

export function handler(fn: WorkforceHandler): WorkforceHandler
}

declare module '@agentworkforce/persona-kit' {
export type Harness = 'claude' | 'codex' | 'opencode'
export type WatchEvent = 'created' | 'updated' | 'deleted'

export interface WatchRule {
paths: string[]
events: WatchEvent[]
debounceMs?: number
match?: string
}

export interface PersonaSpec {
id: string
name?: string
description?: string
harness: Harness
model: string
systemPrompt: string
integrations?: Record<string, unknown>
watch?: WatchRule[]
onEvent?: string
inputs?: Record<string, unknown>
memory?: boolean | { enabled?: boolean; scopes?: string[]; ttlDays?: number }
harnessSettings?: { reasoning?: 'low' | 'medium' | 'high'; timeoutSeconds?: number }
mount?: { enabled?: boolean }
}
}
`

await mkdir(dirname(outPath), { recursive: true })
await writeFile(outPath, source, 'utf8')
console.log(`wrote ${outPath}`)
Loading