@jskit-ai/assistant-runtime 0.1.126 → 0.1.128

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/assistant-runtime",
3
- "version": "0.1.126",
3
+ "version": "0.1.128",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./client": "./src/client/index.js",
@@ -8,13 +8,14 @@
8
8
  "./server/actionIds": "./src/server/actionIds.js"
9
9
  },
10
10
  "dependencies": {
11
- "@jskit-ai/assistant-core": "0.1.131",
12
- "@jskit-ai/database-runtime": "0.1.155",
13
- "@jskit-ai/http-runtime": "0.1.153",
14
- "@jskit-ai/kernel": "0.1.155",
15
- "@jskit-ai/shell-web": "0.1.159",
16
- "@jskit-ai/users-core": "0.1.168",
17
- "@jskit-ai/users-web": "0.1.173",
11
+ "@jskit-ai/assistant-core": "0.1.133",
12
+ "@jskit-ai/database-runtime": "0.1.157",
13
+ "@jskit-ai/http-web": "0.1.2",
14
+ "@jskit-ai/http-runtime": "0.1.155",
15
+ "@jskit-ai/kernel": "0.1.157",
16
+ "@jskit-ai/shell-web": "0.1.161",
17
+ "@jskit-ai/users-core": "0.1.170",
18
+ "@jskit-ai/users-web": "0.1.175",
18
19
  "json-rest-schema": "^1.0.17"
19
20
  },
20
21
  "peerDependencies": {
@@ -33,6 +34,7 @@
33
34
  "runtime.actions",
34
35
  "runtime.database",
35
36
  "auth.policy",
37
+ "runtime.http-web",
36
38
  "runtime.http-client",
37
39
  "users.core",
38
40
  "users.web"
@@ -110,13 +112,14 @@
110
112
  "mutations": {
111
113
  "dependencies": {
112
114
  "runtime": {
113
- "@jskit-ai/assistant-core": "0.1.131",
114
- "@jskit-ai/database-runtime": "0.1.155",
115
- "@jskit-ai/http-runtime": "0.1.153",
116
- "@jskit-ai/kernel": "0.1.155",
117
- "@jskit-ai/shell-web": "0.1.159",
118
- "@jskit-ai/users-core": "0.1.168",
119
- "@jskit-ai/users-web": "0.1.173"
115
+ "@jskit-ai/assistant-core": "0.1.133",
116
+ "@jskit-ai/database-runtime": "0.1.157",
117
+ "@jskit-ai/http-web": "0.1.2",
118
+ "@jskit-ai/http-runtime": "0.1.155",
119
+ "@jskit-ai/kernel": "0.1.157",
120
+ "@jskit-ai/shell-web": "0.1.161",
121
+ "@jskit-ai/users-core": "0.1.170",
122
+ "@jskit-ai/users-web": "0.1.175"
120
123
  },
121
124
  "dev": {}
122
125
  },
@@ -20,7 +20,7 @@ import {
20
20
  createAssistantApi
21
21
  } from "@jskit-ai/assistant-core/client";
22
22
  import { useShellWebErrorRuntime } from "@jskit-ai/shell-web/client/error";
23
- import { usePagedCollection } from "@jskit-ai/users-web/client/composables/usePagedCollection";
23
+ import { usePagedCollection } from "@jskit-ai/http-web/client/composables/usePagedCollection";
24
24
  import { useSurfaceRouteContext } from "@jskit-ai/shell-web/client/navigation/useSurfaceRouteContext";
25
25
  import { resolveAssistantSurfaceConfig } from "../../shared/assistantSurfaces.js";
26
26
  import { insertTextAtSelection } from "../support/composerInputSupport.js";
@@ -2,8 +2,6 @@ import AssistantSettingsClientElement from "../components/AssistantSettingsClien
2
2
 
3
3
  class AssistantClientProvider {
4
4
  static id = "assistant.web.client";
5
- static dependsOn = ["users.web.client"];
6
-
7
5
  register(app) {
8
6
  if (!app || typeof app.singleton !== "function") {
9
7
  throw new Error("AssistantClientProvider requires application singleton().");
@@ -60,7 +60,7 @@ function createAssistantAiClientFactory(config = {}) {
60
60
  class AssistantProvider {
61
61
  static id = "assistant.chat.service";
62
62
 
63
- static dependsOn = ["runtime.actions", "runtime.database", "auth.policy.fastify", "users.core"];
63
+ static startsAfter = ["runtime.actions"];
64
64
 
65
65
  register(app) {
66
66
  if (
@@ -1,7 +1,7 @@
1
1
  import { normalizeDbRecordId, createWithTransaction } from "@jskit-ai/database-runtime/shared";
2
2
  import { normalizeSurfaceId } from "@jskit-ai/kernel/shared/surface/registry";
3
3
  import { normalizeRecordId, normalizeText } from "@jskit-ai/kernel/shared/support/normalize";
4
- import { resolveInsertedId } from "@jskit-ai/assistant-core/server";
4
+ import { resolveInsertedId } from "./repositoryPersistenceUtils.js";
5
5
  import { assistantRuntimeConfig } from "../../shared/assistantRuntimeConfig.js";
6
6
 
7
7
  function normalizeTargetSurfaceId(value = "") {
@@ -6,7 +6,7 @@ import {
6
6
  resolveInsertedId,
7
7
  stringifyJsonObject,
8
8
  toIso
9
- } from "@jskit-ai/assistant-core/server";
9
+ } from "./repositoryPersistenceUtils.js";
10
10
  import { assistantRuntimeConfig } from "../../shared/assistantRuntimeConfig.js";
11
11
 
12
12
  function normalizeWorkspaceId(value) {
@@ -5,7 +5,7 @@ import {
5
5
  resolveInsertedId,
6
6
  stringifyJsonObject,
7
7
  toIso
8
- } from "@jskit-ai/assistant-core/server";
8
+ } from "./repositoryPersistenceUtils.js";
9
9
  import { assistantRuntimeConfig } from "../../shared/assistantRuntimeConfig.js";
10
10
 
11
11
  function normalizeWorkspaceId(value) {
@@ -0,0 +1,29 @@
1
+ import { resolveInsertedRecordId } from "@jskit-ai/database-runtime/shared";
2
+ import { parseJsonObject } from "@jskit-ai/assistant-core/shared";
3
+
4
+ function stringifyJsonObject(value) {
5
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
6
+ return null;
7
+ }
8
+
9
+ return JSON.stringify(value);
10
+ }
11
+
12
+ function toIso(value) {
13
+ if (!value) {
14
+ return "";
15
+ }
16
+
17
+ const date = value instanceof Date ? value : new Date(value);
18
+ if (Number.isNaN(date.getTime())) {
19
+ return "";
20
+ }
21
+
22
+ return date.toISOString();
23
+ }
24
+
25
+ function resolveInsertedId(insertResult) {
26
+ return resolveInsertedRecordId(insertResult, { fallback: "" }) || "";
27
+ }
28
+
29
+ export { parseJsonObject, stringifyJsonObject, toIso, resolveInsertedId };