@dudousxd/nestjs-agent-react 0.22.1 → 0.24.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 CHANGED
@@ -729,6 +729,11 @@ const { files } = chat.composer;
729
729
  <button disabled={!chat.composer.canSend} onClick={() => chat.composer.submit()} />
730
730
  ```
731
731
 
732
+ `accept`, `maxBytes` and `maxFiles` default to the server's own limits (`GET <base>/config`, read
733
+ once per backend by `useAgentConfig()`), so the composer never repeats them; pass them only to
734
+ narrow further. What a send carries is `files.refs` — `{ mediaId }` only, the one shape the server
735
+ accepts (each item's full `attachment` is there for display).
736
+
732
737
  An item is `uploading`, `ready`, `error` (retry with `files.retry(id)`) or `rejected` (failed
733
738
  `accept`/`maxBytes`/`maxFiles` and never uploaded; `error` says why). `remove` cancels an upload in
734
739
  flight. `messageFiles(message)` reads the files back off any message — live or replayed — with a
@@ -1,4 +1,4 @@
1
- import { ThreadSummary, ThreadDetail, MessageAttachment, ToolCatalogEntry, SkillCatalogEntry, QuotaReport, ModelCatalogView, AgentCatalogEntry, MessageFeedbackValue, MessageFeedback } from '@dudousxd/nestjs-agent-core';
1
+ import { ThreadSummary, ThreadDetail, MessageAttachment, ToolCatalogEntry, SkillCatalogEntry, QuotaReport, ModelCatalogView, AgentCatalogEntry, AgentClientConfig, MessageFeedbackValue, MessageFeedback } from '@dudousxd/nestjs-agent-core';
2
2
 
3
3
  /**
4
4
  * Partial update accepted by `PATCH <base>/threads/:threadId`. `defaultAgent: null` clears a
@@ -123,6 +123,8 @@ interface AgentBackend {
123
123
  listModels?(agent?: string): Promise<ModelCatalogView>;
124
124
  /** `GET <base>/agents` — what an agent picker offers. */
125
125
  listAgents?(): Promise<AgentCatalogEntry[]>;
126
+ /** `GET <base>/config` — attachment limits and upload mode, and which features are on. */
127
+ getConfig?(): Promise<AgentClientConfig>;
126
128
  setMessageFeedback?(messageId: string, input: MessageFeedbackInput): Promise<{
127
129
  feedback: MessageFeedback | null;
128
130
  }>;
@@ -246,6 +248,8 @@ declare class AgentClient implements AgentBackend {
246
248
  listModels(agent?: string): Promise<ModelCatalogView>;
247
249
  /** `GET <path>/agents` — the registered agents, the default one flagged. */
248
250
  listAgents(): Promise<AgentCatalogEntry[]>;
251
+ /** `GET <path>/config` — attachment limits and upload mode, and which features are on. */
252
+ getConfig(): Promise<AgentClientConfig>;
249
253
  /** `GET <path>/quota` — the caller's budget windows and the one blocking sends, if any. */
250
254
  getQuota(): Promise<QuotaReport>;
251
255
  cancelStream(runId: string): Promise<CancelResult>;
@@ -1,4 +1,4 @@
1
- import { ThreadSummary, ThreadDetail, MessageAttachment, ToolCatalogEntry, SkillCatalogEntry, QuotaReport, ModelCatalogView, AgentCatalogEntry, MessageFeedbackValue, MessageFeedback } from '@dudousxd/nestjs-agent-core';
1
+ import { ThreadSummary, ThreadDetail, MessageAttachment, ToolCatalogEntry, SkillCatalogEntry, QuotaReport, ModelCatalogView, AgentCatalogEntry, AgentClientConfig, MessageFeedbackValue, MessageFeedback } from '@dudousxd/nestjs-agent-core';
2
2
 
3
3
  /**
4
4
  * Partial update accepted by `PATCH <base>/threads/:threadId`. `defaultAgent: null` clears a
@@ -123,6 +123,8 @@ interface AgentBackend {
123
123
  listModels?(agent?: string): Promise<ModelCatalogView>;
124
124
  /** `GET <base>/agents` — what an agent picker offers. */
125
125
  listAgents?(): Promise<AgentCatalogEntry[]>;
126
+ /** `GET <base>/config` — attachment limits and upload mode, and which features are on. */
127
+ getConfig?(): Promise<AgentClientConfig>;
126
128
  setMessageFeedback?(messageId: string, input: MessageFeedbackInput): Promise<{
127
129
  feedback: MessageFeedback | null;
128
130
  }>;
@@ -246,6 +248,8 @@ declare class AgentClient implements AgentBackend {
246
248
  listModels(agent?: string): Promise<ModelCatalogView>;
247
249
  /** `GET <path>/agents` — the registered agents, the default one flagged. */
248
250
  listAgents(): Promise<AgentCatalogEntry[]>;
251
+ /** `GET <path>/config` — attachment limits and upload mode, and which features are on. */
252
+ getConfig(): Promise<AgentClientConfig>;
249
253
  /** `GET <path>/quota` — the caller's budget windows and the one blocking sends, if any. */
250
254
  getQuota(): Promise<QuotaReport>;
251
255
  cancelStream(runId: string): Promise<CancelResult>;