@parall/cli 1.59.0 → 1.61.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/commands/agents.d.ts +9 -0
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +288 -8
- package/dist/commands/approvals.d.ts.map +1 -1
- package/dist/commands/approvals.js +19 -0
- package/dist/commands/chats.d.ts.map +1 -1
- package/dist/commands/chats.js +84 -0
- package/dist/commands/comments.d.ts +3 -0
- package/dist/commands/comments.d.ts.map +1 -1
- package/dist/commands/comments.js +44 -1
- package/dist/commands/labels.d.ts +5 -0
- package/dist/commands/labels.d.ts.map +1 -0
- package/dist/commands/labels.js +114 -0
- package/dist/commands/messages.d.ts.map +1 -1
- package/dist/commands/messages.js +35 -0
- package/dist/commands/projects.d.ts.map +1 -1
- package/dist/commands/projects.js +4 -2
- package/dist/commands/search.d.ts +5 -0
- package/dist/commands/search.d.ts.map +1 -1
- package/dist/commands/search.js +28 -1
- package/dist/commands/tasks.d.ts +13 -3
- package/dist/commands/tasks.d.ts.map +1 -1
- package/dist/commands/tasks.js +214 -8
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/commands/watch.js +7 -5
- package/dist/commands/wiki-comments.d.ts +6 -0
- package/dist/commands/wiki-comments.d.ts.map +1 -0
- package/dist/commands/wiki-comments.js +108 -0
- package/dist/commands/wiki.d.ts.map +1 -1
- package/dist/commands/wiki.js +2 -98
- package/dist/index.js +2 -0
- package/dist/lib/wiki-index.d.ts +67 -0
- package/dist/lib/wiki-index.d.ts.map +1 -0
- package/dist/lib/wiki-index.js +758 -0
- package/dist/lib/wiki-merge.d.ts +113 -6
- package/dist/lib/wiki-merge.d.ts.map +1 -1
- package/dist/lib/wiki-merge.js +236 -31
- package/dist/lib/wiki-propose.d.ts +43 -0
- package/dist/lib/wiki-propose.d.ts.map +1 -0
- package/dist/lib/wiki-propose.js +335 -0
- package/dist/lib/wiki-shared.d.ts +291 -0
- package/dist/lib/wiki-shared.d.ts.map +1 -0
- package/dist/lib/wiki-shared.js +407 -0
- package/dist/lib/wiki-sync.d.ts +109 -0
- package/dist/lib/wiki-sync.d.ts.map +1 -0
- package/dist/lib/wiki-sync.js +637 -0
- package/dist/lib/wiki-workspace.d.ts +58 -0
- package/dist/lib/wiki-workspace.d.ts.map +1 -0
- package/dist/lib/wiki-workspace.js +255 -0
- package/dist/lib/wiki.d.ts +6 -312
- package/dist/lib/wiki.d.ts.map +1 -1
- package/dist/lib/wiki.js +53 -2208
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../src/commands/watch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../src/commands/watch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuBzC,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGxD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,GAAG,GAAE,IAAiB,GACrB,IAAI,CAAC,oBAAoB,EAAE,OAAO,GAAG,OAAO,CAAC,CAe/C;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,GAAG,IAAI,CAiBzD;AAKD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA4G5D"}
|
package/dist/commands/watch.js
CHANGED
|
@@ -8,8 +8,10 @@ import { printError, printJson } from '../lib/output.js';
|
|
|
8
8
|
// and a temporary flip: `<value> until <time>` receives <value> until then
|
|
9
9
|
// and goes back to the other value. `--catch-up` on `mentions until` asks
|
|
10
10
|
// for one wake when the mute lapses with unread activity.
|
|
11
|
-
// Targets: a chat (cht_)
|
|
12
|
-
//
|
|
11
|
+
// Targets: a chat (cht_), a thread root (msg_) or an external IM
|
|
12
|
+
// conversation root (chv_ — a Slack/Feishu group the agent's bound channel
|
|
13
|
+
// sees; thread rows inherit). Threads are watched on first use; chats need
|
|
14
|
+
// membership; a DM with a person (in-app or external) has no setting.
|
|
13
15
|
// Tasks carry no setting: `parall watch <task>` / `parall unwatch <task>`.
|
|
14
16
|
// A temporary setting needs the runtime contract — older runtimes get 422
|
|
15
17
|
// RUNTIME_CONTRACT_REQUIRED.
|
|
@@ -88,7 +90,7 @@ export function registerWatchCommands(program) {
|
|
|
88
90
|
return;
|
|
89
91
|
}
|
|
90
92
|
if (!id.startsWith('msg_')) {
|
|
91
|
-
throw new Error('watch takes a thread root (msg_) or a task (tsk_); for a chat use `parall watch set <
|
|
93
|
+
throw new Error('watch takes a thread root (msg_) or a task (tsk_); for a chat or external conversation use `parall watch set <target> all|mentions`');
|
|
92
94
|
}
|
|
93
95
|
const body = { target_uri: uri, level: 'all' };
|
|
94
96
|
if (opts.until)
|
|
@@ -113,8 +115,8 @@ export function registerWatchCommands(program) {
|
|
|
113
115
|
});
|
|
114
116
|
watch
|
|
115
117
|
.command('set')
|
|
116
|
-
.description('Set what you receive on a chat or
|
|
117
|
-
.argument('<target>', 'prll:// URI (cht_
|
|
118
|
+
.description('Set what you receive on a chat, thread root or external conversation: all | mentions [until <time>]')
|
|
119
|
+
.argument('<target>', 'prll:// URI: chat (cht_), thread root (msg_) or external conversation (chv_)')
|
|
118
120
|
.argument('<value...>', 'all | mentions [until tomorrow|2h|RFC3339]')
|
|
119
121
|
.option('--catch-up', 'with `mentions until`: one wake when the mute lapses with unread activity')
|
|
120
122
|
.action(async (target, value, opts) => {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Command } from 'commander';
|
|
2
|
+
/** Wiki comment commands (`parall wiki comment …`), extracted from wiki.ts to
|
|
3
|
+
* respect the file-size ratchet. Registered by registerWikiCommands on the
|
|
4
|
+
* `wiki` command group. */
|
|
5
|
+
export declare function registerWikiCommentCommands(wiki: Command): void;
|
|
6
|
+
//# sourceMappingURL=wiki-comments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wiki-comments.d.ts","sourceRoot":"","sources":["../../src/commands/wiki-comments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC;;2BAE2B;AAC3B,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,OAAO,QA6HxD"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { resolveCredentials } from '../lib/client.js';
|
|
2
|
+
import { printError, printJson, stripPrllScheme } from '../lib/output.js';
|
|
3
|
+
import { BODY_FILE_OPTION_DESC, BODY_OPTION_DESC, resolveCommentBody } from '../lib/text-input.js';
|
|
4
|
+
/** Wiki comment commands (`parall wiki comment …`), extracted from wiki.ts to
|
|
5
|
+
* respect the file-size ratchet. Registered by registerWikiCommands on the
|
|
6
|
+
* `wiki` command group. */
|
|
7
|
+
export function registerWikiCommentCommands(wiki) {
|
|
8
|
+
const comment = wiki.command('comment').description('Manage wiki comments');
|
|
9
|
+
comment
|
|
10
|
+
.command('list')
|
|
11
|
+
.description('List comments on a wiki target')
|
|
12
|
+
.argument('[wiki]', 'Wiki ID or slug')
|
|
13
|
+
.requiredOption('--target-type <type>', 'Target type (changeset or page)')
|
|
14
|
+
.requiredOption('--target-id <id>', 'Target ID (changeset ID or page path)')
|
|
15
|
+
.option('--limit <n>', 'Maximum number of comments to return', '50')
|
|
16
|
+
.option('--cursor <cursor>', 'Pagination cursor')
|
|
17
|
+
.option('--order <order>', 'Sort order (asc or desc)')
|
|
18
|
+
.action(async (wikiRef, opts) => {
|
|
19
|
+
try {
|
|
20
|
+
const ctx = resolveCredentials();
|
|
21
|
+
const { resolveWikiRefOrDefault } = await import('../lib/wiki.js');
|
|
22
|
+
const { COMMENT_TARGET } = await import('@parall/sdk');
|
|
23
|
+
const w = await resolveWikiRefOrDefault(ctx, wikiRef);
|
|
24
|
+
if (opts.targetType !== 'changeset' && opts.targetType !== 'page') {
|
|
25
|
+
throw new Error('--target-type must be "changeset" or "page"');
|
|
26
|
+
}
|
|
27
|
+
const targetUri = opts.targetType === 'changeset'
|
|
28
|
+
? COMMENT_TARGET.changeset(opts.targetId, w.id)
|
|
29
|
+
: COMMENT_TARGET.wikiPage(w.id, opts.targetId);
|
|
30
|
+
const result = await ctx.client.getComments(ctx.orgId, {
|
|
31
|
+
target_uri: targetUri,
|
|
32
|
+
limit: Number(opts.limit),
|
|
33
|
+
cursor: opts.cursor,
|
|
34
|
+
order: opts.order,
|
|
35
|
+
});
|
|
36
|
+
printJson(result);
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
printError(err);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
comment
|
|
43
|
+
.command('add')
|
|
44
|
+
.description('Add a comment to a wiki target, or reply into an existing thread with --parent')
|
|
45
|
+
.argument('[wiki]', 'Wiki ID or slug')
|
|
46
|
+
.requiredOption('--target-type <type>', 'Target type (changeset or page)')
|
|
47
|
+
.requiredOption('--target-id <id>', 'Target ID (changeset ID or page path)')
|
|
48
|
+
.option('--body <text>', BODY_OPTION_DESC)
|
|
49
|
+
.option('--body-file <path>', BODY_FILE_OPTION_DESC)
|
|
50
|
+
.option('--parent <id>', 'Root comment ID — post as a threaded reply under it')
|
|
51
|
+
.action(async (wikiRef, opts) => {
|
|
52
|
+
try {
|
|
53
|
+
const body = resolveCommentBody(opts);
|
|
54
|
+
const ctx = resolveCredentials();
|
|
55
|
+
const { resolveWikiRefOrDefault } = await import('../lib/wiki.js');
|
|
56
|
+
const { COMMENT_TARGET } = await import('@parall/sdk');
|
|
57
|
+
const w = await resolveWikiRefOrDefault(ctx, wikiRef);
|
|
58
|
+
if (opts.targetType !== 'changeset' && opts.targetType !== 'page') {
|
|
59
|
+
throw new Error('--target-type must be "changeset" or "page"');
|
|
60
|
+
}
|
|
61
|
+
const targetUri = opts.targetType === 'changeset'
|
|
62
|
+
? COMMENT_TARGET.changeset(opts.targetId, w.id)
|
|
63
|
+
: COMMENT_TARGET.wikiPage(w.id, opts.targetId);
|
|
64
|
+
const result = await ctx.client.createComment(ctx.orgId, {
|
|
65
|
+
target_uri: targetUri,
|
|
66
|
+
body,
|
|
67
|
+
parent_id: opts.parent ? stripPrllScheme(opts.parent) : undefined,
|
|
68
|
+
});
|
|
69
|
+
printJson(result);
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
printError(err);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
comment
|
|
76
|
+
.command('update')
|
|
77
|
+
.description('Update a wiki comment')
|
|
78
|
+
.argument('<commentId>', 'Comment ID')
|
|
79
|
+
.option('--body <text>', BODY_OPTION_DESC)
|
|
80
|
+
.option('--body-file <path>', BODY_FILE_OPTION_DESC)
|
|
81
|
+
.action(async (commentId, opts) => {
|
|
82
|
+
try {
|
|
83
|
+
const body = resolveCommentBody(opts);
|
|
84
|
+
const ctx = resolveCredentials();
|
|
85
|
+
const result = await ctx.client.updateComment(ctx.orgId, stripPrllScheme(commentId), {
|
|
86
|
+
body,
|
|
87
|
+
});
|
|
88
|
+
printJson(result);
|
|
89
|
+
}
|
|
90
|
+
catch (err) {
|
|
91
|
+
printError(err);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
comment
|
|
95
|
+
.command('delete')
|
|
96
|
+
.description('Delete a wiki comment')
|
|
97
|
+
.argument('<commentId>', 'Comment ID')
|
|
98
|
+
.action(async (commentId) => {
|
|
99
|
+
try {
|
|
100
|
+
const ctx = resolveCredentials();
|
|
101
|
+
await ctx.client.deleteComment(ctx.orgId, stripPrllScheme(commentId));
|
|
102
|
+
printJson({ ok: true });
|
|
103
|
+
}
|
|
104
|
+
catch (err) {
|
|
105
|
+
printError(err);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiki.d.ts","sourceRoot":"","sources":["../../src/commands/wiki.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0BpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"wiki.d.ts","sourceRoot":"","sources":["../../src/commands/wiki.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0BpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,QAy4BpD"}
|
package/dist/commands/wiki.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { promises as fs } from 'node:fs';
|
|
2
2
|
import { resolveCredentials, resolveRuntimeContext } from '../lib/client.js';
|
|
3
3
|
import { printError, printJson } from '../lib/output.js';
|
|
4
|
-
import { BODY_FILE_OPTION_DESC, BODY_OPTION_DESC, resolveCommentBody } from '../lib/text-input.js';
|
|
5
4
|
import { deleteWikiFile, downloadWikiFile, uploadWikiFile } from '../lib/wiki-files.js';
|
|
6
5
|
import { getAfcsDiff, getAfcsStatus, getWikiBlob, getWikiChangesetDetail, getWikiChangesetDiff, getWikiLog, getWikiOutline, getWikiSection, getWikiTree, listWikiChangesets, queryWiki, requestWikiAccess, resetWikiWorkspace, listWikis, proposeWikiChangeset, searchWiki, syncAllMounts, watchMounts, } from '../lib/wiki.js';
|
|
6
|
+
import { registerWikiCommentCommands } from './wiki-comments.js';
|
|
7
7
|
export function registerWikiCommands(program) {
|
|
8
8
|
const wiki = program.command('wiki').description('Parall Wiki — read, edit, and propose changes');
|
|
9
9
|
// ---- CRUD ----
|
|
@@ -756,103 +756,7 @@ export function registerWikiCommands(program) {
|
|
|
756
756
|
printError(error);
|
|
757
757
|
}
|
|
758
758
|
});
|
|
759
|
-
|
|
760
|
-
const comment = wiki.command('comment').description('Manage wiki comments');
|
|
761
|
-
comment
|
|
762
|
-
.command('list')
|
|
763
|
-
.description('List comments on a wiki target')
|
|
764
|
-
.argument('[wiki]', 'Wiki ID or slug')
|
|
765
|
-
.requiredOption('--target-type <type>', 'Target type (changeset or page)')
|
|
766
|
-
.requiredOption('--target-id <id>', 'Target ID (changeset ID or page path)')
|
|
767
|
-
.option('--limit <n>', 'Maximum number of comments to return', '50')
|
|
768
|
-
.option('--cursor <cursor>', 'Pagination cursor')
|
|
769
|
-
.option('--order <order>', 'Sort order (asc or desc)')
|
|
770
|
-
.action(async (wikiRef, opts) => {
|
|
771
|
-
try {
|
|
772
|
-
const ctx = resolveCredentials();
|
|
773
|
-
const { resolveWikiRefOrDefault } = await import('../lib/wiki.js');
|
|
774
|
-
const { COMMENT_TARGET } = await import('@parall/sdk');
|
|
775
|
-
const w = await resolveWikiRefOrDefault(ctx, wikiRef);
|
|
776
|
-
if (opts.targetType !== 'changeset' && opts.targetType !== 'page') {
|
|
777
|
-
throw new Error('--target-type must be "changeset" or "page"');
|
|
778
|
-
}
|
|
779
|
-
const targetUri = opts.targetType === 'changeset'
|
|
780
|
-
? COMMENT_TARGET.changeset(opts.targetId, w.id)
|
|
781
|
-
: COMMENT_TARGET.wikiPage(w.id, opts.targetId);
|
|
782
|
-
const result = await ctx.client.getComments(ctx.orgId, {
|
|
783
|
-
target_uri: targetUri,
|
|
784
|
-
limit: Number(opts.limit),
|
|
785
|
-
cursor: opts.cursor,
|
|
786
|
-
order: opts.order,
|
|
787
|
-
});
|
|
788
|
-
printJson(result);
|
|
789
|
-
}
|
|
790
|
-
catch (err) {
|
|
791
|
-
printError(err);
|
|
792
|
-
}
|
|
793
|
-
});
|
|
794
|
-
comment
|
|
795
|
-
.command('add')
|
|
796
|
-
.description('Add a comment to a wiki target')
|
|
797
|
-
.argument('[wiki]', 'Wiki ID or slug')
|
|
798
|
-
.requiredOption('--target-type <type>', 'Target type (changeset or page)')
|
|
799
|
-
.requiredOption('--target-id <id>', 'Target ID (changeset ID or page path)')
|
|
800
|
-
.option('--body <text>', BODY_OPTION_DESC)
|
|
801
|
-
.option('--body-file <path>', BODY_FILE_OPTION_DESC)
|
|
802
|
-
.action(async (wikiRef, opts) => {
|
|
803
|
-
try {
|
|
804
|
-
const body = resolveCommentBody(opts);
|
|
805
|
-
const ctx = resolveCredentials();
|
|
806
|
-
const { resolveWikiRefOrDefault } = await import('../lib/wiki.js');
|
|
807
|
-
const { COMMENT_TARGET } = await import('@parall/sdk');
|
|
808
|
-
const w = await resolveWikiRefOrDefault(ctx, wikiRef);
|
|
809
|
-
if (opts.targetType !== 'changeset' && opts.targetType !== 'page') {
|
|
810
|
-
throw new Error('--target-type must be "changeset" or "page"');
|
|
811
|
-
}
|
|
812
|
-
const targetUri = opts.targetType === 'changeset'
|
|
813
|
-
? COMMENT_TARGET.changeset(opts.targetId, w.id)
|
|
814
|
-
: COMMENT_TARGET.wikiPage(w.id, opts.targetId);
|
|
815
|
-
const result = await ctx.client.createComment(ctx.orgId, {
|
|
816
|
-
target_uri: targetUri,
|
|
817
|
-
body,
|
|
818
|
-
});
|
|
819
|
-
printJson(result);
|
|
820
|
-
}
|
|
821
|
-
catch (err) {
|
|
822
|
-
printError(err);
|
|
823
|
-
}
|
|
824
|
-
});
|
|
825
|
-
comment
|
|
826
|
-
.command('update')
|
|
827
|
-
.description('Update a wiki comment')
|
|
828
|
-
.argument('<commentId>', 'Comment ID')
|
|
829
|
-
.option('--body <text>', BODY_OPTION_DESC)
|
|
830
|
-
.option('--body-file <path>', BODY_FILE_OPTION_DESC)
|
|
831
|
-
.action(async (commentId, opts) => {
|
|
832
|
-
try {
|
|
833
|
-
const body = resolveCommentBody(opts);
|
|
834
|
-
const ctx = resolveCredentials();
|
|
835
|
-
const result = await ctx.client.updateComment(ctx.orgId, commentId, { body });
|
|
836
|
-
printJson(result);
|
|
837
|
-
}
|
|
838
|
-
catch (err) {
|
|
839
|
-
printError(err);
|
|
840
|
-
}
|
|
841
|
-
});
|
|
842
|
-
comment
|
|
843
|
-
.command('delete')
|
|
844
|
-
.description('Delete a wiki comment')
|
|
845
|
-
.argument('<commentId>', 'Comment ID')
|
|
846
|
-
.action(async (commentId) => {
|
|
847
|
-
try {
|
|
848
|
-
const ctx = resolveCredentials();
|
|
849
|
-
await ctx.client.deleteComment(ctx.orgId, commentId);
|
|
850
|
-
printJson({ ok: true });
|
|
851
|
-
}
|
|
852
|
-
catch (err) {
|
|
853
|
-
printError(err);
|
|
854
|
-
}
|
|
855
|
-
});
|
|
759
|
+
registerWikiCommentCommands(wiki);
|
|
856
760
|
// ---- Utility (not for direct agent use) ----
|
|
857
761
|
wiki
|
|
858
762
|
.command('list')
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import { registerDMCommands } from './commands/dm.js';
|
|
|
8
8
|
import { registerMessageCommands } from './commands/messages.js';
|
|
9
9
|
import { registerTaskCommands } from './commands/tasks.js';
|
|
10
10
|
import { registerCommentCommands } from './commands/comments.js';
|
|
11
|
+
import { registerLabelCommands } from './commands/labels.js';
|
|
11
12
|
import { registerProjectCommands } from './commands/projects.js';
|
|
12
13
|
import { registerProfileCommands } from './commands/profile.js';
|
|
13
14
|
import { registerTeamCommands } from './commands/teams.js';
|
|
@@ -41,6 +42,7 @@ registerMessageCommands(program);
|
|
|
41
42
|
registerWatchCommands(program);
|
|
42
43
|
registerTaskCommands(program);
|
|
43
44
|
registerCommentCommands(program);
|
|
45
|
+
registerLabelCommands(program);
|
|
44
46
|
registerProjectCommands(program);
|
|
45
47
|
registerProfileCommands(program);
|
|
46
48
|
registerTeamCommands(program);
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { type MarkdownFile, type ParallContext, type ReadableWiki, type WikiContentSource, type WikiNodeSection, type WikiQueryDocument, type WikiQuerySectionResult, type WikiSearchResult } from './wiki-shared.js';
|
|
2
|
+
type CachedNodeSection = WikiNodeSection & {
|
|
3
|
+
content: string;
|
|
4
|
+
};
|
|
5
|
+
type IndexedNode = {
|
|
6
|
+
section: CachedNodeSection;
|
|
7
|
+
content: string;
|
|
8
|
+
lowerPath: string;
|
|
9
|
+
lowerTitle: string;
|
|
10
|
+
lowerBody: string;
|
|
11
|
+
lowerJoined: string;
|
|
12
|
+
termFreq: Map<string, number>;
|
|
13
|
+
docLen: number;
|
|
14
|
+
};
|
|
15
|
+
type MarkdownFileDescriptor = {
|
|
16
|
+
path: string;
|
|
17
|
+
size: number;
|
|
18
|
+
mtime_ms: number;
|
|
19
|
+
};
|
|
20
|
+
type LocalNodeSectionFileArtifact = MarkdownFileDescriptor & {
|
|
21
|
+
nodes: CachedNodeSection[];
|
|
22
|
+
};
|
|
23
|
+
type LocalNodeSectionArtifact = {
|
|
24
|
+
version: number;
|
|
25
|
+
generated_at: string;
|
|
26
|
+
wiki_id: string;
|
|
27
|
+
wiki_slug: string;
|
|
28
|
+
wiki_name: string;
|
|
29
|
+
file_count: number;
|
|
30
|
+
files: LocalNodeSectionFileArtifact[];
|
|
31
|
+
};
|
|
32
|
+
type LoadedNodeSectionSet = {
|
|
33
|
+
kind: WikiContentSource;
|
|
34
|
+
generatedAt: string;
|
|
35
|
+
fileCount: number;
|
|
36
|
+
sections: CachedNodeSection[];
|
|
37
|
+
};
|
|
38
|
+
export declare function loadWikiNodeSections(ctx: ParallContext, wiki: ReadableWiki, options?: {
|
|
39
|
+
ref?: string;
|
|
40
|
+
pathPrefix?: string;
|
|
41
|
+
}): Promise<LoadedNodeSectionSet>;
|
|
42
|
+
export declare function tryLoadLocalNodeSections(ctx: ParallContext, wiki: ReadableWiki, pathPrefix?: string): Promise<LocalNodeSectionArtifact | null>;
|
|
43
|
+
export declare function findLocalNodeSection(artifact: LocalNodeSectionArtifact, nodeId: string): CachedNodeSection | undefined;
|
|
44
|
+
export declare function stripNodeSectionContent(section: CachedNodeSection): WikiNodeSection;
|
|
45
|
+
export declare function buildIndexNodes(sections: CachedNodeSection[]): IndexedNode[];
|
|
46
|
+
export declare function parseMarkdownFile(wiki: ReadableWiki, file: MarkdownFile): CachedNodeSection[];
|
|
47
|
+
export declare function scoreNodes(nodes: IndexedNode[], query: string, options: {
|
|
48
|
+
limit?: number;
|
|
49
|
+
includeContent?: boolean;
|
|
50
|
+
source: 'local_mount' | 'api';
|
|
51
|
+
}): WikiSearchResult[];
|
|
52
|
+
export declare function planWikiQuery(sections: CachedNodeSection[], query: string, options: {
|
|
53
|
+
limit?: number;
|
|
54
|
+
includeContent?: boolean;
|
|
55
|
+
source: WikiContentSource;
|
|
56
|
+
}): {
|
|
57
|
+
documents: WikiQueryDocument[];
|
|
58
|
+
sections: WikiQuerySectionResult[];
|
|
59
|
+
};
|
|
60
|
+
export declare function detectFrontMatterEnd(lines: string[]): number;
|
|
61
|
+
export declare function parseNodeId(nodeId: string): {
|
|
62
|
+
path: string;
|
|
63
|
+
kind: 'doc' | 'preface' | 'line';
|
|
64
|
+
line?: number;
|
|
65
|
+
};
|
|
66
|
+
export {};
|
|
67
|
+
//# sourceMappingURL=wiki-index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wiki-index.d.ts","sourceRoot":"","sources":["../../src/lib/wiki-index.ts"],"names":[],"mappings":"AAQA,OAAO,EAEL,KAAK,YAAY,EAEjB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EAWtB,MAAM,kBAAkB,CAAC;AAE1B,KAAK,iBAAiB,GAAG,eAAe,GAAG;IACzC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAA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