@blokkli/editor 2.0.0-alpha.63 → 2.0.0-alpha.65
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/dist/global/types/blockOptions.d.ts +32 -27
- package/dist/module.d.mts +2 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +154 -5
- package/dist/modules/agent/index.d.mts +1 -1
- package/dist/modules/agent/index.mjs +2 -1
- package/dist/modules/agent/runtime/app/components/Attachment/PreviewCsv/index.vue +1 -1
- package/dist/modules/agent/runtime/app/features/agent/ConversationsAdmin/SplitView/index.d.vue.ts +1 -1
- package/dist/modules/agent/runtime/app/features/agent/ConversationsAdmin/SplitView/index.vue.d.ts +1 -1
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.vue +1 -1
- package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/index.vue +1 -1
- package/dist/modules/agent/runtime/app/features/agent/Transcript/index.vue +1 -1
- package/dist/modules/agent/runtime/app/features/agent/index.vue +1 -1
- package/dist/modules/agent/runtime/app/helpers/mutationResult.d.ts +12 -0
- package/dist/modules/agent/runtime/app/helpers/mutationResult.js +34 -0
- package/dist/modules/agent/runtime/app/providers/toolsProvider.js +13 -7
- package/dist/modules/agent/runtime/app/tools/add_content_search_paragraphs/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/add_fragment/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/add_media_paragraph/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/add_paragraphs/index.d.ts +16 -5
- package/dist/modules/agent/runtime/app/tools/add_paragraphs/index.js +43 -15
- package/dist/modules/agent/runtime/app/tools/add_reusable_paragraph/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/add_template/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/ask_question/Component.vue +1 -1
- package/dist/modules/agent/runtime/app/tools/ask_question/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/delete_paragraphs/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/detach_reusable_paragraph/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/duplicate_paragraphs/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/fieldDiffApproval.js +1 -3
- package/dist/modules/agent/runtime/app/tools/find_paragraphs/index.d.ts +2 -2
- package/dist/modules/agent/runtime/app/tools/get_bundle_info/index.js +6 -2
- package/dist/modules/agent/runtime/app/tools/get_content_fields/index.d.ts +3 -3
- package/dist/modules/agent/runtime/app/tools/get_paragraph_context/index.d.ts +5 -5
- package/dist/modules/agent/runtime/app/tools/get_paragraphs_in_viewport/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/get_referenced_entities/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/go_to_history_index/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/move_paragraphs/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/rearrange_paragraphs/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/replace_content_search_item/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/replace_media_field/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/schemas.d.ts +2 -2
- package/dist/modules/agent/runtime/app/tools/set_paragraph_options/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/swap_paragraphs/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/update_text_fields/index.d.ts +3 -3
- package/dist/modules/agent/runtime/server/classes/FieldStreamParser/index.js +10 -15
- package/dist/modules/agent/runtime/server/server-tools/load_tools/index.d.ts +1 -3
- package/dist/modules/agent/runtime/server/server-tools/load_tools/index.js +3 -1
- package/dist/modules/agent/runtime/shared/toolParams.d.ts +3 -3
- package/dist/modules/agent/runtime/shared/types.d.ts +3 -3
- package/dist/modules/charts/index.d.mts +14 -1
- package/dist/modules/charts/index.mjs +37 -2
- package/dist/modules/charts/runtime/features/charts/Editor/AdvancedConfigPanel/index.vue +1 -1
- package/dist/modules/charts/runtime/features/charts/Editor/ChartTypeOptions/Field.vue +19 -9
- package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/OutputPreviewTable/index.vue +1 -1
- package/dist/modules/charts/runtime/features/charts/Editor/DataTable/index.vue +16 -8
- package/dist/modules/charts/runtime/features/charts/Editor/NumberFormatEditor/index.vue +23 -7
- package/dist/modules/charts/runtime/features/charts/Editor/index.vue +5 -6
- package/dist/modules/drupal/graphql/base/fragment.paragraphsBlokkliEditState.graphql +5 -0
- package/dist/modules/drupal/index.d.mts +1 -1
- package/dist/modules/drupal/runtime/adapter/index.js +3 -0
- package/dist/modules/iframes/index.d.mts +1 -1
- package/dist/modules/index.d.mts +1 -1
- package/dist/modules/readability/index.d.mts +1 -1
- package/dist/modules/readability/index.mjs +2 -1
- package/dist/modules/table-of-contents/index.d.mts +1 -1
- package/dist/runtime/components/Blocks/NotImplemented/index.vue +1 -1
- package/dist/runtime/editor/components/Actions/Title/index.vue +1 -1
- package/dist/runtime/editor/components/Actions/index.vue +1 -1
- package/dist/runtime/editor/components/ArtboardTooltip/index.d.vue.ts +1 -0
- package/dist/runtime/editor/components/ArtboardTooltip/index.vue +2 -2
- package/dist/runtime/editor/components/ArtboardTooltip/index.vue.d.ts +1 -0
- package/dist/runtime/editor/components/Avatar/index.vue +1 -1
- package/dist/runtime/editor/components/BlockPreviewItem/index.vue +1 -1
- package/dist/runtime/editor/components/BlockPreviewRenderer/index.vue +1 -1
- package/dist/runtime/editor/components/BlockProxy/index.vue +1 -1
- package/dist/runtime/editor/components/BlokkliRootErrorBoundary.vue +1 -1
- package/dist/runtime/editor/components/BundleSelector/index.vue +1 -1
- package/dist/runtime/editor/components/ColorDropdown/index.vue +1 -1
- package/dist/runtime/editor/components/Dialog/index.vue +1 -1
- package/dist/runtime/editor/components/DiffApproval/Toolbar/index.vue +1 -1
- package/dist/runtime/editor/components/DiffApproval/types.js +1 -3
- package/dist/runtime/editor/components/DiffViewer/State.vue +1 -1
- package/dist/runtime/editor/components/DraggableList.vue +1 -1
- package/dist/runtime/editor/components/Dropdown/index.d.vue.ts +1 -0
- package/dist/runtime/editor/components/Dropdown/index.vue +2 -2
- package/dist/runtime/editor/components/Dropdown/index.vue.d.ts +1 -0
- package/dist/runtime/editor/components/DropdownItem/index.vue +1 -1
- package/dist/runtime/editor/components/EditIndicator.vue +1 -1
- package/dist/runtime/editor/components/EditProvider.vue +2 -2
- package/dist/runtime/editor/components/FileDropHandler/index.vue +1 -1
- package/dist/runtime/editor/components/FlexTextarea/index.d.vue.ts +1 -1
- package/dist/runtime/editor/components/FlexTextarea/index.vue.d.ts +1 -1
- package/dist/runtime/editor/components/Form/RadioTabs/index.vue +1 -1
- package/dist/runtime/editor/components/Form/Search/index.d.vue.ts +1 -0
- package/dist/runtime/editor/components/Form/Search/index.vue +2 -2
- package/dist/runtime/editor/components/Form/Search/index.vue.d.ts +1 -0
- package/dist/runtime/editor/components/FormOverlay/index.vue +1 -1
- package/dist/runtime/editor/components/Icon/index.vue +1 -1
- package/dist/runtime/editor/components/Indicators/index.vue +31 -100
- package/dist/runtime/editor/components/Konami/Game/index.vue +1 -1
- package/dist/runtime/editor/components/Messages/index.vue +1 -1
- package/dist/runtime/editor/components/NestedEditorOverlay/index.d.vue.ts +1 -0
- package/dist/runtime/editor/components/NestedEditorOverlay/index.vue +2 -1
- package/dist/runtime/editor/components/NestedEditorOverlay/index.vue.d.ts +1 -0
- package/dist/runtime/editor/components/Overlay/index.vue +1 -1
- package/dist/runtime/editor/components/Pagination/index.vue +1 -1
- package/dist/runtime/editor/components/Panel/Section/index.vue +1 -1
- package/dist/runtime/editor/components/Panel/Tabs/index.d.vue.ts +1 -1
- package/dist/runtime/editor/components/Panel/Tabs/index.vue.d.ts +1 -1
- package/dist/runtime/editor/components/PluginConfigForm/index.vue +1 -1
- package/dist/runtime/editor/components/PluginConfigFormInline/FilterSelect/index.vue +1 -1
- package/dist/runtime/editor/components/PluginConfigFormInline/index.vue +1 -1
- package/dist/runtime/editor/components/Popup/index.vue +1 -1
- package/dist/runtime/editor/components/PreviewProvider.vue +3 -2
- package/dist/runtime/editor/components/RelativeTime/index.vue +7 -13
- package/dist/runtime/editor/components/Resizable/index.vue +1 -1
- package/dist/runtime/editor/components/RichText/Editor/index.vue +1 -1
- package/dist/runtime/editor/components/ScaleToFit/index.vue +1 -1
- package/dist/runtime/editor/components/SearchOverlay/index.vue +1 -1
- package/dist/runtime/editor/components/SidebarFloater/index.vue +1 -1
- package/dist/runtime/editor/components/StatusIcon/index.vue +1 -1
- package/dist/runtime/editor/components/StatusIndicator/index.vue +1 -1
- package/dist/runtime/editor/components/SystemRequirements/index.vue +1 -1
- package/dist/runtime/editor/components/Tabs/index.d.vue.ts +1 -1
- package/dist/runtime/editor/components/Tabs/index.vue.d.ts +1 -1
- package/dist/runtime/editor/components/Toolbar/ViewOptions/List/Button/index.vue +2 -1
- package/dist/runtime/editor/components/Toolbar/index.vue +1 -1
- package/dist/runtime/editor/components/Transition/Collapse/index.vue +1 -1
- package/dist/runtime/editor/components/Transition/List/index.vue +1 -1
- package/dist/runtime/editor/composables/defineViewOption.js +5 -1
- package/dist/runtime/editor/composables/useStickyToolbar.js +1 -4
- package/dist/runtime/editor/css/output.css +1 -1
- package/dist/runtime/editor/features/add-list/Help/index.vue +1 -1
- package/dist/runtime/editor/features/add-list/index.vue +1 -1
- package/dist/runtime/editor/features/analyze/index.vue +1 -1
- package/dist/runtime/editor/features/anchors/Overlay/index.vue +11 -5
- package/dist/runtime/editor/features/anchors/index.vue +2 -1
- package/dist/runtime/editor/features/artboard/Overview/index.vue +1 -1
- package/dist/runtime/editor/features/artboard/Renderer.vue +1 -1
- package/dist/runtime/editor/features/artboard/Scrollbar/index.vue +1 -1
- package/dist/runtime/editor/features/block-scheduler/Dialog/index.vue +1 -1
- package/dist/runtime/editor/features/block-transfer/index.vue +1 -1
- package/dist/runtime/editor/features/breadcrumbs/index.vue +1 -1
- package/dist/runtime/editor/features/changelog/changelog.json +8 -0
- package/dist/runtime/editor/features/clipboard/DropElement/index.vue +1 -1
- package/dist/runtime/editor/features/comments/AddForm/index.vue +1 -1
- package/dist/runtime/editor/features/comments/Thread/index.vue +1 -1
- package/dist/runtime/editor/features/complex-options/index.vue +1 -0
- package/dist/runtime/editor/features/debug/Main.vue +1 -1
- package/dist/runtime/editor/features/dev-mode/index.vue +1 -1
- package/dist/runtime/editor/features/dragging-overlay/DragItems/index.vue +1 -1
- package/dist/runtime/editor/features/dragging-overlay/index.vue +1 -1
- package/dist/runtime/editor/features/droppable-field-edit/Overlay/index.vue +1 -1
- package/dist/runtime/editor/features/editable-field/Overlay/Frame/index.vue +1 -1
- package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.d.vue.ts +1 -5
- package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.vue.d.ts +1 -5
- package/dist/runtime/editor/features/editable-field/Overlay/ReadabilityIndicator/ChunkOverlay.vue +1 -1
- package/dist/runtime/editor/features/editable-field/Overlay/index.vue +1 -1
- package/dist/runtime/editor/features/editable-mask/index.vue +1 -1
- package/dist/runtime/editor/features/entity-title/index.vue +17 -7
- package/dist/runtime/editor/features/help/Dialog/index.vue +1 -1
- package/dist/runtime/editor/features/help/Shortcuts/index.vue +1 -1
- package/dist/runtime/editor/features/history/List/index.vue +1 -1
- package/dist/runtime/editor/features/import-existing/Dialog/index.vue +1 -1
- package/dist/runtime/editor/features/library/index.vue +1 -0
- package/dist/runtime/editor/features/media-library/index.vue +1 -1
- package/dist/runtime/editor/features/options/Form/Item.vue +5 -12
- package/dist/runtime/editor/features/options/Form/Radios/index.d.vue.ts +5 -4
- package/dist/runtime/editor/features/options/Form/Radios/index.vue +8 -5
- package/dist/runtime/editor/features/options/Form/Radios/index.vue.d.ts +5 -4
- package/dist/runtime/editor/features/options/Form/Text/index.d.vue.ts +4 -0
- package/dist/runtime/editor/features/options/Form/Text/index.vue +11 -3
- package/dist/runtime/editor/features/options/Form/Text/index.vue.d.ts +4 -0
- package/dist/runtime/editor/features/options/index.vue +1 -1
- package/dist/runtime/editor/features/publish/Dialog/Item.vue +4 -7
- package/dist/runtime/editor/features/publish/Dialog/PublishOption.vue +1 -1
- package/dist/runtime/editor/features/referenced-entities/List/Item/index.vue +1 -0
- package/dist/runtime/editor/features/responsive-preview/Frame/index.vue +1 -1
- package/dist/runtime/editor/features/search/index.vue +1 -1
- package/dist/runtime/editor/features/selection/AddButtons/Renderer/index.vue +1 -1
- package/dist/runtime/editor/features/settings/Dialog/FeatureSetting/index.vue +1 -1
- package/dist/runtime/editor/features/settings/index.vue +1 -1
- package/dist/runtime/editor/features/structure/List/Item/index.vue +1 -1
- package/dist/runtime/editor/features/structure/index.vue +1 -1
- package/dist/runtime/editor/features/templates/DialogManageTemplates/Item.vue +1 -0
- package/dist/runtime/editor/features/templates/DialogManageTemplates/index.vue +1 -1
- package/dist/runtime/editor/features/theme/index.vue +1 -1
- package/dist/runtime/editor/features/touch-action-bar/Bar/index.vue +1 -1
- package/dist/runtime/editor/features/tour/Overlay/index.vue +1 -1
- package/dist/runtime/editor/features/transform/Dialog/index.vue +1 -1
- package/dist/runtime/editor/features/translations/SelectionTable/index.vue +1 -1
- package/dist/runtime/editor/features/workspace/index.vue +1 -1
- package/dist/runtime/editor/helpers/diff/index.d.ts +11 -0
- package/dist/runtime/editor/helpers/diff/index.js +13 -7
- package/dist/runtime/editor/helpers/options/index.d.ts +2 -0
- package/dist/runtime/editor/helpers/options/index.js +21 -0
- package/dist/runtime/editor/plugins/BlockIndicator/index.d.vue.ts +24 -1
- package/dist/runtime/editor/plugins/BlockIndicator/index.vue +17 -7
- package/dist/runtime/editor/plugins/BlockIndicator/index.vue.d.ts +24 -1
- package/dist/runtime/editor/plugins/ItemAction/index.d.vue.ts +2 -1
- package/dist/runtime/editor/plugins/ItemAction/index.vue +1 -1
- package/dist/runtime/editor/plugins/ItemAction/index.vue.d.ts +2 -1
- package/dist/runtime/editor/plugins/Sidebar/Detached/index.d.vue.ts +1 -1
- package/dist/runtime/editor/plugins/Sidebar/Detached/index.vue.d.ts +1 -1
- package/dist/runtime/editor/plugins/Sidebar/index.d.vue.ts +2 -2
- package/dist/runtime/editor/plugins/Sidebar/index.vue +1 -1
- package/dist/runtime/editor/plugins/Sidebar/index.vue.d.ts +2 -2
- package/dist/runtime/editor/plugins/ToolbarButton/index.vue +1 -1
- package/dist/runtime/editor/providers/animation.d.ts +2 -0
- package/dist/runtime/editor/providers/definition.d.ts +4 -3
- package/dist/runtime/editor/providers/definition.js +10 -2
- package/dist/runtime/editor/providers/plugin.d.ts +1 -0
- package/dist/runtime/editor/providers/state.d.ts +25 -1
- package/dist/runtime/editor/providers/state.js +17 -0
- package/dist/runtime/editor/translations/de.json +2 -0
- package/dist/runtime/editor/translations/fr.json +2 -0
- package/dist/runtime/editor/translations/gsw_CH.json +2 -0
- package/dist/runtime/editor/translations/it.json +2 -0
- package/dist/runtime/editor/types/state.d.ts +7 -0
- package/dist/runtime/editor/types/ui.d.ts +1 -0
- package/dist/shared/{editor.Gu7mgJ5Q.mjs → editor.BGemL1Oh.mjs} +146 -146
- package/dist/shared/{editor.D28NbXr3.d.mts → editor.S5sA3rij.d.mts} +452 -406
- package/dist/types.d.mts +1 -1
- package/package.json +74 -82
|
@@ -12,11 +12,11 @@ export declare const paramsSchema: z.ZodObject<{
|
|
|
12
12
|
}, z.core.$strip>;
|
|
13
13
|
export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
14
14
|
type: z.ZodEnum<{
|
|
15
|
+
options: "options";
|
|
15
16
|
rewrite: "rewrite";
|
|
16
17
|
delete: "delete";
|
|
17
18
|
add: "add";
|
|
18
19
|
move: "move";
|
|
19
|
-
options: "options";
|
|
20
20
|
}>;
|
|
21
21
|
label: z.ZodString;
|
|
22
22
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
type OptionValue = string | boolean | number | string[];
|
|
3
|
+
/**
|
|
4
|
+
* The accepted input shapes for a single content-field value, mirroring
|
|
5
|
+
* `contentFieldValueSchema`. Normalized to `CanonicalFieldValue` before use.
|
|
6
|
+
*/
|
|
7
|
+
type ContentFieldInput = string | {
|
|
8
|
+
uri: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
} | {
|
|
11
|
+
entityType: string;
|
|
12
|
+
entityId: string;
|
|
13
|
+
} | {
|
|
14
|
+
target_id: string;
|
|
15
|
+
target_type?: string;
|
|
16
|
+
};
|
|
3
17
|
type BlockInput = {
|
|
4
18
|
bundle: string;
|
|
5
|
-
contentFields?: Record<string,
|
|
6
|
-
entityType: string;
|
|
7
|
-
entityId: string;
|
|
8
|
-
}>;
|
|
19
|
+
contentFields?: Record<string, ContentFieldInput>;
|
|
9
20
|
options?: Record<string, OptionValue>;
|
|
10
21
|
children?: Record<string, BlockInput[]>;
|
|
11
22
|
};
|
|
@@ -20,11 +31,11 @@ export declare const paramsSchema: z.ZodObject<{
|
|
|
20
31
|
}, z.core.$strip>;
|
|
21
32
|
export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
22
33
|
type: z.ZodEnum<{
|
|
34
|
+
options: "options";
|
|
23
35
|
rewrite: "rewrite";
|
|
24
36
|
delete: "delete";
|
|
25
37
|
add: "add";
|
|
26
38
|
move: "move";
|
|
27
|
-
options: "options";
|
|
28
39
|
}>;
|
|
29
40
|
label: z.ZodString;
|
|
30
41
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -17,23 +17,48 @@ import { validateFieldCardinality } from "../../helpers/validation.js";
|
|
|
17
17
|
import { getFieldKey } from "#blokkli/helpers";
|
|
18
18
|
import { optionValueToStorable } from "#blokkli/editor/helpers/options";
|
|
19
19
|
import { countNewParagraphs } from "#blokkli/agent/app/helpers/mutationResult";
|
|
20
|
-
const contentFieldValueSchema = z.union(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
const contentFieldValueSchema = z.union(
|
|
21
|
+
[
|
|
22
|
+
z.string().describe(
|
|
23
|
+
"Text for plain/markup fields, or a URL/link URI (https://\u2026, mailto:, tel:, internal:/path, entity:type/id) for link fields."
|
|
24
|
+
),
|
|
25
|
+
z.object({
|
|
26
|
+
uri: z.string().describe("The link target: an absolute URL or a backend link URI."),
|
|
27
|
+
title: z.string().optional().describe(
|
|
28
|
+
"Optional link text. Accepted, but the URI is what gets stored \u2014 some backends do not persist the title yet."
|
|
29
|
+
)
|
|
30
|
+
}).describe("Link field value with an optional title."),
|
|
31
|
+
z.object({
|
|
32
|
+
entityType: z.string().describe('Entity type (e.g. "media", "node").'),
|
|
33
|
+
entityId: z.string().describe("Entity ID.")
|
|
34
|
+
}).describe(
|
|
35
|
+
"Entity reference for reference fields (media, content references), from search_media / search_content results."
|
|
36
|
+
),
|
|
37
|
+
z.object({
|
|
38
|
+
target_id: z.string().describe("The referenced entity ID."),
|
|
39
|
+
target_type: z.string().optional().describe("The referenced entity type, if known.")
|
|
40
|
+
}).describe(
|
|
41
|
+
"Entity reference in the backend-native { target_id } shape (equivalent to { entityType, entityId })."
|
|
42
|
+
)
|
|
43
|
+
],
|
|
44
|
+
{
|
|
45
|
+
error: "Content field value must be one of: a text/URL string; a link object { uri, title? }; or an entity reference { entityType, entityId } or { target_id, target_type? }."
|
|
46
|
+
}
|
|
47
|
+
);
|
|
31
48
|
const contentFieldsSchema = z.record(
|
|
32
49
|
z.string().describe("The content field name"),
|
|
33
50
|
contentFieldValueSchema
|
|
34
51
|
).optional().describe(
|
|
35
52
|
"Content field values to set on the new paragraph, keyed by field name. Use this to set text content and media/entity references in one step."
|
|
36
53
|
);
|
|
54
|
+
function normalizeContentFieldValue(value) {
|
|
55
|
+
if (typeof value === "string") return value;
|
|
56
|
+
if ("uri" in value) return value.uri;
|
|
57
|
+
if ("target_id" in value) {
|
|
58
|
+
return { entityType: value.target_type ?? "", entityId: value.target_id };
|
|
59
|
+
}
|
|
60
|
+
return { entityType: value.entityType, entityId: value.entityId };
|
|
61
|
+
}
|
|
37
62
|
const blockSchema = z.object({
|
|
38
63
|
bundle: z.string().describe("The paragraph bundle to add"),
|
|
39
64
|
contentFields: contentFieldsSchema,
|
|
@@ -54,7 +79,10 @@ export const paramsSchema = z.object({
|
|
|
54
79
|
});
|
|
55
80
|
function validateContentFields(ctx, block, path) {
|
|
56
81
|
if (!block.contentFields) return void 0;
|
|
57
|
-
for (const [fieldName,
|
|
82
|
+
for (const [fieldName, rawFieldValue] of Object.entries(
|
|
83
|
+
block.contentFields
|
|
84
|
+
)) {
|
|
85
|
+
const fieldValue = normalizeContentFieldValue(rawFieldValue);
|
|
58
86
|
const editableConfig = ctx.app.types.editableFieldConfig.forName(
|
|
59
87
|
ctx.itemEntityType,
|
|
60
88
|
block.bundle,
|
|
@@ -76,7 +104,7 @@ function validateContentFields(ctx, block, path) {
|
|
|
76
104
|
}
|
|
77
105
|
if (droppableConfig) {
|
|
78
106
|
if (typeof fieldValue === "string" && droppableConfig.type !== "link") {
|
|
79
|
-
return `${path}: Field "${fieldName}" is a reference field and expects { entityType, entityId }, got a string.`;
|
|
107
|
+
return `${path}: Field "${fieldName}" is a reference field and expects { entityType, entityId } (or { target_id }), got a string.`;
|
|
80
108
|
}
|
|
81
109
|
}
|
|
82
110
|
}
|
|
@@ -161,7 +189,7 @@ function buildEventBlocks(ctx, blocks, parentBundle) {
|
|
|
161
189
|
const blockUuid = generateUUID();
|
|
162
190
|
const values = block.contentFields ? Object.entries(block.contentFields).map(([fieldName, fieldValue]) => ({
|
|
163
191
|
fieldName,
|
|
164
|
-
fieldValue
|
|
192
|
+
fieldValue: normalizeContentFieldValue(fieldValue)
|
|
165
193
|
})) : void 0;
|
|
166
194
|
let options;
|
|
167
195
|
if (block.options) {
|
|
@@ -229,7 +257,7 @@ function collectAllUuids(blocks) {
|
|
|
229
257
|
export const resultSchema = mutationResultSchema;
|
|
230
258
|
export default defineBlokkliAgentTool({
|
|
231
259
|
name: "add_paragraphs",
|
|
232
|
-
description: "Add one or more new paragraphs to the page. Supports nested structures via the `children` property \u2014 define entire paragraph trees in a single call. IMPORTANT: Always provide content field values (text, media/entity references) directly via contentFields, instead of adding empty paragraphs! For reference content fields (media), set the value to { entityType, entityId } from search_media results. NOTE: You can ONLY provide content fields, NOT paragraph fields! For nested paragraphs, use the `children` property keyed by paragraph field name. You can also set paragraph options inline via the `options` property (key-value pairs). The success result mirrors the input shape: each top-level entry in `newParagraphs` includes its own `children` keyed by paragraph field, so the structure round-trips and a nested child does NOT appear as a sibling \u2014 treat the tree as the source of truth instead of guessing from order.",
|
|
260
|
+
description: "Add one or more new paragraphs to the page. Supports nested structures via the `children` property \u2014 define entire paragraph trees in a single call. IMPORTANT: Always provide content field values (text, media/entity references) directly via contentFields, instead of adding empty paragraphs! For reference content fields (media), set the value to { entityType, entityId } from search_media results. For link fields, set a URL string or { uri, title }. NOTE: You can ONLY provide content fields, NOT paragraph fields! For nested paragraphs, use the `children` property keyed by paragraph field name. You can also set paragraph options inline via the `options` property (key-value pairs). The success result mirrors the input shape: each top-level entry in `newParagraphs` includes its own `children` keyed by paragraph field, so the structure round-trips and a nested child does NOT appear as a sibling \u2014 treat the tree as the source of truth instead of guessing from order.",
|
|
233
261
|
category: "mutation",
|
|
234
262
|
lazy: false,
|
|
235
263
|
prunedSummary: (r) => r.success ? `added ${countNewParagraphs(r.newParagraphs ?? [])} paragraphs` : "rejected",
|
|
@@ -10,11 +10,11 @@ export declare const paramsSchema: z.ZodObject<{
|
|
|
10
10
|
}, z.core.$strip>;
|
|
11
11
|
export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
12
12
|
type: z.ZodEnum<{
|
|
13
|
+
options: "options";
|
|
13
14
|
rewrite: "rewrite";
|
|
14
15
|
delete: "delete";
|
|
15
16
|
add: "add";
|
|
16
17
|
move: "move";
|
|
17
|
-
options: "options";
|
|
18
18
|
}>;
|
|
19
19
|
label: z.ZodString;
|
|
20
20
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -10,11 +10,11 @@ export declare const paramsSchema: z.ZodObject<{
|
|
|
10
10
|
}, z.core.$strip>;
|
|
11
11
|
export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
12
12
|
type: z.ZodEnum<{
|
|
13
|
+
options: "options";
|
|
13
14
|
rewrite: "rewrite";
|
|
14
15
|
delete: "delete";
|
|
15
16
|
add: "add";
|
|
16
17
|
move: "move";
|
|
17
|
-
options: "options";
|
|
18
18
|
}>;
|
|
19
19
|
label: z.ZodString;
|
|
20
20
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -115,7 +115,7 @@ function cancel() {
|
|
|
115
115
|
}
|
|
116
116
|
</script>
|
|
117
117
|
|
|
118
|
-
<style>/*! tailwindcss v4.
|
|
118
|
+
<style>/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */
|
|
119
119
|
:is(.bk-agent-tool-question-list .bk-radio,.bk-agent-tool-question-list .bk-checkbox) input + span {
|
|
120
120
|
font-size: var(--text-sm, 14px);
|
|
121
121
|
line-height: var(--bk-tw-leading, var(--text-sm--line-height, calc(1.25 / 0.875)));
|
|
@@ -5,7 +5,7 @@ export declare const paramsSchema: z.ZodObject<{
|
|
|
5
5
|
value: z.ZodString;
|
|
6
6
|
label: z.ZodString;
|
|
7
7
|
}, z.core.$strip>>;
|
|
8
|
-
multiSelect: z.ZodDefault<z.ZodOptional<z.
|
|
8
|
+
multiSelect: z.ZodDefault<z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>>;
|
|
9
9
|
paragraphUuids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
10
10
|
}, z.core.$strip>;
|
|
11
11
|
export declare const resultSchema: z.ZodObject<{
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { fieldDiffResultSchema } from '../schemas.js';
|
|
3
3
|
import { type SkippedField } from '../fieldDiffApproval.js';
|
|
4
4
|
export declare const paramsSchema: z.ZodObject<{
|
|
5
|
-
uuids: z.
|
|
5
|
+
uuids: z.ZodPreprocess<z.ZodArray<z.ZodString>>;
|
|
6
6
|
}, z.core.$strip>;
|
|
7
7
|
export type AutoTranslateParams = z.infer<typeof paramsSchema>;
|
|
8
8
|
export type AutoTranslateResult = z.infer<typeof fieldDiffResultSchema>;
|
|
@@ -4,11 +4,11 @@ export declare const paramsSchema: z.ZodObject<{
|
|
|
4
4
|
}, z.core.$strip>;
|
|
5
5
|
export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
6
6
|
type: z.ZodEnum<{
|
|
7
|
+
options: "options";
|
|
7
8
|
rewrite: "rewrite";
|
|
8
9
|
delete: "delete";
|
|
9
10
|
add: "add";
|
|
10
11
|
move: "move";
|
|
11
|
-
options: "options";
|
|
12
12
|
}>;
|
|
13
13
|
label: z.ZodString;
|
|
14
14
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -4,11 +4,11 @@ export declare const paramsSchema: z.ZodObject<{
|
|
|
4
4
|
}, z.core.$strip>;
|
|
5
5
|
export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
6
6
|
type: z.ZodEnum<{
|
|
7
|
+
options: "options";
|
|
7
8
|
rewrite: "rewrite";
|
|
8
9
|
delete: "delete";
|
|
9
10
|
add: "add";
|
|
10
11
|
move: "move";
|
|
11
|
-
options: "options";
|
|
12
12
|
}>;
|
|
13
13
|
label: z.ZodString;
|
|
14
14
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -10,11 +10,11 @@ export declare const paramsSchema: z.ZodObject<{
|
|
|
10
10
|
}, z.core.$strip>;
|
|
11
11
|
export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
12
12
|
type: z.ZodEnum<{
|
|
13
|
+
options: "options";
|
|
13
14
|
rewrite: "rewrite";
|
|
14
15
|
delete: "delete";
|
|
15
16
|
add: "add";
|
|
16
17
|
move: "move";
|
|
17
|
-
options: "options";
|
|
18
18
|
}>;
|
|
19
19
|
label: z.ZodString;
|
|
20
20
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -18,9 +18,7 @@ export function decideFieldUpdates(items, selected, reasons) {
|
|
|
18
18
|
let totalCount = 0;
|
|
19
19
|
for (const item of items) {
|
|
20
20
|
if (item.segments) {
|
|
21
|
-
const atoms = flattenSegments(item.segments).filter(
|
|
22
|
-
(s) => s.status !== "matched" || s.beforeHtml !== s.afterHtml
|
|
23
|
-
);
|
|
21
|
+
const atoms = flattenSegments(item.segments).filter((s) => s.changed);
|
|
24
22
|
totalCount += atoms.length;
|
|
25
23
|
const acceptedById = {};
|
|
26
24
|
const rejectedSegments = [];
|
|
@@ -2,8 +2,8 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare const paramsSchema: z.ZodObject<{
|
|
3
3
|
bundle: z.ZodOptional<z.ZodString>;
|
|
4
4
|
bundles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
5
|
-
hasChildren: z.ZodOptional<z.
|
|
6
|
-
isRootLevel: z.ZodOptional<z.
|
|
5
|
+
hasChildren: z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>;
|
|
6
|
+
isRootLevel: z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>;
|
|
7
7
|
nestingLevel: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
parentBundle: z.ZodOptional<z.ZodString>;
|
|
9
9
|
inField: z.ZodOptional<z.ZodString>;
|
|
@@ -124,11 +124,15 @@ export default defineBlokkliAgentTool({
|
|
|
124
124
|
);
|
|
125
125
|
const entry = {
|
|
126
126
|
type: opt.option.type,
|
|
127
|
-
label:
|
|
127
|
+
label: ctx.app.definitions.resolveDefinitionString(
|
|
128
|
+
opt.option.label
|
|
129
|
+
),
|
|
128
130
|
currentValue: resolvedValue ?? ""
|
|
129
131
|
};
|
|
130
132
|
if (opt.option.description) {
|
|
131
|
-
entry.description =
|
|
133
|
+
entry.description = ctx.app.definitions.resolveDefinitionString(
|
|
134
|
+
opt.option.description
|
|
135
|
+
);
|
|
132
136
|
}
|
|
133
137
|
const labels = extractOptionLabels(opt.option);
|
|
134
138
|
if (labels) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const paramsSchema: z.
|
|
3
|
-
uuids: z.
|
|
4
|
-
includeNested: z.ZodDefault<z.ZodOptional<z.
|
|
2
|
+
export declare const paramsSchema: z.ZodPreprocess<z.ZodObject<{
|
|
3
|
+
uuids: z.ZodPreprocess<z.ZodArray<z.ZodString>>;
|
|
4
|
+
includeNested: z.ZodDefault<z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>>;
|
|
5
5
|
}, z.core.$strip>>;
|
|
6
6
|
export declare const resultSchema: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
7
7
|
type: z.ZodLiteral<"plain">;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const paramsSchema: z.ZodObject<{
|
|
3
3
|
uuid: z.ZodString;
|
|
4
|
-
includeParentChain: z.ZodDefault<z.ZodOptional<z.
|
|
5
|
-
includeSiblings: z.ZodDefault<z.ZodOptional<z.
|
|
6
|
-
includeChildren: z.ZodDefault<z.ZodOptional<z.
|
|
7
|
-
includeContentFields: z.ZodDefault<z.ZodOptional<z.
|
|
8
|
-
includeOptions: z.ZodDefault<z.ZodOptional<z.
|
|
4
|
+
includeParentChain: z.ZodDefault<z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>>;
|
|
5
|
+
includeSiblings: z.ZodDefault<z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>>;
|
|
6
|
+
includeChildren: z.ZodDefault<z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>>;
|
|
7
|
+
includeContentFields: z.ZodDefault<z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>>;
|
|
8
|
+
includeOptions: z.ZodDefault<z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>>;
|
|
9
9
|
}, z.core.$strip>;
|
|
10
10
|
export declare const resultSchema: z.ZodObject<{
|
|
11
11
|
uuid: z.ZodString;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const paramsSchema: z.ZodObject<{
|
|
3
3
|
maxNestingLevel: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
4
|
-
includeDimensions: z.ZodDefault<z.ZodOptional<z.
|
|
4
|
+
includeDimensions: z.ZodDefault<z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>>;
|
|
5
5
|
}, z.core.$strip>;
|
|
6
6
|
type BlockDimensions = {
|
|
7
7
|
x: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const paramsSchema: z.ZodObject<{
|
|
3
|
-
uuids: z.
|
|
3
|
+
uuids: z.ZodPreprocess<z.ZodArray<z.ZodString>>;
|
|
4
4
|
}, z.core.$strip>;
|
|
5
5
|
export declare const resultSchema: z.ZodObject<{
|
|
6
6
|
entities: z.ZodArray<z.ZodObject<{
|
|
@@ -4,11 +4,11 @@ export declare const paramsSchema: z.ZodObject<{
|
|
|
4
4
|
}, z.core.$strip>;
|
|
5
5
|
export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
6
6
|
type: z.ZodEnum<{
|
|
7
|
+
options: "options";
|
|
7
8
|
rewrite: "rewrite";
|
|
8
9
|
delete: "delete";
|
|
9
10
|
add: "add";
|
|
10
11
|
move: "move";
|
|
11
|
-
options: "options";
|
|
12
12
|
}>;
|
|
13
13
|
label: z.ZodString;
|
|
14
14
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -10,11 +10,11 @@ export declare const paramsSchema: z.ZodObject<{
|
|
|
10
10
|
}, z.core.$strip>;
|
|
11
11
|
export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
12
12
|
type: z.ZodEnum<{
|
|
13
|
+
options: "options";
|
|
13
14
|
rewrite: "rewrite";
|
|
14
15
|
delete: "delete";
|
|
15
16
|
add: "add";
|
|
16
17
|
move: "move";
|
|
17
|
-
options: "options";
|
|
18
18
|
}>;
|
|
19
19
|
label: z.ZodString;
|
|
20
20
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -9,11 +9,11 @@ export declare const paramsSchema: z.ZodObject<{
|
|
|
9
9
|
}, z.core.$strip>;
|
|
10
10
|
export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
11
11
|
type: z.ZodEnum<{
|
|
12
|
+
options: "options";
|
|
12
13
|
rewrite: "rewrite";
|
|
13
14
|
delete: "delete";
|
|
14
15
|
add: "add";
|
|
15
16
|
move: "move";
|
|
16
|
-
options: "options";
|
|
17
17
|
}>;
|
|
18
18
|
label: z.ZodString;
|
|
19
19
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -8,11 +8,11 @@ export declare const paramsSchema: z.ZodObject<{
|
|
|
8
8
|
}, z.core.$strip>;
|
|
9
9
|
export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
10
10
|
type: z.ZodEnum<{
|
|
11
|
+
options: "options";
|
|
11
12
|
rewrite: "rewrite";
|
|
12
13
|
delete: "delete";
|
|
13
14
|
add: "add";
|
|
14
15
|
move: "move";
|
|
15
|
-
options: "options";
|
|
16
16
|
}>;
|
|
17
17
|
label: z.ZodString;
|
|
18
18
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -7,11 +7,11 @@ export declare const paramsSchema: z.ZodObject<{
|
|
|
7
7
|
}, z.core.$strip>;
|
|
8
8
|
export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
9
9
|
type: z.ZodEnum<{
|
|
10
|
+
options: "options";
|
|
10
11
|
rewrite: "rewrite";
|
|
11
12
|
delete: "delete";
|
|
12
13
|
add: "add";
|
|
13
14
|
move: "move";
|
|
14
|
-
options: "options";
|
|
15
15
|
}>;
|
|
16
16
|
label: z.ZodString;
|
|
17
17
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -59,7 +59,7 @@ export declare const mutationResultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
59
59
|
* still advertises an array, so the model is guided toward the array form while
|
|
60
60
|
* a single string is accepted as a fallback.
|
|
61
61
|
*/
|
|
62
|
-
export declare function stringArrayParam(description: string): z.
|
|
62
|
+
export declare function stringArrayParam(description: string): z.ZodPreprocess<z.ZodArray<z.ZodString>>;
|
|
63
63
|
/**
|
|
64
64
|
* Wraps an object params schema to tolerate a singular key when the schema
|
|
65
65
|
* actually expects its plural form (e.g. `uuid` → `uuids`). LLMs — especially
|
|
@@ -71,7 +71,7 @@ export declare function stringArrayParam(description: string): z.ZodPipe<z.ZodTr
|
|
|
71
71
|
* `z.preprocess`), so the model is still guided to the plural form; the
|
|
72
72
|
* singular form is silently accepted as a fallback.
|
|
73
73
|
*/
|
|
74
|
-
export declare function tolerantSingularKeys<T extends z.ZodType>(schema: T, aliases: Record<string, string>): z.
|
|
74
|
+
export declare function tolerantSingularKeys<T extends z.ZodType>(schema: T, aliases: Record<string, string>): z.ZodPreprocess<T>;
|
|
75
75
|
/**
|
|
76
76
|
* Shared schema for option values (used by add_blocks and set_block_options).
|
|
77
77
|
*/
|
|
@@ -7,11 +7,11 @@ export declare const paramsSchema: z.ZodObject<{
|
|
|
7
7
|
}, z.core.$strip>;
|
|
8
8
|
export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
9
9
|
type: z.ZodEnum<{
|
|
10
|
+
options: "options";
|
|
10
11
|
rewrite: "rewrite";
|
|
11
12
|
delete: "delete";
|
|
12
13
|
add: "add";
|
|
13
14
|
move: "move";
|
|
14
|
-
options: "options";
|
|
15
15
|
}>;
|
|
16
16
|
label: z.ZodString;
|
|
17
17
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -5,11 +5,11 @@ export declare const paramsSchema: z.ZodObject<{
|
|
|
5
5
|
}, z.core.$strip>;
|
|
6
6
|
export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
7
7
|
type: z.ZodEnum<{
|
|
8
|
+
options: "options";
|
|
8
9
|
rewrite: "rewrite";
|
|
9
10
|
delete: "delete";
|
|
10
11
|
add: "add";
|
|
11
12
|
move: "move";
|
|
12
|
-
options: "options";
|
|
13
13
|
}>;
|
|
14
14
|
label: z.ZodString;
|
|
15
15
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -6,7 +6,7 @@ declare const operationSchema: z.ZodObject<{
|
|
|
6
6
|
fieldName: z.ZodString;
|
|
7
7
|
search: z.ZodString;
|
|
8
8
|
replace: z.ZodString;
|
|
9
|
-
selector: z.ZodOptional<z.
|
|
9
|
+
selector: z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>;
|
|
10
10
|
}, z.core.$strip>;
|
|
11
11
|
declare const updateSchema: z.ZodObject<{
|
|
12
12
|
uuid: z.ZodString;
|
|
@@ -24,9 +24,9 @@ export declare const paramsSchema: z.ZodObject<{
|
|
|
24
24
|
fieldName: z.ZodString;
|
|
25
25
|
search: z.ZodString;
|
|
26
26
|
replace: z.ZodString;
|
|
27
|
-
selector: z.ZodOptional<z.
|
|
27
|
+
selector: z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>;
|
|
28
28
|
}, z.core.$strip>>>;
|
|
29
|
-
requireApproval: z.ZodOptional<z.
|
|
29
|
+
requireApproval: z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>;
|
|
30
30
|
}, z.core.$strip>;
|
|
31
31
|
export type BatchRewriteParams = z.infer<typeof paramsSchema>;
|
|
32
32
|
export type BatchRewriteResult = z.infer<typeof fieldDiffResultSchema>;
|
|
@@ -24,34 +24,29 @@ export class FieldStreamParser {
|
|
|
24
24
|
}
|
|
25
25
|
this.stripLeadingNewline = false;
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
while (changed) {
|
|
29
|
-
changed = false;
|
|
27
|
+
while (true) {
|
|
30
28
|
const markerPos = this.buffer.indexOf(MARKER_PREFIX);
|
|
31
29
|
if (markerPos === -1) {
|
|
32
|
-
|
|
30
|
+
this.emitBufferedContent(events, this.buffer.length);
|
|
33
31
|
break;
|
|
34
32
|
}
|
|
35
33
|
if (markerPos > 0) {
|
|
36
34
|
const before = this.buffer.slice(0, markerPos);
|
|
37
35
|
this.buffer = this.buffer.slice(markerPos);
|
|
38
36
|
this.appendContent(before, events);
|
|
39
|
-
changed = true;
|
|
40
37
|
continue;
|
|
41
38
|
}
|
|
42
39
|
const matched = this.tryMatchMarker(events);
|
|
43
40
|
if (matched) {
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
} else {
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
if (this.buffer.length >= MAX_MARKER_LENGTH) {
|
|
44
|
+
const chunk = this.buffer.slice(0, 3);
|
|
45
|
+
this.buffer = this.buffer.slice(3);
|
|
46
|
+
this.appendContent(chunk, events);
|
|
47
|
+
continue;
|
|
54
48
|
}
|
|
49
|
+
break;
|
|
55
50
|
}
|
|
56
51
|
return events;
|
|
57
52
|
}
|
|
@@ -5,7 +5,9 @@ export default defineServerSideTool({
|
|
|
5
5
|
description: 'Load additional tools by name before using them. You must call this before using any tool listed under "Additional Tools" in the system prompt.',
|
|
6
6
|
inputSchema(ctx) {
|
|
7
7
|
return z.object({
|
|
8
|
-
tools: z.array(z.
|
|
8
|
+
tools: z.array(z.string()).describe(
|
|
9
|
+
ctx.lazyToolNames.length ? `Tool names to activate. Loadable tools: ${ctx.lazyToolNames.join(", ")}.` : "Tool names to activate."
|
|
10
|
+
)
|
|
9
11
|
});
|
|
10
12
|
},
|
|
11
13
|
isAvailable(ctx) {
|
|
@@ -19,21 +19,21 @@ import { z } from 'zod';
|
|
|
19
19
|
* or `.default()` on the result would degrade to `any` in the published `.d.ts`
|
|
20
20
|
* — use {@link optionalBooleanParam} / {@link booleanParamWithDefault} instead.
|
|
21
21
|
*/
|
|
22
|
-
export declare function booleanParam(description: string): z.
|
|
22
|
+
export declare function booleanParam(description: string): z.ZodPreprocess<z.ZodBoolean>;
|
|
23
23
|
/**
|
|
24
24
|
* Optional variant of {@link booleanParam}. Use instead of
|
|
25
25
|
* `booleanParam(...).optional()` so isolated-declaration emit can preserve the
|
|
26
26
|
* type — chained Zod method calls aren't resolvable by mkdist's per-file
|
|
27
27
|
* declaration emit and collapse to `any` in the published `.d.ts`.
|
|
28
28
|
*/
|
|
29
|
-
export declare function optionalBooleanParam(description: string): z.ZodOptional<z.
|
|
29
|
+
export declare function optionalBooleanParam(description: string): z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>;
|
|
30
30
|
/**
|
|
31
31
|
* Optional boolean with a default. Use instead of
|
|
32
32
|
* `booleanParam(...).optional().default(value)` so isolated-declaration emit
|
|
33
33
|
* can preserve the type. The default value applies when the param is omitted
|
|
34
34
|
* or `undefined` at parse time.
|
|
35
35
|
*/
|
|
36
|
-
export declare function booleanParamWithDefault(description: string, defaultValue: boolean): z.ZodDefault<z.ZodOptional<z.
|
|
36
|
+
export declare function booleanParamWithDefault(description: string, defaultValue: boolean): z.ZodDefault<z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>>;
|
|
37
37
|
/**
|
|
38
38
|
* Coerce double-serialized array/object params back to their real values.
|
|
39
39
|
*
|
|
@@ -207,7 +207,6 @@ export type PageContext = {
|
|
|
207
207
|
* Both Anthropic and OpenAI SDKs map to these via HTTP status codes.
|
|
208
208
|
*/
|
|
209
209
|
export declare const agentErrorTypeSchema: z.ZodEnum<{
|
|
210
|
-
unknown: "unknown";
|
|
211
210
|
authentication: "authentication";
|
|
212
211
|
rate_limit: "rate_limit";
|
|
213
212
|
overloaded: "overloaded";
|
|
@@ -215,6 +214,7 @@ export declare const agentErrorTypeSchema: z.ZodEnum<{
|
|
|
215
214
|
bad_request: "bad_request";
|
|
216
215
|
connection: "connection";
|
|
217
216
|
unauthorized: "unauthorized";
|
|
217
|
+
unknown: "unknown";
|
|
218
218
|
}>;
|
|
219
219
|
export type AgentErrorType = z.infer<typeof agentErrorTypeSchema>;
|
|
220
220
|
/**
|
|
@@ -355,8 +355,8 @@ export declare const clientMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
355
355
|
name: z.ZodString;
|
|
356
356
|
label: z.ZodString;
|
|
357
357
|
type: z.ZodEnum<{
|
|
358
|
-
link: "link";
|
|
359
358
|
reference: "reference";
|
|
359
|
+
link: "link";
|
|
360
360
|
}>;
|
|
361
361
|
allowed: z.ZodArray<z.ZodObject<{
|
|
362
362
|
type: z.ZodString;
|
|
@@ -395,8 +395,8 @@ export declare const clientMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
395
395
|
name: z.ZodString;
|
|
396
396
|
label: z.ZodString;
|
|
397
397
|
type: z.ZodEnum<{
|
|
398
|
-
link: "link";
|
|
399
398
|
reference: "reference";
|
|
399
|
+
link: "link";
|
|
400
400
|
}>;
|
|
401
401
|
allowed: z.ZodArray<z.ZodObject<{
|
|
402
402
|
type: z.ZodString;
|