@vite-hub/comments 0.3.1 → 0.5.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/README.md +37 -15
- package/dist/anchor.d.ts +2 -2
- package/dist/{client-diagnostics-CcFpkbAk.js → client-diagnostics-Bubm7Shd.js} +20 -5
- package/dist/client-files-CJZl5Kc4.js +53 -0
- package/dist/client.d.ts +567 -13
- package/dist/client.js +1209 -34
- package/dist/{console-h4KlhIik.d.ts → console-D1lwNMZn.d.ts} +2 -0
- package/dist/{migrate-BDQ8xqUs.js → database-6hXRnqDE.js} +47 -2
- package/dist/database-CTo7mx6t.d.ts +575 -0
- package/dist/database.d.ts +2 -1
- package/dist/database.js +2 -2
- package/dist/{define-43mMR39K.js → define-BMBSVbD9.js} +1 -1
- package/dist/{define-B3TF9zzn.d.ts → define-CmIFU96x.d.ts} +8 -4
- package/dist/{errors-4gelGVmK.js → errors-BJTZ9iyv.js} +24 -0
- package/dist/{errors-C6qptPoG.js → errors-Dq4AHjza.js} +23 -3
- package/dist/index-RiHzmV16.d.ts +194 -0
- package/dist/index.d.ts +6 -7
- package/dist/index.js +57 -9
- package/dist/{install-W9ghhGoh.d.ts → install-BGGQKbQ4.d.ts} +9 -3
- package/dist/{install-BcMPgPk_.js → install-DrAse1Fa.js} +912 -60
- package/dist/{installed-B-PfERBU.js → installed-C3EoqJEY.js} +7 -6
- package/dist/{operations-GLeOqgMt.d.ts → operations-BKhUWYkb.d.ts} +10 -5
- package/dist/{operations-D4A1Fcgf.d.ts → operations-VyyNZusz.d.ts} +13 -2
- package/dist/{operations-DMMIfYPW.js → operations-lsVKE0GH.js} +312 -219
- package/dist/operations.d.ts +2 -2
- package/dist/operations.js +2 -2
- package/dist/overlay/client-DBmJ4C1M.js +4 -0
- package/dist/overlay/overlay.js +41 -65
- package/dist/page/loader.js +39 -47
- package/dist/{page-DtbMOEMd.d.ts → page-Bzj0CszG.d.ts} +1 -10
- package/dist/{page-B41ozN63.js → page-DRz_sDY4.js} +1 -1
- package/dist/{page-tools-shared-NHUjKI8E.js → page-tools-shared-BNnuPK93.js} +6 -3
- package/dist/{plugin-PS8PMYus.js → plugin-DRsNaJaK.js} +34 -8
- package/dist/realtime.d.ts +2 -2
- package/dist/realtime.js +2 -2
- package/dist/reply-id-P_bSuEng.js +12 -0
- package/dist/request-log-Dj9Vw7qG.js +105 -0
- package/dist/request-origin-CFU0TQ7E.js +49 -0
- package/dist/{rpc-RKPAusHp.js → rpc-BQqYx8kb.js} +23 -7
- package/dist/{rpc-HBcWtg0T.d.ts → rpc-CuJ5GLIz.d.ts} +1 -1
- package/dist/rpc.d.ts +1 -1
- package/dist/rpc.js +1 -1
- package/dist/runtime/auth.d.ts +2 -2
- package/dist/runtime/auth.js +2 -2
- package/dist/runtime/console.d.ts +1 -1
- package/dist/runtime/console.js +3 -3
- package/dist/runtime/index.d.ts +42 -13
- package/dist/runtime/index.js +224 -22
- package/dist/{server-D8k-0GXe.js → server-Yk610niJ.js} +1 -1
- package/dist/server.d.ts +6 -5
- package/dist/server.js +6 -6
- package/dist/service-Bj-Mg63c.d.ts +73 -0
- package/dist/{service-GHhhyQj4.js → service-DA5BwfPQ.js} +71 -14
- package/dist/{session-DVx-1Tym.d.ts → session-DUcEor2W.d.ts} +3 -3
- package/dist/{session-EkudzUmm.js → session-X_g9dnU5.js} +27 -30
- package/dist/{service-CFVm23k7.d.ts → store-CsUNfC1w.d.ts} +11 -72
- package/dist/table-names-B9LlRC0B.js +16 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +38 -5
- package/dist/{types-CZujrMFd.d.ts → types-BLaYh0_f.d.ts} +48 -4
- package/dist/{types-BIS0hCEl.d.ts → types-C35INXIs.d.ts} +88 -4
- package/dist/vite.d.ts +24 -7
- package/dist/vite.js +322 -173
- package/package.json +9 -9
- package/dist/errors-CyQyKAvy.d.ts +0 -185
- package/dist/index-DNhy69Wt.d.ts +0 -83
- package/dist/overlay/client-DmsSMOzi.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as hasCommentsRuntime, t as commentsRuntime } from "./server-
|
|
1
|
+
import { r as hasCommentsRuntime, t as commentsRuntime } from "./server-Yk610niJ.js";
|
|
2
2
|
//#region src/installed.ts
|
|
3
3
|
/** The runtime that `installComments()` connected to each definition. */
|
|
4
4
|
const runtimes = /* @__PURE__ */ new WeakMap();
|
|
@@ -18,13 +18,14 @@ async function runtimeOf(comments) {
|
|
|
18
18
|
const built = await commentsRuntime().catch(() => void 0);
|
|
19
19
|
return built?.definition === comments.options ? built : void 0;
|
|
20
20
|
}
|
|
21
|
-
/** The runtime that `installComments()` connected, for the overlay API and the MCP tools. */
|
|
22
|
-
function commentsRuntimeOf(comments) {
|
|
23
|
-
return runtimes.get(comments)?.runtime;
|
|
24
|
-
}
|
|
25
21
|
/** The runtime of a definition, or the one that the generated Nitro plugin builds on first use, for the overlay API. */
|
|
26
22
|
async function resolveCommentsRuntime(comments) {
|
|
27
23
|
return runtimeOf(comments);
|
|
28
24
|
}
|
|
25
|
+
/** The Send service of a definition, after the runtime is built. Undefined while Send is off. */
|
|
26
|
+
async function commentSendOf(comments) {
|
|
27
|
+
await runtimeOf(comments);
|
|
28
|
+
return runtimes.get(comments)?.send;
|
|
29
|
+
}
|
|
29
30
|
//#endregion
|
|
30
|
-
export { runtimeOf as a, runtimeBuilds as i, pendingKey as n, runtimes as o, resolveCommentsRuntime as r,
|
|
31
|
+
export { runtimeOf as a, runtimeBuilds as i, pendingKey as n, runtimes as o, resolveCommentsRuntime as r, commentSendOf as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { f as CommentsPolicyGate, g as CommentsUser } from "./define-
|
|
3
|
-
import { i as CommentsRuntime, t as CommentsAttachmentBody } from "./service-
|
|
4
|
-
import { t as AnyOperation } from "./operations-
|
|
1
|
+
import { C as CommentStatusInput, D as CommentUser, E as CommentUploadInput, O as CommentUsersInput, T as CommentThread, c as CommentCreateInput, f as CommentEditInput, g as CommentGetInput, i as CommentAttachment, l as CommentDeleteInput, n as CommentActor, s as CommentContext, v as CommentListQuery, x as CommentReplyInput, y as CommentMessage } from "./types-BLaYh0_f.js";
|
|
2
|
+
import { f as CommentsPolicyGate, g as CommentsUser } from "./define-CmIFU96x.js";
|
|
3
|
+
import { i as CommentsRuntime, t as CommentsAttachmentBody } from "./service-Bj-Mg63c.js";
|
|
4
|
+
import { t as AnyOperation } from "./operations-VyyNZusz.js";
|
|
5
5
|
import * as v from "valibot";
|
|
6
6
|
//#region src/operations-core/operations.d.ts
|
|
7
7
|
declare const anchor: v.UnionSchema<[v.StrictObjectSchema<{
|
|
@@ -167,7 +167,7 @@ declare const commentInputSchemas: {
|
|
|
167
167
|
readonly threadId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
|
|
168
168
|
}, undefined>;
|
|
169
169
|
readonly get: v.UnionSchema<[v.StrictObjectSchema<{
|
|
170
|
-
readonly
|
|
170
|
+
readonly threadId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
|
|
171
171
|
}, undefined>, v.StrictObjectSchema<{
|
|
172
172
|
readonly n: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
173
173
|
readonly scope: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
|
|
@@ -195,6 +195,7 @@ declare const commentInputSchemas: {
|
|
|
195
195
|
readonly attachments: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>, v.MaxLengthAction<string[], 10, undefined>]>, undefined>;
|
|
196
196
|
readonly body: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 10000, undefined>]>;
|
|
197
197
|
readonly mentions: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>, undefined>, v.MaxLengthAction<string[], 20, undefined>]>, undefined>;
|
|
198
|
+
readonly requestId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
|
|
198
199
|
readonly threadId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
|
|
199
200
|
}, undefined>;
|
|
200
201
|
readonly status: v.StrictObjectSchema<{
|
|
@@ -241,6 +242,10 @@ declare const commentActions: {
|
|
|
241
242
|
edit(input: CommentEditInput, who: CommentsCaller): Promise<CommentThread>;
|
|
242
243
|
delete(input: CommentDeleteInput, who: CommentsCaller): Promise<CommentThread | null>;
|
|
243
244
|
setStatus(input: CommentStatusInput, who: CommentsCaller, status: "open" | "resolved"): Promise<CommentThread>;
|
|
245
|
+
resolveThreads(input: readonly {
|
|
246
|
+
threadId: string;
|
|
247
|
+
reply?: string;
|
|
248
|
+
}[], who: CommentsCaller): Promise<CommentThread[]>;
|
|
244
249
|
/** `minimum`: the shortest query that gets suggestions. The operations ask for two characters. */
|
|
245
250
|
users(input: CommentUsersInput, who: CommentsCaller, options?: {
|
|
246
251
|
minimum?: number;
|
|
@@ -28,6 +28,11 @@ interface OperationAccess {
|
|
|
28
28
|
*/
|
|
29
29
|
readonly sections: "all" | readonly string[];
|
|
30
30
|
readonly user?: OperationUser;
|
|
31
|
+
/**
|
|
32
|
+
* Who signed the call: `"console"` when the ViteHub Console signed it for a person, whose `user` is then a Console
|
|
33
|
+
* account and not an app user, or `"cli"` for a key. Not set for other calls.
|
|
34
|
+
*/
|
|
35
|
+
readonly via?: "console" | "cli";
|
|
31
36
|
}
|
|
32
37
|
interface OperationContext {
|
|
33
38
|
/** The checked Console access of the call. */
|
|
@@ -39,6 +44,11 @@ interface OperationContext {
|
|
|
39
44
|
surface: "console" | "cli" | "mcp" | "agent";
|
|
40
45
|
/** Set by the host from generated build identity, never from request input or runtime NODE_ENV. */
|
|
41
46
|
development?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* The project root of a development server, for operations that read build files, such as `bundle.report`. Hosts set
|
|
49
|
+
* it only with `development`, so a deployed server never reads project files through it.
|
|
50
|
+
*/
|
|
51
|
+
projectRoot?: string;
|
|
42
52
|
env?: Record<string, unknown>;
|
|
43
53
|
waitUntil?: (task: Promise<unknown>) => void;
|
|
44
54
|
request?: Request;
|
|
@@ -85,7 +95,8 @@ interface OperationDefinition<Input, Output> {
|
|
|
85
95
|
/** Standard Schema (valibot in this repo). Its Standard JSON Schema builds CLI flags and the MCP input schema. */
|
|
86
96
|
input: StandardSchemaV1<unknown, Input>;
|
|
87
97
|
output?: StandardSchemaV1<unknown, Output>;
|
|
88
|
-
|
|
98
|
+
/** `false`: no `vitehub` command. The Console and MCP still call the operation. */
|
|
99
|
+
cli?: false | {
|
|
89
100
|
/** Defaults: namespace = section, command = verb. */
|
|
90
101
|
namespace?: string;
|
|
91
102
|
/** A space groups commands: `jobs list` and `jobs show` run as `vitehub <namespace> jobs list` and `jobs show`. */
|
|
@@ -126,7 +137,7 @@ interface OperationDefinition<Input, Output> {
|
|
|
126
137
|
/** An operation of any input and output, as a registry holds it. */
|
|
127
138
|
interface AnyOperation extends Omit<OperationDefinition<unknown, unknown>, "cli" | "input" | "mcp" | "output" | "readOnlyWhen" | "run" | "scope" | "section"> {
|
|
128
139
|
readOnlyWhen?: (input: never) => boolean;
|
|
129
|
-
cli?: {
|
|
140
|
+
cli?: false | {
|
|
130
141
|
namespace?: string;
|
|
131
142
|
command?: string;
|
|
132
143
|
default?: boolean;
|