@difflab/pi 0.1.0 → 0.2.0-rc.202609170717.9cb91d1
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 +32 -1
- package/agents/diffpi-autonomous.md +15 -0
- package/agents/diffpi-copilot.md +22 -0
- package/agents/diffpi-orchestrator.md +23 -0
- package/agents/diffpi-planner.md +15 -0
- package/agents/diffpi-reviewer.md +27 -0
- package/agents/diffpi-tutor.md +20 -0
- package/agents/diffpi-worker.md +19 -0
- package/dist/assets.d.ts +2 -0
- package/dist/assets.d.ts.map +1 -0
- package/dist/config.d.ts +28 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/environment.d.ts +40 -0
- package/dist/environment.d.ts.map +1 -0
- package/dist/extensions/index.js +2054 -182
- package/dist/forge.d.ts +48 -0
- package/dist/forge.d.ts.map +1 -0
- package/dist/fsx.d.ts +6 -0
- package/dist/fsx.d.ts.map +1 -0
- package/dist/gates.d.ts +12 -0
- package/dist/gates.d.ts.map +1 -0
- package/dist/index.d.ts +19 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1528 -149
- package/dist/modes.d.ts +59 -0
- package/dist/modes.d.ts.map +1 -0
- package/dist/pi.d.ts +21 -5
- package/dist/pi.d.ts.map +1 -1
- package/dist/process.d.ts +2 -0
- package/dist/process.d.ts.map +1 -1
- package/dist/review.d.ts +57 -0
- package/dist/review.d.ts.map +1 -0
- package/dist/setup.d.ts +11 -0
- package/dist/setup.d.ts.map +1 -1
- package/dist/store.d.ts +15 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/tools/index.d.ts +5 -2
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +1763 -171
- package/dist/tools/modes.d.ts +4 -0
- package/dist/tools/modes.d.ts.map +1 -0
- package/dist/tools/review.d.ts +7 -0
- package/dist/tools/review.d.ts.map +1 -0
- package/dist/tools/setup.d.ts.map +1 -1
- package/dist/tuicr.d.ts +43 -0
- package/dist/tuicr.d.ts.map +1 -0
- package/dist/zed.d.ts +11 -0
- package/dist/zed.d.ts.map +1 -0
- package/package.json +2 -1
- package/skills/diffpi-setup/SKILL.md +15 -1
- package/skills/mode/SKILL.md +38 -0
- package/skills/review/SKILL.md +13 -0
- package/skills/review/references/workflows/address.md +6 -0
- package/skills/review/references/workflows/complete.md +6 -0
- package/skills/review/references/workflows/help.md +12 -0
- package/skills/review/references/workflows/merge.md +6 -0
- package/skills/review/references/workflows/new.md +6 -0
- package/skills/review/references/workflows/open.md +6 -0
- package/skills/review/references/workflows/publish.md +5 -0
package/dist/forge.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ForgeProvider, VcsInfo } from './environment';
|
|
2
|
+
export type ReviewSide = 'LEFT' | 'RIGHT';
|
|
3
|
+
export type ReviewEvent = 'APPROVE' | 'REQUEST_CHANGES' | 'COMMENT';
|
|
4
|
+
export interface ReviewComment {
|
|
5
|
+
file: string;
|
|
6
|
+
line: number;
|
|
7
|
+
side?: ReviewSide;
|
|
8
|
+
body: string;
|
|
9
|
+
}
|
|
10
|
+
export interface PrRef {
|
|
11
|
+
number: number;
|
|
12
|
+
title: string;
|
|
13
|
+
url: string;
|
|
14
|
+
isDraft: boolean;
|
|
15
|
+
baseRef: string;
|
|
16
|
+
headRef: string;
|
|
17
|
+
}
|
|
18
|
+
export interface OpenPrOptions {
|
|
19
|
+
title: string;
|
|
20
|
+
body: string;
|
|
21
|
+
base: string;
|
|
22
|
+
head: string;
|
|
23
|
+
draft?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface Forge {
|
|
26
|
+
readonly provider: ForgeProvider;
|
|
27
|
+
createDraftPr(options: OpenPrOptions): Promise<PrRef>;
|
|
28
|
+
viewPr(idOrBranch: string): Promise<PrRef | undefined>;
|
|
29
|
+
defaultBranch(): Promise<string>;
|
|
30
|
+
prDiff(id: number): Promise<string>;
|
|
31
|
+
prChecks(id: number): Promise<string>;
|
|
32
|
+
createPendingReview(id: number, comments: ReviewComment[], body: string): Promise<void>;
|
|
33
|
+
submitReview(id: number, event: ReviewEvent, body: string): Promise<void>;
|
|
34
|
+
markReady(id: number): Promise<void>;
|
|
35
|
+
closePr(id: number, comment?: string): Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
export declare function createForge(vcs: VcsInfo): Forge;
|
|
38
|
+
export declare function assertReviewEventSupported(provider: ForgeProvider, event: ReviewEvent): void;
|
|
39
|
+
export declare function isConfirmedMissingChange(provider: ForgeProvider, output: string): boolean;
|
|
40
|
+
export declare function githubReviewSubmissionEndpoint(owner: string, repo: string, id: number, pendingReviewId: string): string;
|
|
41
|
+
export interface GitlabDiffRefs {
|
|
42
|
+
base_sha: string;
|
|
43
|
+
start_sha: string;
|
|
44
|
+
head_sha: string;
|
|
45
|
+
}
|
|
46
|
+
export declare function parseGitlabDiffRefs(input: string): GitlabDiffRefs;
|
|
47
|
+
export declare function hasGitlabDraftNotes(input: string): boolean;
|
|
48
|
+
//# sourceMappingURL=forge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forge.d.ts","sourceRoot":"","sources":["../src/forge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAG5D,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;AAC1C,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,iBAAiB,GAAG,SAAS,CAAC;AAEpE,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,KAAK;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,E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CAM5F;AAED,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAgBzF;AAaD,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,eAAe,EAAE,MAAM,GACtB,MAAM,CAIR;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,CAYjE;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAO1D"}
|
package/dist/fsx.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Dirent } from 'node:fs';
|
|
2
|
+
/** Read a directory, or return an empty list when the path does not exist. */
|
|
3
|
+
export declare function readDirectoryIfExists(path: string): Promise<Dirent[]>;
|
|
4
|
+
/** Read a UTF-8 file, or return undefined when the path does not exist. */
|
|
5
|
+
export declare function readTextIfExists(path: string): Promise<string | undefined>;
|
|
6
|
+
//# sourceMappingURL=fsx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fsx.d.ts","sourceRoot":"","sources":["../src/fsx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAGtC,8EAA8E;AAC9E,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAO3E;AAED,2EAA2E;AAC3E,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAOhF"}
|
package/dist/gates.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const CONVENTIONAL_COMMIT: RegExp;
|
|
2
|
+
export type GateStatus = 'pass' | 'fail' | 'warn' | 'skip';
|
|
3
|
+
export interface GateResult {
|
|
4
|
+
name: string;
|
|
5
|
+
status: GateStatus;
|
|
6
|
+
detail: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function checkConventionalSubject(subject: string): GateResult;
|
|
9
|
+
export declare function runMiseGates(cwd: string): Promise<GateResult[]>;
|
|
10
|
+
export declare function ciGate(checksOutput: string): GateResult;
|
|
11
|
+
export declare function parseMiseTasks(input: string): Map<string, string[]>;
|
|
12
|
+
//# sourceMappingURL=gates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gates.d.ts","sourceRoot":"","sources":["../src/gates.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,QAAsF,CAAC;AAGvH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAE3D,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAQpE;AAED,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAkBrE;AAED,wBAAgB,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,UAAU,CAMvD;AAQD,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAkBnE"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,25 @@
|
|
|
1
|
+
export { diffpiConfigPaths, findPreferredModel, loadDiffpiConfig, resolveAgentModelPreferences } from './config';
|
|
2
|
+
export { detectIde, detectMux, detectShell, detectVcs, openInNewTab, parseRemote } from './environment';
|
|
3
|
+
export { createForge } from './forge';
|
|
4
|
+
export { checkConventionalSubject, ciGate, CONVENTIONAL_COMMIT, runMiseGates } from './gates';
|
|
1
5
|
export { mcp } from './mcp';
|
|
2
6
|
export { mise } from './mise';
|
|
7
|
+
export { createModeController, discoverAgentModes, resolveAgentMode } from './modes';
|
|
3
8
|
export { pi } from './pi';
|
|
4
|
-
export {
|
|
9
|
+
export { computeProjectSlug, ensureStore, gitToplevel, reviewsDir, sessionsDir, storeDir, storeGlobalRoot, } from './store';
|
|
10
|
+
export { addComment, launch, listSessions, readSession, resolveSession, toFindings, tuicrAvailable } from './tuicr';
|
|
11
|
+
export { ensureZedReviewKeybinding, ensureZedReviewTask, zedKeymapPath, zedTasksPath, ZED_REVIEW_TASK_NAME, } from './zed';
|
|
12
|
+
export { dedupeFindings, findingSchema, findingsSchema, mmddyy, renderPrBody, renderReviewDoc, reviewRecordName, reviewSlug, reviewWorkingDir, severitySchema, toReviewComments, } from './review';
|
|
13
|
+
export { ensureMcpAdapters, ensureMise, ensureMiseDeps, ensureMiseHooks, ensurePiAgents, ensurePiPlugins, ensurePiSkills, setupPi, } from './setup';
|
|
14
|
+
export type { DiffpiAgentConfig, DiffpiConfig, DiffpiConfigPaths, LoadedDiffpiConfig } from './config';
|
|
15
|
+
export type { AgentMode, ModeCatalog, ModeController, ModeListOptions, ModePromptStrategy, ModeSelectionResult, ModeThinkingLevel, } from './modes';
|
|
5
16
|
export type { CommandResult } from './process';
|
|
17
|
+
export type { ForgeProvider, Ide, LaunchOptions, LaunchResult, Mux, VcsInfo } from './environment';
|
|
18
|
+
export type { Forge, OpenPrOptions, PrRef, ReviewComment, ReviewEvent, ReviewSide } from './forge';
|
|
19
|
+
export type { GateResult, GateStatus } from './gates';
|
|
20
|
+
export type { Finding, ReviewDocInput, Severity } from './review';
|
|
21
|
+
export type { StoreInfo } from './store';
|
|
22
|
+
export type { SessionSummary, SessionJson } from './tuicr';
|
|
23
|
+
export type { ZedEnsureResult } from './zed';
|
|
6
24
|
export type { IssueTracker, SetupAction, SetupOptions, SetupResult, SetupStatus } from './setup';
|
|
7
25
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,OAAO,EACL,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,eAAe,EACf,eAAe,EACf,cAAc,EACd,OAAO,GACR,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AACjH,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACxG,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC9F,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACrF,OAAO,EAA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