@milaboratories/pl-model-middle-layer 1.38.0 → 1.40.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.
@@ -0,0 +1,6 @@
1
+ // src/block_status_tree.ts
2
+ /** How many branches each heaviest list carries. */
3
+ const BlockStatusTreeHeaviestCount = 5;
4
+ exports.BlockStatusTreeHeaviestCount = BlockStatusTreeHeaviestCount;
5
+
6
+ //# sourceMappingURL=block_status_tree.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block_status_tree.cjs","names":[],"sources":["../src/block_status_tree.ts"],"sourcesContent":["/**\n * A block run's action-context tree, node by node, as the middle layer hands it to the Desktop App.\n *\n * A run can make thousands of contexts, so this is never the whole tree: the root and its top-level\n * contexts are always present, and a context's children are present only while the reader has\n * expanded it.\n *\n * Source: docs/text/work/projects/sdk/block-status/README_teo.md, \"Developer debug panel\", which\n * is what the Desktop App shows it in.\n */\n\nimport type { BlockStatusSummary } from \"./block_status\";\n\n/** One transition: `transition/<namespace>/<reporter>/<ns>`. */\nexport type BlockStatusTreeTransition = {\n /** `render`, `exec`, `workdir`, ... */\n readonly namespace: string;\n /** The resource that reported: the render itself, or a command or work dir it created. */\n readonly reporter: string;\n /** As written by the reporter. Can be a state this build does not know. */\n readonly state: string;\n readonly detail?: string;\n readonly reason?: string;\n /** ms since the epoch, on the reporter's clock. */\n readonly at: number;\n};\n\n/** One reading of a node: `reading/<namespace>/<resource>/<key>`. */\nexport type BlockStatusTreeReading = {\n /** The namespace the reading was written under, e.g. `workdir`. */\n readonly namespace: string;\n /** The resource that wrote it. */\n readonly resource: string;\n readonly key: string;\n /** Opaque text; the reporter owns the format. */\n readonly value: string;\n};\n\n/** One action context of the run. */\nexport type BlockStatusTreeNode = {\n /** Global id of the context, the handle for expanding it. */\n readonly contextId: string;\n /** The context's `name` baggage, falling back to the context id. */\n readonly name: string;\n /**\n * What the node is: `command` when a command reported into it, `workdir` when only a work dir\n * did, else `render`.\n */\n readonly kind: \"render\" | \"command\" | \"workdir\";\n /** The rest of the baggage: `block-pack`, `block-id`, `run-id`, ... */\n readonly baggage: Readonly<Record<string, string>>;\n /** The state holding the node as its reporter wrote it, undefined once it has ended or before it\n * reports. */\n readonly state?: string;\n /** True for `Running` reported by a command executing on a machine. */\n readonly onMachine: boolean;\n /** When the node entered {@link state}, ms since the epoch. */\n readonly enteredAt?: number;\n /** True once the node's render has ended and every reporter in it has too. */\n readonly ended: boolean;\n /** The engine's reason, set when the render terminated. */\n readonly failure?: string;\n /** Every transition of every reporter, oldest first, whatever its state. */\n readonly transitions: readonly BlockStatusTreeTransition[];\n /** Readings, sorted by namespace, then resource, then key. */\n readonly readings: readonly BlockStatusTreeReading[];\n /** Direct children, whether or not they are present below. */\n readonly childCount: number;\n /** This node and everything under it. */\n readonly subtreeContexts: number;\n /** Contexts in this subtree that have not ended. */\n readonly subtreeActiveContexts: number;\n /**\n * Time commands in this subtree spent running on a machine, ms. A command still running counts\n * up to the latest report anywhere in the run.\n */\n readonly subtreeComputeMs: number;\n /** The children, present only while the node is expanded. The root's are always present. */\n readonly children?: readonly BlockStatusTreeNode[];\n};\n\n/** A branch of the run, one of the root's top-level contexts with everything under it. */\nexport type BlockStatusTreeBranch = {\n readonly contextId: string;\n readonly name: string;\n readonly value: number;\n};\n\n/** The heaviest branches of the run, each list largest first. */\nexport type BlockStatusTreeHeaviest = {\n /** By {@link BlockStatusTreeNode.subtreeComputeMs}. */\n readonly byCompute: readonly BlockStatusTreeBranch[];\n /** By {@link BlockStatusTreeNode.subtreeContexts}. */\n readonly byContexts: readonly BlockStatusTreeBranch[];\n /**\n * By bytes of output. Undefined while no reporter writes file sizes, which is distinct from a run\n * that wrote nothing.\n */\n readonly byFileSize?: readonly BlockStatusTreeBranch[];\n};\n\n/** How many branches each heaviest list carries. */\nexport const BlockStatusTreeHeaviestCount = 5;\n\n/** The tree of one block run. */\nexport type BlockStatusTree = {\n /** The run's summary, the same one `watchBlockStatus` gives. */\n readonly summary: BlockStatusSummary;\n readonly heaviest: BlockStatusTreeHeaviest;\n /** The root context, undefined while the block has none. */\n readonly root?: BlockStatusTreeNode;\n /**\n * The context ids from the root down to the render that terminated first, so a reader can open\n * the tree to it. Undefined while no render has terminated.\n */\n readonly firstFailurePath?: readonly string[];\n};\n"],"mappings":";;AAsGA,MAAa,+BAA+B"}
@@ -0,0 +1,100 @@
1
+ import { BlockStatusSummary } from "./block_status.js";
2
+ /** One transition: `transition/<namespace>/<reporter>/<ns>`. */
3
+ export type BlockStatusTreeTransition = {
4
+ /** `render`, `exec`, `workdir`, ... */
5
+ readonly namespace: string;
6
+ /** The resource that reported: the render itself, or a command or work dir it created. */
7
+ readonly reporter: string;
8
+ /** As written by the reporter. Can be a state this build does not know. */
9
+ readonly state: string;
10
+ readonly detail?: string;
11
+ readonly reason?: string;
12
+ /** ms since the epoch, on the reporter's clock. */
13
+ readonly at: number;
14
+ };
15
+ /** One reading of a node: `reading/<namespace>/<resource>/<key>`. */
16
+ export type BlockStatusTreeReading = {
17
+ /** The namespace the reading was written under, e.g. `workdir`. */
18
+ readonly namespace: string;
19
+ /** The resource that wrote it. */
20
+ readonly resource: string;
21
+ readonly key: string;
22
+ /** Opaque text; the reporter owns the format. */
23
+ readonly value: string;
24
+ };
25
+ /** One action context of the run. */
26
+ export type BlockStatusTreeNode = {
27
+ /** Global id of the context, the handle for expanding it. */
28
+ readonly contextId: string;
29
+ /** The context's `name` baggage, falling back to the context id. */
30
+ readonly name: string;
31
+ /**
32
+ * What the node is: `command` when a command reported into it, `workdir` when only a work dir
33
+ * did, else `render`.
34
+ */
35
+ readonly kind: "render" | "command" | "workdir";
36
+ /** The rest of the baggage: `block-pack`, `block-id`, `run-id`, ... */
37
+ readonly baggage: Readonly<Record<string, string>>;
38
+ /** The state holding the node as its reporter wrote it, undefined once it has ended or before it
39
+ * reports. */
40
+ readonly state?: string;
41
+ /** True for `Running` reported by a command executing on a machine. */
42
+ readonly onMachine: boolean;
43
+ /** When the node entered {@link state}, ms since the epoch. */
44
+ readonly enteredAt?: number;
45
+ /** True once the node's render has ended and every reporter in it has too. */
46
+ readonly ended: boolean;
47
+ /** The engine's reason, set when the render terminated. */
48
+ readonly failure?: string;
49
+ /** Every transition of every reporter, oldest first, whatever its state. */
50
+ readonly transitions: readonly BlockStatusTreeTransition[];
51
+ /** Readings, sorted by namespace, then resource, then key. */
52
+ readonly readings: readonly BlockStatusTreeReading[];
53
+ /** Direct children, whether or not they are present below. */
54
+ readonly childCount: number;
55
+ /** This node and everything under it. */
56
+ readonly subtreeContexts: number;
57
+ /** Contexts in this subtree that have not ended. */
58
+ readonly subtreeActiveContexts: number;
59
+ /**
60
+ * Time commands in this subtree spent running on a machine, ms. A command still running counts
61
+ * up to the latest report anywhere in the run.
62
+ */
63
+ readonly subtreeComputeMs: number;
64
+ /** The children, present only while the node is expanded. The root's are always present. */
65
+ readonly children?: readonly BlockStatusTreeNode[];
66
+ };
67
+ /** A branch of the run, one of the root's top-level contexts with everything under it. */
68
+ export type BlockStatusTreeBranch = {
69
+ readonly contextId: string;
70
+ readonly name: string;
71
+ readonly value: number;
72
+ };
73
+ /** The heaviest branches of the run, each list largest first. */
74
+ export type BlockStatusTreeHeaviest = {
75
+ /** By {@link BlockStatusTreeNode.subtreeComputeMs}. */
76
+ readonly byCompute: readonly BlockStatusTreeBranch[];
77
+ /** By {@link BlockStatusTreeNode.subtreeContexts}. */
78
+ readonly byContexts: readonly BlockStatusTreeBranch[];
79
+ /**
80
+ * By bytes of output. Undefined while no reporter writes file sizes, which is distinct from a run
81
+ * that wrote nothing.
82
+ */
83
+ readonly byFileSize?: readonly BlockStatusTreeBranch[];
84
+ };
85
+ /** How many branches each heaviest list carries. */
86
+ export declare const BlockStatusTreeHeaviestCount = 5;
87
+ /** The tree of one block run. */
88
+ export type BlockStatusTree = {
89
+ /** The run's summary, the same one `watchBlockStatus` gives. */
90
+ readonly summary: BlockStatusSummary;
91
+ readonly heaviest: BlockStatusTreeHeaviest;
92
+ /** The root context, undefined while the block has none. */
93
+ readonly root?: BlockStatusTreeNode;
94
+ /**
95
+ * The context ids from the root down to the render that terminated first, so a reader can open
96
+ * the tree to it. Undefined while no render has terminated.
97
+ */
98
+ readonly firstFailurePath?: readonly string[];
99
+ };
100
+ //# sourceMappingURL=block_status_tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block_status_tree.d.ts","names":[],"sources":["../src/block_status_tree.ts"],"mappings":";;YAcY;;WAED;;WAEA;;WAEA;WACA;WACA;;WAEA;;;YAIC;;WAED;;WAEA;WACA;;WAEA;;;YAIC;;WAED;;WAEA;;;;;WAKA;;WAEA,SAAS,SAAS;;;WAGlB;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA,sBAAsB;;WAEtB,mBAAmB;;WAEnB;;WAEA;;WAEA;;;;;WAKA;;WAEA,oBAAoB;;;YAInB;WACD;WACA;WACA;;;YAIC;;WAED,oBAAoB;;WAEpB,qBAAqB;;;;;WAKrB,sBAAsB;;;qBAIpB;;YAGD;;WAED,SAAS;WACT,UAAU;;WAEV,OAAO;;;;;WAKP"}
@@ -0,0 +1,6 @@
1
+ // src/block_status_tree.ts
2
+ /** How many branches each heaviest list carries. */
3
+ const BlockStatusTreeHeaviestCount = 5;
4
+ export { BlockStatusTreeHeaviestCount };
5
+
6
+ //# sourceMappingURL=block_status_tree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block_status_tree.js","names":[],"sources":["../src/block_status_tree.ts"],"sourcesContent":["/**\n * A block run's action-context tree, node by node, as the middle layer hands it to the Desktop App.\n *\n * A run can make thousands of contexts, so this is never the whole tree: the root and its top-level\n * contexts are always present, and a context's children are present only while the reader has\n * expanded it.\n *\n * Source: docs/text/work/projects/sdk/block-status/README_teo.md, \"Developer debug panel\", which\n * is what the Desktop App shows it in.\n */\n\nimport type { BlockStatusSummary } from \"./block_status\";\n\n/** One transition: `transition/<namespace>/<reporter>/<ns>`. */\nexport type BlockStatusTreeTransition = {\n /** `render`, `exec`, `workdir`, ... */\n readonly namespace: string;\n /** The resource that reported: the render itself, or a command or work dir it created. */\n readonly reporter: string;\n /** As written by the reporter. Can be a state this build does not know. */\n readonly state: string;\n readonly detail?: string;\n readonly reason?: string;\n /** ms since the epoch, on the reporter's clock. */\n readonly at: number;\n};\n\n/** One reading of a node: `reading/<namespace>/<resource>/<key>`. */\nexport type BlockStatusTreeReading = {\n /** The namespace the reading was written under, e.g. `workdir`. */\n readonly namespace: string;\n /** The resource that wrote it. */\n readonly resource: string;\n readonly key: string;\n /** Opaque text; the reporter owns the format. */\n readonly value: string;\n};\n\n/** One action context of the run. */\nexport type BlockStatusTreeNode = {\n /** Global id of the context, the handle for expanding it. */\n readonly contextId: string;\n /** The context's `name` baggage, falling back to the context id. */\n readonly name: string;\n /**\n * What the node is: `command` when a command reported into it, `workdir` when only a work dir\n * did, else `render`.\n */\n readonly kind: \"render\" | \"command\" | \"workdir\";\n /** The rest of the baggage: `block-pack`, `block-id`, `run-id`, ... */\n readonly baggage: Readonly<Record<string, string>>;\n /** The state holding the node as its reporter wrote it, undefined once it has ended or before it\n * reports. */\n readonly state?: string;\n /** True for `Running` reported by a command executing on a machine. */\n readonly onMachine: boolean;\n /** When the node entered {@link state}, ms since the epoch. */\n readonly enteredAt?: number;\n /** True once the node's render has ended and every reporter in it has too. */\n readonly ended: boolean;\n /** The engine's reason, set when the render terminated. */\n readonly failure?: string;\n /** Every transition of every reporter, oldest first, whatever its state. */\n readonly transitions: readonly BlockStatusTreeTransition[];\n /** Readings, sorted by namespace, then resource, then key. */\n readonly readings: readonly BlockStatusTreeReading[];\n /** Direct children, whether or not they are present below. */\n readonly childCount: number;\n /** This node and everything under it. */\n readonly subtreeContexts: number;\n /** Contexts in this subtree that have not ended. */\n readonly subtreeActiveContexts: number;\n /**\n * Time commands in this subtree spent running on a machine, ms. A command still running counts\n * up to the latest report anywhere in the run.\n */\n readonly subtreeComputeMs: number;\n /** The children, present only while the node is expanded. The root's are always present. */\n readonly children?: readonly BlockStatusTreeNode[];\n};\n\n/** A branch of the run, one of the root's top-level contexts with everything under it. */\nexport type BlockStatusTreeBranch = {\n readonly contextId: string;\n readonly name: string;\n readonly value: number;\n};\n\n/** The heaviest branches of the run, each list largest first. */\nexport type BlockStatusTreeHeaviest = {\n /** By {@link BlockStatusTreeNode.subtreeComputeMs}. */\n readonly byCompute: readonly BlockStatusTreeBranch[];\n /** By {@link BlockStatusTreeNode.subtreeContexts}. */\n readonly byContexts: readonly BlockStatusTreeBranch[];\n /**\n * By bytes of output. Undefined while no reporter writes file sizes, which is distinct from a run\n * that wrote nothing.\n */\n readonly byFileSize?: readonly BlockStatusTreeBranch[];\n};\n\n/** How many branches each heaviest list carries. */\nexport const BlockStatusTreeHeaviestCount = 5;\n\n/** The tree of one block run. */\nexport type BlockStatusTree = {\n /** The run's summary, the same one `watchBlockStatus` gives. */\n readonly summary: BlockStatusSummary;\n readonly heaviest: BlockStatusTreeHeaviest;\n /** The root context, undefined while the block has none. */\n readonly root?: BlockStatusTreeNode;\n /**\n * The context ids from the root down to the render that terminated first, so a reader can open\n * the tree to it. Undefined while no render has terminated.\n */\n readonly firstFailurePath?: readonly string[];\n};\n"],"mappings":";;AAsGA,MAAa,+BAA+B"}
package/dist/index.cjs CHANGED
@@ -2,6 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_block_settings = require("./block_settings.cjs");
3
3
  const require_instance_stats = require("./instance_stats.cjs");
4
4
  const require_block_status = require("./block_status.cjs");
5
+ const require_block_status_tree = require("./block_status_tree.cjs");
5
6
  const require_project = require("./project.cjs");
6
7
  const require_document = require("./folders/document.cjs");
7
8
  const require_decode = require("./folders/decode.cjs");
@@ -56,6 +57,7 @@ exports.BlockPackOverviewNoRegistryId = require_overview.BlockPackOverviewNoRegi
56
57
  exports.BlockPackOverviewRaw = require_overview.BlockPackOverviewRaw;
57
58
  exports.BlockPackSpec = require_block_pack_spec.BlockPackSpec;
58
59
  exports.BlockPlatform = require_block_meta.BlockPlatform;
60
+ exports.BlockStatusTreeHeaviestCount = require_block_status_tree.BlockStatusTreeHeaviestCount;
59
61
  exports.ContentExplicitBase64 = require_content_types.ContentExplicitBase64;
60
62
  exports.ContentExplicitBytes = require_content_types.ContentExplicitBytes;
61
63
  exports.ContentRelative = require_content_types.ContentRelative;
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import { StorageDebugView } from "./storage_debug_view.js";
4
4
  import { BlockStateInternal, BlockStateInternalV3 } from "./block_state.js";
5
5
  import { InstanceStats, InstanceStatsCapacity, InstanceStatsStatus, UnsupportedInstanceStats } from "./instance_stats.js";
6
6
  import { BlockStatusAvailability, BlockStatusJobGroup, BlockStatusJobs, BlockStatusState, BlockStatusSummary, EmptyBlockStatusJobs, EmptyBlockStatusSummary, UnreadableBlockStatusSummary, UnsupportedBlockStatusSummary, blockStatusStates, blockStatusStatesRecord, isTerminalBlockStatusState } from "./block_status.js";
7
+ import { BlockStatusTree, BlockStatusTreeBranch, BlockStatusTreeHeaviest, BlockStatusTreeHeaviestCount, BlockStatusTreeNode, BlockStatusTreeReading, BlockStatusTreeTransition } from "./block_status_tree.js";
7
8
  import { ProjectMeta, normalizeDescription, normalizeProjectMeta } from "./project.js";
8
9
  import { ProjectListEntry } from "./project_list.js";
9
10
  import { BlockPackDevV1, BlockPackDevV2, BlockPackFromPackV2, BlockPackFromRegistryV1, BlockPackFromRegistryV2, BlockPackSpec } from "./block_registry/block_pack_spec.js";
@@ -35,4 +36,4 @@ import "./block_meta/index.js";
35
36
  import { index_d_exports } from "./pframe/internal_api/index.js";
36
37
  import "./pframe/index.js";
37
38
  import { HashedJson, hashJson, readJson, readJsonSync } from "./json.js";
38
- export { AnyChannel, type AuthorMarker, BlockCalculationStatus, BlockComponents, BlockComponentsDescriptionRaw, BlockComponentsManifest, BlockKindRef, BlockPackDescription, BlockPackDescriptionFromPackageJsonRaw, BlockPackDescriptionManifest, BlockPackDescriptionRaw, BlockPackDevV1, BlockPackDevV2, BlockPackFromPackV2, BlockPackFromRegistryV1, BlockPackFromRegistryV2, BlockPackId, BlockPackIdNoVersion, BlockPackListing, BlockPackManifest, BlockPackManifestFile, BlockPackMeta, BlockPackMetaDescriptionRaw, BlockPackMetaEmbeddedBase64, BlockPackMetaEmbeddedBytes, BlockPackMetaManifest, BlockPackOverview, BlockPackOverviewLegacy, BlockPackOverviewNoRegistryId, BlockPackOverviewRaw, BlockPackSpec, BlockPlatform, BlockSettings, BlockStateInternal, BlockStateInternalV3, BlockStateOverview, BlockStatusAvailability, BlockStatusJobGroup, BlockStatusJobs, BlockStatusState, BlockStatusSummary, Content, ContentAbsoluteBinaryLocal, ContentAbsoluteFile, ContentAbsoluteFolder, ContentAbsoluteTextLocal, ContentAbsoluteUrl, ContentAnyBinaryLocal, ContentAnyLocal, ContentAnyTextLocal, ContentExplicitBase64, ContentExplicitBytes, ContentExplicitOrRelative, ContentExplicitString, ContentRelative, ContentRelativeBinary, ContentRelativeText, ContentType, ContextType, CreateBlockPackDescriptionSchema, DescriptionContentBinary, DescriptionContentText, EmptyBlockStatusJobs, EmptyBlockStatusSummary, FOLDERS_SCHEMA_VERSION, FeatureFlags, FolderEntry, FolderId, FolderView, FoldersDecoded, FoldersDocument, FoldersDocumentProblem, FoldersEdit, FoldersItem, FoldersItemInput, FoldersItemView, FoldersLabelRename, FoldersLeafItem, FoldersMoveApplication, FoldersMoveEntry, FoldersMoveIssue, FoldersMoveOutcome, FoldersMovePlan, FoldersMovePlanResult, FoldersPlacement, FoldersProjectInput, FoldersProjectView, FoldersRemoval, FoldersRemovalIssue, FoldersRemovalOutcome, FoldersRemovalPlanResult, FoldersStoredDocument, FoldersTemplateInput, FoldersTemplateView, FoldersView, FoldersViolation, HashedJson, InitialBlockSettings, InstanceStats, InstanceStatsCapacity, InstanceStatsStatus, LocalDevFolder, ManifestFileInfo, index_d_exports as PFrameInternal, ProjectListEntry, ProjectMeta, ProjectOverview, RegistryEntry, RegistryList, RegistrySpec, RegistryStatus, RemoteRegistryV1Spec, RemoteRegistryV2Spec, SemVer, Sha256Schema, SingleBlockPackOverview, StableChannel, StorageDebugView, UnreadableBlockStatusSummary, UnsupportedBlockStatusSummary, UnsupportedInstanceStats, UpdateSuggestion, UpdateSuggestions, VersionLock, VersionWithChannels, Workflow, WorkflowSchemaV1, WorkflowV1, addPrefixToRelative, applyFoldersMove, applyFoldersRemoval, asFolderId, blockPackIdEquals, blockPackIdNoVersionEquals, blockPackIdNoVersionToString, blockPackIdToString, blockPackOverviewToLegacy, blockStatusStates, blockStatusStatesRecord, commitFoldersMove, commitFoldersRemoval, decodeFoldersDocument, decodeStoredFoldersDocument, emptyFoldersDocument, encodeFoldersDocument, foldersChildren, foldersDocumentFromView, foldersMovePlansEqual, foldersNameBlank, foldersNameTaken, foldersRemovalsEqual, foldersSiblingNames, foldersSubtree, foldersUniqueName, foldersViewFromDocument, formatFoldersViolation, hashJson, healFolders, inheritedFolder, isTerminalBlockStatusState, mapRemoteToAbsolute, normalizeDescription, normalizeProjectMeta, overrideDescriptionVersion, overrideManifestVersion, planFoldersMove, planFoldersRemoval, readJson, readJsonSync, validateFoldersDocument };
39
+ export { AnyChannel, type AuthorMarker, BlockCalculationStatus, BlockComponents, BlockComponentsDescriptionRaw, BlockComponentsManifest, BlockKindRef, BlockPackDescription, BlockPackDescriptionFromPackageJsonRaw, BlockPackDescriptionManifest, BlockPackDescriptionRaw, BlockPackDevV1, BlockPackDevV2, BlockPackFromPackV2, BlockPackFromRegistryV1, BlockPackFromRegistryV2, BlockPackId, BlockPackIdNoVersion, BlockPackListing, BlockPackManifest, BlockPackManifestFile, BlockPackMeta, BlockPackMetaDescriptionRaw, BlockPackMetaEmbeddedBase64, BlockPackMetaEmbeddedBytes, BlockPackMetaManifest, BlockPackOverview, BlockPackOverviewLegacy, BlockPackOverviewNoRegistryId, BlockPackOverviewRaw, BlockPackSpec, BlockPlatform, BlockSettings, BlockStateInternal, BlockStateInternalV3, BlockStateOverview, BlockStatusAvailability, BlockStatusJobGroup, BlockStatusJobs, BlockStatusState, BlockStatusSummary, BlockStatusTree, BlockStatusTreeBranch, BlockStatusTreeHeaviest, BlockStatusTreeHeaviestCount, BlockStatusTreeNode, BlockStatusTreeReading, BlockStatusTreeTransition, Content, ContentAbsoluteBinaryLocal, ContentAbsoluteFile, ContentAbsoluteFolder, ContentAbsoluteTextLocal, ContentAbsoluteUrl, ContentAnyBinaryLocal, ContentAnyLocal, ContentAnyTextLocal, ContentExplicitBase64, ContentExplicitBytes, ContentExplicitOrRelative, ContentExplicitString, ContentRelative, ContentRelativeBinary, ContentRelativeText, ContentType, ContextType, CreateBlockPackDescriptionSchema, DescriptionContentBinary, DescriptionContentText, EmptyBlockStatusJobs, EmptyBlockStatusSummary, FOLDERS_SCHEMA_VERSION, FeatureFlags, FolderEntry, FolderId, FolderView, FoldersDecoded, FoldersDocument, FoldersDocumentProblem, FoldersEdit, FoldersItem, FoldersItemInput, FoldersItemView, FoldersLabelRename, FoldersLeafItem, FoldersMoveApplication, FoldersMoveEntry, FoldersMoveIssue, FoldersMoveOutcome, FoldersMovePlan, FoldersMovePlanResult, FoldersPlacement, FoldersProjectInput, FoldersProjectView, FoldersRemoval, FoldersRemovalIssue, FoldersRemovalOutcome, FoldersRemovalPlanResult, FoldersStoredDocument, FoldersTemplateInput, FoldersTemplateView, FoldersView, FoldersViolation, HashedJson, InitialBlockSettings, InstanceStats, InstanceStatsCapacity, InstanceStatsStatus, LocalDevFolder, ManifestFileInfo, index_d_exports as PFrameInternal, ProjectListEntry, ProjectMeta, ProjectOverview, RegistryEntry, RegistryList, RegistrySpec, RegistryStatus, RemoteRegistryV1Spec, RemoteRegistryV2Spec, SemVer, Sha256Schema, SingleBlockPackOverview, StableChannel, StorageDebugView, UnreadableBlockStatusSummary, UnsupportedBlockStatusSummary, UnsupportedInstanceStats, UpdateSuggestion, UpdateSuggestions, VersionLock, VersionWithChannels, Workflow, WorkflowSchemaV1, WorkflowV1, addPrefixToRelative, applyFoldersMove, applyFoldersRemoval, asFolderId, blockPackIdEquals, blockPackIdNoVersionEquals, blockPackIdNoVersionToString, blockPackIdToString, blockPackOverviewToLegacy, blockStatusStates, blockStatusStatesRecord, commitFoldersMove, commitFoldersRemoval, decodeFoldersDocument, decodeStoredFoldersDocument, emptyFoldersDocument, encodeFoldersDocument, foldersChildren, foldersDocumentFromView, foldersMovePlansEqual, foldersNameBlank, foldersNameTaken, foldersRemovalsEqual, foldersSiblingNames, foldersSubtree, foldersUniqueName, foldersViewFromDocument, formatFoldersViolation, hashJson, healFolders, inheritedFolder, isTerminalBlockStatusState, mapRemoteToAbsolute, normalizeDescription, normalizeProjectMeta, overrideDescriptionVersion, overrideManifestVersion, planFoldersMove, planFoldersRemoval, readJson, readJsonSync, validateFoldersDocument };
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { InitialBlockSettings } from "./block_settings.js";
2
2
  import { UnsupportedInstanceStats } from "./instance_stats.js";
3
3
  import { EmptyBlockStatusJobs, EmptyBlockStatusSummary, UnreadableBlockStatusSummary, UnsupportedBlockStatusSummary, blockStatusStates, blockStatusStatesRecord, isTerminalBlockStatusState } from "./block_status.js";
4
+ import { BlockStatusTreeHeaviestCount } from "./block_status_tree.js";
4
5
  import { normalizeDescription, normalizeProjectMeta } from "./project.js";
5
6
  import { FOLDERS_SCHEMA_VERSION, FolderEntry, FoldersDocument, asFolderId, emptyFoldersDocument } from "./folders/document.js";
6
7
  import { decodeFoldersDocument, decodeStoredFoldersDocument, encodeFoldersDocument } from "./folders/decode.js";
@@ -27,4 +28,4 @@ import { AnyChannel, BlockPackListing, BlockPackOverview, BlockPackOverviewLegac
27
28
  import "./block_registry/index.js";
28
29
  import { internal_api_exports } from "./pframe/internal_api/index.js";
29
30
  import { hashJson, readJson, readJsonSync } from "./json.js";
30
- export { AnyChannel, BlockComponentsDescriptionRaw, BlockComponentsManifest, BlockKindRef, BlockPackDescriptionFromPackageJsonRaw, BlockPackDescriptionManifest, BlockPackDescriptionRaw, BlockPackDevV1, BlockPackDevV2, BlockPackFromPackV2, BlockPackFromRegistryV1, BlockPackFromRegistryV2, BlockPackId, BlockPackIdNoVersion, BlockPackListing, BlockPackManifest, BlockPackManifestFile, BlockPackMeta, BlockPackMetaDescriptionRaw, BlockPackMetaEmbeddedBase64, BlockPackMetaEmbeddedBytes, BlockPackMetaManifest, BlockPackOverview, BlockPackOverviewLegacy, BlockPackOverviewNoRegistryId, BlockPackOverviewRaw, BlockPackSpec, BlockPlatform, ContentExplicitBase64, ContentExplicitBytes, ContentRelative, ContentRelativeBinary, ContentRelativeText, CreateBlockPackDescriptionSchema, DescriptionContentBinary, DescriptionContentText, EmptyBlockStatusJobs, EmptyBlockStatusSummary, FOLDERS_SCHEMA_VERSION, FeatureFlags, FolderEntry, FoldersDocument, InitialBlockSettings, LocalDevFolder, ManifestFileInfo, internal_api_exports as PFrameInternal, RegistryEntry, RegistryList, RegistrySpec, RegistryStatus, RemoteRegistryV1Spec, RemoteRegistryV2Spec, SemVer, Sha256Schema, SingleBlockPackOverview, StableChannel, UnreadableBlockStatusSummary, UnsupportedBlockStatusSummary, UnsupportedInstanceStats, VersionWithChannels, WorkflowSchemaV1, addPrefixToRelative, applyFoldersMove, applyFoldersRemoval, asFolderId, blockPackIdEquals, blockPackIdNoVersionEquals, blockPackIdNoVersionToString, blockPackIdToString, blockPackOverviewToLegacy, blockStatusStates, blockStatusStatesRecord, commitFoldersMove, commitFoldersRemoval, decodeFoldersDocument, decodeStoredFoldersDocument, emptyFoldersDocument, encodeFoldersDocument, foldersChildren, foldersDocumentFromView, foldersMovePlansEqual, foldersNameBlank, foldersNameTaken, foldersRemovalsEqual, foldersSiblingNames, foldersSubtree, foldersUniqueName, foldersViewFromDocument, formatFoldersViolation, hashJson, healFolders, inheritedFolder, isTerminalBlockStatusState, mapRemoteToAbsolute, normalizeDescription, normalizeProjectMeta, overrideDescriptionVersion, overrideManifestVersion, planFoldersMove, planFoldersRemoval, readJson, readJsonSync, validateFoldersDocument };
31
+ export { AnyChannel, BlockComponentsDescriptionRaw, BlockComponentsManifest, BlockKindRef, BlockPackDescriptionFromPackageJsonRaw, BlockPackDescriptionManifest, BlockPackDescriptionRaw, BlockPackDevV1, BlockPackDevV2, BlockPackFromPackV2, BlockPackFromRegistryV1, BlockPackFromRegistryV2, BlockPackId, BlockPackIdNoVersion, BlockPackListing, BlockPackManifest, BlockPackManifestFile, BlockPackMeta, BlockPackMetaDescriptionRaw, BlockPackMetaEmbeddedBase64, BlockPackMetaEmbeddedBytes, BlockPackMetaManifest, BlockPackOverview, BlockPackOverviewLegacy, BlockPackOverviewNoRegistryId, BlockPackOverviewRaw, BlockPackSpec, BlockPlatform, BlockStatusTreeHeaviestCount, ContentExplicitBase64, ContentExplicitBytes, ContentRelative, ContentRelativeBinary, ContentRelativeText, CreateBlockPackDescriptionSchema, DescriptionContentBinary, DescriptionContentText, EmptyBlockStatusJobs, EmptyBlockStatusSummary, FOLDERS_SCHEMA_VERSION, FeatureFlags, FolderEntry, FoldersDocument, InitialBlockSettings, LocalDevFolder, ManifestFileInfo, internal_api_exports as PFrameInternal, RegistryEntry, RegistryList, RegistrySpec, RegistryStatus, RemoteRegistryV1Spec, RemoteRegistryV2Spec, SemVer, Sha256Schema, SingleBlockPackOverview, StableChannel, UnreadableBlockStatusSummary, UnsupportedBlockStatusSummary, UnsupportedInstanceStats, VersionWithChannels, WorkflowSchemaV1, addPrefixToRelative, applyFoldersMove, applyFoldersRemoval, asFolderId, blockPackIdEquals, blockPackIdNoVersionEquals, blockPackIdNoVersionToString, blockPackIdToString, blockPackOverviewToLegacy, blockStatusStates, blockStatusStatesRecord, commitFoldersMove, commitFoldersRemoval, decodeFoldersDocument, decodeStoredFoldersDocument, emptyFoldersDocument, encodeFoldersDocument, foldersChildren, foldersDocumentFromView, foldersMovePlansEqual, foldersNameBlank, foldersNameTaken, foldersRemovalsEqual, foldersSiblingNames, foldersSubtree, foldersUniqueName, foldersViewFromDocument, formatFoldersViolation, hashJson, healFolders, inheritedFolder, isTerminalBlockStatusState, mapRemoteToAbsolute, normalizeDescription, normalizeProjectMeta, overrideDescriptionVersion, overrideManifestVersion, planFoldersMove, planFoldersRemoval, readJson, readJsonSync, validateFoldersDocument };
@@ -1,5 +1,5 @@
1
1
  import { AxisQualification, ColumnAxesWithQualifications } from "./common.js";
2
- import { AxisValueType, ColumnValueType, DiscoverColumnsStepInfo, PColumnIdAndSpec } from "@milaboratories/pl-model-common";
2
+ import { AxisValueType, ColumnUniversalId, ColumnValueType, DiscoverColumnsStepInfo, PColumnIdAndSpec } from "@milaboratories/pl-model-common";
3
3
  /** Matches a string value either exactly or by regex pattern */
4
4
  export type StringMatcher = {
5
5
  type: "exact";
@@ -98,5 +98,42 @@ export interface DiscoverColumnsResponse {
98
98
  /** Columns that could be integrated and possible ways to integrate them */
99
99
  hits: DiscoverColumnsResponseHit[];
100
100
  }
101
+ /**
102
+ * Request for discovering roots: the columns that, used as anchors, would
103
+ * reach the given ones. Where {@link DiscoverColumnsRequestV2} starts from
104
+ * anchors, this starts from columns already in the frame (the leaves).
105
+ */
106
+ export interface DiscoverRootsRequest {
107
+ /** Leaves: ids of frame columns to discover roots for (at least one) */
108
+ columns: ColumnUniversalId[];
109
+ /** Roots must match these selectors (OR-ed); empty or omitted matches all columns */
110
+ includeColumns?: MultiColumnSelector[];
111
+ /** Roots matching these selectors (OR-ed) are dropped; applied after include filter */
112
+ excludeColumns?: MultiColumnSelector[];
113
+ /** Maximum number of linker hops between a root and a leaf (0 = direct only) */
114
+ maxHops?: number;
115
+ /** Matching constraints, with the root as the source and the leaf as the hit */
116
+ constraints: DiscoverColumnsConstraints;
117
+ }
118
+ /**
119
+ * A root found for one leaf. `path` and `mappingVariants` are exactly what
120
+ * discover columns anchored on `root` reports for `leaf`: the path runs from
121
+ * the root to the leaf, `forQueries` qualifies the root and `forHit` the leaf.
122
+ */
123
+ export interface DiscoverRootsResponseHit {
124
+ /** The discovered root column */
125
+ root: PColumnIdAndSpec;
126
+ /** The requested column this root reaches */
127
+ leaf: ColumnUniversalId;
128
+ /** Possible ways to join the leaf onto the root */
129
+ mappingVariants: DiscoverColumnsMappingVariant[];
130
+ /** Linker steps from the root to the leaf; empty when they join directly */
131
+ path: DiscoverColumnsStepInfo[];
132
+ }
133
+ /** Response from discover roots. */
134
+ export interface DiscoverRootsResponse {
135
+ /** One entry per (root, leaf, path) */
136
+ hits: DiscoverRootsResponseHit[];
137
+ }
101
138
  export type { DiscoverColumnsStepInfo };
102
139
  //# sourceMappingURL=discover_columns.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"discover_columns.d.ts","names":[],"sources":["../../../src/pframe/internal_api/discover_columns.ts"],"mappings":";;;YAWY;EAAkB;EAAe;;EAAoB;EAAe;;;YAGpE,aAAa,eAAe;;iBAGvB;;WAEN,OAAO;;WAEP,OAAO;;WAEP,SAAS;;WAET,gBAAgB;;WAEhB,cAAc;;;;iBAKR;;WAEN,OAAO;;WAEP,OAAO;;WAEP,SAAS;;WAET,gBAAgB;;WAEhB,cAAc;;WAEd,OAAO;;WAEP;;;iBAIM;;EAEf;;EAEA;;EAEA;;EAEA;;;iBAIe;;EAEf,iBAAiB;;EAEjB,iBAAiB;;EAEjB,MAAM;;EAEN;;EAEA,aAAa;;;iBAIE;;EAEf,YAAY;;EAEZ,QAAQ;;;iBAIO;;EAEf,gBAAgB;;EAEhB,2BAA2B;;;;;;;;iBASZ;;EAEf,KAAK;;EAEL,iBAAiB;;EAEjB,MAAM;;;iBAIS;;EAEf,MAAM"}
1
+ {"version":3,"file":"discover_columns.d.ts","names":[],"sources":["../../../src/pframe/internal_api/discover_columns.ts"],"mappings":";;;YAYY;EAAkB;EAAe;;EAAoB;EAAe;;;YAGpE,aAAa,eAAe;;iBAGvB;;WAEN,OAAO;;WAEP,OAAO;;WAEP,SAAS;;WAET,gBAAgB;;WAEhB,cAAc;;;;iBAKR;;WAEN,OAAO;;WAEP,OAAO;;WAEP,SAAS;;WAET,gBAAgB;;WAEhB,cAAc;;WAEd,OAAO;;WAEP;;;iBAIM;;EAEf;;EAEA;;EAEA;;EAEA;;;iBAIe;;EAEf,iBAAiB;;EAEjB,iBAAiB;;EAEjB,MAAM;;EAEN;;EAEA,aAAa;;;iBAIE;;EAEf,YAAY;;EAEZ,QAAQ;;;iBAIO;;EAEf,gBAAgB;;EAEhB,2BAA2B;;;;;;;;iBASZ;;EAEf,KAAK;;EAEL,iBAAiB;;EAEjB,MAAM;;;iBAIS;;EAEf,MAAM;;;;;;;iBAQS;;EAEf,SAAS;;EAET,iBAAiB;;EAEjB,iBAAiB;;EAEjB;;EAEA,aAAa;;;;;;;iBAQE;;EAEf,MAAM;;EAEN,MAAM;;EAEN,iBAAiB;;EAEjB,MAAM;;;iBAIS;;EAEf,MAAM"}
@@ -5,12 +5,12 @@ import { BaseObjectStore, CacheConfig, CacheCounters, CacheMetrics, CachingObjec
5
5
  import { AddColumnEntryV2, DataInfo, DataInfoExtension, DataInfoV2, FilePath, PColumnValueTypeSpec, PFrameBlobId, PFrameDataSourceV2, PFrameFactoryAPIV6, SpecExtension } from "./api_factory.js";
6
6
  import { ArtificialColumnJoinEntry, ColumnJoinEntry, CreateTableRequestV4, FullJoinV4, InlineColumnJoinEntry, InnerJoinV4, JoinEntryV4, OuterJoinV4, SlicedColumnJoinEntry } from "./create_table.js";
7
7
  import { DeleteColumnFromColumnsRequest, DeleteColumnFromColumnsResponse } from "./delete_column.js";
8
- import { DiscoverColumnsConstraints, DiscoverColumnsMappingVariant, DiscoverColumnsRequestV2, DiscoverColumnsResponse, DiscoverColumnsResponseHit, DiscoverColumnsResponseQualifications, DiscoverColumnsStepInfo, MatcherMap, MultiAxisSelector, MultiColumnSelector, StringMatcher } from "./discover_columns.js";
8
+ import { DiscoverColumnsConstraints, DiscoverColumnsMappingVariant, DiscoverColumnsRequestV2, DiscoverColumnsResponse, DiscoverColumnsResponseHit, DiscoverColumnsResponseQualifications, DiscoverColumnsStepInfo, DiscoverRootsRequest, DiscoverRootsResponse, DiscoverRootsResponseHit, MatcherMap, MultiAxisSelector, MultiColumnSelector, StringMatcher } from "./discover_columns.js";
9
9
  import { FindColumnResponseQualifications, FindColumnsMappingVariant, FindColumnsRequest, FindColumnsResponse, FindColumnsResponseHit } from "./find_columns.js";
10
10
  import { PFrameFactoryV9, PFrameOptionsV2, PFrameV18 } from "./pframe.js";
11
11
  import { SingleAxisSelector as SingleAxisSelector$1 } from "@milaboratories/pl-model-common";
12
12
  declare namespace index_d_exports {
13
- export { AddColumnEntryV2, ArtificialColumnJoinEntry, AxisQualification, BaseObjectStore, CacheConfig, CacheCounters, CacheMetrics, CachingObjectStore, CachingObjectStoreOptions, ColumnAxesWithQualifications, ColumnJoinEntry, ConstantAxisFilter, CreateTableRequestV4, DataInfo, DataInfoExtension, DataInfoV2, DeleteColumnFromColumnsRequest, DeleteColumnFromColumnsResponse, DiscoverColumnsConstraints, DiscoverColumnsMappingVariant, DiscoverColumnsRequestV2, DiscoverColumnsResponse, DiscoverColumnsResponseHit, DiscoverColumnsResponseQualifications, DiscoverColumnsStepInfo, FilePath, FileRange, FindColumnResponseQualifications, FindColumnsMappingVariant, FindColumnsRequest, FindColumnsResponse, FindColumnsResponseHit, FsStoreOptions, FullJoinV4, HttpAuthorizationToken, HttpHelpers, HttpMethod, HttpRange, HttpServer, HttpServerInfo, HttpServerOptions, InlineColumnJoinEntry, InnerJoinV4, JoinEntryV4, Logger, MatcherMap, MultiAxisSelector, MultiColumnSelector, ObjectStore, ObjectStoreOptions, ObjectStoreResponse, ObjectStoreUrl, OuterJoinV4, PColumnValueTypeSpec, PFrameBlobId, PFrameDataSourceV2, PFrameFactoryAPIV6, PFrameFactoryV9, PFrameId, PFrameOptionsV2, PFrameReadAPIV15, PFrameV18, PTableId, PTableV12, ParquetExtension, ParquetFileName, PemCertificate, RequestHandlerOptions, SingleAxisSelector$1 as SingleAxisSelector, SlicedColumnJoinEntry, SpecExtension, StringMatcher, UniqueValuesRequestV2 };
13
+ export { AddColumnEntryV2, ArtificialColumnJoinEntry, AxisQualification, BaseObjectStore, CacheConfig, CacheCounters, CacheMetrics, CachingObjectStore, CachingObjectStoreOptions, ColumnAxesWithQualifications, ColumnJoinEntry, ConstantAxisFilter, CreateTableRequestV4, DataInfo, DataInfoExtension, DataInfoV2, DeleteColumnFromColumnsRequest, DeleteColumnFromColumnsResponse, DiscoverColumnsConstraints, DiscoverColumnsMappingVariant, DiscoverColumnsRequestV2, DiscoverColumnsResponse, DiscoverColumnsResponseHit, DiscoverColumnsResponseQualifications, DiscoverColumnsStepInfo, DiscoverRootsRequest, DiscoverRootsResponse, DiscoverRootsResponseHit, FilePath, FileRange, FindColumnResponseQualifications, FindColumnsMappingVariant, FindColumnsRequest, FindColumnsResponse, FindColumnsResponseHit, FsStoreOptions, FullJoinV4, HttpAuthorizationToken, HttpHelpers, HttpMethod, HttpRange, HttpServer, HttpServerInfo, HttpServerOptions, InlineColumnJoinEntry, InnerJoinV4, JoinEntryV4, Logger, MatcherMap, MultiAxisSelector, MultiColumnSelector, ObjectStore, ObjectStoreOptions, ObjectStoreResponse, ObjectStoreUrl, OuterJoinV4, PColumnValueTypeSpec, PFrameBlobId, PFrameDataSourceV2, PFrameFactoryAPIV6, PFrameFactoryV9, PFrameId, PFrameOptionsV2, PFrameReadAPIV15, PFrameV18, PTableId, PTableV12, ParquetExtension, ParquetFileName, PemCertificate, RequestHandlerOptions, SingleAxisSelector$1 as SingleAxisSelector, SlicedColumnJoinEntry, SpecExtension, StringMatcher, UniqueValuesRequestV2 };
14
14
  }
15
- export { AddColumnEntryV2, ArtificialColumnJoinEntry, AxisQualification, BaseObjectStore, CacheConfig, CacheCounters, CacheMetrics, CachingObjectStore, CachingObjectStoreOptions, ColumnAxesWithQualifications, ColumnJoinEntry, ConstantAxisFilter, CreateTableRequestV4, DataInfo, DataInfoExtension, DataInfoV2, DeleteColumnFromColumnsRequest, DeleteColumnFromColumnsResponse, DiscoverColumnsConstraints, DiscoverColumnsMappingVariant, DiscoverColumnsRequestV2, DiscoverColumnsResponse, DiscoverColumnsResponseHit, DiscoverColumnsResponseQualifications, type DiscoverColumnsStepInfo, FilePath, FileRange, FindColumnResponseQualifications, FindColumnsMappingVariant, FindColumnsRequest, FindColumnsResponse, FindColumnsResponseHit, FsStoreOptions, FullJoinV4, HttpAuthorizationToken, HttpHelpers, HttpMethod, HttpRange, HttpServer, HttpServerInfo, HttpServerOptions, InlineColumnJoinEntry, InnerJoinV4, JoinEntryV4, Logger, MatcherMap, MultiAxisSelector, MultiColumnSelector, ObjectStore, ObjectStoreOptions, ObjectStoreResponse, ObjectStoreUrl, OuterJoinV4, PColumnValueTypeSpec, PFrameBlobId, PFrameDataSourceV2, PFrameFactoryAPIV6, PFrameFactoryV9, PFrameId, PFrameOptionsV2, PFrameReadAPIV15, PFrameV18, PTableId, PTableV12, ParquetExtension, ParquetFileName, PemCertificate, RequestHandlerOptions, type SingleAxisSelector$1 as SingleAxisSelector, SlicedColumnJoinEntry, SpecExtension, StringMatcher, UniqueValuesRequestV2, index_d_exports };
15
+ export { AddColumnEntryV2, ArtificialColumnJoinEntry, AxisQualification, BaseObjectStore, CacheConfig, CacheCounters, CacheMetrics, CachingObjectStore, CachingObjectStoreOptions, ColumnAxesWithQualifications, ColumnJoinEntry, ConstantAxisFilter, CreateTableRequestV4, DataInfo, DataInfoExtension, DataInfoV2, DeleteColumnFromColumnsRequest, DeleteColumnFromColumnsResponse, DiscoverColumnsConstraints, DiscoverColumnsMappingVariant, DiscoverColumnsRequestV2, DiscoverColumnsResponse, DiscoverColumnsResponseHit, DiscoverColumnsResponseQualifications, type DiscoverColumnsStepInfo, DiscoverRootsRequest, DiscoverRootsResponse, DiscoverRootsResponseHit, FilePath, FileRange, FindColumnResponseQualifications, FindColumnsMappingVariant, FindColumnsRequest, FindColumnsResponse, FindColumnsResponseHit, FsStoreOptions, FullJoinV4, HttpAuthorizationToken, HttpHelpers, HttpMethod, HttpRange, HttpServer, HttpServerInfo, HttpServerOptions, InlineColumnJoinEntry, InnerJoinV4, JoinEntryV4, Logger, MatcherMap, MultiAxisSelector, MultiColumnSelector, ObjectStore, ObjectStoreOptions, ObjectStoreResponse, ObjectStoreUrl, OuterJoinV4, PColumnValueTypeSpec, PFrameBlobId, PFrameDataSourceV2, PFrameFactoryAPIV6, PFrameFactoryV9, PFrameId, PFrameOptionsV2, PFrameReadAPIV15, PFrameV18, PTableId, PTableV12, ParquetExtension, ParquetFileName, PemCertificate, RequestHandlerOptions, type SingleAxisSelector$1 as SingleAxisSelector, SlicedColumnJoinEntry, SpecExtension, StringMatcher, UniqueValuesRequestV2, index_d_exports };
16
16
  //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@milaboratories/pl-model-middle-layer",
3
- "version": "1.38.0",
3
+ "version": "1.40.0",
4
4
  "description": "Common model between middle layer and non-block UI code",
5
5
  "files": [
6
6
  "./dist/**/*",
@@ -18,14 +18,14 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@milaboratories/helpers": "1.14.7",
21
- "@milaboratories/pl-model-common": "1.55.2",
21
+ "@milaboratories/pl-model-common": "1.56.0",
22
22
  "es-toolkit": "^1.39.10",
23
23
  "utility-types": "^3.11.0",
24
24
  "zod": "~3.25.76"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@milaboratories/build-configs": "2.0.3",
28
- "@milaboratories/ts-builder": "1.7.4",
28
+ "@milaboratories/ts-builder": "1.8.0",
29
29
  "@milaboratories/ts-configs": "1.4.1",
30
30
  "@types/node": "~24.19.2",
31
31
  "@vitest/coverage-istanbul": "^4.1.12",
@@ -0,0 +1,117 @@
1
+ /**
2
+ * A block run's action-context tree, node by node, as the middle layer hands it to the Desktop App.
3
+ *
4
+ * A run can make thousands of contexts, so this is never the whole tree: the root and its top-level
5
+ * contexts are always present, and a context's children are present only while the reader has
6
+ * expanded it.
7
+ *
8
+ * Source: docs/text/work/projects/sdk/block-status/README_teo.md, "Developer debug panel", which
9
+ * is what the Desktop App shows it in.
10
+ */
11
+
12
+ import type { BlockStatusSummary } from "./block_status";
13
+
14
+ /** One transition: `transition/<namespace>/<reporter>/<ns>`. */
15
+ export type BlockStatusTreeTransition = {
16
+ /** `render`, `exec`, `workdir`, ... */
17
+ readonly namespace: string;
18
+ /** The resource that reported: the render itself, or a command or work dir it created. */
19
+ readonly reporter: string;
20
+ /** As written by the reporter. Can be a state this build does not know. */
21
+ readonly state: string;
22
+ readonly detail?: string;
23
+ readonly reason?: string;
24
+ /** ms since the epoch, on the reporter's clock. */
25
+ readonly at: number;
26
+ };
27
+
28
+ /** One reading of a node: `reading/<namespace>/<resource>/<key>`. */
29
+ export type BlockStatusTreeReading = {
30
+ /** The namespace the reading was written under, e.g. `workdir`. */
31
+ readonly namespace: string;
32
+ /** The resource that wrote it. */
33
+ readonly resource: string;
34
+ readonly key: string;
35
+ /** Opaque text; the reporter owns the format. */
36
+ readonly value: string;
37
+ };
38
+
39
+ /** One action context of the run. */
40
+ export type BlockStatusTreeNode = {
41
+ /** Global id of the context, the handle for expanding it. */
42
+ readonly contextId: string;
43
+ /** The context's `name` baggage, falling back to the context id. */
44
+ readonly name: string;
45
+ /**
46
+ * What the node is: `command` when a command reported into it, `workdir` when only a work dir
47
+ * did, else `render`.
48
+ */
49
+ readonly kind: "render" | "command" | "workdir";
50
+ /** The rest of the baggage: `block-pack`, `block-id`, `run-id`, ... */
51
+ readonly baggage: Readonly<Record<string, string>>;
52
+ /** The state holding the node as its reporter wrote it, undefined once it has ended or before it
53
+ * reports. */
54
+ readonly state?: string;
55
+ /** True for `Running` reported by a command executing on a machine. */
56
+ readonly onMachine: boolean;
57
+ /** When the node entered {@link state}, ms since the epoch. */
58
+ readonly enteredAt?: number;
59
+ /** True once the node's render has ended and every reporter in it has too. */
60
+ readonly ended: boolean;
61
+ /** The engine's reason, set when the render terminated. */
62
+ readonly failure?: string;
63
+ /** Every transition of every reporter, oldest first, whatever its state. */
64
+ readonly transitions: readonly BlockStatusTreeTransition[];
65
+ /** Readings, sorted by namespace, then resource, then key. */
66
+ readonly readings: readonly BlockStatusTreeReading[];
67
+ /** Direct children, whether or not they are present below. */
68
+ readonly childCount: number;
69
+ /** This node and everything under it. */
70
+ readonly subtreeContexts: number;
71
+ /** Contexts in this subtree that have not ended. */
72
+ readonly subtreeActiveContexts: number;
73
+ /**
74
+ * Time commands in this subtree spent running on a machine, ms. A command still running counts
75
+ * up to the latest report anywhere in the run.
76
+ */
77
+ readonly subtreeComputeMs: number;
78
+ /** The children, present only while the node is expanded. The root's are always present. */
79
+ readonly children?: readonly BlockStatusTreeNode[];
80
+ };
81
+
82
+ /** A branch of the run, one of the root's top-level contexts with everything under it. */
83
+ export type BlockStatusTreeBranch = {
84
+ readonly contextId: string;
85
+ readonly name: string;
86
+ readonly value: number;
87
+ };
88
+
89
+ /** The heaviest branches of the run, each list largest first. */
90
+ export type BlockStatusTreeHeaviest = {
91
+ /** By {@link BlockStatusTreeNode.subtreeComputeMs}. */
92
+ readonly byCompute: readonly BlockStatusTreeBranch[];
93
+ /** By {@link BlockStatusTreeNode.subtreeContexts}. */
94
+ readonly byContexts: readonly BlockStatusTreeBranch[];
95
+ /**
96
+ * By bytes of output. Undefined while no reporter writes file sizes, which is distinct from a run
97
+ * that wrote nothing.
98
+ */
99
+ readonly byFileSize?: readonly BlockStatusTreeBranch[];
100
+ };
101
+
102
+ /** How many branches each heaviest list carries. */
103
+ export const BlockStatusTreeHeaviestCount = 5;
104
+
105
+ /** The tree of one block run. */
106
+ export type BlockStatusTree = {
107
+ /** The run's summary, the same one `watchBlockStatus` gives. */
108
+ readonly summary: BlockStatusSummary;
109
+ readonly heaviest: BlockStatusTreeHeaviest;
110
+ /** The root context, undefined while the block has none. */
111
+ readonly root?: BlockStatusTreeNode;
112
+ /**
113
+ * The context ids from the root down to the render that terminated first, so a reader can open
114
+ * the tree to it. Undefined while no render has terminated.
115
+ */
116
+ readonly firstFailurePath?: readonly string[];
117
+ };
package/src/index.ts CHANGED
@@ -3,6 +3,7 @@ export * from "./block_settings";
3
3
  export * from "./block_state";
4
4
  export * from "./instance_stats";
5
5
  export * from "./block_status";
6
+ export * from "./block_status_tree";
6
7
  export * from "./project";
7
8
  export * from "./project_list";
8
9
  export * from "./project_overview";
@@ -1,5 +1,6 @@
1
1
  import type {
2
2
  AxisValueType,
3
+ ColumnUniversalId,
3
4
  ColumnValueType,
4
5
  DiscoverColumnsStepInfo,
5
6
  PColumnIdAndSpec,
@@ -109,3 +110,43 @@ export interface DiscoverColumnsResponse {
109
110
  /** Columns that could be integrated and possible ways to integrate them */
110
111
  hits: DiscoverColumnsResponseHit[];
111
112
  }
113
+
114
+ /**
115
+ * Request for discovering roots: the columns that, used as anchors, would
116
+ * reach the given ones. Where {@link DiscoverColumnsRequestV2} starts from
117
+ * anchors, this starts from columns already in the frame (the leaves).
118
+ */
119
+ export interface DiscoverRootsRequest {
120
+ /** Leaves: ids of frame columns to discover roots for (at least one) */
121
+ columns: ColumnUniversalId[];
122
+ /** Roots must match these selectors (OR-ed); empty or omitted matches all columns */
123
+ includeColumns?: MultiColumnSelector[];
124
+ /** Roots matching these selectors (OR-ed) are dropped; applied after include filter */
125
+ excludeColumns?: MultiColumnSelector[];
126
+ /** Maximum number of linker hops between a root and a leaf (0 = direct only) */
127
+ maxHops?: number;
128
+ /** Matching constraints, with the root as the source and the leaf as the hit */
129
+ constraints: DiscoverColumnsConstraints;
130
+ }
131
+
132
+ /**
133
+ * A root found for one leaf. `path` and `mappingVariants` are exactly what
134
+ * discover columns anchored on `root` reports for `leaf`: the path runs from
135
+ * the root to the leaf, `forQueries` qualifies the root and `forHit` the leaf.
136
+ */
137
+ export interface DiscoverRootsResponseHit {
138
+ /** The discovered root column */
139
+ root: PColumnIdAndSpec;
140
+ /** The requested column this root reaches */
141
+ leaf: ColumnUniversalId;
142
+ /** Possible ways to join the leaf onto the root */
143
+ mappingVariants: DiscoverColumnsMappingVariant[];
144
+ /** Linker steps from the root to the leaf; empty when they join directly */
145
+ path: DiscoverColumnsStepInfo[];
146
+ }
147
+
148
+ /** Response from discover roots. */
149
+ export interface DiscoverRootsResponse {
150
+ /** One entry per (root, leaf, path) */
151
+ hits: DiscoverRootsResponseHit[];
152
+ }