@things-factory/ai-assistant 10.1.282 → 10.1.288

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.
@@ -336,6 +336,9 @@ export declare class OxAssistantChat extends LitElement {
336
336
  private inviting;
337
337
  /** Who is typing now, by name - kept by `typingRoom`, redrawn on each notice and as they fade. */
338
338
  private typingNames;
339
+ /** What the tool working on this turn last said it is doing; empty when nothing is said. */
340
+ private progressText;
341
+ private _progressSub?;
339
342
  private typingRoom;
340
343
  private _typingSub?;
341
344
  private _typingTimer?;
@@ -419,6 +422,8 @@ export declare class OxAssistantChat extends LitElement {
419
422
  private _startPresence;
420
423
  private _stopPresence;
421
424
  private _startMessageSubscription;
425
+ private _startProgress;
426
+ private _stopProgress;
422
427
  /** The room's "typing" line - notices of the others, which fade by themselves (`TypingRoom`). */
423
428
  private _startTypingSubscription;
424
429
  private _refreshTyping;
@@ -286,6 +286,14 @@ const CHAT_TYPING_SUBSCRIPTION = gql `
286
286
  }
287
287
  }
288
288
  `;
289
+ /* What a long tool call of this turn is doing now - "Building piece 3 of 7" - beside the waiting dots. */
290
+ const ASSISTANT_PROGRESS_SUBSCRIPTION = gql `
291
+ subscription AssistantProgress($key: String!) {
292
+ assistantProgress(key: $key) {
293
+ text
294
+ }
295
+ }
296
+ `;
289
297
  /* The selection a screen request carries, noted before the request (design/ai/shared-dock.md §2-11-1). */
290
298
  const APPEND_SESSION_NOTE_MUTATION = gql `
291
299
  mutation AppendSessionNote($sessionId: String!, $content: String!) {
@@ -363,6 +371,8 @@ let OxAssistantChat = class OxAssistantChat extends LitElement {
363
371
  this.inviting = false;
364
372
  /** Who is typing now, by name - kept by `typingRoom`, redrawn on each notice and as they fade. */
365
373
  this.typingNames = [];
374
+ /** What the tool working on this turn last said it is doing; empty when nothing is said. */
375
+ this.progressText = '';
366
376
  this.typingRoom = new TypingRoom();
367
377
  /** roster online 재평가 트리거 — heartbeat tick 마다 갱신(시간 경과 반영). */
368
378
  this._presenceTick = 0;
@@ -1496,6 +1506,11 @@ let OxAssistantChat = class OxAssistantChat extends LitElement {
1496
1506
  .msg.pending {
1497
1507
  opacity: 0.5;
1498
1508
  }
1509
+ .progress-text {
1510
+ margin-left: 8px;
1511
+ font-size: 0.85em;
1512
+ color: var(--md-sys-color-on-surface-variant);
1513
+ }
1499
1514
  .typing-dots {
1500
1515
  display: inline-flex;
1501
1516
  gap: 4px;
@@ -2848,6 +2863,28 @@ let OxAssistantChat = class OxAssistantChat extends LitElement {
2848
2863
  /* 구독 미지원 환경 — 조용히 스킵 */
2849
2864
  }
2850
2865
  }
2866
+ _startProgress(key) {
2867
+ this._stopProgress();
2868
+ try {
2869
+ this._progressSub = client.subscribe({ query: ASSISTANT_PROGRESS_SUBSCRIPTION, variables: { key } }).subscribe({
2870
+ next: ({ data }) => {
2871
+ if (typeof data?.assistantProgress?.text === 'string')
2872
+ this.progressText = data.assistantProgress.text;
2873
+ },
2874
+ error: () => {
2875
+ /* no progress line - the turn itself is unaffected */
2876
+ }
2877
+ });
2878
+ }
2879
+ catch {
2880
+ /* subscriptions unavailable */
2881
+ }
2882
+ }
2883
+ _stopProgress() {
2884
+ this._progressSub?.unsubscribe();
2885
+ this._progressSub = undefined;
2886
+ this.progressText = '';
2887
+ }
2851
2888
  /** The room's "typing" line - notices of the others, which fade by themselves (`TypingRoom`). */
2852
2889
  _startTypingSubscription() {
2853
2890
  try {
@@ -3011,8 +3048,11 @@ let OxAssistantChat = class OxAssistantChat extends LitElement {
3011
3048
  const prevSameSender = !!prev && prev.role === 'user' && prev.senderEmail === line.senderEmail;
3012
3049
  const showSenderLabel = isOther && !prevSameSender;
3013
3050
  const content = (line.content ?? '').trim();
3014
- /* A "requested" row is the card's state, shown on the card - as a line it would only be the machine's key. */
3015
- if (line.role === 'system' && parseProposalRequestLine(content))
3051
+ /*
3052
+ * "requested" and outcome rows are the card's state, shown on the card - as lines they would only be the
3053
+ * machine's record ("proposal <key>: accepted 14/14"). They stay in the conversation for the model to read.
3054
+ */
3055
+ if (line.role === 'system' && (parseProposalRequestLine(content) || parseProposalOutcomeLine(content)))
3016
3056
  return nothing;
3017
3057
  /*
3018
3058
  * 가려진 줄은 어시스턴트의 말이 아니다 — 마크다운으로 그리지 않고, 복사·재실행 같은 손잡이도
@@ -3032,7 +3072,9 @@ let OxAssistantChat = class OxAssistantChat extends LitElement {
3032
3072
  ? 'open'
3033
3073
  : ''} ${line.redacted ? 'redacted' : ''}">
3034
3074
  ${line.pending
3035
- ? html `<span class="typing-dots"><span></span><span></span><span></span></span>`
3075
+ ? html `<span class="typing-dots"><span></span><span></span><span></span></span>${this.progressText
3076
+ ? html `<span class="progress-text" role="status" aria-live="polite">${this.progressText}</span>`
3077
+ : nothing}`
3036
3078
  : line.redacted
3037
3079
  ? html `<div class="redacted-body"><md-icon>lock</md-icon><span>${content}</span></div>`
3038
3080
  : isMarkdown
@@ -4932,6 +4974,10 @@ let OxAssistantChat = class OxAssistantChat extends LitElement {
4932
4974
  this.errorMessage = undefined;
4933
4975
  // 가짜 pending 응답 표시 (UX 부드럽게)
4934
4976
  this.lines = [...this.lines, { role: 'assistant', content: '', pending: true, _localId: asstLocalId }];
4977
+ /* A key for this turn only: a long tool call tells its progress under it (assistantProgress). */
4978
+ const progressKey = `p${Date.now().toString(36)}${Math.random().toString(36).slice(2, 10)}`;
4979
+ requestContext.hostContext = { ...(requestContext.hostContext ?? {}), progressKey };
4980
+ this._startProgress(progressKey);
4935
4981
  try {
4936
4982
  if (attachmentsToSend.length > 0 && !attachmentIds) {
4937
4983
  requestContext.hostContext = {
@@ -5078,6 +5124,7 @@ let OxAssistantChat = class OxAssistantChat extends LitElement {
5078
5124
  this.lastFailedInput = text;
5079
5125
  }
5080
5126
  finally {
5127
+ this._stopProgress();
5081
5128
  this.busy = false;
5082
5129
  }
5083
5130
  }
@@ -5298,6 +5345,10 @@ __decorate([
5298
5345
  state(),
5299
5346
  __metadata("design:type", Array)
5300
5347
  ], OxAssistantChat.prototype, "typingNames", void 0);
5348
+ __decorate([
5349
+ state(),
5350
+ __metadata("design:type", Object)
5351
+ ], OxAssistantChat.prototype, "progressText", void 0);
5301
5352
  __decorate([
5302
5353
  state(),
5303
5354
  __metadata("design:type", Object)
@@ -26,6 +26,8 @@ const tslib_1 = require("tslib");
26
26
  * document are not offered here — `registryAssistantChat` enforces that, and it decides what may
27
27
  * be dispatched from the same list it offers, so the two cannot drift apart.
28
28
  */
29
+ const assistant_progress_js_1 = require("./chat-message/assistant-progress.js");
30
+ const assistant_progress_subscription_js_1 = require("./chat-message/assistant-progress-subscription.js");
29
31
  const type_graphql_1 = require("type-graphql");
30
32
  const graphql_scalars_1 = require("graphql-scalars");
31
33
  require("@things-factory/auth-base");
@@ -281,6 +283,10 @@ let AssistantChatResolver = class AssistantChatResolver {
281
283
  toolAccess: (0, tool_access_js_1.toolAccessFor)(context),
282
284
  /* The stop notice is a sentence a person reads — the server writes it in their language (ADR-0054). */
283
285
  t,
286
+ /* A long tool call says what it is doing to the person waiting on this turn, under the key their screen made. */
287
+ ...((0, assistant_progress_js_1.progressKeyOf)(input.hostContext) && context.state.user?.id
288
+ ? { progress: (text) => (0, assistant_progress_subscription_js_1.publishAssistantProgress)({ domainId: domain.id, userId: context.state.user.id, key: (0, assistant_progress_js_1.progressKeyOf)(input.hostContext), text }) }
289
+ : {}),
284
290
  hostContext: input.hostContext,
285
291
  attachments: turnFiles.forTools,
286
292
  state: context.state
@@ -26,6 +26,7 @@ export interface ModeTurnInput {
26
26
  conversation?: {
27
27
  id: string;
28
28
  };
29
+ progress?: (text: string) => void;
29
30
  attachments?: ToolAttachment[];
30
31
  /** A run's limits: lookups, no wrap-up call, a stop. The conversation door's own when absent. */
31
32
  limits?: {
@@ -25,6 +25,7 @@ async function runModeTurn(input) {
25
25
  ...(input.conversation?.id ? { conversation: { id: input.conversation.id } } : {}),
26
26
  toolAccess: input.toolAccess,
27
27
  ...(input.t ? { t: input.t } : {}),
28
+ ...(input.progress ? { progress: input.progress } : {}),
28
29
  hostContext: input.hostContext,
29
30
  ...(input.attachments ? { attachments: input.attachments } : {}),
30
31
  /*
@@ -0,0 +1,11 @@
1
+ import { type AssistantProgressPayload } from './assistant-progress.js';
2
+ export declare class AssistantProgress {
3
+ key: string;
4
+ text: string;
5
+ at: string;
6
+ }
7
+ /** Tells the waiting person; a notice missed is a line that does not show, nothing else rests on it. */
8
+ export declare function publishAssistantProgress(payload: Omit<AssistantProgressPayload, 'at'>): void;
9
+ export declare class AssistantProgressSubscription {
10
+ assistantProgress(payload: AssistantProgressPayload, key: string): AssistantProgress;
11
+ }
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AssistantProgressSubscription = exports.AssistantProgress = void 0;
4
+ exports.publishAssistantProgress = publishAssistantProgress;
5
+ const tslib_1 = require("tslib");
6
+ /*
7
+ * AssistantProgressSubscription - a long tool call's progress, live, for the person waiting on that turn. The rules are
8
+ * in `assistant-progress.ts`; this file holds only pubsub and the decorators.
9
+ */
10
+ const type_graphql_1 = require("type-graphql");
11
+ const graphql_yoga_1 = require("graphql-yoga");
12
+ const shell_1 = require("@things-factory/shell");
13
+ const assistant_progress_js_1 = require("./assistant-progress.js");
14
+ let AssistantProgress = class AssistantProgress {
15
+ };
16
+ exports.AssistantProgress = AssistantProgress;
17
+ tslib_1.__decorate([
18
+ (0, type_graphql_1.Field)({ description: 'The key the screen made for the turn.' }),
19
+ tslib_1.__metadata("design:type", String)
20
+ ], AssistantProgress.prototype, "key", void 0);
21
+ tslib_1.__decorate([
22
+ (0, type_graphql_1.Field)({ description: 'What it is doing, in the person\'s language.' }),
23
+ tslib_1.__metadata("design:type", String)
24
+ ], AssistantProgress.prototype, "text", void 0);
25
+ tslib_1.__decorate([
26
+ (0, type_graphql_1.Field)({ description: 'When (ISO).' }),
27
+ tslib_1.__metadata("design:type", String)
28
+ ], AssistantProgress.prototype, "at", void 0);
29
+ exports.AssistantProgress = AssistantProgress = tslib_1.__decorate([
30
+ (0, type_graphql_1.ObjectType)({ description: 'What a long tool call of this turn is doing now. Nothing is stored.' })
31
+ ], AssistantProgress);
32
+ /** Tells the waiting person; a notice missed is a line that does not show, nothing else rests on it. */
33
+ function publishAssistantProgress(payload) {
34
+ try {
35
+ shell_1.pubsub.publish(assistant_progress_js_1.ASSISTANT_PROGRESS_TOPIC, { ...payload, at: new Date().toISOString() });
36
+ }
37
+ catch {
38
+ /* nothing rests on it */
39
+ }
40
+ }
41
+ let AssistantProgressSubscription = class AssistantProgressSubscription {
42
+ assistantProgress(payload, key) {
43
+ return { key: payload.key, text: payload.text, at: payload.at };
44
+ }
45
+ };
46
+ exports.AssistantProgressSubscription = AssistantProgressSubscription;
47
+ tslib_1.__decorate([
48
+ (0, type_graphql_1.Subscription)(() => AssistantProgress, {
49
+ description: 'Subscribes to the progress of the caller\'s own turn, by the key their screen sent with it.',
50
+ subscribe: async ({ args, context }) => {
51
+ const { domain, user } = context.state;
52
+ await (0, shell_1.assertDomainSubscribeAllowed)(domain, user, (d, u) => process.superUserGranted(d, u));
53
+ return (0, graphql_yoga_1.pipe)(shell_1.pubsub.subscribe(assistant_progress_js_1.ASSISTANT_PROGRESS_TOPIC), (0, graphql_yoga_1.filter)((0, assistant_progress_js_1.assistantProgressFilter)(domain.id, user?.id, args.key)));
54
+ }
55
+ }),
56
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
57
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('key')),
58
+ tslib_1.__metadata("design:type", Function),
59
+ tslib_1.__metadata("design:paramtypes", [Object, String]),
60
+ tslib_1.__metadata("design:returntype", AssistantProgress)
61
+ ], AssistantProgressSubscription.prototype, "assistantProgress", null);
62
+ exports.AssistantProgressSubscription = AssistantProgressSubscription = tslib_1.__decorate([
63
+ (0, type_graphql_1.Resolver)(AssistantProgress)
64
+ ], AssistantProgressSubscription);
65
+ //# sourceMappingURL=assistant-progress-subscription.js.map
@@ -0,0 +1,11 @@
1
+ export declare const ASSISTANT_PROGRESS_TOPIC = "ai-assistant-progress";
2
+ export interface AssistantProgressPayload {
3
+ domainId: string;
4
+ userId: string;
5
+ key: string;
6
+ text: string;
7
+ at: string;
8
+ }
9
+ /** A key a screen made for one turn: short, plain. Anything else is not listened for. */
10
+ export declare function progressKeyOf(host: unknown): string | undefined;
11
+ export declare function assistantProgressFilter(domainId: string, userId: string | undefined, key: string): (payload: AssistantProgressPayload) => boolean;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ASSISTANT_PROGRESS_TOPIC = void 0;
4
+ exports.progressKeyOf = progressKeyOf;
5
+ exports.assistantProgressFilter = assistantProgressFilter;
6
+ /*
7
+ * What a long tool call is doing now, for the person waiting on it (2026-11-13: a figure built piece by piece took
8
+ * minutes behind three dots). Nothing is stored. A notice goes only to the user whose turn it is, in the same domain,
9
+ * under the key their screen made for that turn -- the key is the client's and only names the turn; who may hear is
10
+ * the server's.
11
+ */
12
+ exports.ASSISTANT_PROGRESS_TOPIC = 'ai-assistant-progress';
13
+ /** A key a screen made for one turn: short, plain. Anything else is not listened for. */
14
+ function progressKeyOf(host) {
15
+ const key = host?.progressKey;
16
+ return typeof key === 'string' && /^[A-Za-z0-9_-]{8,64}$/.test(key) ? key : undefined;
17
+ }
18
+ function assistantProgressFilter(domainId, userId, key) {
19
+ return (payload) => !!userId && payload.domainId === domainId && payload.userId === userId && payload.key === key;
20
+ }
21
+ //# sourceMappingURL=assistant-progress.js.map
@@ -6,6 +6,7 @@ import { AiAgentResolver } from './ai-agent-resolver.js';
6
6
  import { MySessionActivitySubscription } from './chat-session/session-activity-subscription.js';
7
7
  import { ChatMessageSubscription } from './chat-message/chat-message-subscription.js';
8
8
  import { ChatTypingSubscription } from './chat-message/chat-typing-subscription.js';
9
+ import { AssistantProgressSubscription } from './chat-message/assistant-progress-subscription.js';
9
10
  import './chat-session/attachment-tools.js';
10
11
  import './chat-session/session-purge.js';
11
12
  import './chat-session/attachment-route.js';
@@ -53,5 +54,5 @@ export { assertMayWriteSession } from './chat-session/session-write-gate.js';
53
54
  export * from './unattended-run/index.js';
54
55
  export declare const entities: (typeof import("./chat-message/chat-message.js").ChatMessage | typeof import("./chat-session/chat-session.js").ChatSession | typeof import("./chat-session-participant/chat-session-participant.js").ChatSessionParticipant | typeof import("./unattended-run/assistant-run.js").AssistantRun)[];
55
56
  export declare const schema: {
56
- resolverClasses: (typeof ChatSessionResolver | typeof AssistantChatResolver | typeof AssistantModeResolver | typeof AssistantCapabilityResolver | typeof AiAgentResolver | typeof MySessionActivitySubscription | typeof ChatMessageSubscription | typeof ChatTypingSubscription | typeof EntryProposalResolver)[];
57
+ resolverClasses: (typeof ChatSessionResolver | typeof AssistantProgressSubscription | typeof AssistantChatResolver | typeof AssistantModeResolver | typeof AssistantCapabilityResolver | typeof AiAgentResolver | typeof MySessionActivitySubscription | typeof ChatMessageSubscription | typeof ChatTypingSubscription | typeof EntryProposalResolver)[];
57
58
  };
@@ -10,6 +10,7 @@ const ai_agent_resolver_js_1 = require("./ai-agent-resolver.js");
10
10
  const session_activity_subscription_js_1 = require("./chat-session/session-activity-subscription.js");
11
11
  const chat_message_subscription_js_1 = require("./chat-message/chat-message-subscription.js");
12
12
  const chat_typing_subscription_js_1 = require("./chat-message/chat-typing-subscription.js");
13
+ const assistant_progress_subscription_js_1 = require("./chat-message/assistant-progress-subscription.js");
13
14
  const index_js_1 = require("./chat-session/index.js");
14
15
  const index_js_2 = require("./chat-message/index.js");
15
16
  const index_js_3 = require("./chat-session-participant/index.js");
@@ -105,6 +106,7 @@ exports.schema = {
105
106
  chat_message_subscription_js_1.ChatMessageSubscription,
106
107
  /* 「입력 중」 — 저장하지 않는 방의 한 줄. 듣는 사람은 메시지와 같은 방 판정을 지난다. */
107
108
  chat_typing_subscription_js_1.ChatTypingSubscription,
109
+ assistant_progress_subscription_js_1.AssistantProgressSubscription,
108
110
  /* 내가 참여한 모든 세션의 활동 — 창을 닫아 둔 표면이 배지·목록을 갱신할 수 있게. */
109
111
  session_activity_subscription_js_1.MySessionActivitySubscription,
110
112
  /* 사람이 누른 입력 제안을 쓰는 자리 — 행마다 앱의 코드로, 그 사람의 권한으로. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/ai-assistant",
3
- "version": "10.1.282",
3
+ "version": "10.1.288",
4
4
  "main": "dist-server/index.js",
5
5
  "things-factory": true,
6
6
  "author": "heartyoh",
@@ -37,14 +37,14 @@
37
37
  "@operato/shell": "^10.29.69",
38
38
  "@operato/styles": "^10.0.0",
39
39
  "@operato/utils": "^10.29.76",
40
- "@things-factory/ai-client-base": "^10.1.282",
41
- "@things-factory/apptool-base": "^10.1.282",
42
- "@things-factory/attachment-base": "^10.1.282",
43
- "@things-factory/auth-base": "^10.1.282",
40
+ "@things-factory/ai-client-base": "^10.1.283",
41
+ "@things-factory/apptool-base": "^10.1.283",
42
+ "@things-factory/attachment-base": "^10.1.283",
43
+ "@things-factory/auth-base": "^10.1.283",
44
44
  "@things-factory/env": "^10.1.281",
45
- "@things-factory/help": "^10.1.282",
46
- "@things-factory/setting-base": "^10.1.282",
47
- "@things-factory/shell": "^10.1.282",
45
+ "@things-factory/help": "^10.1.283",
46
+ "@things-factory/setting-base": "^10.1.283",
47
+ "@things-factory/shell": "^10.1.283",
48
48
  "dompurify": "^3.0.0",
49
49
  "exceljs": "4.2.0",
50
50
  "graphql-scalars": "^1.22.0",
@@ -74,5 +74,5 @@
74
74
  "copyfiles": "^2.4.1",
75
75
  "rimraf": "^5.0.0"
76
76
  },
77
- "gitHead": "6a232e670bdb52e1420b1d33cdeeb37ceb0f26b8"
77
+ "gitHead": "78eaee46dd9b425ed845b02952b082f35a0faca7"
78
78
  }