@suss/ir-core 0.35.1 → 0.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1464,7 +1464,21 @@ var SourceLocationSchema = z13.object({
1464
1464
  * project's `suss.json` gives it. Set only when the project lists its
1465
1465
  * modules, and then on every unit whose file is under a module's root.
1466
1466
  */
1467
- module: z13.string().optional()
1467
+ module: z13.string().optional(),
1468
+ /**
1469
+ * The git repository the extract ran in. Summaries from several
1470
+ * repositories can share a folder, and two of them can both have
1471
+ * `src/index.ts::handler`; this says which one each came from, and
1472
+ * which commit, so a link opens the file that was read. `path` is
1473
+ * where `file` is measured from, relative to the repository's top.
1474
+ * Absent outside a repository.
1475
+ */
1476
+ repository: z13.object({
1477
+ name: z13.string(),
1478
+ path: z13.string(),
1479
+ remote: z13.string().optional(),
1480
+ commit: z13.string().optional()
1481
+ }).optional()
1468
1482
  });
1469
1483
  var BoundaryBindingSchema = z13.object({
1470
1484
  transport: z13.string(),
package/dist/index.cjs CHANGED
@@ -1608,7 +1608,21 @@ var SourceLocationSchema = import_zod13.z.object({
1608
1608
  * project's `suss.json` gives it. Set only when the project lists its
1609
1609
  * modules, and then on every unit whose file is under a module's root.
1610
1610
  */
1611
- module: import_zod13.z.string().optional()
1611
+ module: import_zod13.z.string().optional(),
1612
+ /**
1613
+ * The git repository the extract ran in. Summaries from several
1614
+ * repositories can share a folder, and two of them can both have
1615
+ * `src/index.ts::handler`; this says which one each came from, and
1616
+ * which commit, so a link opens the file that was read. `path` is
1617
+ * where `file` is measured from, relative to the repository's top.
1618
+ * Absent outside a repository.
1619
+ */
1620
+ repository: import_zod13.z.object({
1621
+ name: import_zod13.z.string(),
1622
+ path: import_zod13.z.string(),
1623
+ remote: import_zod13.z.string().optional(),
1624
+ commit: import_zod13.z.string().optional()
1625
+ }).optional()
1612
1626
  });
1613
1627
  var BoundaryBindingSchema = import_zod13.z.object({
1614
1628
  transport: import_zod13.z.string(),
@@ -1888,15 +1902,27 @@ function fileInCodeScope(file, scope) {
1888
1902
  const path = codeScopePath(file);
1889
1903
  return path === prefix || path.startsWith(`${prefix}/`);
1890
1904
  }
1891
- function parseHandler(handler) {
1905
+ function parseHandler(handler, runtime) {
1892
1906
  const trimmed = handler.trim();
1893
- const lastDot = trimmed.lastIndexOf(".");
1894
- if (lastDot <= 0 || lastDot === trimmed.length - 1) {
1907
+ return HANDLER_SPLITS[handlerSpelling(trimmed, runtime)](trimmed);
1908
+ }
1909
+ function handlerSpelling(handler, runtime) {
1910
+ if (runtime !== void 0) {
1911
+ return runtime.trim().toLowerCase().startsWith("ruby") ? "ruby" : "lastDot";
1912
+ }
1913
+ return handler.includes("::") ? "ruby" : "lastDot";
1914
+ }
1915
+ var HANDLER_SPLITS = {
1916
+ lastDot: (handler) => splitAt(handler, handler.lastIndexOf(".")),
1917
+ ruby: (handler) => splitAt(handler, handler.indexOf(".", handler.lastIndexOf("/") + 1))
1918
+ };
1919
+ function splitAt(handler, dot) {
1920
+ if (dot <= 0 || dot === handler.length - 1) {
1895
1921
  return null;
1896
1922
  }
1897
1923
  return {
1898
- modulePath: trimmed.slice(0, lastDot),
1899
- exportName: trimmed.slice(lastDot + 1)
1924
+ modulePath: handler.slice(0, dot),
1925
+ exportName: handler.slice(dot + 1)
1900
1926
  };
1901
1927
  }
1902
1928
 
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { T as TypeShape, M as MessageBusSemantics, D as DeployableUnit, S as Semantics, B as BoundaryBindingSchema, C as ConfidenceInfoSchema, a as ConfidenceLevelSchema, b as ConfidenceSourceSchema, c as CorroborationSchema, d as SourceLocationSchema, e as MessageBusTechnology } from './schemas-lfg8kvak.cjs';
3
- export { f as DeployableUnitSchema, E as EVERY_FIELD, F as FunctionCallSemantics, g as FunctionCallSemanticsSchema, G as GraphqlOperationSemantics, h as GraphqlOperationSemanticsSchema, i as GraphqlResolverSemantics, j as GraphqlResolverSemanticsSchema, k as MessageBusSemanticsSchema, R as RestSemantics, l as RestSemanticsSchema, m as RuntimeConfigSemantics, n as RuntimeConfigSemanticsSchema, o as SemanticsSchema, p as StorageSemantics, q as StorageSemanticsSchema, r as TypeShapeSchema, s as ecsContainerInstanceName, t as isModuleName, u as methodsAgree, v as normalizePath, w as pathShape, x as routePathAdmits, y as routePathsMeet, z as storageContainerLabel, A as storageLabel, H as storageSystemLabel, I as typeDefinitionKey, J as withDefinitionsInlined } from './schemas-lfg8kvak.cjs';
2
+ import { T as TypeShape, M as MessageBusSemantics, D as DeployableUnit, S as Semantics, B as BoundaryBindingSchema, C as ConfidenceInfoSchema, a as ConfidenceLevelSchema, b as ConfidenceSourceSchema, c as CorroborationSchema, d as SourceLocationSchema, e as MessageBusTechnology } from './schemas-D-cxOSiQ.cjs';
3
+ export { f as DeployableUnitSchema, E as EVERY_FIELD, F as FunctionCallSemantics, g as FunctionCallSemanticsSchema, G as GraphqlOperationSemantics, h as GraphqlOperationSemanticsSchema, i as GraphqlResolverSemantics, j as GraphqlResolverSemanticsSchema, k as MessageBusSemanticsSchema, R as RestSemantics, l as RestSemanticsSchema, m as RuntimeConfigSemantics, n as RuntimeConfigSemanticsSchema, o as SemanticsSchema, p as StorageSemantics, q as StorageSemanticsSchema, r as TypeShapeSchema, s as ecsContainerInstanceName, t as isModuleName, u as methodsAgree, v as normalizePath, w as pathShape, x as routePathAdmits, y as routePathsMeet, z as storageContainerLabel, A as storageLabel, H as storageSystemLabel, I as typeDefinitionKey, J as withDefinitionsInlined } from './schemas-D-cxOSiQ.cjs';
4
4
 
5
5
  /**
6
6
  * The boundary-name syntax, parsed and printed in one place.
@@ -493,6 +493,14 @@ interface PackConfiguration {
493
493
  * not say.
494
494
  */
495
495
  readFromProject?: (projectRoot: string) => Record<string, unknown> | null;
496
+ /**
497
+ * The options whose value is a file or directory path, either one
498
+ * string or a list of them. A relative one is read against the config
499
+ * file, so a file kept outside the project points somewhere else. The
500
+ * CLI reports each path where nothing exists, instead of letting the
501
+ * pack look up classes in a directory that is not there.
502
+ */
503
+ paths?: readonly string[];
496
504
  }
497
505
  interface PackDeclaration {
498
506
  /**
@@ -761,15 +769,28 @@ declare function codeScopePath(raw: string): string;
761
769
  declare function fileInCodeScope(file: string, scope: string): boolean;
762
770
  interface ParsedHandler {
763
771
  modulePath: string;
772
+ /**
773
+ * The function the platform calls, written the way the module's
774
+ * language writes it: `handler`, or `Billing::Handler.process` for a
775
+ * class method in Ruby.
776
+ */
764
777
  exportName: string;
765
778
  }
766
779
  /**
767
- * Split a handler string into its module path and exported symbol.
768
- * The final dot separates them: `"src/handlers/confirmToken.handler"` →
780
+ * Split a handler string into its module path and the function the
781
+ * platform calls. Most runtimes put the function after the final dot:
782
+ * `"src/handlers/confirmToken.handler"` gives
769
783
  * `{ modulePath: "src/handlers/confirmToken", exportName: "handler" }`.
784
+ *
785
+ * Ruby writes `file.method` or `file.Class.method`, and the class can be
786
+ * namespaced, as in `app.Billing::Handler.process`. A Ruby file name has
787
+ * no dot, so the module ends at the first dot. The runtime, when the
788
+ * manifest gives one, says which language wrote the handler; without
789
+ * one, a `::` marks a Ruby class.
790
+ *
770
791
  * Returns null when there's no dot, since there's no export to bind to.
771
792
  */
772
- declare function parseHandler(handler: string): ParsedHandler | null;
793
+ declare function parseHandler(handler: string, runtime?: string): ParsedHandler | null;
773
794
 
774
795
  /**
775
796
  * Dispatch on a discriminated union through a mapped-type Record, so a
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { T as TypeShape, M as MessageBusSemantics, D as DeployableUnit, S as Semantics, B as BoundaryBindingSchema, C as ConfidenceInfoSchema, a as ConfidenceLevelSchema, b as ConfidenceSourceSchema, c as CorroborationSchema, d as SourceLocationSchema, e as MessageBusTechnology } from './schemas-lfg8kvak.js';
3
- export { f as DeployableUnitSchema, E as EVERY_FIELD, F as FunctionCallSemantics, g as FunctionCallSemanticsSchema, G as GraphqlOperationSemantics, h as GraphqlOperationSemanticsSchema, i as GraphqlResolverSemantics, j as GraphqlResolverSemanticsSchema, k as MessageBusSemanticsSchema, R as RestSemantics, l as RestSemanticsSchema, m as RuntimeConfigSemantics, n as RuntimeConfigSemanticsSchema, o as SemanticsSchema, p as StorageSemantics, q as StorageSemanticsSchema, r as TypeShapeSchema, s as ecsContainerInstanceName, t as isModuleName, u as methodsAgree, v as normalizePath, w as pathShape, x as routePathAdmits, y as routePathsMeet, z as storageContainerLabel, A as storageLabel, H as storageSystemLabel, I as typeDefinitionKey, J as withDefinitionsInlined } from './schemas-lfg8kvak.js';
2
+ import { T as TypeShape, M as MessageBusSemantics, D as DeployableUnit, S as Semantics, B as BoundaryBindingSchema, C as ConfidenceInfoSchema, a as ConfidenceLevelSchema, b as ConfidenceSourceSchema, c as CorroborationSchema, d as SourceLocationSchema, e as MessageBusTechnology } from './schemas-D-cxOSiQ.js';
3
+ export { f as DeployableUnitSchema, E as EVERY_FIELD, F as FunctionCallSemantics, g as FunctionCallSemanticsSchema, G as GraphqlOperationSemantics, h as GraphqlOperationSemanticsSchema, i as GraphqlResolverSemantics, j as GraphqlResolverSemanticsSchema, k as MessageBusSemanticsSchema, R as RestSemantics, l as RestSemanticsSchema, m as RuntimeConfigSemantics, n as RuntimeConfigSemanticsSchema, o as SemanticsSchema, p as StorageSemantics, q as StorageSemanticsSchema, r as TypeShapeSchema, s as ecsContainerInstanceName, t as isModuleName, u as methodsAgree, v as normalizePath, w as pathShape, x as routePathAdmits, y as routePathsMeet, z as storageContainerLabel, A as storageLabel, H as storageSystemLabel, I as typeDefinitionKey, J as withDefinitionsInlined } from './schemas-D-cxOSiQ.js';
4
4
 
5
5
  /**
6
6
  * The boundary-name syntax, parsed and printed in one place.
@@ -493,6 +493,14 @@ interface PackConfiguration {
493
493
  * not say.
494
494
  */
495
495
  readFromProject?: (projectRoot: string) => Record<string, unknown> | null;
496
+ /**
497
+ * The options whose value is a file or directory path, either one
498
+ * string or a list of them. A relative one is read against the config
499
+ * file, so a file kept outside the project points somewhere else. The
500
+ * CLI reports each path where nothing exists, instead of letting the
501
+ * pack look up classes in a directory that is not there.
502
+ */
503
+ paths?: readonly string[];
496
504
  }
497
505
  interface PackDeclaration {
498
506
  /**
@@ -761,15 +769,28 @@ declare function codeScopePath(raw: string): string;
761
769
  declare function fileInCodeScope(file: string, scope: string): boolean;
762
770
  interface ParsedHandler {
763
771
  modulePath: string;
772
+ /**
773
+ * The function the platform calls, written the way the module's
774
+ * language writes it: `handler`, or `Billing::Handler.process` for a
775
+ * class method in Ruby.
776
+ */
764
777
  exportName: string;
765
778
  }
766
779
  /**
767
- * Split a handler string into its module path and exported symbol.
768
- * The final dot separates them: `"src/handlers/confirmToken.handler"` →
780
+ * Split a handler string into its module path and the function the
781
+ * platform calls. Most runtimes put the function after the final dot:
782
+ * `"src/handlers/confirmToken.handler"` gives
769
783
  * `{ modulePath: "src/handlers/confirmToken", exportName: "handler" }`.
784
+ *
785
+ * Ruby writes `file.method` or `file.Class.method`, and the class can be
786
+ * namespaced, as in `app.Billing::Handler.process`. A Ruby file name has
787
+ * no dot, so the module ends at the first dot. The runtime, when the
788
+ * manifest gives one, says which language wrote the handler; without
789
+ * one, a `::` marks a Ruby class.
790
+ *
770
791
  * Returns null when there's no dot, since there's no export to bind to.
771
792
  */
772
- declare function parseHandler(handler: string): ParsedHandler | null;
793
+ declare function parseHandler(handler: string, runtime?: string): ParsedHandler | null;
773
794
 
774
795
  /**
775
796
  * Dispatch on a discriminated union through a mapped-type Record, so a
package/dist/index.js CHANGED
@@ -63,7 +63,7 @@ import {
63
63
  typeDefinitionKey,
64
64
  unitIdentityKey,
65
65
  withDefinitionsInlined
66
- } from "./chunk-A46EUIKC.js";
66
+ } from "./chunk-7IOGU4OC.js";
67
67
 
68
68
  // src/semconv.ts
69
69
  function semconvAttributes(binding) {
@@ -261,15 +261,27 @@ function fileInCodeScope(file, scope) {
261
261
  const path = codeScopePath(file);
262
262
  return path === prefix || path.startsWith(`${prefix}/`);
263
263
  }
264
- function parseHandler(handler) {
264
+ function parseHandler(handler, runtime) {
265
265
  const trimmed = handler.trim();
266
- const lastDot = trimmed.lastIndexOf(".");
267
- if (lastDot <= 0 || lastDot === trimmed.length - 1) {
266
+ return HANDLER_SPLITS[handlerSpelling(trimmed, runtime)](trimmed);
267
+ }
268
+ function handlerSpelling(handler, runtime) {
269
+ if (runtime !== void 0) {
270
+ return runtime.trim().toLowerCase().startsWith("ruby") ? "ruby" : "lastDot";
271
+ }
272
+ return handler.includes("::") ? "ruby" : "lastDot";
273
+ }
274
+ var HANDLER_SPLITS = {
275
+ lastDot: (handler) => splitAt(handler, handler.lastIndexOf(".")),
276
+ ruby: (handler) => splitAt(handler, handler.indexOf(".", handler.lastIndexOf("/") + 1))
277
+ };
278
+ function splitAt(handler, dot) {
279
+ if (dot <= 0 || dot === handler.length - 1) {
268
280
  return null;
269
281
  }
270
282
  return {
271
- modulePath: trimmed.slice(0, lastDot),
272
- exportName: trimmed.slice(lastDot + 1)
283
+ modulePath: handler.slice(0, dot),
284
+ exportName: handler.slice(dot + 1)
273
285
  };
274
286
  }
275
287
 
@@ -365,6 +365,12 @@ declare const SourceLocationSchema: z.ZodObject<{
365
365
  exportName: z.ZodNullable<z.ZodString>;
366
366
  workspace: z.ZodOptional<z.ZodString>;
367
367
  module: z.ZodOptional<z.ZodString>;
368
+ repository: z.ZodOptional<z.ZodObject<{
369
+ name: z.ZodString;
370
+ path: z.ZodString;
371
+ remote: z.ZodOptional<z.ZodString>;
372
+ commit: z.ZodOptional<z.ZodString>;
373
+ }, z.core.$strip>>;
368
374
  }, z.core.$strip>;
369
375
  declare const BoundaryBindingSchema: z.ZodObject<{
370
376
  transport: z.ZodString;
@@ -365,6 +365,12 @@ declare const SourceLocationSchema: z.ZodObject<{
365
365
  exportName: z.ZodNullable<z.ZodString>;
366
366
  workspace: z.ZodOptional<z.ZodString>;
367
367
  module: z.ZodOptional<z.ZodString>;
368
+ repository: z.ZodOptional<z.ZodObject<{
369
+ name: z.ZodString;
370
+ path: z.ZodString;
371
+ remote: z.ZodOptional<z.ZodString>;
372
+ commit: z.ZodOptional<z.ZodString>;
373
+ }, z.core.$strip>>;
368
374
  }, z.core.$strip>;
369
375
  declare const BoundaryBindingSchema: z.ZodObject<{
370
376
  transport: z.ZodString;
package/dist/schemas.cjs CHANGED
@@ -1360,7 +1360,21 @@ var SourceLocationSchema = import_zod13.z.object({
1360
1360
  * project's `suss.json` gives it. Set only when the project lists its
1361
1361
  * modules, and then on every unit whose file is under a module's root.
1362
1362
  */
1363
- module: import_zod13.z.string().optional()
1363
+ module: import_zod13.z.string().optional(),
1364
+ /**
1365
+ * The git repository the extract ran in. Summaries from several
1366
+ * repositories can share a folder, and two of them can both have
1367
+ * `src/index.ts::handler`; this says which one each came from, and
1368
+ * which commit, so a link opens the file that was read. `path` is
1369
+ * where `file` is measured from, relative to the repository's top.
1370
+ * Absent outside a repository.
1371
+ */
1372
+ repository: import_zod13.z.object({
1373
+ name: import_zod13.z.string(),
1374
+ path: import_zod13.z.string(),
1375
+ remote: import_zod13.z.string().optional(),
1376
+ commit: import_zod13.z.string().optional()
1377
+ }).optional()
1364
1378
  });
1365
1379
  var BoundaryBindingSchema = import_zod13.z.object({
1366
1380
  transport: import_zod13.z.string(),
@@ -1,2 +1,2 @@
1
1
  import 'zod';
2
- export { B as BoundaryBindingSchema, C as ConfidenceInfoSchema, a as ConfidenceLevelSchema, b as ConfidenceSourceSchema, c as CorroborationSchema, f as DeployableUnitSchema, g as FunctionCallSemanticsSchema, h as GraphqlOperationSemanticsSchema, j as GraphqlResolverSemanticsSchema, k as MessageBusSemanticsSchema, l as RestSemanticsSchema, n as RuntimeConfigSemanticsSchema, o as SemanticsSchema, d as SourceLocationSchema, q as StorageSemanticsSchema, T as TypeShape, r as TypeShapeSchema, I as typeDefinitionKey, J as withDefinitionsInlined } from './schemas-lfg8kvak.cjs';
2
+ export { B as BoundaryBindingSchema, C as ConfidenceInfoSchema, a as ConfidenceLevelSchema, b as ConfidenceSourceSchema, c as CorroborationSchema, f as DeployableUnitSchema, g as FunctionCallSemanticsSchema, h as GraphqlOperationSemanticsSchema, j as GraphqlResolverSemanticsSchema, k as MessageBusSemanticsSchema, l as RestSemanticsSchema, n as RuntimeConfigSemanticsSchema, o as SemanticsSchema, d as SourceLocationSchema, q as StorageSemanticsSchema, T as TypeShape, r as TypeShapeSchema, I as typeDefinitionKey, J as withDefinitionsInlined } from './schemas-D-cxOSiQ.cjs';
package/dist/schemas.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  import 'zod';
2
- export { B as BoundaryBindingSchema, C as ConfidenceInfoSchema, a as ConfidenceLevelSchema, b as ConfidenceSourceSchema, c as CorroborationSchema, f as DeployableUnitSchema, g as FunctionCallSemanticsSchema, h as GraphqlOperationSemanticsSchema, j as GraphqlResolverSemanticsSchema, k as MessageBusSemanticsSchema, l as RestSemanticsSchema, n as RuntimeConfigSemanticsSchema, o as SemanticsSchema, d as SourceLocationSchema, q as StorageSemanticsSchema, T as TypeShape, r as TypeShapeSchema, I as typeDefinitionKey, J as withDefinitionsInlined } from './schemas-lfg8kvak.js';
2
+ export { B as BoundaryBindingSchema, C as ConfidenceInfoSchema, a as ConfidenceLevelSchema, b as ConfidenceSourceSchema, c as CorroborationSchema, f as DeployableUnitSchema, g as FunctionCallSemanticsSchema, h as GraphqlOperationSemanticsSchema, j as GraphqlResolverSemanticsSchema, k as MessageBusSemanticsSchema, l as RestSemanticsSchema, n as RuntimeConfigSemanticsSchema, o as SemanticsSchema, d as SourceLocationSchema, q as StorageSemanticsSchema, T as TypeShape, r as TypeShapeSchema, I as typeDefinitionKey, J as withDefinitionsInlined } from './schemas-D-cxOSiQ.js';
package/dist/schemas.js CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  TypeShapeSchema,
18
18
  typeDefinitionKey,
19
19
  withDefinitionsInlined
20
- } from "./chunk-A46EUIKC.js";
20
+ } from "./chunk-7IOGU4OC.js";
21
21
  export {
22
22
  BoundaryBindingSchema,
23
23
  ConfidenceInfoSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suss/ir-core",
3
- "version": "0.35.1",
3
+ "version": "0.36.0",
4
4
  "type": "module",
5
5
  "description": "The type primitives every suss summary is built from: type shapes, boundary bindings, source locations and confidence.",
6
6
  "keywords": [