@neuralis/brain-core 0.2.0 → 0.2.1
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/app/README.md +1 -1
- package/app/filesystem/README.md +3 -3
- package/app/filesystem/api/README.md +3 -3
- package/app/filesystem/api/index.ts +127 -122
- package/app/filesystem/domain/types.ts +12 -0
- package/app/filesystem/hooks/README.md +5 -5
- package/app/filesystem/hooks/useDiscoverableSources.ts +4 -2
- package/app/filesystem/hooks/useFilesystemSSE.ts +31 -23
- package/app/filesystem/hooks/useGitChangesInventory.ts +4 -2
- package/app/filesystem/host/README.md +3 -2
- package/app/filesystem/host/installFilesystemHostComponents.tsx +22 -9
- package/app/filesystem/store/README.md +11 -7
- package/app/filesystem/store/filesystemStore.ts +434 -161
- package/app/filesystem/store/gitSlice.ts +6 -6
- package/app/filesystem/store/listSlice.ts +8 -6
- package/app/filesystem/store/searchSlice.ts +3 -3
- package/app/filesystem/ui/FileEditor.tsx +48 -35
- package/app/filesystem/ui/FileTree.tsx +10 -9
- package/app/filesystem/ui/GitCommitChangesView.tsx +5 -3
- package/app/filesystem/ui/GitCommitGraph.tsx +6 -5
- package/app/filesystem/ui/GitControlPanel.tsx +14 -13
- package/app/filesystem/ui/GitDiffView.tsx +2 -1
- package/app/filesystem/ui/GitFileDiff.tsx +7 -6
- package/app/filesystem/ui/PendingChangesPanel.tsx +16 -13
- package/app/filesystem/ui/PendingReviewDialog.tsx +8 -5
- package/app/filesystem/ui/ReembedDialog.tsx +4 -2
- package/app/filesystem/ui/SourcesPanel.tsx +26 -26
- package/app/filesystem/ui/VectorHealthPanel.tsx +6 -4
- package/dist/app/host.js +46 -46
- package/package.json +4 -4
- package/skills/create-package/references/manifest-and-discovery.md +1 -1
- package/skills/create-package/references/surfaces-and-design.md +7 -5
- package/skills/create-package/scripts/check-package.sh +47 -1
- package/app/filesystem/hooks/useContainerWidth.ts +0 -39
|
@@ -21,12 +21,15 @@ import type {
|
|
|
21
21
|
} from '../domain/types';
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
24
|
+
* Every request takes its `client` as the LAST argument: a Files window passes
|
|
25
|
+
* the one its store was built with — `createPackageApi` over the window's project
|
|
26
|
+
* and BOUND agent (`createFilesWindowStore`) — so the X-Project-Id / X-Agent-Id
|
|
27
|
+
* headers are the window's own, fixed before any await, whatever other Files
|
|
28
|
+
* window or agent is mounted beside it. A request body may still name another
|
|
29
|
+
* agent (a file read through its writing agent); the header plane stays the
|
|
30
|
+
* window's. `readFiles` alone accepts no client, for the chat change card, which
|
|
31
|
+
* is not a Files window and reads through the first registered provider.
|
|
26
32
|
*/
|
|
27
|
-
function api(): Promise<PackageApi> {
|
|
28
|
-
return tryGetPackageApiImperativeAsync('brain-core');
|
|
29
|
-
}
|
|
30
33
|
|
|
31
34
|
export type ResolveListOpts = {
|
|
32
35
|
/** Omit (or `/`) for the full-root view; otherwise a scope URI like `data://agent-core`. */
|
|
@@ -58,8 +61,9 @@ export type ResolveListOpts = {
|
|
|
58
61
|
|
|
59
62
|
export async function resolveList(
|
|
60
63
|
agentId: string,
|
|
61
|
-
projectId
|
|
62
|
-
opts
|
|
64
|
+
projectId: string | undefined,
|
|
65
|
+
opts: ResolveListOpts,
|
|
66
|
+
client: PackageApi,
|
|
63
67
|
): Promise<{
|
|
64
68
|
uri: string;
|
|
65
69
|
folders: unknown[];
|
|
@@ -69,7 +73,6 @@ export async function resolveList(
|
|
|
69
73
|
truncated?: boolean;
|
|
70
74
|
summary_omitted_count?: number;
|
|
71
75
|
}> {
|
|
72
|
-
const a = await api();
|
|
73
76
|
const body: Record<string, unknown> = { agentId };
|
|
74
77
|
if (projectId) body.projectId = projectId;
|
|
75
78
|
if (opts?.uri) body.uri = opts.uri;
|
|
@@ -81,7 +84,7 @@ export async function resolveList(
|
|
|
81
84
|
if (typeof opts?.sources_only === 'boolean') body.sources_only = opts.sources_only;
|
|
82
85
|
if (typeof opts?.include_counts === 'boolean') body.include_counts = opts.include_counts;
|
|
83
86
|
if (typeof opts?.limit === 'number') body.limit = opts.limit;
|
|
84
|
-
return
|
|
87
|
+
return client.post('list', body);
|
|
85
88
|
}
|
|
86
89
|
|
|
87
90
|
/**
|
|
@@ -95,6 +98,7 @@ export async function fetchSourceCounts(
|
|
|
95
98
|
agentId: string,
|
|
96
99
|
projectId: string | undefined,
|
|
97
100
|
source: string,
|
|
101
|
+
client: PackageApi,
|
|
98
102
|
): Promise<SourceInfo | null> {
|
|
99
103
|
const res = await resolveList(agentId, projectId, {
|
|
100
104
|
uri: `${source}://`,
|
|
@@ -102,7 +106,7 @@ export async function fetchSourceCounts(
|
|
|
102
106
|
include: 'folders',
|
|
103
107
|
include_counts: true,
|
|
104
108
|
limit: 1,
|
|
105
|
-
});
|
|
109
|
+
}, client);
|
|
106
110
|
return res.sources?.[0] ?? null;
|
|
107
111
|
}
|
|
108
112
|
|
|
@@ -112,8 +116,8 @@ export async function readFiles(params: {
|
|
|
112
116
|
files: string[];
|
|
113
117
|
/** `baseline` reads the pre-change snapshot (for the Changes diff card). */
|
|
114
118
|
read_version?: 'current' | 'baseline';
|
|
115
|
-
}): Promise<FSReadResponse> {
|
|
116
|
-
return (await
|
|
119
|
+
}, client?: PackageApi): Promise<FSReadResponse> {
|
|
120
|
+
return (client ?? await tryGetPackageApiImperativeAsync('brain-core')).post('read', params);
|
|
117
121
|
}
|
|
118
122
|
|
|
119
123
|
export async function listSourceConfigs(params: {
|
|
@@ -121,20 +125,20 @@ export async function listSourceConfigs(params: {
|
|
|
121
125
|
projectId?: string;
|
|
122
126
|
scope?: 'project' | 'user' | 'agent';
|
|
123
127
|
observed?: boolean;
|
|
124
|
-
}): Promise<SourceConfigRecord[]> {
|
|
128
|
+
}, client: PackageApi): Promise<SourceConfigRecord[]> {
|
|
125
129
|
const qs: Record<string, string> = { agentId: params.agentId };
|
|
126
130
|
if (params.projectId) qs.projectId = params.projectId;
|
|
127
131
|
if (params.scope) qs.scope = params.scope;
|
|
128
132
|
if (params.observed) qs.observed = '1';
|
|
129
|
-
return
|
|
133
|
+
return client.get('sources', qs);
|
|
130
134
|
}
|
|
131
135
|
|
|
132
136
|
export async function updateSourceConfig(params: {
|
|
133
137
|
agentId: string;
|
|
134
138
|
projectId?: string;
|
|
135
139
|
config: UpdateSourceConfigRequest;
|
|
136
|
-
}): Promise<SourceConfigRecord> {
|
|
137
|
-
return
|
|
140
|
+
}, client: PackageApi): Promise<SourceConfigRecord> {
|
|
141
|
+
return client.patch('sources', {
|
|
138
142
|
agentId: params.agentId,
|
|
139
143
|
...(params.projectId ? { projectId: params.projectId } : {}),
|
|
140
144
|
...params.config,
|
|
@@ -149,8 +153,8 @@ export async function triggerSourceSync(params: {
|
|
|
149
153
|
agentId: string;
|
|
150
154
|
projectId?: string;
|
|
151
155
|
source: string;
|
|
152
|
-
}): Promise<TriggerSourceSyncResponse> {
|
|
153
|
-
return
|
|
156
|
+
}, client: PackageApi): Promise<TriggerSourceSyncResponse> {
|
|
157
|
+
return client.post('sources/sync', params);
|
|
154
158
|
}
|
|
155
159
|
|
|
156
160
|
/** Queue job status for one source (or every visible source when omitted). */
|
|
@@ -158,11 +162,11 @@ export async function getSyncStatus(params: {
|
|
|
158
162
|
agentId: string;
|
|
159
163
|
projectId?: string;
|
|
160
164
|
source?: string;
|
|
161
|
-
}): Promise<{ source?: string; job?: SyncJobSnapshotRecord | null; jobs?: SyncJobSnapshotRecord[] }> {
|
|
165
|
+
}, client: PackageApi): Promise<{ source?: string; job?: SyncJobSnapshotRecord | null; jobs?: SyncJobSnapshotRecord[] }> {
|
|
162
166
|
const qs: Record<string, string> = { agentId: params.agentId };
|
|
163
167
|
if (params.projectId) qs.projectId = params.projectId;
|
|
164
168
|
if (params.source) qs.source = params.source;
|
|
165
|
-
return
|
|
169
|
+
return client.get('sources/sync-status', qs);
|
|
166
170
|
}
|
|
167
171
|
|
|
168
172
|
/**
|
|
@@ -174,8 +178,8 @@ export async function setSourceEnabled(params: {
|
|
|
174
178
|
projectId?: string;
|
|
175
179
|
source: string;
|
|
176
180
|
enabled: boolean | 'auto';
|
|
177
|
-
}): Promise<SourceConfigRecord> {
|
|
178
|
-
return
|
|
181
|
+
}, client: PackageApi): Promise<SourceConfigRecord> {
|
|
182
|
+
return client.post('sources/enabled', {
|
|
179
183
|
agentId: params.agentId,
|
|
180
184
|
...(params.projectId ? { projectId: params.projectId } : {}),
|
|
181
185
|
source: params.source,
|
|
@@ -237,11 +241,11 @@ export type DiscoverableSourceSuggestion = {
|
|
|
237
241
|
export async function listDiscoverableSources(params: {
|
|
238
242
|
agentId: string;
|
|
239
243
|
projectId?: string;
|
|
240
|
-
}): Promise<{ suggestions: DiscoverableSourceSuggestion[] }> {
|
|
244
|
+
}, client: PackageApi): Promise<{ suggestions: DiscoverableSourceSuggestion[] }> {
|
|
241
245
|
const qs = new URLSearchParams();
|
|
242
246
|
qs.set('agentId', params.agentId);
|
|
243
247
|
if (params.projectId) qs.set('projectId', params.projectId);
|
|
244
|
-
return
|
|
248
|
+
return client.get('sources/discoverable', Object.fromEntries(qs));
|
|
245
249
|
}
|
|
246
250
|
|
|
247
251
|
// ---------------------------------------------------------------------------
|
|
@@ -283,10 +287,10 @@ export async function getGitRepos(params: {
|
|
|
283
287
|
agentId: string;
|
|
284
288
|
projectId?: string;
|
|
285
289
|
source: string;
|
|
286
|
-
}): Promise<{ ok: boolean; repos: GitRepoInfo[] }> {
|
|
290
|
+
}, client: PackageApi): Promise<{ ok: boolean; repos: GitRepoInfo[] }> {
|
|
287
291
|
const qs: Record<string, string> = { agentId: params.agentId, source: params.source };
|
|
288
292
|
if (params.projectId) qs.projectId = params.projectId;
|
|
289
|
-
return
|
|
293
|
+
return client.get('git/repos', qs);
|
|
290
294
|
}
|
|
291
295
|
|
|
292
296
|
/**
|
|
@@ -299,7 +303,7 @@ export async function getGitStatus(params: {
|
|
|
299
303
|
projectId?: string;
|
|
300
304
|
source: string;
|
|
301
305
|
repo?: string;
|
|
302
|
-
}): Promise<{
|
|
306
|
+
}, client: PackageApi): Promise<{
|
|
303
307
|
ok: boolean;
|
|
304
308
|
status: GitControlStatus;
|
|
305
309
|
/** Bucket `+/-` totals for the section headers, summed server-side over the
|
|
@@ -308,7 +312,7 @@ export async function getGitStatus(params: {
|
|
|
308
312
|
}> {
|
|
309
313
|
const qs: Record<string, string> = { agentId: params.agentId, source: params.source, ...repoQuery(params.repo) };
|
|
310
314
|
if (params.projectId) qs.projectId = params.projectId;
|
|
311
|
-
return
|
|
315
|
+
return client.get('git/status', qs);
|
|
312
316
|
}
|
|
313
317
|
|
|
314
318
|
/** Local branch list for the (G2.3) branch-switcher. */
|
|
@@ -317,10 +321,10 @@ export async function getGitBranches(params: {
|
|
|
317
321
|
projectId?: string;
|
|
318
322
|
source: string;
|
|
319
323
|
repo?: string;
|
|
320
|
-
}): Promise<{ ok: boolean; branches: GitBranchInfo[]; truncated?: boolean }> {
|
|
324
|
+
}, client: PackageApi): Promise<{ ok: boolean; branches: GitBranchInfo[]; truncated?: boolean }> {
|
|
321
325
|
const qs: Record<string, string> = { agentId: params.agentId, source: params.source, ...repoQuery(params.repo) };
|
|
322
326
|
if (params.projectId) qs.projectId = params.projectId;
|
|
323
|
-
return
|
|
327
|
+
return client.get('git/branch', qs);
|
|
324
328
|
}
|
|
325
329
|
|
|
326
330
|
/**
|
|
@@ -356,7 +360,7 @@ export async function getGitDiff(params: {
|
|
|
356
360
|
commit?: string;
|
|
357
361
|
base?: string;
|
|
358
362
|
head?: string;
|
|
359
|
-
}): Promise<
|
|
363
|
+
}, client: PackageApi): Promise<
|
|
360
364
|
| {
|
|
361
365
|
ok: true;
|
|
362
366
|
diff: string;
|
|
@@ -390,7 +394,7 @@ export async function getGitDiff(params: {
|
|
|
390
394
|
if (typeof params.head === 'string') qs.head = params.head;
|
|
391
395
|
if (typeof params.staged === 'boolean') qs.staged = params.staged ? '1' : '0';
|
|
392
396
|
if (params.projectId) qs.projectId = params.projectId;
|
|
393
|
-
return
|
|
397
|
+
return client.get('git/diff', qs);
|
|
394
398
|
}
|
|
395
399
|
|
|
396
400
|
/**
|
|
@@ -414,13 +418,13 @@ export async function getGitLog(params: {
|
|
|
414
418
|
maxCount?: number;
|
|
415
419
|
skip?: number;
|
|
416
420
|
ref?: string;
|
|
417
|
-
}): Promise<{ ok: boolean; commits: GitGraphCommit[]; hasMore: boolean; outgoing?: string[] }> {
|
|
421
|
+
}, client: PackageApi): Promise<{ ok: boolean; commits: GitGraphCommit[]; hasMore: boolean; outgoing?: string[] }> {
|
|
418
422
|
const qs: Record<string, string> = { agentId: params.agentId, source: params.source, ...repoQuery(params.repo) };
|
|
419
423
|
if (params.projectId) qs.projectId = params.projectId;
|
|
420
424
|
if (typeof params.maxCount === 'number') qs.maxCount = String(params.maxCount);
|
|
421
425
|
if (typeof params.skip === 'number') qs.skip = String(params.skip);
|
|
422
426
|
if (params.ref) qs.ref = params.ref;
|
|
423
|
-
return
|
|
427
|
+
return client.get('git/log', qs);
|
|
424
428
|
}
|
|
425
429
|
|
|
426
430
|
/**
|
|
@@ -444,13 +448,13 @@ export async function getGitLogStats(params: {
|
|
|
444
448
|
maxCount?: number;
|
|
445
449
|
skip?: number;
|
|
446
450
|
ref?: string;
|
|
447
|
-
}): Promise<GitLogStatsResponse> {
|
|
451
|
+
}, client: PackageApi): Promise<GitLogStatsResponse> {
|
|
448
452
|
const qs: Record<string, string> = { agentId: params.agentId, source: params.source, ...repoQuery(params.repo) };
|
|
449
453
|
if (params.projectId) qs.projectId = params.projectId;
|
|
450
454
|
if (typeof params.maxCount === 'number') qs.maxCount = String(params.maxCount);
|
|
451
455
|
if (typeof params.skip === 'number') qs.skip = String(params.skip);
|
|
452
456
|
if (params.ref) qs.ref = params.ref;
|
|
453
|
-
return
|
|
457
|
+
return client.get('git/log-stats', qs);
|
|
454
458
|
}
|
|
455
459
|
|
|
456
460
|
/**
|
|
@@ -469,7 +473,7 @@ export async function getGitCommitFiles(params: {
|
|
|
469
473
|
source: string;
|
|
470
474
|
repo?: string;
|
|
471
475
|
sha: string;
|
|
472
|
-
}): Promise<
|
|
476
|
+
}, client: PackageApi): Promise<
|
|
473
477
|
| { ok: true; sha: string; files: GitCommitFileChange[] }
|
|
474
478
|
| { ok: false; code: 'unavailable'; sha: string }
|
|
475
479
|
> {
|
|
@@ -480,7 +484,7 @@ export async function getGitCommitFiles(params: {
|
|
|
480
484
|
sha: params.sha,
|
|
481
485
|
};
|
|
482
486
|
if (params.projectId) qs.projectId = params.projectId;
|
|
483
|
-
return
|
|
487
|
+
return client.get('git/commit', qs);
|
|
484
488
|
}
|
|
485
489
|
|
|
486
490
|
/**
|
|
@@ -498,7 +502,7 @@ export async function getGitOutgoing(params: {
|
|
|
498
502
|
projectId?: string;
|
|
499
503
|
source: string;
|
|
500
504
|
repo?: string;
|
|
501
|
-
}): Promise<{
|
|
505
|
+
}, client: PackageApi): Promise<{
|
|
502
506
|
ok: boolean;
|
|
503
507
|
// Present on the `ok:true` shapes (ready | honest no-upstream). A DEEP failure
|
|
504
508
|
// (non-repo / unborn HEAD / any git error) is a typed refusal `{ok:false,
|
|
@@ -511,7 +515,7 @@ export async function getGitOutgoing(params: {
|
|
|
511
515
|
}> {
|
|
512
516
|
const qs: Record<string, string> = { agentId: params.agentId, source: params.source, ...repoQuery(params.repo) };
|
|
513
517
|
if (params.projectId) qs.projectId = params.projectId;
|
|
514
|
-
return
|
|
518
|
+
return client.get('git/outgoing', qs);
|
|
515
519
|
}
|
|
516
520
|
|
|
517
521
|
/**
|
|
@@ -531,7 +535,7 @@ export async function getGitShow(params: {
|
|
|
531
535
|
repo?: string;
|
|
532
536
|
path: string;
|
|
533
537
|
rev: string;
|
|
534
|
-
}): Promise<
|
|
538
|
+
}, client: PackageApi): Promise<
|
|
535
539
|
| { ok: true; content: string; path: string; rev: string }
|
|
536
540
|
| { ok: false; code: 'not_a_blob' | 'too_large' | 'binary' | 'unavailable'; path: string; rev: string }
|
|
537
541
|
> {
|
|
@@ -543,7 +547,7 @@ export async function getGitShow(params: {
|
|
|
543
547
|
rev: params.rev,
|
|
544
548
|
};
|
|
545
549
|
if (params.projectId) qs.projectId = params.projectId;
|
|
546
|
-
return
|
|
550
|
+
return client.get('git/show', qs);
|
|
547
551
|
}
|
|
548
552
|
|
|
549
553
|
// ---------------------------------------------------------------------------
|
|
@@ -560,8 +564,6 @@ export async function getGitShow(params: {
|
|
|
560
564
|
// recovered from), surfaced for the best-effort undo affordance.
|
|
561
565
|
// ---------------------------------------------------------------------------
|
|
562
566
|
|
|
563
|
-
const git = () => api();
|
|
564
|
-
|
|
565
567
|
/**
|
|
566
568
|
* The typed rescue carrier a destructive op returns (G2.5) — drives one-click
|
|
567
569
|
* UNDO via `restoreGit`. `stash` → `git stash apply <ref>` (discarded content);
|
|
@@ -577,8 +579,8 @@ export async function stagePaths(params: {
|
|
|
577
579
|
source: string;
|
|
578
580
|
repo?: string;
|
|
579
581
|
paths: string[];
|
|
580
|
-
}): Promise<{ ok: boolean; staged: string[] | 'hunk' }> {
|
|
581
|
-
return
|
|
582
|
+
}, client: PackageApi): Promise<{ ok: boolean; staged: string[] | 'hunk' }> {
|
|
583
|
+
return client.post('git/stage', {
|
|
582
584
|
source: params.source,
|
|
583
585
|
...repoBody(params.repo),
|
|
584
586
|
paths: params.paths,
|
|
@@ -594,8 +596,8 @@ export async function unstagePaths(params: {
|
|
|
594
596
|
source: string;
|
|
595
597
|
repo?: string;
|
|
596
598
|
paths: string[];
|
|
597
|
-
}): Promise<{ ok: boolean; unstaged: string[] | 'hunk' }> {
|
|
598
|
-
return
|
|
599
|
+
}, client: PackageApi): Promise<{ ok: boolean; unstaged: string[] | 'hunk' }> {
|
|
600
|
+
return client.post('git/unstage', {
|
|
599
601
|
source: params.source,
|
|
600
602
|
...repoBody(params.repo),
|
|
601
603
|
paths: params.paths,
|
|
@@ -614,8 +616,8 @@ export async function stageHunk(params: {
|
|
|
614
616
|
source: string;
|
|
615
617
|
repo?: string;
|
|
616
618
|
hunk: string;
|
|
617
|
-
}): Promise<{ ok: boolean; staged: string[] | 'hunk' }> {
|
|
618
|
-
return
|
|
619
|
+
}, client: PackageApi): Promise<{ ok: boolean; staged: string[] | 'hunk' }> {
|
|
620
|
+
return client.post('git/stage', {
|
|
619
621
|
source: params.source,
|
|
620
622
|
...repoBody(params.repo),
|
|
621
623
|
hunk: params.hunk,
|
|
@@ -631,8 +633,8 @@ export async function unstageHunk(params: {
|
|
|
631
633
|
source: string;
|
|
632
634
|
repo?: string;
|
|
633
635
|
hunk: string;
|
|
634
|
-
}): Promise<{ ok: boolean; unstaged: string[] | 'hunk' }> {
|
|
635
|
-
return
|
|
636
|
+
}, client: PackageApi): Promise<{ ok: boolean; unstaged: string[] | 'hunk' }> {
|
|
637
|
+
return client.post('git/unstage', {
|
|
636
638
|
source: params.source,
|
|
637
639
|
...repoBody(params.repo),
|
|
638
640
|
hunk: params.hunk,
|
|
@@ -653,8 +655,8 @@ export async function discardPaths(params: {
|
|
|
653
655
|
source: string;
|
|
654
656
|
repo?: string;
|
|
655
657
|
paths: string[];
|
|
656
|
-
}): Promise<{ ok: boolean; discarded: string[]; rescue?: GitRescue }> {
|
|
657
|
-
return
|
|
658
|
+
}, client: PackageApi): Promise<{ ok: boolean; discarded: string[]; rescue?: GitRescue }> {
|
|
659
|
+
return client.post('git/discard', {
|
|
658
660
|
source: params.source,
|
|
659
661
|
...repoBody(params.repo),
|
|
660
662
|
paths: params.paths,
|
|
@@ -671,8 +673,8 @@ export async function commitGit(params: {
|
|
|
671
673
|
repo?: string;
|
|
672
674
|
message: string;
|
|
673
675
|
amend?: boolean;
|
|
674
|
-
}): Promise<{ ok: boolean; commit: string }> {
|
|
675
|
-
return
|
|
676
|
+
}, client: PackageApi): Promise<{ ok: boolean; commit: string }> {
|
|
677
|
+
return client.post('git/commit', {
|
|
676
678
|
source: params.source,
|
|
677
679
|
...repoBody(params.repo),
|
|
678
680
|
message: params.message,
|
|
@@ -690,8 +692,8 @@ export async function createGitBranch(params: {
|
|
|
690
692
|
repo?: string;
|
|
691
693
|
name: string;
|
|
692
694
|
startPoint?: string;
|
|
693
|
-
}): Promise<{ ok: boolean; branch: string; action: 'create' }> {
|
|
694
|
-
return
|
|
695
|
+
}, client: PackageApi): Promise<{ ok: boolean; branch: string; action: 'create' }> {
|
|
696
|
+
return client.post('git/branch', {
|
|
695
697
|
source: params.source,
|
|
696
698
|
...repoBody(params.repo),
|
|
697
699
|
action: 'create',
|
|
@@ -714,8 +716,8 @@ export async function deleteGitBranch(params: {
|
|
|
714
716
|
repo?: string;
|
|
715
717
|
name: string;
|
|
716
718
|
force?: boolean;
|
|
717
|
-
}): Promise<{ ok: boolean; branch: string; action: 'delete'; rescue?: GitRescue }> {
|
|
718
|
-
return
|
|
719
|
+
}, client: PackageApi): Promise<{ ok: boolean; branch: string; action: 'delete'; rescue?: GitRescue }> {
|
|
720
|
+
return client.post('git/branch', {
|
|
719
721
|
source: params.source,
|
|
720
722
|
...repoBody(params.repo),
|
|
721
723
|
action: 'delete',
|
|
@@ -738,8 +740,8 @@ export async function restoreGit(params: {
|
|
|
738
740
|
source: string;
|
|
739
741
|
repo?: string;
|
|
740
742
|
rescue: GitRescue;
|
|
741
|
-
}): Promise<{ ok: boolean; restored: 'stash' | 'branch' }> {
|
|
742
|
-
return
|
|
743
|
+
}, client: PackageApi): Promise<{ ok: boolean; restored: 'stash' | 'branch' }> {
|
|
744
|
+
return client.post('git/restore', {
|
|
743
745
|
source: params.source,
|
|
744
746
|
...repoBody(params.repo),
|
|
745
747
|
rescue: params.rescue,
|
|
@@ -758,8 +760,8 @@ export async function checkoutGitBranch(params: {
|
|
|
758
760
|
source: string;
|
|
759
761
|
repo?: string;
|
|
760
762
|
ref: string;
|
|
761
|
-
}): Promise<{ ok: boolean; checkout: string }> {
|
|
762
|
-
return
|
|
763
|
+
}, client: PackageApi): Promise<{ ok: boolean; checkout: string }> {
|
|
764
|
+
return client.post('git/checkout', {
|
|
763
765
|
source: params.source,
|
|
764
766
|
...repoBody(params.repo),
|
|
765
767
|
ref: params.ref,
|
|
@@ -781,8 +783,8 @@ export async function fetchGit(params: {
|
|
|
781
783
|
projectId?: string;
|
|
782
784
|
source: string;
|
|
783
785
|
repo?: string;
|
|
784
|
-
}): Promise<{ ok: boolean; op: 'fetch'; host: string; status?: GitControlStatus }> {
|
|
785
|
-
return
|
|
786
|
+
}, client: PackageApi): Promise<{ ok: boolean; op: 'fetch'; host: string; status?: GitControlStatus }> {
|
|
787
|
+
return client.post('git/fetch', {
|
|
786
788
|
source: params.source,
|
|
787
789
|
...repoBody(params.repo),
|
|
788
790
|
...(params.projectId ? { projectId: params.projectId } : {}),
|
|
@@ -796,8 +798,8 @@ export async function pullGit(params: {
|
|
|
796
798
|
projectId?: string;
|
|
797
799
|
source: string;
|
|
798
800
|
repo?: string;
|
|
799
|
-
}): Promise<{ ok: boolean; op: 'pull'; host: string; status?: GitControlStatus }> {
|
|
800
|
-
return
|
|
801
|
+
}, client: PackageApi): Promise<{ ok: boolean; op: 'pull'; host: string; status?: GitControlStatus }> {
|
|
802
|
+
return client.post('git/pull', {
|
|
801
803
|
source: params.source,
|
|
802
804
|
...repoBody(params.repo),
|
|
803
805
|
...(params.projectId ? { projectId: params.projectId } : {}),
|
|
@@ -811,8 +813,8 @@ export async function pushGit(params: {
|
|
|
811
813
|
projectId?: string;
|
|
812
814
|
source: string;
|
|
813
815
|
repo?: string;
|
|
814
|
-
}): Promise<{ ok: boolean; op: 'push'; host: string }> {
|
|
815
|
-
return
|
|
816
|
+
}, client: PackageApi): Promise<{ ok: boolean; op: 'push'; host: string }> {
|
|
817
|
+
return client.post('git/push', {
|
|
816
818
|
source: params.source,
|
|
817
819
|
...repoBody(params.repo),
|
|
818
820
|
...(params.projectId ? { projectId: params.projectId } : {}),
|
|
@@ -836,8 +838,8 @@ export async function searchFiles(params: {
|
|
|
836
838
|
created_before?: string;
|
|
837
839
|
include_siblings?: boolean;
|
|
838
840
|
limit?: number;
|
|
839
|
-
}): Promise<FSSearchResponse> {
|
|
840
|
-
return
|
|
841
|
+
}, client: PackageApi): Promise<FSSearchResponse> {
|
|
842
|
+
return client.post('search', params);
|
|
841
843
|
}
|
|
842
844
|
|
|
843
845
|
/**
|
|
@@ -855,14 +857,14 @@ export async function uploadFile(params: {
|
|
|
855
857
|
file: File;
|
|
856
858
|
uri?: string;
|
|
857
859
|
tags?: string[];
|
|
858
|
-
}): Promise<FSUploadResponse> {
|
|
860
|
+
}, client: PackageApi): Promise<FSUploadResponse> {
|
|
859
861
|
const form = new FormData();
|
|
860
862
|
form.append('agentId', params.agentId);
|
|
861
863
|
if (params.projectId) form.append('projectId', params.projectId);
|
|
862
864
|
form.append('file', params.file);
|
|
863
865
|
if (params.uri) form.append('uri', params.uri);
|
|
864
866
|
if (params.tags?.length) form.append('tags', params.tags.join(','));
|
|
865
|
-
return
|
|
867
|
+
return client.upload('upload', form);
|
|
866
868
|
}
|
|
867
869
|
|
|
868
870
|
/**
|
|
@@ -901,8 +903,9 @@ export type FSWriteRequest = {
|
|
|
901
903
|
|
|
902
904
|
export async function writeFile(
|
|
903
905
|
params: { agentId: string; projectId?: string } & FSWriteRequest,
|
|
906
|
+
client: PackageApi,
|
|
904
907
|
): Promise<FSWriteResponse> {
|
|
905
|
-
return
|
|
908
|
+
return client.post('write', params);
|
|
906
909
|
}
|
|
907
910
|
|
|
908
911
|
/**
|
|
@@ -927,8 +930,8 @@ export async function approveFileReview(params: {
|
|
|
927
930
|
uri?: string;
|
|
928
931
|
expectedFingerprint?: string;
|
|
929
932
|
acknowledgeCurrentState?: true;
|
|
930
|
-
}): Promise<FSReviewApproveResponse> {
|
|
931
|
-
return
|
|
933
|
+
}, client: PackageApi): Promise<FSReviewApproveResponse> {
|
|
934
|
+
return client.post('approve', params);
|
|
932
935
|
}
|
|
933
936
|
|
|
934
937
|
// ---------------------------------------------------------------------------
|
|
@@ -942,8 +945,8 @@ export async function approveFileReview(params: {
|
|
|
942
945
|
export type { PendingChangeRecord, PendingPreview, PendingReviewIntent } from '@neuralis/brain-core/domain/pending-change';
|
|
943
946
|
import type { PendingChangeRecord, PendingPreview } from '@neuralis/brain-core/domain/pending-change';
|
|
944
947
|
|
|
945
|
-
export async function previewPendingChange(params: { agentId: string; projectId?: string; id: string }): Promise<PendingPreview> {
|
|
946
|
-
const result = await
|
|
948
|
+
export async function previewPendingChange(params: { agentId: string; projectId?: string; id: string }, client: PackageApi): Promise<PendingPreview> {
|
|
949
|
+
const result = await client.post('pending', { ...params, action: 'preview' }) as { preview: PendingPreview };
|
|
947
950
|
return result.preview;
|
|
948
951
|
}
|
|
949
952
|
|
|
@@ -970,8 +973,9 @@ export type PendingChangesQuery = {
|
|
|
970
973
|
*/
|
|
971
974
|
export async function listPendingChanges(
|
|
972
975
|
params: PendingChangesQuery,
|
|
976
|
+
client: PackageApi,
|
|
973
977
|
): Promise<{ ok: boolean; changes: PendingChangeRecord[]; orphanIds: string[] }> {
|
|
974
|
-
const res = await
|
|
978
|
+
const res = await client.post('pending', params) as {
|
|
975
979
|
ok?: boolean; changes?: PendingChangeRecord[]; orphanIds?: string[];
|
|
976
980
|
};
|
|
977
981
|
return {
|
|
@@ -985,10 +989,10 @@ export async function listPendingChanges(
|
|
|
985
989
|
* The caller's visible pending COUNT — the list's own per-record floor, no orphan
|
|
986
990
|
* probe and no rows on the wire. Feeds the Changes badge.
|
|
987
991
|
*/
|
|
988
|
-
export async function countPendingChanges(params: { agentId: string; projectId?: string }): Promise<number> {
|
|
992
|
+
export async function countPendingChanges(params: { agentId: string; projectId?: string }, client: PackageApi): Promise<number> {
|
|
989
993
|
const qs: Record<string, string> = { agentId: params.agentId, count_only: '1' };
|
|
990
994
|
if (params.projectId) qs.projectId = params.projectId;
|
|
991
|
-
const res = await
|
|
995
|
+
const res = await client.get('pending', qs) as { count?: number };
|
|
992
996
|
return typeof res?.count === 'number' ? res.count : 0;
|
|
993
997
|
}
|
|
994
998
|
|
|
@@ -998,8 +1002,8 @@ export async function revertPendingChange(params: {
|
|
|
998
1002
|
id: string;
|
|
999
1003
|
expectedFingerprint?: string;
|
|
1000
1004
|
acknowledgeCurrentState?: true;
|
|
1001
|
-
}): Promise<{ ok: boolean; id: string; uri?: string; error?: string }> {
|
|
1002
|
-
return
|
|
1005
|
+
}, client: PackageApi): Promise<{ ok: boolean; id: string; uri?: string; error?: string }> {
|
|
1006
|
+
return client.post('pending', { ...params, action: 'revert' }) as Promise<{ ok: boolean; id: string; uri?: string; error?: string }>;
|
|
1003
1007
|
}
|
|
1004
1008
|
|
|
1005
1009
|
/** Scan the caller's visible pending changes for ORPHANED rows — backing target
|
|
@@ -1009,8 +1013,8 @@ export async function scanOrphanedPending(params: {
|
|
|
1009
1013
|
agentId: string;
|
|
1010
1014
|
projectId?: string;
|
|
1011
1015
|
conversationId?: string;
|
|
1012
|
-
}): Promise<{ ok: boolean; orphans: PendingChangeRecord[] }> {
|
|
1013
|
-
const res = await
|
|
1016
|
+
}, client: PackageApi): Promise<{ ok: boolean; orphans: PendingChangeRecord[] }> {
|
|
1017
|
+
const res = await client.post('pending', { ...params, action: 'scan-orphans' }) as { ok?: boolean; orphans?: PendingChangeRecord[] };
|
|
1014
1018
|
return { ok: res?.ok !== false, orphans: Array.isArray(res?.orphans) ? res.orphans : [] };
|
|
1015
1019
|
}
|
|
1016
1020
|
|
|
@@ -1020,8 +1024,8 @@ export async function discardPendingChange(params: {
|
|
|
1020
1024
|
agentId: string;
|
|
1021
1025
|
projectId?: string;
|
|
1022
1026
|
id: string;
|
|
1023
|
-
}): Promise<{ ok: boolean; id: string; uri?: string; error?: string }> {
|
|
1024
|
-
return
|
|
1027
|
+
}, client: PackageApi): Promise<{ ok: boolean; id: string; uri?: string; error?: string }> {
|
|
1028
|
+
return client.post('pending', { ...params, action: 'discard' }) as Promise<{ ok: boolean; id: string; uri?: string; error?: string }>;
|
|
1025
1029
|
}
|
|
1026
1030
|
|
|
1027
1031
|
/** DISMISS ONE live-source pending record — the op-aware "accept-and-stop-
|
|
@@ -1034,8 +1038,8 @@ export async function dismissPendingChange(params: {
|
|
|
1034
1038
|
id: string;
|
|
1035
1039
|
expectedFingerprint?: string;
|
|
1036
1040
|
acknowledgeCurrentState?: true;
|
|
1037
|
-
}): Promise<{ ok: boolean; id: string; uri?: string; error?: string; retryable?: boolean }> {
|
|
1038
|
-
return
|
|
1041
|
+
}, client: PackageApi): Promise<{ ok: boolean; id: string; uri?: string; error?: string; retryable?: boolean }> {
|
|
1042
|
+
return client.post('pending', { ...params, action: 'dismiss' }) as Promise<{ ok: boolean; id: string; uri?: string; error?: string; retryable?: boolean }>;
|
|
1039
1043
|
}
|
|
1040
1044
|
|
|
1041
1045
|
/** Bulk-discard every orphaned pending change the caller can write (the Repair
|
|
@@ -1044,8 +1048,8 @@ export async function discardOrphanedPending(params: {
|
|
|
1044
1048
|
agentId: string;
|
|
1045
1049
|
projectId?: string;
|
|
1046
1050
|
conversationId?: string;
|
|
1047
|
-
}): Promise<{ ok: boolean; discarded: number }> {
|
|
1048
|
-
const res = await
|
|
1051
|
+
}, client: PackageApi): Promise<{ ok: boolean; discarded: number }> {
|
|
1052
|
+
const res = await client.post('pending', { ...params, action: 'discard-orphans' }) as { ok?: boolean; discarded?: number };
|
|
1049
1053
|
return { ok: res?.ok !== false, discarded: typeof res?.discarded === 'number' ? res.discarded : 0 };
|
|
1050
1054
|
}
|
|
1051
1055
|
|
|
@@ -1066,16 +1070,16 @@ export function getRawFileUrl(agentId: string, uri: string, projectId?: string):
|
|
|
1066
1070
|
export async function checkVectorHealth(params: {
|
|
1067
1071
|
agentId: string;
|
|
1068
1072
|
projectId?: string;
|
|
1069
|
-
}): Promise<Record<string, unknown>> {
|
|
1070
|
-
return
|
|
1073
|
+
}, client: PackageApi): Promise<Record<string, unknown>> {
|
|
1074
|
+
return client.post('health', params);
|
|
1071
1075
|
}
|
|
1072
1076
|
|
|
1073
1077
|
/** Expensive integrity scan (orphan + duplicate detection) — explicit only. */
|
|
1074
1078
|
export async function scanVectorHealth(params: {
|
|
1075
1079
|
agentId: string;
|
|
1076
1080
|
projectId?: string;
|
|
1077
|
-
}): Promise<{ orphanChunkCount?: number; duplicateGroups?: number; generatedAt?: string }> {
|
|
1078
|
-
return
|
|
1081
|
+
}, client: PackageApi): Promise<{ orphanChunkCount?: number; duplicateGroups?: number; generatedAt?: string }> {
|
|
1082
|
+
return client.post('health/scan', params);
|
|
1079
1083
|
}
|
|
1080
1084
|
|
|
1081
1085
|
export async function runHealthAction(params: {
|
|
@@ -1084,12 +1088,12 @@ export async function runHealthAction(params: {
|
|
|
1084
1088
|
action: 'gc' | 'repair-orphans' | 'deduplicate' | 'repair-pending';
|
|
1085
1089
|
dryRun?: boolean;
|
|
1086
1090
|
retentionHours?: number;
|
|
1087
|
-
}): Promise<Record<string, unknown>> {
|
|
1088
|
-
return
|
|
1091
|
+
}, client: PackageApi): Promise<Record<string, unknown>> {
|
|
1092
|
+
return client.post('health/gc', params);
|
|
1089
1093
|
}
|
|
1090
1094
|
|
|
1091
|
-
export async function createSource(params: CreateSourceRequest): Promise<SourceConfigRecord> {
|
|
1092
|
-
return
|
|
1095
|
+
export async function createSource(params: CreateSourceRequest, client: PackageApi): Promise<SourceConfigRecord> {
|
|
1096
|
+
return client.post('sources', params);
|
|
1093
1097
|
}
|
|
1094
1098
|
|
|
1095
1099
|
export async function deleteSource(params: {
|
|
@@ -1101,19 +1105,19 @@ export async function deleteSource(params: {
|
|
|
1101
1105
|
* false/omitted, only the config and in-memory connector binding are
|
|
1102
1106
|
* removed; vectors stay in Qdrant. */
|
|
1103
1107
|
purgeVectors?: boolean;
|
|
1104
|
-
}): Promise<{ ok: true; purgeJob?: SyncJobSnapshotRecord }> {
|
|
1108
|
+
}, client: PackageApi): Promise<{ ok: true; purgeJob?: SyncJobSnapshotRecord }> {
|
|
1105
1109
|
const qs = new URLSearchParams({ agentId: params.agentId });
|
|
1106
1110
|
if (params.projectId) qs.set('projectId', params.projectId);
|
|
1107
1111
|
if (params.purgeVectors) qs.set('purge', '1');
|
|
1108
|
-
return
|
|
1112
|
+
return client.del(`sources/${encodeURIComponent(params.source)}?${qs.toString()}`);
|
|
1109
1113
|
}
|
|
1110
1114
|
|
|
1111
1115
|
export async function resetSync(params: {
|
|
1112
1116
|
agentId: string;
|
|
1113
1117
|
projectId?: string;
|
|
1114
1118
|
source: string;
|
|
1115
|
-
}): Promise<{ ok: true; source: string }> {
|
|
1116
|
-
return
|
|
1119
|
+
}, client: PackageApi): Promise<{ ok: true; source: string }> {
|
|
1120
|
+
return client.post('sources/reset', params);
|
|
1117
1121
|
}
|
|
1118
1122
|
|
|
1119
1123
|
/**
|
|
@@ -1124,8 +1128,8 @@ export async function reindexSource(params: {
|
|
|
1124
1128
|
agentId: string;
|
|
1125
1129
|
projectId?: string;
|
|
1126
1130
|
source: string;
|
|
1127
|
-
}): Promise<SyncJobSnapshotRecord> {
|
|
1128
|
-
return
|
|
1131
|
+
}, client: PackageApi): Promise<SyncJobSnapshotRecord> {
|
|
1132
|
+
return client.post('sources/reindex', params);
|
|
1129
1133
|
}
|
|
1130
1134
|
|
|
1131
1135
|
export type IndexPurgeCounts = { removedParents: number; removedChunks: number; retained: number; unresolved: number; canMaintain: boolean };
|
|
@@ -1133,8 +1137,8 @@ export type IndexPurgeSelector = { kind: 'source' } | { kind: 'folder' | 'file';
|
|
|
1133
1137
|
export async function purgeSourceIndex(params: {
|
|
1134
1138
|
agentId: string; projectId?: string; source: string;
|
|
1135
1139
|
selector: IndexPurgeSelector; mode: 'estimate' | 'apply'; obsoleteOnly?: boolean;
|
|
1136
|
-
}): Promise<IndexPurgeCounts> {
|
|
1137
|
-
return
|
|
1140
|
+
}, client: PackageApi): Promise<IndexPurgeCounts> {
|
|
1141
|
+
return client.post('sources/purge', params);
|
|
1138
1142
|
}
|
|
1139
1143
|
|
|
1140
1144
|
/** The scope of a forced re-embed: the whole source, one `folder`, or one `uri` (full URIs). */
|
|
@@ -1202,9 +1206,9 @@ const reembedVerb = (kind: ReembedKind) => (kind === 'pending' ? { embeddingOnly
|
|
|
1202
1206
|
* source's sync markers — an estimate has no side effect. For `pending` the
|
|
1203
1207
|
* figures are an upper bound: the whole scope, of which only the owed part runs.
|
|
1204
1208
|
*/
|
|
1205
|
-
export async function estimateReembed(params: ReembedScope, kind: ReembedKind
|
|
1209
|
+
export async function estimateReembed(params: ReembedScope, kind: ReembedKind, client: PackageApi): Promise<ReembedEstimate | null> {
|
|
1206
1210
|
return normalizeReembedEstimate(
|
|
1207
|
-
await
|
|
1211
|
+
await client.post<unknown>('sources/reindex', { ...params, ...reembedVerb(kind), estimate: true }),
|
|
1208
1212
|
);
|
|
1209
1213
|
}
|
|
1210
1214
|
|
|
@@ -1215,9 +1219,10 @@ export async function estimateReembed(params: ReembedScope, kind: ReembedKind =
|
|
|
1215
1219
|
*/
|
|
1216
1220
|
export async function startReembed(
|
|
1217
1221
|
params: ReembedScope,
|
|
1218
|
-
kind: ReembedKind
|
|
1222
|
+
kind: ReembedKind,
|
|
1223
|
+
client: PackageApi,
|
|
1219
1224
|
): Promise<{ documents: number | null; truncated: boolean; job: SyncJobSnapshotRecord | null }> {
|
|
1220
|
-
const raw = await
|
|
1225
|
+
const raw = await client.post<Record<string, unknown> | null>('sources/reindex', { ...params, ...reembedVerb(kind) });
|
|
1221
1226
|
const job = raw?.job && typeof raw.job === 'object' ? (raw.job as SyncJobSnapshotRecord) : null;
|
|
1222
1227
|
return { documents: finiteOrNull(raw?.documents), truncated: raw?.truncated === true, job };
|
|
1223
1228
|
}
|
|
@@ -1230,14 +1235,14 @@ export async function cancelSync(params: {
|
|
|
1230
1235
|
agentId: string;
|
|
1231
1236
|
projectId?: string;
|
|
1232
1237
|
source?: string;
|
|
1233
|
-
}): Promise<{ ok: true; source?: string; cancelled: boolean | number }> {
|
|
1234
|
-
return
|
|
1238
|
+
}, client: PackageApi): Promise<{ ok: true; source?: string; cancelled: boolean | number }> {
|
|
1239
|
+
return client.post('sources/cancel', params);
|
|
1235
1240
|
}
|
|
1236
1241
|
|
|
1237
1242
|
export async function getSourcesHealth(params: {
|
|
1238
1243
|
agentId: string;
|
|
1239
1244
|
projectId?: string;
|
|
1240
|
-
}): Promise<Array<{
|
|
1245
|
+
}, client: PackageApi): Promise<Array<{
|
|
1241
1246
|
source: string;
|
|
1242
1247
|
source_kind: string;
|
|
1243
1248
|
sync_status: string;
|
|
@@ -1245,7 +1250,7 @@ export async function getSourcesHealth(params: {
|
|
|
1245
1250
|
}>> {
|
|
1246
1251
|
const qs: Record<string, string> = { agentId: params.agentId };
|
|
1247
1252
|
if (params.projectId) qs.projectId = params.projectId;
|
|
1248
|
-
return
|
|
1253
|
+
return client.get('sources/health', qs);
|
|
1249
1254
|
}
|
|
1250
1255
|
|
|
1251
1256
|
/**
|
|
@@ -1262,10 +1267,10 @@ export async function browseDirectories(params: {
|
|
|
1262
1267
|
path: string;
|
|
1263
1268
|
agentId: string;
|
|
1264
1269
|
projectId?: string;
|
|
1265
|
-
}): Promise<{ entries: Array<{ name: string; path: string; type: 'directory' }> }> {
|
|
1270
|
+
}, client: PackageApi): Promise<{ entries: Array<{ name: string; path: string; type: 'directory' }> }> {
|
|
1266
1271
|
const qs: Record<string, string> = { path: params.path, agentId: params.agentId };
|
|
1267
1272
|
if (params.projectId) qs.projectId = params.projectId;
|
|
1268
|
-
return
|
|
1273
|
+
return client.get('sources/browse', qs);
|
|
1269
1274
|
}
|
|
1270
1275
|
|
|
1271
1276
|
export type SourceKindRecord = {
|
|
@@ -1296,10 +1301,10 @@ export type SourceKindSchema = {
|
|
|
1296
1301
|
defaultSyncExcludes?: string[];
|
|
1297
1302
|
};
|
|
1298
1303
|
|
|
1299
|
-
export async function listSourceKinds(): Promise<{ kinds: SourceKindRecord[] }> {
|
|
1300
|
-
return
|
|
1304
|
+
export async function listSourceKinds(client: PackageApi): Promise<{ kinds: SourceKindRecord[] }> {
|
|
1305
|
+
return client.get('sources/kinds', {});
|
|
1301
1306
|
}
|
|
1302
1307
|
|
|
1303
|
-
export async function getSourceKindSchema(kind: string): Promise<SourceKindSchema> {
|
|
1304
|
-
return
|
|
1308
|
+
export async function getSourceKindSchema(kind: string, client: PackageApi): Promise<SourceKindSchema> {
|
|
1309
|
+
return client.get(`sources/kinds/${encodeURIComponent(kind)}/schema`, {});
|
|
1305
1310
|
}
|