@getpipher/armory-fleet 0.2.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/LICENSE +21 -0
- package/README.md +31 -0
- package/agents/general-purpose.md +10 -0
- package/package.json +65 -0
- package/src/engine/child-loader.ts +47 -0
- package/src/engine/concurrency-lock.ts +24 -0
- package/src/engine/run-registry.ts +39 -0
- package/src/engine/spawnSubagent.ts +234 -0
- package/src/engine/turn-budget.ts +21 -0
- package/src/index.ts +118 -0
- package/src/memory-hydrate/adapter.ts +12 -0
- package/src/memory-hydrate/port.ts +13 -0
- package/src/panel/fleet-panel.ts +227 -0
- package/src/panel/rows.ts +53 -0
- package/src/registry/discovery.ts +83 -0
- package/src/registry/frontmatter.ts +69 -0
- package/src/todo-sync/adapter.ts +84 -0
- package/src/todo-sync/port.ts +41 -0
- package/src/tools/subagent.ts +75 -0
- package/src/vision/adapter.ts +51 -0
- package/src/vision/describe-image-tool.ts +34 -0
- package/src/vision/port.ts +19 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// src/vision/describe-image-tool.ts — fleet-defined describe_image for child sessions.
|
|
2
|
+
// Mirrors @getpipher/vision's describe_image contract so user muscle memory transfers,
|
|
3
|
+
// but execute() delegates via VisionPort (vision's extension never loads into the child).
|
|
4
|
+
import { Type, type Static } from "typebox";
|
|
5
|
+
import type { VisionPort } from "./port.ts";
|
|
6
|
+
|
|
7
|
+
const params = Type.Object({
|
|
8
|
+
image: Type.String({ description: "Absolute path to the image file to analyze." }),
|
|
9
|
+
prompt: Type.Optional(Type.String({ description: "Optional question/instruction for the analysis." })),
|
|
10
|
+
});
|
|
11
|
+
type DescribeImageInput = Static<typeof params>;
|
|
12
|
+
|
|
13
|
+
export function createDescribeImageTool(visionPort: VisionPort) {
|
|
14
|
+
return {
|
|
15
|
+
name: "describe_image",
|
|
16
|
+
label: "Vision",
|
|
17
|
+
description:
|
|
18
|
+
"Analyze an image file and return a text description. Use when you read an image file and need to understand its contents. " +
|
|
19
|
+
"Pass an absolute image path and an optional analysis prompt.",
|
|
20
|
+
promptSnippet: "Analyze an image file and return a text description",
|
|
21
|
+
promptGuidelines: [
|
|
22
|
+
"Use describe_image when you read an image file (read returns an image attachment) and need a textual understanding of its contents.",
|
|
23
|
+
"Pass the absolute image path; add an optional prompt to focus the analysis (e.g. 'describe the UI layout').",
|
|
24
|
+
],
|
|
25
|
+
parameters: params,
|
|
26
|
+
async execute(_toolCallId: string, p: DescribeImageInput, signal: AbortSignal, _onUpdate: unknown, _ctx: unknown) {
|
|
27
|
+
const result = await visionPort.delegate({ imagePath: p.image, prompt: p.prompt }, signal);
|
|
28
|
+
if (result.ok) {
|
|
29
|
+
return { content: [{ type: "text" as const, text: result.text }] };
|
|
30
|
+
}
|
|
31
|
+
return { content: [{ type: "text" as const, text: result.error }], isError: true as const };
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// src/vision/port.ts — fleet-owned port; fleet core depends only on this.
|
|
2
|
+
import type { Model } from "@earendil-works/pi-ai";
|
|
3
|
+
|
|
4
|
+
export interface VisionDelegateParams {
|
|
5
|
+
/** Absolute path to the image file the child read. */
|
|
6
|
+
imagePath: string;
|
|
7
|
+
/** Optional analysis prompt. */
|
|
8
|
+
prompt?: string;
|
|
9
|
+
}
|
|
10
|
+
export type VisionDelegateResult = { ok: true; text: string } | { ok: false; error: string };
|
|
11
|
+
|
|
12
|
+
export interface VisionPort {
|
|
13
|
+
/** Whether the given model can process images natively (pass-through) vs needs delegation. */
|
|
14
|
+
isMultimodal(model: Model<any> | undefined): boolean;
|
|
15
|
+
/** Delegate image analysis to the configured vision model; returns text or an actionable error. */
|
|
16
|
+
delegate(params: VisionDelegateParams, signal?: AbortSignal): Promise<VisionDelegateResult>;
|
|
17
|
+
/** Whether a vision model is configured in the host vision.json. */
|
|
18
|
+
isConfigured(): boolean;
|
|
19
|
+
}
|