@usepipr/sdk 0.4.2 → 0.5.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/dist/config-STm6gTIf.mjs +110 -0
- package/dist/config-STm6gTIf.mjs.map +1 -0
- package/dist/{index-D_XmBHeL.d.mts → index-D9q-ZDr-.d.mts} +138 -39
- package/dist/index-D9q-ZDr-.d.mts.map +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +245 -44
- package/dist/index.mjs.map +1 -1
- package/dist/internal.d.mts +35 -8
- package/dist/internal.d.mts.map +1 -1
- package/dist/internal.mjs +2 -2
- package/dist/internal.mjs.map +1 -1
- package/package.json +3 -2
- package/dist/config-Ct0Qfa_b.mjs +0 -56
- package/dist/config-Ct0Qfa_b.mjs.map +0 -1
- package/dist/index-D_XmBHeL.d.mts.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 pipr contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
//#region src/command-grammar.ts
|
|
2
|
+
function commandPatternParts(pattern) {
|
|
3
|
+
return pattern.match(/\[[^\]]+\]|[^\s]+/g) ?? [];
|
|
4
|
+
}
|
|
5
|
+
function tokenizeCommandPattern(value) {
|
|
6
|
+
return value.trim().split(/\s+/).filter(Boolean);
|
|
7
|
+
}
|
|
8
|
+
function unsupportedCommandRestCaptureError(pattern) {
|
|
9
|
+
const parts = commandPatternParts(pattern);
|
|
10
|
+
for (const [index, part] of parts.entries()) {
|
|
11
|
+
if (isOptionalCommandPatternPart(part)) {
|
|
12
|
+
const optionalRest = tokenizeCommandPattern(part.slice(1, -1)).find(isCommandRestCaptureToken);
|
|
13
|
+
if (optionalRest) return finalRequiredRestCaptureMessage(optionalRest);
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
if (isCommandRestCaptureToken(part) && index !== parts.length - 1) return finalRequiredRestCaptureMessage(part);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function assertSupportedCommandRestCapture(pattern) {
|
|
20
|
+
const error = unsupportedCommandRestCaptureError(pattern);
|
|
21
|
+
if (error) throw new Error(error);
|
|
22
|
+
}
|
|
23
|
+
function isOptionalCommandPatternPart(value) {
|
|
24
|
+
return value.startsWith("[") && value.endsWith("]");
|
|
25
|
+
}
|
|
26
|
+
function isCommandCaptureToken(value) {
|
|
27
|
+
return /^<[a-z0-9-]+(\.\.\.)?>$/.test(value);
|
|
28
|
+
}
|
|
29
|
+
function isCommandRestCaptureToken(value) {
|
|
30
|
+
return /^<[a-z0-9-]+\.\.\.>$/.test(value);
|
|
31
|
+
}
|
|
32
|
+
function finalRequiredRestCaptureMessage(token) {
|
|
33
|
+
return `Rest capture '${token}' must be the final required command pattern token`;
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/internal-contract.ts
|
|
37
|
+
const configFactoryBrand = Symbol.for("pipr.config.factory");
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/prompt-json.ts
|
|
40
|
+
const promptJsonSerializationError = "Prompt value must be JSON-serializable";
|
|
41
|
+
const unsupportedJsonCollectionTypes = [
|
|
42
|
+
Map,
|
|
43
|
+
Set,
|
|
44
|
+
WeakMap,
|
|
45
|
+
WeakSet
|
|
46
|
+
];
|
|
47
|
+
/** Serializes one prompt JSON value without silently dropping unsupported data. */
|
|
48
|
+
function serializePromptJson(value, pretty) {
|
|
49
|
+
try {
|
|
50
|
+
assertJsonSerializable(value, /* @__PURE__ */ new Set());
|
|
51
|
+
const rendered = JSON.stringify(value, strictJsonReplacer, pretty ? 2 : 0);
|
|
52
|
+
if (rendered === void 0) throw new Error(promptJsonSerializationError);
|
|
53
|
+
return rendered;
|
|
54
|
+
} catch {
|
|
55
|
+
throw new Error(promptJsonSerializationError);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function assertJsonSerializable(value, ancestors) {
|
|
59
|
+
assertJsonPrimitive(value);
|
|
60
|
+
if (typeof value !== "object" || value === null) return;
|
|
61
|
+
if (ancestors.has(value)) throw new Error(promptJsonSerializationError);
|
|
62
|
+
assertJsonObjectShape(value);
|
|
63
|
+
ancestors.add(value);
|
|
64
|
+
for (const key of Reflect.ownKeys(value)) {
|
|
65
|
+
if (!Object.prototype.propertyIsEnumerable.call(value, key)) continue;
|
|
66
|
+
if (typeof key === "symbol") throw new Error(promptJsonSerializationError);
|
|
67
|
+
assertJsonSerializable(Reflect.get(value, key), ancestors);
|
|
68
|
+
}
|
|
69
|
+
ancestors.delete(value);
|
|
70
|
+
}
|
|
71
|
+
function assertJsonObjectShape(value) {
|
|
72
|
+
if (unsupportedJsonCollectionTypes.some((Collection) => value instanceof Collection)) throw new Error(promptJsonSerializationError);
|
|
73
|
+
if (Array.isArray(value) && Object.keys(value).some((key) => !isSerializedArrayIndex(value, key))) throw new Error(promptJsonSerializationError);
|
|
74
|
+
}
|
|
75
|
+
function isSerializedArrayIndex(value, key) {
|
|
76
|
+
const index = Number(key);
|
|
77
|
+
return Number.isInteger(index) && index >= 0 && String(index) === key && index < value.length;
|
|
78
|
+
}
|
|
79
|
+
function strictJsonReplacer(_key, value) {
|
|
80
|
+
assertJsonPrimitive(value);
|
|
81
|
+
if (typeof value === "object" && value !== null) {
|
|
82
|
+
assertJsonObjectShape(value);
|
|
83
|
+
if (Object.getOwnPropertySymbols(value).some((key) => Object.prototype.propertyIsEnumerable.call(value, key))) throw new Error(promptJsonSerializationError);
|
|
84
|
+
}
|
|
85
|
+
return value;
|
|
86
|
+
}
|
|
87
|
+
function assertJsonPrimitive(value) {
|
|
88
|
+
const type = typeof value;
|
|
89
|
+
if (type === "undefined" || type === "function" || type === "symbol" || type === "bigint") throw new Error(promptJsonSerializationError);
|
|
90
|
+
if (type === "number" && !Number.isFinite(value)) throw new Error(promptJsonSerializationError);
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/prompt-render.ts
|
|
94
|
+
/** Renders a prompt source/value into plain text for Pi prompts. */
|
|
95
|
+
function renderPromptValue(value) {
|
|
96
|
+
if (value === void 0 || value === null) return "";
|
|
97
|
+
if (typeof value === "string") return value;
|
|
98
|
+
if (typeof value === "number") return serializePromptJson(value, false);
|
|
99
|
+
if (typeof value === "boolean") return String(value);
|
|
100
|
+
if (typeof value === "object" && value !== null && Reflect.get(value, "kind") === "pipr.prompt") return value.value;
|
|
101
|
+
return serializePromptJson(value, true);
|
|
102
|
+
}
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region src/types/config.ts
|
|
105
|
+
const defaultMaxStoredFindings = 50;
|
|
106
|
+
const maxStoredFindingsLimit = 100;
|
|
107
|
+
//#endregion
|
|
108
|
+
export { configFactoryBrand as a, isCommandCaptureToken as c, tokenizeCommandPattern as d, unsupportedCommandRestCaptureError as f, serializePromptJson as i, isCommandRestCaptureToken as l, maxStoredFindingsLimit as n, assertSupportedCommandRestCapture as o, renderPromptValue as r, commandPatternParts as s, defaultMaxStoredFindings as t, isOptionalCommandPatternPart as u };
|
|
109
|
+
|
|
110
|
+
//# sourceMappingURL=config-STm6gTIf.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-STm6gTIf.mjs","names":[],"sources":["../src/command-grammar.ts","../src/internal-contract.ts","../src/prompt-json.ts","../src/prompt-render.ts","../src/types/config.ts"],"sourcesContent":["export function commandPatternParts(pattern: string): string[] {\n return pattern.match(/\\[[^\\]]+\\]|[^\\s]+/g) ?? [];\n}\n\nexport function tokenizeCommandPattern(value: string): string[] {\n return value.trim().split(/\\s+/).filter(Boolean);\n}\n\nexport function unsupportedCommandRestCaptureError(pattern: string): string | undefined {\n const parts = commandPatternParts(pattern);\n for (const [index, part] of parts.entries()) {\n if (isOptionalCommandPatternPart(part)) {\n const optionalRest = tokenizeCommandPattern(part.slice(1, -1)).find(\n isCommandRestCaptureToken,\n );\n if (optionalRest) {\n return finalRequiredRestCaptureMessage(optionalRest);\n }\n continue;\n }\n if (isCommandRestCaptureToken(part) && index !== parts.length - 1) {\n return finalRequiredRestCaptureMessage(part);\n }\n }\n return undefined;\n}\n\nexport function assertSupportedCommandRestCapture(pattern: string): void {\n const error = unsupportedCommandRestCaptureError(pattern);\n if (error) {\n throw new Error(error);\n }\n}\n\nexport function isOptionalCommandPatternPart(value: string): boolean {\n return value.startsWith(\"[\") && value.endsWith(\"]\");\n}\n\nexport function isCommandCaptureToken(value: string): boolean {\n return /^<[a-z0-9-]+(\\.\\.\\.)?>$/.test(value);\n}\n\nexport function isCommandRestCaptureToken(value: string): boolean {\n return /^<[a-z0-9-]+\\.\\.\\.>$/.test(value);\n}\n\nfunction finalRequiredRestCaptureMessage(token: string): string {\n return `Rest capture '${token}' must be the final required command pattern token`;\n}\n","import type { RuntimePlan } from \"./runtime-contract.js\";\n\nexport const configFactoryBrand = Symbol.for(\"pipr.config.factory\");\n\nexport type ConfigFactoryValue = {\n readonly kind: \"pipr.config-factory\";\n};\n\nexport type InternalPiprConfigFactory = ConfigFactoryValue & {\n readonly [configFactoryBrand]: true;\n build(): RuntimePlan;\n};\n","const promptJsonSerializationError = \"Prompt value must be JSON-serializable\";\nconst unsupportedJsonCollectionTypes = [Map, Set, WeakMap, WeakSet] as const;\n\n/** Serializes one prompt JSON value without silently dropping unsupported data. */\nexport function serializePromptJson(value: unknown, pretty: boolean): string {\n try {\n assertJsonSerializable(value, new Set<object>());\n const rendered = JSON.stringify(value, strictJsonReplacer, pretty ? 2 : 0);\n if (rendered === undefined) {\n throw new Error(promptJsonSerializationError);\n }\n return rendered;\n } catch {\n throw new Error(promptJsonSerializationError);\n }\n}\n\nfunction assertJsonSerializable(value: unknown, ancestors: Set<object>): void {\n assertJsonPrimitive(value);\n if (typeof value !== \"object\" || value === null) {\n return;\n }\n if (ancestors.has(value)) {\n throw new Error(promptJsonSerializationError);\n }\n assertJsonObjectShape(value);\n ancestors.add(value);\n for (const key of Reflect.ownKeys(value)) {\n if (!Object.prototype.propertyIsEnumerable.call(value, key)) {\n continue;\n }\n if (typeof key === \"symbol\") {\n throw new Error(promptJsonSerializationError);\n }\n assertJsonSerializable(Reflect.get(value, key), ancestors);\n }\n ancestors.delete(value);\n}\n\nfunction assertJsonObjectShape(value: object): void {\n if (unsupportedJsonCollectionTypes.some((Collection) => value instanceof Collection)) {\n throw new Error(promptJsonSerializationError);\n }\n if (\n Array.isArray(value) &&\n Object.keys(value).some((key) => !isSerializedArrayIndex(value, key))\n ) {\n throw new Error(promptJsonSerializationError);\n }\n}\n\nfunction isSerializedArrayIndex(value: unknown[], key: string): boolean {\n const index = Number(key);\n return Number.isInteger(index) && index >= 0 && String(index) === key && index < value.length;\n}\n\nfunction strictJsonReplacer(_key: string, value: unknown): unknown {\n assertJsonPrimitive(value);\n if (typeof value === \"object\" && value !== null) {\n assertJsonObjectShape(value);\n if (\n Object.getOwnPropertySymbols(value).some((key) =>\n Object.prototype.propertyIsEnumerable.call(value, key),\n )\n ) {\n throw new Error(promptJsonSerializationError);\n }\n }\n return value;\n}\n\nfunction assertJsonPrimitive(value: unknown): void {\n const type = typeof value;\n if (type === \"undefined\" || type === \"function\" || type === \"symbol\" || type === \"bigint\") {\n throw new Error(promptJsonSerializationError);\n }\n if (type === \"number\" && !Number.isFinite(value)) {\n throw new Error(promptJsonSerializationError);\n }\n}\n","import type { PromptText, PromptValue } from \"./index.js\";\nimport { serializePromptJson } from \"./prompt-json.js\";\n\n/** Renders a prompt source/value into plain text for Pi prompts. */\nexport function renderPromptValue(value: PromptValue): string {\n if (value === undefined || value === null) {\n return \"\";\n }\n if (typeof value === \"string\") {\n return value;\n }\n if (typeof value === \"number\") {\n return serializePromptJson(value, false);\n }\n if (typeof value === \"boolean\") {\n return String(value);\n }\n if (typeof value === \"object\" && value !== null && Reflect.get(value, \"kind\") === \"pipr.prompt\") {\n return (value as PromptText).value;\n }\n return serializePromptJson(value, true);\n}\n","import type { RuntimeLimits } from \"./manifest.js\";\n\nexport const defaultMaxStoredFindings = 50;\nexport const maxStoredFindingsLimit = 100;\n\n/** Repository permission levels used to authorize pipr commands. */\nexport type RepositoryPermission = \"read\" | \"triage\" | \"write\" | \"maintain\" | \"admin\";\n\n/** Pull request lifecycle actions that can trigger change-request tasks. */\nexport type ChangeRequestAction = \"opened\" | \"updated\" | \"reopened\" | \"ready\" | \"closed\";\n\n/** Duration accepted by timeout options, either seconds as a number or a suffixed string. */\nexport type DurationInput = number | `${number}s` | `${number}m` | `${number}h`;\n\n/** Reference to a secret that pipr resolves from the runtime environment. */\nexport type SecretRef = {\n readonly kind: \"pipr.secret\";\n readonly name: string;\n};\n\n/** Options for declaring a secret by environment variable name. */\nexport type SecretOptions = {\n name: string;\n};\n\n/** Options for registering a model provider and model id. */\nexport type ModelOptions = {\n id?: string;\n provider: string;\n model: string;\n apiKey?: SecretRef;\n options?: Record<string, unknown>;\n};\n\n/** Registered model profile that can be used by reviewers and agents. */\nexport type ModelProfile = {\n readonly kind: \"pipr.model\";\n readonly id: string;\n readonly provider: string;\n readonly model: string;\n readonly apiKey?: SecretRef;\n readonly options?: Record<string, unknown>;\n};\n\n/** Aggregate check-run options for a Pipr review run. */\nexport type AggregateCheckOptions =\n | false\n | {\n enabled?: boolean;\n name?: string;\n };\n\n/** Check-run settings for a pipr config. */\nexport type ChecksOptions = {\n aggregate?: AggregateCheckOptions;\n};\n\n/** Actor policy for auto-resolving inline review threads from user replies. */\nexport type AutoResolveAllowedActors = \"author-or-write\" | \"write\" | \"any\";\n\n/** Options controlling auto-resolve behavior for user replies. */\nexport type AutoResolveUserRepliesOptions = {\n enabled?: boolean;\n respondWhenStillValid?: boolean;\n allowedActors?: AutoResolveAllowedActors;\n};\n\n/** Options controlling automatic stale-finding resolution. */\nexport type AutoResolveOptions =\n | false\n | {\n enabled?: boolean;\n model?: ModelProfile;\n instructions?: string;\n synchronize?: boolean;\n userReplies?: boolean | AutoResolveUserRepliesOptions;\n };\n\n/** Review publication settings. */\nexport type PublicationOptions = {\n maxInlineComments?: number;\n maxStoredFindings?: number;\n autoResolve?: AutoResolveOptions;\n showHeader?: boolean;\n showFooter?: boolean;\n showStats?: boolean;\n};\n\n/** Top-level pipr config settings. */\nexport type PiprConfigOptions = {\n publication?: PublicationOptions;\n checks?: ChecksOptions;\n limits?: RuntimeLimits;\n};\n"],"mappings":";AAAA,SAAgB,oBAAoB,SAA2B;CAC7D,OAAO,QAAQ,MAAM,oBAAoB,KAAK,CAAC;AACjD;AAEA,SAAgB,uBAAuB,OAAyB;CAC9D,OAAO,MAAM,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,OAAO,OAAO;AACjD;AAEA,SAAgB,mCAAmC,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,YAAY,CAAC,OAAO,SAAS,KAAK,GAC7C,MAAM,IAAI,MAAM,4BAA4B;AAEhD;;;;AC3EA,SAAgB,kBAAkB,OAA4B;CAC5D,IAAI,UAAU,KAAA,KAAa,UAAU,MACnC,OAAO;CAET,IAAI,OAAO,UAAU,UACnB,OAAO;CAET,IAAI,OAAO,UAAU,UACnB,OAAO,oBAAoB,OAAO,KAAK;CAEzC,IAAI,OAAO,UAAU,WACnB,OAAO,OAAO,KAAK;CAErB,IAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,QAAQ,IAAI,OAAO,MAAM,MAAM,eAChF,OAAQ,MAAqB;CAE/B,OAAO,oBAAoB,OAAO,IAAI;AACxC;;;ACnBA,MAAa,2BAA2B;AACxC,MAAa,yBAAyB"}
|
|
@@ -75,11 +75,113 @@ declare function parseReviewFinding(value: unknown): ReviewFinding;
|
|
|
75
75
|
/** Returns a small valid example for the main change request review schema. */
|
|
76
76
|
declare function reviewSchemaExample(): ReviewResult;
|
|
77
77
|
//#endregion
|
|
78
|
+
//#region src/result.d.ts
|
|
79
|
+
declare const piprRunTriggers: readonly ["change-request", "command", "verifier", "local"];
|
|
80
|
+
type PiprRunTrigger = (typeof piprRunTriggers)[number];
|
|
81
|
+
type PiprRunContext = {
|
|
82
|
+
readonly id: string;
|
|
83
|
+
readonly trigger: PiprRunTrigger;
|
|
84
|
+
};
|
|
85
|
+
type PiprRunSummary = PiprRunContext & {
|
|
86
|
+
baseSha: string;
|
|
87
|
+
headSha: string;
|
|
88
|
+
tasks: string[];
|
|
89
|
+
durationMs: number;
|
|
90
|
+
models: string[];
|
|
91
|
+
agentRuns: number;
|
|
92
|
+
inputTokens: number;
|
|
93
|
+
outputTokens: number;
|
|
94
|
+
costUsd: number;
|
|
95
|
+
usageStatus: "complete" | "partial" | "unavailable";
|
|
96
|
+
};
|
|
97
|
+
type InlineCommentCounts = {
|
|
98
|
+
posted: number;
|
|
99
|
+
skipped: number;
|
|
100
|
+
failed: number;
|
|
101
|
+
};
|
|
102
|
+
type ReviewPublication = {
|
|
103
|
+
state: "disabled";
|
|
104
|
+
} | {
|
|
105
|
+
state: "completed";
|
|
106
|
+
mainComment: {
|
|
107
|
+
action: "created" | "updated";
|
|
108
|
+
};
|
|
109
|
+
inlineComments: InlineCommentCounts;
|
|
110
|
+
inlinePublicationErrorCount: number;
|
|
111
|
+
inlineResolutionErrorCount: number;
|
|
112
|
+
};
|
|
113
|
+
type PiprResult = {
|
|
114
|
+
formatVersion: 2;
|
|
115
|
+
kind: "review";
|
|
116
|
+
run: PiprRunSummary;
|
|
117
|
+
mainComment: string;
|
|
118
|
+
inlineFindings: ReviewFinding[];
|
|
119
|
+
droppedFindings: Array<{
|
|
120
|
+
finding: ReviewFinding;
|
|
121
|
+
reason: string;
|
|
122
|
+
}>;
|
|
123
|
+
taskChecks: Array<{
|
|
124
|
+
taskName: string;
|
|
125
|
+
conclusion: "success" | "failure" | "neutral";
|
|
126
|
+
summary?: string;
|
|
127
|
+
}>;
|
|
128
|
+
repairAttempted: boolean;
|
|
129
|
+
publication: ReviewPublication;
|
|
130
|
+
} | {
|
|
131
|
+
formatVersion: 2;
|
|
132
|
+
kind: "skipped";
|
|
133
|
+
reason: string;
|
|
134
|
+
} | {
|
|
135
|
+
formatVersion: 2;
|
|
136
|
+
kind: "ignored";
|
|
137
|
+
reason: string;
|
|
138
|
+
} | {
|
|
139
|
+
formatVersion: 2;
|
|
140
|
+
kind: "dry-run";
|
|
141
|
+
} | {
|
|
142
|
+
formatVersion: 2;
|
|
143
|
+
kind: "command-help";
|
|
144
|
+
reason: string;
|
|
145
|
+
mainComment: string;
|
|
146
|
+
} | {
|
|
147
|
+
formatVersion: 2;
|
|
148
|
+
kind: "command-response";
|
|
149
|
+
run: PiprRunSummary;
|
|
150
|
+
mainComment: string;
|
|
151
|
+
publication: {
|
|
152
|
+
state: "completed";
|
|
153
|
+
action: "created" | "updated";
|
|
154
|
+
};
|
|
155
|
+
} | {
|
|
156
|
+
formatVersion: 2;
|
|
157
|
+
kind: "verifier";
|
|
158
|
+
run: PiprRunSummary;
|
|
159
|
+
publication: {
|
|
160
|
+
state: "completed";
|
|
161
|
+
inlineResolutionErrorCount: number;
|
|
162
|
+
};
|
|
163
|
+
} | {
|
|
164
|
+
formatVersion: 2;
|
|
165
|
+
kind: "publication-error";
|
|
166
|
+
message: string;
|
|
167
|
+
publication?: {
|
|
168
|
+
inlineComments: InlineCommentCounts;
|
|
169
|
+
inlinePublicationErrorCount: number;
|
|
170
|
+
inlineResolutionErrorCount: number;
|
|
171
|
+
};
|
|
172
|
+
} | {
|
|
173
|
+
formatVersion: 2;
|
|
174
|
+
kind: "error";
|
|
175
|
+
message: string;
|
|
176
|
+
};
|
|
177
|
+
declare const piprResultSchema: z.ZodType<PiprResult>;
|
|
178
|
+
declare function parsePiprResult(value: unknown): PiprResult;
|
|
179
|
+
//#endregion
|
|
78
180
|
//#region src/types/manifest.d.ts
|
|
79
181
|
/** Include/exclude path filter for scoped reviews and Diff Manifest projection. */
|
|
80
182
|
type PathFilter = {
|
|
81
|
-
include?: string[];
|
|
82
|
-
exclude?: string[];
|
|
183
|
+
include?: readonly string[];
|
|
184
|
+
exclude?: readonly string[];
|
|
83
185
|
};
|
|
84
186
|
/** Side of a change request diff that a commentable range belongs to. */
|
|
85
187
|
type ReviewSide = "RIGHT" | "LEFT";
|
|
@@ -87,6 +189,12 @@ type ReviewSide = "RIGHT" | "LEFT";
|
|
|
87
189
|
type RangeKind = "added" | "deleted" | "context" | "mixed";
|
|
88
190
|
/** File lifecycle status in a Diff Manifest. */
|
|
89
191
|
type FileStatus = "added" | "modified" | "removed" | "renamed";
|
|
192
|
+
/** One changed file returned without its Diff Manifest hunks and ranges. */
|
|
193
|
+
type ChangedFile = {
|
|
194
|
+
readonly path: string;
|
|
195
|
+
readonly previousPath?: string;
|
|
196
|
+
readonly status: FileStatus;
|
|
197
|
+
};
|
|
90
198
|
/** Commentable line range that can anchor an Inline Review Comment. */
|
|
91
199
|
type CommentableRange = {
|
|
92
200
|
id: string;
|
|
@@ -119,10 +227,10 @@ type DiffManifestFile = {
|
|
|
119
227
|
language?: string;
|
|
120
228
|
additions: number;
|
|
121
229
|
deletions: number;
|
|
122
|
-
hunks: DiffHunk[];
|
|
123
|
-
commentableRanges: CommentableRange[];
|
|
124
|
-
signals?: string[];
|
|
125
|
-
changedSymbols?: string[];
|
|
230
|
+
hunks: readonly DiffHunk[];
|
|
231
|
+
commentableRanges: readonly CommentableRange[];
|
|
232
|
+
signals?: readonly string[];
|
|
233
|
+
changedSymbols?: readonly string[];
|
|
126
234
|
excludedReason?: string;
|
|
127
235
|
};
|
|
128
236
|
/** Diff Manifest exposed to reviewers and tasks. */
|
|
@@ -130,7 +238,7 @@ type DiffManifest = {
|
|
|
130
238
|
baseSha: string;
|
|
131
239
|
headSha: string;
|
|
132
240
|
mergeBaseSha: string;
|
|
133
|
-
files: DiffManifestFile[];
|
|
241
|
+
files: readonly DiffManifestFile[];
|
|
134
242
|
};
|
|
135
243
|
/** Options for projecting a Diff Manifest for task or prompt use. */
|
|
136
244
|
type DiffManifestOptions = {
|
|
@@ -257,19 +365,16 @@ type BuiltinSchemaCatalog = {
|
|
|
257
365
|
readonly review: Schema<ReviewResult>;
|
|
258
366
|
readonly summary: Schema<ReviewSummary>;
|
|
259
367
|
};
|
|
260
|
-
|
|
368
|
+
declare const agentToolHandleBrand: unique symbol;
|
|
369
|
+
/** Opaque tool handle available to Pi agents. */
|
|
261
370
|
type AgentTool<Input = unknown, Output = unknown> = {
|
|
262
371
|
readonly kind: "pipr.tool";
|
|
263
372
|
readonly name: string;
|
|
264
|
-
readonly
|
|
265
|
-
readonly input?: Schema<Input>;
|
|
266
|
-
readonly output?: Schema<Output>;
|
|
267
|
-
run?(options: ToolRunOptions<Input>): Output | Promise<Output>;
|
|
268
|
-
toModelOutput?(output: Output): PromptValue;
|
|
373
|
+
readonly [agentToolHandleBrand]: readonly [Input, Output];
|
|
269
374
|
};
|
|
270
375
|
/** Context passed to an agent prompt function. */
|
|
271
376
|
type AgentPromptContext = {
|
|
272
|
-
|
|
377
|
+
run: PiprRunContext;
|
|
273
378
|
repository: RepositoryInfo;
|
|
274
379
|
change: ChangeRequestInfo;
|
|
275
380
|
platform: PlatformInfo;
|
|
@@ -278,7 +383,7 @@ type AgentPromptContext = {
|
|
|
278
383
|
type AgentDefinition<Input, Output> = {
|
|
279
384
|
name?: string;
|
|
280
385
|
model?: ModelProfile;
|
|
281
|
-
fallbacks?: ModelProfile[];
|
|
386
|
+
fallbacks?: readonly ModelProfile[];
|
|
282
387
|
instructions: PromptSource;
|
|
283
388
|
prompt(input: Input, context: AgentPromptContext): PromptSource | Promise<PromptSource>;
|
|
284
389
|
output: Schema<Output>;
|
|
@@ -293,11 +398,12 @@ type AgentDefinition<Input, Output> = {
|
|
|
293
398
|
type AgentExtension<Input, Output> = Partial<AgentDefinition<Input, Output>> & {
|
|
294
399
|
instructions?: PromptSource;
|
|
295
400
|
};
|
|
296
|
-
|
|
401
|
+
declare const agentHandleBrand: unique symbol;
|
|
402
|
+
/** Opaque registered Pi agent with typed input and output. */
|
|
297
403
|
type Agent<Input = unknown, Output = unknown> = {
|
|
298
404
|
readonly kind: "pipr.agent";
|
|
299
405
|
readonly name?: string;
|
|
300
|
-
readonly
|
|
406
|
+
readonly [agentHandleBrand]: (input: Input) => Output;
|
|
301
407
|
extend(patch: AgentExtension<Input, Output>): Agent<Input, Output>;
|
|
302
408
|
};
|
|
303
409
|
//#endregion
|
|
@@ -338,13 +444,12 @@ type TaskDefinition<Input> = {
|
|
|
338
444
|
local?: false;
|
|
339
445
|
run: TaskHandler<Input>;
|
|
340
446
|
};
|
|
341
|
-
|
|
447
|
+
declare const taskHandleBrand: unique symbol;
|
|
448
|
+
/** Opaque registered task handle selected by change-request and command entrypoints. */
|
|
342
449
|
type Task<Input = void> = {
|
|
343
450
|
readonly kind: "pipr.task";
|
|
344
451
|
readonly name: string;
|
|
345
|
-
readonly
|
|
346
|
-
readonly local?: false;
|
|
347
|
-
readonly handler: TaskHandler<Input>;
|
|
452
|
+
readonly [taskHandleBrand]: (input: Input) => Input;
|
|
348
453
|
};
|
|
349
454
|
/** Options shared by command registrations. */
|
|
350
455
|
type CommandOptions<Input> = {
|
|
@@ -361,7 +466,7 @@ type CommandRegistrationOptions<Input> = CommandOptions<Input> & {
|
|
|
361
466
|
type ReviewerOptions = {
|
|
362
467
|
name?: string;
|
|
363
468
|
model: ModelProfile;
|
|
364
|
-
fallbacks?: ModelProfile[];
|
|
469
|
+
fallbacks?: readonly ModelProfile[];
|
|
365
470
|
instructions: PromptSource;
|
|
366
471
|
prompt?: (input: DefaultReviewInput, context: AgentPromptContext) => PromptSource | Promise<PromptSource>;
|
|
367
472
|
tools?: readonly AgentTool[];
|
|
@@ -412,6 +517,7 @@ type ReviewCommentContext = {
|
|
|
412
517
|
review: {
|
|
413
518
|
id: string;
|
|
414
519
|
};
|
|
520
|
+
run: PiprRunContext;
|
|
415
521
|
repository: RepositoryInfo;
|
|
416
522
|
change: ChangeRequestContext;
|
|
417
523
|
platform: PlatformInfo;
|
|
@@ -435,10 +541,10 @@ type ToolRunOptions<Input> = {
|
|
|
435
541
|
ctx: TaskContext;
|
|
436
542
|
signal?: AbortSignal;
|
|
437
543
|
};
|
|
438
|
-
/** Definition used to register
|
|
439
|
-
type ChangeRequestRegistrationOptions
|
|
544
|
+
/** Definition used to register an inputless task for change request actions. */
|
|
545
|
+
type ChangeRequestRegistrationOptions = {
|
|
440
546
|
actions: readonly ChangeRequestAction[];
|
|
441
|
-
task: Task<
|
|
547
|
+
task: Task<void>;
|
|
442
548
|
};
|
|
443
549
|
/** Handle for reporting task check status from inside a task. */
|
|
444
550
|
type CheckHandle = {
|
|
@@ -451,7 +557,7 @@ type PiprBuilder = {
|
|
|
451
557
|
readonly tools: BuiltinToolCatalog;
|
|
452
558
|
readonly schemas: BuiltinSchemaCatalog;
|
|
453
559
|
readonly on: {
|
|
454
|
-
changeRequest
|
|
560
|
+
changeRequest(options: ChangeRequestRegistrationOptions): void;
|
|
455
561
|
};
|
|
456
562
|
secret(options: SecretOptions): SecretRef;
|
|
457
563
|
model(options: ModelOptions): ModelProfile;
|
|
@@ -503,18 +609,13 @@ type PlatformInfo = {
|
|
|
503
609
|
/** Change-request context available inside tasks. */
|
|
504
610
|
type ChangeRequestContext = ChangeRequestInfo & {
|
|
505
611
|
diffManifest(options?: DiffManifestOptions): Promise<DiffManifest>;
|
|
506
|
-
changedFiles(): Promise<
|
|
507
|
-
path: string;
|
|
508
|
-
previousPath?: string;
|
|
509
|
-
status: string;
|
|
510
|
-
}>>;
|
|
511
|
-
currentHeadSha(): Promise<string>;
|
|
612
|
+
changedFiles(): Promise<readonly ChangedFile[]>;
|
|
512
613
|
};
|
|
513
614
|
/** Runner for invoking Pi agents from tasks. */
|
|
514
615
|
type PiRunner = {
|
|
515
616
|
run<Input, Output>(agent: Agent<Input, Output>, input: Input, options?: {
|
|
516
617
|
model?: ModelProfile;
|
|
517
|
-
fallbacks?: ModelProfile[];
|
|
618
|
+
fallbacks?: readonly ModelProfile[];
|
|
518
619
|
instructions?: PromptSource;
|
|
519
620
|
timeout?: DurationInput;
|
|
520
621
|
paths?: PathFilter;
|
|
@@ -529,10 +630,8 @@ type CommandContext = {
|
|
|
529
630
|
};
|
|
530
631
|
/** Context object passed to task handlers. */
|
|
531
632
|
type TaskContext = {
|
|
532
|
-
/** Stable
|
|
533
|
-
readonly run:
|
|
534
|
-
id: string;
|
|
535
|
-
};
|
|
633
|
+
/** Stable identity and trigger for the selected Review Run, not the process attempt. */
|
|
634
|
+
readonly run: PiprRunContext;
|
|
536
635
|
readonly repository: RepositoryInfo;
|
|
537
636
|
readonly change: ChangeRequestContext;
|
|
538
637
|
readonly platform: PlatformInfo;
|
|
@@ -571,5 +670,5 @@ declare function jsonSchema<T>(definition: JsonSchemaDefinition): Schema<T>;
|
|
|
571
670
|
/** Built-in schemas available as reusable agent output contracts. */
|
|
572
671
|
declare const schemas: BuiltinSchemaCatalog;
|
|
573
672
|
//#endregion
|
|
574
|
-
export { AutoResolveUserRepliesOptions as $, Task as A,
|
|
575
|
-
//# sourceMappingURL=index-
|
|
673
|
+
export { AutoResolveUserRepliesOptions as $, Task as A, ReviewFinding as At, AgentExtension as B, JsonObject as Bt, PriorReview as C, RuntimeLimits as Ct, ReviewRecipeOptions as D, PiprRunTrigger as Dt, ReviewEntrypoints as E, PiprRunSummary as Et, ToolRunOptions as F, parseReviewSummary as Ft, JsonPromptOptions as G, Schema as Gt, AgentTool as H, JsonSchema as Ht, defaultReviewActions as I, reviewFindingSchema as It, PromptText as J, ZodSchema as Jt, Markdown as K, SchemaDefinition as Kt, defaultReviewEntrypoints as L, reviewResultSchema as Lt, TaskContext as M, ReviewSummary as Mt, TaskDefinition as N, parseReviewFinding as Nt, Reviewer as O, parsePiprResult as Ot, TaskHandler as P, parseReviewResult as Pt, AutoResolveOptions as Q, Agent as R, reviewSchemaExample as Rt, PriorInlineFinding as S, ReviewSide as St, ReviewCommentContext as T, PiprRunContext as Tt, BuiltinSchemaCatalog as U, JsonSchemaDefinition as Ut, AgentPromptContext as V, JsonPrimitive as Vt, BuiltinToolCatalog as W, JsonValue as Wt, AggregateCheckOptions as X, PromptValue as Y, AutoResolveAllowedActors as Z, PiRunner as _, DiffManifestLimits as _t, md as a, PiprConfigOptions as at, PlatformInfo as b, PathFilter as bt, ChangeRequestContext as c, SecretOptions as ct, CheckHandle as d, maxStoredFindingsLimit as dt, ChangeRequestAction as et, CommandContext as f, ChangedFile as ft, DefaultReviewInput as g, DiffManifestFile as gt, CommentValue as h, DiffManifest as ht, schemas as i, ModelProfile as it, TaskCheckOptions as j, ReviewResult as jt, ReviewerOptions as k, piprResultSchema as kt, ChangeRequestInfo as l, SecretRef as lt, CommandRegistrationOptions as m, DiffHunk as mt, jsonSchema as n, DurationInput as nt, definePipr as o, PublicationOptions as ot, CommandOptions as p, CommentableRange as pt, PromptSource as q, SchemaParseResult as qt, schema as r, ModelOptions as rt, definePlugin as s, RepositoryPermission as st, z$1 as t, ChecksOptions as tt, ChangeRequestRegistrationOptions as u, defaultMaxStoredFindings as ut, PiprBuilder as v, DiffManifestOptions as vt, RepositoryInfo as w, PiprResult as wt, PluginToolDefinition as x, RangeKind as xt, PiprPlugin as y, FileStatus as yt, AgentDefinition as z, reviewSummarySchema as zt };
|
|
674
|
+
//# sourceMappingURL=index-D9q-ZDr-.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-D9q-ZDr-.d.mts","names":[],"sources":["../src/types/schema.ts","../src/review-contract.ts","../src/result.ts","../src/types/manifest.ts","../src/types/config.ts","../src/types/prompt.ts","../src/types/agent.ts","../src/types/task.ts","../src/builder.ts","../src/prompt.ts","../src/schema.ts"],"mappings":";;;KAGY;;KAEA,YAAY,gBAAgB,cAAc;;KAE1C;GAAgB,cAAc;;;KAE9B,aAAa;;KAGb,kBAAkB;EAAO;EAAe,MAAM;;EAAQ;EAAgB,OAAO;;;KAG7E,OAAO;WACR;WACA;WACA,aAAa;EACtB,MAAM,iBAAiB;EACvB,UAAU,iBAAiB,kBAAkB;;;KAInC,UAAU,KAAK,EAAE,QAAQ;;KAGzB,iBAAiB;EAC3B;EACA,QAAQ,UAAU;;;KAIR;EACV;EACA,QAAQ;;;;;KC/BE;EACV;EACA;;;KAIU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;;;KAIU;EACV,SAAS;EACT,gBAAgB;;;cAML,qBAAqB,UAAU;;cAM/B,qBAAqB,UAAU;;cAW/B,oBAAoB,UAAU;;iBAM3B,kBAAkB,iBAAiB;;iBAKnC,mBAAmB,iBAAiB;;iBAKpC,mBAAmB,iBAAiB;;iBAKpC,uBAAuB;;;cChEjC;KAEM,yBAAyB;KAEzB;WACD;WACA,SAAS;;KAGR,iBAAiB;EAC3B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;KAGG;EAAwB;EAAgB;EAAiB;;KACzD;EACC;;EAEA;EACA;IAAe;;EACf,gBAAgB;EAChB;EACA;;KAGM;EAEN;EACA;EACA,KAAK;EACL;EACA,gBAAgB;EAChB,iBAAiB;IAAQ,SAAS;IAAe;;EACjD,YAAY;IACV;IACA;IACA;;EAEF;EACA,aAAa;;EAEb;EAAkB;EAAiB;;EACnC;EAAkB;EAAiB;;EACnC;EAAkB;;EAClB;EAAkB;EAAsB;EAAgB;;EAExD;EACA;EACA,KAAK;EACL;EACA;IAAe;IAAoB;;;EAGnC;EACA;EACA,KAAK;EACL;IAAe;IAAoB;;;EAGnC;EACA;EACA;EACA;IACE,gBAAgB;IAChB;IACA;;;EAGF;EAAkB;EAAe;;cAwF1B,kBAAkB,EAAE,QAAQ;iBAEzB,gBAAgB,iBAAiB;;;;KCxKrC;EACV;EACA;;;KAIU;;KAGA;;KAGA;;KAGA;WACD;WACA;WACA,QAAQ;;;KAIP;EACV;EACA;EACA,MAAM;EACN;EACA;EACA,MAAM;EACN;EACA;EACA;EACA;EACA;;;KAIU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;;;KAIU;EACV;EACA;EACA,QAAQ;EACR;EACA;EACA;EACA,gBAAgB;EAChB,4BAA4B;EAC5B;EACA;EACA;;;KAIU;EACV;EACA;EACA;EACA,gBAAgB;;;KAIN;EACV;EACA;EACA;EACA,QAAQ;;;KAIE;EACV;EACA;EACA;EACA;EACA;;;KAIU;EACV;EACA,eAAe;;;;cCzFJ;cACA;;KAGD;;KAGA;;KAGA;;KAGA;WACD;WACA;;;KAIC;EACV;;;KAIU;EACV;EACA;EACA;EACA,SAAS;EACT,UAAU;;;KAIA;WACD;WACA;WACA;WACA;WACA,SAAS;WACT,UAAU;;;KAIT;EAGN;EACA;;;KAIM;EACV,YAAY;;;KAIF;;KAGA;EACV;EACA;EACA,gBAAgB;;;KAIN;EAGN;EACA,QAAQ;EACR;EACA;EACA,wBAAwB;;;KAIlB;EACV;EACA;EACA,cAAc;EACd;EACA;EACA;;;KAIU;EACV,cAAc;EACd,SAAS;EACT,S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KAIU;EACV;EACA;EACA;EACA;EACA;IAAW;;EACX;IAAQ;IAAc;;EACtB;IAAQ;IAAc;;EACtB;;;KAIU;EACV;;;KAIU,uBAAuB;EACjC,aAAa,UAAU,sBAAsB,QAAQ;EACrD,gBAAgB,iBAAiB;;;KAIvB;EACV,IAAI,OAAO,QACT,OAAO,MAAM,OAAO,SACpB,OAAO,OACP;IACE,QAAQ;IACR,qBAAqB;IACrB,eAAe;IACf,UAAU;IACV,QAAQ;MAET,QAAQ;;;KAID;WACD;WACA;WACA,WAAW;EACpB,MAAM,UAAU,WAAW;;;KAIjB;;WAED,KAAK;WACL,YAAY;WACZ,QAAQ;WACR,UAAU;WACV,IAAI;WACJ,UAAU;EACnB,OAAO,QAAQ;WACN;IACP,SAAS,QAAQ;;WAEV,OAAO;EAChB,QAAQ,OAAO,eAAe;WACrB;IACP,KAAK;IACL,KAAK;IACL,MAAM;;;;;;iBClQM,WAAW,YAAY,MAAM;WAClC;;;iBAsBK,aAAa,QAAQ,QAAQ,SAAS,gBAAgB,SAAS,WAAW;;;;iBCtE1E,GAAG,SAAS,yBAAyB,oBAAoB;;;;iBCezD,OAAO,GAAG,YAAY,iBAAiB,KAAK,OAAO;;iBASnD,WAAW,GAAG,YAAY,uBAAuB,OAAO;;cAU3D,SAAS"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as AutoResolveUserRepliesOptions, A as Task, At as
|
|
2
|
-
export { type Agent, type AgentDefinition, type AgentExtension, type AgentPromptContext, type AgentTool, type AggregateCheckOptions, type AutoResolveAllowedActors, type AutoResolveOptions, type AutoResolveUserRepliesOptions, type BuiltinSchemaCatalog, type BuiltinToolCatalog, type ChangeRequestAction, type ChangeRequestContext, type ChangeRequestInfo, type ChangeRequestRegistrationOptions, type CheckHandle, type ChecksOptions, type CommandContext, type CommandOptions, type CommandRegistrationOptions, type CommentValue, type CommentableRange, type DefaultReviewInput, type DiffHunk, type DiffManifest, type DiffManifestFile, type DiffManifestLimits, type DiffManifestOptions, type DurationInput, type FileStatus, type JsonObject, type JsonPrimitive, type JsonPromptOptions, type JsonSchema, type JsonSchemaDefinition, type JsonValue, type Markdown, type ModelOptions, type ModelProfile, type PathFilter, type PiRunner, type PiprBuilder, type PiprConfigOptions, type PiprPlugin, type PlatformInfo, type PluginToolDefinition, type PriorInlineFinding, type PriorReview, type PromptSource, type PromptText, type PromptValue, type PublicationOptions, type RangeKind, type RepositoryInfo, type RepositoryPermission, type ReviewCommentContext, type ReviewEntrypoints, type ReviewFinding, type ReviewRecipeOptions, type ReviewResult, type ReviewSide, type ReviewSummary, type Reviewer, type ReviewerOptions, type RuntimeLimits, type Schema, type SchemaDefinition, type SchemaParseResult, type SecretOptions, type SecretRef, type Task, type TaskCheckOptions, type TaskContext, type TaskDefinition, type TaskHandler, type ToolRunOptions, type ZodSchema, defaultReviewActions, defaultReviewEntrypoints, definePipr, definePlugin, jsonSchema, md, parseReviewFinding, parseReviewResult, parseReviewSummary, reviewFindingSchema, reviewResultSchema, reviewSchemaExample, reviewSummarySchema, schema, schemas, z };
|
|
1
|
+
import { $ as AutoResolveUserRepliesOptions, A as Task, At as ReviewFinding, B as AgentExtension, Bt as JsonObject, C as PriorReview, Ct as RuntimeLimits, D as ReviewRecipeOptions, Dt as PiprRunTrigger, E as ReviewEntrypoints, Et as PiprRunSummary, F as ToolRunOptions, Ft as parseReviewSummary, G as JsonPromptOptions, Gt as Schema, H as AgentTool, Ht as JsonSchema, I as defaultReviewActions, It as reviewFindingSchema, J as PromptText, Jt as ZodSchema, K as Markdown, Kt as SchemaDefinition, L as defaultReviewEntrypoints, Lt as reviewResultSchema, M as TaskContext, Mt as ReviewSummary, N as TaskDefinition, Nt as parseReviewFinding, O as Reviewer, Ot as parsePiprResult, P as TaskHandler, Pt as parseReviewResult, Q as AutoResolveOptions, R as Agent, Rt as reviewSchemaExample, S as PriorInlineFinding, St as ReviewSide, T as ReviewCommentContext, Tt as PiprRunContext, U as BuiltinSchemaCatalog, Ut as JsonSchemaDefinition, V as AgentPromptContext, Vt as JsonPrimitive, W as BuiltinToolCatalog, Wt as JsonValue, X as AggregateCheckOptions, Y as PromptValue, Z as AutoResolveAllowedActors, _ as PiRunner, _t as DiffManifestLimits, a as md, at as PiprConfigOptions, b as PlatformInfo, bt as PathFilter, c as ChangeRequestContext, ct as SecretOptions, d as CheckHandle, et as ChangeRequestAction, f as CommandContext, ft as ChangedFile, g as DefaultReviewInput, gt as DiffManifestFile, h as CommentValue, ht as DiffManifest, i as schemas, it as ModelProfile, j as TaskCheckOptions, jt as ReviewResult, k as ReviewerOptions, kt as piprResultSchema, l as ChangeRequestInfo, lt as SecretRef, m as CommandRegistrationOptions, mt as DiffHunk, n as jsonSchema, nt as DurationInput, o as definePipr, ot as PublicationOptions, p as CommandOptions, pt as CommentableRange, q as PromptSource, qt as SchemaParseResult, r as schema, rt as ModelOptions, s as definePlugin, st as RepositoryPermission, t as z, tt as ChecksOptions, u as ChangeRequestRegistrationOptions, v as PiprBuilder, vt as DiffManifestOptions, w as RepositoryInfo, wt as PiprResult, x as PluginToolDefinition, xt as RangeKind, y as PiprPlugin, yt as FileStatus, z as AgentDefinition, zt as reviewSummarySchema } from "./index-D9q-ZDr-.mjs";
|
|
2
|
+
export { type Agent, type AgentDefinition, type AgentExtension, type AgentPromptContext, type AgentTool, type AggregateCheckOptions, type AutoResolveAllowedActors, type AutoResolveOptions, type AutoResolveUserRepliesOptions, type BuiltinSchemaCatalog, type BuiltinToolCatalog, type ChangeRequestAction, type ChangeRequestContext, type ChangeRequestInfo, type ChangeRequestRegistrationOptions, type ChangedFile, type CheckHandle, type ChecksOptions, type CommandContext, type CommandOptions, type CommandRegistrationOptions, type CommentValue, type CommentableRange, type DefaultReviewInput, type DiffHunk, type DiffManifest, type DiffManifestFile, type DiffManifestLimits, type DiffManifestOptions, type DurationInput, type FileStatus, type JsonObject, type JsonPrimitive, type JsonPromptOptions, type JsonSchema, type JsonSchemaDefinition, type JsonValue, type Markdown, type ModelOptions, type ModelProfile, type PathFilter, type PiRunner, type PiprBuilder, type PiprConfigOptions, type PiprPlugin, type PiprResult, type PiprRunContext, type PiprRunSummary, type PiprRunTrigger, type PlatformInfo, type PluginToolDefinition, type PriorInlineFinding, type PriorReview, type PromptSource, type PromptText, type PromptValue, type PublicationOptions, type RangeKind, type RepositoryInfo, type RepositoryPermission, type ReviewCommentContext, type ReviewEntrypoints, type ReviewFinding, type ReviewRecipeOptions, type ReviewResult, type ReviewSide, type ReviewSummary, type Reviewer, type ReviewerOptions, type RuntimeLimits, type Schema, type SchemaDefinition, type SchemaParseResult, type SecretOptions, type SecretRef, type Task, type TaskCheckOptions, type TaskContext, type TaskDefinition, type TaskHandler, type ToolRunOptions, type ZodSchema, defaultReviewActions, defaultReviewEntrypoints, definePipr, definePlugin, jsonSchema, md, parsePiprResult, parseReviewFinding, parseReviewResult, parseReviewSummary, piprResultSchema, reviewFindingSchema, reviewResultSchema, reviewSchemaExample, reviewSummarySchema, schema, schemas, z };
|