@k2b/cloud 0.30.0 → 0.32.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/package.json +7 -4
- package/src/_internal/app-presentation.ts +22 -1
- package/src/_internal/capabilities.ts +2 -2
- package/src/_internal/define-app.ts +17 -5
- package/src/_internal/registry.ts +50 -6
- package/src/_internal/widget-declarations.ts +53 -0
- package/src/ai/app-skills.ts +1 -7
- package/src/ai/approval-routes.ts +40 -4
- package/src/ai/approvals.ts +68 -10
- package/src/ai/audio-tool.ts +2 -1
- package/src/ai/browser.ts +109 -0
- package/src/ai/capabilities.ts +6 -2
- package/src/ai/chart-block.ts +431 -81
- package/src/ai/chat/action-sentences.ts +13 -7
- package/src/ai/chat/blocks.tsx +64 -39
- package/src/ai/chat/builtin-tools.tsx +9 -7
- package/src/ai/chat/chart-block.tsx +218 -44
- package/src/ai/chat/explorer-block.tsx +276 -0
- package/src/ai/chat/file-tools.tsx +40 -1
- package/src/ai/chat/live-turn.browser-harness.tsx +4 -1
- package/src/ai/chat/message-actions.tsx +9 -1
- package/src/ai/chat/message-utils.ts +7 -0
- package/src/ai/chat/messages.ts +34 -0
- package/src/ai/chat/presentation.tsx +13 -3
- package/src/ai/chat/reference-text.tsx +34 -0
- package/src/ai/chat/tool-groups.ts +67 -12
- package/src/ai/chat/tool-names.ts +18 -2
- package/src/ai/chat/turn-layout.ts +8 -0
- package/src/ai/chat/turn-view.tsx +111 -32
- package/src/ai/chat/view-block.browser-harness.tsx +35 -0
- package/src/ai/chat/view-block.tsx +417 -0
- package/src/ai/chat/visual-tools.tsx +32 -53
- package/src/ai/chat/web-tools.tsx +95 -1
- package/src/ai/client/controller.ts +6 -3
- package/src/ai/client-tool-results.ts +9 -0
- package/src/ai/code-runtime-tools.ts +50 -17
- package/src/ai/code-source-contracts.ts +25 -21
- package/src/ai/code-source-tools.ts +3 -1
- package/src/ai/default-tool-contracts.ts +334 -91
- package/src/ai/default-tools.ts +87 -11
- package/src/ai/executor.ts +343 -45
- package/src/ai/fetch-file-tool.ts +41 -4
- package/src/ai/file-error.ts +2 -0
- package/src/ai/file-tools.ts +27 -7
- package/src/ai/files-store.ts +60 -0
- package/src/ai/firecrawl-tools.ts +87 -4
- package/src/ai/html-pdf-tool.ts +3 -2
- package/src/ai/http.ts +37 -12
- package/src/ai/index.ts +98 -0
- package/src/ai/local-tool-contracts.ts +244 -0
- package/src/ai/malformed-tool-call-repair.ts +144 -0
- package/src/ai/markdown-pdf-tool.ts +2 -1
- package/src/ai/migrate.ts +120 -2
- package/src/ai/openai-api-messages.ts +53 -0
- package/src/ai/openai-api-slots.ts +40 -0
- package/src/ai/openai-api.ts +383 -0
- package/src/ai/protocol.ts +28 -3
- package/src/ai/provider.ts +16 -4
- package/src/ai/request-context.ts +33 -0
- package/src/ai/routes.ts +99 -49
- package/src/ai/runtime.ts +90 -15
- package/src/ai/settings.ts +5 -0
- package/src/ai/skill-catalog.ts +20 -5
- package/src/ai/skill-format.ts +17 -7
- package/src/ai/skill-tool.ts +15 -5
- package/src/ai/skills-routes.ts +20 -6
- package/src/ai/skills.ts +26 -7
- package/src/ai/store.ts +91 -1
- package/src/ai/system-prompt.ts +69 -10
- package/src/ai/timeline.ts +3 -1
- package/src/ai/tool-audit.ts +11 -1
- package/src/ai/tools.ts +94 -3
- package/src/ai/types.ts +48 -0
- package/src/ai/view-block.ts +941 -0
- package/src/ai/vision-tool.ts +2 -1
- package/src/ai/web-provenance.ts +103 -0
- package/src/api/admin-identity.ts +6 -1
- package/src/api/app-approval-actions.ts +36 -0
- package/src/api/app-approval.ts +10 -2
- package/src/api/approvals-loader.ts +15 -0
- package/src/api/approvals.ts +120 -0
- package/src/api/capabilities.ts +3 -2
- package/src/api/index.ts +3 -0
- package/src/api/me.ts +12 -3
- package/src/api/widgets.ts +36 -5
- package/src/approvals/Approvals.browser-harness.tsx +16 -0
- package/src/approvals/Approvals.tsx +621 -0
- package/src/approvals/ApprovalsNavStatus.tsx +20 -0
- package/src/approvals/messages.ts +95 -0
- package/src/approvals/ui.ts +8 -0
- package/src/browser/CloudResourceSearch.tsx +1 -1
- package/src/browser/app-approval.ts +32 -0
- package/src/browser/choose-files.tsx +26 -13
- package/src/browser/command-shortcuts.ts +21 -6
- package/src/browser/commands.ts +13 -4
- package/src/browser/file-provider-error.ts +11 -0
- package/src/browser/file-providers.ts +3 -12
- package/src/browser/files.tsx +1 -2
- package/src/browser/live-connection.ts +2 -3
- package/src/browser/provider-list.ts +2 -1
- package/src/browser/save-files.tsx +13 -2
- package/src/browser/spotlight-position.ts +4 -1
- package/src/browser/widgets.ts +7 -5
- package/src/capabilities/executions.ts +3 -0
- package/src/cli/account.ts +21 -2
- package/src/cli/commands.ts +24 -2
- package/src/cli/index.ts +16 -0
- package/src/cli/plugin.ts +30 -0
- package/src/contracts/app-approval.ts +120 -0
- package/src/contracts/app.ts +34 -2
- package/src/contracts/approval-paths.ts +4 -0
- package/src/contracts/approvals.ts +81 -0
- package/src/contracts/command-path.ts +17 -0
- package/src/contracts/commands.ts +5 -15
- package/src/contracts/registry.ts +9 -1
- package/src/contracts/shared.ts +5 -0
- package/src/contracts/widgets.ts +47 -2
- package/src/desktop/solid.tsx +6 -7
- package/src/events/live-protocol.ts +2 -1
- package/src/events/live-server-message.ts +40 -0
- package/src/events/testing.ts +88 -0
- package/src/server/index.ts +3 -0
- package/src/server/middleware/auth.ts +11 -1
- package/src/server/request-timeout.ts +22 -0
- package/src/server/services/access.ts +4 -3
- package/src/server/widget-request.ts +27 -0
- package/src/services/app-approval.ts +103 -15
- package/src/services/approvals/cursor.ts +15 -0
- package/src/services/approvals/device.ts +112 -0
- package/src/services/approvals/index.ts +241 -0
- package/src/services/approvals/list.ts +120 -0
- package/src/services/approvals/migrate.ts +41 -0
- package/src/services/identity/models-only-auth.ts +25 -0
- package/src/services/notifications/email-frame.ts +16 -3
- package/src/services/service-account-credentials.ts +22 -10
- package/src/services/settings/core-settings.ts +27 -0
- package/src/shared/ai-platform-prompt.ts +26 -1
- package/src/shared/app-presentation.ts +11 -0
- package/src/shared/email-html.ts +46 -7
- package/src/shared/index.ts +6 -1
- package/src/shared/markdown/extensions/code.ts +14 -0
- package/src/shared/markdown/index.ts +4 -4
- package/src/ssr/AdminLayout.tsx +4 -7
- package/src/ssr/AppBadge.tsx +4 -4
- package/src/ssr/AppLaunchpad.island.tsx +1 -1
- package/src/ssr/AppLaunchpadPanel.tsx +4 -4
- package/src/ssr/Layout.tsx +38 -14
- package/src/ssr/LayoutFooter.tsx +1 -1
- package/src/ssr/LayoutHeader.tsx +17 -20
- package/src/ssr/LayoutHelp.tsx +1 -1
- package/src/ssr/LayoutRail.tsx +1 -2
- package/src/ssr/PageTrail.tsx +23 -0
- package/src/ssr/PageTrailRow.island.tsx +20 -0
- package/src/ssr/PageTrailRuntime.island.tsx +26 -0
- package/src/ssr/ProfilePreferences.island.tsx +7 -3
- package/src/ssr/RailApps.island.tsx +2 -2
- package/src/ssr/app-badges.ts +50 -6
- package/src/ssr/islands/index.ts +1 -0
- package/src/ssr/layout-runtime.ts +60 -0
- package/src/ssr/mobile-menu-history.ts +1 -1
- package/src/ssr/page-trail-runtime.ts +313 -0
- package/src/ssr/page-trail.browser-harness.tsx +265 -0
- package/src/ssr/page-trail.ts +59 -0
- package/src/ssr/platform-messages.ts +4 -0
- package/src/ssr/rail-navigation.ts +5 -3
- package/src/ssr/runtime.ts +6 -1
- package/src/styles/approvals.css +390 -0
- package/src/styles/effects.css +21 -4
- package/src/styles/global.css +39 -3
- package/src/styles/utilities-layout.css +24 -1
- package/src/styles/utilities-navigation.css +6 -18
package/src/ai/browser.ts
CHANGED
|
@@ -17,29 +17,104 @@ export {
|
|
|
17
17
|
type CloudAiChartColumn,
|
|
18
18
|
type CloudAiChartRow,
|
|
19
19
|
type CloudAiChartTable,
|
|
20
|
+
chartDrawingIssue,
|
|
21
|
+
cloudAiChartLegend,
|
|
22
|
+
cloudAiChartMarkKey,
|
|
23
|
+
cloudAiChartMarks,
|
|
24
|
+
cloudAiChartReferenceMark,
|
|
25
|
+
cloudAiChartRenderOptions,
|
|
26
|
+
cloudAiChartRows,
|
|
20
27
|
cloudAiChartTable,
|
|
28
|
+
cloudAiChartXValueFormat,
|
|
29
|
+
cloudAiNumberFormatters,
|
|
21
30
|
} from "./chart-block";
|
|
22
31
|
export { parseAiSse } from "./client/transport";
|
|
23
32
|
export {
|
|
24
33
|
CLOUD_AI_CHART_MAX_SERIES,
|
|
25
34
|
CLOUD_AI_CHART_MAX_VALUES,
|
|
35
|
+
CLOUD_AI_GROUP_MAX_CHARTS,
|
|
26
36
|
CLOUD_AI_TEXT_EDITOR_MAX_CHARS,
|
|
37
|
+
CLOUD_AI_VIEW_MAX_MARKS,
|
|
27
38
|
CloudAiCardInputSchema,
|
|
39
|
+
type CloudAiChartInput,
|
|
28
40
|
CloudAiChartInputSchema,
|
|
41
|
+
type CloudAiDateFormat,
|
|
42
|
+
type CloudAiFormat,
|
|
29
43
|
CloudAiLocalBashInputSchema,
|
|
44
|
+
type CloudAiNumberFormat,
|
|
30
45
|
CloudAiSurveyInputSchema,
|
|
46
|
+
CloudAiSurveyOutputSchema,
|
|
31
47
|
CloudAiTextEditorInputSchema,
|
|
48
|
+
CloudAiTextEditorOutputSchema,
|
|
49
|
+
cloudAiAppChartSchema,
|
|
50
|
+
cloudAiChartSchema,
|
|
51
|
+
cloudAiFormatSchema,
|
|
52
|
+
cloudAiNumberFormatSchema,
|
|
32
53
|
parseCloudAiChartInput,
|
|
33
54
|
} from "./default-tool-contracts";
|
|
34
55
|
export { guessAiMediaType } from "./file-media-type";
|
|
56
|
+
export { AI_PROJECT_FILE_MOUNT, AI_SKILL_FILE_MOUNT } from "./file-mount";
|
|
35
57
|
export { AI_IMAGE_INPUT_MAX_BYTES, AI_TURN_ATTACHMENT_MAX_ITEMS, AI_TURN_IMAGE_MAX_TOTAL_BYTES } from "./limits";
|
|
36
58
|
export {
|
|
59
|
+
AI_LOCAL_BATCH_MAX_ITEMS,
|
|
60
|
+
AI_LOCAL_INSTRUCTIONS_MAX_BYTES,
|
|
61
|
+
AI_LOCAL_LIST_MAX_LIMIT,
|
|
62
|
+
AI_LOCAL_READ_MAX_BYTES,
|
|
63
|
+
AI_LOCAL_SELECTED_SKILLS_MAX_ITEMS,
|
|
64
|
+
AI_LOCAL_SKILL_FILES_MAX_ITEMS,
|
|
65
|
+
AI_LOCAL_SKILLS_MAX_ITEMS,
|
|
66
|
+
AI_LOCAL_TOOL_NAMES,
|
|
67
|
+
AI_LOCAL_WRITE_MAX_BYTES,
|
|
68
|
+
type AiLocalClient,
|
|
69
|
+
AiLocalClientSchema,
|
|
70
|
+
type AiLocalContext,
|
|
71
|
+
AiLocalContextSchema,
|
|
72
|
+
type AiLocalToolName,
|
|
73
|
+
type CloudAiLoadLocalSkillInput,
|
|
74
|
+
CloudAiLoadLocalSkillInputSchema,
|
|
75
|
+
type CloudAiLoadLocalSkillOutput,
|
|
76
|
+
CloudAiLoadLocalSkillOutputSchema,
|
|
77
|
+
type CloudAiLocalDownloadInput,
|
|
78
|
+
CloudAiLocalDownloadInputSchema,
|
|
79
|
+
type CloudAiLocalDownloadOutput,
|
|
80
|
+
CloudAiLocalDownloadOutputSchema,
|
|
81
|
+
type CloudAiLocalListInput,
|
|
82
|
+
CloudAiLocalListInputSchema,
|
|
83
|
+
type CloudAiLocalListOutput,
|
|
84
|
+
CloudAiLocalListOutputSchema,
|
|
85
|
+
type CloudAiLocalMoveInput,
|
|
86
|
+
CloudAiLocalMoveInputSchema,
|
|
87
|
+
type CloudAiLocalMoveOutput,
|
|
88
|
+
CloudAiLocalMoveOutputSchema,
|
|
89
|
+
type CloudAiLocalReadInput,
|
|
90
|
+
CloudAiLocalReadInputSchema,
|
|
91
|
+
type CloudAiLocalReadOutput,
|
|
92
|
+
CloudAiLocalReadOutputSchema,
|
|
93
|
+
type CloudAiLocalUploadInput,
|
|
94
|
+
CloudAiLocalUploadInputSchema,
|
|
95
|
+
type CloudAiLocalUploadOutput,
|
|
96
|
+
CloudAiLocalUploadOutputSchema,
|
|
97
|
+
type CloudAiLocalWriteInput,
|
|
98
|
+
CloudAiLocalWriteInputSchema,
|
|
99
|
+
type CloudAiLocalWriteOutput,
|
|
100
|
+
CloudAiLocalWriteOutputSchema,
|
|
101
|
+
} from "./local-tool-contracts";
|
|
102
|
+
export {
|
|
103
|
+
AI_SKILL_DESCRIPTION_MAX_CHARS,
|
|
104
|
+
AI_SKILL_EXTRA_FRONTMATTER_MAX_CHARS,
|
|
105
|
+
AI_SKILL_INSTRUCTIONS_MAX_CHARS,
|
|
106
|
+
AI_SKILL_NAME_MAX_CHARS,
|
|
107
|
+
AI_SKILL_REFERENCE_MAX_CHARS,
|
|
37
108
|
AI_SKILL_REFERENCE_MAX_ITEMS,
|
|
109
|
+
AI_SKILL_REFERENCE_PATH_PATTERN,
|
|
38
110
|
AI_SKILL_REFERENCES_MAX_CHARS,
|
|
39
111
|
type AiSkillDocument,
|
|
40
112
|
type AiSkillReferenceInput,
|
|
113
|
+
isAiSkillManualOnly,
|
|
114
|
+
mountAiSkillInstructionLinks,
|
|
41
115
|
parseAiSkillMarkdown,
|
|
42
116
|
serializeAiSkillMarkdown,
|
|
117
|
+
splitAiSkillMarkdown,
|
|
43
118
|
validateAiSkillReferences,
|
|
44
119
|
} from "./skill-format";
|
|
45
120
|
export { isAiImageMediaType } from "./types";
|
|
@@ -112,3 +187,37 @@ export const launchAssistant = async (input: LaunchAssistantInput): Promise<Assi
|
|
|
112
187
|
href: `/app/assistant?conversation=${encodeURIComponent(conversation.id)}`,
|
|
113
188
|
};
|
|
114
189
|
};
|
|
190
|
+
|
|
191
|
+
export {
|
|
192
|
+
CLOUD_AI_STATS_MAX_ITEMS,
|
|
193
|
+
CLOUD_AI_TABLE_MAX_COLUMNS,
|
|
194
|
+
CLOUD_AI_TABLE_MAX_ROWS,
|
|
195
|
+
CLOUD_AI_VIEW_DIRECTORY,
|
|
196
|
+
CLOUD_AI_VIEW_MAX_BYTES,
|
|
197
|
+
CLOUD_AI_VIEW_SUFFIX,
|
|
198
|
+
type CloudAiChartView,
|
|
199
|
+
type CloudAiDetailsView,
|
|
200
|
+
type CloudAiExplorerRequest,
|
|
201
|
+
type CloudAiExplorerView,
|
|
202
|
+
type CloudAiGroupView,
|
|
203
|
+
type CloudAiStatsView,
|
|
204
|
+
type CloudAiTableView,
|
|
205
|
+
type CloudAiView,
|
|
206
|
+
type CloudAiViewReference,
|
|
207
|
+
type CloudAiViewSummary,
|
|
208
|
+
CloudAiViewSummarySchema,
|
|
209
|
+
type CloudAiViewTable,
|
|
210
|
+
checkCloudAiView,
|
|
211
|
+
cloudAiDetailsRows,
|
|
212
|
+
cloudAiExplorerControls,
|
|
213
|
+
cloudAiExplorerState,
|
|
214
|
+
cloudAiStatsTiles,
|
|
215
|
+
cloudAiTableTsv,
|
|
216
|
+
cloudAiViewSummary,
|
|
217
|
+
cloudAiViewTable,
|
|
218
|
+
isAiViewFile,
|
|
219
|
+
isAiViewPath,
|
|
220
|
+
parseCloudAiChartToolView,
|
|
221
|
+
parseCloudAiView,
|
|
222
|
+
sortCloudAiViewRows,
|
|
223
|
+
} from "./view-block";
|
package/src/ai/capabilities.ts
CHANGED
|
@@ -84,12 +84,13 @@ export type AiRememberableCapabilityApprovals = ReadonlyMap<string, string>;
|
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
86
|
* Why `load_tools` could not make a requested name callable:
|
|
87
|
+
* - `skill`: the name is an Assistant Skill; load_skill loads it, not load_tools;
|
|
87
88
|
* - `unknown`: no tool has this exact name;
|
|
88
89
|
* - `not_offered_in_turn`: the tool exists, but this turn's client or task does not provide it;
|
|
89
90
|
* - `not_allowed`: the conversation's fixed tool scope or task grants exclude it;
|
|
90
91
|
* - `app_offline`: the app operation is not in the live registry now.
|
|
91
92
|
*/
|
|
92
|
-
export const AI_TOOL_UNAVAILABLE_REASONS = ["unknown", "not_offered_in_turn", "not_allowed", "app_offline"] as const;
|
|
93
|
+
export const AI_TOOL_UNAVAILABLE_REASONS = ["unknown", "skill", "not_offered_in_turn", "not_allowed", "app_offline"] as const;
|
|
93
94
|
export type AiToolUnavailableReason = (typeof AI_TOOL_UNAVAILABLE_REASONS)[number];
|
|
94
95
|
|
|
95
96
|
const DEFAULT_SEARCH_LIMIT = 10;
|
|
@@ -585,7 +586,7 @@ export const createAiToolMetaTools = (input: {
|
|
|
585
586
|
const load = defineAiTool({
|
|
586
587
|
name: "load_tools",
|
|
587
588
|
description:
|
|
588
|
-
"Load stable capability ids such as mail.conversation.list, or exact built-in names returned by search_tools, as ordinary tools for the next model turn. Skills may name capability ids directly, so load them without searching first. Call each loaded tool by the `call` name returned for it. `unavailable` gives a reason per name: unknown means no tool has this exact name, so look it up once with search_tools instead of guessing; not_offered_in_turn means this client or task does not provide the tool; not_allowed means this chat's fixed tool scope or task grants exclude it; app_offline means its app is not reachable now. For
|
|
589
|
+
"Load stable capability ids such as mail.conversation.list, or exact built-in names returned by search_tools, as ordinary tools for the next model turn. Skills may name capability ids directly, so load them without searching first. Call each loaded tool by the `call` name returned for it. `unavailable` gives a reason per name: unknown means no tool has this exact name, so look it up once with search_tools instead of guessing; not_offered_in_turn means this client or task does not provide the tool; not_allowed means this chat's fixed tool scope or task grants exclude it; app_offline means its app is not reachable now; skill means the name is an Assistant Skill: call load_skill with it instead. For not_offered_in_turn, not_allowed and app_offline, do not search or load the name again in this turn.",
|
|
589
590
|
inputSchema: z.object({ names: z.array(z.string().trim().min(1)).min(1).max(25) }).strict(),
|
|
590
591
|
outputSchema: z
|
|
591
592
|
.object({
|
|
@@ -749,6 +750,8 @@ export const createAiToolResolver =
|
|
|
749
750
|
mandatePolicy?: MandatePolicyV1 | null;
|
|
750
751
|
/** Built-in tools that exist but that this turn does not offer, such as client tools its client did not declare or tools outside `allowedTools`. */
|
|
751
752
|
unofferedTools?: readonly string[];
|
|
753
|
+
/** Assistant Skills this turn can load with load_skill. */
|
|
754
|
+
skillNames?: readonly string[];
|
|
752
755
|
runtimeContext?: Omit<AiToolPreparationContext, "actor" | "conversationId">;
|
|
753
756
|
store: Pick<AiConversationService, "getLoadedTools" | "loadTools">;
|
|
754
757
|
listRegistry?: () => Promise<CapabilityRegistryEntry[]>;
|
|
@@ -823,6 +826,7 @@ export const createAiToolResolver =
|
|
|
823
826
|
);
|
|
824
827
|
// App operation IDs always contain a dot; built-in names never do.
|
|
825
828
|
const unavailableReason = (requested: string): AiToolUnavailableReason => {
|
|
829
|
+
if (input.skillNames?.includes(requested)) return "skill";
|
|
826
830
|
const name = loadedByProviderName.get(requested) ?? requested;
|
|
827
831
|
if (mandateExcluded.has(name)) return "not_allowed";
|
|
828
832
|
if (allowed && outOfScope.has(name) && !allowed.has(name)) return "not_allowed";
|