@infodb/p3 0.3.0 → 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/bin/p3.mjs +11 -5
- package/dist/web/assets/Outputs-C83ZDXvs.js +1 -0
- package/dist/web/assets/RequestStatus-GmiWYEcL.js +1 -0
- package/dist/web/assets/Tabs-CJn0Qy7W.js +1 -0
- package/dist/web/assets/TagInput-CtM8HM8Z.js +1 -0
- package/dist/web/assets/TaskDrawer-D5v36QoF.js +3 -0
- package/dist/web/assets/_requestId-BHUqLO-j.js +1 -0
- package/dist/web/assets/_requestId-DxwxbXY2.js +30 -0
- package/dist/web/assets/{ui-Sz7y5_TS.js → appCtx-B-VRVOyv.js} +1 -1
- package/dist/web/assets/board-DAaVR04x.js +1 -0
- package/dist/web/assets/copy-CKsXEjMi.js +1 -0
- package/dist/web/assets/done-CaqB_qTH.js +1 -0
- package/dist/web/assets/index-BF1xMdJo.css +2 -0
- package/dist/web/assets/index-BQYvKpjF.js +12 -0
- package/dist/web/assets/milestoneOrder-N7b5XFJP.js +1 -0
- package/dist/web/assets/new-DLVnRvrB.js +1 -0
- package/dist/web/assets/preflightInput-BAeEJYUK.js +2 -0
- package/dist/web/assets/preload-helper-B74h5i3O.js +1 -0
- package/dist/web/assets/progressTree-wp9mH4VF.js +1 -0
- package/dist/web/assets/release-notes-MTLcOcvZ.js +3 -0
- package/dist/web/assets/requestData-D-HXu-cy.js +1 -0
- package/dist/web/assets/routes-CI4Qfkjs.js +3 -0
- package/dist/web/assets/settings-CJMNgzi6.js +1 -0
- package/dist/web/index.html +4 -4
- package/docs/architecture.md +238 -9
- package/docs/development.md +16 -9
- package/docs/how-to-use.md +128 -12
- package/docs/installation.md +8 -6
- package/docs/publishing.md +4 -2
- package/lib/cli/args.js +172 -0
- package/lib/cli/chatgpt.js +70 -0
- package/lib/cli/codex.js +30 -0
- package/lib/cli/format.js +9 -0
- package/{src/cli/help.ts → lib/cli/help.js} +11 -8
- package/lib/cli/main.js +326 -0
- package/lib/cli/output.js +110 -0
- package/lib/cli/preflightCommands.js +301 -0
- package/lib/cli/project.js +649 -0
- package/lib/cli/readOnly.js +36 -0
- package/lib/cli/releaseNotesCommands.js +197 -0
- package/lib/cli/render.js +58 -0
- package/lib/cli/requestCommands.js +180 -0
- package/lib/cli/showView.js +100 -0
- package/lib/cli/taskCommands.js +152 -0
- package/lib/cli/userConfig.js +64 -0
- package/{src/core/chatgpt.ts → lib/core/chatgpt.js} +10 -16
- package/lib/core/context.js +41 -0
- package/lib/core/hierarchy.js +128 -0
- package/lib/core/machineSettings.js +146 -0
- package/lib/core/machineSettingsEdit.js +148 -0
- package/lib/core/ops.js +120 -0
- package/lib/core/preflight/carryover.js +105 -0
- package/lib/core/preflight/codexEngine.js +687 -0
- package/lib/core/preflight/codexImage.js +61 -0
- package/lib/core/preflight/diagnose.js +95 -0
- package/lib/core/preflight/engine.js +58 -0
- package/lib/core/preflight/input.js +83 -0
- package/lib/core/preflight/launch.js +68 -0
- package/lib/core/preflight/mockEngine.js +175 -0
- package/lib/core/preflight/render.js +304 -0
- package/lib/core/preflight/service.js +868 -0
- package/lib/core/preflight/split.js +83 -0
- package/lib/core/preflight/uiMaterials.js +281 -0
- package/lib/core/preflight/uiRender.js +89 -0
- package/lib/core/preflight/wireframe.js +63 -0
- package/lib/core/preflight/xlsx.js +324 -0
- package/lib/core/projectRegistry.js +207 -0
- package/lib/core/redact.js +28 -0
- package/lib/core/releaseNotes/completeRequests.js +106 -0
- package/lib/core/releaseNotes/generate.js +266 -0
- package/lib/core/releaseNotes/material.js +141 -0
- package/lib/core/releaseNotes/mockSummarizer.js +26 -0
- package/lib/core/releaseNotes/service.js +83 -0
- package/lib/core/releaseNotes/store.js +209 -0
- package/lib/core/repoAdmin.js +82 -0
- package/lib/core/repoRefs.js +72 -0
- package/lib/core/requestOps.js +154 -0
- package/lib/core/requestStatus.js +171 -0
- package/lib/core/store/attachments.js +242 -0
- package/lib/core/store/collection.js +254 -0
- package/lib/core/store/frontmatter.js +18 -0
- package/lib/core/store/fsutil.js +84 -0
- package/lib/core/store/locate.js +162 -0
- package/lib/core/store/normalize.js +150 -0
- package/lib/core/store/noteStore.js +59 -0
- package/lib/core/store/preflightStore.js +161 -0
- package/lib/core/store/projectFile.js +99 -0
- package/lib/core/store/workspace.js +320 -0
- package/lib/core/supersede.js +69 -0
- package/lib/core/userConfig.js +158 -0
- package/{src/core/userTheme.ts → lib/core/userTheme.js} +11 -13
- package/lib/core/workTargets.js +106 -0
- package/lib/server/api/chatgptRoutes.js +46 -0
- package/{src/server/api/local.ts → lib/server/api/local.js} +23 -22
- package/lib/server/api/manifest.js +140 -0
- package/lib/server/api/projectsRoutes.js +82 -0
- package/lib/server/api/releaseNoteRoutes.js +88 -0
- package/lib/server/api/repoRoutes.js +67 -0
- package/lib/server/api/routes.js +404 -0
- package/lib/server/api/userThemeRoutes.js +60 -0
- package/lib/server/server.js +85 -0
- package/lib/shared/dates.js +10 -0
- package/{src/shared/directTask.ts → lib/shared/directTask.js} +3 -11
- package/lib/shared/hierarchy.js +120 -0
- package/lib/shared/milestoneOrder.js +45 -0
- package/lib/shared/preflightInput.js +19 -0
- package/lib/shared/refs.js +44 -0
- package/lib/shared/repos.js +69 -0
- package/lib/shared/scopeView.js +39 -0
- package/{src/shared/tags.ts → lib/shared/tags.js} +9 -14
- package/lib/shared/types.js +74 -0
- package/lib/shared/workTarget.js +31 -0
- package/package.json +4 -7
- package/skills/p3/SKILL.md +29 -8
- package/dist/web/assets/Outputs-DqJdybkd.js +0 -1
- package/dist/web/assets/RequestStatus-DN-2iAM0.js +0 -1
- package/dist/web/assets/TagInput-D-1ILLDX.js +0 -1
- package/dist/web/assets/TaskDrawer-CHD7T-Su.js +0 -3
- package/dist/web/assets/_requestId-BzSepQIV.js +0 -30
- package/dist/web/assets/_requestId-pIds2tFU.js +0 -1
- package/dist/web/assets/board-BIkOpuC4.js +0 -1
- package/dist/web/assets/copy-B1ZbihKL.js +0 -2
- package/dist/web/assets/done-BUAUhIRr.js +0 -1
- package/dist/web/assets/index-Byv9j77D.js +0 -12
- package/dist/web/assets/index-DTfUhuQw.css +0 -2
- package/dist/web/assets/new-6kly4-PX.js +0 -1
- package/dist/web/assets/preload-helper-DlN0ouRj.js +0 -1
- package/dist/web/assets/release-notes-iwQWmfX6.js +0 -3
- package/dist/web/assets/requestData-DJ1Rlx-u.js +0 -1
- package/dist/web/assets/routes-Ciot9p4x.js +0 -2
- package/dist/web/assets/settings-DBCi6lAY.js +0 -1
- package/src/cli/args.ts +0 -186
- package/src/cli/chatgpt.ts +0 -74
- package/src/cli/codex.ts +0 -28
- package/src/cli/format.ts +0 -9
- package/src/cli/main.ts +0 -336
- package/src/cli/output.ts +0 -117
- package/src/cli/preflightCommands.ts +0 -245
- package/src/cli/project.ts +0 -672
- package/src/cli/readOnly.ts +0 -36
- package/src/cli/releaseNotesCommands.ts +0 -159
- package/src/cli/render.ts +0 -60
- package/src/cli/requestCommands.ts +0 -170
- package/src/cli/showView.ts +0 -110
- package/src/cli/taskCommands.ts +0 -167
- package/src/cli/userConfig.ts +0 -58
- package/src/core/context.ts +0 -58
- package/src/core/machineSettings.ts +0 -207
- package/src/core/machineSettingsEdit.ts +0 -156
- package/src/core/ops.ts +0 -114
- package/src/core/preflight/carryover.ts +0 -133
- package/src/core/preflight/codexEngine.ts +0 -703
- package/src/core/preflight/codexImage.ts +0 -98
- package/src/core/preflight/diagnose.ts +0 -124
- package/src/core/preflight/engine.ts +0 -92
- package/src/core/preflight/input.ts +0 -65
- package/src/core/preflight/launch.ts +0 -86
- package/src/core/preflight/mockEngine.ts +0 -145
- package/src/core/preflight/render.ts +0 -339
- package/src/core/preflight/service.ts +0 -707
- package/src/core/preflight/uiMaterials.ts +0 -272
- package/src/core/preflight/uiRender.ts +0 -84
- package/src/core/preflight/wireframe.ts +0 -69
- package/src/core/preflight/xlsx.ts +0 -328
- package/src/core/projectRegistry.ts +0 -264
- package/src/core/redact.ts +0 -31
- package/src/core/releaseNotes/generate.ts +0 -283
- package/src/core/releaseNotes/material.ts +0 -114
- package/src/core/releaseNotes/mockSummarizer.ts +0 -28
- package/src/core/releaseNotes/service.ts +0 -106
- package/src/core/releaseNotes/store.ts +0 -216
- package/src/core/repoAdmin.ts +0 -81
- package/src/core/repoRefs.ts +0 -90
- package/src/core/requestOps.ts +0 -140
- package/src/core/requestStatus.ts +0 -58
- package/src/core/store/attachments.ts +0 -228
- package/src/core/store/collection.ts +0 -282
- package/src/core/store/frontmatter.ts +0 -22
- package/src/core/store/fsutil.ts +0 -90
- package/src/core/store/locate.ts +0 -181
- package/src/core/store/normalize.ts +0 -155
- package/src/core/store/noteStore.ts +0 -56
- package/src/core/store/preflightStore.ts +0 -136
- package/src/core/store/projectFile.ts +0 -101
- package/src/core/store/workspace.ts +0 -328
- package/src/core/supersede.ts +0 -74
- package/src/core/userConfig.ts +0 -205
- package/src/core/workTargets.ts +0 -120
- package/src/server/api/chatgptRoutes.ts +0 -49
- package/src/server/api/manifest.ts +0 -128
- package/src/server/api/projectsRoutes.ts +0 -89
- package/src/server/api/releaseNoteRoutes.ts +0 -78
- package/src/server/api/repoRoutes.ts +0 -67
- package/src/server/api/routes.ts +0 -382
- package/src/server/api/userThemeRoutes.ts +0 -62
- package/src/server/server.ts +0 -108
- package/src/shared/dates.ts +0 -12
- package/src/shared/preflightInput.ts +0 -27
- package/src/shared/refs.ts +0 -55
- package/src/shared/repos.ts +0 -113
- package/src/shared/scopeView.ts +0 -48
- package/src/shared/types.ts +0 -700
- package/src/shared/workTarget.ts +0 -44
- /package/{src → lib}/core/preflight/launcher.mjs +0 -0
- /package/{src → lib}/core/preflight/mock-ui.html +0 -0
- /package/{src → lib}/core/preflight/mock-ui.png +0 -0
- /package/{src → lib}/core/preflight/render-image/Dockerfile +0 -0
- /package/{src → lib}/core/preflight/render-image/fonts-ja.conf +0 -0
- /package/{src → lib}/core/preflight/render-image/render.mjs +0 -0
package/src/shared/repos.ts
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Preflight が読む参照先(リポジトリ・フォルダ)。数と名前はプロジェクトごとに自由。
|
|
3
|
-
*
|
|
4
|
-
* project.yaml(共有): 名前・役割・最初に読むか・作業先になりうるか・主なフォルダ
|
|
5
|
-
* 個人設定(共有しない): 名前 → このマシンのパス(projects.<名前>.repos)
|
|
6
|
-
*
|
|
7
|
-
* 参照の書き方: `<参照先の名前>:<参照先の中のパス>`(例: `docs:guide/`)。名前を付けなければ先頭の参照先。
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/** 主なフォルダの1行: フォルダ(またはファイル)とその役割・入口(最初に読むファイル。参照先の中のパス) */
|
|
11
|
-
export interface CodeMapEntry {
|
|
12
|
-
path: string;
|
|
13
|
-
role: string;
|
|
14
|
-
entry?: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface RepoRef {
|
|
18
|
-
/** 論理名(任意。空白・コロン・スラッシュ・バックスラッシュは使えない) */
|
|
19
|
-
name: string;
|
|
20
|
-
/** 役割の説明(例: システム本体 / ドキュメント / 基盤 / 依存しているライブラリ) */
|
|
21
|
-
role: string;
|
|
22
|
-
/** Preflight で最初に読む対象か */
|
|
23
|
-
readFirst: boolean;
|
|
24
|
-
/** タスクの作業先になりうるか(今は表示だけ。作業先の多重化は別の要望) */
|
|
25
|
-
writable: boolean;
|
|
26
|
-
/** 主なフォルダ(どこから読むかの案内。全部読む指示ではない)。入口がそのフォルダの最初に読むファイル */
|
|
27
|
-
map: CodeMapEntry[];
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export const REPO_NAME = /^[^\s:/\\]+$/;
|
|
31
|
-
|
|
32
|
-
/** 参照先の名前として使えるか(理由。使えれば undefined) */
|
|
33
|
-
export function repoNameProblem(name: string): string | undefined {
|
|
34
|
-
if (!name) return "名前が空です";
|
|
35
|
-
if (!REPO_NAME.test(name)) return `「${name}」は使えません(空白・コロン・スラッシュ・バックスラッシュを含めない)`;
|
|
36
|
-
if (name === "." || name === "..") return `「${name}」は使えません`;
|
|
37
|
-
return undefined;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* コンテナに置く名前(/workspace/<名前>)。論理名から英数字と . _ - だけを残し、空・重複は番号で分ける。
|
|
42
|
-
* 返す配列は repos と同じ順
|
|
43
|
-
*/
|
|
44
|
-
export function mountNames(names: readonly string[]): string[] {
|
|
45
|
-
const used = new Set<string>();
|
|
46
|
-
return names.map((n, i) => {
|
|
47
|
-
let base = n.replace(/[^A-Za-z0-9._-]+/g, "-").replace(/^[-.]+|-+$/g, "");
|
|
48
|
-
if (!base) base = `repo${i + 1}`;
|
|
49
|
-
let m = base;
|
|
50
|
-
for (let k = 2; used.has(m); k++) m = `${base}-${k}`;
|
|
51
|
-
used.add(m);
|
|
52
|
-
return m;
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export interface RepoPath {
|
|
57
|
-
/** 参照先の名前 */
|
|
58
|
-
repo: string;
|
|
59
|
-
/** 参照先の中の相対パス("" は参照先の全体)。末尾の / と先頭の ./ は除く */
|
|
60
|
-
path: string;
|
|
61
|
-
/** 名前を書いたか */
|
|
62
|
-
qualified: boolean;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export type ParsedRepoPath = ({ ok: true } & RepoPath) | { ok: false; reason: string; raw: string };
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* `<名前>:<パス>` か `<パス>`(既定の参照先)を読む。名前が登録に無い・パスが絶対か .. を含むときは ok: false
|
|
69
|
-
* (別のリポジトリの同じパスとして扱ったりしない)。
|
|
70
|
-
*/
|
|
71
|
-
export function parseRepoPath(raw: string, known: readonly string[], defaultRepo: string | undefined): ParsedRepoPath {
|
|
72
|
-
const s = raw.trim();
|
|
73
|
-
const m = /^([^\s:/\\]+):(.*)$/.exec(s);
|
|
74
|
-
let repo: string | undefined;
|
|
75
|
-
let rest: string;
|
|
76
|
-
let qualified = false;
|
|
77
|
-
if (m && known.includes(m[1])) {
|
|
78
|
-
repo = m[1];
|
|
79
|
-
rest = m[2];
|
|
80
|
-
qualified = true;
|
|
81
|
-
} else if (m && !/^[A-Za-z]:[\\/]/.test(s)) {
|
|
82
|
-
return { ok: false, reason: `参照先「${m[1]}」は登録されていません`, raw };
|
|
83
|
-
} else {
|
|
84
|
-
repo = defaultRepo;
|
|
85
|
-
rest = s;
|
|
86
|
-
}
|
|
87
|
-
if (!repo) return { ok: false, reason: "参照先がありません", raw };
|
|
88
|
-
const path = rest.replace(/^(\.\/)+/, "").replace(/\/+$/, "");
|
|
89
|
-
if (path.startsWith("/") || /^[A-Za-z]:[\\/]/.test(path)) return { ok: false, reason: `参照先の中の相対パスで書いてください: ${raw}`, raw };
|
|
90
|
-
if (path.split("/").includes("..")) return { ok: false, reason: `.. は使えません: ${raw}`, raw };
|
|
91
|
-
return { ok: true, repo, path: path === "." ? "" : path, qualified };
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/** 書き戻すときの形(既定の参照先なら名前を付けない) */
|
|
95
|
-
export const formatRepoPath = (p: RepoPath, defaultRepo: string | undefined) => (p.repo === defaultRepo && !p.qualified ? p.path : `${p.repo}:${p.path}`);
|
|
96
|
-
|
|
97
|
-
/** Preflight の記録(run.json)に残す参照先。このマシンのパスは入れない(共有するので) */
|
|
98
|
-
export interface RefScope {
|
|
99
|
-
name: string;
|
|
100
|
-
/** コンテナの中の名前(/workspace/<mount>) */
|
|
101
|
-
mount: string;
|
|
102
|
-
role: string;
|
|
103
|
-
readFirst: boolean;
|
|
104
|
-
/** ok: 読めた / unregistered: このマシンのパスが無い / missing: パスが無い / notdir: フォルダでない */
|
|
105
|
-
status: "ok" | "unregistered" | "missing" | "notdir";
|
|
106
|
-
/** 見られなかった理由(パスは含めない) */
|
|
107
|
-
reason?: string;
|
|
108
|
-
/**
|
|
109
|
-
* git の履歴が Codex のコンテナから使えるか(読めた参照先だけ)。ok: 使える / shallow: 浅い clone で途中まで /
|
|
110
|
-
* unavailable: 使えない(git の作業ツリー・リポジトリの中のサブフォルダ・git でない)。無ければ以前の評価(記録なし)
|
|
111
|
-
*/
|
|
112
|
-
history?: { status: "ok" | "shallow" | "unavailable"; reason?: string };
|
|
113
|
-
}
|
package/src/shared/scopeView.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { RefScope } from "./repos.ts";
|
|
2
|
-
import type { Evidence } from "./types.ts";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Preflight の「調べた範囲」と「判断の根拠」の見せ方(CLI の p3 drafts と画面で同じ言葉にする)。
|
|
6
|
-
* 調べた範囲(scope)は P3 が始めるときに決めたもの、根拠(evidence)は Codex が書き P3 が確かめたもの。
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
export const SCOPE_STATUS_LABEL: Record<RefScope["status"], string> = {
|
|
10
|
-
ok: "読んだ",
|
|
11
|
-
unregistered: "見ていない(このマシンのパスが未登録)",
|
|
12
|
-
missing: "見ていない(パスが無い)",
|
|
13
|
-
notdir: "見ていない(フォルダでない)",
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
/** 根拠の場所(<参照先>:<ファイル> <箇所>) */
|
|
17
|
-
export const evidenceWhere = (e: Evidence) =>
|
|
18
|
-
[e.repo && e.file ? `${e.repo}:${e.file}${e.location ? ` ${e.location}` : ""}` : "", e.commit ? `commit ${e.commit}` : ""].filter(Boolean).join(" / ");
|
|
19
|
-
|
|
20
|
-
/** git の履歴の表示(調べた範囲) */
|
|
21
|
-
export const historyLabel = (h: RefScope["history"]) =>
|
|
22
|
-
!h ? "" : h.status === "ok" ? "git の履歴あり" : h.status === "shallow" ? `git の履歴は途中まで(${h.reason ?? "浅い clone"})` : `git の履歴なし(${h.reason ?? "不明"})`;
|
|
23
|
-
|
|
24
|
-
export function scopeLines(scope: RefScope[] | undefined): string[] {
|
|
25
|
-
if (!scope) return ["調べた範囲: 記録なし(以前の評価)"];
|
|
26
|
-
if (!scope.length) return ["調べた範囲: 参照先なし"];
|
|
27
|
-
return [
|
|
28
|
-
"調べた範囲:",
|
|
29
|
-
...scope.map(
|
|
30
|
-
(s) =>
|
|
31
|
-
` ${s.status === "ok" ? "✓" : "✕"} ${s.name}${s.role ? `(${s.role})` : ""} ${s.status === "ok" ? `/workspace/${s.mount}` : (s.reason ?? SCOPE_STATUS_LABEL[s.status])}${s.history ? ` ${historyLabel(s.history)}` : ""}`,
|
|
32
|
-
),
|
|
33
|
-
];
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function evidenceLines(evidence: Evidence[] | undefined): string[] {
|
|
37
|
-
if (evidence === undefined) return ["判断の根拠: 記録なし(以前の評価)"];
|
|
38
|
-
if (!evidence.length) return ["判断の根拠: なし"];
|
|
39
|
-
return [
|
|
40
|
-
"判断の根拠:",
|
|
41
|
-
...evidence.map((e) => {
|
|
42
|
-
const where = evidenceWhere(e);
|
|
43
|
-
return e.kind === "verified"
|
|
44
|
-
? ` 確かめた ${where} — ${e.claim}`
|
|
45
|
-
: ` 推測 ${e.claim}${where ? `(${where})` : ""}${e.note ? ` ※${e.note}` : ""}`;
|
|
46
|
-
}),
|
|
47
|
-
];
|
|
48
|
-
}
|