@evandu/super-pi 0.1.130 → 0.1.132
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 +18 -0
- package/agents/super-pi-documents/index.ts +92 -0
- package/agents/super-pi-feishu/index.ts +88 -0
- package/agents/super-pi-knowledge/index.ts +32 -1
- package/agents/super-pi-task/core.ts +217 -0
- package/agents/super-pi-task/index.ts +74 -1
- package/agents/super-pi-web/index.ts +32 -0
- package/assets/fonts/LICENSE +92 -0
- package/assets/fonts/NotoSansSC-Bold.otf +0 -0
- package/assets/fonts/NotoSansSC-Regular.otf +0 -0
- package/dist/client/.super-pi-client-sources.json +13 -10
- package/dist/client/assets/CodeMirrorEditor-ktyL2PcX.js +2 -0
- package/dist/client/assets/{dist-BKp4AWEJ.js → dist--igDAzRS.js} +1 -1
- package/dist/client/assets/{dist-BBW2SE_R.js → dist-60usx__o.js} +1 -1
- package/dist/client/assets/{dist-GkIV1LTX.js → dist-8pdzh6h1.js} +1 -1
- package/dist/client/assets/{dist-B2nPVdKh.js → dist-B8OZ-n_C.js} +1 -1
- package/dist/client/assets/{dist-BDygQgZD.js → dist-BAJCrbnX.js} +1 -1
- package/dist/client/assets/{dist-CiSGSVBZ.js → dist-BJi5HmH4.js} +1 -1
- package/dist/client/assets/{dist-CRzRB9k3.js → dist-BRjGckmQ.js} +1 -1
- package/dist/client/assets/{dist-Cxerc7Bb.js → dist-Bg9zLfex.js} +1 -1
- package/dist/client/assets/{dist-C90MPTnk.js → dist-BjZUYxLd.js} +1 -1
- package/dist/client/assets/{dist-DmAOqr0M.js → dist-Bv6P2Rcp.js} +1 -1
- package/dist/client/assets/{dist-BhJGK8-b.js → dist-C6iAHGvb.js} +1 -1
- package/dist/client/assets/{dist-Dq4-QFAJ.js → dist-CMscy2Nn.js} +1 -1
- package/dist/client/assets/{dist-Ur37340K.js → dist-CPLCQDqy.js} +1 -1
- package/dist/client/assets/{dist-DZnUERoW.js → dist-CgmISAMr.js} +1 -1
- package/dist/client/assets/{dist-CWYRjnj-.js → dist-CoszOk5k.js} +1 -1
- package/dist/client/assets/{dist-CMnvChDX.js → dist-Cu75NyQ0.js} +1 -1
- package/dist/client/assets/{dist-HdeIBl2J.js → dist-DNZMXYNq.js} +1 -1
- package/dist/client/assets/{dist-BykVFExd.js → dist-D_Zdnhm8.js} +1 -1
- package/dist/client/assets/{dist-ChszWGDv.js → dist-DvHghuGd.js} +1 -1
- package/dist/client/assets/{dist-CZ9I2JCd.js → dist-Hj_dWgPr.js} +1 -1
- package/dist/client/assets/{dist-B61RSa-K.js → dist-Zhdkfvng.js} +1 -1
- package/dist/client/assets/{dist-DB5M5fZG.js → dist-vsMBLoxV.js} +1 -1
- package/dist/client/assets/{index-D_c-CYAr.js → index-ChyemF2I.js} +23 -21
- package/dist/client/assets/{index-CXB6U5mz.css → index-D3MEG8uH.css} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/application/document-service.d.ts +68 -0
- package/dist/server/application/document-service.js +120 -0
- package/dist/server/application/feishu-service.d.ts +132 -0
- package/dist/server/application/feishu-service.js +264 -0
- package/dist/server/application/run-service.js +49 -7
- package/dist/server/application/scheduled-task-service.d.ts +164 -0
- package/dist/server/application/scheduled-task-service.js +350 -0
- package/dist/server/command-handler.d.ts +25 -1
- package/dist/server/command-handler.js +60 -1
- package/dist/server/documents.d.ts +152 -0
- package/dist/server/documents.js +998 -0
- package/dist/server/feishu-cli.d.ts +207 -0
- package/dist/server/feishu-cli.js +419 -0
- package/dist/server/file-changes.js +6 -4
- package/dist/server/files.d.ts +32 -0
- package/dist/server/files.js +31 -3
- package/dist/server/http-server.js +324 -2
- package/dist/server/index.js +41 -2
- package/dist/server/inline-thinking.d.ts +90 -0
- package/dist/server/inline-thinking.js +181 -0
- package/dist/server/knowledge.d.ts +24 -14
- package/dist/server/knowledge.js +57 -34
- package/dist/server/persistence/app-state-repository.d.ts +13 -1
- package/dist/server/persistence/sqlite-state-repository.js +3 -0
- package/dist/server/pi-session-pool.js +2 -1
- package/dist/server/pi-session.d.ts +4 -0
- package/dist/server/pi-session.js +14 -0
- package/dist/server/presentations/schema.d.ts +120 -0
- package/dist/server/presentations/schema.js +128 -0
- package/dist/server/runtime.d.ts +67 -0
- package/dist/server/runtime.js +204 -18
- package/dist/server/scheduled-tasks.d.ts +101 -0
- package/dist/server/scheduled-tasks.js +138 -0
- package/dist/server/server-context.d.ts +19 -0
- package/dist/server/store.d.ts +30 -0
- package/dist/server/store.js +81 -2
- package/dist/server/subagents.js +33 -6
- package/dist/server/task-tool.d.ts +18 -0
- package/dist/server/task-tool.js +18 -0
- package/dist/server/types.d.ts +56 -0
- package/dist/server/web.d.ts +24 -0
- package/dist/server/web.js +180 -0
- package/package.json +45 -6
- package/skills/presentation/SKILL.md +30 -0
- package/skills/presentation/references/data.md +10 -0
- package/skills/presentation/references/quality.md +12 -0
- package/skills/presentation/references/story.md +12 -0
- package/skills/presentation/references/templates-and-editing.md +11 -0
- package/skills/presentation/references/visual-system.md +10 -0
- package/dist/.super-pi-check-inputs.json +0 -4
- package/dist/client/assets/CodeMirrorEditor-BNVBZZSS.js +0 -2
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/** Versioned, renderer-independent contract for structured presentation tools. */
|
|
2
|
+
export declare const PRESENTATION_SPEC_VERSION: 1;
|
|
3
|
+
export declare const PRESENTATION_LIMITS: {
|
|
4
|
+
readonly maxSlides: 200;
|
|
5
|
+
readonly maxElementsPerSlide: 500;
|
|
6
|
+
readonly maxTextCharacters: 100000;
|
|
7
|
+
readonly maxTableCells: 10000;
|
|
8
|
+
readonly maxChartPoints: 20000;
|
|
9
|
+
};
|
|
10
|
+
export type PresentationSpec = {
|
|
11
|
+
version: typeof PRESENTATION_SPEC_VERSION;
|
|
12
|
+
metadata?: {
|
|
13
|
+
title?: string;
|
|
14
|
+
subject?: string;
|
|
15
|
+
author?: string;
|
|
16
|
+
company?: string;
|
|
17
|
+
language?: string;
|
|
18
|
+
};
|
|
19
|
+
canvas: {
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
};
|
|
23
|
+
theme?: PresentationTheme;
|
|
24
|
+
slides: PresentationSlide[];
|
|
25
|
+
};
|
|
26
|
+
export type PresentationTheme = {
|
|
27
|
+
colors?: Record<string, string>;
|
|
28
|
+
fonts?: {
|
|
29
|
+
heading?: string;
|
|
30
|
+
body?: string;
|
|
31
|
+
mono?: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export type PresentationSlide = {
|
|
35
|
+
id: string;
|
|
36
|
+
title?: string;
|
|
37
|
+
notes?: string;
|
|
38
|
+
background?: string;
|
|
39
|
+
elements: PresentationElement[];
|
|
40
|
+
};
|
|
41
|
+
type Frame = {
|
|
42
|
+
x: number;
|
|
43
|
+
y: number;
|
|
44
|
+
width: number;
|
|
45
|
+
height: number;
|
|
46
|
+
};
|
|
47
|
+
type BaseElement = Frame & {
|
|
48
|
+
id: string;
|
|
49
|
+
altText?: string;
|
|
50
|
+
name?: string;
|
|
51
|
+
hidden?: boolean;
|
|
52
|
+
rotation?: number;
|
|
53
|
+
};
|
|
54
|
+
export type TextElement = BaseElement & {
|
|
55
|
+
type: "text";
|
|
56
|
+
text: string;
|
|
57
|
+
fontFamily?: string;
|
|
58
|
+
fontSize?: number;
|
|
59
|
+
color?: string;
|
|
60
|
+
bold?: boolean;
|
|
61
|
+
italic?: boolean;
|
|
62
|
+
align?: "left" | "center" | "right" | "justify";
|
|
63
|
+
verticalAlign?: "top" | "middle" | "bottom";
|
|
64
|
+
link?: string;
|
|
65
|
+
};
|
|
66
|
+
export type ShapeElement = BaseElement & {
|
|
67
|
+
type: "shape";
|
|
68
|
+
shape: "rectangle" | "roundRectangle" | "ellipse" | "triangle" | "chevron";
|
|
69
|
+
fill?: string;
|
|
70
|
+
stroke?: string;
|
|
71
|
+
strokeWidth?: number;
|
|
72
|
+
};
|
|
73
|
+
export type LineElement = BaseElement & {
|
|
74
|
+
type: "line";
|
|
75
|
+
stroke?: string;
|
|
76
|
+
strokeWidth?: number;
|
|
77
|
+
dash?: "solid" | "dash" | "dot";
|
|
78
|
+
beginArrow?: boolean;
|
|
79
|
+
endArrow?: boolean;
|
|
80
|
+
};
|
|
81
|
+
export type ImageElement = BaseElement & {
|
|
82
|
+
type: "image";
|
|
83
|
+
source: string;
|
|
84
|
+
fit?: "contain" | "cover" | "stretch";
|
|
85
|
+
link?: string;
|
|
86
|
+
};
|
|
87
|
+
export type TableElement = BaseElement & {
|
|
88
|
+
type: "table";
|
|
89
|
+
rows: Array<Array<string | number | boolean | null>>;
|
|
90
|
+
headerRows?: number;
|
|
91
|
+
};
|
|
92
|
+
export type ChartElement = BaseElement & {
|
|
93
|
+
type: "chart";
|
|
94
|
+
chart: "bar" | "column" | "line" | "area" | "pie" | "doughnut" | "scatter";
|
|
95
|
+
categories?: string[];
|
|
96
|
+
series: Array<{
|
|
97
|
+
name: string;
|
|
98
|
+
values: Array<number | null>;
|
|
99
|
+
xValues?: Array<number | null>;
|
|
100
|
+
}>;
|
|
101
|
+
showLegend?: boolean;
|
|
102
|
+
showValues?: boolean;
|
|
103
|
+
};
|
|
104
|
+
export type PresentationElement = TextElement | ShapeElement | LineElement | ImageElement | TableElement | ChartElement;
|
|
105
|
+
export type PresentationDiagnostic = {
|
|
106
|
+
code: "invalid_type" | "invalid_value" | "unsupported_version" | "duplicate_id" | "limit_exceeded" | "out_of_bounds";
|
|
107
|
+
severity: "error" | "warning";
|
|
108
|
+
path: string;
|
|
109
|
+
message: string;
|
|
110
|
+
};
|
|
111
|
+
export type PresentationValidationResult = {
|
|
112
|
+
valid: true;
|
|
113
|
+
spec: PresentationSpec;
|
|
114
|
+
diagnostics: PresentationDiagnostic[];
|
|
115
|
+
} | {
|
|
116
|
+
valid: false;
|
|
117
|
+
diagnostics: PresentationDiagnostic[];
|
|
118
|
+
};
|
|
119
|
+
export declare function validatePresentationSpec(input: unknown): PresentationValidationResult;
|
|
120
|
+
export {};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/** Versioned, renderer-independent contract for structured presentation tools. */
|
|
2
|
+
export const PRESENTATION_SPEC_VERSION = 1;
|
|
3
|
+
export const PRESENTATION_LIMITS = {
|
|
4
|
+
maxSlides: 200,
|
|
5
|
+
maxElementsPerSlide: 500,
|
|
6
|
+
maxTextCharacters: 100_000,
|
|
7
|
+
maxTableCells: 10_000,
|
|
8
|
+
maxChartPoints: 20_000,
|
|
9
|
+
};
|
|
10
|
+
const ELEMENT_TYPES = new Set(["text", "shape", "line", "image", "table", "chart"]);
|
|
11
|
+
const ID_PATTERN = /^[A-Za-z][A-Za-z0-9._-]{0,127}$/;
|
|
12
|
+
export function validatePresentationSpec(input) {
|
|
13
|
+
const diagnostics = [];
|
|
14
|
+
const error = (code, path, message) => diagnostics.push({ code, severity: "error", path, message });
|
|
15
|
+
if (!isObject(input)) {
|
|
16
|
+
error("invalid_type", "$", "Presentation spec must be an object.");
|
|
17
|
+
return { valid: false, diagnostics };
|
|
18
|
+
}
|
|
19
|
+
if (input.version !== PRESENTATION_SPEC_VERSION) {
|
|
20
|
+
error("unsupported_version", "$.version", `Only presentation spec version ${PRESENTATION_SPEC_VERSION} is supported.`);
|
|
21
|
+
}
|
|
22
|
+
const canvas = input.canvas;
|
|
23
|
+
if (!isObject(canvas))
|
|
24
|
+
error("invalid_type", "$.canvas", "Canvas must be an object.");
|
|
25
|
+
else {
|
|
26
|
+
positiveNumber(canvas.width, "$.canvas.width", error);
|
|
27
|
+
positiveNumber(canvas.height, "$.canvas.height", error);
|
|
28
|
+
}
|
|
29
|
+
if (!Array.isArray(input.slides)) {
|
|
30
|
+
error("invalid_type", "$.slides", "Slides must be an array.");
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
if (input.slides.length > PRESENTATION_LIMITS.maxSlides) {
|
|
34
|
+
error("limit_exceeded", "$.slides", `A deck may contain at most ${PRESENTATION_LIMITS.maxSlides} slides.`);
|
|
35
|
+
}
|
|
36
|
+
const ids = new Set();
|
|
37
|
+
input.slides.forEach((slide, slideIndex) => validateSlide(slide, slideIndex, canvas, ids, error));
|
|
38
|
+
}
|
|
39
|
+
if (input.theme !== undefined)
|
|
40
|
+
validateTheme(input.theme, error);
|
|
41
|
+
return diagnostics.some((item) => item.severity === "error")
|
|
42
|
+
? { valid: false, diagnostics }
|
|
43
|
+
: { valid: true, spec: input, diagnostics };
|
|
44
|
+
}
|
|
45
|
+
function validateSlide(slide, index, canvas, ids, error) {
|
|
46
|
+
const path = `$.slides[${index}]`;
|
|
47
|
+
if (!isObject(slide))
|
|
48
|
+
return error("invalid_type", path, "Slide must be an object.");
|
|
49
|
+
validateId(slide.id, `${path}.id`, ids, error);
|
|
50
|
+
if (!Array.isArray(slide.elements))
|
|
51
|
+
return error("invalid_type", `${path}.elements`, "Elements must be an array.");
|
|
52
|
+
if (slide.elements.length > PRESENTATION_LIMITS.maxElementsPerSlide) {
|
|
53
|
+
error("limit_exceeded", `${path}.elements`, `A slide may contain at most ${PRESENTATION_LIMITS.maxElementsPerSlide} elements.`);
|
|
54
|
+
}
|
|
55
|
+
slide.elements.forEach((element, elementIndex) => validateElement(element, `${path}.elements[${elementIndex}]`, canvas, ids, error));
|
|
56
|
+
}
|
|
57
|
+
function validateElement(element, path, canvas, ids, error) {
|
|
58
|
+
if (!isObject(element))
|
|
59
|
+
return error("invalid_type", path, "Element must be an object.");
|
|
60
|
+
validateId(element.id, `${path}.id`, ids, error);
|
|
61
|
+
if (typeof element.type !== "string" || !ELEMENT_TYPES.has(element.type)) {
|
|
62
|
+
error("invalid_value", `${path}.type`, "Element type is not supported.");
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
for (const key of ["x", "y", "width", "height"])
|
|
66
|
+
positiveNumber(element[key], `${path}.${key}`, error, key === "x" || key === "y");
|
|
67
|
+
if (isObject(canvas) && finite(element.x) && finite(element.y) && finite(element.width) && finite(element.height)
|
|
68
|
+
&& finite(canvas.width) && finite(canvas.height)
|
|
69
|
+
&& (element.x < 0 || element.y < 0 || element.x + element.width > canvas.width || element.y + element.height > canvas.height)) {
|
|
70
|
+
error("out_of_bounds", path, "Element frame must fit within the canvas.");
|
|
71
|
+
}
|
|
72
|
+
if (element.type === "text") {
|
|
73
|
+
if (typeof element.text !== "string")
|
|
74
|
+
error("invalid_type", `${path}.text`, "Text must be a string.");
|
|
75
|
+
else if (element.text.length > PRESENTATION_LIMITS.maxTextCharacters)
|
|
76
|
+
error("limit_exceeded", `${path}.text`, "Text is too long.");
|
|
77
|
+
}
|
|
78
|
+
else if (element.type === "image") {
|
|
79
|
+
if (typeof element.source !== "string" || !element.source.trim())
|
|
80
|
+
error("invalid_value", `${path}.source`, "Image source is required.");
|
|
81
|
+
if (!element.altText)
|
|
82
|
+
error("invalid_value", `${path}.altText`, "Images require alt text.");
|
|
83
|
+
}
|
|
84
|
+
else if (element.type === "table") {
|
|
85
|
+
if (!Array.isArray(element.rows))
|
|
86
|
+
error("invalid_type", `${path}.rows`, "Table rows must be an array.");
|
|
87
|
+
else if (element.rows.reduce((sum, row) => sum + (Array.isArray(row) ? row.length : 0), 0) > PRESENTATION_LIMITS.maxTableCells)
|
|
88
|
+
error("limit_exceeded", `${path}.rows`, "Table contains too many cells.");
|
|
89
|
+
}
|
|
90
|
+
else if (element.type === "chart")
|
|
91
|
+
validateChart(element, path, error);
|
|
92
|
+
}
|
|
93
|
+
function validateChart(chart, path, error) {
|
|
94
|
+
if (!Array.isArray(chart.series) || chart.series.length === 0)
|
|
95
|
+
return error("invalid_value", `${path}.series`, "Chart requires at least one series.");
|
|
96
|
+
let points = 0;
|
|
97
|
+
for (const [index, series] of chart.series.entries()) {
|
|
98
|
+
if (!isObject(series) || typeof series.name !== "string" || !Array.isArray(series.values)) {
|
|
99
|
+
error("invalid_type", `${path}.series[${index}]`, "Series requires a name and numeric values.");
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
if (series.values.some((value) => value !== null && !finite(value)))
|
|
103
|
+
error("invalid_value", `${path}.series[${index}].values`, "Chart values must be finite numbers or null.");
|
|
104
|
+
points += series.values.length;
|
|
105
|
+
}
|
|
106
|
+
if (points > PRESENTATION_LIMITS.maxChartPoints)
|
|
107
|
+
error("limit_exceeded", `${path}.series`, "Chart contains too many data points.");
|
|
108
|
+
}
|
|
109
|
+
function validateTheme(theme, error) {
|
|
110
|
+
if (!isObject(theme))
|
|
111
|
+
return error("invalid_type", "$.theme", "Theme must be an object.");
|
|
112
|
+
if (theme.colors !== undefined && (!isObject(theme.colors) || Object.values(theme.colors).some((value) => typeof value !== "string"))) {
|
|
113
|
+
error("invalid_type", "$.theme.colors", "Theme colors must map token names to color strings.");
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function validateId(value, path, ids, error) {
|
|
117
|
+
if (typeof value !== "string" || !ID_PATTERN.test(value))
|
|
118
|
+
return error("invalid_value", path, "ID must start with a letter and contain only letters, digits, dot, underscore, or hyphen.");
|
|
119
|
+
if (ids.has(value))
|
|
120
|
+
error("duplicate_id", path, `ID '${value}' is already used in this deck.`);
|
|
121
|
+
ids.add(value);
|
|
122
|
+
}
|
|
123
|
+
function positiveNumber(value, path, error, allowZero = false) {
|
|
124
|
+
if (!finite(value) || (allowZero ? value < 0 : value <= 0))
|
|
125
|
+
error("invalid_value", path, allowZero ? "Value must be a non-negative finite number." : "Value must be a positive finite number.");
|
|
126
|
+
}
|
|
127
|
+
function finite(value) { return typeof value === "number" && Number.isFinite(value); }
|
|
128
|
+
function isObject(value) { return typeof value === "object" && value !== null && !Array.isArray(value); }
|
package/dist/server/runtime.d.ts
CHANGED
|
@@ -512,6 +512,19 @@ export declare const catalogKey: (selection?: ModelSelection) => string;
|
|
|
512
512
|
* warning on a path that is genuinely optional rather than a startup crash on a build that skipped it.
|
|
513
513
|
*/
|
|
514
514
|
export declare function taskExtensionPath(from?: string): string;
|
|
515
|
+
/**
|
|
516
|
+
* The document extension's file, resolved the same way the task extension's is: two `..` segments
|
|
517
|
+
* from `import.meta.dirname` reach the repository root both after `tsc -b` and under `tsx watch`.
|
|
518
|
+
*/
|
|
519
|
+
export declare function documentExtensionPath(from?: string): string;
|
|
520
|
+
/**
|
|
521
|
+
* The Feishu extension's file, resolved the same way the document extension's is.
|
|
522
|
+
*
|
|
523
|
+
* Named on both sides of the wire rather than imported by the extension, for the reason every one
|
|
524
|
+
* of these names is written out twice: `agents/` is loaded by Pi's module loader and `src/` by
|
|
525
|
+
* tsc, so a relative import across the two would resolve differently under each.
|
|
526
|
+
*/
|
|
527
|
+
export declare function feishuExtensionPath(from?: string): string;
|
|
515
528
|
export declare class PiRpcRuntime implements AgentRuntime {
|
|
516
529
|
private readonly sessionDir;
|
|
517
530
|
/**
|
|
@@ -635,6 +648,10 @@ export declare class PiRpcRuntime implements AgentRuntime {
|
|
|
635
648
|
private modelEpoch;
|
|
636
649
|
/** Latches the "no extension on disk" warning, so it is said once rather than once per turn. */
|
|
637
650
|
private warnedMissingExtension;
|
|
651
|
+
/** Latches the "the document extension is missing" warning, for the same reason. */
|
|
652
|
+
private warnedMissingDocumentExtension;
|
|
653
|
+
/** Latches the "the Feishu extension is missing" warning, for the same reason. */
|
|
654
|
+
private warnedMissingFeishuExtension;
|
|
638
655
|
/** Latches the "Pi's SDK is not installed" warning, for the same reason. */
|
|
639
656
|
private warnedMissingSdk;
|
|
640
657
|
/**
|
|
@@ -701,6 +718,8 @@ export declare class PiRpcRuntime implements AgentRuntime {
|
|
|
701
718
|
workflowEndpoint?: string;
|
|
702
719
|
questionEndpoint?: string;
|
|
703
720
|
toolsEndpoint?: string;
|
|
721
|
+
documentsEndpoint?: string;
|
|
722
|
+
scheduledTaskEndpoint?: string;
|
|
704
723
|
uploadsDir?: string;
|
|
705
724
|
sessionFactory?: PiSessionFactory;
|
|
706
725
|
sessionMode?: "sdk" | "oneshot";
|
|
@@ -784,6 +803,28 @@ export declare class PiRpcRuntime implements AgentRuntime {
|
|
|
784
803
|
* knowing and worth not repeating on every keystroke.
|
|
785
804
|
*/
|
|
786
805
|
private taskExtensionArgs;
|
|
806
|
+
/**
|
|
807
|
+
* The document extension's spawn argument.
|
|
808
|
+
*
|
|
809
|
+
* IT IS MOUNTED UNCONDITIONALLY, unlike the knowledge extension. The knowledge extension is only
|
|
810
|
+
* worth mounting when the workspace HAS documents, because its tool returns nothing otherwise; the
|
|
811
|
+
* document tools are about the files in the workspace, and a workspace with no PDF in it is exactly
|
|
812
|
+
* the workspace where an agent might be asked to WRITE one.
|
|
813
|
+
*
|
|
814
|
+
* The endpoint is the gate: without it the extension returns without registering anything, so a
|
|
815
|
+
* runtime with no document endpoint mounts nothing rather than a tool whose every call fails.
|
|
816
|
+
*/
|
|
817
|
+
private documentExtensionArgs;
|
|
818
|
+
/**
|
|
819
|
+
* The Feishu extension's spawn argument.
|
|
820
|
+
*
|
|
821
|
+
* MOUNTED UNCONDITIONALLY, for the same reason the document tools are: the endpoint is the gate,
|
|
822
|
+
* and the extension registers nothing without it. The credential is NOT the gate - a user who
|
|
823
|
+
* has not configured an application yet still gets the tools, because the error those tools
|
|
824
|
+
* return is the one that tells the user what to do, and a tool that is simply absent cannot say
|
|
825
|
+
* anything at all.
|
|
826
|
+
*/
|
|
827
|
+
private feishuExtensionArgs;
|
|
787
828
|
/**
|
|
788
829
|
* The five values the extension reads out of its own environment. See `task-tool.ts` for why they are
|
|
789
830
|
* written out on both sides rather than imported.
|
|
@@ -906,7 +947,33 @@ export declare class PiRpcRuntime implements AgentRuntime {
|
|
|
906
947
|
* because `toolFlags` treats an explicit false as outranking a host extra.
|
|
907
948
|
*/
|
|
908
949
|
private extensionToolNames;
|
|
950
|
+
/**
|
|
951
|
+
* A TURN, WITH THE REASONING TAKEN OUT OF THE ANSWER.
|
|
952
|
+
*
|
|
953
|
+
* This is the ONE place every turn passes through, whichever path it runs on - the persistent
|
|
954
|
+
* session or a one-shot process - so it is where the model's own text is read once and read
|
|
955
|
+
* properly.
|
|
956
|
+
*
|
|
957
|
+
* WHAT IT DOES. A model that has no reasoning channel answers in one stream of text and marks its
|
|
958
|
+
* thinking up inside it with `<think>…</think>`. Pi's adapter passes that through as ordinary
|
|
959
|
+
* text, because Pi only knows the four reasoning FIELDS a provider can use and a tag is not one
|
|
960
|
+
* of them. Left alone, the reasoning would be drawn as part of the answer, unlabelled, with the
|
|
961
|
+
* tags in it.
|
|
962
|
+
*
|
|
963
|
+
* WHY IT IS HERE AND NOT IN THE USER'S `models.json`. The alternative is to tell every reader to
|
|
964
|
+
* go and set a vendor-specific switch in a file Super Pi owns but Pi reads. A user who never
|
|
965
|
+
* hears of it sees a broken transcript and has no way to find out why. Super Pi reads the tags
|
|
966
|
+
* itself, for every provider, so the transcript reads the same way whichever endpoint is behind
|
|
967
|
+
* it - and the reasoning goes where the reasoning goes: into a thinking block, over the same
|
|
968
|
+
* channel Pi's own reasoning events use, so the fold, the live indicator and the persisted
|
|
969
|
+
* transcript all work without knowing where the reasoning came from.
|
|
970
|
+
*/
|
|
909
971
|
answer(input: AnswerInput): AsyncIterable<string>;
|
|
972
|
+
/**
|
|
973
|
+
* THE TURN ITSELF, on whichever path it runs. See `answer`, which is the seam the reasoning is
|
|
974
|
+
* separated at.
|
|
975
|
+
*/
|
|
976
|
+
private answerTurn;
|
|
910
977
|
/**
|
|
911
978
|
* The one-shot path: a fresh child process for a single turn.
|
|
912
979
|
*
|