@c4a/context 0.6.0-beta.5 → 0.6.0-beta.6
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 +1 -1
- package/docs/getting-started.md +113 -49
- package/docs/guides/agent-dialogue.md +32 -23
- package/docs/guides/agent-guide.md +125 -58
- package/docs/reference/package-templates.md +7 -1
- package/docs/reference/project-api.md +202 -49
- package/index.js +190 -102
- package/package.json +1 -1
- package/sources.d.ts +22 -0
package/index.js
CHANGED
|
@@ -11359,12 +11359,24 @@ var DEFAULT_FILE_SOURCES_REGISTRY_PATH = "sources/file/index.yaml";
|
|
|
11359
11359
|
var DEFAULT_LARK_SOURCES_REGISTRY_PATH = "sources/lark/index.yaml";
|
|
11360
11360
|
var SOURCE_TYPES = ["repo", "file", "lark"];
|
|
11361
11361
|
var SOURCE_NAME_PATTERN = /^[a-z0-9][a-z0-9._-]*$/u;
|
|
11362
|
+
var REPO_DATE_NAMESPACE_PATTERN = /^\d{8}$/u;
|
|
11362
11363
|
function assertSourceType(value, field) {
|
|
11363
11364
|
if (!SOURCE_TYPES.includes(value)) {
|
|
11364
11365
|
throw new TypeError(`${field} must be one of ${SOURCE_TYPES.join(", ")}: ${value}`);
|
|
11365
11366
|
}
|
|
11366
11367
|
}
|
|
11367
|
-
function source(name, options) {
|
|
11368
|
+
function source(name, options, moduleOptions) {
|
|
11369
|
+
if (typeof options === "string") {
|
|
11370
|
+
const moduleName = options;
|
|
11371
|
+
const type2 = moduleOptions?.type ?? "repo";
|
|
11372
|
+
assertSourceType(type2, "source type");
|
|
11373
|
+
return {
|
|
11374
|
+
kind: "source.ref",
|
|
11375
|
+
type: type2,
|
|
11376
|
+
name: `${name}/${moduleName}`,
|
|
11377
|
+
materializedAt: type2 === "repo" ? `sources/repo/${name}/${moduleName}` : `sources/${type2}/${name}`
|
|
11378
|
+
};
|
|
11379
|
+
}
|
|
11368
11380
|
const type = options?.type;
|
|
11369
11381
|
if (type === undefined) {
|
|
11370
11382
|
return {
|
|
@@ -11381,7 +11393,7 @@ function source(name, options) {
|
|
|
11381
11393
|
materializedAt: `sources/${type}/${name}`
|
|
11382
11394
|
};
|
|
11383
11395
|
}
|
|
11384
|
-
var
|
|
11396
|
+
var repoSourceModuleSchema = exports_external.object({
|
|
11385
11397
|
id: exports_external.string().min(1).optional(),
|
|
11386
11398
|
name: exports_external.string().min(1),
|
|
11387
11399
|
local: exports_external.string().min(1).optional(),
|
|
@@ -11392,6 +11404,10 @@ var repoSourceRegistryEntrySchema = exports_external.object({
|
|
|
11392
11404
|
ref: exports_external.string().min(1)
|
|
11393
11405
|
}).strict().optional()
|
|
11394
11406
|
}).strict();
|
|
11407
|
+
var repoSourceRegistryEntrySchema = exports_external.object({
|
|
11408
|
+
name: exports_external.string().min(1),
|
|
11409
|
+
modules: exports_external.array(repoSourceModuleSchema).min(1)
|
|
11410
|
+
}).strict();
|
|
11395
11411
|
var sourceSnapshotSchema = exports_external.object({
|
|
11396
11412
|
manifest: exports_external.string().min(1)
|
|
11397
11413
|
}).strict();
|
|
@@ -11403,6 +11419,10 @@ var fileSourceRegistryEntrySchema = exports_external.object({
|
|
|
11403
11419
|
materializedAt: exports_external.string().min(1).optional(),
|
|
11404
11420
|
snapshot: sourceSnapshotSchema.optional()
|
|
11405
11421
|
}).strict();
|
|
11422
|
+
var fileSourceBatchSchema = exports_external.object({
|
|
11423
|
+
name: exports_external.string().min(1),
|
|
11424
|
+
modules: exports_external.array(fileSourceRegistryEntrySchema).min(1)
|
|
11425
|
+
}).strict();
|
|
11406
11426
|
var larkSourceRegistryEntrySchema = exports_external.object({
|
|
11407
11427
|
id: exports_external.string().min(1).optional(),
|
|
11408
11428
|
name: exports_external.string().min(1),
|
|
@@ -11413,14 +11433,18 @@ var larkSourceRegistryEntrySchema = exports_external.object({
|
|
|
11413
11433
|
title: exports_external.string().min(1).optional(),
|
|
11414
11434
|
snapshot: sourceSnapshotSchema.optional()
|
|
11415
11435
|
}).strict();
|
|
11436
|
+
var larkSourceBatchSchema = exports_external.object({
|
|
11437
|
+
name: exports_external.string().min(1),
|
|
11438
|
+
modules: exports_external.array(larkSourceRegistryEntrySchema).min(1)
|
|
11439
|
+
}).strict();
|
|
11416
11440
|
var repoSourcesRegistrySchema = exports_external.object({
|
|
11417
11441
|
sources: exports_external.array(repoSourceRegistryEntrySchema).default([])
|
|
11418
11442
|
}).strict();
|
|
11419
11443
|
var fileSourcesRegistrySchema = exports_external.object({
|
|
11420
|
-
sources: exports_external.array(fileSourceRegistryEntrySchema).default([])
|
|
11444
|
+
sources: exports_external.array(exports_external.union([fileSourceRegistryEntrySchema, fileSourceBatchSchema])).default([])
|
|
11421
11445
|
}).strict();
|
|
11422
11446
|
var larkSourcesRegistrySchema = exports_external.object({
|
|
11423
|
-
sources: exports_external.array(larkSourceRegistryEntrySchema).default([])
|
|
11447
|
+
sources: exports_external.array(exports_external.union([larkSourceRegistryEntrySchema, larkSourceBatchSchema])).default([])
|
|
11424
11448
|
}).strict();
|
|
11425
11449
|
var formatRegistryIssues = (issues) => issues.map((issue) => {
|
|
11426
11450
|
const path = issue.path.length > 0 ? issue.path.join(".") : "<root>";
|
|
@@ -11432,6 +11456,20 @@ var assertSourceName = (sourceType, name, registryPath) => {
|
|
|
11432
11456
|
throw new TypeError(`${sourceType} source name must be a lowercase path-safe slug in ${registryPath}: ${name}`);
|
|
11433
11457
|
}
|
|
11434
11458
|
};
|
|
11459
|
+
var assertDateSourceNamespace = (sourceType, name, registryPath) => {
|
|
11460
|
+
if (!REPO_DATE_NAMESPACE_PATTERN.test(name)) {
|
|
11461
|
+
throw new TypeError(`${sourceType} source batch must be a valid YYYYMMDD date in ${registryPath}: ${name}`);
|
|
11462
|
+
}
|
|
11463
|
+
const year = Number(name.slice(0, 4));
|
|
11464
|
+
const month = Number(name.slice(4, 6));
|
|
11465
|
+
const day = Number(name.slice(6, 8));
|
|
11466
|
+
const date = new Date(0);
|
|
11467
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
11468
|
+
date.setUTCFullYear(year, month - 1, day);
|
|
11469
|
+
if (date.getUTCFullYear() !== year || date.getUTCMonth() !== month - 1 || date.getUTCDate() !== day) {
|
|
11470
|
+
throw new TypeError(`${sourceType} source batch must be a valid YYYYMMDD date in ${registryPath}: ${name}`);
|
|
11471
|
+
}
|
|
11472
|
+
};
|
|
11435
11473
|
var assertRegistryRelativePath = (sourceType, name, field, value, registryPath) => {
|
|
11436
11474
|
if (value.length === 0 || value.includes("\x00") || isAbsoluteRegistryPath(value)) {
|
|
11437
11475
|
throw new TypeError(`${sourceType} source "${name}" in ${registryPath} has invalid ${field}; use a committed relative path`);
|
|
@@ -11451,7 +11489,9 @@ var assertWorkspaceRelativePath = (sourceType, name, field, value, registryPath)
|
|
|
11451
11489
|
var assertDocumentSourcePath = (sourceType, name, field, value, registryPath, options = {}) => {
|
|
11452
11490
|
assertWorkspaceRelativePath(sourceType, name, field, value, registryPath);
|
|
11453
11491
|
const normalized = value.replaceAll("\\", "/");
|
|
11454
|
-
const
|
|
11492
|
+
const [namespace, module, ...rest] = name.split("/");
|
|
11493
|
+
const batchName = module !== undefined && rest.length === 0 && REPO_DATE_NAMESPACE_PATTERN.test(namespace ?? "") ? namespace : name;
|
|
11494
|
+
const base = `sources/${sourceType}/${batchName}`;
|
|
11455
11495
|
if (normalized === base && options.allowBase === true)
|
|
11456
11496
|
return;
|
|
11457
11497
|
if (!normalized.startsWith(`${base}/`)) {
|
|
@@ -11467,40 +11507,55 @@ var parseRepoSourcesRegistry = (input, registryPath, absolutePath) => {
|
|
|
11467
11507
|
throw new TypeError(`Invalid repo sources registry ${registryPath}: ${formatRegistryIssues(parsed.error.issues)}`);
|
|
11468
11508
|
}
|
|
11469
11509
|
const seenSourceKeys = new Set;
|
|
11470
|
-
const
|
|
11471
|
-
|
|
11472
|
-
|
|
11473
|
-
|
|
11474
|
-
|
|
11475
|
-
|
|
11476
|
-
|
|
11477
|
-
|
|
11478
|
-
|
|
11479
|
-
|
|
11480
|
-
|
|
11481
|
-
|
|
11482
|
-
|
|
11483
|
-
|
|
11484
|
-
|
|
11485
|
-
|
|
11486
|
-
|
|
11487
|
-
|
|
11488
|
-
|
|
11489
|
-
|
|
11490
|
-
|
|
11491
|
-
|
|
11492
|
-
|
|
11493
|
-
remote
|
|
11494
|
-
|
|
11495
|
-
|
|
11496
|
-
|
|
11497
|
-
|
|
11498
|
-
|
|
11499
|
-
|
|
11500
|
-
assertWorkspaceRelativePath("repo",
|
|
11501
|
-
normalized
|
|
11502
|
-
|
|
11503
|
-
|
|
11510
|
+
const moduleNamespaces = new Map;
|
|
11511
|
+
const repos = parsed.data.sources.flatMap((namespaceEntry) => {
|
|
11512
|
+
assertDateSourceNamespace("repo", namespaceEntry.name, registryPath);
|
|
11513
|
+
const namespace = namespaceEntry.name;
|
|
11514
|
+
return namespaceEntry.modules.map((entry) => {
|
|
11515
|
+
assertSourceName("repo", entry.name, registryPath);
|
|
11516
|
+
if (entry.id !== undefined)
|
|
11517
|
+
assertSourceName("repo", entry.id, registryPath);
|
|
11518
|
+
const existingNamespace = moduleNamespaces.get(entry.name);
|
|
11519
|
+
if (existingNamespace !== undefined && existingNamespace !== namespace) {
|
|
11520
|
+
throw new TypeError(`Duplicate repo module ${JSON.stringify(entry.name)} across date batches ${existingNamespace} and ${namespace} in ${registryPath}; repo module names are project-wide codegraph identities`);
|
|
11521
|
+
}
|
|
11522
|
+
moduleNamespaces.set(entry.name, namespace);
|
|
11523
|
+
const name = `${namespace}/${entry.name}`;
|
|
11524
|
+
const id = `${namespace}/${entry.id ?? entry.name}`;
|
|
11525
|
+
for (const key of new Set([name, id])) {
|
|
11526
|
+
if (seenSourceKeys.has(key)) {
|
|
11527
|
+
throw new TypeError(`Duplicate repo source identifier "${key}" in ${registryPath}`);
|
|
11528
|
+
}
|
|
11529
|
+
seenSourceKeys.add(key);
|
|
11530
|
+
}
|
|
11531
|
+
const remote = entry.git?.remote;
|
|
11532
|
+
const ref = entry.git?.ref;
|
|
11533
|
+
if (!remote) {
|
|
11534
|
+
throw new TypeError(`Repo source "${name}" in ${registryPath} is missing remote`);
|
|
11535
|
+
}
|
|
11536
|
+
if (!ref) {
|
|
11537
|
+
throw new TypeError(`Repo source "${name}" in ${registryPath} is missing ref`);
|
|
11538
|
+
}
|
|
11539
|
+
const materializedAt = entry.materializedAt ?? `sources/repo/${namespace}/${entry.name}`;
|
|
11540
|
+
assertWorkspaceRelativePath("repo", name, "materializedAt", materializedAt, registryPath);
|
|
11541
|
+
const normalized = {
|
|
11542
|
+
id,
|
|
11543
|
+
name,
|
|
11544
|
+
namespace,
|
|
11545
|
+
module: entry.name,
|
|
11546
|
+
materializedAt,
|
|
11547
|
+
remote,
|
|
11548
|
+
ref
|
|
11549
|
+
};
|
|
11550
|
+
if (entry.local) {
|
|
11551
|
+
normalized.local = entry.local;
|
|
11552
|
+
}
|
|
11553
|
+
if (entry.subpath) {
|
|
11554
|
+
assertWorkspaceRelativePath("repo", name, "subpath", entry.subpath, registryPath);
|
|
11555
|
+
normalized.subpath = entry.subpath;
|
|
11556
|
+
}
|
|
11557
|
+
return normalized;
|
|
11558
|
+
});
|
|
11504
11559
|
});
|
|
11505
11560
|
return {
|
|
11506
11561
|
kind: "sources.registry.repo",
|
|
@@ -11515,34 +11570,43 @@ var parseFileSourcesRegistry = (input, registryPath) => {
|
|
|
11515
11570
|
throw new TypeError(`Invalid file sources registry ${registryPath}: ${formatRegistryIssues(parsed.error.issues)}`);
|
|
11516
11571
|
}
|
|
11517
11572
|
const seenSourceKeys = new Set;
|
|
11518
|
-
return parsed.data.sources.
|
|
11519
|
-
|
|
11520
|
-
if (
|
|
11521
|
-
|
|
11522
|
-
|
|
11523
|
-
|
|
11524
|
-
|
|
11525
|
-
|
|
11526
|
-
|
|
11527
|
-
|
|
11528
|
-
|
|
11529
|
-
|
|
11530
|
-
|
|
11531
|
-
|
|
11532
|
-
|
|
11533
|
-
|
|
11534
|
-
|
|
11573
|
+
return parsed.data.sources.flatMap((sourceEntry) => {
|
|
11574
|
+
const namespace = "modules" in sourceEntry ? sourceEntry.name : undefined;
|
|
11575
|
+
if (namespace !== undefined)
|
|
11576
|
+
assertDateSourceNamespace("file", namespace, registryPath);
|
|
11577
|
+
const entries = "modules" in sourceEntry ? sourceEntry.modules : [sourceEntry];
|
|
11578
|
+
return entries.map((entry) => {
|
|
11579
|
+
assertSourceName("file", entry.name, registryPath);
|
|
11580
|
+
const name = namespace === undefined ? entry.name : `${namespace}/${entry.name}`;
|
|
11581
|
+
if (entry.local !== undefined) {
|
|
11582
|
+
assertRegistryRelativePath("file", name, "local", entry.local, registryPath);
|
|
11583
|
+
}
|
|
11584
|
+
const materializedAt = entry.materializedAt ?? `sources/file/${namespace ?? name}`;
|
|
11585
|
+
assertDocumentSourcePath("file", name, "materializedAt", materializedAt, registryPath, { allowBase: true });
|
|
11586
|
+
for (const [index, include] of (entry.include ?? []).entries()) {
|
|
11587
|
+
assertDocumentIncludePath("file", name, `include[${index}]`, include, registryPath);
|
|
11588
|
+
}
|
|
11589
|
+
const snapshot = entry.snapshot ?? (namespace !== undefined ? { manifest: `sources/file/${namespace}/manifest.json` } : undefined);
|
|
11590
|
+
if (snapshot !== undefined) {
|
|
11591
|
+
assertDocumentSourcePath("file", name, "snapshot.manifest", snapshot.manifest, registryPath);
|
|
11592
|
+
}
|
|
11593
|
+
const id = namespace === undefined ? entry.id ?? entry.name : `${namespace}/${entry.id ?? entry.name}`;
|
|
11594
|
+
for (const key of new Set([name, id])) {
|
|
11595
|
+
if (seenSourceKeys.has(key)) {
|
|
11596
|
+
throw new TypeError(`Duplicate file source identifier "${key}" in ${registryPath}`);
|
|
11597
|
+
}
|
|
11598
|
+
seenSourceKeys.add(key);
|
|
11535
11599
|
}
|
|
11536
|
-
|
|
11537
|
-
|
|
11538
|
-
|
|
11539
|
-
|
|
11540
|
-
|
|
11541
|
-
|
|
11542
|
-
|
|
11543
|
-
|
|
11544
|
-
|
|
11545
|
-
};
|
|
11600
|
+
return {
|
|
11601
|
+
id,
|
|
11602
|
+
name,
|
|
11603
|
+
...namespace !== undefined ? { namespace, module: entry.name } : {},
|
|
11604
|
+
materializedAt,
|
|
11605
|
+
...entry.local !== undefined ? { local: entry.local } : {},
|
|
11606
|
+
...entry.include !== undefined ? { include: entry.include } : {},
|
|
11607
|
+
...snapshot !== undefined ? { snapshot } : {}
|
|
11608
|
+
};
|
|
11609
|
+
});
|
|
11546
11610
|
});
|
|
11547
11611
|
};
|
|
11548
11612
|
var parseLarkSourcesRegistry = (input, registryPath) => {
|
|
@@ -11551,38 +11615,47 @@ var parseLarkSourcesRegistry = (input, registryPath) => {
|
|
|
11551
11615
|
throw new TypeError(`Invalid lark sources registry ${registryPath}: ${formatRegistryIssues(parsed.error.issues)}`);
|
|
11552
11616
|
}
|
|
11553
11617
|
const seenSourceKeys = new Set;
|
|
11554
|
-
return parsed.data.sources.
|
|
11555
|
-
|
|
11556
|
-
|
|
11557
|
-
|
|
11558
|
-
|
|
11559
|
-
|
|
11560
|
-
|
|
11561
|
-
|
|
11562
|
-
|
|
11563
|
-
|
|
11564
|
-
|
|
11565
|
-
|
|
11566
|
-
|
|
11567
|
-
|
|
11568
|
-
|
|
11569
|
-
|
|
11570
|
-
|
|
11571
|
-
|
|
11572
|
-
|
|
11573
|
-
|
|
11574
|
-
|
|
11575
|
-
|
|
11576
|
-
|
|
11577
|
-
id
|
|
11578
|
-
|
|
11579
|
-
|
|
11580
|
-
|
|
11581
|
-
|
|
11582
|
-
|
|
11583
|
-
|
|
11584
|
-
|
|
11585
|
-
|
|
11618
|
+
return parsed.data.sources.flatMap((sourceEntry) => {
|
|
11619
|
+
const namespace = "modules" in sourceEntry ? sourceEntry.name : undefined;
|
|
11620
|
+
if (namespace !== undefined)
|
|
11621
|
+
assertDateSourceNamespace("lark", namespace, registryPath);
|
|
11622
|
+
const entries = "modules" in sourceEntry ? sourceEntry.modules : [sourceEntry];
|
|
11623
|
+
return entries.map((entry) => {
|
|
11624
|
+
assertSourceName("lark", entry.name, registryPath);
|
|
11625
|
+
const name = namespace === undefined ? entry.name : `${namespace}/${entry.name}`;
|
|
11626
|
+
const identityCount = [
|
|
11627
|
+
entry.url !== undefined,
|
|
11628
|
+
entry.docToken !== undefined,
|
|
11629
|
+
entry.wikiToken !== undefined
|
|
11630
|
+
].filter(Boolean).length;
|
|
11631
|
+
if (identityCount !== 1) {
|
|
11632
|
+
throw new TypeError(`Lark source "${name}" in ${registryPath} must declare exactly one of url, docToken, or wikiToken`);
|
|
11633
|
+
}
|
|
11634
|
+
const materializedAt = entry.materializedAt ?? `sources/lark/${namespace ?? name}`;
|
|
11635
|
+
assertDocumentSourcePath("lark", name, "materializedAt", materializedAt, registryPath, { allowBase: true });
|
|
11636
|
+
const snapshot = entry.snapshot ?? (namespace !== undefined ? { manifest: `sources/lark/${namespace}/manifest.json` } : undefined);
|
|
11637
|
+
if (snapshot !== undefined) {
|
|
11638
|
+
assertDocumentSourcePath("lark", name, "snapshot.manifest", snapshot.manifest, registryPath);
|
|
11639
|
+
}
|
|
11640
|
+
const id = namespace === undefined ? entry.id ?? entry.name : `${namespace}/${entry.id ?? entry.name}`;
|
|
11641
|
+
for (const key of new Set([name, id])) {
|
|
11642
|
+
if (seenSourceKeys.has(key)) {
|
|
11643
|
+
throw new TypeError(`Duplicate lark source identifier "${key}" in ${registryPath}`);
|
|
11644
|
+
}
|
|
11645
|
+
seenSourceKeys.add(key);
|
|
11646
|
+
}
|
|
11647
|
+
return {
|
|
11648
|
+
id,
|
|
11649
|
+
name,
|
|
11650
|
+
...namespace !== undefined ? { namespace, module: entry.name } : {},
|
|
11651
|
+
materializedAt,
|
|
11652
|
+
...entry.url !== undefined ? { url: entry.url } : {},
|
|
11653
|
+
...entry.docToken !== undefined ? { docToken: entry.docToken } : {},
|
|
11654
|
+
...entry.wikiToken !== undefined ? { wikiToken: entry.wikiToken } : {},
|
|
11655
|
+
...entry.title !== undefined ? { title: entry.title } : {},
|
|
11656
|
+
...snapshot !== undefined ? { snapshot } : {}
|
|
11657
|
+
};
|
|
11658
|
+
});
|
|
11586
11659
|
});
|
|
11587
11660
|
};
|
|
11588
11661
|
var readYamlIfPresent = async (absolutePath, emptyValue) => {
|
|
@@ -11659,6 +11732,8 @@ var resolveSourceReference = (reference, registry) => {
|
|
|
11659
11732
|
kind: "source.repo",
|
|
11660
11733
|
id: entry.id,
|
|
11661
11734
|
name: entry.name,
|
|
11735
|
+
namespace: entry.namespace,
|
|
11736
|
+
module: entry.module,
|
|
11662
11737
|
materializedAt: entry.materializedAt,
|
|
11663
11738
|
git: {
|
|
11664
11739
|
remote: entry.remote,
|
|
@@ -11683,10 +11758,23 @@ var allSources = (type) => {
|
|
|
11683
11758
|
};
|
|
11684
11759
|
|
|
11685
11760
|
// src/index.ts
|
|
11686
|
-
|
|
11687
|
-
|
|
11688
|
-
|
|
11689
|
-
|
|
11761
|
+
function assertUniquePhaseIds(phases) {
|
|
11762
|
+
const firstById = new Map;
|
|
11763
|
+
for (const [index, phase] of phases.entries()) {
|
|
11764
|
+
const first = firstById.get(phase.id);
|
|
11765
|
+
if (first !== undefined) {
|
|
11766
|
+
throw new TypeError(`Duplicate Context phase id ${JSON.stringify(phase.id)}: phases[${first.index}] (${first.kind}) conflicts with phases[${index}] (${phase.kind}). Every phase id must be unique.`);
|
|
11767
|
+
}
|
|
11768
|
+
firstById.set(phase.id, { index, kind: phase.kind });
|
|
11769
|
+
}
|
|
11770
|
+
}
|
|
11771
|
+
var defineProject = (project) => {
|
|
11772
|
+
assertUniquePhaseIds(project.phases);
|
|
11773
|
+
return {
|
|
11774
|
+
kind: "context.project",
|
|
11775
|
+
project
|
|
11776
|
+
};
|
|
11777
|
+
};
|
|
11690
11778
|
var normalizeTemplate = (template, builtInVars) => {
|
|
11691
11779
|
const assertTemplatePath = (templatePath) => {
|
|
11692
11780
|
if (!isSafeProjectRelativePath(templatePath)) {
|
package/package.json
CHANGED
package/sources.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export type RepoSourceDefinition = {
|
|
|
7
7
|
kind: "source.repo";
|
|
8
8
|
id: string;
|
|
9
9
|
name: string;
|
|
10
|
+
namespace: string;
|
|
11
|
+
module: string;
|
|
10
12
|
local?: string;
|
|
11
13
|
subpath?: string;
|
|
12
14
|
materializedAt: string;
|
|
@@ -19,6 +21,8 @@ export type FileSourceDefinition = {
|
|
|
19
21
|
kind: "source.file";
|
|
20
22
|
id: string;
|
|
21
23
|
name: string;
|
|
24
|
+
namespace?: string;
|
|
25
|
+
module?: string;
|
|
22
26
|
local?: string;
|
|
23
27
|
materializedAt: string;
|
|
24
28
|
include?: readonly string[];
|
|
@@ -30,6 +34,8 @@ export type LarkSourceDefinition = {
|
|
|
30
34
|
kind: "source.lark";
|
|
31
35
|
id: string;
|
|
32
36
|
name: string;
|
|
37
|
+
namespace?: string;
|
|
38
|
+
module?: string;
|
|
33
39
|
materializedAt: string;
|
|
34
40
|
url?: string;
|
|
35
41
|
docToken?: string;
|
|
@@ -62,6 +68,8 @@ export type SourceCollectionReference<TType extends SourceType = SourceType> = {
|
|
|
62
68
|
export type RepoSourceRegistryEntry = {
|
|
63
69
|
id: string;
|
|
64
70
|
name: string;
|
|
71
|
+
namespace: string;
|
|
72
|
+
module: string;
|
|
65
73
|
local?: string;
|
|
66
74
|
subpath?: string;
|
|
67
75
|
materializedAt: string;
|
|
@@ -71,6 +79,8 @@ export type RepoSourceRegistryEntry = {
|
|
|
71
79
|
export type FileSourceRegistryEntry = {
|
|
72
80
|
id: string;
|
|
73
81
|
name: string;
|
|
82
|
+
namespace?: string;
|
|
83
|
+
module?: string;
|
|
74
84
|
local?: string;
|
|
75
85
|
materializedAt: string;
|
|
76
86
|
include?: readonly string[];
|
|
@@ -81,6 +91,8 @@ export type FileSourceRegistryEntry = {
|
|
|
81
91
|
export type LarkSourceRegistryEntry = {
|
|
82
92
|
id: string;
|
|
83
93
|
name: string;
|
|
94
|
+
namespace?: string;
|
|
95
|
+
module?: string;
|
|
84
96
|
materializedAt: string;
|
|
85
97
|
url?: string;
|
|
86
98
|
docToken?: string;
|
|
@@ -124,6 +136,16 @@ export type DocumentSourceDefinition = FileSourceDefinition | LarkSourceDefiniti
|
|
|
124
136
|
export type RepoProjectSourceDefinition = RepoSourceDefinition | RepoSourceReference | SourceCollectionReference<"repo">;
|
|
125
137
|
export type ProjectSourceDefinition = SourceDefinition | SourceCollectionReference;
|
|
126
138
|
export declare function source(name: string): RegistrySourceReference;
|
|
139
|
+
export declare function source(namespace: string, module: string): RepoSourceReference;
|
|
140
|
+
export declare function source(namespace: string, module: string, options: {
|
|
141
|
+
type: "repo";
|
|
142
|
+
}): RepoSourceReference;
|
|
143
|
+
export declare function source(namespace: string, module: string, options: {
|
|
144
|
+
type: "file";
|
|
145
|
+
}): FileSourceReference;
|
|
146
|
+
export declare function source(namespace: string, module: string, options: {
|
|
147
|
+
type: "lark";
|
|
148
|
+
}): LarkSourceReference;
|
|
127
149
|
export declare function source(name: string, options: {
|
|
128
150
|
type: "repo";
|
|
129
151
|
}): RepoSourceReference;
|