@loomcycle/explorer 0.3.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.
- package/dist/components/Connections.d.ts +9 -0
- package/dist/components/HistoryModal.d.ts +9 -0
- package/dist/index.cjs +10 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1430 -937
- package/dist/index.js.map +1 -1
- package/dist/lib/dataLayer.d.ts +34 -2
- package/dist/styles.css +180 -0
- package/dist/types.d.ts +32 -1
- package/package.json +1 -1
package/dist/lib/dataLayer.d.ts
CHANGED
|
@@ -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<{
|
|
@@ -36,7 +37,9 @@ export interface ExplorerDataLayer {
|
|
|
36
37
|
chunks: ChunkRow[];
|
|
37
38
|
}>;
|
|
38
39
|
documentGetChunk(id: string, scope: DocScope, browse?: BrowseScope): Promise<ChunkDetail>;
|
|
39
|
-
documentCreateChunk(documentId: string, parentId: string, patch: ChunkPatch, scope: DocScope, browse?: BrowseScope): Promise<ChunkDetail>;
|
|
40
|
+
documentCreateChunk(documentId: string, parentId: string, patch: ChunkPatch, scope: DocScope, browse?: BrowseScope, afterId?: string): Promise<ChunkDetail>;
|
|
41
|
+
documentReorderChunk(id: string, direction: "up" | "down", scope: DocScope, browse?: BrowseScope): Promise<unknown>;
|
|
42
|
+
documentDeleteChunk(id: string, scope: DocScope, browse?: BrowseScope): Promise<unknown>;
|
|
40
43
|
documentSetAsset(chunkId: string, mediaType: string, dataBase64: string, filename: string | undefined, scope: DocScope, browse?: BrowseScope): Promise<ChunkDetail>;
|
|
41
44
|
documentGetEdges(documentId: string, scope: DocScope, browse?: BrowseScope): Promise<{
|
|
42
45
|
edges: DocEdge[];
|
|
@@ -48,6 +51,35 @@ export interface ExplorerDataLayer {
|
|
|
48
51
|
title: string;
|
|
49
52
|
document_id: string;
|
|
50
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
|
+
}>;
|
|
51
83
|
}
|
|
52
84
|
export declare function dataLayerFromClient(client: LoomcycleClient, assetFetch?: AssetFetch): ExplorerDataLayer;
|
|
53
85
|
export declare function ExplorerDataProvider({ value, children, }: {
|
package/dist/styles.css
CHANGED
|
@@ -655,6 +655,15 @@
|
|
|
655
655
|
border-radius: 4px;
|
|
656
656
|
cursor: pointer;
|
|
657
657
|
}
|
|
658
|
+
/* RFC BP — up/down reorder + delete controls. */
|
|
659
|
+
.loomcycle-explorer .doc-content-controls > button:disabled {
|
|
660
|
+
opacity: 0.4;
|
|
661
|
+
cursor: default;
|
|
662
|
+
}
|
|
663
|
+
.loomcycle-explorer .doc-content-controls > button.danger {
|
|
664
|
+
color: var(--danger);
|
|
665
|
+
border-color: var(--danger);
|
|
666
|
+
}
|
|
658
667
|
/* The selected-chunk view (chunk body OR assembled markdown) scrolls
|
|
659
668
|
independently of the fixed head — both modes can be long. */
|
|
660
669
|
.loomcycle-explorer .doc-content-body {
|
|
@@ -1023,6 +1032,177 @@
|
|
|
1023
1032
|
font-size: var(--lc-text-xs);
|
|
1024
1033
|
}
|
|
1025
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
|
+
|
|
1026
1206
|
/* ============================================================
|
|
1027
1207
|
RFC BO — image & diagram chunks
|
|
1028
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.
|
|
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",
|