@c4a/core 0.4.12-alpha.3 → 0.4.12-beta.7
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/index.js +308 -32
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -7000,6 +7000,7 @@ var RelationType;
|
|
|
7000
7000
|
RelationType2["Triggers"] = "TRIGGERS";
|
|
7001
7001
|
RelationType2["References"] = "REFERENCES";
|
|
7002
7002
|
RelationType2["Corresponds"] = "CORRESPONDS";
|
|
7003
|
+
RelationType2["Mentions"] = "MENTIONS";
|
|
7003
7004
|
})(RelationType ||= {});
|
|
7004
7005
|
var AtomField;
|
|
7005
7006
|
((AtomField2) => {
|
|
@@ -7017,6 +7018,7 @@ var AtomField;
|
|
|
7017
7018
|
AtomField2["Constraints"] = "constraints";
|
|
7018
7019
|
AtomField2["Comparisons"] = "comparisons";
|
|
7019
7020
|
AtomField2["Boundaries"] = "boundaries";
|
|
7021
|
+
AtomField2["Claims"] = "claims";
|
|
7020
7022
|
})(AtomField ||= {});
|
|
7021
7023
|
var Kind;
|
|
7022
7024
|
((Kind2) => {
|
|
@@ -7029,12 +7031,124 @@ var Perspective;
|
|
|
7029
7031
|
Perspective2["Business"] = "business";
|
|
7030
7032
|
Perspective2["Technical"] = "technical";
|
|
7031
7033
|
})(Perspective ||= {});
|
|
7034
|
+
// src/types/edgeSyncRules.ts
|
|
7035
|
+
var EDGE_SYNC_RULES = [
|
|
7036
|
+
{
|
|
7037
|
+
field: "container_id",
|
|
7038
|
+
sourceEntityType: "component" /* Component */,
|
|
7039
|
+
edgeType: "CONTAINS" /* Contains */,
|
|
7040
|
+
direction: "reverse",
|
|
7041
|
+
writeGraph: true
|
|
7042
|
+
},
|
|
7043
|
+
{
|
|
7044
|
+
field: "system_id",
|
|
7045
|
+
sourceEntityType: "container" /* Container */,
|
|
7046
|
+
edgeType: "CONTAINS" /* Contains */,
|
|
7047
|
+
direction: "reverse",
|
|
7048
|
+
writeGraph: true
|
|
7049
|
+
},
|
|
7050
|
+
{
|
|
7051
|
+
field: "ref_sor",
|
|
7052
|
+
sourceEntityType: "sor" /* SoR */,
|
|
7053
|
+
edgeType: "REFERENCES" /* References */,
|
|
7054
|
+
direction: "forward",
|
|
7055
|
+
writeGraph: true
|
|
7056
|
+
},
|
|
7057
|
+
{
|
|
7058
|
+
field: "product_refs",
|
|
7059
|
+
sourceEntityType: "epic" /* Epic */,
|
|
7060
|
+
edgeType: "REFERENCES" /* References */,
|
|
7061
|
+
direction: "forward",
|
|
7062
|
+
writeGraph: true
|
|
7063
|
+
},
|
|
7064
|
+
{
|
|
7065
|
+
field: "atoms.entities.ref",
|
|
7066
|
+
sourceEntityType: "any",
|
|
7067
|
+
edgeType: "MENTIONS" /* Mentions */,
|
|
7068
|
+
direction: "forward",
|
|
7069
|
+
writeGraph: true
|
|
7070
|
+
},
|
|
7071
|
+
{
|
|
7072
|
+
field: "atoms.behaviors.ref",
|
|
7073
|
+
sourceEntityType: "any",
|
|
7074
|
+
edgeType: "MENTIONS" /* Mentions */,
|
|
7075
|
+
direction: "forward",
|
|
7076
|
+
writeGraph: true
|
|
7077
|
+
},
|
|
7078
|
+
{
|
|
7079
|
+
field: "product_id",
|
|
7080
|
+
sourceEntityType: "sor" /* SoR */,
|
|
7081
|
+
edgeType: null,
|
|
7082
|
+
direction: "forward",
|
|
7083
|
+
writeGraph: false
|
|
7084
|
+
},
|
|
7085
|
+
{
|
|
7086
|
+
field: "process_id",
|
|
7087
|
+
sourceEntityType: "sor" /* SoR */,
|
|
7088
|
+
edgeType: "PRODUCES" /* Produces */,
|
|
7089
|
+
direction: "reverse",
|
|
7090
|
+
writeGraph: true
|
|
7091
|
+
}
|
|
7092
|
+
];
|
|
7093
|
+
// src/types/refPointer.ts
|
|
7094
|
+
var REF_POINTER_PATTERN = /^ref:(entity|relation|content):(.+)$/;
|
|
7095
|
+
function parseRef(pointer) {
|
|
7096
|
+
const match = REF_POINTER_PATTERN.exec(pointer);
|
|
7097
|
+
if (!match) {
|
|
7098
|
+
return null;
|
|
7099
|
+
}
|
|
7100
|
+
const [, type, id] = match;
|
|
7101
|
+
if (!id) {
|
|
7102
|
+
return null;
|
|
7103
|
+
}
|
|
7104
|
+
return { type, id };
|
|
7105
|
+
}
|
|
7106
|
+
function buildRef(type, id) {
|
|
7107
|
+
return `ref:${type}:${id}`;
|
|
7108
|
+
}
|
|
7109
|
+
function isRefPointer(value) {
|
|
7110
|
+
return typeof value === "string" && parseRef(value) !== null;
|
|
7111
|
+
}
|
|
7112
|
+
function extractAllRefs(data) {
|
|
7113
|
+
const results = [];
|
|
7114
|
+
const visit = (value, path) => {
|
|
7115
|
+
if (typeof value === "string") {
|
|
7116
|
+
if (isRefPointer(value)) {
|
|
7117
|
+
results.push({ pointer: value, fieldPath: path });
|
|
7118
|
+
}
|
|
7119
|
+
return;
|
|
7120
|
+
}
|
|
7121
|
+
if (Array.isArray(value)) {
|
|
7122
|
+
value.forEach((item, index) => {
|
|
7123
|
+
const nextPath = path ? `${path}[${index}]` : `[${index}]`;
|
|
7124
|
+
visit(item, nextPath);
|
|
7125
|
+
});
|
|
7126
|
+
return;
|
|
7127
|
+
}
|
|
7128
|
+
if (value && typeof value === "object") {
|
|
7129
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
7130
|
+
const nextPath = path ? `${path}.${key}` : key;
|
|
7131
|
+
visit(entry, nextPath);
|
|
7132
|
+
}
|
|
7133
|
+
}
|
|
7134
|
+
};
|
|
7135
|
+
visit(data, "");
|
|
7136
|
+
return results;
|
|
7137
|
+
}
|
|
7032
7138
|
// src/types/serverConfig.ts
|
|
7033
7139
|
var DEFAULT_SERVER_CONFIG = {
|
|
7034
7140
|
server: {
|
|
7035
7141
|
port: 5100,
|
|
7036
7142
|
host: "::"
|
|
7037
7143
|
},
|
|
7144
|
+
git_hosts: [],
|
|
7145
|
+
daemon_scheduler: {
|
|
7146
|
+
enabled: true,
|
|
7147
|
+
host: "localhost",
|
|
7148
|
+
port: 5110,
|
|
7149
|
+
workspace: "./data/daemon-workspace",
|
|
7150
|
+
max_daemons: 20
|
|
7151
|
+
},
|
|
7038
7152
|
doc_db: {
|
|
7039
7153
|
provider: "sqlite",
|
|
7040
7154
|
sqlite: {
|
|
@@ -7057,6 +7171,9 @@ var DEFAULT_SERVER_CONFIG = {
|
|
|
7057
7171
|
username: "root",
|
|
7058
7172
|
password: "nebula",
|
|
7059
7173
|
space: "c4a"
|
|
7174
|
+
},
|
|
7175
|
+
duckdb: {
|
|
7176
|
+
path: "./data/c4a-graph.duckdb"
|
|
7060
7177
|
}
|
|
7061
7178
|
},
|
|
7062
7179
|
vector_db: {
|
|
@@ -11158,7 +11275,7 @@ var atomFieldSchema = exports_external.enum(Object.values(AtomField));
|
|
|
11158
11275
|
var kindSchema = exports_external.enum(Object.values(Kind));
|
|
11159
11276
|
var scopeSchema = exports_external.literal("project");
|
|
11160
11277
|
var perspectiveSchema = exports_external.enum(Object.values(Perspective));
|
|
11161
|
-
var
|
|
11278
|
+
var extractionConfidenceSchema = exports_external.object({
|
|
11162
11279
|
structural: exports_external.number().min(0).max(1),
|
|
11163
11280
|
semantic: exports_external.number().min(0).max(1)
|
|
11164
11281
|
});
|
|
@@ -11166,13 +11283,29 @@ var metadataSchema = exports_external.object({
|
|
|
11166
11283
|
created_at: exports_external.string().datetime(),
|
|
11167
11284
|
updated_at: exports_external.string().datetime(),
|
|
11168
11285
|
version_tag: exports_external.string().optional(),
|
|
11169
|
-
|
|
11286
|
+
extraction_confidence: extractionConfidenceSchema.optional(),
|
|
11287
|
+
confidence: exports_external.number().min(0).max(1).optional(),
|
|
11288
|
+
aliases: exports_external.array(exports_external.string()).optional(),
|
|
11289
|
+
rank: exports_external.number().optional(),
|
|
11290
|
+
community_id: exports_external.string().optional(),
|
|
11291
|
+
community_level: exports_external.number().optional()
|
|
11292
|
+
});
|
|
11293
|
+
var entityRefPointerSchema = exports_external.string().regex(/^ref:entity:.+$/, "must be a ref pointer in format ref:entity:<id>");
|
|
11294
|
+
var sourceRefSpanSchema = exports_external.object({
|
|
11295
|
+
start: exports_external.number().int().min(1),
|
|
11296
|
+
end: exports_external.number().int().min(1)
|
|
11297
|
+
});
|
|
11298
|
+
var sourceRefSchema = exports_external.object({
|
|
11299
|
+
ref: exports_external.string(),
|
|
11300
|
+
span: sourceRefSpanSchema.optional()
|
|
11170
11301
|
});
|
|
11302
|
+
var sourceRefsSchema = exports_external.array(sourceRefSchema).optional();
|
|
11171
11303
|
// src/schemas/atomsSchema.ts
|
|
11172
11304
|
var confidenceAtomSchema = exports_external.number().min(0).max(1).optional();
|
|
11173
11305
|
var entityAtomSchema = exports_external.object({
|
|
11174
11306
|
name: exports_external.string(),
|
|
11175
11307
|
kind: kindSchema.optional(),
|
|
11308
|
+
ref: exports_external.string().optional(),
|
|
11176
11309
|
confidence: confidenceAtomSchema
|
|
11177
11310
|
});
|
|
11178
11311
|
var relationAtomSchema = exports_external.object({
|
|
@@ -11186,6 +11319,8 @@ var behaviorAtomSchema = exports_external.object({
|
|
|
11186
11319
|
name: exports_external.string(),
|
|
11187
11320
|
signature: exports_external.string().optional(),
|
|
11188
11321
|
description: exports_external.string().optional(),
|
|
11322
|
+
performed_by: exports_external.array(exports_external.string()).optional(),
|
|
11323
|
+
ref: exports_external.string().optional(),
|
|
11189
11324
|
confidence: confidenceAtomSchema
|
|
11190
11325
|
});
|
|
11191
11326
|
var attributeAtomSchema = exports_external.object({
|
|
@@ -11226,6 +11361,7 @@ var decisionPhaseSchema = exports_external.object({
|
|
|
11226
11361
|
rationale: exports_external.string().optional()
|
|
11227
11362
|
});
|
|
11228
11363
|
var decisionAtomSchema = exports_external.object({
|
|
11364
|
+
name: exports_external.string().optional(),
|
|
11229
11365
|
description: exports_external.string(),
|
|
11230
11366
|
rationale: exports_external.string(),
|
|
11231
11367
|
alternatives: exports_external.array(exports_external.string()).optional(),
|
|
@@ -11248,9 +11384,9 @@ var metricAtomSchema = exports_external.object({
|
|
|
11248
11384
|
});
|
|
11249
11385
|
var roleAtomSchema = exports_external.object({
|
|
11250
11386
|
name: exports_external.string(),
|
|
11251
|
-
kind: exports_external.enum(["
|
|
11387
|
+
kind: exports_external.enum(["human", "team", "persona"]),
|
|
11252
11388
|
performs: exports_external.array(exports_external.string()).optional(),
|
|
11253
|
-
|
|
11389
|
+
description: exports_external.string().optional()
|
|
11254
11390
|
});
|
|
11255
11391
|
var constraintAtomSchema = exports_external.object({
|
|
11256
11392
|
description: exports_external.string(),
|
|
@@ -11281,6 +11417,16 @@ var comparisonAtomSchema = exports_external.object({
|
|
|
11281
11417
|
decision_ref: exports_external.string().optional(),
|
|
11282
11418
|
confidence: confidenceAtomSchema
|
|
11283
11419
|
});
|
|
11420
|
+
var claimAtomSchema = exports_external.object({
|
|
11421
|
+
claim_type: exports_external.string(),
|
|
11422
|
+
description: exports_external.string(),
|
|
11423
|
+
status: exports_external.enum(["active", "deprecated", "proposed"]),
|
|
11424
|
+
valid_from: exports_external.string(),
|
|
11425
|
+
valid_until: exports_external.string().optional(),
|
|
11426
|
+
session_ref: exports_external.string().optional(),
|
|
11427
|
+
changed_by: exports_external.string(),
|
|
11428
|
+
confidence: confidenceAtomSchema
|
|
11429
|
+
});
|
|
11284
11430
|
var dataAtomsSchema = exports_external.object({
|
|
11285
11431
|
entities: exports_external.array(entityAtomSchema).optional(),
|
|
11286
11432
|
relations: exports_external.array(relationAtomSchema).optional(),
|
|
@@ -11295,31 +11441,115 @@ var dataAtomsSchema = exports_external.object({
|
|
|
11295
11441
|
roles: exports_external.array(roleAtomSchema).optional(),
|
|
11296
11442
|
constraints: exports_external.array(constraintAtomSchema).optional(),
|
|
11297
11443
|
comparisons: exports_external.array(comparisonAtomSchema).optional(),
|
|
11298
|
-
boundaries: exports_external.array(boundaryAtomSchema).optional()
|
|
11444
|
+
boundaries: exports_external.array(boundaryAtomSchema).optional(),
|
|
11445
|
+
claims: exports_external.array(claimAtomSchema).optional()
|
|
11299
11446
|
}).superRefine((atoms2, ctx) => {
|
|
11300
|
-
if (!atoms2.transitions || atoms2.transitions.length === 0) {
|
|
11301
|
-
return;
|
|
11302
|
-
}
|
|
11303
11447
|
const stateValues = new Set;
|
|
11448
|
+
const stateNames = new Set;
|
|
11304
11449
|
for (const state of atoms2.states ?? []) {
|
|
11450
|
+
stateNames.add(state.name);
|
|
11305
11451
|
for (const value of state.values) {
|
|
11306
11452
|
stateValues.add(value);
|
|
11307
11453
|
}
|
|
11308
11454
|
}
|
|
11309
|
-
|
|
11310
|
-
|
|
11311
|
-
|
|
11312
|
-
|
|
11313
|
-
|
|
11314
|
-
|
|
11315
|
-
|
|
11455
|
+
const behaviorNames = new Set;
|
|
11456
|
+
for (const behavior of atoms2.behaviors ?? []) {
|
|
11457
|
+
behaviorNames.add(behavior.name);
|
|
11458
|
+
}
|
|
11459
|
+
const roleNames = new Set;
|
|
11460
|
+
for (const role of atoms2.roles ?? []) {
|
|
11461
|
+
roleNames.add(role.name);
|
|
11462
|
+
}
|
|
11463
|
+
const eventNames = new Set;
|
|
11464
|
+
for (const event of atoms2.events ?? []) {
|
|
11465
|
+
eventNames.add(event.name);
|
|
11466
|
+
}
|
|
11467
|
+
const metricNames = new Set;
|
|
11468
|
+
for (const metric of atoms2.metrics ?? []) {
|
|
11469
|
+
metricNames.add(metric.name);
|
|
11470
|
+
}
|
|
11471
|
+
if (atoms2.transitions && atoms2.transitions.length > 0) {
|
|
11472
|
+
for (const transition of atoms2.transitions) {
|
|
11473
|
+
if (!stateValues.has(transition.from)) {
|
|
11474
|
+
ctx.addIssue({
|
|
11475
|
+
code: exports_external.ZodIssueCode.custom,
|
|
11476
|
+
path: ["transitions"],
|
|
11477
|
+
message: `transition.from references unknown state: ${transition.from}`
|
|
11478
|
+
});
|
|
11479
|
+
}
|
|
11480
|
+
if (!stateValues.has(transition.to)) {
|
|
11481
|
+
ctx.addIssue({
|
|
11482
|
+
code: exports_external.ZodIssueCode.custom,
|
|
11483
|
+
path: ["transitions"],
|
|
11484
|
+
message: `transition.to references unknown state: ${transition.to}`
|
|
11485
|
+
});
|
|
11486
|
+
}
|
|
11487
|
+
const hasEvents = eventNames.size > 0;
|
|
11488
|
+
const hasBehaviors = behaviorNames.size > 0;
|
|
11489
|
+
if (hasEvents || hasBehaviors) {
|
|
11490
|
+
const triggerMatchesEvent = hasEvents && eventNames.has(transition.trigger);
|
|
11491
|
+
const triggerMatchesBehavior = hasBehaviors && behaviorNames.has(transition.trigger);
|
|
11492
|
+
if (!triggerMatchesEvent && !triggerMatchesBehavior) {
|
|
11493
|
+
ctx.addIssue({
|
|
11494
|
+
code: exports_external.ZodIssueCode.custom,
|
|
11495
|
+
path: ["transitions"],
|
|
11496
|
+
message: `transition.trigger references unknown event/behavior: ${transition.trigger}`
|
|
11497
|
+
});
|
|
11498
|
+
}
|
|
11499
|
+
}
|
|
11316
11500
|
}
|
|
11317
|
-
|
|
11318
|
-
|
|
11319
|
-
|
|
11320
|
-
|
|
11321
|
-
|
|
11322
|
-
|
|
11501
|
+
}
|
|
11502
|
+
if (atoms2.roles && atoms2.roles.length > 0) {
|
|
11503
|
+
for (const [index, role] of atoms2.roles.entries()) {
|
|
11504
|
+
for (const perform of role.performs ?? []) {
|
|
11505
|
+
if (!behaviorNames.has(perform)) {
|
|
11506
|
+
ctx.addIssue({
|
|
11507
|
+
code: exports_external.ZodIssueCode.custom,
|
|
11508
|
+
path: ["roles", index, "performs"],
|
|
11509
|
+
message: `role.performs references unknown behavior: ${perform}`
|
|
11510
|
+
});
|
|
11511
|
+
}
|
|
11512
|
+
}
|
|
11513
|
+
}
|
|
11514
|
+
}
|
|
11515
|
+
if (atoms2.behaviors && atoms2.behaviors.length > 0) {
|
|
11516
|
+
for (const [index, behavior] of atoms2.behaviors.entries()) {
|
|
11517
|
+
for (const performer of behavior.performed_by ?? []) {
|
|
11518
|
+
if (!roleNames.has(performer)) {
|
|
11519
|
+
ctx.addIssue({
|
|
11520
|
+
code: exports_external.ZodIssueCode.custom,
|
|
11521
|
+
path: ["behaviors", index, "performed_by"],
|
|
11522
|
+
message: `behavior.performed_by references unknown role: ${performer}`
|
|
11523
|
+
});
|
|
11524
|
+
}
|
|
11525
|
+
}
|
|
11526
|
+
}
|
|
11527
|
+
}
|
|
11528
|
+
if (atoms2.rules && atoms2.rules.length > 0) {
|
|
11529
|
+
const allowedDependsOn = new Set([...stateNames, ...metricNames]);
|
|
11530
|
+
for (const [index, rule] of atoms2.rules.entries()) {
|
|
11531
|
+
for (const dependency of rule.depends_on ?? []) {
|
|
11532
|
+
if (!allowedDependsOn.has(dependency)) {
|
|
11533
|
+
ctx.addIssue({
|
|
11534
|
+
code: exports_external.ZodIssueCode.custom,
|
|
11535
|
+
path: ["rules", index, "depends_on"],
|
|
11536
|
+
message: `rule.depends_on references unknown state/metric: ${dependency}`
|
|
11537
|
+
});
|
|
11538
|
+
}
|
|
11539
|
+
}
|
|
11540
|
+
}
|
|
11541
|
+
}
|
|
11542
|
+
if (atoms2.events && atoms2.events.length > 0) {
|
|
11543
|
+
for (const [index, event] of atoms2.events.entries()) {
|
|
11544
|
+
for (const behaviorName of event.trigger_for ?? []) {
|
|
11545
|
+
if (!behaviorNames.has(behaviorName)) {
|
|
11546
|
+
ctx.addIssue({
|
|
11547
|
+
code: exports_external.ZodIssueCode.custom,
|
|
11548
|
+
path: ["events", index, "trigger_for"],
|
|
11549
|
+
message: `event.trigger_for references unknown behavior: ${behaviorName}`
|
|
11550
|
+
});
|
|
11551
|
+
}
|
|
11552
|
+
}
|
|
11323
11553
|
}
|
|
11324
11554
|
}
|
|
11325
11555
|
});
|
|
@@ -11335,7 +11565,8 @@ var atomsWhitelistByEntityType = {
|
|
|
11335
11565
|
"states" /* States */,
|
|
11336
11566
|
"rules" /* Rules */,
|
|
11337
11567
|
"transitions" /* Transitions */,
|
|
11338
|
-
"events" /* Events
|
|
11568
|
+
"events" /* Events */,
|
|
11569
|
+
"claims" /* Claims */
|
|
11339
11570
|
]),
|
|
11340
11571
|
["process" /* Process */]: new Set,
|
|
11341
11572
|
["sor" /* SoR */]: new Set([
|
|
@@ -11351,7 +11582,8 @@ var atomsWhitelistByEntityType = {
|
|
|
11351
11582
|
"metrics" /* Metrics */,
|
|
11352
11583
|
"roles" /* Roles */,
|
|
11353
11584
|
"constraints" /* Constraints */,
|
|
11354
|
-
"comparisons" /* Comparisons
|
|
11585
|
+
"comparisons" /* Comparisons */,
|
|
11586
|
+
"claims" /* Claims */
|
|
11355
11587
|
]),
|
|
11356
11588
|
["contract" /* Contract */]: new Set,
|
|
11357
11589
|
["epic" /* Epic */]: new Set([
|
|
@@ -11359,7 +11591,8 @@ var atomsWhitelistByEntityType = {
|
|
|
11359
11591
|
"metrics" /* Metrics */,
|
|
11360
11592
|
"roles" /* Roles */,
|
|
11361
11593
|
"constraints" /* Constraints */,
|
|
11362
|
-
"comparisons" /* Comparisons
|
|
11594
|
+
"comparisons" /* Comparisons */,
|
|
11595
|
+
"claims" /* Claims */
|
|
11363
11596
|
]),
|
|
11364
11597
|
["document" /* Document */]: new Set
|
|
11365
11598
|
};
|
|
@@ -11385,7 +11618,8 @@ var baseEntitySchema = exports_external.object({
|
|
|
11385
11618
|
kind: kindSchema,
|
|
11386
11619
|
scope: scopeSchema,
|
|
11387
11620
|
perspective: perspectiveSchema,
|
|
11388
|
-
metadata: metadataSchema
|
|
11621
|
+
metadata: metadataSchema,
|
|
11622
|
+
source_refs: sourceRefsSchema
|
|
11389
11623
|
});
|
|
11390
11624
|
var productDataSchema = exports_external.object({
|
|
11391
11625
|
description: exports_external.string().optional(),
|
|
@@ -11399,7 +11633,8 @@ var productEntitySchema = baseEntitySchema.extend({
|
|
|
11399
11633
|
});
|
|
11400
11634
|
var systemDataSchema = exports_external.object({
|
|
11401
11635
|
description: exports_external.string().optional(),
|
|
11402
|
-
corresponds_to: exports_external.string().optional()
|
|
11636
|
+
corresponds_to: exports_external.string().optional(),
|
|
11637
|
+
atoms: exports_external.undefined().optional()
|
|
11403
11638
|
});
|
|
11404
11639
|
var systemEntitySchema = baseEntitySchema.extend({
|
|
11405
11640
|
type: exports_external.literal("system" /* System */),
|
|
@@ -11445,9 +11680,10 @@ var sorEntitySchema = baseEntitySchema.extend({
|
|
|
11445
11680
|
data: sorDataSchema
|
|
11446
11681
|
});
|
|
11447
11682
|
var contractDataSchema = exports_external.object({
|
|
11448
|
-
format: exports_external.enum(["openapi", "asyncapi", "proto"]),
|
|
11683
|
+
format: exports_external.enum(["openapi", "asyncapi", "proto", "graphql", "custom"]),
|
|
11449
11684
|
spec: exports_external.string(),
|
|
11450
|
-
|
|
11685
|
+
version: exports_external.string().optional(),
|
|
11686
|
+
description: exports_external.string().optional()
|
|
11451
11687
|
});
|
|
11452
11688
|
var contractEntitySchema = baseEntitySchema.extend({
|
|
11453
11689
|
type: exports_external.literal("contract" /* Contract */),
|
|
@@ -11455,7 +11691,7 @@ var contractEntitySchema = baseEntitySchema.extend({
|
|
|
11455
11691
|
});
|
|
11456
11692
|
var epicDataSchema = exports_external.object({
|
|
11457
11693
|
description: exports_external.string().optional(),
|
|
11458
|
-
product_refs: exports_external.array(
|
|
11694
|
+
product_refs: exports_external.array(entityRefPointerSchema).optional(),
|
|
11459
11695
|
atoms: dataAtomsSchema.optional()
|
|
11460
11696
|
});
|
|
11461
11697
|
var epicEntitySchema = baseEntitySchema.extend({
|
|
@@ -11531,18 +11767,45 @@ var entitySchema = exports_external.discriminatedUnion("type", [
|
|
|
11531
11767
|
});
|
|
11532
11768
|
}
|
|
11533
11769
|
}
|
|
11770
|
+
if (entity2.type === "sor" /* SoR */ && entity2.data.atoms) {
|
|
11771
|
+
const { constraints, rules } = entity2.data.atoms;
|
|
11772
|
+
const hasConstraints = Array.isArray(constraints) && constraints.length > 0;
|
|
11773
|
+
const hasRules = Array.isArray(rules) && rules.length > 0;
|
|
11774
|
+
if (!hasConstraints && !hasRules) {
|
|
11775
|
+
ctx.addIssue({
|
|
11776
|
+
code: exports_external.ZodIssueCode.custom,
|
|
11777
|
+
path: ["data", "atoms"],
|
|
11778
|
+
message: "SoR must have at least one constraint or rule"
|
|
11779
|
+
});
|
|
11780
|
+
}
|
|
11781
|
+
}
|
|
11782
|
+
if (entity2.type === "epic" /* Epic */ && entity2.data.atoms) {
|
|
11783
|
+
const { decisions } = entity2.data.atoms;
|
|
11784
|
+
const hasDecisions = Array.isArray(decisions) && decisions.length > 0;
|
|
11785
|
+
if (!hasDecisions) {
|
|
11786
|
+
ctx.addIssue({
|
|
11787
|
+
code: exports_external.ZodIssueCode.custom,
|
|
11788
|
+
path: ["data", "atoms"],
|
|
11789
|
+
message: "Epic must have at least one decision"
|
|
11790
|
+
});
|
|
11791
|
+
}
|
|
11792
|
+
}
|
|
11534
11793
|
});
|
|
11535
11794
|
// src/schemas/relationSchema.ts
|
|
11536
11795
|
var relationDataSchema = exports_external.object({
|
|
11537
|
-
description: exports_external.string().optional()
|
|
11796
|
+
description: exports_external.string().optional(),
|
|
11797
|
+
_source: exports_external.literal("field_sync").optional()
|
|
11538
11798
|
});
|
|
11539
11799
|
var relationSchema = exports_external.object({
|
|
11540
11800
|
id: exports_external.string(),
|
|
11541
11801
|
type: relationTypeSchema,
|
|
11542
11802
|
from: exports_external.string(),
|
|
11543
11803
|
to: exports_external.string(),
|
|
11804
|
+
weight: exports_external.number().optional(),
|
|
11805
|
+
confidence: exports_external.number().min(0).max(1).optional(),
|
|
11544
11806
|
data: relationDataSchema.optional(),
|
|
11545
|
-
metadata: metadataSchema.optional()
|
|
11807
|
+
metadata: metadataSchema.optional(),
|
|
11808
|
+
source_refs: sourceRefsSchema
|
|
11546
11809
|
});
|
|
11547
11810
|
// src/errors/c4aError.ts
|
|
11548
11811
|
class C4AError extends Error {
|
|
@@ -11689,6 +11952,7 @@ var DEFAULT_CLOUD_LIBRARY_ID = "lib_cloud_default";
|
|
|
11689
11952
|
var DEFAULT_CLOUD_LIBRARY_NAME = "个人云";
|
|
11690
11953
|
var DAEMON_HEARTBEAT_INTERVAL = 30000;
|
|
11691
11954
|
var DAEMON_OFFLINE_THRESHOLD = 60000;
|
|
11955
|
+
var CLOUD_DAEMON_IDLE_TIMEOUT = 300000;
|
|
11692
11956
|
// src/fileTypes.ts
|
|
11693
11957
|
var INDEXABLE_CODE_EXTENSIONS = new Set([".ts", ".tsx"]);
|
|
11694
11958
|
var INDEXABLE_DOC_EXTENSIONS = new Set([".md"]);
|
|
@@ -11733,6 +11997,9 @@ export {
|
|
|
11733
11997
|
transitionAtomSchema,
|
|
11734
11998
|
systemEntitySchema,
|
|
11735
11999
|
stateAtomSchema,
|
|
12000
|
+
sourceRefsSchema,
|
|
12001
|
+
sourceRefSpanSchema,
|
|
12002
|
+
sourceRefSchema,
|
|
11736
12003
|
sorEntitySchema,
|
|
11737
12004
|
sessionDecisionSchema,
|
|
11738
12005
|
serializeYaml,
|
|
@@ -11747,6 +12014,7 @@ export {
|
|
|
11747
12014
|
processEntitySchema,
|
|
11748
12015
|
perspectiveSchema,
|
|
11749
12016
|
parseYaml,
|
|
12017
|
+
parseRef,
|
|
11750
12018
|
modelingSessionDataSchema,
|
|
11751
12019
|
metricMilestoneSchema,
|
|
11752
12020
|
metricAtomSchema,
|
|
@@ -11754,15 +12022,19 @@ export {
|
|
|
11754
12022
|
mapErrorCodeToStatus,
|
|
11755
12023
|
kindSchema,
|
|
11756
12024
|
isValidManifest,
|
|
12025
|
+
isRefPointer,
|
|
11757
12026
|
isPathSafe,
|
|
11758
12027
|
isIndexableFile,
|
|
11759
12028
|
getFileExtension,
|
|
11760
12029
|
generateUUID,
|
|
11761
12030
|
generateId,
|
|
12031
|
+
extractionConfidenceSchema,
|
|
12032
|
+
extractAllRefs,
|
|
11762
12033
|
eventAtomSchema,
|
|
11763
12034
|
epicEntitySchema,
|
|
11764
12035
|
entityTypeSchema,
|
|
11765
12036
|
entitySchema,
|
|
12037
|
+
entityRefPointerSchema,
|
|
11766
12038
|
entityAtomSchema,
|
|
11767
12039
|
documentSchema,
|
|
11768
12040
|
documentModelingEntitySchema,
|
|
@@ -11772,14 +12044,16 @@ export {
|
|
|
11772
12044
|
decisionAtomSchema,
|
|
11773
12045
|
dataAtomsSchema,
|
|
11774
12046
|
contractEntitySchema,
|
|
12047
|
+
contractDataSchema,
|
|
11775
12048
|
contentHash,
|
|
11776
12049
|
containerEntitySchema,
|
|
11777
12050
|
constraintAtomSchema,
|
|
11778
|
-
confidenceSchema,
|
|
11779
12051
|
componentEntitySchema,
|
|
11780
12052
|
comparisonDimensionValueSchema,
|
|
11781
12053
|
comparisonDimensionSchema,
|
|
11782
12054
|
comparisonAtomSchema,
|
|
12055
|
+
claimAtomSchema,
|
|
12056
|
+
buildRef,
|
|
11783
12057
|
boundaryAtomSchema,
|
|
11784
12058
|
behaviorAtomSchema,
|
|
11785
12059
|
attributeAtomSchema,
|
|
@@ -11807,6 +12081,7 @@ export {
|
|
|
11807
12081
|
INDEXABLE_CODE_EXTENSIONS,
|
|
11808
12082
|
ErrorCode,
|
|
11809
12083
|
EntityType,
|
|
12084
|
+
EDGE_SYNC_RULES,
|
|
11810
12085
|
DEFAULT_WORKSPACE_NAME,
|
|
11811
12086
|
DEFAULT_WORKSPACE_ID,
|
|
11812
12087
|
DEFAULT_USER_NAME,
|
|
@@ -11817,6 +12092,7 @@ export {
|
|
|
11817
12092
|
DAEMON_OFFLINE_THRESHOLD,
|
|
11818
12093
|
DAEMON_HEARTBEAT_INTERVAL,
|
|
11819
12094
|
CODE_PACKAGE_FILES,
|
|
12095
|
+
CLOUD_DAEMON_IDLE_TIMEOUT,
|
|
11820
12096
|
C4AError,
|
|
11821
12097
|
AtomField
|
|
11822
12098
|
};
|