buckyos 0.7.206 → 0.7.209
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/cli/dist/cli.mjs +602 -179
- package/cli/dist/cli.mjs.map +1 -1
- package/cli/modules/ai.ts +460 -23
- package/cli/modules/aiws.ts +1 -1
- package/cli/version.ts +1 -1
- package/dist/{aicc-67851c41.mjs → aicc-286ba457.mjs} +7 -5
- package/dist/aicc-286ba457.mjs.map +1 -0
- package/dist/aicc-342f2659.js +2 -0
- package/dist/aicc-342f2659.js.map +1 -0
- package/dist/aicc_client.d.ts +623 -288
- package/dist/aicc_client.d.ts.map +1 -1
- package/dist/{aiws_write-47c90e76.mjs → aiws_write-5b542439.mjs} +232 -135
- package/dist/{aiws_write-47c90e76.mjs.map → aiws_write-5b542439.mjs.map} +1 -1
- package/dist/aiws_write-a0769003.js +13 -0
- package/dist/{aiws_write-eeea8ed3.js.map → aiws_write-a0769003.js.map} +1 -1
- package/dist/app-frame.cjs +1 -1
- package/dist/app-frame.cjs.map +1 -1
- package/dist/app-frame.d.ts +3 -0
- package/dist/app-frame.d.ts.map +1 -1
- package/dist/app-frame.mjs +14 -3
- package/dist/app-frame.mjs.map +1 -1
- package/dist/browser.cjs +1 -1
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.ts +4 -0
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.mjs +93 -81
- package/dist/browser.mjs.map +1 -1
- package/dist/{content_objid-0a095cbd.mjs → content_objid-09031ce1.mjs} +2 -2
- package/dist/{content_objid-0a095cbd.mjs.map → content_objid-09031ce1.mjs.map} +1 -1
- package/dist/{content_objid-4742308a.js → content_objid-6342d0ba.js} +2 -2
- package/dist/{content_objid-4742308a.js.map → content_objid-6342d0ba.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +93 -81
- package/dist/index.mjs.map +1 -1
- package/dist/node.cjs +1 -1
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.ts +4 -0
- package/dist/node.d.ts.map +1 -1
- package/dist/node.mjs +92 -80
- package/dist/node.mjs.map +1 -1
- package/dist/{openai-ae2978de.mjs → openai-1c0d8341.mjs} +2 -2
- package/dist/{openai-ae2978de.mjs.map → openai-1c0d8341.mjs.map} +1 -1
- package/dist/{openai-f560d518.js → openai-7aa4ffbf.js} +2 -2
- package/dist/{openai-f560d518.js.map → openai-7aa4ffbf.js.map} +1 -1
- package/dist/sdk_core.d.ts +18 -0
- package/dist/sdk_core.d.ts.map +1 -1
- package/dist/{site_manager-91b4d899.mjs → site_manager-4f1940eb.mjs} +209 -143
- package/dist/site_manager-4f1940eb.mjs.map +1 -0
- package/dist/site_manager-ca22ffbd.js +2 -0
- package/dist/site_manager-ca22ffbd.js.map +1 -0
- package/dist/user_preferences-1d49850a.mjs +158 -0
- package/dist/user_preferences-1d49850a.mjs.map +1 -0
- package/dist/user_preferences-7288c989.js +2 -0
- package/dist/user_preferences-7288c989.js.map +1 -0
- package/dist/user_preferences.d.ts +50 -0
- package/dist/user_preferences.d.ts.map +1 -0
- package/dist/xllm/core/loop.d.ts.map +1 -1
- package/dist/xllm/core/run.d.ts.map +1 -1
- package/dist/xllm/core/types.d.ts +0 -2
- package/dist/xllm/core/types.d.ts.map +1 -1
- package/dist/xllm/hosts/deno/native_runtime.d.ts.map +1 -1
- package/dist/xllm/hosts/deno/native_tools.d.ts +2 -1
- package/dist/xllm/hosts/deno/native_tools.d.ts.map +1 -1
- package/dist/xllm/index.d.ts +3 -2
- package/dist/xllm/index.d.ts.map +1 -1
- package/dist/xllm/providers/aicc.d.ts +7 -3
- package/dist/xllm/providers/aicc.d.ts.map +1 -1
- package/dist/xllm/runtime/hints.d.ts +9 -4
- package/dist/xllm/runtime/hints.d.ts.map +1 -1
- package/dist/xllm/runtime/step_renderer.d.ts +4 -4
- package/dist/xllm/runtime/step_renderer.d.ts.map +1 -1
- package/dist/xllm/runtime/text_budget.d.ts +5 -0
- package/dist/xllm/runtime/text_budget.d.ts.map +1 -0
- package/dist/xllm/runtime/tool_result.d.ts +14 -1
- package/dist/xllm/runtime/tool_result.d.ts.map +1 -1
- package/dist/xllm.cjs +1 -1
- package/dist/xllm.cjs.map +1 -1
- package/dist/xllm.mjs +37 -31
- package/dist/xllm_deno.cjs +1 -1
- package/dist/xllm_deno.cjs.map +1 -1
- package/dist/xllm_deno.mjs +125 -44
- package/dist/xllm_deno.mjs.map +1 -1
- package/dist/xllm_dev.cjs +1 -1
- package/dist/xllm_dev.mjs +2 -2
- package/package.json +1 -1
- package/dist/aicc-67851c41.mjs.map +0 -1
- package/dist/aicc-ccb36ef7.js +0 -2
- package/dist/aicc-ccb36ef7.js.map +0 -1
- package/dist/aiws_write-eeea8ed3.js +0 -13
- package/dist/runtime_env-39e4df98.mjs +0 -44
- package/dist/runtime_env-39e4df98.mjs.map +0 -1
- package/dist/runtime_env-6396e1eb.js +0 -2
- package/dist/runtime_env-6396e1eb.js.map +0 -1
- package/dist/site_manager-716a2cf5.js +0 -2
- package/dist/site_manager-716a2cf5.js.map +0 -1
- package/dist/site_manager-91b4d899.mjs.map +0 -1
|
@@ -40,7 +40,7 @@ import { s as DID, N as NODE_IDENTITY_SCHEMA_V2, e as isBuckyOSLocalNodeIdentity
|
|
|
40
40
|
import { sniffMagic, mediaTypeFromExtension, extensionOf, stripMediaTypeParams, heifImageSize, isoBoxes, ContentRegistryClient } from "./content.mjs";
|
|
41
41
|
import { g as getBrowserIdentityRaw, c as clearBrowserUserInfo, s as saveBrowserIdentity, a as saveBrowserUserInfo, b as getBrowserUserInfo, d as clearBrowserIdentity, h as hashPassword, e as saveLocalAccountInfo, f as cleanLocalAccountInfo } from "./account-7a7bde6f.mjs";
|
|
42
42
|
import { i as AiWorkspaceClient, A as AIWORKSPACE_SERVICE_NAME, Y as newRecordId, _ as insertRecordOp, Z as setValuesOps, $ as deleteRecordsOp, V as orderKeyBetween, g as commitOverLimit, M as AIWS_PROTOCOL_VERSION, a as AiwsFailure, h as commitWithParts } from "./aiws_bind-b851d4db.mjs";
|
|
43
|
-
import { a as getRuntimeEnvironment, g as getBuckyApi } from "./
|
|
43
|
+
import { U as UserPreferencesStore, r as readUserPreferences, a as getRuntimeEnvironment, g as getBuckyApi } from "./user_preferences-1d49850a.mjs";
|
|
44
44
|
import { a as objEventKey } from "./object_url-20e94b67.mjs";
|
|
45
45
|
function ensureSSOEnvironment() {
|
|
46
46
|
if (typeof window === "undefined" || typeof window.location === "undefined") {
|
|
@@ -1467,7 +1467,6 @@ const AICC_CORE_METHODS = {
|
|
|
1467
1467
|
};
|
|
1468
1468
|
const AICC_MANAGEMENT_METHODS = {
|
|
1469
1469
|
SERVICE_RELOAD_SETTINGS: "service.reload_settings",
|
|
1470
|
-
QUOTA_QUERY: "quota.query",
|
|
1471
1470
|
USAGE_QUERY: "usage.query",
|
|
1472
1471
|
TRACE_QUERY: "trace.query",
|
|
1473
1472
|
ROUTING_GET: "routing.get",
|
|
@@ -1487,21 +1486,39 @@ const AICC_MANAGEMENT_METHODS = {
|
|
|
1487
1486
|
DRIVER_METADATA_UPDATE_GET: "driver_metadata_update.get",
|
|
1488
1487
|
DRIVER_METADATA_UPDATE_SET: "driver_metadata_update.set"
|
|
1489
1488
|
};
|
|
1490
|
-
const
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1489
|
+
const AICC_POLICY_METHODS = {
|
|
1490
|
+
POLICY_LIST: "policy.list",
|
|
1491
|
+
POLICY_GET: "policy.get",
|
|
1492
|
+
POLICY_UPSERT: "policy.upsert",
|
|
1493
|
+
POLICY_DELETE: "policy.delete",
|
|
1494
|
+
POLICY_EFFECTIVE: "policy.effective",
|
|
1495
|
+
POLICY_STATUS: "policy.status",
|
|
1496
|
+
PRICE_GET: "price.get",
|
|
1497
|
+
PRICE_UPDATE: "price.update",
|
|
1498
|
+
CREDIT_ACCOUNT_GET: "credit.account.get",
|
|
1499
|
+
CREDIT_ACCOUNT_LIST: "credit.account.list",
|
|
1500
|
+
CREDIT_LEDGER_LIST: "credit.ledger.list",
|
|
1501
|
+
CREDIT_RECHARGE: "credit.recharge",
|
|
1502
|
+
CREDIT_RECHARGE_GET: "credit.recharge.get",
|
|
1503
|
+
CREDIT_ADJUST: "credit.adjust"
|
|
1503
1504
|
};
|
|
1504
|
-
const
|
|
1505
|
+
const AICC_ROUTING_METHODS = {
|
|
1506
|
+
ROUTING_USECASES: "routing.usecases",
|
|
1507
|
+
ROUTING_USECASE_SET: "routing.usecase.set",
|
|
1508
|
+
ROUTING_GROUPS_LIST: "routing.groups.list",
|
|
1509
|
+
ROUTING_GROUPS_CREATE: "routing.groups.create",
|
|
1510
|
+
ROUTING_GROUPS_UPDATE: "routing.groups.update",
|
|
1511
|
+
ROUTING_GROUPS_DELETE: "routing.groups.delete",
|
|
1512
|
+
ROUTING_BINDINGS_LIST: "routing.bindings.list",
|
|
1513
|
+
ROUTING_BINDINGS_SET: "routing.bindings.set",
|
|
1514
|
+
ROUTING_BINDINGS_REMOVE: "routing.bindings.remove"
|
|
1515
|
+
};
|
|
1516
|
+
const AICC_API_TOKEN_METHODS = {
|
|
1517
|
+
API_TOKEN_CREATE: "api_token.create",
|
|
1518
|
+
API_TOKEN_LIST: "api_token.list",
|
|
1519
|
+
API_TOKEN_REVOKE: "api_token.revoke"
|
|
1520
|
+
};
|
|
1521
|
+
const AICC_METHODS = { ...AICC_AI_METHODS, ...AICC_CORE_METHODS, ...AICC_MANAGEMENT_METHODS, ...AICC_POLICY_METHODS, ...AICC_ROUTING_METHODS, ...AICC_API_TOKEN_METHODS };
|
|
1505
1522
|
const AICC_FEATURES = {
|
|
1506
1523
|
PLAN: "plan",
|
|
1507
1524
|
TOOL_CALL: "tool_call",
|
|
@@ -1513,13 +1530,20 @@ const AICC_FEATURES = {
|
|
|
1513
1530
|
VIDEO_UNDERSTAND: "video_understand"
|
|
1514
1531
|
};
|
|
1515
1532
|
const AICC_EXECUTION_MODES = { IMMEDIATE: "immediate", STREAM: "stream" };
|
|
1516
|
-
const AICC_POLICY_REFUSAL_CODES = ["quota_exhausted", "
|
|
1533
|
+
const AICC_POLICY_REFUSAL_CODES = ["quota_exhausted", "credit_insufficient", "quota_unavailable", "resource_not_permitted", "attribution_unavailable"];
|
|
1517
1534
|
function aiccRefusalOf(error) {
|
|
1518
1535
|
if (!(error instanceof RPCError) || !AICC_POLICY_REFUSAL_CODES.includes(error.code))
|
|
1519
1536
|
return void 0;
|
|
1520
1537
|
const data = error.data;
|
|
1521
1538
|
return { code: error.code, message: (data == null ? void 0 : data.message) ?? error.message, retriable: data == null ? void 0 : data.retriable, details: data == null ? void 0 : data.details };
|
|
1522
1539
|
}
|
|
1540
|
+
const PROVIDER_ACCESS_DISABLED_REASON = "provider_access_disabled";
|
|
1541
|
+
const AICC_CONTRACT_VERSION = 1;
|
|
1542
|
+
const AICC_CONTRACT_VERSION_PARAM = "aicc_contract_version";
|
|
1543
|
+
const AICC_API_TOKEN_PREFIX = "bkai_";
|
|
1544
|
+
function isAiccApiTokenId(value) {
|
|
1545
|
+
return /^[0-9a-f]{16}$/.test(value);
|
|
1546
|
+
}
|
|
1523
1547
|
const AI_METHOD_SET = new Set(Object.values(AICC_AI_METHODS));
|
|
1524
1548
|
function isAiccAiMethod(method) {
|
|
1525
1549
|
return AI_METHOD_SET.has(method);
|
|
@@ -1573,12 +1597,8 @@ function strict(request, allowed) {
|
|
|
1573
1597
|
if (mode !== void 0 && mode !== AICC_EXECUTION_MODES.IMMEDIATE && mode !== AICC_EXECUTION_MODES.STREAM) {
|
|
1574
1598
|
throw new RPCError("execution_mode must be `immediate` or `stream`");
|
|
1575
1599
|
}
|
|
1576
|
-
const sessionId = request.session_id;
|
|
1577
|
-
if (sessionId !== void 0 && (typeof sessionId !== "string" || !sessionId.trim() || new TextEncoder().encode(sessionId).length > 512)) {
|
|
1578
|
-
throw new RPCError("session_id must contain 1..512 bytes");
|
|
1579
|
-
}
|
|
1580
1600
|
}
|
|
1581
|
-
const common = ["exact_model", "trace_id", "execution_mode", "idempotency_key", "task_options"
|
|
1601
|
+
const common = ["exact_model", "trace_id", "execution_mode", "idempotency_key", "task_options"];
|
|
1582
1602
|
const schemas = {
|
|
1583
1603
|
[AICC_AI_METHODS.CHAT_COMPLETIONS_CREATE]: [...common, "web_search", "messages", "tools", "response_format", "temperature", "top_p", "max_output_tokens", "seed", "stop", "output"],
|
|
1584
1604
|
[AICC_AI_METHODS.IMAGES_GENERATE]: [...common, "prompt", "negative_prompt", "n", "aspect_ratio", "size", "quality", "style", "seed", "output"],
|
|
@@ -1603,18 +1623,17 @@ const schemas = {
|
|
|
1603
1623
|
[AICC_AI_METHODS.VIDEO_EXTEND]: [...common, "video", "prompt", "continuation_handle", "duration_seconds", "resolution"],
|
|
1604
1624
|
[AICC_AI_METHODS.VIDEO_UPSCALE]: [...common, "video", "target_resolution", "denoise", "sharpen", "output"],
|
|
1605
1625
|
[AICC_AI_METHODS.AGENT_COMPUTER_USE]: [...common, "task", "environment", "allowed_actions"],
|
|
1606
|
-
[AICC_CORE_METHODS.ROUTE_RESOLVE]: ["trace_id", "execution_mode", "request_id", "api_type", "logical_model", "requirements", "disable", "policy", "estimated_input_tokens", "estimated_output_tokens", "
|
|
1607
|
-
[AICC_CORE_METHODS.HELPER_LLM_CHAT]: ["logical_model", "trace_id", "execution_mode", "requirements", "disable", "policy", "messages", "tools", "response_format", "temperature", "top_p", "max_output_tokens", "seed", "stop", "output", "idempotency_key", "task_options", "
|
|
1608
|
-
[AICC_CORE_METHODS.HELPER_TEXT_TO_IMAGE]: ["logical_model", "trace_id", "execution_mode", "requirements", "disable", "policy", "prompt", "negative_prompt", "n", "aspect_ratio", "size", "quality", "style", "seed", "output", "idempotency_key", "task_options", "
|
|
1609
|
-
[AICC_CORE_METHODS.HELPER_VIDEO_GENERATE]: ["logical_model", "trace_id", "execution_mode", "requirements", "disable", "policy", "prompt", "negative_prompt", "conditions", "output", "seed", "idempotency_key", "task_options", "
|
|
1626
|
+
[AICC_CORE_METHODS.ROUTE_RESOLVE]: ["trace_id", "execution_mode", "request_id", "api_type", "logical_model", "requirements", "disable", "policy", "estimated_input_tokens", "estimated_output_tokens", "route_group"],
|
|
1627
|
+
[AICC_CORE_METHODS.HELPER_LLM_CHAT]: ["logical_model", "trace_id", "execution_mode", "requirements", "disable", "policy", "messages", "tools", "response_format", "temperature", "top_p", "max_output_tokens", "seed", "stop", "output", "idempotency_key", "task_options", "route_group"],
|
|
1628
|
+
[AICC_CORE_METHODS.HELPER_TEXT_TO_IMAGE]: ["logical_model", "trace_id", "execution_mode", "requirements", "disable", "policy", "prompt", "negative_prompt", "n", "aspect_ratio", "size", "quality", "style", "seed", "output", "idempotency_key", "task_options", "route_group"],
|
|
1629
|
+
[AICC_CORE_METHODS.HELPER_VIDEO_GENERATE]: ["logical_model", "trace_id", "execution_mode", "requirements", "disable", "policy", "prompt", "negative_prompt", "conditions", "output", "seed", "idempotency_key", "task_options", "route_group"],
|
|
1610
1630
|
[AICC_CORE_METHODS.CANCEL]: ["task_id"],
|
|
1611
1631
|
[AICC_MANAGEMENT_METHODS.SERVICE_RELOAD_SETTINGS]: [],
|
|
1612
|
-
[AICC_MANAGEMENT_METHODS.QUOTA_QUERY]: ["app_id"],
|
|
1613
1632
|
[AICC_MANAGEMENT_METHODS.USAGE_QUERY]: ["time_range", "filters", "group_by", "time_bucket", "output_mode", "limit", "cursor", "zone_wide"],
|
|
1614
1633
|
[AICC_MANAGEMENT_METHODS.TRACE_QUERY]: ["limit", "cursor", "start_time_ms", "end_time_ms", "task_ids", "request_ids", "api_types", "provider_instance_names", "selected_exact_models", "scheduler_profiles", "query", "outcome"],
|
|
1615
1634
|
[AICC_MANAGEMENT_METHODS.ROUTING_GET]: [],
|
|
1616
1635
|
[AICC_MANAGEMENT_METHODS.ROUTING_PREVIEW]: ["paths", "explain", "requirements"],
|
|
1617
|
-
[AICC_MANAGEMENT_METHODS.ROUTING_UPDATE]: ["settings_revision", "provider_weights"],
|
|
1636
|
+
[AICC_MANAGEMENT_METHODS.ROUTING_UPDATE]: ["settings_revision", "provider_weights", "routing_commands"],
|
|
1618
1637
|
[AICC_MANAGEMENT_METHODS.PROVIDER_PREVIEW_RULES]: ["provider_instance_name", "rules_catalog", "model_ids"],
|
|
1619
1638
|
[AICC_MANAGEMENT_METHODS.PROVIDER_CATALOG]: [],
|
|
1620
1639
|
[AICC_MANAGEMENT_METHODS.PROTOCOL_ADAPTER_LIST]: [],
|
|
@@ -1622,7 +1641,7 @@ const schemas = {
|
|
|
1622
1641
|
[AICC_MANAGEMENT_METHODS.PROVIDER_ADD]: ["provider_instance_name", "provider_type", "provider_profile_id", "protocol_family_id", "protocol_adapter_id", "base_url", "credentials", "region", "workspace", "account", "provider_rules_id", "auth", "discovery", "instance_rules", "timeout_ms", "auto_sync_models"],
|
|
1623
1642
|
[AICC_MANAGEMENT_METHODS.PROVIDER_LIST]: ["method", "view"],
|
|
1624
1643
|
[AICC_MANAGEMENT_METHODS.PROVIDER_HEALTH]: ["exact_model"],
|
|
1625
|
-
[AICC_MANAGEMENT_METHODS.PROVIDER_UPDATE]: ["provider_rules_id", "provider_instance_name", "settings_revision", "enabled", "base_url", "credential", "provider_profile_id", "protocol_adapter_id", "discovery", "instance_rules"],
|
|
1644
|
+
[AICC_MANAGEMENT_METHODS.PROVIDER_UPDATE]: ["provider_rules_id", "provider_instance_name", "settings_revision", "enabled", "base_url", "credential", "provider_profile_id", "protocol_adapter_id", "discovery", "instance_rules", "marked_faulty"],
|
|
1626
1645
|
[AICC_MANAGEMENT_METHODS.PROVIDER_DELETE]: ["provider_instance_name"],
|
|
1627
1646
|
[AICC_MANAGEMENT_METHODS.PROVIDER_REFRESH_MODELS]: ["provider_instance_name"],
|
|
1628
1647
|
[AICC_MANAGEMENT_METHODS.MODELS_LIST]: ["view"],
|
|
@@ -1750,9 +1769,6 @@ class AiccClient {
|
|
|
1750
1769
|
reloadSettings() {
|
|
1751
1770
|
return this.call(AICC_MANAGEMENT_METHODS.SERVICE_RELOAD_SETTINGS, {});
|
|
1752
1771
|
}
|
|
1753
|
-
queryQuota(r = {}) {
|
|
1754
|
-
return this.call(AICC_MANAGEMENT_METHODS.QUOTA_QUERY, r);
|
|
1755
|
-
}
|
|
1756
1772
|
queryUsage(r) {
|
|
1757
1773
|
return this.call(AICC_MANAGEMENT_METHODS.USAGE_QUERY, r);
|
|
1758
1774
|
}
|
|
@@ -1802,41 +1818,87 @@ class AiccClient {
|
|
|
1802
1818
|
listModels(r = {}) {
|
|
1803
1819
|
return this.call(AICC_MANAGEMENT_METHODS.MODELS_LIST, r);
|
|
1804
1820
|
}
|
|
1805
|
-
|
|
1806
|
-
return this.call(
|
|
1821
|
+
listPolicies(r = {}) {
|
|
1822
|
+
return this.call(AICC_POLICY_METHODS.POLICY_LIST, r);
|
|
1823
|
+
}
|
|
1824
|
+
getPolicy(policyId) {
|
|
1825
|
+
return this.call(AICC_POLICY_METHODS.POLICY_GET, { policy_id: policyId });
|
|
1826
|
+
}
|
|
1827
|
+
upsertPolicy(r) {
|
|
1828
|
+
return this.call(AICC_POLICY_METHODS.POLICY_UPSERT, r);
|
|
1829
|
+
}
|
|
1830
|
+
deletePolicy(policyId, expectedVersion) {
|
|
1831
|
+
return this.call(AICC_POLICY_METHODS.POLICY_DELETE, { policy_id: policyId, expected_version: expectedVersion });
|
|
1832
|
+
}
|
|
1833
|
+
effectivePolicy(r = {}) {
|
|
1834
|
+
return this.call(AICC_POLICY_METHODS.POLICY_EFFECTIVE, r);
|
|
1835
|
+
}
|
|
1836
|
+
policyStatus(r = {}) {
|
|
1837
|
+
return this.call(AICC_POLICY_METHODS.POLICY_STATUS, r);
|
|
1838
|
+
}
|
|
1839
|
+
getPrices() {
|
|
1840
|
+
return this.call(AICC_POLICY_METHODS.PRICE_GET, {});
|
|
1841
|
+
}
|
|
1842
|
+
updatePrices(r) {
|
|
1843
|
+
return this.call(AICC_POLICY_METHODS.PRICE_UPDATE, r);
|
|
1844
|
+
}
|
|
1845
|
+
getCreditAccount(userId) {
|
|
1846
|
+
return this.call(AICC_POLICY_METHODS.CREDIT_ACCOUNT_GET, userId ? { user_id: userId } : {});
|
|
1807
1847
|
}
|
|
1808
|
-
|
|
1809
|
-
return this.call(
|
|
1848
|
+
listCreditAccounts(group) {
|
|
1849
|
+
return this.call(AICC_POLICY_METHODS.CREDIT_ACCOUNT_LIST, group ? { group } : {});
|
|
1810
1850
|
}
|
|
1811
|
-
|
|
1812
|
-
return this.call(
|
|
1851
|
+
listCreditLedger(r = {}) {
|
|
1852
|
+
return this.call(AICC_POLICY_METHODS.CREDIT_LEDGER_LIST, r);
|
|
1813
1853
|
}
|
|
1814
|
-
|
|
1815
|
-
return this.call(
|
|
1854
|
+
rechargeCredit(r) {
|
|
1855
|
+
return this.call(AICC_POLICY_METHODS.CREDIT_RECHARGE, r);
|
|
1816
1856
|
}
|
|
1817
|
-
|
|
1818
|
-
return this.call(
|
|
1857
|
+
getCreditRecharge(rechargeId) {
|
|
1858
|
+
return this.call(AICC_POLICY_METHODS.CREDIT_RECHARGE_GET, { recharge_id: rechargeId });
|
|
1819
1859
|
}
|
|
1820
|
-
|
|
1821
|
-
return this.call(
|
|
1860
|
+
adjustCredit(r) {
|
|
1861
|
+
return this.call(AICC_POLICY_METHODS.CREDIT_ADJUST, r);
|
|
1822
1862
|
}
|
|
1823
|
-
|
|
1824
|
-
return this.call(
|
|
1863
|
+
apiTokenCreate(r) {
|
|
1864
|
+
return this.call(AICC_API_TOKEN_METHODS.API_TOKEN_CREATE, r);
|
|
1825
1865
|
}
|
|
1826
|
-
|
|
1827
|
-
return this.call(
|
|
1866
|
+
apiTokenList(r = {}) {
|
|
1867
|
+
return this.call(AICC_API_TOKEN_METHODS.API_TOKEN_LIST, r);
|
|
1828
1868
|
}
|
|
1829
|
-
|
|
1830
|
-
return this.call(
|
|
1869
|
+
apiTokenRevoke(tokenId) {
|
|
1870
|
+
return this.call(AICC_API_TOKEN_METHODS.API_TOKEN_REVOKE, { token_id: tokenId });
|
|
1831
1871
|
}
|
|
1832
|
-
|
|
1833
|
-
|
|
1872
|
+
/** What another AICC lists as this AICC's models (`models.list` with `view: 'provider'`). */
|
|
1873
|
+
providerView() {
|
|
1874
|
+
return this.call(AICC_MANAGEMENT_METHODS.MODELS_LIST, { view: "provider" });
|
|
1834
1875
|
}
|
|
1835
|
-
|
|
1836
|
-
return this.call(
|
|
1876
|
+
getRoutingUsecases(r = {}) {
|
|
1877
|
+
return this.call(AICC_ROUTING_METHODS.ROUTING_USECASES, r);
|
|
1837
1878
|
}
|
|
1838
|
-
|
|
1839
|
-
return this.call(
|
|
1879
|
+
setRoutingUsecase(r) {
|
|
1880
|
+
return this.call(AICC_ROUTING_METHODS.ROUTING_USECASE_SET, r);
|
|
1881
|
+
}
|
|
1882
|
+
listRoutingGroups() {
|
|
1883
|
+
return this.call(AICC_ROUTING_METHODS.ROUTING_GROUPS_LIST, {});
|
|
1884
|
+
}
|
|
1885
|
+
createRoutingGroup(r) {
|
|
1886
|
+
return this.call(AICC_ROUTING_METHODS.ROUTING_GROUPS_CREATE, r);
|
|
1887
|
+
}
|
|
1888
|
+
updateRoutingGroup(r) {
|
|
1889
|
+
return this.call(AICC_ROUTING_METHODS.ROUTING_GROUPS_UPDATE, r);
|
|
1890
|
+
}
|
|
1891
|
+
deleteRoutingGroup(groupId, version2) {
|
|
1892
|
+
return this.call(AICC_ROUTING_METHODS.ROUTING_GROUPS_DELETE, { group_id: groupId, version: version2 });
|
|
1893
|
+
}
|
|
1894
|
+
listRoutingBindings() {
|
|
1895
|
+
return this.call(AICC_ROUTING_METHODS.ROUTING_BINDINGS_LIST, {});
|
|
1896
|
+
}
|
|
1897
|
+
setRoutingBinding(appId, groupId) {
|
|
1898
|
+
return this.call(AICC_ROUTING_METHODS.ROUTING_BINDINGS_SET, { app_id: appId, group_id: groupId });
|
|
1899
|
+
}
|
|
1900
|
+
removeRoutingBinding(appId) {
|
|
1901
|
+
return this.call(AICC_ROUTING_METHODS.ROUTING_BINDINGS_REMOVE, { app_id: appId });
|
|
1840
1902
|
}
|
|
1841
1903
|
getDriverMetadataUpdate() {
|
|
1842
1904
|
return this.call(AICC_MANAGEMENT_METHODS.DRIVER_METADATA_UPDATE_GET, {});
|
|
@@ -5254,6 +5316,7 @@ class BuckyOSSDK {
|
|
|
5254
5316
|
this.currentRuntime = null;
|
|
5255
5317
|
this.currentAccountInfo = null;
|
|
5256
5318
|
this.currentKEventClient = null;
|
|
5319
|
+
this.userPreferences = null;
|
|
5257
5320
|
this.target = target;
|
|
5258
5321
|
}
|
|
5259
5322
|
async initBuckyOS(appid = "", config = null) {
|
|
@@ -5351,6 +5414,31 @@ class BuckyOSSDK {
|
|
|
5351
5414
|
}
|
|
5352
5415
|
return this.currentRuntime.getCurrentIdentity();
|
|
5353
5416
|
}
|
|
5417
|
+
/**
|
|
5418
|
+
* The signed-in user's settings for this page: theme, colour, language and profile. In a host's frame (a Desktop
|
|
5419
|
+
* window, the BuckyOS client) the appearance is the host's; alone in a tab the Zone answers what this page may see
|
|
5420
|
+
* (an App: the appearance and the public profile; a system service's page: the private profile too). `{}` for a
|
|
5421
|
+
* guest, or when the Zone cannot be reached.
|
|
5422
|
+
*/
|
|
5423
|
+
async getUserPreferences() {
|
|
5424
|
+
return this.preferencesStore().get();
|
|
5425
|
+
}
|
|
5426
|
+
/** `listener` hears each change of `getUserPreferences` (the host's, or the Zone's read again whenever the page
|
|
5427
|
+
* comes back to the foreground); the returned function stops it. */
|
|
5428
|
+
onUserPreferencesChanged(listener) {
|
|
5429
|
+
return this.preferencesStore().subscribe(listener);
|
|
5430
|
+
}
|
|
5431
|
+
preferencesStore() {
|
|
5432
|
+
this.userPreferences ?? (this.userPreferences = new UserPreferencesStore(async () => {
|
|
5433
|
+
if (this.currentRuntime == null)
|
|
5434
|
+
return {};
|
|
5435
|
+
const identity = await this.getCurrentIdentity();
|
|
5436
|
+
if (identity.kind !== "account")
|
|
5437
|
+
return {};
|
|
5438
|
+
return readUserPreferences(await this.getServiceRpcClient("control-panel").call("user.preferences.get", {}));
|
|
5439
|
+
}));
|
|
5440
|
+
return this.userPreferences;
|
|
5441
|
+
}
|
|
5354
5442
|
async getAccountInfo() {
|
|
5355
5443
|
if (this.currentRuntime == null) {
|
|
5356
5444
|
console.error("BuckyOS WebSDK is not initialized,call initBuckyOS first");
|
|
@@ -5793,6 +5881,8 @@ function createSDKModule(target) {
|
|
|
5793
5881
|
setAppSetting: sdk.setAppSetting.bind(sdk),
|
|
5794
5882
|
getCurrentWalletUser: sdk.getCurrentWalletUser.bind(sdk),
|
|
5795
5883
|
getCurrentIdentity: sdk.getCurrentIdentity.bind(sdk),
|
|
5884
|
+
getUserPreferences: sdk.getUserPreferences.bind(sdk),
|
|
5885
|
+
onUserPreferencesChanged: sdk.onUserPreferencesChanged.bind(sdk),
|
|
5796
5886
|
resolve_did: sdk.resolve_did.bind(sdk),
|
|
5797
5887
|
walletSignWithActiveDid: sdk.walletSignWithActiveDid.bind(sdk),
|
|
5798
5888
|
openExternalUrl: sdk.openExternalUrl.bind(sdk),
|
|
@@ -32547,7 +32637,7 @@ export {
|
|
|
32547
32637
|
TASK_MANAGER_SERVICE_UNIQUE_ID as ay,
|
|
32548
32638
|
TASK_MANAGER_SERVICE_NAME as az,
|
|
32549
32639
|
bns_client as b,
|
|
32550
|
-
|
|
32640
|
+
aiccMessageTextContent as b$,
|
|
32551
32641
|
TASK_ERR_STALE_RUNNER_EPOCH as b0,
|
|
32552
32642
|
TASK_ERR_INVALID_PHASE as b1,
|
|
32553
32643
|
TASK_ERR_CONTROL_NOT_AVAILABLE as b2,
|
|
@@ -32570,21 +32660,21 @@ export {
|
|
|
32570
32660
|
AICC_AI_METHODS as bJ,
|
|
32571
32661
|
AICC_CORE_METHODS as bK,
|
|
32572
32662
|
AICC_MANAGEMENT_METHODS as bL,
|
|
32573
|
-
|
|
32574
|
-
|
|
32575
|
-
|
|
32576
|
-
|
|
32577
|
-
|
|
32578
|
-
|
|
32579
|
-
|
|
32580
|
-
|
|
32581
|
-
|
|
32582
|
-
|
|
32583
|
-
|
|
32584
|
-
|
|
32585
|
-
|
|
32586
|
-
|
|
32587
|
-
|
|
32663
|
+
AICC_POLICY_METHODS as bM,
|
|
32664
|
+
AICC_ROUTING_METHODS as bN,
|
|
32665
|
+
AICC_API_TOKEN_METHODS as bO,
|
|
32666
|
+
AICC_METHODS as bP,
|
|
32667
|
+
AICC_FEATURES as bQ,
|
|
32668
|
+
AICC_EXECUTION_MODES as bR,
|
|
32669
|
+
AICC_POLICY_REFUSAL_CODES as bS,
|
|
32670
|
+
aiccRefusalOf as bT,
|
|
32671
|
+
PROVIDER_ACCESS_DISABLED_REASON as bU,
|
|
32672
|
+
AICC_CONTRACT_VERSION as bV,
|
|
32673
|
+
AICC_CONTRACT_VERSION_PARAM as bW,
|
|
32674
|
+
AICC_API_TOKEN_PREFIX as bX,
|
|
32675
|
+
isAiccApiTokenId as bY,
|
|
32676
|
+
isAiccAiMethod as bZ,
|
|
32677
|
+
aiccTextMessage as b_,
|
|
32588
32678
|
taskMgrTaskEventPath as ba,
|
|
32589
32679
|
taskMgrTreeEventPath as bb,
|
|
32590
32680
|
taskMgrErrorCode as bc,
|
|
@@ -32612,69 +32702,76 @@ export {
|
|
|
32612
32702
|
WorkflowDefinitionStatus as by,
|
|
32613
32703
|
WorkflowRunStatus as bz,
|
|
32614
32704
|
createSDKModule as c,
|
|
32615
|
-
|
|
32616
|
-
|
|
32617
|
-
|
|
32618
|
-
|
|
32619
|
-
|
|
32620
|
-
|
|
32621
|
-
|
|
32622
|
-
|
|
32623
|
-
|
|
32624
|
-
|
|
32625
|
-
|
|
32626
|
-
|
|
32627
|
-
|
|
32628
|
-
|
|
32629
|
-
|
|
32630
|
-
|
|
32631
|
-
|
|
32632
|
-
|
|
32633
|
-
|
|
32634
|
-
|
|
32635
|
-
|
|
32636
|
-
|
|
32637
|
-
|
|
32638
|
-
|
|
32639
|
-
|
|
32640
|
-
|
|
32641
|
-
|
|
32642
|
-
|
|
32643
|
-
|
|
32644
|
-
|
|
32645
|
-
|
|
32646
|
-
|
|
32647
|
-
|
|
32648
|
-
|
|
32649
|
-
|
|
32650
|
-
|
|
32651
|
-
|
|
32652
|
-
|
|
32653
|
-
|
|
32654
|
-
|
|
32655
|
-
|
|
32656
|
-
|
|
32657
|
-
|
|
32658
|
-
|
|
32659
|
-
|
|
32660
|
-
|
|
32661
|
-
|
|
32662
|
-
|
|
32663
|
-
|
|
32664
|
-
|
|
32665
|
-
|
|
32666
|
-
|
|
32667
|
-
|
|
32668
|
-
|
|
32669
|
-
|
|
32670
|
-
|
|
32671
|
-
|
|
32672
|
-
|
|
32673
|
-
|
|
32674
|
-
|
|
32675
|
-
|
|
32676
|
-
|
|
32705
|
+
setProps as c$,
|
|
32706
|
+
aiccMessageFirstText as c0,
|
|
32707
|
+
validateAiccMessage as c1,
|
|
32708
|
+
AiccClient as c2,
|
|
32709
|
+
decisionRequirements as c3,
|
|
32710
|
+
validateDecisionRequest as c4,
|
|
32711
|
+
validateDecisionAnswers as c5,
|
|
32712
|
+
parseVideoPrompt as c6,
|
|
32713
|
+
validateVideoOutput as c7,
|
|
32714
|
+
validateVideoGeneration as c8,
|
|
32715
|
+
validateVideoEdit as c9,
|
|
32716
|
+
resumeRecording as cA,
|
|
32717
|
+
stopRecording as cB,
|
|
32718
|
+
getRecordingStatus as cC,
|
|
32719
|
+
listRecordings as cD,
|
|
32720
|
+
getRecording as cE,
|
|
32721
|
+
deleteRecording as cF,
|
|
32722
|
+
onRecordingState as cG,
|
|
32723
|
+
COMPUTER_SEMANTIC_FORMAT as cH,
|
|
32724
|
+
COMPUTER_ROLES as cI,
|
|
32725
|
+
COMPUTER_ELEMENT_STATES as cJ,
|
|
32726
|
+
COMPUTER_ELEMENT_ACTIONS as cK,
|
|
32727
|
+
ExecutorClient as cL,
|
|
32728
|
+
ExecutorStreamError as cM,
|
|
32729
|
+
encodeExecutorControl as cN,
|
|
32730
|
+
ExecutorCommandStream as cO,
|
|
32731
|
+
fieldNamed as cP,
|
|
32732
|
+
cellValue as cQ,
|
|
32733
|
+
tableInsert as cR,
|
|
32734
|
+
tableSet as cS,
|
|
32735
|
+
tableDelete as cT,
|
|
32736
|
+
fieldAdd as cU,
|
|
32737
|
+
optionAdd as cV,
|
|
32738
|
+
textAppend as cW,
|
|
32739
|
+
textReplaceBlock as cX,
|
|
32740
|
+
textDeleteBlocks as cY,
|
|
32741
|
+
rename as cZ,
|
|
32742
|
+
move as c_,
|
|
32743
|
+
videoGenerationRequirement as ca,
|
|
32744
|
+
KEventReader as cb,
|
|
32745
|
+
KEventClient as cc,
|
|
32746
|
+
appIdFromDid as cd,
|
|
32747
|
+
parseAppId as ce,
|
|
32748
|
+
appDidFromId as cf,
|
|
32749
|
+
createAppInstanceId as cg,
|
|
32750
|
+
parseAppInstanceId as ch,
|
|
32751
|
+
BNS_EVM_DEFAULT_GAS_LIMIT as ci,
|
|
32752
|
+
BNS_EVM_DEFAULT_MAX_FEE_PER_GAS as cj,
|
|
32753
|
+
BNS_EVM_DEFAULT_MAX_PRIORITY_FEE_PER_GAS as ck,
|
|
32754
|
+
BNS_MAX_INLINE_DOCUMENT_BYTES as cl,
|
|
32755
|
+
BNS_DNS_TXT_DEFAULT_TTL as cm,
|
|
32756
|
+
BNS_DNS_TXT_DOC_TYPE as cn,
|
|
32757
|
+
BNS_PUBLISH_DOCUMENT_ABI as co,
|
|
32758
|
+
BnsEvmTxError as cp,
|
|
32759
|
+
BnsEvmTxBuilder as cq,
|
|
32760
|
+
decodeBnsPublishDocumentCalldata as cr,
|
|
32761
|
+
BnsTxExecutorError as cs,
|
|
32762
|
+
walletUserHasSnAccount as ct,
|
|
32763
|
+
BnsTxExecutor as cu,
|
|
32764
|
+
audioCapabilities as cv,
|
|
32765
|
+
AudioError as cw,
|
|
32766
|
+
acquireBackgroundAudio as cx,
|
|
32767
|
+
startRecording as cy,
|
|
32768
|
+
pauseRecording as cz,
|
|
32677
32769
|
ndm_proxy as d,
|
|
32770
|
+
commitOps as d0,
|
|
32771
|
+
markdownToBlocks as d1,
|
|
32772
|
+
importFiles as d2,
|
|
32773
|
+
ensureUploaded as d3,
|
|
32774
|
+
releaseImportSession as d4,
|
|
32678
32775
|
createZoneClients as e,
|
|
32679
32776
|
bucket_client as f,
|
|
32680
32777
|
BS_SERVICE_TASK_MANAGER as g,
|
|
@@ -32698,4 +32795,4 @@ export {
|
|
|
32698
32795
|
NOTIFY_SESSION_PREFIX as y,
|
|
32699
32796
|
NOTIFY_CHOICE_CONTROL_ID as z
|
|
32700
32797
|
};
|
|
32701
|
-
//# sourceMappingURL=aiws_write-
|
|
32798
|
+
//# sourceMappingURL=aiws_write-5b542439.mjs.map
|