@loomcycle/explorer 0.4.0 → 0.6.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.
@@ -1,6 +1,6 @@
1
1
  import { type ReactNode } from "react";
2
2
  import type { LoomcycleClient } from "@loomcycle/client";
3
- import type { BrowseScope, ChunkDetail, ChunkRow, DocEdge, DocScope, PathEntry, PathScope } from "../types";
3
+ import type { Backlink, BrowseScope, CanvasDoc, ChunkDetail, ChunkRevision, ChunkRow, DocEdge, DocScope, PathEntry, PathScope, RelatedChunk, UnlinkedMention } from "../types";
4
4
  import type { DocSummary, DocumentMeta } from "./colorScheme";
5
5
  import type { AssetFetch } from "./createClient";
6
6
  export interface ChunkPatch {
@@ -9,6 +9,7 @@ export interface ChunkPatch {
9
9
  title?: string;
10
10
  status?: string;
11
11
  type?: string;
12
+ tags?: string[];
12
13
  }
13
14
  export interface ExplorerDataLayer {
14
15
  pathLs(path: string, scope: PathScope, recursive: boolean, browse?: BrowseScope): Promise<{
@@ -50,6 +51,35 @@ export interface ExplorerDataLayer {
50
51
  title: string;
51
52
  document_id: string;
52
53
  }>;
54
+ documentBacklinks(id: string, scope: DocScope, browse?: BrowseScope): Promise<{
55
+ backlinks: Backlink[];
56
+ }>;
57
+ documentRelated(id: string, scope: DocScope, browse?: BrowseScope, limit?: number): Promise<{
58
+ related: RelatedChunk[];
59
+ }>;
60
+ documentUnlinkedMentions(id: string, scope: DocScope, browse?: BrowseScope, limit?: number): Promise<{
61
+ unlinked_mentions: UnlinkedMention[];
62
+ truncated: boolean;
63
+ }>;
64
+ documentHistory(id: string, scope: DocScope, browse?: BrowseScope, limit?: number): Promise<{
65
+ chunk_id: string;
66
+ revisions: ChunkRevision[];
67
+ }>;
68
+ documentGetVersion(id: string, revision: number, scope: DocScope, browse?: BrowseScope): Promise<{
69
+ chunk_id: string;
70
+ revision: number;
71
+ body: string;
72
+ }>;
73
+ documentDiff(id: string, fromRevision: number, toRevision: number, scope: DocScope, browse?: BrowseScope): Promise<{
74
+ chunk_id: string;
75
+ from_revision: number;
76
+ to_revision: number;
77
+ diff: string;
78
+ }>;
79
+ documentExportCanvas(documentId: string, scope: DocScope, browse?: BrowseScope): Promise<{
80
+ canvas: CanvasDoc;
81
+ document_id: string;
82
+ }>;
53
83
  }
54
84
  export declare function dataLayerFromClient(client: LoomcycleClient, assetFetch?: AssetFetch): ExplorerDataLayer;
55
85
  export declare function ExplorerDataProvider({ value, children, }: {
package/dist/styles.css CHANGED
@@ -1032,6 +1032,177 @@
1032
1032
  font-size: var(--lc-text-xs);
1033
1033
  }
1034
1034
 
1035
+ /* ============================================================
1036
+ RFC BS — tag chips, connections panel, chunk history modal
1037
+ ============================================================ */
1038
+ /* Read-only tag chips in the selected-chunk meta row (edit lives in the chunk
1039
+ editor). Accent-tinted to distinguish them from the type/status badges. */
1040
+ .loomcycle-explorer .chunk-tag {
1041
+ font-size: var(--lc-text-xs);
1042
+ padding: 1px 6px;
1043
+ border-radius: 999px;
1044
+ background: var(--bg-soft);
1045
+ border: 1px solid var(--border);
1046
+ color: var(--accent);
1047
+ }
1048
+
1049
+ /* Connections panel (backlinks / related / unlinked mentions) — sits under the
1050
+ References panel, sharing the .doc-ref-* row/target styles for the endpoints. */
1051
+ .loomcycle-explorer .doc-conn {
1052
+ margin-top: 12px;
1053
+ padding-top: 10px;
1054
+ border-top: 1px solid var(--border);
1055
+ }
1056
+ .loomcycle-explorer .doc-conn-toggle {
1057
+ background: none;
1058
+ border: none;
1059
+ color: var(--fg-soft);
1060
+ cursor: pointer;
1061
+ padding: 2px 0;
1062
+ font: inherit;
1063
+ font-size: var(--lc-text-sm);
1064
+ }
1065
+ .loomcycle-explorer .doc-conn-toggle:hover {
1066
+ color: var(--accent);
1067
+ }
1068
+ .loomcycle-explorer .doc-conn-body {
1069
+ margin-top: 8px;
1070
+ display: flex;
1071
+ flex-direction: column;
1072
+ gap: 12px;
1073
+ }
1074
+ .loomcycle-explorer .doc-conn-group h5 {
1075
+ margin: 0 0 4px 0;
1076
+ font-size: var(--lc-text-xs);
1077
+ color: var(--fg-soft);
1078
+ text-transform: uppercase;
1079
+ letter-spacing: 0.04em;
1080
+ }
1081
+ .loomcycle-explorer .doc-conn-empty {
1082
+ color: var(--fg-soft);
1083
+ font-size: var(--lc-text-sm);
1084
+ margin: 0;
1085
+ }
1086
+ .loomcycle-explorer .doc-conn-list {
1087
+ list-style: none;
1088
+ margin: 0;
1089
+ padding: 0;
1090
+ display: flex;
1091
+ flex-direction: column;
1092
+ gap: 4px;
1093
+ }
1094
+ .loomcycle-explorer .doc-conn-row {
1095
+ display: flex;
1096
+ align-items: center;
1097
+ gap: 8px;
1098
+ font-size: var(--lc-text-sm);
1099
+ }
1100
+ .loomcycle-explorer .doc-conn-score {
1101
+ font-family: var(--mono);
1102
+ font-size: var(--lc-text-xs);
1103
+ color: var(--fg-muted);
1104
+ }
1105
+ .loomcycle-explorer .doc-conn-auto {
1106
+ font-size: var(--lc-text-xs);
1107
+ color: var(--fg-soft);
1108
+ border: 1px solid var(--border);
1109
+ border-radius: 3px;
1110
+ padding: 0 4px;
1111
+ }
1112
+ .loomcycle-explorer .doc-conn-more {
1113
+ list-style: none;
1114
+ color: var(--fg-muted);
1115
+ font-size: var(--lc-text-xs);
1116
+ font-style: italic;
1117
+ }
1118
+
1119
+ /* Chunk history modal — revisions list + version/diff output. */
1120
+ .loomcycle-explorer .modal.history-modal {
1121
+ max-width: 720px;
1122
+ width: 92vw;
1123
+ }
1124
+ .loomcycle-explorer .doc-hist-revs {
1125
+ display: flex;
1126
+ flex-direction: column;
1127
+ gap: 2px;
1128
+ max-height: 220px;
1129
+ overflow: auto;
1130
+ margin-bottom: 12px;
1131
+ }
1132
+ .loomcycle-explorer .doc-hist-rev {
1133
+ display: flex;
1134
+ align-items: baseline;
1135
+ gap: 10px;
1136
+ text-align: left;
1137
+ background: var(--bg-soft);
1138
+ border: 1px solid var(--border);
1139
+ border-radius: 4px;
1140
+ padding: 5px 8px;
1141
+ cursor: pointer;
1142
+ color: var(--fg);
1143
+ }
1144
+ .loomcycle-explorer .doc-hist-rev:hover {
1145
+ border-color: var(--accent);
1146
+ }
1147
+ .loomcycle-explorer .doc-hist-rev.active {
1148
+ border-color: var(--accent);
1149
+ background: var(--bg);
1150
+ }
1151
+ .loomcycle-explorer .doc-hist-rev-num {
1152
+ font-family: var(--mono);
1153
+ font-size: var(--lc-text-xs);
1154
+ color: var(--accent);
1155
+ }
1156
+ .loomcycle-explorer .doc-hist-rev-time {
1157
+ font-size: var(--lc-text-xs);
1158
+ color: var(--fg-soft);
1159
+ }
1160
+ .loomcycle-explorer .doc-hist-rev-actor {
1161
+ font-size: var(--lc-text-xs);
1162
+ color: var(--fg-muted);
1163
+ margin-left: auto;
1164
+ }
1165
+ .loomcycle-explorer .doc-hist-diffbar {
1166
+ display: flex;
1167
+ align-items: center;
1168
+ gap: 8px;
1169
+ flex-wrap: wrap;
1170
+ font-size: var(--lc-text-sm);
1171
+ color: var(--fg-soft);
1172
+ margin-bottom: 12px;
1173
+ }
1174
+ .loomcycle-explorer .doc-hist-diffbar button {
1175
+ padding: 4px 12px;
1176
+ border: 1px solid var(--border);
1177
+ background: var(--bg);
1178
+ color: var(--fg);
1179
+ border-radius: 4px;
1180
+ cursor: pointer;
1181
+ }
1182
+ .loomcycle-explorer .doc-hist-diffbar button:disabled {
1183
+ opacity: 0.5;
1184
+ cursor: not-allowed;
1185
+ }
1186
+ .loomcycle-explorer .doc-hist-output {
1187
+ max-height: 40vh;
1188
+ overflow: auto;
1189
+ }
1190
+ .loomcycle-explorer .doc-hist-version,
1191
+ .loomcycle-explorer .doc-hist-diff {
1192
+ margin: 0;
1193
+ white-space: pre-wrap;
1194
+ word-break: break-word;
1195
+ }
1196
+ .loomcycle-explorer .doc-hist-diff .diff-add {
1197
+ color: var(--accent);
1198
+ }
1199
+ .loomcycle-explorer .doc-hist-diff .diff-del {
1200
+ color: var(--failed);
1201
+ }
1202
+ .loomcycle-explorer .doc-hist-diff .diff-hunk {
1203
+ color: var(--fg-muted);
1204
+ }
1205
+
1035
1206
  /* ============================================================
1036
1207
  RFC BO — image & diagram chunks
1037
1208
  ============================================================ */
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export type PathScope = "agent" | "user" | "tenant";
2
- export type DocScope = "agent" | "user";
2
+ export type DocScope = "agent" | "user" | "tenant";
3
3
  export interface BrowseScope {
4
4
  scopeId?: string;
5
5
  tenant?: string;
@@ -23,6 +23,7 @@ export interface ChunkRow {
23
23
  export interface ChunkDetail extends ChunkRow {
24
24
  body: string;
25
25
  fields?: unknown;
26
+ tags?: string[];
26
27
  asset?: {
27
28
  media_type: string;
28
29
  size: number;
@@ -41,6 +42,36 @@ export interface DocEdge {
41
42
  to_status?: string;
42
43
  to_document_id?: string;
43
44
  }
45
+ export interface Backlink {
46
+ from_id: string;
47
+ kind: string;
48
+ auto: boolean;
49
+ from_title?: string;
50
+ from_type?: string;
51
+ from_status?: string;
52
+ from_document_id?: string;
53
+ }
54
+ export interface RelatedChunk {
55
+ chunk_id: string;
56
+ score: number;
57
+ title?: string;
58
+ type?: string;
59
+ document_id?: string;
60
+ }
61
+ export interface UnlinkedMention {
62
+ chunk_id: string;
63
+ title?: string;
64
+ document_id?: string;
65
+ }
66
+ export interface ChunkRevision {
67
+ revision: number;
68
+ created_at: number;
69
+ actor: string;
70
+ }
71
+ export interface CanvasDoc {
72
+ nodes: unknown[];
73
+ edges: unknown[];
74
+ }
44
75
  export interface Principal {
45
76
  subject: string;
46
77
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomcycle/explorer",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "type": "module",
5
5
  "description": "Embeddable React Path VFS + chunked-graph Document browser for the loomcycle agentic runtime (RFC AL / AK) — a themeable, standalone package: a dirent tree with folder/document CRUD and a chunk-tree Document viewer/editor.",
6
6
  "license": "Apache-2.0",