@hachej/boring-agent 0.1.84 → 0.1.85
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/dist/{chunk-DC3S7SZG.js → chunk-6O5ADR57.js} +1 -1
- package/dist/{chunk-PG2WOJ22.js → chunk-HDIRWHJB.js} +5 -1
- package/dist/{chunk-5IRFVKV7.js → chunk-HY7EERLW.js} +253 -16
- package/dist/{chunk-2XADUCX7.js → chunk-LYBTHR7J.js} +1 -1
- package/dist/{chunk-WODTQBXR.js → chunk-YONTHCD7.js} +108 -2
- package/dist/{chunk-5NAN3TAR.js → chunk-ZUDWQAAB.js} +1 -1
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.js +2 -2
- package/dist/{createHarness-TGBJZISM.js → createHarness-MJ5GEL6J.js} +2 -2
- package/dist/front/index.d.ts +1 -1
- package/dist/front/index.js +2 -2
- package/dist/{harness-Dtu-WAXy.d.ts → harness-RhGbdGWY.d.ts} +1 -1
- package/dist/{piChatEvent-DLa8CgFa.d.ts → piChatEvent-CUTKRaZD.d.ts} +14 -14
- package/dist/{piChatSessionService-BuPaMB7k.d.ts → piChatSessionService-iBtx32ya.d.ts} +1 -1
- package/dist/server/index.d.ts +45 -6
- package/dist/server/index.js +12 -8
- package/dist/server/worker/index.js +6 -6
- package/dist/shared/index.d.ts +86 -38
- package/dist/shared/index.js +96 -5
- package/dist/workspaceAgentDispatcher-Dv0DocrE.d.ts +314 -0
- package/docs/ERROR_CODES.md +2 -0
- package/package.json +2 -2
- package/dist/workspaceAgentDispatcher-CBN2xxaH.d.ts +0 -151
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { p as AgentDefinitionErrorCode, q as AgentDeploymentErrorCode, D as InterruptReceipt, j as StopReceipt } from './piChatEvent-DLa8CgFa.js';
|
|
3
|
-
import { p as AgentSendInput, j as AgentEvent } from './harness-Dtu-WAXy.js';
|
|
4
|
-
|
|
5
|
-
interface SandboxHandleRecord {
|
|
6
|
-
workspaceId: string;
|
|
7
|
-
sandboxId: string;
|
|
8
|
-
snapshotId?: string;
|
|
9
|
-
createdAt: string;
|
|
10
|
-
lastUsedAt: string;
|
|
11
|
-
}
|
|
12
|
-
interface SandboxHandleStore {
|
|
13
|
-
get(workspaceId: string): Promise<SandboxHandleRecord | null>;
|
|
14
|
-
put(record: SandboxHandleRecord): Promise<void>;
|
|
15
|
-
delete(workspaceId: string): Promise<void>;
|
|
16
|
-
list(): Promise<SandboxHandleRecord[]>;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
interface FileSearch {
|
|
20
|
-
search(glob: string, limit?: number): Promise<string[]>;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
type Sha256Digest = `sha256:${string}`;
|
|
24
|
-
|
|
25
|
-
interface AgentSchemaIssue<Code extends string> {
|
|
26
|
-
code: Code;
|
|
27
|
-
field: string;
|
|
28
|
-
message: string;
|
|
29
|
-
}
|
|
30
|
-
type AgentSchemaValidationResult<T, Code extends string> = {
|
|
31
|
-
valid: true;
|
|
32
|
-
value: T;
|
|
33
|
-
} | {
|
|
34
|
-
valid: false;
|
|
35
|
-
issues: AgentSchemaIssue<Code>[];
|
|
36
|
-
};
|
|
37
|
-
declare abstract class SchemaValidationError<Code extends string> extends Error {
|
|
38
|
-
readonly code: "CONFIG_INVALID";
|
|
39
|
-
readonly field: string;
|
|
40
|
-
readonly validationCode: Code;
|
|
41
|
-
constructor(issue: AgentSchemaIssue<Code>);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
interface AgentDefinition {
|
|
45
|
-
schemaVersion: 1;
|
|
46
|
-
definitionId: string;
|
|
47
|
-
version: string;
|
|
48
|
-
label?: string;
|
|
49
|
-
instructionsRef: string;
|
|
50
|
-
capabilityRequirements?: string[];
|
|
51
|
-
toolRefs?: string[];
|
|
52
|
-
skillRefs?: string[];
|
|
53
|
-
mcpServerRefs?: string[];
|
|
54
|
-
}
|
|
55
|
-
interface AgentDefinitionReference {
|
|
56
|
-
definitionId: string;
|
|
57
|
-
version: string;
|
|
58
|
-
digest: Sha256Digest;
|
|
59
|
-
}
|
|
60
|
-
interface AgentDeployment {
|
|
61
|
-
deploymentId: string;
|
|
62
|
-
version: string;
|
|
63
|
-
agentId: string;
|
|
64
|
-
definition: AgentDefinitionReference;
|
|
65
|
-
}
|
|
66
|
-
interface AgentDefinitionDigestAsset {
|
|
67
|
-
path: string;
|
|
68
|
-
digest: Sha256Digest;
|
|
69
|
-
content: string;
|
|
70
|
-
}
|
|
71
|
-
type CompiledAgentDefinition = {
|
|
72
|
-
readonly [Key in keyof AgentDefinition]: AgentDefinition[Key] extends readonly string[] | undefined ? readonly string[] | undefined : AgentDefinition[Key];
|
|
73
|
-
};
|
|
74
|
-
interface CompiledAgentBundle {
|
|
75
|
-
readonly definition: CompiledAgentDefinition;
|
|
76
|
-
readonly definitionDigest: Sha256Digest;
|
|
77
|
-
readonly assets: readonly Readonly<AgentDefinitionDigestAsset>[];
|
|
78
|
-
}
|
|
79
|
-
declare const OpaqueRefSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
80
|
-
declare const Sha256DigestSchema: z.ZodEffects<z.ZodString, `sha256:${string}`, string>;
|
|
81
|
-
declare function validateAgentDefinition(raw: unknown): AgentSchemaValidationResult<AgentDefinition, AgentDefinitionErrorCode>;
|
|
82
|
-
declare function validateAgentDeployment(raw: unknown): AgentSchemaValidationResult<AgentDeployment, AgentDeploymentErrorCode>;
|
|
83
|
-
declare function createAgentAssetDigest(content: string): Promise<Sha256Digest>;
|
|
84
|
-
declare class AgentDefinitionValidationError extends SchemaValidationError<AgentDefinitionErrorCode> {
|
|
85
|
-
constructor(issue: AgentSchemaIssue<AgentDefinitionErrorCode>);
|
|
86
|
-
}
|
|
87
|
-
declare class AgentDeploymentValidationError extends SchemaValidationError<AgentDeploymentErrorCode> {
|
|
88
|
-
constructor(issue: AgentSchemaIssue<AgentDeploymentErrorCode>);
|
|
89
|
-
}
|
|
90
|
-
declare function createAgentDefinitionDigest(input: {
|
|
91
|
-
definition: CompiledAgentDefinition;
|
|
92
|
-
assets: readonly AgentDefinitionDigestAsset[];
|
|
93
|
-
}): Promise<Sha256Digest>;
|
|
94
|
-
declare function createAgentDeploymentDigest(deployment: AgentDeployment): Promise<Sha256Digest>;
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Browser CustomEvent name dispatched on `window` after the workspace's
|
|
98
|
-
* agent-plugin hot reload subscriber commits a registry change (load,
|
|
99
|
-
* unload, or error).
|
|
100
|
-
*
|
|
101
|
-
* Declared in `@hachej/boring-agent` (not `@hachej/boring-workspace`)
|
|
102
|
-
* so the agent's ChatPanel — which listens for this event to refresh
|
|
103
|
-
* its slash-command palette / banner state — can import it without
|
|
104
|
-
* creating a workspace → agent → workspace cycle. Workspace's
|
|
105
|
-
* `useAgentPluginHotReload` imports the same constant.
|
|
106
|
-
*/
|
|
107
|
-
declare const WORKSPACE_AGENT_PLUGINS_RELOADED_EVENT = "boring-ui:agent-plugins-reloaded";
|
|
108
|
-
/**
|
|
109
|
-
* One per plugin that loaded successfully but whose server-side surfaces
|
|
110
|
-
* (Fastify routes / agent tools) still hold pre-reload code. Shared
|
|
111
|
-
* between the agent's /reload HTTP route + the ChatPanel banner so the
|
|
112
|
-
* agent layer has ONE declaration of this wire shape. Mirrors what the
|
|
113
|
-
* workspace's `collectRestartWarnings()` emits (workspace owns the
|
|
114
|
-
* canonical `PluginRestartWarning` type; we redeclare here only because
|
|
115
|
-
* the agent layer must not depend on workspace).
|
|
116
|
-
*/
|
|
117
|
-
interface PluginRestartWarning {
|
|
118
|
-
id: string;
|
|
119
|
-
surfaces: string[];
|
|
120
|
-
message: string;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Browser CustomEvent name dispatched on `window` when a `showNotification`
|
|
124
|
-
* UI command arrives from the server (e.g. from a plugin slash command that
|
|
125
|
-
* calls `notify()`). `PiChatPanel` listens for this to show the
|
|
126
|
-
* `CommandRunStatus` banner above the composer.
|
|
127
|
-
*/
|
|
128
|
-
declare const WORKSPACE_COMMAND_NOTIFY_EVENT = "boring-ui:command-notify";
|
|
129
|
-
/**
|
|
130
|
-
* Payload carried by `WORKSPACE_COMMAND_NOTIFY_EVENT`. Maps directly to
|
|
131
|
-
* what `uiCommandDispatcher` extracts from the `showNotification` command.
|
|
132
|
-
*/
|
|
133
|
-
interface CommandNotifyPayload {
|
|
134
|
-
message: string;
|
|
135
|
-
tone: 'success' | 'error' | 'info' | 'warn';
|
|
136
|
-
/** Name of the command that triggered the notification (without leading slash). */
|
|
137
|
-
command?: string;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
interface WorkspaceAgentDispatcherContext {
|
|
141
|
-
workspaceId: string;
|
|
142
|
-
userId: string;
|
|
143
|
-
}
|
|
144
|
-
type WorkspaceAgentDispatcherSendInput = Omit<AgentSendInput, 'ctx'>;
|
|
145
|
-
interface WorkspaceAgentDispatcher {
|
|
146
|
-
send(input: WorkspaceAgentDispatcherSendInput): AsyncIterable<AgentEvent>;
|
|
147
|
-
interrupt(sessionId: string): Promise<InterruptReceipt>;
|
|
148
|
-
stop(sessionId: string): Promise<StopReceipt>;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
export { type AgentDeployment as A, type CompiledAgentBundle as C, type FileSearch as F, OpaqueRefSchema as O, type PluginRestartWarning as P, type SandboxHandleStore as S, type WorkspaceAgentDispatcherContext as W, type SandboxHandleRecord as a, type Sha256Digest as b, type WorkspaceAgentDispatcher as c, SchemaValidationError as d, type AgentSchemaIssue as e, type AgentSchemaValidationResult as f, type AgentDefinition as g, type AgentDefinitionDigestAsset as h, type AgentDefinitionReference as i, AgentDefinitionValidationError as j, AgentDeploymentValidationError as k, type CommandNotifyPayload as l, type CompiledAgentDefinition as m, Sha256DigestSchema as n, WORKSPACE_AGENT_PLUGINS_RELOADED_EVENT as o, WORKSPACE_COMMAND_NOTIFY_EVENT as p, type WorkspaceAgentDispatcherSendInput as q, createAgentAssetDigest as r, createAgentDefinitionDigest as s, createAgentDeploymentDigest as t, validateAgentDeployment as u, validateAgentDefinition as v };
|