@c4a/extract 0.5.33-alpha.4 → 0.5.35-beta.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.
@@ -13557,90 +13557,6 @@ var jsonl = (rows) => rows.map((row) => JSON.stringify(row)).join(`
13557
13557
  ` : "");
13558
13558
  var manifestText = (value) => JSON.stringify(value, null, 2) + `
13559
13559
  `;
13560
- var buildCodeSymbolLocator = (packageName, symbolId, symbol) => `${packageName}:${symbolId}:${symbol.kind}:${symbol.file}:${symbol.line}-${symbol.endLine}`;
13561
- var buildCodeSymbolIdentityKey = (packageName, rootSymbolId, symbolId, kind, hasParent) => hasParent ? `${packageName}|root:${rootSymbolId}|owned:${symbolId}|${kind}` : `${packageName}|root:${symbolId}|${kind}`;
13562
- function applyCodeSymbolIdentity(symbol, context) {
13563
- const segment = symbol.name;
13564
- const symbolId = symbol.symbol_id ?? (context.parentSymbolId ? `${context.parentSymbolId}.${segment}` : segment);
13565
- const rootSymbolId = symbol.root_symbol_id ?? context.rootSymbolId ?? symbolId;
13566
- const memberPath = symbol.member_path ?? [...context.parentPath ?? [], segment];
13567
- const hasParent = context.parentSymbolId !== undefined || symbol.parent_symbol_id !== undefined;
13568
- const parentSymbolId = symbol.parent_symbol_id ?? context.parentSymbolId;
13569
- const members = symbol.members?.map((member) => applyCodeSymbolIdentity(member, {
13570
- packageName: context.packageName,
13571
- parentSymbolId: symbolId,
13572
- rootSymbolId,
13573
- parentPath: memberPath
13574
- }));
13575
- return {
13576
- ...symbol,
13577
- symbol_id: symbolId,
13578
- identity_key: symbol.identity_key ?? buildCodeSymbolIdentityKey(context.packageName, rootSymbolId, symbolId, symbol.kind, hasParent),
13579
- display_name: symbol.display_name ?? symbol.name,
13580
- member_path: memberPath,
13581
- root_symbol_id: rootSymbolId,
13582
- ...parentSymbolId !== undefined ? { parent_symbol_id: parentSymbolId } : {},
13583
- symbol_locator: symbol.symbol_locator ?? buildCodeSymbolLocator(context.packageName, symbolId, symbol),
13584
- ...members && members.length > 0 ? { members } : {}
13585
- };
13586
- }
13587
- function applySymbolIdentities(symbols, packageName) {
13588
- return symbols.map((symbol) => applyCodeSymbolIdentity(symbol, { packageName }));
13589
- }
13590
- function assertIdentityApplied(symbol) {
13591
- if (!symbol.symbol_id || !symbol.identity_key || !symbol.display_name || !symbol.root_symbol_id || !symbol.symbol_locator || !symbol.member_path || symbol.member_path.length === 0) {
13592
- throw new Error(`flattenSymbols requires applied code symbol identity fields for "${symbol.name}"`);
13593
- }
13594
- }
13595
- var buildSymbolHashId = (packageName, modulePath, symbol, symbolId, identityKey, locator) => hashStable({
13596
- packageName,
13597
- modulePath,
13598
- symbolId,
13599
- identityKey,
13600
- locator,
13601
- name: symbol.name,
13602
- kind: symbol.kind,
13603
- visibility: symbol.visibility,
13604
- file: symbol.file,
13605
- line: symbol.line,
13606
- endLine: symbol.endLine,
13607
- params: symbol.params ?? null,
13608
- returnType: symbol.returnType ?? null,
13609
- typeAnnotation: symbol.typeAnnotation ?? null,
13610
- extends: symbol.extends ?? null,
13611
- implements: symbol.implements ?? null,
13612
- doc: symbol.doc ?? null,
13613
- propsType: symbol.propsType ?? null,
13614
- unionValues: symbol.unionValues ?? null
13615
- });
13616
- function flattenSymbols(symbols, packageName, modulePath) {
13617
- const out = [];
13618
- const walk = (list) => {
13619
- for (const symbol of list) {
13620
- assertIdentityApplied(symbol);
13621
- const { members, ...rest } = symbol;
13622
- out.push({
13623
- ...rest,
13624
- package: packageName,
13625
- package_name: packageName,
13626
- symbol_id: symbol.symbol_id,
13627
- identity_key: symbol.identity_key,
13628
- display_name: symbol.display_name,
13629
- member_path: symbol.member_path,
13630
- root_symbol_id: symbol.root_symbol_id,
13631
- symbol_locator: symbol.symbol_locator,
13632
- hash_id: buildSymbolHashId(packageName, modulePath, rest, symbol.symbol_id, symbol.identity_key, symbol.symbol_locator),
13633
- ...symbol.parent_symbol_id !== undefined ? { parent_symbol_id: symbol.parent_symbol_id } : {},
13634
- modulePath,
13635
- module_path: modulePath
13636
- });
13637
- if (members && members.length > 0)
13638
- walk(members);
13639
- }
13640
- };
13641
- walk(symbols);
13642
- return out;
13643
- }
13644
13560
  var hasOwn = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
13645
13561
  var canonicalizeCodeVersionLabel = (value) => {
13646
13562
  const trimmed = value.trim();
@@ -13707,6 +13623,26 @@ var metaText = (manifest, source2, rows) => {
13707
13623
  };
13708
13624
  return manifestText(meta);
13709
13625
  };
13626
+ function flattenSymbols(symbols, packageName, modulePath) {
13627
+ const out = [];
13628
+ const walk = (list) => {
13629
+ for (const symbol of list) {
13630
+ const { members, ...rest } = symbol;
13631
+ out.push({
13632
+ ...rest,
13633
+ package: packageName,
13634
+ package_name: packageName,
13635
+ symbol_id: symbol.name,
13636
+ modulePath,
13637
+ module_path: modulePath
13638
+ });
13639
+ if (members && members.length > 0)
13640
+ walk(members);
13641
+ }
13642
+ };
13643
+ walk(symbols);
13644
+ return out;
13645
+ }
13710
13646
  var buildHashId = (packageName, dirCommit, moduleContentHash, dirty = false) => {
13711
13647
  const base = dirty && moduleContentHash ? `pkg:${packageName}:${dirCommit}:dirty:${moduleContentHash}` : `pkg:${packageName}:${dirCommit}`;
13712
13648
  return sha256(base);
package/index.js CHANGED
@@ -15248,10 +15248,6 @@ var symbolParamSchema = exports_external.object({
15248
15248
  name: exports_external.string().min(1),
15249
15249
  type: exports_external.string().min(1).nullable()
15250
15250
  });
15251
- var symbolRenameEvidenceSchema = exports_external.object({
15252
- previous_identity_key: exports_external.string().min(1),
15253
- reason: exports_external.string().min(1)
15254
- });
15255
15251
  var symbolInfoSchema = exports_external.lazy(() => exports_external.object({
15256
15252
  name: exports_external.string().min(1),
15257
15253
  kind: symbolKindSchema2,
@@ -15259,14 +15255,6 @@ var symbolInfoSchema = exports_external.lazy(() => exports_external.object({
15259
15255
  file: exports_external.string().min(1),
15260
15256
  line: exports_external.number().int().positive(),
15261
15257
  endLine: exports_external.number().int().positive(),
15262
- symbol_id: exports_external.string().min(1).optional(),
15263
- identity_key: exports_external.string().min(1).optional(),
15264
- display_name: exports_external.string().min(1).optional(),
15265
- member_path: exports_external.array(exports_external.string().min(1)).optional(),
15266
- root_symbol_id: exports_external.string().min(1).optional(),
15267
- parent_symbol_id: exports_external.string().min(1).optional(),
15268
- symbol_locator: exports_external.string().min(1).optional(),
15269
- rename_evidence: exports_external.array(symbolRenameEvidenceSchema).optional(),
15270
15258
  members: exports_external.array(symbolInfoSchema).optional(),
15271
15259
  params: exports_external.array(symbolParamSchema).optional(),
15272
15260
  returnType: exports_external.string().min(1).nullable().optional(),
@@ -16023,90 +16011,6 @@ var jsonl = (rows) => rows.map((row) => JSON.stringify(row)).join(`
16023
16011
  ` : "");
16024
16012
  var manifestText = (value) => JSON.stringify(value, null, 2) + `
16025
16013
  `;
16026
- var buildCodeSymbolLocator = (packageName, symbolId, symbol) => `${packageName}:${symbolId}:${symbol.kind}:${symbol.file}:${symbol.line}-${symbol.endLine}`;
16027
- var buildCodeSymbolIdentityKey = (packageName, rootSymbolId, symbolId, kind, hasParent) => hasParent ? `${packageName}|root:${rootSymbolId}|owned:${symbolId}|${kind}` : `${packageName}|root:${symbolId}|${kind}`;
16028
- function applyCodeSymbolIdentity(symbol, context) {
16029
- const segment = symbol.name;
16030
- const symbolId = symbol.symbol_id ?? (context.parentSymbolId ? `${context.parentSymbolId}.${segment}` : segment);
16031
- const rootSymbolId = symbol.root_symbol_id ?? context.rootSymbolId ?? symbolId;
16032
- const memberPath = symbol.member_path ?? [...context.parentPath ?? [], segment];
16033
- const hasParent = context.parentSymbolId !== undefined || symbol.parent_symbol_id !== undefined;
16034
- const parentSymbolId = symbol.parent_symbol_id ?? context.parentSymbolId;
16035
- const members = symbol.members?.map((member) => applyCodeSymbolIdentity(member, {
16036
- packageName: context.packageName,
16037
- parentSymbolId: symbolId,
16038
- rootSymbolId,
16039
- parentPath: memberPath
16040
- }));
16041
- return {
16042
- ...symbol,
16043
- symbol_id: symbolId,
16044
- identity_key: symbol.identity_key ?? buildCodeSymbolIdentityKey(context.packageName, rootSymbolId, symbolId, symbol.kind, hasParent),
16045
- display_name: symbol.display_name ?? symbol.name,
16046
- member_path: memberPath,
16047
- root_symbol_id: rootSymbolId,
16048
- ...parentSymbolId !== undefined ? { parent_symbol_id: parentSymbolId } : {},
16049
- symbol_locator: symbol.symbol_locator ?? buildCodeSymbolLocator(context.packageName, symbolId, symbol),
16050
- ...members && members.length > 0 ? { members } : {}
16051
- };
16052
- }
16053
- function applySymbolIdentities(symbols, packageName) {
16054
- return symbols.map((symbol) => applyCodeSymbolIdentity(symbol, { packageName }));
16055
- }
16056
- function assertIdentityApplied(symbol) {
16057
- if (!symbol.symbol_id || !symbol.identity_key || !symbol.display_name || !symbol.root_symbol_id || !symbol.symbol_locator || !symbol.member_path || symbol.member_path.length === 0) {
16058
- throw new Error(`flattenSymbols requires applied code symbol identity fields for "${symbol.name}"`);
16059
- }
16060
- }
16061
- var buildSymbolHashId = (packageName, modulePath, symbol, symbolId, identityKey, locator) => hashStable({
16062
- packageName,
16063
- modulePath,
16064
- symbolId,
16065
- identityKey,
16066
- locator,
16067
- name: symbol.name,
16068
- kind: symbol.kind,
16069
- visibility: symbol.visibility,
16070
- file: symbol.file,
16071
- line: symbol.line,
16072
- endLine: symbol.endLine,
16073
- params: symbol.params ?? null,
16074
- returnType: symbol.returnType ?? null,
16075
- typeAnnotation: symbol.typeAnnotation ?? null,
16076
- extends: symbol.extends ?? null,
16077
- implements: symbol.implements ?? null,
16078
- doc: symbol.doc ?? null,
16079
- propsType: symbol.propsType ?? null,
16080
- unionValues: symbol.unionValues ?? null
16081
- });
16082
- function flattenSymbols(symbols, packageName, modulePath) {
16083
- const out2 = [];
16084
- const walk = (list) => {
16085
- for (const symbol of list) {
16086
- assertIdentityApplied(symbol);
16087
- const { members, ...rest } = symbol;
16088
- out2.push({
16089
- ...rest,
16090
- package: packageName,
16091
- package_name: packageName,
16092
- symbol_id: symbol.symbol_id,
16093
- identity_key: symbol.identity_key,
16094
- display_name: symbol.display_name,
16095
- member_path: symbol.member_path,
16096
- root_symbol_id: symbol.root_symbol_id,
16097
- symbol_locator: symbol.symbol_locator,
16098
- hash_id: buildSymbolHashId(packageName, modulePath, rest, symbol.symbol_id, symbol.identity_key, symbol.symbol_locator),
16099
- ...symbol.parent_symbol_id !== undefined ? { parent_symbol_id: symbol.parent_symbol_id } : {},
16100
- modulePath,
16101
- module_path: modulePath
16102
- });
16103
- if (members && members.length > 0)
16104
- walk(members);
16105
- }
16106
- };
16107
- walk(symbols);
16108
- return out2;
16109
- }
16110
16014
  var hasOwn = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
16111
16015
  var canonicalizeCodeVersionLabel = (value) => {
16112
16016
  const trimmed = value.trim();
@@ -16173,6 +16077,26 @@ var metaText = (manifest, source2, rows) => {
16173
16077
  };
16174
16078
  return manifestText(meta);
16175
16079
  };
16080
+ function flattenSymbols(symbols, packageName, modulePath) {
16081
+ const out2 = [];
16082
+ const walk = (list) => {
16083
+ for (const symbol of list) {
16084
+ const { members, ...rest } = symbol;
16085
+ out2.push({
16086
+ ...rest,
16087
+ package: packageName,
16088
+ package_name: packageName,
16089
+ symbol_id: symbol.name,
16090
+ modulePath,
16091
+ module_path: modulePath
16092
+ });
16093
+ if (members && members.length > 0)
16094
+ walk(members);
16095
+ }
16096
+ };
16097
+ walk(symbols);
16098
+ return out2;
16099
+ }
16176
16100
  var buildHashId = (packageName, dirCommit, moduleContentHash, dirty = false) => {
16177
16101
  const base = dirty && moduleContentHash ? `pkg:${packageName}:${dirCommit}:dirty:${moduleContentHash}` : `pkg:${packageName}:${dirCommit}`;
16178
16102
  return sha256(base);
@@ -16624,7 +16548,6 @@ var detectTechStack = async (repoPath) => {
16624
16548
  return labels;
16625
16549
  };
16626
16550
  export {
16627
- symbolRenameEvidenceSchema,
16628
16551
  symbolParamSchema,
16629
16552
  symbolInfoSchema,
16630
16553
  symbolDiffSchema,
@@ -16680,10 +16603,7 @@ export {
16680
16603
  buildHashId,
16681
16604
  buildEdgeHashId,
16682
16605
  buildDigestData,
16683
- buildCodeSymbolLocator,
16684
- buildCodeSymbolIdentityKey,
16685
16606
  buildCodeSnapshot,
16686
- applySymbolIdentities,
16687
16607
  SCAN_EXCLUDED_DIRS,
16688
16608
  PACKAGE_JSON,
16689
16609
  ExtractionPluginRegistry
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c4a/extract",
3
- "version": "0.5.33-alpha.4",
3
+ "version": "0.5.35-beta.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "c4a-extract-code": "./bin/c4a-extract-code.js"