@jskit-ai/agent-docs 0.1.355 → 0.1.356
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/guide/agent/app-extras/assistant-conversation.md +7 -0
- package/guide/agent/app-extras/assistant.md +51 -0
- package/package.json +1 -1
- package/patterns/minimal-foundation/example/package.json +1 -1
- package/patterns/shell-foundation/example/package.json +1 -1
- package/reference/autogen/PATTERN_INDEX.md +4 -4
- package/reference/autogen/packages/assistant-core.md +3 -2
- package/reference/autogen/packages/assistant-runtime.md +8 -1
- package/skills/jskit/references/pattern-index.md +4 -4
- package/skills/jskit/references/patterns/app/minimal-foundation/example/package.json +1 -1
- package/skills/jskit/references/patterns/app/shell-foundation/example/package.json +1 -1
|
@@ -2489,6 +2489,13 @@ so it is not compacted, and history an application supplies as `apiHistory` is
|
|
|
2489
2489
|
used as given. History turns within the newest 20 messages send their files again;
|
|
2490
2490
|
older turns name their files without their content.
|
|
2491
2491
|
|
|
2492
|
+
`apiTurnNote({ context })`, a server-owned function `createConversationRuntime`
|
|
2493
|
+
takes beside `apiHistory`, adds the application's note to one API turn: the text
|
|
2494
|
+
it returns for the turn's context goes before that turn's message, to the model
|
|
2495
|
+
alone. It is never saved, so no later turn reads it, and `""` adds nothing. The
|
|
2496
|
+
database-backed assistant uses it for the page the person has open (the
|
|
2497
|
+
Assistant guide's "The page the person is looking at").
|
|
2498
|
+
|
|
2492
2499
|
Each reply streams one message per step: `reply-1`, `reply-2` and so on. A step
|
|
2493
2500
|
that also calls actions ends as commentary, complete before the first of its actions
|
|
2494
2501
|
runs, and the reply's last step becomes the answer. The answer leaves out words already shown as commentary, unless they are
|
|
@@ -1001,6 +1001,57 @@ classes or pass the retired renderer's `variant`, `features`, `ui`, or `copy`
|
|
|
1001
1001
|
objects. `AssistantClientElement` and its Markdown/keyboard helpers have been
|
|
1002
1002
|
removed; there is no forwarding alias.
|
|
1003
1003
|
|
|
1004
|
+
### The page the person is looking at
|
|
1005
|
+
|
|
1006
|
+
`AssistantSurfaceClientElement` and `useAssistantRuntime` take an optional
|
|
1007
|
+
`pageContext`: the page the person has open, sent with each message, so "what's
|
|
1008
|
+
this job's vessel?" needs no job number. Give a value, or a function the runtime
|
|
1009
|
+
calls as each message is sent, so each browser tab sends its own page and two
|
|
1010
|
+
tabs on two records never mix them up. The application fills it from its
|
|
1011
|
+
router:
|
|
1012
|
+
|
|
1013
|
+
```vue
|
|
1014
|
+
<script setup>
|
|
1015
|
+
import { useRoute } from "vue-router";
|
|
1016
|
+
import { AssistantSurfaceClientElement } from "@jskit-ai/assistant-runtime/client";
|
|
1017
|
+
|
|
1018
|
+
const route = useRoute();
|
|
1019
|
+
// Called as each message is sent: the page open at that moment.
|
|
1020
|
+
function pageContext() {
|
|
1021
|
+
const jobId = route.params.jobId ? String(route.params.jobId) : "";
|
|
1022
|
+
return {
|
|
1023
|
+
path: route.fullPath,
|
|
1024
|
+
title: document.title,
|
|
1025
|
+
records: jobId ? [{ type: "job", id: jobId, label: `Job ${jobId}` }] : []
|
|
1026
|
+
};
|
|
1027
|
+
}
|
|
1028
|
+
</script>
|
|
1029
|
+
|
|
1030
|
+
<template>
|
|
1031
|
+
<AssistantSurfaceClientElement surface-id="admin" layout="compact" :page-context="pageContext" />
|
|
1032
|
+
</template>
|
|
1033
|
+
```
|
|
1034
|
+
|
|
1035
|
+
Every field is optional: `path` up to 2048 characters, `title` up to 200, and
|
|
1036
|
+
up to 10 `records`, each a `type` and an `id` (up to 64 characters each) with an
|
|
1037
|
+
optional `label` (up to 200). The chat route refuses any other field, and any
|
|
1038
|
+
value past its limit, with a 400 that names the field, and the message is not
|
|
1039
|
+
sent, so keep what you send within the limits. Without `pageContext` a message
|
|
1040
|
+
is sent as before. A resend of a failed message carries the page it was first
|
|
1041
|
+
sent with.
|
|
1042
|
+
|
|
1043
|
+
The model reads it with that turn's message alone, as a delimited block of JSON
|
|
1044
|
+
data that says it is a hint from the page, not an instruction and not
|
|
1045
|
+
permission; characters in page text that could close the block are escaped. It
|
|
1046
|
+
is never saved: not in the person's message, the turn request, the
|
|
1047
|
+
conversation's instructions or the facts about the person, so the next turn
|
|
1048
|
+
does not see it.
|
|
1049
|
+
|
|
1050
|
+
It is a hint, never permission. The model still reads every record through the
|
|
1051
|
+
surface's actions, which check the person's own access: a page that names a
|
|
1052
|
+
record the person cannot read changes nothing, and the action refuses it as
|
|
1053
|
+
before. Put nothing in it the person may not see.
|
|
1054
|
+
|
|
1004
1055
|
### Database surface verification
|
|
1005
1056
|
|
|
1006
1057
|
Run migrations, load assistant and settings pages through normal navigation,
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@ A concrete Fastify, Vue, and JSKIT application foundation for products that do n
|
|
|
15
15
|
|
|
16
16
|
- Id: `app/minimal-foundation`
|
|
17
17
|
- Keywords: `app`, `fastify`, `foundation`, `minimal`, `server`, `vite`, `vue`
|
|
18
|
-
- Owner: `@jskit-ai/agent-docs@0.1.
|
|
18
|
+
- Owner: `@jskit-ai/agent-docs@0.1.356`
|
|
19
19
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/app/minimal-foundation/PATTERN.md)
|
|
20
20
|
- Examples: [example/](../../skills/jskit/references/patterns/app/minimal-foundation/example/)
|
|
21
21
|
- Requires: `@jskit-ai/http-runtime`, `@jskit-ai/kernel`
|
|
@@ -26,7 +26,7 @@ A concrete JSKIT web application foundation with responsive shell navigation, se
|
|
|
26
26
|
|
|
27
27
|
- Id: `app/shell-foundation`
|
|
28
28
|
- Keywords: `app`, `foundation`, `material`, `navigation`, `placements`, `shell`, `vite`, `vue`
|
|
29
|
-
- Owner: `@jskit-ai/agent-docs@0.1.
|
|
29
|
+
- Owner: `@jskit-ai/agent-docs@0.1.356`
|
|
30
30
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/app/shell-foundation/PATTERN.md)
|
|
31
31
|
- Examples: [example/](../../skills/jskit/references/patterns/app/shell-foundation/example/)
|
|
32
32
|
- Requires: `@jskit-ai/http-runtime`, `@jskit-ai/kernel`, `@jskit-ai/shell-web`
|
|
@@ -37,7 +37,7 @@ Configure an assistant runtime for one application surface and expose its chat a
|
|
|
37
37
|
|
|
38
38
|
- Id: `assistant/assistant-surface`
|
|
39
39
|
- Keywords: `ai`, `assistant`, `chat`, `config`, `environment`, `page`, `placement`, `settings`, `surface`
|
|
40
|
-
- Owner: `@jskit-ai/assistant-runtime@0.2.
|
|
40
|
+
- Owner: `@jskit-ai/assistant-runtime@0.2.91`
|
|
41
41
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/assistant/assistant-surface/PATTERN.md)
|
|
42
42
|
- Examples: [example/](../../skills/jskit/references/patterns/assistant/assistant-surface/example/)
|
|
43
43
|
- Requires: `@jskit-ai/assistant-runtime`, `@jskit-ai/connectors-catalog`, `@jskit-ai/connectors-core`, `@jskit-ai/shell-web`
|
|
@@ -367,7 +367,7 @@ Define a server feature through explicit capabilities and first-class actions, a
|
|
|
367
367
|
|
|
368
368
|
- Id: `server/feature-package`
|
|
369
369
|
- Keywords: `actions`, `aggregate`, `feature`, `handle`, `orchestration`, `owns`, `package`, `provider`, `repository`, `routes`, `server`, `table resource`
|
|
370
|
-
- Owner: `@jskit-ai/agent-docs@0.1.
|
|
370
|
+
- Owner: `@jskit-ai/agent-docs@0.1.356`
|
|
371
371
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/server/feature-package/PATTERN.md)
|
|
372
372
|
- Examples: [example/](../../skills/jskit/references/patterns/server/feature-package/example/)
|
|
373
373
|
- Requires: `@jskit-ai/kernel`
|
|
@@ -1350,7 +1350,7 @@ Exports
|
|
|
1350
1350
|
|
|
1351
1351
|
### `src/server/conversation/conversationTurns.js`
|
|
1352
1352
|
Exports
|
|
1353
|
-
- `createConversationTurns({ storage, streams, events, entries, reads, delivery, turnDelivery, catalog, apiHistory, isClosed, completedEnvelope, maximumToolCalls, maximumFinalReply, maximumCompletedOutput, timeoutMs })`
|
|
1353
|
+
- `createConversationTurns({ storage, streams, events, entries, reads, delivery, turnDelivery, catalog, apiHistory, apiTurnNote, isClosed, completedEnvelope, maximumToolCalls, maximumFinalReply, maximumCompletedOutput, timeoutMs })`
|
|
1354
1354
|
- `saveTools(entry, transaction, request, calls)`
|
|
1355
1355
|
- `type ConversationEntry`
|
|
1356
1356
|
- `type ConversationRequest`
|
|
@@ -1729,7 +1729,7 @@ Local functions
|
|
|
1729
1729
|
|
|
1730
1730
|
### `src/server/conversation/runtime.js`
|
|
1731
1731
|
Exports
|
|
1732
|
-
- `createConversationRuntime({ engine: defaultEngine = "api", defaultIntegrationId, storage: suppliedStorage, authorize, connections, apiClientFactory, apiHistory, actions, toolPolicy, toolCatalog, attachments: suppliedAttachments, fetch, host: defaultHost, onDeliveryTiming, hostDeliveryStages, persistCommentary = true, completedEnvelope = false, limits = DEFAULT_LIMITS })`
|
|
1732
|
+
- `createConversationRuntime({ engine: defaultEngine = "api", defaultIntegrationId, storage: suppliedStorage, authorize, connections, apiClientFactory, apiHistory, apiTurnNote, actions, toolPolicy, toolCatalog, attachments: suppliedAttachments, fetch, host: defaultHost, onDeliveryTiming, hostDeliveryStages, persistCommentary = true, completedEnvelope = false, limits = DEFAULT_LIMITS })`
|
|
1733
1733
|
|
|
1734
1734
|
### `src/server/conversation/runtimeStateUpgrade.js`
|
|
1735
1735
|
Exports
|
|
@@ -2159,6 +2159,7 @@ Exports
|
|
|
2159
2159
|
- `type ConversationConnections`
|
|
2160
2160
|
- `type ConversationApiClientFactory`
|
|
2161
2161
|
- `type ConversationApiHistory`
|
|
2162
|
+
- `type ConversationApiTurnNote`
|
|
2162
2163
|
- `type ConversationDeliveryTimingObserver`
|
|
2163
2164
|
- `type ConversationLimits`
|
|
2164
2165
|
|
|
@@ -89,7 +89,7 @@ Local functions
|
|
|
89
89
|
|
|
90
90
|
### `src/client/composables/useAssistantRuntime.js`
|
|
91
91
|
Exports
|
|
92
|
-
- `useAssistantRuntime({ api, surfaceId = "", integrationId = "" })`
|
|
92
|
+
- `useAssistantRuntime({ api, surfaceId = "", integrationId = "", pageContext = null })`
|
|
93
93
|
- `type RuntimeScope`
|
|
94
94
|
Local functions
|
|
95
95
|
- `toNonNegativeInteger(value, fallback)`
|
|
@@ -164,6 +164,7 @@ Exports
|
|
|
164
164
|
- `type RealtimeSocket`
|
|
165
165
|
- `type SurfaceRouteContext`
|
|
166
166
|
- `type PlacementRuntime`
|
|
167
|
+
- `type AssistantPageContext`
|
|
167
168
|
- `type WorkspaceScopeSupport`
|
|
168
169
|
- `type ConversationIdentity`
|
|
169
170
|
- `type ConversationReader`
|
|
@@ -474,6 +475,12 @@ Local functions
|
|
|
474
475
|
- `buildCatalogOptions(appConfig = {}, surfaceId = "")`
|
|
475
476
|
- `requireContextSurfaceId(context)`
|
|
476
477
|
|
|
478
|
+
### `src/server/support/pageContext.js`
|
|
479
|
+
Exports
|
|
480
|
+
- `pageContextNote(pageContext)`
|
|
481
|
+
Local functions
|
|
482
|
+
- `escapeCharacter(character)`
|
|
483
|
+
|
|
477
484
|
### `src/server/support/personContext.js`
|
|
478
485
|
Exports
|
|
479
486
|
- `NO_PERSON_CONTEXT`
|
|
@@ -15,7 +15,7 @@ A concrete Fastify, Vue, and JSKIT application foundation for products that do n
|
|
|
15
15
|
|
|
16
16
|
- Id: `app/minimal-foundation`
|
|
17
17
|
- Keywords: `app`, `fastify`, `foundation`, `minimal`, `server`, `vite`, `vue`
|
|
18
|
-
- Owner: `@jskit-ai/agent-docs@0.1.
|
|
18
|
+
- Owner: `@jskit-ai/agent-docs@0.1.356`
|
|
19
19
|
- Read: [PATTERN.md](patterns/app/minimal-foundation/PATTERN.md)
|
|
20
20
|
- Examples: [example/](patterns/app/minimal-foundation/example/)
|
|
21
21
|
- Requires: `@jskit-ai/http-runtime`, `@jskit-ai/kernel`
|
|
@@ -26,7 +26,7 @@ A concrete JSKIT web application foundation with responsive shell navigation, se
|
|
|
26
26
|
|
|
27
27
|
- Id: `app/shell-foundation`
|
|
28
28
|
- Keywords: `app`, `foundation`, `material`, `navigation`, `placements`, `shell`, `vite`, `vue`
|
|
29
|
-
- Owner: `@jskit-ai/agent-docs@0.1.
|
|
29
|
+
- Owner: `@jskit-ai/agent-docs@0.1.356`
|
|
30
30
|
- Read: [PATTERN.md](patterns/app/shell-foundation/PATTERN.md)
|
|
31
31
|
- Examples: [example/](patterns/app/shell-foundation/example/)
|
|
32
32
|
- Requires: `@jskit-ai/http-runtime`, `@jskit-ai/kernel`, `@jskit-ai/shell-web`
|
|
@@ -37,7 +37,7 @@ Configure an assistant runtime for one application surface and expose its chat a
|
|
|
37
37
|
|
|
38
38
|
- Id: `assistant/assistant-surface`
|
|
39
39
|
- Keywords: `ai`, `assistant`, `chat`, `config`, `environment`, `page`, `placement`, `settings`, `surface`
|
|
40
|
-
- Owner: `@jskit-ai/assistant-runtime@0.2.
|
|
40
|
+
- Owner: `@jskit-ai/assistant-runtime@0.2.91`
|
|
41
41
|
- Read: [PATTERN.md](patterns/assistant/assistant-surface/PATTERN.md)
|
|
42
42
|
- Examples: [example/](patterns/assistant/assistant-surface/example/)
|
|
43
43
|
- Requires: `@jskit-ai/assistant-runtime`, `@jskit-ai/connectors-catalog`, `@jskit-ai/connectors-core`, `@jskit-ai/shell-web`
|
|
@@ -367,7 +367,7 @@ Define a server feature through explicit capabilities and first-class actions, a
|
|
|
367
367
|
|
|
368
368
|
- Id: `server/feature-package`
|
|
369
369
|
- Keywords: `actions`, `aggregate`, `feature`, `handle`, `orchestration`, `owns`, `package`, `provider`, `repository`, `routes`, `server`, `table resource`
|
|
370
|
-
- Owner: `@jskit-ai/agent-docs@0.1.
|
|
370
|
+
- Owner: `@jskit-ai/agent-docs@0.1.356`
|
|
371
371
|
- Read: [PATTERN.md](patterns/server/feature-package/PATTERN.md)
|
|
372
372
|
- Examples: [example/](patterns/server/feature-package/example/)
|
|
373
373
|
- Requires: `@jskit-ai/kernel`
|