@hugex/artifact 0.7.1 → 0.8.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 +21 -0
- package/dist/artifact/do/ArtifactDO.d.ts +77 -4
- package/dist/artifact/do/ArtifactIndexDO.d.ts +12 -0
- package/dist/artifact/host-route.d.ts +1 -1
- package/dist/artifact/index.d.ts +1 -0
- package/dist/artifact/inject.d.ts +14 -2
- package/dist/artifact/limits.d.ts +11 -0
- package/dist/artifact/mcp/context.d.ts +5 -0
- package/dist/artifact/mcp/domains/toolAuthoring.d.ts +22 -0
- package/dist/artifact/mcp/domains/tools.d.ts +16 -0
- package/dist/artifact/mcp/index.d.ts +1 -1
- package/dist/artifact/mcp/oauth/provider.d.ts +4 -1
- package/dist/artifact/mcp/scopes.d.ts +7 -1
- package/dist/artifact/mcp/toolRunContract.d.ts +110 -0
- package/dist/artifact/types.d.ts +47 -4
- package/dist/artifact/validate.d.ts +18 -1
- package/dist/artifact/version.d.ts +1 -1
- package/dist/artifact/visit.d.ts +38 -0
- package/dist/common/constants/client-tools.d.ts +137 -0
- package/dist/common/flow-graph/index.d.ts +1 -0
- package/dist/common/flow-graph/schema.d.ts +1 -1
- package/dist/common/flow-graph/validate.d.ts +3 -0
- package/dist/index.js +230 -77
- package/package.json +1 -1
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
export type ClientRisk = 'allow' | 'ask';
|
|
2
|
+
export interface ClientToolActionSpec {
|
|
3
|
+
risk: ClientRisk;
|
|
4
|
+
}
|
|
5
|
+
export interface ClientToolSpec {
|
|
6
|
+
sinceVersion: number;
|
|
7
|
+
tokenBudget: number;
|
|
8
|
+
execTimeoutMs?: number;
|
|
9
|
+
description: string;
|
|
10
|
+
actions: Record<string, ClientToolActionSpec>;
|
|
11
|
+
inputSchema: Record<string, unknown>;
|
|
12
|
+
}
|
|
13
|
+
export interface ClientToolFamilySpec {
|
|
14
|
+
version: number;
|
|
15
|
+
label: string;
|
|
16
|
+
summary: string;
|
|
17
|
+
tools: Record<string, ClientToolSpec>;
|
|
18
|
+
}
|
|
19
|
+
export declare const CLIENT_TOOL_FAMILIES: {
|
|
20
|
+
readonly system: {
|
|
21
|
+
readonly version: 1;
|
|
22
|
+
readonly label: 'Sistema';
|
|
23
|
+
readonly summary: 'Basic facts about the user computer (OS, local time).';
|
|
24
|
+
readonly tools: {
|
|
25
|
+
readonly desktop_system: {
|
|
26
|
+
readonly sinceVersion: 1;
|
|
27
|
+
readonly tokenBudget: 200;
|
|
28
|
+
readonly description: 'Get basic facts about the user computer: OS, version, local time and time zone.';
|
|
29
|
+
readonly actions: {
|
|
30
|
+
readonly info: {
|
|
31
|
+
readonly risk: 'allow';
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
readonly inputSchema: {
|
|
35
|
+
readonly type: 'object';
|
|
36
|
+
readonly additionalProperties: false;
|
|
37
|
+
readonly properties: {};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
readonly files: {
|
|
43
|
+
readonly version: 1;
|
|
44
|
+
readonly label: 'Archivos';
|
|
45
|
+
readonly summary: 'List and read files in the folder the user chose.';
|
|
46
|
+
readonly tools: {
|
|
47
|
+
readonly desktop_files: {
|
|
48
|
+
readonly sinceVersion: 1;
|
|
49
|
+
readonly tokenBudget: 300;
|
|
50
|
+
readonly description: string;
|
|
51
|
+
readonly actions: {
|
|
52
|
+
readonly list: {
|
|
53
|
+
readonly risk: 'ask';
|
|
54
|
+
};
|
|
55
|
+
readonly read: {
|
|
56
|
+
readonly risk: 'ask';
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
readonly inputSchema: {
|
|
60
|
+
readonly type: 'object';
|
|
61
|
+
readonly additionalProperties: false;
|
|
62
|
+
readonly required: readonly ["action"];
|
|
63
|
+
readonly properties: {
|
|
64
|
+
readonly action: {
|
|
65
|
+
readonly type: 'string';
|
|
66
|
+
readonly enum: readonly ["list", "read"];
|
|
67
|
+
};
|
|
68
|
+
readonly path: {
|
|
69
|
+
readonly type: 'string';
|
|
70
|
+
readonly maxLength: 512;
|
|
71
|
+
readonly description: 'Relative path. Default "."';
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
readonly code: {
|
|
79
|
+
readonly version: 1;
|
|
80
|
+
readonly label: 'Código';
|
|
81
|
+
readonly summary: 'Run Python or Deno code in a sandboxed local runtime inside the working folder.';
|
|
82
|
+
readonly tools: {
|
|
83
|
+
readonly desktop_code: {
|
|
84
|
+
readonly sinceVersion: 1;
|
|
85
|
+
readonly tokenBudget: 450;
|
|
86
|
+
readonly execTimeoutMs: 130000;
|
|
87
|
+
readonly description: string;
|
|
88
|
+
readonly actions: {
|
|
89
|
+
readonly run: {
|
|
90
|
+
readonly risk: 'ask';
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
readonly inputSchema: {
|
|
94
|
+
readonly type: 'object';
|
|
95
|
+
readonly additionalProperties: false;
|
|
96
|
+
readonly required: readonly ["action", "language", "code"];
|
|
97
|
+
readonly properties: {
|
|
98
|
+
readonly action: {
|
|
99
|
+
readonly type: 'string';
|
|
100
|
+
readonly enum: readonly ["run"];
|
|
101
|
+
};
|
|
102
|
+
readonly language: {
|
|
103
|
+
readonly type: 'string';
|
|
104
|
+
};
|
|
105
|
+
readonly code: {
|
|
106
|
+
readonly type: 'string';
|
|
107
|
+
readonly minLength: 1;
|
|
108
|
+
readonly maxLength: 16384;
|
|
109
|
+
};
|
|
110
|
+
readonly timeoutSec: {
|
|
111
|
+
readonly type: 'number';
|
|
112
|
+
readonly minimum: 1;
|
|
113
|
+
readonly maximum: 120;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
export type ClientToolFamilyId = keyof typeof CLIENT_TOOL_FAMILIES;
|
|
122
|
+
export interface ResolvedClientTool {
|
|
123
|
+
id: string;
|
|
124
|
+
family: ClientToolFamilyId;
|
|
125
|
+
familySpec: ClientToolFamilySpec;
|
|
126
|
+
spec: ClientToolSpec;
|
|
127
|
+
}
|
|
128
|
+
export declare function isClientToolFamily(family: string): family is ClientToolFamilyId;
|
|
129
|
+
export declare function getClientTool(id: string): ResolvedClientTool | undefined;
|
|
130
|
+
export declare function listClientTools(): ResolvedClientTool[];
|
|
131
|
+
export declare const CLIENT_TOOL_ERROR_CODES: ReadonlySet<string>;
|
|
132
|
+
export declare function sanitizeClientToolCode(code: unknown): string;
|
|
133
|
+
export declare function sanitizeClientToolAction(toolName: string, action: unknown): string;
|
|
134
|
+
export declare const CLIENT_TOOL_LANGUAGES: ReadonlySet<string>;
|
|
135
|
+
export declare function sanitizeClientToolLanguage(language: unknown): string;
|
|
136
|
+
export declare function sanitizeFiniteInt(value: unknown): number | undefined;
|
|
137
|
+
export declare function sanitizeDurationMs(value: unknown): number | undefined;
|
|
@@ -9,3 +9,4 @@ export * from './composio';
|
|
|
9
9
|
export * from './classifier';
|
|
10
10
|
export { CLEF_MODELS } from '../constants/clef-models';
|
|
11
11
|
export { TOOL_REGISTRY_SNAPSHOT } from '../constants/tools-registry';
|
|
12
|
+
export { CLIENT_TOOL_FAMILIES, getClientTool, isClientToolFamily, listClientTools, type ClientRisk, type ClientToolActionSpec, type ClientToolFamilyId, type ClientToolFamilySpec, type ClientToolSpec, type ResolvedClientTool, } from '../constants/client-tools';
|
|
@@ -23,7 +23,7 @@ export interface WorkerGraph {
|
|
|
23
23
|
}
|
|
24
24
|
export type IssueSeverity = 'error' | 'warning';
|
|
25
25
|
export type CredentialKind = 'bearer_token' | 'basic_auth' | 'known_token' | 'url_userinfo' | 'url_query' | 'sensitive_key' | 'high_entropy';
|
|
26
|
-
export type IssueCode = 'missing_state' | 'schema_version' | 'var_mapping' | 'classifier_invalid' | 'classifier_edge_missing' | 'out_vars_invalid' | 'start_count' | 'answer_missing' | 'dead_end' | 'unknown_node_type' | 'duplicate_node_id' | 'invalid_node_id' | 'node_id_collides_with_input' | 'edge_unknown_node' | 'edge_bad_handle' | 'edge_duplicate' | 'start_has_input' | 'answer_has_output' | 'multiple_outgoing' | 'field_type' | 'field_required' | 'field_range' | 'field_enum' | 'ref_syntax' | 'ref_unknown_node' | 'ref_out_of_scope' | 'ref_unknown_output' | 'ref_binary_not_allowed' | 'start_input_invalid' | 'answer_mapping_invalid' | 'worker_self_reference' | 'classifier_error_unrouted' | 'classifier_handle_inactive' | 'unreachable_node' | 'graph_cycle' | 'crawl_prompt_literal' | 'model_unknown' | 'param_unsupported' | 'reasoning_effort_unsupported' | 'tool_unavailable' | 'tool_kind_mismatch' | 'skill_unavailable' | 'builtin_unknown' | 'tool_args_invalid' | 'tool_args_unknown' | 'composio_slug_disabled' | 'composio_schema_missing' | 'memo_unavailable' | 'worker_unavailable' | 'worker_child_no_output' | 'worker_inputs_mismatch' | 'worker_child_inactive_forbidden' | 'worker_child_inactive' | 'secret_unknown' | 'secret_check_skipped' | 'personal_memory_inactive' | 'inline_credential' | 'op_invalid' | 'op_unknown_node' | 'already_connected' | 'edge_not_found' | 'edge_ambiguous' | 'cannot_remove_start';
|
|
26
|
+
export type IssueCode = 'missing_state' | 'schema_version' | 'var_mapping' | 'classifier_invalid' | 'classifier_edge_missing' | 'out_vars_invalid' | 'start_count' | 'answer_missing' | 'dead_end' | 'unknown_node_type' | 'duplicate_node_id' | 'invalid_node_id' | 'node_id_collides_with_input' | 'edge_unknown_node' | 'edge_bad_handle' | 'edge_duplicate' | 'start_has_input' | 'answer_has_output' | 'multiple_outgoing' | 'field_type' | 'field_required' | 'field_range' | 'field_enum' | 'ref_syntax' | 'ref_unknown_node' | 'ref_out_of_scope' | 'ref_unknown_output' | 'ref_binary_not_allowed' | 'start_input_invalid' | 'answer_mapping_invalid' | 'worker_self_reference' | 'classifier_error_unrouted' | 'classifier_handle_inactive' | 'unreachable_node' | 'graph_cycle' | 'crawl_prompt_literal' | 'model_unknown' | 'param_unsupported' | 'reasoning_effort_unsupported' | 'tool_unavailable' | 'tool_kind_mismatch' | 'skill_unavailable' | 'builtin_unknown' | 'tool_args_invalid' | 'tool_args_unknown' | 'composio_slug_disabled' | 'composio_schema_missing' | 'memo_unavailable' | 'worker_unavailable' | 'worker_child_no_output' | 'worker_inputs_mismatch' | 'worker_child_inactive_forbidden' | 'worker_child_inactive' | 'secret_unknown' | 'secret_check_skipped' | 'personal_memory_inactive' | 'client_tool_unknown' | 'client_tool_inactive' | 'desktop_tools_unknown_family' | 'inline_credential' | 'op_invalid' | 'op_unknown_node' | 'already_connected' | 'edge_not_found' | 'edge_ambiguous' | 'cannot_remove_start';
|
|
27
27
|
export interface GraphIssue {
|
|
28
28
|
code: IssueCode;
|
|
29
29
|
severity: IssueSeverity;
|
|
@@ -56,6 +56,9 @@ export declare const ISSUE_SEVERITY: {
|
|
|
56
56
|
readonly secret_unknown: 'advisory';
|
|
57
57
|
readonly secret_check_skipped: 'advisory';
|
|
58
58
|
readonly personal_memory_inactive: 'advisory';
|
|
59
|
+
readonly client_tool_unknown: 'advisory';
|
|
60
|
+
readonly client_tool_inactive: 'advisory';
|
|
61
|
+
readonly desktop_tools_unknown_family: 'advisory';
|
|
59
62
|
readonly inline_credential: 'blocking';
|
|
60
63
|
readonly op_invalid: 'blocking';
|
|
61
64
|
readonly op_unknown_node: 'blocking';
|