@hiver/connector-agent 4.20.0 → 4.21.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/features/write-form/api/__tests__/getConversationSummary.test.d.ts +2 -0
- package/features/write-form/api/__tests__/getConversationSummary.test.d.ts.map +1 -0
- package/features/write-form/api/getConversationSummary.d.ts +17 -0
- package/features/write-form/api/getConversationSummary.d.ts.map +1 -0
- package/features/write-form/components/write-form/index.d.ts.map +1 -1
- package/features/write-form/constants/api.d.ts +1 -0
- package/features/write-form/constants/api.d.ts.map +1 -1
- package/features/write-form/utils/__tests__/conversationSummary.test.d.ts +2 -0
- package/features/write-form/utils/__tests__/conversationSummary.test.d.ts.map +1 -0
- package/features/write-form/utils/conversationSummary.d.ts +37 -0
- package/features/write-form/utils/conversationSummary.d.ts.map +1 -0
- package/index.es.js +6691 -6602
- package/index.umd.js +426 -426
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getConversationSummary.test.d.ts","sourceRoot":"","sources":["../../../../../src/features/write-form/api/__tests__/getConversationSummary.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface ConversationSummaryResponse {
|
|
2
|
+
summary: string;
|
|
3
|
+
retryable?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const getConversationSummaryQueryKey: (conversationId?: number, smId?: string, maxChars?: number) => (string | number | undefined)[];
|
|
6
|
+
/**
|
|
7
|
+
* Fetches the AI-generated conversation summary for a field mapped to
|
|
8
|
+
* `{{conversation_summary}}`. The backend resolves freshness itself (no
|
|
9
|
+
* fingerprint params), so we only pass the conversation, the shared mailbox and
|
|
10
|
+
* the field's character cap. Returns `{ summary }` — may be an empty string,
|
|
11
|
+
* in which case the caller leaves the field empty (never an error).
|
|
12
|
+
*
|
|
13
|
+
* Same `/v1/api/connectors/...` namespace as the form default-values endpoint,
|
|
14
|
+
* so the connector bifrost reaches it identically.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useConversationSummaryQuery(conversationId?: number, smId?: string, maxChars?: number, enabled?: boolean): import('@tanstack/react-query').UseQueryResult<ConversationSummaryResponse, Error>;
|
|
17
|
+
//# sourceMappingURL=getConversationSummary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getConversationSummary.d.ts","sourceRoot":"","sources":["../../../../src/features/write-form/api/getConversationSummary.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,MAAM,CAAC;IAGhB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,8BAA8B,oBAAqB,MAAM,SAAS,MAAM,aAAa,MAAM,oCAOvG,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CACzC,cAAc,CAAC,EAAE,MAAM,EACvB,IAAI,CAAC,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,GAAE,OAAc,sFA8BxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/write-form/components/write-form/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/write-form/components/write-form/index.tsx"],"names":[],"mappings":"AA4DA,OAAO,KAAK,EAA+B,UAAU,EAAkB,MAAM,eAAe,CAAC;AAwB7F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,KAAK,EAA+B,UAAU,EAAc,MAAM,cAAc,CAAC;AAGxF,eAAO,MAAM,iBAAiB,wCAAwC,CAAC;AAEvE,UAAU,cAAc;IACtB,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAClC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC,CAAC;IACxE,cAAc,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/D,eAAe,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IAC3E,iBAAiB,CAAC,EAAE,CAAC,aAAa,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;CAC1D;AACD,QAAA,MAAM,SAAS,gJAWZ,cAAc,4CAg1BhB,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -9,5 +9,6 @@ export declare const CUSTOM_FIELDS_API_PATH: string;
|
|
|
9
9
|
export declare const FIELD_CUSTOM_FIELDS_API_PATH: string;
|
|
10
10
|
export declare const FORM_DEFAULTS_API = "/v1/api/connectors/forms/:formId/defaults";
|
|
11
11
|
export declare const FORM_DEFAULT_VALUES_API = "/v1/api/connectors/forms/:formId/default-values";
|
|
12
|
+
export declare const CONVERSATION_SUMMARY_API = "/v1/api/connectors/conversation-summary";
|
|
12
13
|
export declare const ATTACHMENTS_API = "/v1/api/connectors/attachments";
|
|
13
14
|
//# sourceMappingURL=api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/features/write-form/constants/api.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,YAAY,CAAC;AAClC,eAAO,MAAM,qBAAqB,EAAE,MAA4C,CAAC;AACjF,eAAO,MAAM,eAAe,EAAE,MAAkD,CAAC;AACjF,eAAO,MAAM,aAAa,EAAE,MAAgD,CAAC;AAC7E,eAAO,MAAM,gBAAgB,EAAE,MAAmD,CAAC;AACnF,eAAO,MAAM,WAAW,EAAE,MAA8C,CAAC;AACzE,eAAO,MAAM,kCAAkC,EAAE,MAAoD,CAAC;AACtG,eAAO,MAAM,sBAAsB,EAAE,MAAuE,CAAC;AAC7G,eAAO,MAAM,4BAA4B,EAAE,MAA8E,CAAC;AAC1H,eAAO,MAAM,iBAAiB,8CAAkD,CAAC;AACjF,eAAO,MAAM,uBAAuB,oDAAwD,CAAC;AAC7F,eAAO,MAAM,eAAe,mCAAuC,CAAC"}
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/features/write-form/constants/api.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,YAAY,CAAC;AAClC,eAAO,MAAM,qBAAqB,EAAE,MAA4C,CAAC;AACjF,eAAO,MAAM,eAAe,EAAE,MAAkD,CAAC;AACjF,eAAO,MAAM,aAAa,EAAE,MAAgD,CAAC;AAC7E,eAAO,MAAM,gBAAgB,EAAE,MAAmD,CAAC;AACnF,eAAO,MAAM,WAAW,EAAE,MAA8C,CAAC;AACzE,eAAO,MAAM,kCAAkC,EAAE,MAAoD,CAAC;AACtG,eAAO,MAAM,sBAAsB,EAAE,MAAuE,CAAC;AAC7G,eAAO,MAAM,4BAA4B,EAAE,MAA8E,CAAC;AAC1H,eAAO,MAAM,iBAAiB,8CAAkD,CAAC;AACjF,eAAO,MAAM,uBAAuB,oDAAwD,CAAC;AAC7F,eAAO,MAAM,wBAAwB,4CAAgD,CAAC;AACtF,eAAO,MAAM,eAAe,mCAAuC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversationSummary.test.d.ts","sourceRoot":"","sources":["../../../../../src/features/write-form/utils/__tests__/conversationSummary.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const CONVERSATION_SUMMARY_TOKEN = "{{conversation_summary}}";
|
|
2
|
+
export declare const SUMMARY_GENERATING_PLACEHOLDER = "Generating summary\u2026";
|
|
3
|
+
/**
|
|
4
|
+
* Scans the resolved form defaults (per-field, mapped 1:1 from the
|
|
5
|
+
* `/default-values` response) for field(s) still awaiting the summary.
|
|
6
|
+
*
|
|
7
|
+
* The token may be the entire value (`{{conversation_summary}}`) or embedded in
|
|
8
|
+
* admin-authored text (`test - {{conversation_summary}}`), so this matches on
|
|
9
|
+
* containment — an exact-equality check silently skipped the embedded case and
|
|
10
|
+
* no summary was ever requested for it.
|
|
11
|
+
*/
|
|
12
|
+
export declare const getConversationSummaryFieldNames: (defaults?: Record<string, unknown> | null) => string[];
|
|
13
|
+
/**
|
|
14
|
+
* Substitutes the fetched summary into a field value, preserving whatever the
|
|
15
|
+
* admin configured around the token. An empty `summary` (feature off, over
|
|
16
|
+
* quota, generation failed) drops the token instead, so the literal token can
|
|
17
|
+
* never reach the third-party system.
|
|
18
|
+
*/
|
|
19
|
+
export declare const applySummaryToValue: (value: string, summary: string) => string;
|
|
20
|
+
/**
|
|
21
|
+
* Of the detected summary fields, the ones whose CURRENT form value still holds
|
|
22
|
+
* the token — i.e. the substitution is still owed.
|
|
23
|
+
*
|
|
24
|
+
* Derived from live form state rather than from the resolved-defaults snapshot on
|
|
25
|
+
* purpose: on a reopened form the defaults and an already-cached summary arrive in
|
|
26
|
+
* the same render, and `setFormDefaults` only reaches form state on the next one.
|
|
27
|
+
* Anything keyed off the defaults alone therefore looks at empty values, skips,
|
|
28
|
+
* and never re-runs — leaving the raw token in the field.
|
|
29
|
+
*/
|
|
30
|
+
export declare const getPendingSummaryFields: (fieldNames: string[], values: Record<string, unknown>) => string[];
|
|
31
|
+
/**
|
|
32
|
+
* Clears any token still sitting in the summary-mapped fields. Used on submit:
|
|
33
|
+
* the summary takes seconds to generate and the form can be submitted before it
|
|
34
|
+
* lands, and the literal token must never reach the third-party system.
|
|
35
|
+
*/
|
|
36
|
+
export declare const withSummaryTokensCleared: <T extends Record<string, unknown>>(values: T, fieldNames: string[]) => T;
|
|
37
|
+
//# sourceMappingURL=conversationSummary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversationSummary.d.ts","sourceRoot":"","sources":["../../../../src/features/write-form/utils/conversationSummary.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,0BAA0B,6BAA6B,CAAC;AAGrE,eAAO,MAAM,8BAA8B,6BAAwB,CAAC;AAEpE;;;;;;;;GAQG;AACH,eAAO,MAAM,gCAAgC,cAAe,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,KAAG,MAAM,EAUlG,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,UAAW,MAAM,WAAW,MAAM,KAAG,MACd,CAAC;AAExD;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,eAAgB,MAAM,EAAE,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,MAAM,EAIlG,CAAC;AAEL;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,cAAc,MAAM,EAAE,KAAG,CAQ7G,CAAC"}
|