codecartographer-pi 0.8.0 → 0.9.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/.codecarto/GUIDE.md +2 -0
- package/README.md +36 -16
- package/assets/logo.svg +42 -0
- package/dist/core/dashboard.d.ts +6 -0
- package/dist/core/dashboard.js +396 -285
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +1 -0
- package/dist/core/library.d.ts +157 -0
- package/dist/core/library.js +675 -0
- package/dist/core/orchestrator-config.d.ts +38 -0
- package/dist/core/orchestrator-config.js +86 -19
- package/dist/core/pipeline.js +15 -3
- package/dist/core/prompts.d.ts +12 -1
- package/dist/core/prompts.js +15 -6
- package/dist/core/usage.js +15 -1
- package/dist/core/utils.d.ts +8 -0
- package/dist/core/utils.js +17 -1
- package/dist/extensions/codecarto/auto-runner.d.ts +16 -0
- package/dist/extensions/codecarto/auto-runner.js +7 -3
- package/dist/extensions/codecarto/dashboard-writer.js +26 -1
- package/dist/extensions/codecarto/index.js +23 -2
- package/dist/mcp-server/server.d.ts +21 -0
- package/dist/mcp-server/server.js +305 -3
- package/package.json +3 -2
package/dist/core/index.d.ts
CHANGED
package/dist/core/index.js
CHANGED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
export declare const LIBRARY_MARKER_FILE = ".codecarto-library";
|
|
2
|
+
export declare const LIBRARY_INDEX_FILE = "index.yaml";
|
|
3
|
+
export declare const LIBRARY_INDEX_MD_FILE = "INDEX.md";
|
|
4
|
+
export declare const ENTRIES_DIR = "entries";
|
|
5
|
+
export declare const SPEC_FILE = "reimplementation-spec.md";
|
|
6
|
+
export declare const METADATA_FILE = "metadata.yaml";
|
|
7
|
+
export declare const LATEST_POINTER_FILE = "latest";
|
|
8
|
+
export declare const MARKER_SCHEMA_VERSION = 1;
|
|
9
|
+
export declare const INDEX_SCHEMA_VERSION = 1;
|
|
10
|
+
export type LibraryVisibility = "internal" | "shared" | "public";
|
|
11
|
+
export interface LibraryMarker {
|
|
12
|
+
schema_version: number;
|
|
13
|
+
name: string;
|
|
14
|
+
visibility?: LibraryVisibility;
|
|
15
|
+
created_at?: string;
|
|
16
|
+
namespaced: boolean;
|
|
17
|
+
}
|
|
18
|
+
export type GenerationSurface = "pi-extension" | "mcp-server" | "drop-in";
|
|
19
|
+
export type GenerationReasoning = "high" | "medium" | "low" | "default" | "unknown";
|
|
20
|
+
export interface EntryGeneration {
|
|
21
|
+
surface: GenerationSurface;
|
|
22
|
+
agent: string;
|
|
23
|
+
agent_version: string;
|
|
24
|
+
model: string;
|
|
25
|
+
model_vendor: string;
|
|
26
|
+
reasoning: GenerationReasoning;
|
|
27
|
+
notes: string;
|
|
28
|
+
}
|
|
29
|
+
export interface EntryProvenance {
|
|
30
|
+
prior_version: number | null;
|
|
31
|
+
mutation_source: string | null;
|
|
32
|
+
}
|
|
33
|
+
export interface ScopeTierCounts {
|
|
34
|
+
p0?: number;
|
|
35
|
+
p1?: number;
|
|
36
|
+
p2?: number;
|
|
37
|
+
}
|
|
38
|
+
export interface EntryMetadata {
|
|
39
|
+
slug: string;
|
|
40
|
+
namespace?: string;
|
|
41
|
+
version: number;
|
|
42
|
+
source_repo: string;
|
|
43
|
+
source_commit?: string;
|
|
44
|
+
source_branch?: string;
|
|
45
|
+
source_dirty?: boolean;
|
|
46
|
+
analyzed_at: string;
|
|
47
|
+
pipeline: string;
|
|
48
|
+
codecarto_version: string;
|
|
49
|
+
headline: string;
|
|
50
|
+
tags: string[];
|
|
51
|
+
capabilities: string[];
|
|
52
|
+
scope_tier_counts?: ScopeTierCounts;
|
|
53
|
+
confidentiality?: LibraryVisibility;
|
|
54
|
+
generation: EntryGeneration;
|
|
55
|
+
provenance?: EntryProvenance;
|
|
56
|
+
}
|
|
57
|
+
export interface LibraryIndexEntry {
|
|
58
|
+
slug: string;
|
|
59
|
+
namespace?: string;
|
|
60
|
+
latest_version: number;
|
|
61
|
+
versions: number[];
|
|
62
|
+
source_repo: string;
|
|
63
|
+
headline: string;
|
|
64
|
+
tags: string[];
|
|
65
|
+
capabilities: string[];
|
|
66
|
+
confidentiality?: LibraryVisibility;
|
|
67
|
+
last_analyzed_at: string;
|
|
68
|
+
last_codecarto_version: string;
|
|
69
|
+
}
|
|
70
|
+
export interface LibraryIndex {
|
|
71
|
+
schema_version: number;
|
|
72
|
+
library_name: string;
|
|
73
|
+
generated_at: string;
|
|
74
|
+
entry_count: number;
|
|
75
|
+
namespaces: string[];
|
|
76
|
+
entries: LibraryIndexEntry[];
|
|
77
|
+
}
|
|
78
|
+
export declare function discoverLibrary(libraryPath: string): Promise<LibraryMarker | null>;
|
|
79
|
+
export declare function readMarker(libraryRoot: string): Promise<LibraryMarker | null>;
|
|
80
|
+
export declare function writeMarker(libraryRoot: string, marker: LibraryMarker): Promise<void>;
|
|
81
|
+
export declare function isValidSlug(slug: string): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Derive a slug from a source repo URL or path. The last meaningful path
|
|
84
|
+
* component is lowercased and non-`[a-z0-9-]` characters are coerced to `-`.
|
|
85
|
+
* Caller is responsible for collision handling — derived slugs may already
|
|
86
|
+
* exist in the library and the calling UX (Pi or MCP) is the right place
|
|
87
|
+
* to ask the user about it.
|
|
88
|
+
*/
|
|
89
|
+
export declare function deriveSlug(sourceRepo: string): string;
|
|
90
|
+
export interface PublishInput {
|
|
91
|
+
slug: string;
|
|
92
|
+
namespace?: string;
|
|
93
|
+
source_repo: string;
|
|
94
|
+
source_commit?: string;
|
|
95
|
+
source_branch?: string;
|
|
96
|
+
source_dirty?: boolean;
|
|
97
|
+
analyzed_at: string;
|
|
98
|
+
pipeline: string;
|
|
99
|
+
codecarto_version: string;
|
|
100
|
+
headline: string;
|
|
101
|
+
tags: string[];
|
|
102
|
+
capabilities: string[];
|
|
103
|
+
scope_tier_counts?: ScopeTierCounts;
|
|
104
|
+
confidentiality?: LibraryVisibility;
|
|
105
|
+
generation: EntryGeneration;
|
|
106
|
+
provenance?: EntryProvenance;
|
|
107
|
+
}
|
|
108
|
+
export interface PublishOptions {
|
|
109
|
+
/** Force a new version even if content matches the latest. */
|
|
110
|
+
forceNewVersion?: boolean;
|
|
111
|
+
/** Skip the regen of index.yaml + INDEX.md (caller will batch). */
|
|
112
|
+
skipReindex?: boolean;
|
|
113
|
+
}
|
|
114
|
+
export interface PublishResult {
|
|
115
|
+
slug: string;
|
|
116
|
+
namespace?: string;
|
|
117
|
+
version: number;
|
|
118
|
+
isNewVersion: boolean;
|
|
119
|
+
entryDir: string;
|
|
120
|
+
versionDir: string;
|
|
121
|
+
}
|
|
122
|
+
export declare function publishEntry(libraryRoot: string, spec: string, input: PublishInput, opts?: PublishOptions): Promise<PublishResult>;
|
|
123
|
+
export interface EntryRef {
|
|
124
|
+
slug: string;
|
|
125
|
+
namespace?: string;
|
|
126
|
+
/** If omitted, resolves to latest. */
|
|
127
|
+
version?: number;
|
|
128
|
+
}
|
|
129
|
+
export interface EntryReadResult {
|
|
130
|
+
metadata: EntryMetadata;
|
|
131
|
+
spec: string;
|
|
132
|
+
versionDir: string;
|
|
133
|
+
}
|
|
134
|
+
export declare function readEntry(libraryRoot: string, ref: EntryRef): Promise<EntryReadResult>;
|
|
135
|
+
export interface ListEntriesFilter {
|
|
136
|
+
namespace?: string;
|
|
137
|
+
tag?: string;
|
|
138
|
+
slug?: string;
|
|
139
|
+
source_repo?: string;
|
|
140
|
+
}
|
|
141
|
+
export declare function listEntries(libraryRoot: string, filter?: ListEntriesFilter): Promise<LibraryIndexEntry[]>;
|
|
142
|
+
export declare function reindex(libraryRoot: string): Promise<LibraryIndex>;
|
|
143
|
+
export interface CommitOptions {
|
|
144
|
+
addAll?: boolean;
|
|
145
|
+
}
|
|
146
|
+
export interface CommitResult {
|
|
147
|
+
ok: boolean;
|
|
148
|
+
skipped?: "not-a-git-repo" | "nothing-to-commit" | "git-missing" | "error";
|
|
149
|
+
message?: string;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Optional convenience: stage and commit publish output. Never pushes.
|
|
153
|
+
* On any failure, returns `{ ok: false, skipped: <reason> }` rather than
|
|
154
|
+
* throwing — the publish itself has already succeeded, and the caller
|
|
155
|
+
* decides whether to surface the commit failure to the user.
|
|
156
|
+
*/
|
|
157
|
+
export declare function commitPublish(libraryRoot: string, message: string, opts?: CommitOptions): Promise<CommitResult>;
|