scoutline 0.15.0 → 0.17.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/README.md +115 -11
- package/dist/capabilities/repository.d.ts +96 -0
- package/dist/capabilities/repository.d.ts.map +1 -1
- package/dist/capabilities/repository.js.map +1 -1
- package/dist/command-invocation.d.ts +2 -2
- package/dist/command-invocation.d.ts.map +1 -1
- package/dist/command-invocation.js +1 -1
- package/dist/command-invocation.js.map +1 -1
- package/dist/commands/cache.d.ts +38 -0
- package/dist/commands/cache.d.ts.map +1 -1
- package/dist/commands/cache.js +64 -5
- package/dist/commands/cache.js.map +1 -1
- package/dist/commands/config.d.ts +17 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +25 -2
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/repo.d.ts +96 -1
- package/dist/commands/repo.d.ts.map +1 -1
- package/dist/commands/repo.js +420 -0
- package/dist/commands/repo.js.map +1 -1
- package/dist/commands/research.d.ts +45 -0
- package/dist/commands/research.d.ts.map +1 -1
- package/dist/commands/research.js +152 -4
- package/dist/commands/research.js.map +1 -1
- package/dist/commands/search.d.ts +161 -0
- package/dist/commands/search.d.ts.map +1 -1
- package/dist/commands/search.js +399 -29
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/usage.d.ts +101 -0
- package/dist/commands/usage.d.ts.map +1 -0
- package/dist/commands/usage.js +228 -0
- package/dist/commands/usage.js.map +1 -0
- package/dist/commands/vision.d.ts +28 -0
- package/dist/commands/vision.d.ts.map +1 -1
- package/dist/commands/vision.js +452 -0
- package/dist/commands/vision.js.map +1 -1
- package/dist/index.d.ts +224 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +921 -27
- package/dist/index.js.map +1 -1
- package/dist/lib/batch-assign.d.ts +61 -0
- package/dist/lib/batch-assign.d.ts.map +1 -0
- package/dist/lib/batch-assign.js +118 -0
- package/dist/lib/batch-assign.js.map +1 -0
- package/dist/lib/batch-manifest.d.ts +183 -0
- package/dist/lib/batch-manifest.d.ts.map +1 -0
- package/dist/lib/batch-manifest.js +644 -0
- package/dist/lib/batch-manifest.js.map +1 -0
- package/dist/lib/batch-runner.d.ts +169 -0
- package/dist/lib/batch-runner.d.ts.map +1 -0
- package/dist/lib/batch-runner.js +357 -0
- package/dist/lib/batch-runner.js.map +1 -0
- package/dist/lib/cache.d.ts +111 -7
- package/dist/lib/cache.d.ts.map +1 -1
- package/dist/lib/cache.js +316 -7
- package/dist/lib/cache.js.map +1 -1
- package/dist/lib/config-store.d.ts +51 -1
- package/dist/lib/config-store.d.ts.map +1 -1
- package/dist/lib/config-store.js +90 -6
- package/dist/lib/config-store.js.map +1 -1
- package/dist/lib/consumption.d.ts +17 -0
- package/dist/lib/consumption.d.ts.map +1 -1
- package/dist/lib/consumption.js +38 -0
- package/dist/lib/consumption.js.map +1 -1
- package/dist/lib/context-file.d.ts +90 -0
- package/dist/lib/context-file.d.ts.map +1 -0
- package/dist/lib/context-file.js +244 -0
- package/dist/lib/context-file.js.map +1 -0
- package/dist/lib/trigger-detection.d.ts +21 -0
- package/dist/lib/trigger-detection.d.ts.map +1 -1
- package/dist/lib/trigger-detection.js +63 -0
- package/dist/lib/trigger-detection.js.map +1 -1
- package/dist/lib/url.d.ts +43 -0
- package/dist/lib/url.d.ts.map +1 -0
- package/dist/lib/url.js +172 -0
- package/dist/lib/url.js.map +1 -0
- package/dist/lib/usage-ledger.d.ts +221 -0
- package/dist/lib/usage-ledger.d.ts.map +1 -0
- package/dist/lib/usage-ledger.js +408 -0
- package/dist/lib/usage-ledger.js.map +1 -0
- package/dist/node-command-invocation-adapter.d.ts +25 -0
- package/dist/node-command-invocation-adapter.d.ts.map +1 -1
- package/dist/node-command-invocation-adapter.js +73 -38
- package/dist/node-command-invocation-adapter.js.map +1 -1
- package/dist/providers/selection.d.ts +21 -0
- package/dist/providers/selection.d.ts.map +1 -1
- package/dist/providers/selection.js +58 -0
- package/dist/providers/selection.js.map +1 -1
- package/package.json +1 -1
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* registry layer (API keys never ride argv, AGENTS.md).
|
|
15
15
|
*/
|
|
16
16
|
import type { CommandResult } from "../command-invocation.js";
|
|
17
|
-
import { type ScoutlineConfig } from "../lib/config-store.js";
|
|
17
|
+
import { type FanoutNoticeContext, type ScoutlineConfig } from "../lib/config-store.js";
|
|
18
18
|
export interface ConfigGetDependencies {
|
|
19
19
|
/** Read the current config (production: `readConfig`). */
|
|
20
20
|
readonly read: () => Promise<ScoutlineConfig>;
|
|
@@ -24,6 +24,22 @@ export interface ConfigGetDependencies {
|
|
|
24
24
|
export interface ConfigSetDependencies {
|
|
25
25
|
/** Strict set (production: `setConfigValue`). */
|
|
26
26
|
readonly set: (path: string, value: string) => Promise<ScoutlineConfig>;
|
|
27
|
+
/**
|
|
28
|
+
* Success-path notice channel (production: the invocation context's
|
|
29
|
+
* `notice`, stderr). Used for registry-mandated warnings like the
|
|
30
|
+
* fan-out cost sentence (search-fanout DESIGN D7) — visible in every
|
|
31
|
+
* output mode while stdout stays data-only. Optional so presentation
|
|
32
|
+
* doubles stay minimal.
|
|
33
|
+
*/
|
|
34
|
+
readonly notify?: (message: string) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Eligibility context (env + provider registry) the fan-out cost
|
|
37
|
+
* notice needs to name only the routed providers that would actually
|
|
38
|
+
* bill — the same arm set `resolveFanoutPlan` computes (review fix,
|
|
39
|
+
* PR #36). Optional: without it the notice falls back to the blanket
|
|
40
|
+
* sentence instead of naming raw routing entries.
|
|
41
|
+
*/
|
|
42
|
+
readonly noticeContext?: FanoutNoticeContext;
|
|
27
43
|
}
|
|
28
44
|
export interface ConfigUnsetDependencies {
|
|
29
45
|
/** Unset (production: `unsetConfigValue`). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;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,uBAAuB;IACtC,8CAA8C;IAC9C,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;CAC5D;AAgDD;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,IAAI,EAAE,qBAAqB,GAC1B,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAyBjC;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,qBAAqB,GAC1B,OAAO,CAAC,aAAa,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC,CAoB1D;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,uBAAuB,GAC5B,OAAO,CAAC,aAAa,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAO1C;AAED,eAAO,MAAM,WAAW,QAsDhB,CAAC"}
|
package/dist/commands/config.js
CHANGED
|
@@ -46,6 +46,8 @@ function valueAtPath(config, path) {
|
|
|
46
46
|
return config.routing?.[trimmed.slice("routing.".length)];
|
|
47
47
|
if (trimmed === "fallbackEnabled")
|
|
48
48
|
return config.fallbackEnabled;
|
|
49
|
+
if (trimmed === "fanout")
|
|
50
|
+
return config.fanout;
|
|
49
51
|
const providerMatch = /^providers\.([a-z0-9-]+)(?:\.[A-Za-z0-9-]+)*$/.exec(trimmed);
|
|
50
52
|
if (providerMatch?.[1])
|
|
51
53
|
return config.providers[providerMatch[1]];
|
|
@@ -78,7 +80,7 @@ export async function configGetCommand(path, deps) {
|
|
|
78
80
|
// silent "(not set)"; other unknown paths list the valid roots.
|
|
79
81
|
throw path.trim().startsWith("routing.")
|
|
80
82
|
? unknownConfigKeyError(path)
|
|
81
|
-
: new ValidationError(`Unknown config key "${path}".`, 'Valid keys: routing, routing.<capability>, fallbackEnabled, providers.<id>. Run "scoutline config --help".');
|
|
83
|
+
: new ValidationError(`Unknown config key "${path}".`, 'Valid keys: routing, routing.<capability>, fallbackEnabled, fanout, providers.<id>. Run "scoutline config --help".');
|
|
82
84
|
}
|
|
83
85
|
const raw = valueAtPath(config, path);
|
|
84
86
|
const redacted = redactSecrets(raw ?? null, secrets);
|
|
@@ -95,6 +97,18 @@ export async function configGetCommand(path, deps) {
|
|
|
95
97
|
export async function configSetCommand(path, value, deps) {
|
|
96
98
|
const updated = await deps.set(path, value);
|
|
97
99
|
const raw = valueAtPath(updated, path);
|
|
100
|
+
// Registry-mandated enable-time warning (fan-out cost sentence, D7):
|
|
101
|
+
// emitted as a stderr notice so it reaches every output mode while
|
|
102
|
+
// stdout stays data-only. The registry supplies the sentence for the
|
|
103
|
+
// UPDATED config plus the eligibility context — with `routing.search`
|
|
104
|
+
// set it names only the routed arms that are ELIGIBLE (configured ∩
|
|
105
|
+
// search-capable, the same set `resolveFanoutPlan` computes) instead
|
|
106
|
+
// of claiming ALL configured providers or naming raw routing entries
|
|
107
|
+
// that would not bill (review fix, PR #36).
|
|
108
|
+
const key = resolveConfigKey(path);
|
|
109
|
+
if (key?.setTrueNotice !== undefined && raw === true) {
|
|
110
|
+
deps.notify?.(key.setTrueNotice(updated, deps.noticeContext));
|
|
111
|
+
}
|
|
98
112
|
return {
|
|
99
113
|
kind: "data",
|
|
100
114
|
data: { path: path.trim(), value: raw },
|
|
@@ -126,6 +140,12 @@ Keys:
|
|
|
126
140
|
routing.<capability> Ordered provider list for one capability.
|
|
127
141
|
Example: scoutline config set routing.search tavily,brave
|
|
128
142
|
fallbackEnabled true|false — the always-on provider fallback switch.
|
|
143
|
+
fanout true|false — the multi-provider search fan-out
|
|
144
|
+
switch (default false; enabling warns about the
|
|
145
|
+
billable cost — every configured search provider,
|
|
146
|
+
or the routing.search subset when routed).
|
|
147
|
+
Remove the standing switch with
|
|
148
|
+
\`scoutline config unset fanout\`.
|
|
129
149
|
providers.<id> Provider configuration (view only; credential
|
|
130
150
|
values are always masked).
|
|
131
151
|
|
|
@@ -138,7 +158,8 @@ Behaviour:
|
|
|
138
158
|
provider's environment variable (API keys never belong in command
|
|
139
159
|
arguments).
|
|
140
160
|
unset Removes a routing capability (and the table when the last entry
|
|
141
|
-
goes), the whole routing table,
|
|
161
|
+
goes), the whole routing table, the fallbackEnabled switch, or
|
|
162
|
+
the fanout switch.
|
|
142
163
|
|
|
143
164
|
Routing semantics: when no --provider / SCOUTLINE_PROVIDER pin exists,
|
|
144
165
|
the routed list orders provider selection for that capability — the
|
|
@@ -155,7 +176,9 @@ Examples:
|
|
|
155
176
|
scoutline config get routing
|
|
156
177
|
scoutline config set routing.search tavily,brave
|
|
157
178
|
scoutline config set fallbackEnabled false
|
|
179
|
+
scoutline config set fanout true
|
|
158
180
|
scoutline config unset routing.search
|
|
181
|
+
scoutline config unset fanout
|
|
159
182
|
scoutline config --help
|
|
160
183
|
`.trim();
|
|
161
184
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EACL,gBAAgB,EAChB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EACL,gBAAgB,EAChB,qBAAqB,GAGtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAuCjD,8EAA8E;AAC9E,8BAA8B;AAC9B,8EAA8E;AAE9E,uEAAuE;AACvE,SAAS,kBAAkB,CAAC,OAAoD;IAC9E,MAAM,YAA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AAE,GAAG,EAAE;QACvC,aAAa,EAAE,gBAAgB,CAAC,IAAI,EAAE,GAAG,CAAC;KAC3C,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,IAAY,EACZ,IAA6B;IAE7B,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACvB,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE;QAC3B,aAAa,EAAE,iBAAiB,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC;KAC/D,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsD1B,CAAC,IAAI,EAAE,CAAC"}
|
package/dist/commands/repo.d.ts
CHANGED
|
@@ -23,8 +23,57 @@
|
|
|
23
23
|
* before reaching the Explorer rather than silently degrading.
|
|
24
24
|
*/
|
|
25
25
|
import type { CommandContext, CommandResult } from "../command-invocation.js";
|
|
26
|
-
import type { RepositoryCapability } from "../capabilities/repository.js";
|
|
26
|
+
import type { RepositoryBrief, RepositoryCapability, RepositoryTreeResult, RepoBriefFocus } from "../capabilities/repository.js";
|
|
27
27
|
import type { ExecutionDependencies } from "../lib/execution.js";
|
|
28
|
+
/**
|
|
29
|
+
* Sealed v1 probe set. Opening the set later is additive — do NOT
|
|
30
|
+
* mutate this constant at runtime.
|
|
31
|
+
*/
|
|
32
|
+
export declare const REPO_BRIEF_FOCUS: readonly RepoBriefFocus[];
|
|
33
|
+
/**
|
|
34
|
+
* Probe query constants per DESIGN D7. These are NOT constructed at
|
|
35
|
+
* call time — they are literal constants so the brief's evidence
|
|
36
|
+
* chain (search.query inside the envelope) is reproducible byte-for-
|
|
37
|
+
* byte across providers and reruns.
|
|
38
|
+
*/
|
|
39
|
+
export declare const README_QUERY = "README";
|
|
40
|
+
export declare const MANIFEST_QUERY = "package.json pyproject.toml Cargo.toml go.mod";
|
|
41
|
+
/**
|
|
42
|
+
* Pure tree-derived file selection (DESIGN D1 / D7 steps 5–8). The
|
|
43
|
+
* tree is the path inventory — search excerpts carry no paths, so
|
|
44
|
+
* file selection MUST be tree-derived. The returned `manifests` array
|
|
45
|
+
* is in canonical kind order; `readme` is the single shallowest
|
|
46
|
+
* README match. Non-file entries (directories) are ignored even when
|
|
47
|
+
* their `name` happens to look like a README/manifest.
|
|
48
|
+
*/
|
|
49
|
+
export declare function selectBriefFiles(tree: RepositoryTreeResult): {
|
|
50
|
+
readme?: string;
|
|
51
|
+
manifests: string[];
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Parse the `--focus` flag value. Splits on `,`, trims, drops empties,
|
|
55
|
+
* validates against the sealed `REPO_BRIEF_FOCUS` set, dedupes
|
|
56
|
+
* preserving first occurrence, and rejects empty-after-processing.
|
|
57
|
+
*
|
|
58
|
+
* The error message names the sealed set so a consumer can fix the
|
|
59
|
+
* value without consulting docs (DESIGN D7 step 3).
|
|
60
|
+
*/
|
|
61
|
+
export declare function parseBriefFocus(raw: string): readonly RepoBriefFocus[];
|
|
62
|
+
/**
|
|
63
|
+
* Parse the `--depth` flag value. Positive integer (≥ 1); `undefined`
|
|
64
|
+
* means "unset — use the Explorer's default". Accepts only numbers and
|
|
65
|
+
* numeric strings (CLI parses flags as strings); every other runtime
|
|
66
|
+
* type — booleans, null, objects — is rejected BEFORE coercion so a
|
|
67
|
+
* `true` can never ride `Number(true) === 1` past validation.
|
|
68
|
+
*/
|
|
69
|
+
export declare function parseBriefDepth(raw: unknown): number | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Parse the `--max-chars` flag value. Positive integer (≥ 1);
|
|
72
|
+
* `undefined` means "unset — use the Explorer's default upper bound".
|
|
73
|
+
* Same runtime-type gate as `parseBriefDepth`: only numbers and numeric
|
|
74
|
+
* strings are coerced.
|
|
75
|
+
*/
|
|
76
|
+
export declare function parseBriefMaxChars(raw: unknown): number | undefined;
|
|
28
77
|
export interface RepoSearchOptions {
|
|
29
78
|
language?: "en" | "zh";
|
|
30
79
|
maxChars?: number;
|
|
@@ -39,6 +88,25 @@ export interface RepoReadOptions {
|
|
|
39
88
|
maxChars?: number;
|
|
40
89
|
noCache?: boolean;
|
|
41
90
|
}
|
|
91
|
+
export interface RepoBriefOptions {
|
|
92
|
+
/**
|
|
93
|
+
* Requested focus, a subset of the sealed `REPO_BRIEF_FOCUS` set, in
|
|
94
|
+
* caller order. Omitted defaults to all four. Non-empty; each token
|
|
95
|
+
* must be a sealed member (DESIGN D7 step 3). Duplicate tokens are
|
|
96
|
+
* collapsed preserving first occurrence, matching `parseBriefFocus`,
|
|
97
|
+
* so direct handler callers cannot smuggle duplicates into the
|
|
98
|
+
* envelope's `focus` field.
|
|
99
|
+
*/
|
|
100
|
+
focus?: readonly RepoBriefFocus[];
|
|
101
|
+
/** Tree-only scope (DESIGN D3: search/read have no path parameter). */
|
|
102
|
+
path?: string;
|
|
103
|
+
/** Tree-only depth; defaults to the Explorer's default (1). */
|
|
104
|
+
depth?: number;
|
|
105
|
+
/** Per-call search/read budget; tree is never character-limited. */
|
|
106
|
+
maxChars?: number;
|
|
107
|
+
/** Bypasses the response cache for every probe. */
|
|
108
|
+
noCache?: boolean;
|
|
109
|
+
}
|
|
42
110
|
/**
|
|
43
111
|
* Dependencies injected by `src/index.ts` after Provider selection,
|
|
44
112
|
* capability support check, configuration check, Adapter
|
|
@@ -49,6 +117,14 @@ export interface RepoReadOptions {
|
|
|
49
117
|
export interface RepoHandlerDependencies {
|
|
50
118
|
readonly capability: RepositoryCapability;
|
|
51
119
|
readonly execution: ExecutionDependencies;
|
|
120
|
+
/**
|
|
121
|
+
* Invocation-resolved credential values used to redact failed-probe
|
|
122
|
+
* error messages. Injected by `src/index.ts` already resolved from
|
|
123
|
+
* the invocation's env (including injected credentials absent from
|
|
124
|
+
* ambient `process.env`). Omitted → the ambient `configuredSecrets()`
|
|
125
|
+
* fallback, mirroring `invokeCommand`'s output/error boundary.
|
|
126
|
+
*/
|
|
127
|
+
readonly secrets?: readonly string[];
|
|
52
128
|
}
|
|
53
129
|
/**
|
|
54
130
|
* Repository Search. Validates parse-level request shape, delegates
|
|
@@ -69,5 +145,24 @@ export declare function repoTree(repo: string, options: RepoTreeOptions, deps: R
|
|
|
69
145
|
* and returns the normalized File result as base data.
|
|
70
146
|
*/
|
|
71
147
|
export declare function repoRead(repo: string, path: string, options: RepoReadOptions, deps: RepoHandlerDependencies, _context?: CommandContext): Promise<CommandResult>;
|
|
148
|
+
/**
|
|
149
|
+
* Repository Brief. Composes the three Explorer operations into one
|
|
150
|
+
* schema-version-1 envelope (DESIGN D2/D3/D4). Fixed probe order:
|
|
151
|
+
* tree → search("README") → search(manifest names) → read loop (README
|
|
152
|
+
* first, then manifests in canonical kind order, cap 4 total reads).
|
|
153
|
+
*
|
|
154
|
+
* Parse-level validation (DESIGN D7): `validateRepo`, `--depth` and
|
|
155
|
+
* `--max-chars` positive integers, `--focus` a non-empty subset of the
|
|
156
|
+
* sealed set (default all four). Forwarding (DESIGN D3): `--no-cache`
|
|
157
|
+
* to every call; `--max-chars` to searches/reads only (the tree is
|
|
158
|
+
* never character-limited); `--depth`/`--path` to the tree only.
|
|
159
|
+
*
|
|
160
|
+
* Every Explorer call runs settled (DESIGN D6): a throw becomes a
|
|
161
|
+
* `failed` probe record and the brief continues. Exit policy: ≥1 probe
|
|
162
|
+
* `ok` → `{kind: "data"}` (exit 0); every probe terminal and failed →
|
|
163
|
+
* the last error is rethrown so the executor routes it through the
|
|
164
|
+
* standard stderr boundary (exit 1).
|
|
165
|
+
*/
|
|
166
|
+
export declare function repoBrief(repo: string, options: RepoBriefOptions, deps: RepoHandlerDependencies, _context?: CommandContext): Promise<CommandResult<RepositoryBrief>>;
|
|
72
167
|
export declare const REPO_HELP: string;
|
|
73
168
|
//# sourceMappingURL=repo.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../src/commands/repo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../src/commands/repo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EAEpB,oBAAoB,EAGpB,cAAc,EAGf,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAgCjE;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,cAAc,EAK5C,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,YAAY,WAAW,CAAC;AACrC,eAAO,MAAM,cAAc,kDACsB,CAAC;AAkElD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,oBAAoB,GACzB;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE,CAgB1C;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,cAAc,EAAE,CA2BtE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAUhE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAUnE;AAMD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAA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