@opencode-ai/server 0.0.0-dev-18078 → 0.0.0-dev-18082

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/fetch.d.ts CHANGED
@@ -31,15 +31,15 @@ export interface BootOptions {
31
31
  * next boot, and the sweep is a no-op when nothing is suspended.
32
32
  */
33
33
  export declare const make: (options?: {
34
- readonly events?: {
35
- readonly persist?: boolean | undefined;
36
- } | undefined;
37
34
  readonly models?: {
38
35
  readonly url?: string | undefined;
39
36
  readonly file?: string | undefined;
40
37
  readonly snapshot?: boolean | undefined;
41
38
  readonly fetch?: boolean | undefined;
42
39
  } | undefined;
40
+ readonly events?: {
41
+ readonly persist?: boolean | undefined;
42
+ } | undefined;
43
43
  readonly config?: {
44
44
  readonly directory?: string | undefined;
45
45
  readonly project?: boolean | undefined;
@@ -1,3 +1,3 @@
1
1
  import { Session } from "@opencode-ai/core/session";
2
2
  import { SessionTransfer } from "@opencode-ai/core/session/transfer";
3
- export declare const SessionHandler: import("effect/Layer").Layer<import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.session">, never, Session.Service | import("../middleware/session-location").SessionLocationMiddleware | SessionTransfer.Service | (import("@opencode-ai/protocol/middleware/schema-error").SchemaErrorMiddleware | import("@opencode-ai/protocol/middleware/authorization").Authorization)>;
3
+ export declare const SessionHandler: import("effect/Layer").Layer<import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.session">, never, import("@opencode-ai/protocol/middleware/schema-error").SchemaErrorMiddleware | import("@opencode-ai/protocol/middleware/authorization").Authorization | Session.Service | import("../middleware/session-location").SessionLocationMiddleware | SessionTransfer.Service | import("effect/unstable/http/HttpRouter").Request<"Requires", import("@opencode-ai/core/database/database").Service>>;
@@ -1,4 +1,5 @@
1
1
  import { Session } from "@opencode-ai/core/session";
2
+ import { SessionStats } from "@opencode-ai/core/session/stats";
2
3
  import { SessionTransfer } from "@opencode-ai/core/session/transfer";
3
4
  import { InstructionEntry } from "@opencode-ai/core/session/instruction-entry";
4
5
  import { DateTime, Effect, Stream } from "effect";
@@ -52,6 +53,25 @@ export const SessionHandler = HttpApiBuilder.group(Api, "server.session", (handl
52
53
  }) : void 0
53
54
  }
54
55
  };
56
+ })).handle("session.stats", Effect.fn(function* (ctx) {
57
+ if (ctx.query.from !== void 0 && ctx.query.to !== void 0 && ctx.query.from >= ctx.query.to)
58
+ return yield* new InvalidRequestError({ message: "Stats range must end after it starts" });
59
+ const timezone = ctx.query.timezone ?? "UTC";
60
+ yield* Effect.try({
61
+ try: () => new Intl.DateTimeFormat("en-US", { timeZone: timezone }),
62
+ catch: () => new InvalidRequestError({ message: `Invalid time zone: ${timezone}` })
63
+ });
64
+ return {
65
+ data: yield* SessionStats.get({
66
+ from: ctx.query.from,
67
+ to: ctx.query.to,
68
+ projectID: ctx.query.project,
69
+ timezone,
70
+ models: ctx.query.models,
71
+ tools: ctx.query.tools,
72
+ toolSummary: ctx.query.toolSummary
73
+ })
74
+ };
55
75
  })).handle("session.create", Effect.fn(function* (ctx) {
56
76
  return {
57
77
  data: yield* session.create({
@@ -1,2 +1,2 @@
1
1
  import { Layer } from "effect";
2
- export declare const handlers: Layer.Layer<import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.generate"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.message"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.model"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.provider"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.session"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.permission"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.fs"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.form"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.command"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.skill"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.event"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.agent"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.plugin"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.health"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.server"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.debug"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.pty"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.shell"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.reference"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.location"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.integration"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.websearch"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.mcp"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.credential"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.project"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.worktree"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.vcs"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.migration"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.config">, never, import("@opencode-ai/protocol/middleware/schema-error").SchemaErrorMiddleware | import("@opencode-ai/protocol/middleware/authorization").Authorization | import("@opencode-ai/core/bus").Service | import("@opencode-ai/core/worktree").Service | import("@opencode-ai/core/session").Service | import("./location").LocationMiddleware | import("./middleware/form-location").FormLocationMiddleware | import("./middleware/session-location").SessionLocationMiddleware | import("@opencode-ai/core/pty/ticket").Service | import("@opencode-ai/core/session/transfer").Service | import("effect/unstable/http/HttpRouter").Request<"Requires", import("@opencode-ai/core/permission/saved").Service> | import("effect/unstable/http/HttpRouter").Request<"Requires", import("./server-info").Service> | import("./pty-environment").Service | import("effect/unstable/http/HttpRouter").Request<"Requires", import("@opencode-ai/core/wellknown").Service> | import("effect/unstable/http/HttpRouter").Request<"Requires", import("@opencode-ai/core/project").Service> | import("effect/unstable/http/HttpRouter").Request<"Requires", import("@opencode-ai/core/database/database").Service>>;
2
+ export declare const handlers: Layer.Layer<import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.generate"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.message"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.model"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.provider"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.session"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.permission"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.fs"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.form"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.command"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.skill"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.event"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.agent"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.plugin"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.health"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.server"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.debug"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.pty"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.shell"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.reference"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.location"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.integration"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.websearch"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.mcp"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.credential"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.project"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.worktree"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.vcs"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.migration"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.config">, never, import("@opencode-ai/protocol/middleware/schema-error").SchemaErrorMiddleware | import("@opencode-ai/protocol/middleware/authorization").Authorization | import("@opencode-ai/core/bus").Service | import("@opencode-ai/core/worktree").Service | import("@opencode-ai/core/session").Service | import("./location").LocationMiddleware | import("./middleware/form-location").FormLocationMiddleware | import("./middleware/session-location").SessionLocationMiddleware | import("@opencode-ai/core/pty/ticket").Service | import("@opencode-ai/core/session/transfer").Service | import("effect/unstable/http/HttpRouter").Request<"Requires", import("@opencode-ai/core/database/database").Service> | import("effect/unstable/http/HttpRouter").Request<"Requires", import("@opencode-ai/core/permission/saved").Service> | import("effect/unstable/http/HttpRouter").Request<"Requires", import("./server-info").Service> | import("./pty-environment").Service | import("effect/unstable/http/HttpRouter").Request<"Requires", import("@opencode-ai/core/wellknown").Service> | import("effect/unstable/http/HttpRouter").Request<"Requires", import("@opencode-ai/core/project").Service>>;
package/dist/process.d.ts CHANGED
@@ -7,15 +7,15 @@ export interface Lifecycle<E = never, R = never> {
7
7
  type App = Effect.Effect<HttpServerResponse.HttpServerResponse, unknown, HttpServerRequest.HttpServerRequest | Scope.Scope>;
8
8
  export type Transform = (app: App) => App;
9
9
  export declare const start: <E, R>(options: {
10
- readonly events?: {
11
- readonly persist?: boolean | undefined;
12
- } | undefined;
13
10
  readonly models?: {
14
11
  readonly url?: string | undefined;
15
12
  readonly file?: string | undefined;
16
13
  readonly snapshot?: boolean | undefined;
17
14
  readonly fetch?: boolean | undefined;
18
15
  } | undefined;
16
+ readonly events?: {
17
+ readonly persist?: boolean | undefined;
18
+ } | undefined;
19
19
  readonly config?: {
20
20
  readonly directory?: string | undefined;
21
21
  readonly project?: boolean | undefined;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode-ai/server",
4
- "version": "0.0.0-dev-18078",
4
+ "version": "0.0.0-dev-18082",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -29,11 +29,11 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@effect/platform-node": "4.0.0-rc.111",
32
- "@opencode-ai/core": "0.0.0-dev-18078",
33
- "@opencode-ai/protocol": "0.0.0-dev-18078",
34
- "@opencode-ai/schema": "0.0.0-dev-18078",
35
- "@opencode-ai/simulation": "0.0.0-dev-18078",
36
- "@opencode-ai/util": "0.0.0-dev-18078",
32
+ "@opencode-ai/core": "0.0.0-dev-18082",
33
+ "@opencode-ai/protocol": "0.0.0-dev-18082",
34
+ "@opencode-ai/schema": "0.0.0-dev-18082",
35
+ "@opencode-ai/simulation": "0.0.0-dev-18082",
36
+ "@opencode-ai/util": "0.0.0-dev-18082",
37
37
  "drizzle-orm": "1.0.0-rc.5-169397b",
38
38
  "effect": "4.0.0-rc.111"
39
39
  },